From 3e69d73ec970fd3d2fc1e2c2ce5f909b9c21fb72 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Tue, 7 Jul 2020 12:26:35 +0800 Subject: [PATCH 001/129] Update JS dependencies (#6867) * update JS dependencies * test js in circleci * remove js test in travis * remove node version --- .gitignore | 3 +- .../resources/Javascript/es6/package.mustache | 4 +- pom.xml | 4 +- .../petstore/javascript-es6/package-lock.json | 4560 ----------------- .../petstore/javascript-es6/package.json | 4 +- .../javascript-promise-es6/package-lock.json | 3395 ------------ .../javascript-promise-es6/package.json | 4 +- 7 files changed, 10 insertions(+), 7964 deletions(-) delete mode 100644 samples/client/petstore/javascript-es6/package-lock.json delete mode 100644 samples/client/petstore/javascript-promise-es6/package-lock.json diff --git a/.gitignore b/.gitignore index 2b1fa3629b05..4739673eb889 100644 --- a/.gitignore +++ b/.gitignore @@ -230,7 +230,8 @@ samples/client/petstore/dart/petstore/test/packages **/.dart_tool # JS -samples/client/petstore/javascript/package-lock.json +samples/client/petstore/javascript-es6/package-lock.json +samples/client/petstore/javascript-promise-es6/package-lock.json # elm samples/client/petstore/elm/index.html diff --git a/modules/openapi-generator/src/main/resources/Javascript/es6/package.mustache b/modules/openapi-generator/src/main/resources/Javascript/es6/package.mustache index 15a0a52fec63..53ee63d2bb15 100644 --- a/modules/openapi-generator/src/main/resources/Javascript/es6/package.mustache +++ b/modules/openapi-generator/src/main/resources/Javascript/es6/package.mustache @@ -19,7 +19,7 @@ {{/npmRepository}} "dependencies": { "@babel/cli": "^7.0.0", - "superagent": "3.7.0" + "superagent": "^5.3.0" }, "devDependencies": { "@babel/core": "^7.0.0", @@ -42,7 +42,7 @@ "@babel/preset-env": "^7.0.0", "@babel/register": "^7.0.0", "expect.js": "^0.3.1", - "mocha": "^5.2.0", + "mocha": "^8.0.1", "sinon": "^7.2.0" }, "files": [ diff --git a/pom.xml b/pom.xml index 18eca9b433ff..9786aabd6276 100644 --- a/pom.xml +++ b/pom.xml @@ -1194,8 +1194,6 @@ samples/client/petstore/rust/reqwest/petstore-async samples/client/petstore/php/OpenAPIClient-php - samples/client/petstore/javascript-es6 - samples/client/petstore/javascript-promise-es6 samples/client/petstore/javascript-flowtyped samples/client/petstore/python samples/client/petstore/python-experimental @@ -1334,6 +1332,8 @@ + samples/client/petstore/javascript-es6 + samples/client/petstore/javascript-promise-es6 samples/server/petstore/go-api-server samples/server/petstore/go-gin-api-server diff --git a/samples/client/petstore/javascript-es6/package-lock.json b/samples/client/petstore/javascript-es6/package-lock.json deleted file mode 100644 index 7ee41d741f2e..000000000000 --- a/samples/client/petstore/javascript-es6/package-lock.json +++ /dev/null @@ -1,4560 +0,0 @@ -{ - "name": "open_api_petstore", - "version": "1.0.0", - "lockfileVersion": 1, - "requires": true, - "dependencies": { - "@babel/cli": { - "version": "7.8.4", - "resolved": "https://registry.npmjs.org/@babel/cli/-/cli-7.8.4.tgz", - "integrity": "sha512-XXLgAm6LBbaNxaGhMAznXXaxtCWfuv6PIDJ9Alsy9JYTOh+j2jJz+L/162kkfU1j/pTSxK1xGmlwI4pdIMkoag==", - "requires": { - "chokidar": "^2.1.8", - "commander": "^4.0.1", - "convert-source-map": "^1.1.0", - "fs-readdir-recursive": "^1.1.0", - "glob": "^7.0.0", - "lodash": "^4.17.13", - "make-dir": "^2.1.0", - "slash": "^2.0.0", - "source-map": "^0.5.0" - }, - "dependencies": { - "anymatch": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-2.0.0.tgz", - "integrity": "sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw==", - "optional": true, - "requires": { - "micromatch": "^3.1.4", - "normalize-path": "^2.1.1" - }, - "dependencies": { - "normalize-path": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", - "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", - "optional": true, - "requires": { - "remove-trailing-separator": "^1.0.1" - } - } - } - }, - "arr-diff": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", - "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", - "optional": true - }, - "array-unique": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", - "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", - "optional": true - }, - "braces": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", - "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", - "optional": true, - "requires": { - "arr-flatten": "^1.1.0", - "array-unique": "^0.3.2", - "extend-shallow": "^2.0.1", - "fill-range": "^4.0.0", - "isobject": "^3.0.1", - "repeat-element": "^1.1.2", - "snapdragon": "^0.8.1", - "snapdragon-node": "^2.0.1", - "split-string": "^3.0.2", - "to-regex": "^3.0.1" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "optional": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "chokidar": { - "version": "2.1.8", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.1.8.tgz", - "integrity": "sha512-ZmZUazfOzf0Nve7duiCKD23PFSCs4JPoYyccjUFF3aQkQadqBhfzhjkwBH2mNOG9cTBwhamM37EIsIkZw3nRgg==", - "optional": true, - "requires": { - "anymatch": "^2.0.0", - "async-each": "^1.0.1", - "braces": "^2.3.2", - "fsevents": "^1.2.7", - "glob-parent": "^3.1.0", - "inherits": "^2.0.3", - "is-binary-path": "^1.0.0", - "is-glob": "^4.0.0", - "normalize-path": "^3.0.0", - "path-is-absolute": "^1.0.0", - "readdirp": "^2.2.1", - "upath": "^1.1.1" - } - }, - "commander": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-4.1.1.tgz", - "integrity": "sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==" - }, - "expand-brackets": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", - "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", - "optional": true, - "requires": { - "debug": "^2.3.3", - "define-property": "^0.2.5", - "extend-shallow": "^2.0.1", - "posix-character-classes": "^0.1.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "optional": true, - "requires": { - "is-descriptor": "^0.1.0" - } - }, - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "optional": true, - "requires": { - "is-extendable": "^0.1.0" - } - }, - "is-accessor-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", - "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", - "optional": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "optional": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "is-data-descriptor": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", - "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", - "optional": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "optional": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "is-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", - "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", - "optional": true, - "requires": { - "is-accessor-descriptor": "^0.1.6", - "is-data-descriptor": "^0.1.4", - "kind-of": "^5.0.0" - } - }, - "kind-of": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", - "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", - "optional": true - } - } - }, - "extglob": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", - "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", - "optional": true, - "requires": { - "array-unique": "^0.3.2", - "define-property": "^1.0.0", - "expand-brackets": "^2.1.4", - "extend-shallow": "^2.0.1", - "fragment-cache": "^0.2.1", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" - }, - "dependencies": { - "define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", - "optional": true, - "requires": { - "is-descriptor": "^1.0.0" - } - }, - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "optional": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "fill-range": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", - "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", - "optional": true, - "requires": { - "extend-shallow": "^2.0.1", - "is-number": "^3.0.0", - "repeat-string": "^1.6.1", - "to-regex-range": "^2.1.0" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "optional": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "glob-parent": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", - "integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=", - "optional": true, - "requires": { - "is-glob": "^3.1.0", - "path-dirname": "^1.0.0" - }, - "dependencies": { - "is-glob": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", - "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", - "optional": true, - "requires": { - "is-extglob": "^2.1.0" - } - } - } - }, - "is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "optional": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "optional": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "optional": true, - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - } - }, - "is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", - "optional": true - }, - "is-glob": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", - "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", - "optional": true, - "requires": { - "is-extglob": "^2.1.1" - } - }, - "is-number": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", - "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", - "optional": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "optional": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", - "optional": true - }, - "kind-of": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", - "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", - "optional": true - }, - "lodash": { - "version": "4.17.15", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", - "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==" - }, - "micromatch": { - "version": "3.1.10", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", - "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", - "optional": true, - "requires": { - "arr-diff": "^4.0.0", - "array-unique": "^0.3.2", - "braces": "^2.3.1", - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "extglob": "^2.0.4", - "fragment-cache": "^0.2.1", - "kind-of": "^6.0.2", - "nanomatch": "^1.2.9", - "object.pick": "^1.3.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.2" - } - }, - "normalize-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", - "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", - "optional": true - }, - "slash": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-2.0.0.tgz", - "integrity": "sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A==" - } - } - }, - "@babel/code-frame": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.8.3.tgz", - "integrity": "sha512-a9gxpmdXtZEInkCSHUJDLHZVBgb1QS0jhss4cPP93EW7s+uC5bikET2twEF3KV+7rDblJcmNvTR7VJejqd2C2g==", - "dev": true, - "requires": { - "@babel/highlight": "^7.8.3" - } - }, - "@babel/compat-data": { - "version": "7.9.6", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.9.6.tgz", - "integrity": "sha512-5QPTrNen2bm7RBc7dsOmcA5hbrS4O2Vhmk5XOL4zWW/zD/hV0iinpefDlkm+tBBy8kDtFaaeEvmAqt+nURAV2g==", - "dev": true, - "requires": { - "browserslist": "^4.11.1", - "invariant": "^2.2.4", - "semver": "^5.5.0" - }, - "dependencies": { - "browserslist": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.12.0.tgz", - "integrity": "sha512-UH2GkcEDSI0k/lRkuDSzFl9ZZ87skSy9w2XAn1MsZnL+4c4rqbBd3e82UWHbYDpztABrPBhZsTEeuxVfHppqDg==", - "dev": true, - "requires": { - "caniuse-lite": "^1.0.30001043", - "electron-to-chromium": "^1.3.413", - "node-releases": "^1.1.53", - "pkg-up": "^2.0.0" - } - }, - "caniuse-lite": { - "version": "1.0.30001064", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001064.tgz", - "integrity": "sha512-hdBcQMFvJIrOhkpAZiRXz04Cmetwc9NekeuNl0qZfHOugxOhJKxsjF1RmISMPFjIF4PPx1reliIzbfN42EiQ5A==", - "dev": true - }, - "electron-to-chromium": { - "version": "1.3.451", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.451.tgz", - "integrity": "sha512-2fvco0F2bBIgqzO8GRP0Jt/91pdrf9KfZ5FsmkYkjERmIJG585cFeFZV4+CO6oTmU3HmCTgfcZuEa7kW8VUh3A==", - "dev": true - } - } - }, - "@babel/core": { - "version": "7.9.6", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.9.6.tgz", - "integrity": "sha512-nD3deLvbsApbHAHttzIssYqgb883yU/d9roe4RZymBCDaZryMJDbptVpEpeQuRh4BJ+SYI8le9YGxKvFEvl1Wg==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.8.3", - "@babel/generator": "^7.9.6", - "@babel/helper-module-transforms": "^7.9.0", - "@babel/helpers": "^7.9.6", - "@babel/parser": "^7.9.6", - "@babel/template": "^7.8.6", - "@babel/traverse": "^7.9.6", - "@babel/types": "^7.9.6", - "convert-source-map": "^1.7.0", - "debug": "^4.1.0", - "gensync": "^1.0.0-beta.1", - "json5": "^2.1.2", - "lodash": "^4.17.13", - "resolve": "^1.3.2", - "semver": "^5.4.1", - "source-map": "^0.5.0" - }, - "dependencies": { - "convert-source-map": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.7.0.tgz", - "integrity": "sha512-4FJkXzKXEDB1snCFZlLP4gpC3JILicCpGbzG9f9G7tGqGCzETQ2hWPrcinA9oU4wtf2biUaEH5065UnMeR33oA==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.1" - } - }, - "debug": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", - "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", - "dev": true, - "requires": { - "ms": "^2.1.1" - } - }, - "json5": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.1.3.tgz", - "integrity": "sha512-KXPvOm8K9IJKFM0bmdn8QXh7udDh1g/giieX0NLCaMnb4hEiVFqnop2ImTXCc5e0/oHz3LTqmHGtExn5hfMkOA==", - "dev": true, - "requires": { - "minimist": "^1.2.5" - } - }, - "lodash": { - "version": "4.17.15", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", - "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", - "dev": true - }, - "minimist": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", - "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", - "dev": true - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - } - } - }, - "@babel/generator": { - "version": "7.9.6", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.9.6.tgz", - "integrity": "sha512-+htwWKJbH2bL72HRluF8zumBxzuX0ZZUFl3JLNyoUjM/Ho8wnVpPXM6aUz8cfKDqQ/h7zHqKt4xzJteUosckqQ==", - "dev": true, - "requires": { - "@babel/types": "^7.9.6", - "jsesc": "^2.5.1", - "lodash": "^4.17.13", - "source-map": "^0.5.0" - }, - "dependencies": { - "jsesc": { - "version": "2.5.2", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", - "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", - "dev": true - }, - "lodash": { - "version": "4.17.15", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", - "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", - "dev": true - } - } - }, - "@babel/helper-annotate-as-pure": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.8.3.tgz", - "integrity": "sha512-6o+mJrZBxOoEX77Ezv9zwW7WV8DdluouRKNY/IR5u/YTMuKHgugHOzYWlYvYLpLA9nPsQCAAASpCIbjI9Mv+Uw==", - "dev": true, - "requires": { - "@babel/types": "^7.8.3" - } - }, - "@babel/helper-builder-binary-assignment-operator-visitor": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.8.3.tgz", - "integrity": "sha512-5eFOm2SyFPK4Rh3XMMRDjN7lBH0orh3ss0g3rTYZnBQ+r6YPj7lgDyCvPphynHvUrobJmeMignBr6Acw9mAPlw==", - "dev": true, - "requires": { - "@babel/helper-explode-assignable-expression": "^7.8.3", - "@babel/types": "^7.8.3" - } - }, - "@babel/helper-compilation-targets": { - "version": "7.9.6", - "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.9.6.tgz", - "integrity": "sha512-x2Nvu0igO0ejXzx09B/1fGBxY9NXQlBW2kZsSxCJft+KHN8t9XWzIvFxtPHnBOAXpVsdxZKZFbRUC8TsNKajMw==", - "dev": true, - "requires": { - "@babel/compat-data": "^7.9.6", - "browserslist": "^4.11.1", - "invariant": "^2.2.4", - "levenary": "^1.1.1", - "semver": "^5.5.0" - }, - "dependencies": { - "browserslist": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.12.0.tgz", - "integrity": "sha512-UH2GkcEDSI0k/lRkuDSzFl9ZZ87skSy9w2XAn1MsZnL+4c4rqbBd3e82UWHbYDpztABrPBhZsTEeuxVfHppqDg==", - "dev": true, - "requires": { - "caniuse-lite": "^1.0.30001043", - "electron-to-chromium": "^1.3.413", - "node-releases": "^1.1.53", - "pkg-up": "^2.0.0" - } - }, - "caniuse-lite": { - "version": "1.0.30001064", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001064.tgz", - "integrity": "sha512-hdBcQMFvJIrOhkpAZiRXz04Cmetwc9NekeuNl0qZfHOugxOhJKxsjF1RmISMPFjIF4PPx1reliIzbfN42EiQ5A==", - "dev": true - }, - "electron-to-chromium": { - "version": "1.3.451", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.451.tgz", - "integrity": "sha512-2fvco0F2bBIgqzO8GRP0Jt/91pdrf9KfZ5FsmkYkjERmIJG585cFeFZV4+CO6oTmU3HmCTgfcZuEa7kW8VUh3A==", - "dev": true - } - } - }, - "@babel/helper-create-class-features-plugin": { - "version": "7.9.6", - "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.9.6.tgz", - "integrity": "sha512-6N9IeuyHvMBRyjNYOMJHrhwtu4WJMrYf8hVbEHD3pbbbmNOk1kmXSQs7bA4dYDUaIx4ZEzdnvo6NwC3WHd/Qow==", - "dev": true, - "requires": { - "@babel/helper-function-name": "^7.9.5", - "@babel/helper-member-expression-to-functions": "^7.8.3", - "@babel/helper-optimise-call-expression": "^7.8.3", - "@babel/helper-plugin-utils": "^7.8.3", - "@babel/helper-replace-supers": "^7.9.6", - "@babel/helper-split-export-declaration": "^7.8.3" - } - }, - "@babel/helper-create-regexp-features-plugin": { - "version": "7.8.8", - "resolved": "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.8.8.tgz", - "integrity": "sha512-LYVPdwkrQEiX9+1R29Ld/wTrmQu1SSKYnuOk3g0CkcZMA1p0gsNxJFj/3gBdaJ7Cg0Fnek5z0DsMULePP7Lrqg==", - "dev": true, - "requires": { - "@babel/helper-annotate-as-pure": "^7.8.3", - "@babel/helper-regex": "^7.8.3", - "regexpu-core": "^4.7.0" - }, - "dependencies": { - "jsesc": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", - "integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=", - "dev": true - }, - "regexpu-core": { - "version": "4.7.0", - "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-4.7.0.tgz", - "integrity": "sha512-TQ4KXRnIn6tz6tjnrXEkD/sshygKH/j5KzK86X8MkeHyZ8qst/LZ89j3X4/8HEIfHANTFIP/AbXakeRhWIl5YQ==", - "dev": true, - "requires": { - "regenerate": "^1.4.0", - "regenerate-unicode-properties": "^8.2.0", - "regjsgen": "^0.5.1", - "regjsparser": "^0.6.4", - "unicode-match-property-ecmascript": "^1.0.4", - "unicode-match-property-value-ecmascript": "^1.2.0" - } - }, - "regjsgen": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.5.1.tgz", - "integrity": "sha512-5qxzGZjDs9w4tzT3TPhCJqWdCc3RLYwy9J2NB0nm5Lz+S273lvWcpjaTGHsT1dc6Hhfq41uSEOw8wBmxrKOuyg==", - "dev": true - }, - "regjsparser": { - "version": "0.6.4", - "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.6.4.tgz", - "integrity": "sha512-64O87/dPDgfk8/RQqC4gkZoGyyWFIEUTTh80CU6CWuK5vkCGyekIx+oKcEIYtP/RAxSQltCZHCNu/mdd7fqlJw==", - "dev": true, - "requires": { - "jsesc": "~0.5.0" - } - } - } - }, - "@babel/helper-define-map": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-define-map/-/helper-define-map-7.8.3.tgz", - "integrity": "sha512-PoeBYtxoZGtct3md6xZOCWPcKuMuk3IHhgxsRRNtnNShebf4C8YonTSblsK4tvDbm+eJAw2HAPOfCr+Q/YRG/g==", - "dev": true, - "requires": { - "@babel/helper-function-name": "^7.8.3", - "@babel/types": "^7.8.3", - "lodash": "^4.17.13" - }, - "dependencies": { - "lodash": { - "version": "4.17.15", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", - "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", - "dev": true - } - } - }, - "@babel/helper-explode-assignable-expression": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.8.3.tgz", - "integrity": "sha512-N+8eW86/Kj147bO9G2uclsg5pwfs/fqqY5rwgIL7eTBklgXjcOJ3btzS5iM6AitJcftnY7pm2lGsrJVYLGjzIw==", - "dev": true, - "requires": { - "@babel/traverse": "^7.8.3", - "@babel/types": "^7.8.3" - } - }, - "@babel/helper-function-name": { - "version": "7.9.5", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.9.5.tgz", - "integrity": "sha512-JVcQZeXM59Cd1qanDUxv9fgJpt3NeKUaqBqUEvfmQ+BCOKq2xUgaWZW2hr0dkbyJgezYuplEoh5knmrnS68efw==", - "dev": true, - "requires": { - "@babel/helper-get-function-arity": "^7.8.3", - "@babel/template": "^7.8.3", - "@babel/types": "^7.9.5" - } - }, - "@babel/helper-get-function-arity": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.8.3.tgz", - "integrity": "sha512-FVDR+Gd9iLjUMY1fzE2SR0IuaJToR4RkCDARVfsBBPSP53GEqSFjD8gNyxg246VUyc/ALRxFaAK8rVG7UT7xRA==", - "dev": true, - "requires": { - "@babel/types": "^7.8.3" - } - }, - "@babel/helper-hoist-variables": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.8.3.tgz", - "integrity": "sha512-ky1JLOjcDUtSc+xkt0xhYff7Z6ILTAHKmZLHPxAhOP0Nd77O+3nCsd6uSVYur6nJnCI029CrNbYlc0LoPfAPQg==", - "dev": true, - "requires": { - "@babel/types": "^7.8.3" - } - }, - "@babel/helper-member-expression-to-functions": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.8.3.tgz", - "integrity": "sha512-fO4Egq88utkQFjbPrSHGmGLFqmrshs11d46WI+WZDESt7Wu7wN2G2Iu+NMMZJFDOVRHAMIkB5SNh30NtwCA7RA==", - "dev": true, - "requires": { - "@babel/types": "^7.8.3" - } - }, - "@babel/helper-module-imports": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.8.3.tgz", - "integrity": "sha512-R0Bx3jippsbAEtzkpZ/6FIiuzOURPcMjHp+Z6xPe6DtApDJx+w7UYyOLanZqO8+wKR9G10s/FmHXvxaMd9s6Kg==", - "dev": true, - "requires": { - "@babel/types": "^7.8.3" - } - }, - "@babel/helper-module-transforms": { - "version": "7.9.0", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.9.0.tgz", - "integrity": "sha512-0FvKyu0gpPfIQ8EkxlrAydOWROdHpBmiCiRwLkUiBGhCUPRRbVD2/tm3sFr/c/GWFrQ/ffutGUAnx7V0FzT2wA==", - "dev": true, - "requires": { - "@babel/helper-module-imports": "^7.8.3", - "@babel/helper-replace-supers": "^7.8.6", - "@babel/helper-simple-access": "^7.8.3", - "@babel/helper-split-export-declaration": "^7.8.3", - "@babel/template": "^7.8.6", - "@babel/types": "^7.9.0", - "lodash": "^4.17.13" - }, - "dependencies": { - "lodash": { - "version": "4.17.15", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", - "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", - "dev": true - } - } - }, - "@babel/helper-optimise-call-expression": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.8.3.tgz", - "integrity": "sha512-Kag20n86cbO2AvHca6EJsvqAd82gc6VMGule4HwebwMlwkpXuVqrNRj6CkCV2sKxgi9MyAUnZVnZ6lJ1/vKhHQ==", - "dev": true, - "requires": { - "@babel/types": "^7.8.3" - } - }, - "@babel/helper-plugin-utils": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.8.3.tgz", - "integrity": "sha512-j+fq49Xds2smCUNYmEHF9kGNkhbet6yVIBp4e6oeQpH1RUs/Ir06xUKzDjDkGcaaokPiTNs2JBWHjaE4csUkZQ==", - "dev": true - }, - "@babel/helper-regex": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-regex/-/helper-regex-7.8.3.tgz", - "integrity": "sha512-BWt0QtYv/cg/NecOAZMdcn/waj/5P26DR4mVLXfFtDokSR6fyuG0Pj+e2FqtSME+MqED1khnSMulkmGl8qWiUQ==", - "dev": true, - "requires": { - "lodash": "^4.17.13" - }, - "dependencies": { - "lodash": { - "version": "4.17.15", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", - "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", - "dev": true - } - } - }, - "@babel/helper-remap-async-to-generator": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.8.3.tgz", - "integrity": "sha512-kgwDmw4fCg7AVgS4DukQR/roGp+jP+XluJE5hsRZwxCYGg+Rv9wSGErDWhlI90FODdYfd4xG4AQRiMDjjN0GzA==", - "dev": true, - "requires": { - "@babel/helper-annotate-as-pure": "^7.8.3", - "@babel/helper-wrap-function": "^7.8.3", - "@babel/template": "^7.8.3", - "@babel/traverse": "^7.8.3", - "@babel/types": "^7.8.3" - } - }, - "@babel/helper-replace-supers": { - "version": "7.9.6", - "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.9.6.tgz", - "integrity": "sha512-qX+chbxkbArLyCImk3bWV+jB5gTNU/rsze+JlcF6Nf8tVTigPJSI1o1oBow/9Resa1yehUO9lIipsmu9oG4RzA==", - "dev": true, - "requires": { - "@babel/helper-member-expression-to-functions": "^7.8.3", - "@babel/helper-optimise-call-expression": "^7.8.3", - "@babel/traverse": "^7.9.6", - "@babel/types": "^7.9.6" - } - }, - "@babel/helper-simple-access": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.8.3.tgz", - "integrity": "sha512-VNGUDjx5cCWg4vvCTR8qQ7YJYZ+HBjxOgXEl7ounz+4Sn7+LMD3CFrCTEU6/qXKbA2nKg21CwhhBzO0RpRbdCw==", - "dev": true, - "requires": { - "@babel/template": "^7.8.3", - "@babel/types": "^7.8.3" - } - }, - "@babel/helper-split-export-declaration": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.8.3.tgz", - "integrity": "sha512-3x3yOeyBhW851hroze7ElzdkeRXQYQbFIb7gLK1WQYsw2GWDay5gAJNw1sWJ0VFP6z5J1whqeXH/WCdCjZv6dA==", - "dev": true, - "requires": { - "@babel/types": "^7.8.3" - } - }, - "@babel/helper-validator-identifier": { - "version": "7.9.5", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.9.5.tgz", - "integrity": "sha512-/8arLKUFq882w4tWGj9JYzRpAlZgiWUJ+dtteNTDqrRBz9Iguck9Rn3ykuBDoUwh2TO4tSAJlrxDUOXWklJe4g==", - "dev": true - }, - "@babel/helper-wrap-function": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.8.3.tgz", - "integrity": "sha512-LACJrbUET9cQDzb6kG7EeD7+7doC3JNvUgTEQOx2qaO1fKlzE/Bf05qs9w1oXQMmXlPO65lC3Tq9S6gZpTErEQ==", - "dev": true, - "requires": { - "@babel/helper-function-name": "^7.8.3", - "@babel/template": "^7.8.3", - "@babel/traverse": "^7.8.3", - "@babel/types": "^7.8.3" - } - }, - "@babel/helpers": { - "version": "7.9.6", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.9.6.tgz", - "integrity": "sha512-tI4bUbldloLcHWoRUMAj4g1bF313M/o6fBKhIsb3QnGVPwRm9JsNf/gqMkQ7zjqReABiffPV6RWj7hEglID5Iw==", - "dev": true, - "requires": { - "@babel/template": "^7.8.3", - "@babel/traverse": "^7.9.6", - "@babel/types": "^7.9.6" - } - }, - "@babel/highlight": { - "version": "7.9.0", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.9.0.tgz", - "integrity": "sha512-lJZPilxX7Op3Nv/2cvFdnlepPXDxi29wxteT57Q965oc5R9v86ztx0jfxVrTcBk8C2kcPkkDa2Z4T3ZsPPVWsQ==", - "dev": true, - "requires": { - "@babel/helper-validator-identifier": "^7.9.0", - "chalk": "^2.0.0", - "js-tokens": "^4.0.0" - }, - "dependencies": { - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "js-tokens": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", - "dev": true - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - } - } - }, - "@babel/parser": { - "version": "7.9.6", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.9.6.tgz", - "integrity": "sha512-AoeIEJn8vt+d/6+PXDRPaksYhnlbMIiejioBZvvMQsOjW/JYK6k/0dKnvvP3EhK5GfMBWDPtrxRtegWdAcdq9Q==", - "dev": true - }, - "@babel/plugin-proposal-async-generator-functions": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.8.3.tgz", - "integrity": "sha512-NZ9zLv848JsV3hs8ryEh7Uaz/0KsmPLqv0+PdkDJL1cJy0K4kOCFa8zc1E3mp+RHPQcpdfb/6GovEsW4VDrOMw==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.3", - "@babel/helper-remap-async-to-generator": "^7.8.3", - "@babel/plugin-syntax-async-generators": "^7.8.0" - } - }, - "@babel/plugin-proposal-class-properties": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.8.3.tgz", - "integrity": "sha512-EqFhbo7IosdgPgZggHaNObkmO1kNUe3slaKu54d5OWvy+p9QIKOzK1GAEpAIsZtWVtPXUHSMcT4smvDrCfY4AA==", - "dev": true, - "requires": { - "@babel/helper-create-class-features-plugin": "^7.8.3", - "@babel/helper-plugin-utils": "^7.8.3" - } - }, - "@babel/plugin-proposal-decorators": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-decorators/-/plugin-proposal-decorators-7.8.3.tgz", - "integrity": "sha512-e3RvdvS4qPJVTe288DlXjwKflpfy1hr0j5dz5WpIYYeP7vQZg2WfAEIp8k5/Lwis/m5REXEteIz6rrcDtXXG7w==", - "dev": true, - "requires": { - "@babel/helper-create-class-features-plugin": "^7.8.3", - "@babel/helper-plugin-utils": "^7.8.3", - "@babel/plugin-syntax-decorators": "^7.8.3" - } - }, - "@babel/plugin-proposal-do-expressions": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-do-expressions/-/plugin-proposal-do-expressions-7.8.3.tgz", - "integrity": "sha512-NoMcN+0+SS1DVswjDCfz+Jfm9ViOYuFtv1lm0QInEugbEXK2iH3jeSq38WmIiTP+2QKqo2zt8xku77gqHINZkw==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.3", - "@babel/plugin-syntax-do-expressions": "^7.8.3" - } - }, - "@babel/plugin-proposal-dynamic-import": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-dynamic-import/-/plugin-proposal-dynamic-import-7.8.3.tgz", - "integrity": "sha512-NyaBbyLFXFLT9FP+zk0kYlUlA8XtCUbehs67F0nnEg7KICgMc2mNkIeu9TYhKzyXMkrapZFwAhXLdnt4IYHy1w==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.3", - "@babel/plugin-syntax-dynamic-import": "^7.8.0" - } - }, - "@babel/plugin-proposal-export-default-from": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-export-default-from/-/plugin-proposal-export-default-from-7.8.3.tgz", - "integrity": "sha512-PYtv2S2OdCdp7GSPDg5ndGZFm9DmWFvuLoS5nBxZCgOBggluLnhTScspJxng96alHQzPyrrHxvC9/w4bFuspeA==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.3", - "@babel/plugin-syntax-export-default-from": "^7.8.3" - } - }, - "@babel/plugin-proposal-export-namespace-from": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-export-namespace-from/-/plugin-proposal-export-namespace-from-7.8.3.tgz", - "integrity": "sha512-WKK+9jz6TWUTX1uej9/EUVOmM1sK7aHv6bZyxbUV3NJjbiIZRqJITeXGMo7D631J72PEnIORh5VOlFCSlrLicg==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.3", - "@babel/plugin-syntax-export-namespace-from": "^7.8.3" - } - }, - "@babel/plugin-proposal-function-bind": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-function-bind/-/plugin-proposal-function-bind-7.8.3.tgz", - "integrity": "sha512-6q7VAHJQa9x4P6Lm6h6KHoJUEhx2r1buFKseHICe0ogb1LWxducO4tsQp3hd/7BVBo485YBsn6tJnpuwWm/9cA==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.3", - "@babel/plugin-syntax-function-bind": "^7.8.3" - } - }, - "@babel/plugin-proposal-function-sent": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-function-sent/-/plugin-proposal-function-sent-7.8.3.tgz", - "integrity": "sha512-lu9wQjLnXd6Zy6eBKr0gE175xfD+da1rv2wOWEnZlD5KIxl894Tg34ppZ7ANR0jzQJMn+7pGuzSdy6JK4zGtKg==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.3", - "@babel/helper-wrap-function": "^7.8.3", - "@babel/plugin-syntax-function-sent": "^7.8.3" - } - }, - "@babel/plugin-proposal-json-strings": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.8.3.tgz", - "integrity": "sha512-KGhQNZ3TVCQG/MjRbAUwuH+14y9q0tpxs1nWWs3pbSleRdDro9SAMMDyye8HhY1gqZ7/NqIc8SKhya0wRDgP1Q==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.3", - "@babel/plugin-syntax-json-strings": "^7.8.0" - } - }, - "@babel/plugin-proposal-logical-assignment-operators": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-logical-assignment-operators/-/plugin-proposal-logical-assignment-operators-7.8.3.tgz", - "integrity": "sha512-TLPLojGZYBeeoesO2NQIMLUJKD9N5oJlxG6iHLx7l7EvNQP5DfzeyxdI2lMPo5I7ih4Jv/vxrlwIPf6aJw422Q==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.3", - "@babel/plugin-syntax-logical-assignment-operators": "^7.8.3" - } - }, - "@babel/plugin-proposal-nullish-coalescing-operator": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-nullish-coalescing-operator/-/plugin-proposal-nullish-coalescing-operator-7.8.3.tgz", - "integrity": "sha512-TS9MlfzXpXKt6YYomudb/KU7nQI6/xnapG6in1uZxoxDghuSMZsPb6D2fyUwNYSAp4l1iR7QtFOjkqcRYcUsfw==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.3", - "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.0" - } - }, - "@babel/plugin-proposal-numeric-separator": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-numeric-separator/-/plugin-proposal-numeric-separator-7.8.3.tgz", - "integrity": "sha512-jWioO1s6R/R+wEHizfaScNsAx+xKgwTLNXSh7tTC4Usj3ItsPEhYkEpU4h+lpnBwq7NBVOJXfO6cRFYcX69JUQ==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.3", - "@babel/plugin-syntax-numeric-separator": "^7.8.3" - } - }, - "@babel/plugin-proposal-object-rest-spread": { - "version": "7.9.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.9.6.tgz", - "integrity": "sha512-Ga6/fhGqA9Hj+y6whNpPv8psyaK5xzrQwSPsGPloVkvmH+PqW1ixdnfJ9uIO06OjQNYol3PMnfmJ8vfZtkzF+A==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.3", - "@babel/plugin-syntax-object-rest-spread": "^7.8.0", - "@babel/plugin-transform-parameters": "^7.9.5" - } - }, - "@babel/plugin-proposal-optional-catch-binding": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.8.3.tgz", - "integrity": "sha512-0gkX7J7E+AtAw9fcwlVQj8peP61qhdg/89D5swOkjYbkboA2CVckn3kiyum1DE0wskGb7KJJxBdyEBApDLLVdw==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.3", - "@babel/plugin-syntax-optional-catch-binding": "^7.8.0" - } - }, - "@babel/plugin-proposal-optional-chaining": { - "version": "7.9.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.9.0.tgz", - "integrity": "sha512-NDn5tu3tcv4W30jNhmc2hyD5c56G6cXx4TesJubhxrJeCvuuMpttxr0OnNCqbZGhFjLrg+NIhxxC+BK5F6yS3w==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.3", - "@babel/plugin-syntax-optional-chaining": "^7.8.0" - } - }, - "@babel/plugin-proposal-pipeline-operator": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-pipeline-operator/-/plugin-proposal-pipeline-operator-7.8.3.tgz", - "integrity": "sha512-Z0qV3aUYoLUAnVLdfLTlz/GJYfcrbX7Mhrp897Twik29wQseAFAAXQ4TPvN1oswVBHdN74sLPIn9HVfTXtjuQA==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.3", - "@babel/plugin-syntax-pipeline-operator": "^7.8.3" - } - }, - "@babel/plugin-proposal-throw-expressions": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-throw-expressions/-/plugin-proposal-throw-expressions-7.8.3.tgz", - "integrity": "sha512-tH40s9JnoR+r45ZXKWW+PC5xzPQfVJix3pR1D8Ty5l9sn5NnrbZUzw8MtnNxu/Bz7p0imyeSYj9FQVccEymOEg==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.3", - "@babel/plugin-syntax-throw-expressions": "^7.8.3" - } - }, - "@babel/plugin-proposal-unicode-property-regex": { - "version": "7.8.8", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.8.8.tgz", - "integrity": "sha512-EVhjVsMpbhLw9ZfHWSx2iy13Q8Z/eg8e8ccVWt23sWQK5l1UdkoLJPN5w69UA4uITGBnEZD2JOe4QOHycYKv8A==", - "dev": true, - "requires": { - "@babel/helper-create-regexp-features-plugin": "^7.8.8", - "@babel/helper-plugin-utils": "^7.8.3" - } - }, - "@babel/plugin-syntax-async-generators": { - "version": "7.8.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz", - "integrity": "sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.0" - } - }, - "@babel/plugin-syntax-decorators": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-decorators/-/plugin-syntax-decorators-7.8.3.tgz", - "integrity": "sha512-8Hg4dNNT9/LcA1zQlfwuKR8BUc/if7Q7NkTam9sGTcJphLwpf2g4S42uhspQrIrR+dpzE0dtTqBVFoHl8GtnnQ==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.3" - } - }, - "@babel/plugin-syntax-do-expressions": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-do-expressions/-/plugin-syntax-do-expressions-7.8.3.tgz", - "integrity": "sha512-puRiUTVDQ69iRX41eeVWqOftZK31waWqZfwKB/TGzPfgi7097twx/DpwfOfyqEGqYtvpQF3jpHwT6UBzvSyAjw==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.3" - } - }, - "@babel/plugin-syntax-dynamic-import": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.8.3.tgz", - "integrity": "sha512-5gdGbFon+PszYzqs83S3E5mpi7/y/8M9eC90MRTZfduQOYW76ig6SOSPNe41IG5LoP3FGBn2N0RjVDSQiS94kQ==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.0" - } - }, - "@babel/plugin-syntax-export-default-from": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-export-default-from/-/plugin-syntax-export-default-from-7.8.3.tgz", - "integrity": "sha512-a1qnnsr73KLNIQcQlcQ4ZHxqqfBKM6iNQZW2OMTyxNbA2WC7SHWHtGVpFzWtQAuS2pspkWVzdEBXXx8Ik0Za4w==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.3" - } - }, - "@babel/plugin-syntax-export-namespace-from": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-export-namespace-from/-/plugin-syntax-export-namespace-from-7.8.3.tgz", - "integrity": "sha512-MXf5laXo6c1IbEbegDmzGPwGNTsHZmEy6QGznu5Sh2UCWvueywb2ee+CCE4zQiZstxU9BMoQO9i6zUFSY0Kj0Q==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.3" - } - }, - "@babel/plugin-syntax-function-bind": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-function-bind/-/plugin-syntax-function-bind-7.8.3.tgz", - "integrity": "sha512-gEYag4Q3CfqlQcJQQw/KSWdV2husGOnIsOsRlyzkoaNqj2V/V/CSdSJDCGSl67oJ1bdIYP6TjORWPH561dSJpA==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.3" - } - }, - "@babel/plugin-syntax-function-sent": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-function-sent/-/plugin-syntax-function-sent-7.8.3.tgz", - "integrity": "sha512-NNEutF0x2PdWYij2bmf/i50dSq4SUdgFij4BZwj3I4qDZgql3dlFJRyvwGHAhwKYElUKHaP0wQ/yO1d/enpJaw==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.3" - } - }, - "@babel/plugin-syntax-import-meta": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-meta/-/plugin-syntax-import-meta-7.8.3.tgz", - "integrity": "sha512-vYiGd4wQ9gx0Lngb7+bPCwQXGK/PR6FeTIJ+TIOlq+OfOKG/kCAOO2+IBac3oMM9qV7/fU76hfcqxUaLKZf1hQ==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.3" - } - }, - "@babel/plugin-syntax-json-strings": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.8.3.tgz", - "integrity": "sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.0" - } - }, - "@babel/plugin-syntax-logical-assignment-operators": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.8.3.tgz", - "integrity": "sha512-Zpg2Sgc++37kuFl6ppq2Q7Awc6E6AIW671x5PY8E/f7MCIyPPGK/EoeZXvvY3P42exZ3Q4/t3YOzP/HiN79jDg==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.3" - } - }, - "@babel/plugin-syntax-nullish-coalescing-operator": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz", - "integrity": "sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.0" - } - }, - "@babel/plugin-syntax-numeric-separator": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.8.3.tgz", - "integrity": "sha512-H7dCMAdN83PcCmqmkHB5dtp+Xa9a6LKSvA2hiFBC/5alSHxM5VgWZXFqDi0YFe8XNGT6iCa+z4V4zSt/PdZ7Dw==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.3" - } - }, - "@babel/plugin-syntax-object-rest-spread": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz", - "integrity": "sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.0" - } - }, - "@babel/plugin-syntax-optional-catch-binding": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.8.3.tgz", - "integrity": "sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.0" - } - }, - "@babel/plugin-syntax-optional-chaining": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz", - "integrity": "sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.0" - } - }, - "@babel/plugin-syntax-pipeline-operator": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-pipeline-operator/-/plugin-syntax-pipeline-operator-7.8.3.tgz", - "integrity": "sha512-GhiBvlXZLWeP+MjKaEv33KmiR/QMCv4iCwz1AuuAp7pHxBvOxxyQmIPukh+N/py6PRLYG10bvRCNeenG34QbDA==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.3" - } - }, - "@babel/plugin-syntax-throw-expressions": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-throw-expressions/-/plugin-syntax-throw-expressions-7.8.3.tgz", - "integrity": "sha512-Mv3shY1i7ZssY4OY+eLZJAmNCwqTcpv2qOKO9x6irELSygfKWVSMXk0igJsA9UhU4hOdw0qMGkjj9TAk4MqzwQ==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.3" - } - }, - "@babel/plugin-syntax-top-level-await": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.8.3.tgz", - "integrity": "sha512-kwj1j9lL/6Wd0hROD3b/OZZ7MSrZLqqn9RAZ5+cYYsflQ9HZBIKCUkr3+uL1MEJ1NePiUbf98jjiMQSv0NMR9g==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.3" - } - }, - "@babel/plugin-transform-arrow-functions": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.8.3.tgz", - "integrity": "sha512-0MRF+KC8EqH4dbuITCWwPSzsyO3HIWWlm30v8BbbpOrS1B++isGxPnnuq/IZvOX5J2D/p7DQalQm+/2PnlKGxg==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.3" - } - }, - "@babel/plugin-transform-async-to-generator": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.8.3.tgz", - "integrity": "sha512-imt9tFLD9ogt56Dd5CI/6XgpukMwd/fLGSrix2httihVe7LOGVPhyhMh1BU5kDM7iHD08i8uUtmV2sWaBFlHVQ==", - "dev": true, - "requires": { - "@babel/helper-module-imports": "^7.8.3", - "@babel/helper-plugin-utils": "^7.8.3", - "@babel/helper-remap-async-to-generator": "^7.8.3" - } - }, - "@babel/plugin-transform-block-scoped-functions": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.8.3.tgz", - "integrity": "sha512-vo4F2OewqjbB1+yaJ7k2EJFHlTP3jR634Z9Cj9itpqNjuLXvhlVxgnjsHsdRgASR8xYDrx6onw4vW5H6We0Jmg==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.3" - } - }, - "@babel/plugin-transform-block-scoping": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.8.3.tgz", - "integrity": "sha512-pGnYfm7RNRgYRi7bids5bHluENHqJhrV4bCZRwc5GamaWIIs07N4rZECcmJL6ZClwjDz1GbdMZFtPs27hTB06w==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.3", - "lodash": "^4.17.13" - }, - "dependencies": { - "lodash": { - "version": "4.17.15", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", - "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", - "dev": true - } - } - }, - "@babel/plugin-transform-classes": { - "version": "7.9.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.9.5.tgz", - "integrity": "sha512-x2kZoIuLC//O5iA7PEvecB105o7TLzZo8ofBVhP79N+DO3jaX+KYfww9TQcfBEZD0nikNyYcGB1IKtRq36rdmg==", - "dev": true, - "requires": { - "@babel/helper-annotate-as-pure": "^7.8.3", - "@babel/helper-define-map": "^7.8.3", - "@babel/helper-function-name": "^7.9.5", - "@babel/helper-optimise-call-expression": "^7.8.3", - "@babel/helper-plugin-utils": "^7.8.3", - "@babel/helper-replace-supers": "^7.8.6", - "@babel/helper-split-export-declaration": "^7.8.3", - "globals": "^11.1.0" - }, - "dependencies": { - "globals": { - "version": "11.12.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", - "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", - "dev": true - } - } - }, - "@babel/plugin-transform-computed-properties": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.8.3.tgz", - "integrity": "sha512-O5hiIpSyOGdrQZRQ2ccwtTVkgUDBBiCuK//4RJ6UfePllUTCENOzKxfh6ulckXKc0DixTFLCfb2HVkNA7aDpzA==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.3" - } - }, - "@babel/plugin-transform-destructuring": { - "version": "7.9.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.9.5.tgz", - "integrity": "sha512-j3OEsGel8nHL/iusv/mRd5fYZ3DrOxWC82x0ogmdN/vHfAP4MYw+AFKYanzWlktNwikKvlzUV//afBW5FTp17Q==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.3" - } - }, - "@babel/plugin-transform-dotall-regex": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.8.3.tgz", - "integrity": "sha512-kLs1j9Nn4MQoBYdRXH6AeaXMbEJFaFu/v1nQkvib6QzTj8MZI5OQzqmD83/2jEM1z0DLilra5aWO5YpyC0ALIw==", - "dev": true, - "requires": { - "@babel/helper-create-regexp-features-plugin": "^7.8.3", - "@babel/helper-plugin-utils": "^7.8.3" - } - }, - "@babel/plugin-transform-duplicate-keys": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.8.3.tgz", - "integrity": "sha512-s8dHiBUbcbSgipS4SMFuWGqCvyge5V2ZeAWzR6INTVC3Ltjig/Vw1G2Gztv0vU/hRG9X8IvKvYdoksnUfgXOEQ==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.3" - } - }, - "@babel/plugin-transform-exponentiation-operator": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.8.3.tgz", - "integrity": "sha512-zwIpuIymb3ACcInbksHaNcR12S++0MDLKkiqXHl3AzpgdKlFNhog+z/K0+TGW+b0w5pgTq4H6IwV/WhxbGYSjQ==", - "dev": true, - "requires": { - "@babel/helper-builder-binary-assignment-operator-visitor": "^7.8.3", - "@babel/helper-plugin-utils": "^7.8.3" - } - }, - "@babel/plugin-transform-for-of": { - "version": "7.9.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.9.0.tgz", - "integrity": "sha512-lTAnWOpMwOXpyDx06N+ywmF3jNbafZEqZ96CGYabxHrxNX8l5ny7dt4bK/rGwAh9utyP2b2Hv7PlZh1AAS54FQ==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.3" - } - }, - "@babel/plugin-transform-function-name": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.8.3.tgz", - "integrity": "sha512-rO/OnDS78Eifbjn5Py9v8y0aR+aSYhDhqAwVfsTl0ERuMZyr05L1aFSCJnbv2mmsLkit/4ReeQ9N2BgLnOcPCQ==", - "dev": true, - "requires": { - "@babel/helper-function-name": "^7.8.3", - "@babel/helper-plugin-utils": "^7.8.3" - } - }, - "@babel/plugin-transform-literals": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-literals/-/plugin-transform-literals-7.8.3.tgz", - "integrity": "sha512-3Tqf8JJ/qB7TeldGl+TT55+uQei9JfYaregDcEAyBZ7akutriFrt6C/wLYIer6OYhleVQvH/ntEhjE/xMmy10A==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.3" - } - }, - "@babel/plugin-transform-member-expression-literals": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.8.3.tgz", - "integrity": "sha512-3Wk2EXhnw+rP+IDkK6BdtPKsUE5IeZ6QOGrPYvw52NwBStw9V1ZVzxgK6fSKSxqUvH9eQPR3tm3cOq79HlsKYA==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.3" - } - }, - "@babel/plugin-transform-modules-amd": { - "version": "7.9.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.9.6.tgz", - "integrity": "sha512-zoT0kgC3EixAyIAU+9vfaUVKTv9IxBDSabgHoUCBP6FqEJ+iNiN7ip7NBKcYqbfUDfuC2mFCbM7vbu4qJgOnDw==", - "dev": true, - "requires": { - "@babel/helper-module-transforms": "^7.9.0", - "@babel/helper-plugin-utils": "^7.8.3", - "babel-plugin-dynamic-import-node": "^2.3.3" - } - }, - "@babel/plugin-transform-modules-commonjs": { - "version": "7.9.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.9.6.tgz", - "integrity": "sha512-7H25fSlLcn+iYimmsNe3uK1at79IE6SKW9q0/QeEHTMC9MdOZ+4bA+T1VFB5fgOqBWoqlifXRzYD0JPdmIrgSQ==", - "dev": true, - "requires": { - "@babel/helper-module-transforms": "^7.9.0", - "@babel/helper-plugin-utils": "^7.8.3", - "@babel/helper-simple-access": "^7.8.3", - "babel-plugin-dynamic-import-node": "^2.3.3" - } - }, - "@babel/plugin-transform-modules-systemjs": { - "version": "7.9.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.9.6.tgz", - "integrity": "sha512-NW5XQuW3N2tTHim8e1b7qGy7s0kZ2OH3m5octc49K1SdAKGxYxeIx7hiIz05kS1R2R+hOWcsr1eYwcGhrdHsrg==", - "dev": true, - "requires": { - "@babel/helper-hoist-variables": "^7.8.3", - "@babel/helper-module-transforms": "^7.9.0", - "@babel/helper-plugin-utils": "^7.8.3", - "babel-plugin-dynamic-import-node": "^2.3.3" - } - }, - "@babel/plugin-transform-modules-umd": { - "version": "7.9.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.9.0.tgz", - "integrity": "sha512-uTWkXkIVtg/JGRSIABdBoMsoIeoHQHPTL0Y2E7xf5Oj7sLqwVsNXOkNk0VJc7vF0IMBsPeikHxFjGe+qmwPtTQ==", - "dev": true, - "requires": { - "@babel/helper-module-transforms": "^7.9.0", - "@babel/helper-plugin-utils": "^7.8.3" - } - }, - "@babel/plugin-transform-named-capturing-groups-regex": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.8.3.tgz", - "integrity": "sha512-f+tF/8UVPU86TrCb06JoPWIdDpTNSGGcAtaD9mLP0aYGA0OS0j7j7DHJR0GTFrUZPUU6loZhbsVZgTh0N+Qdnw==", - "dev": true, - "requires": { - "@babel/helper-create-regexp-features-plugin": "^7.8.3" - } - }, - "@babel/plugin-transform-new-target": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.8.3.tgz", - "integrity": "sha512-QuSGysibQpyxexRyui2vca+Cmbljo8bcRckgzYV4kRIsHpVeyeC3JDO63pY+xFZ6bWOBn7pfKZTqV4o/ix9sFw==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.3" - } - }, - "@babel/plugin-transform-object-super": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.8.3.tgz", - "integrity": "sha512-57FXk+gItG/GejofIyLIgBKTas4+pEU47IXKDBWFTxdPd7F80H8zybyAY7UoblVfBhBGs2EKM+bJUu2+iUYPDQ==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.3", - "@babel/helper-replace-supers": "^7.8.3" - } - }, - "@babel/plugin-transform-parameters": { - "version": "7.9.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.9.5.tgz", - "integrity": "sha512-0+1FhHnMfj6lIIhVvS4KGQJeuhe1GI//h5uptK4PvLt+BGBxsoUJbd3/IW002yk//6sZPlFgsG1hY6OHLcy6kA==", - "dev": true, - "requires": { - "@babel/helper-get-function-arity": "^7.8.3", - "@babel/helper-plugin-utils": "^7.8.3" - } - }, - "@babel/plugin-transform-property-literals": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.8.3.tgz", - "integrity": "sha512-uGiiXAZMqEoQhRWMK17VospMZh5sXWg+dlh2soffpkAl96KAm+WZuJfa6lcELotSRmooLqg0MWdH6UUq85nmmg==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.3" - } - }, - "@babel/plugin-transform-regenerator": { - "version": "7.8.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.8.7.tgz", - "integrity": "sha512-TIg+gAl4Z0a3WmD3mbYSk+J9ZUH6n/Yc57rtKRnlA/7rcCvpekHXe0CMZHP1gYp7/KLe9GHTuIba0vXmls6drA==", - "dev": true, - "requires": { - "regenerator-transform": "^0.14.2" - }, - "dependencies": { - "regenerator-transform": { - "version": "0.14.4", - "resolved": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.14.4.tgz", - "integrity": "sha512-EaJaKPBI9GvKpvUz2mz4fhx7WPgvwRLY9v3hlNHWmAuJHI13T4nwKnNvm5RWJzEdnI5g5UwtOww+S8IdoUC2bw==", - "dev": true, - "requires": { - "@babel/runtime": "^7.8.4", - "private": "^0.1.8" - } - } - } - }, - "@babel/plugin-transform-reserved-words": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.8.3.tgz", - "integrity": "sha512-mwMxcycN3omKFDjDQUl+8zyMsBfjRFr0Zn/64I41pmjv4NJuqcYlEtezwYtw9TFd9WR1vN5kiM+O0gMZzO6L0A==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.3" - } - }, - "@babel/plugin-transform-shorthand-properties": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.8.3.tgz", - "integrity": "sha512-I9DI6Odg0JJwxCHzbzW08ggMdCezoWcuQRz3ptdudgwaHxTjxw5HgdFJmZIkIMlRymL6YiZcped4TTCB0JcC8w==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.3" - } - }, - "@babel/plugin-transform-spread": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-spread/-/plugin-transform-spread-7.8.3.tgz", - "integrity": "sha512-CkuTU9mbmAoFOI1tklFWYYbzX5qCIZVXPVy0jpXgGwkplCndQAa58s2jr66fTeQnA64bDox0HL4U56CFYoyC7g==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.3" - } - }, - "@babel/plugin-transform-sticky-regex": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.8.3.tgz", - "integrity": "sha512-9Spq0vGCD5Bb4Z/ZXXSK5wbbLFMG085qd2vhL1JYu1WcQ5bXqZBAYRzU1d+p79GcHs2szYv5pVQCX13QgldaWw==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.3", - "@babel/helper-regex": "^7.8.3" - } - }, - "@babel/plugin-transform-template-literals": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.8.3.tgz", - "integrity": "sha512-820QBtykIQOLFT8NZOcTRJ1UNuztIELe4p9DCgvj4NK+PwluSJ49we7s9FB1HIGNIYT7wFUJ0ar2QpCDj0escQ==", - "dev": true, - "requires": { - "@babel/helper-annotate-as-pure": "^7.8.3", - "@babel/helper-plugin-utils": "^7.8.3" - } - }, - "@babel/plugin-transform-typeof-symbol": { - "version": "7.8.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.8.4.tgz", - "integrity": "sha512-2QKyfjGdvuNfHsb7qnBBlKclbD4CfshH2KvDabiijLMGXPHJXGxtDzwIF7bQP+T0ysw8fYTtxPafgfs/c1Lrqg==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.3" - } - }, - "@babel/plugin-transform-unicode-regex": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.8.3.tgz", - "integrity": "sha512-+ufgJjYdmWfSQ+6NS9VGUR2ns8cjJjYbrbi11mZBTaWm+Fui/ncTLFF28Ei1okavY+xkojGr1eJxNsWYeA5aZw==", - "dev": true, - "requires": { - "@babel/helper-create-regexp-features-plugin": "^7.8.3", - "@babel/helper-plugin-utils": "^7.8.3" - } - }, - "@babel/preset-env": { - "version": "7.9.6", - "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.9.6.tgz", - "integrity": "sha512-0gQJ9RTzO0heXOhzftog+a/WyOuqMrAIugVYxMYf83gh1CQaQDjMtsOpqOwXyDL/5JcWsrCm8l4ju8QC97O7EQ==", - "dev": true, - "requires": { - "@babel/compat-data": "^7.9.6", - "@babel/helper-compilation-targets": "^7.9.6", - "@babel/helper-module-imports": "^7.8.3", - "@babel/helper-plugin-utils": "^7.8.3", - "@babel/plugin-proposal-async-generator-functions": "^7.8.3", - "@babel/plugin-proposal-dynamic-import": "^7.8.3", - "@babel/plugin-proposal-json-strings": "^7.8.3", - "@babel/plugin-proposal-nullish-coalescing-operator": "^7.8.3", - "@babel/plugin-proposal-numeric-separator": "^7.8.3", - "@babel/plugin-proposal-object-rest-spread": "^7.9.6", - "@babel/plugin-proposal-optional-catch-binding": "^7.8.3", - "@babel/plugin-proposal-optional-chaining": "^7.9.0", - "@babel/plugin-proposal-unicode-property-regex": "^7.8.3", - "@babel/plugin-syntax-async-generators": "^7.8.0", - "@babel/plugin-syntax-dynamic-import": "^7.8.0", - "@babel/plugin-syntax-json-strings": "^7.8.0", - "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.0", - "@babel/plugin-syntax-numeric-separator": "^7.8.0", - "@babel/plugin-syntax-object-rest-spread": "^7.8.0", - "@babel/plugin-syntax-optional-catch-binding": "^7.8.0", - "@babel/plugin-syntax-optional-chaining": "^7.8.0", - "@babel/plugin-syntax-top-level-await": "^7.8.3", - "@babel/plugin-transform-arrow-functions": "^7.8.3", - "@babel/plugin-transform-async-to-generator": "^7.8.3", - "@babel/plugin-transform-block-scoped-functions": "^7.8.3", - "@babel/plugin-transform-block-scoping": "^7.8.3", - "@babel/plugin-transform-classes": "^7.9.5", - "@babel/plugin-transform-computed-properties": "^7.8.3", - "@babel/plugin-transform-destructuring": "^7.9.5", - "@babel/plugin-transform-dotall-regex": "^7.8.3", - "@babel/plugin-transform-duplicate-keys": "^7.8.3", - "@babel/plugin-transform-exponentiation-operator": "^7.8.3", - "@babel/plugin-transform-for-of": "^7.9.0", - "@babel/plugin-transform-function-name": "^7.8.3", - "@babel/plugin-transform-literals": "^7.8.3", - "@babel/plugin-transform-member-expression-literals": "^7.8.3", - "@babel/plugin-transform-modules-amd": "^7.9.6", - "@babel/plugin-transform-modules-commonjs": "^7.9.6", - "@babel/plugin-transform-modules-systemjs": "^7.9.6", - "@babel/plugin-transform-modules-umd": "^7.9.0", - "@babel/plugin-transform-named-capturing-groups-regex": "^7.8.3", - "@babel/plugin-transform-new-target": "^7.8.3", - "@babel/plugin-transform-object-super": "^7.8.3", - "@babel/plugin-transform-parameters": "^7.9.5", - "@babel/plugin-transform-property-literals": "^7.8.3", - "@babel/plugin-transform-regenerator": "^7.8.7", - "@babel/plugin-transform-reserved-words": "^7.8.3", - "@babel/plugin-transform-shorthand-properties": "^7.8.3", - "@babel/plugin-transform-spread": "^7.8.3", - "@babel/plugin-transform-sticky-regex": "^7.8.3", - "@babel/plugin-transform-template-literals": "^7.8.3", - "@babel/plugin-transform-typeof-symbol": "^7.8.4", - "@babel/plugin-transform-unicode-regex": "^7.8.3", - "@babel/preset-modules": "^0.1.3", - "@babel/types": "^7.9.6", - "browserslist": "^4.11.1", - "core-js-compat": "^3.6.2", - "invariant": "^2.2.2", - "levenary": "^1.1.1", - "semver": "^5.5.0" - }, - "dependencies": { - "browserslist": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.12.0.tgz", - "integrity": "sha512-UH2GkcEDSI0k/lRkuDSzFl9ZZ87skSy9w2XAn1MsZnL+4c4rqbBd3e82UWHbYDpztABrPBhZsTEeuxVfHppqDg==", - "dev": true, - "requires": { - "caniuse-lite": "^1.0.30001043", - "electron-to-chromium": "^1.3.413", - "node-releases": "^1.1.53", - "pkg-up": "^2.0.0" - } - }, - "caniuse-lite": { - "version": "1.0.30001064", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001064.tgz", - "integrity": "sha512-hdBcQMFvJIrOhkpAZiRXz04Cmetwc9NekeuNl0qZfHOugxOhJKxsjF1RmISMPFjIF4PPx1reliIzbfN42EiQ5A==", - "dev": true - }, - "electron-to-chromium": { - "version": "1.3.451", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.451.tgz", - "integrity": "sha512-2fvco0F2bBIgqzO8GRP0Jt/91pdrf9KfZ5FsmkYkjERmIJG585cFeFZV4+CO6oTmU3HmCTgfcZuEa7kW8VUh3A==", - "dev": true - } - } - }, - "@babel/preset-modules": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/@babel/preset-modules/-/preset-modules-0.1.3.tgz", - "integrity": "sha512-Ra3JXOHBq2xd56xSF7lMKXdjBn3T772Y1Wet3yWnkDly9zHvJki029tAFzvAAK5cf4YV3yoxuP61crYRol6SVg==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.0.0", - "@babel/plugin-proposal-unicode-property-regex": "^7.4.4", - "@babel/plugin-transform-dotall-regex": "^7.4.4", - "@babel/types": "^7.4.4", - "esutils": "^2.0.2" - } - }, - "@babel/register": { - "version": "7.9.0", - "resolved": "https://registry.npmjs.org/@babel/register/-/register-7.9.0.tgz", - "integrity": "sha512-Tv8Zyi2J2VRR8g7pC5gTeIN8Ihultbmk0ocyNz8H2nEZbmhp1N6q0A1UGsQbDvGP/sNinQKUHf3SqXwqjtFv4Q==", - "dev": true, - "requires": { - "find-cache-dir": "^2.0.0", - "lodash": "^4.17.13", - "make-dir": "^2.1.0", - "pirates": "^4.0.0", - "source-map-support": "^0.5.16" - }, - "dependencies": { - "lodash": { - "version": "4.17.15", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", - "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", - "dev": true - }, - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - }, - "source-map-support": { - "version": "0.5.19", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz", - "integrity": "sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==", - "dev": true, - "requires": { - "buffer-from": "^1.0.0", - "source-map": "^0.6.0" - } - } - } - }, - "@babel/runtime": { - "version": "7.9.6", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.9.6.tgz", - "integrity": "sha512-64AF1xY3OAkFHqOb9s4jpgk1Mm5vDZ4L3acHvAml+53nO1XbXLuDodsVpO4OIUsmemlUHMxNdYMNJmsvOwLrvQ==", - "dev": true, - "requires": { - "regenerator-runtime": "^0.13.4" - }, - "dependencies": { - "regenerator-runtime": { - "version": "0.13.5", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.5.tgz", - "integrity": "sha512-ZS5w8CpKFinUzOwW3c83oPeVXoNsrLsaCoLtJvAClH135j/R77RuymhiSErhm2lKcwSCIpmvIWSbDkIfAqKQlA==", - "dev": true - } - } - }, - "@babel/template": { - "version": "7.8.6", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.8.6.tgz", - "integrity": "sha512-zbMsPMy/v0PWFZEhQJ66bqjhH+z0JgMoBWuikXybgG3Gkd/3t5oQ1Rw2WQhnSrsOmsKXnZOx15tkC4qON/+JPg==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.8.3", - "@babel/parser": "^7.8.6", - "@babel/types": "^7.8.6" - } - }, - "@babel/traverse": { - "version": "7.9.6", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.9.6.tgz", - "integrity": "sha512-b3rAHSjbxy6VEAvlxM8OV/0X4XrG72zoxme6q1MOoe2vd0bEc+TwayhuC1+Dfgqh1QEG+pj7atQqvUprHIccsg==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.8.3", - "@babel/generator": "^7.9.6", - "@babel/helper-function-name": "^7.9.5", - "@babel/helper-split-export-declaration": "^7.8.3", - "@babel/parser": "^7.9.6", - "@babel/types": "^7.9.6", - "debug": "^4.1.0", - "globals": "^11.1.0", - "lodash": "^4.17.13" - }, - "dependencies": { - "debug": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", - "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", - "dev": true, - "requires": { - "ms": "^2.1.1" - } - }, - "globals": { - "version": "11.12.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", - "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", - "dev": true - }, - "lodash": { - "version": "4.17.15", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", - "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", - "dev": true - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - } - } - }, - "@babel/types": { - "version": "7.9.6", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.9.6.tgz", - "integrity": "sha512-qxXzvBO//jO9ZnoasKF1uJzHd2+M6Q2ZPIVfnFps8JJvXy0ZBbwbNOmE6SGIY5XOY6d1Bo5lb9d9RJ8nv3WSeA==", - "dev": true, - "requires": { - "@babel/helper-validator-identifier": "^7.9.5", - "lodash": "^4.17.13", - "to-fast-properties": "^2.0.0" - }, - "dependencies": { - "lodash": { - "version": "4.17.15", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", - "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", - "dev": true - }, - "to-fast-properties": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", - "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", - "dev": true - } - } - }, - "@sinonjs/commons": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.8.0.tgz", - "integrity": "sha512-wEj54PfsZ5jGSwMX68G8ZXFawcSglQSXqCftWX3ec8MDUzQdHgcKvw97awHbY0efQEL5iKUOAmmVtoYgmrSG4Q==", - "dev": true, - "requires": { - "type-detect": "4.0.8" - } - }, - "@sinonjs/formatio": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/@sinonjs/formatio/-/formatio-3.2.2.tgz", - "integrity": "sha512-B8SEsgd8gArBLMD6zpRw3juQ2FVSsmdd7qlevyDqzS9WTCtvF55/gAL+h6gue8ZvPYcdiPdvueM/qm//9XzyTQ==", - "dev": true, - "requires": { - "@sinonjs/commons": "^1", - "@sinonjs/samsam": "^3.1.0" - } - }, - "@sinonjs/samsam": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/@sinonjs/samsam/-/samsam-3.3.3.tgz", - "integrity": "sha512-bKCMKZvWIjYD0BLGnNrxVuw4dkWCYsLqFOUWw8VgKF/+5Y+mE7LfHWPIYoDXowH+3a9LsWDMo0uAP8YDosPvHQ==", - "dev": true, - "requires": { - "@sinonjs/commons": "^1.3.0", - "array-from": "^2.1.1", - "lodash": "^4.17.15" - }, - "dependencies": { - "lodash": { - "version": "4.17.15", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", - "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", - "dev": true - } - } - }, - "@sinonjs/text-encoding": { - "version": "0.7.1", - "resolved": "https://registry.npmjs.org/@sinonjs/text-encoding/-/text-encoding-0.7.1.tgz", - "integrity": "sha512-+iTbntw2IZPb/anVDbypzfQa+ay64MW0Zo8aJ8gZPWMMK6/OubMVb6lUPMagqjOPnmtauXnFCACVl3O7ogjeqQ==", - "dev": true - }, - "arr-flatten": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", - "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==", - "optional": true - }, - "arr-union": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", - "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=", - "optional": true - }, - "array-from": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/array-from/-/array-from-2.1.1.tgz", - "integrity": "sha1-z+nYwmYoudxa7MYqn12PHzUsEZU=", - "dev": true - }, - "assign-symbols": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", - "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=", - "optional": true - }, - "async-each": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.1.tgz", - "integrity": "sha1-GdOGodntxufByF04iu28xW0zYC0=", - "optional": true - }, - "asynckit": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" - }, - "atob": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz", - "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==", - "optional": true - }, - "babel-plugin-dynamic-import-node": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/babel-plugin-dynamic-import-node/-/babel-plugin-dynamic-import-node-2.3.3.tgz", - "integrity": "sha512-jZVI+s9Zg3IqA/kdi0i6UDCybUI3aSBLnglhYbSSjKlV7yF1F/5LWv8MakQmvYpnbJDS6fcBL2KzHSxNCMtWSQ==", - "dev": true, - "requires": { - "object.assign": "^4.1.0" - } - }, - "balanced-match": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" - }, - "base": { - "version": "0.11.2", - "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", - "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", - "optional": true, - "requires": { - "cache-base": "^1.0.1", - "class-utils": "^0.3.5", - "component-emitter": "^1.2.1", - "define-property": "^1.0.0", - "isobject": "^3.0.1", - "mixin-deep": "^1.2.0", - "pascalcase": "^0.1.1" - }, - "dependencies": { - "define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", - "optional": true, - "requires": { - "is-descriptor": "^1.0.0" - } - }, - "is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "optional": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "optional": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "optional": true, - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - } - }, - "isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", - "optional": true - }, - "kind-of": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", - "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", - "optional": true - } - } - }, - "binary-extensions": { - "version": "1.12.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.12.0.tgz", - "integrity": "sha512-DYWGk01lDcxeS/K9IHPGWfT8PsJmbXRtRd2Sx72Tnb8pcYZQFF1oSDb8hJtS1vhp212q1Rzi5dUf9+nq0o9UIg==", - "optional": true - }, - "brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "browser-stdout": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", - "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", - "dev": true - }, - "buffer-from": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", - "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", - "dev": true - }, - "cache-base": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", - "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", - "optional": true, - "requires": { - "collection-visit": "^1.0.0", - "component-emitter": "^1.2.1", - "get-value": "^2.0.6", - "has-value": "^1.0.0", - "isobject": "^3.0.1", - "set-value": "^2.0.0", - "to-object-path": "^0.3.0", - "union-value": "^1.0.0", - "unset-value": "^1.0.0" - }, - "dependencies": { - "isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", - "optional": true - } - } - }, - "class-utils": { - "version": "0.3.6", - "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", - "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==", - "optional": true, - "requires": { - "arr-union": "^3.1.0", - "define-property": "^0.2.5", - "isobject": "^3.0.0", - "static-extend": "^0.1.1" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "optional": true, - "requires": { - "is-descriptor": "^0.1.0" - } - }, - "isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", - "optional": true - } - } - }, - "collection-visit": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", - "integrity": "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=", - "optional": true, - "requires": { - "map-visit": "^1.0.0", - "object-visit": "^1.0.0" - } - }, - "color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "requires": { - "color-name": "1.1.3" - } - }, - "color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", - "dev": true - }, - "combined-stream": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.7.tgz", - "integrity": "sha512-brWl9y6vOB1xYPZcpZde3N9zDByXTosAeMDo4p1wzo6UMOX4vumB+TP1RZ76sfE6Md68Q0NJSrE/gbezd4Ul+w==", - "requires": { - "delayed-stream": "~1.0.0" - } - }, - "commondir": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", - "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=", - "dev": true - }, - "component-emitter": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz", - "integrity": "sha1-E3kY1teCg/ffemt8WmPhQOaUJeY=" - }, - "concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" - }, - "convert-source-map": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.6.0.tgz", - "integrity": "sha512-eFu7XigvxdZ1ETfbgPBohgyQ/Z++C0eEhTor0qRwBw9unw+L0/6V8wkSuGgzdThkiS5lSpdptOQPD8Ak40a+7A==", - "requires": { - "safe-buffer": "~5.1.1" - } - }, - "cookiejar": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/cookiejar/-/cookiejar-2.1.2.tgz", - "integrity": "sha512-Mw+adcfzPxcPeI+0WlvRrr/3lGVO0bD75SxX6811cxSh1Wbxx7xZBGK1eVtDf6si8rg2lhnUjsVLMFMfbRIuwA==" - }, - "copy-descriptor": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", - "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=", - "optional": true - }, - "core-js-compat": { - "version": "3.6.5", - "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.6.5.tgz", - "integrity": "sha512-7ItTKOhOZbznhXAQ2g/slGg1PJV5zDO/WdkTwi7UEOJmkvsE32PWvx6mKtDjiMpjnR2CNf6BAD6sSxIlv7ptng==", - "dev": true, - "requires": { - "browserslist": "^4.8.5", - "semver": "7.0.0" - }, - "dependencies": { - "browserslist": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.12.0.tgz", - "integrity": "sha512-UH2GkcEDSI0k/lRkuDSzFl9ZZ87skSy9w2XAn1MsZnL+4c4rqbBd3e82UWHbYDpztABrPBhZsTEeuxVfHppqDg==", - "dev": true, - "requires": { - "caniuse-lite": "^1.0.30001043", - "electron-to-chromium": "^1.3.413", - "node-releases": "^1.1.53", - "pkg-up": "^2.0.0" - } - }, - "caniuse-lite": { - "version": "1.0.30001064", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001064.tgz", - "integrity": "sha512-hdBcQMFvJIrOhkpAZiRXz04Cmetwc9NekeuNl0qZfHOugxOhJKxsjF1RmISMPFjIF4PPx1reliIzbfN42EiQ5A==", - "dev": true - }, - "electron-to-chromium": { - "version": "1.3.451", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.451.tgz", - "integrity": "sha512-2fvco0F2bBIgqzO8GRP0Jt/91pdrf9KfZ5FsmkYkjERmIJG585cFeFZV4+CO6oTmU3HmCTgfcZuEa7kW8VUh3A==", - "dev": true - }, - "semver": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.0.0.tgz", - "integrity": "sha512-+GB6zVA9LWh6zovYQLALHwv5rb2PHGlJi3lfiqIHxR0uuwCgefcOJc59v9fv1w8GbStwxuuqqAjI9NMAOOgq1A==", - "dev": true - } - } - }, - "core-util-is": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" - }, - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "optional": true, - "requires": { - "ms": "2.0.0" - } - }, - "decode-uri-component": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", - "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=", - "optional": true - }, - "define-properties": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", - "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", - "dev": true, - "requires": { - "object-keys": "^1.0.12" - } - }, - "define-property": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", - "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", - "optional": true, - "requires": { - "is-descriptor": "^1.0.2", - "isobject": "^3.0.1" - }, - "dependencies": { - "is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "optional": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "optional": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "optional": true, - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - } - }, - "isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", - "optional": true - }, - "kind-of": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", - "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", - "optional": true - } - } - }, - "delayed-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" - }, - "diff": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", - "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", - "dev": true - }, - "escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", - "dev": true - }, - "esutils": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", - "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", - "dev": true - }, - "expect.js": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/expect.js/-/expect.js-0.3.1.tgz", - "integrity": "sha1-sKWaDS7/VDdUTr8M6qYBWEHQm1s=", - "dev": true - }, - "extend": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", - "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" - }, - "extend-shallow": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", - "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", - "optional": true, - "requires": { - "assign-symbols": "^1.0.0", - "is-extendable": "^1.0.1" - }, - "dependencies": { - "is-extendable": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", - "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", - "optional": true, - "requires": { - "is-plain-object": "^2.0.4" - } - } - } - }, - "find-cache-dir": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-2.1.0.tgz", - "integrity": "sha512-Tq6PixE0w/VMFfCgbONnkiQIVol/JJL7nRMi20fqzA4NRs9AfeqMGeRdPi3wIhYkxjeBaWh2rxwapn5Tu3IqOQ==", - "dev": true, - "requires": { - "commondir": "^1.0.1", - "make-dir": "^2.0.0", - "pkg-dir": "^3.0.0" - } - }, - "find-up": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", - "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", - "dev": true, - "requires": { - "locate-path": "^2.0.0" - } - }, - "for-in": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", - "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", - "optional": true - }, - "form-data": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", - "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", - "requires": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.6", - "mime-types": "^2.1.12" - } - }, - "formidable": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/formidable/-/formidable-1.2.1.tgz", - "integrity": "sha512-Fs9VRguL0gqGHkXS5GQiMCr1VhZBxz0JnJs4JmMp/2jL18Fmbzvv7vOFRU+U8TBkHEE/CX1qDXzJplVULgsLeg==" - }, - "fragment-cache": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", - "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", - "optional": true, - "requires": { - "map-cache": "^0.2.2" - } - }, - "fs-readdir-recursive": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/fs-readdir-recursive/-/fs-readdir-recursive-1.1.0.tgz", - "integrity": "sha512-GNanXlVr2pf02+sPN40XN8HG+ePaNcvM0q5mZBd668Obwb0yD5GiUbZOFgwn8kGMY6I3mdyDJzieUy3PTYyTRA==" - }, - "fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" - }, - "fsevents": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.7.tgz", - "integrity": "sha512-Pxm6sI2MeBD7RdD12RYsqaP0nMiwx8eZBXCa6z2L+mRHm2DYrOYwihmhjpkdjUHwQhslWQjRpEgNq4XvBmaAuw==", - "optional": true, - "requires": { - "nan": "^2.9.2", - "node-pre-gyp": "^0.10.0" - }, - "dependencies": { - "abbrev": { - "version": "1.1.1", - "resolved": false, - "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", - "optional": true - }, - "ansi-regex": { - "version": "2.1.1", - "resolved": false, - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", - "optional": true - }, - "aproba": { - "version": "1.2.0", - "resolved": false, - "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", - "optional": true - }, - "are-we-there-yet": { - "version": "1.1.5", - "resolved": false, - "integrity": "sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w==", - "optional": true, - "requires": { - "delegates": "^1.0.0", - "readable-stream": "^2.0.6" - } - }, - "balanced-match": { - "version": "1.0.0", - "resolved": false, - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", - "optional": true - }, - "brace-expansion": { - "version": "1.1.11", - "resolved": false, - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "optional": true, - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "chownr": { - "version": "1.1.1", - "resolved": false, - "integrity": "sha512-j38EvO5+LHX84jlo6h4UzmOwi0UgW61WRyPtJz4qaadK5eY3BTS5TY/S1Stc3Uk2lIM6TPevAlULiEJwie860g==", - "optional": true - }, - "code-point-at": { - "version": "1.1.0", - "resolved": false, - "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", - "optional": true - }, - "concat-map": { - "version": "0.0.1", - "resolved": false, - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", - "optional": true - }, - "console-control-strings": { - "version": "1.1.0", - "resolved": false, - "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=", - "optional": true - }, - "core-util-is": { - "version": "1.0.2", - "resolved": false, - "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", - "optional": true - }, - "debug": { - "version": "2.6.9", - "resolved": false, - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "optional": true, - "requires": { - "ms": "2.0.0" - } - }, - "deep-extend": { - "version": "0.6.0", - "resolved": false, - "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", - "optional": true - }, - "delegates": { - "version": "1.0.0", - "resolved": false, - "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=", - "optional": true - }, - "detect-libc": { - "version": "1.0.3", - "resolved": false, - "integrity": "sha1-+hN8S9aY7fVc1c0CrFWfkaTEups=", - "optional": true - }, - "fs-minipass": { - "version": "1.2.5", - "resolved": false, - "integrity": "sha512-JhBl0skXjUPCFH7x6x61gQxrKyXsxB5gcgePLZCwfyCGGsTISMoIeObbrvVeP6Xmyaudw4TT43qV2Gz+iyd2oQ==", - "optional": true, - "requires": { - "minipass": "^2.2.1" - } - }, - "fs.realpath": { - "version": "1.0.0", - "resolved": false, - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", - "optional": true - }, - "gauge": { - "version": "2.7.4", - "resolved": false, - "integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=", - "optional": true, - "requires": { - "aproba": "^1.0.3", - "console-control-strings": "^1.0.0", - "has-unicode": "^2.0.0", - "object-assign": "^4.1.0", - "signal-exit": "^3.0.0", - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1", - "wide-align": "^1.1.0" - } - }, - "glob": { - "version": "7.1.3", - "resolved": false, - "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", - "optional": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "has-unicode": { - "version": "2.0.1", - "resolved": false, - "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=", - "optional": true - }, - "iconv-lite": { - "version": "0.4.24", - "resolved": false, - "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", - "optional": true, - "requires": { - "safer-buffer": ">= 2.1.2 < 3" - } - }, - "ignore-walk": { - "version": "3.0.1", - "resolved": false, - "integrity": "sha512-DTVlMx3IYPe0/JJcYP7Gxg7ttZZu3IInhuEhbchuqneY9wWe5Ojy2mXLBaQFUQmo0AW2r3qG7m1mg86js+gnlQ==", - "optional": true, - "requires": { - "minimatch": "^3.0.4" - } - }, - "inflight": { - "version": "1.0.6", - "resolved": false, - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "optional": true, - "requires": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "inherits": { - "version": "2.0.3", - "resolved": false, - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", - "optional": true - }, - "ini": { - "version": "1.3.5", - "resolved": false, - "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==", - "optional": true - }, - "is-fullwidth-code-point": { - "version": "1.0.0", - "resolved": false, - "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", - "optional": true, - "requires": { - "number-is-nan": "^1.0.0" - } - }, - "isarray": { - "version": "1.0.0", - "resolved": false, - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "optional": true - }, - "minimatch": { - "version": "3.0.4", - "resolved": false, - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", - "optional": true, - "requires": { - "brace-expansion": "^1.1.7" - } - }, - "minimist": { - "version": "0.0.8", - "resolved": false, - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", - "optional": true - }, - "minipass": { - "version": "2.3.5", - "resolved": false, - "integrity": "sha512-Gi1W4k059gyRbyVUZQ4mEqLm0YIUiGYfvxhF6SIlk3ui1WVxMTGfGdQ2SInh3PDrRTVvPKgULkpJtT4RH10+VA==", - "optional": true, - "requires": { - "safe-buffer": "^5.1.2", - "yallist": "^3.0.0" - } - }, - "minizlib": { - "version": "1.2.1", - "resolved": false, - "integrity": "sha512-7+4oTUOWKg7AuL3vloEWekXY2/D20cevzsrNT2kGWm+39J9hGTCBv8VI5Pm5lXZ/o3/mdR4f8rflAPhnQb8mPA==", - "optional": true, - "requires": { - "minipass": "^2.2.1" - } - }, - "mkdirp": { - "version": "0.5.1", - "resolved": false, - "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", - "optional": true, - "requires": { - "minimist": "0.0.8" - } - }, - "ms": { - "version": "2.0.0", - "resolved": false, - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "optional": true - }, - "needle": { - "version": "2.2.4", - "resolved": false, - "integrity": "sha512-HyoqEb4wr/rsoaIDfTH2aVL9nWtQqba2/HvMv+++m8u0dz808MaagKILxtfeSN7QU7nvbQ79zk3vYOJp9zsNEA==", - "optional": true, - "requires": { - "debug": "^2.1.2", - "iconv-lite": "^0.4.4", - "sax": "^1.2.4" - } - }, - "node-pre-gyp": { - "version": "0.10.3", - "resolved": false, - "integrity": "sha512-d1xFs+C/IPS8Id0qPTZ4bUT8wWryfR/OzzAFxweG+uLN85oPzyo2Iw6bVlLQ/JOdgNonXLCoRyqDzDWq4iw72A==", - "optional": true, - "requires": { - "detect-libc": "^1.0.2", - "mkdirp": "^0.5.1", - "needle": "^2.2.1", - "nopt": "^4.0.1", - "npm-packlist": "^1.1.6", - "npmlog": "^4.0.2", - "rc": "^1.2.7", - "rimraf": "^2.6.1", - "semver": "^5.3.0", - "tar": "^4" - } - }, - "nopt": { - "version": "4.0.1", - "resolved": false, - "integrity": "sha1-0NRoWv1UFRk8jHUFYC0NF81kR00=", - "optional": true, - "requires": { - "abbrev": "1", - "osenv": "^0.1.4" - } - }, - "npm-bundled": { - "version": "1.0.5", - "resolved": false, - "integrity": "sha512-m/e6jgWu8/v5niCUKQi9qQl8QdeEduFA96xHDDzFGqly0OOjI7c+60KM/2sppfnUU9JJagf+zs+yGhqSOFj71g==", - "optional": true - }, - "npm-packlist": { - "version": "1.2.0", - "resolved": false, - "integrity": "sha512-7Mni4Z8Xkx0/oegoqlcao/JpPCPEMtUvsmB0q7mgvlMinykJLSRTYuFqoQLYgGY8biuxIeiHO+QNJKbCfljewQ==", - "optional": true, - "requires": { - "ignore-walk": "^3.0.1", - "npm-bundled": "^1.0.1" - } - }, - "npmlog": { - "version": "4.1.2", - "resolved": false, - "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==", - "optional": true, - "requires": { - "are-we-there-yet": "~1.1.2", - "console-control-strings": "~1.1.0", - "gauge": "~2.7.3", - "set-blocking": "~2.0.0" - } - }, - "number-is-nan": { - "version": "1.0.1", - "resolved": false, - "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", - "optional": true - }, - "object-assign": { - "version": "4.1.1", - "resolved": false, - "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", - "optional": true - }, - "once": { - "version": "1.4.0", - "resolved": false, - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "optional": true, - "requires": { - "wrappy": "1" - } - }, - "os-homedir": { - "version": "1.0.2", - "resolved": false, - "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", - "optional": true - }, - "os-tmpdir": { - "version": "1.0.2", - "resolved": false, - "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", - "optional": true - }, - "osenv": { - "version": "0.1.5", - "resolved": false, - "integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==", - "optional": true, - "requires": { - "os-homedir": "^1.0.0", - "os-tmpdir": "^1.0.0" - } - }, - "path-is-absolute": { - "version": "1.0.1", - "resolved": false, - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", - "optional": true - }, - "process-nextick-args": { - "version": "2.0.0", - "resolved": false, - "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==", - "optional": true - }, - "rc": { - "version": "1.2.8", - "resolved": false, - "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", - "optional": true, - "requires": { - "deep-extend": "^0.6.0", - "ini": "~1.3.0", - "minimist": "^1.2.0", - "strip-json-comments": "~2.0.1" - }, - "dependencies": { - "minimist": { - "version": "1.2.0", - "resolved": false, - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", - "optional": true - } - } - }, - "readable-stream": { - "version": "2.3.6", - "resolved": false, - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", - "optional": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "rimraf": { - "version": "2.6.3", - "resolved": false, - "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", - "optional": true, - "requires": { - "glob": "^7.1.3" - } - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": false, - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "optional": true - }, - "safer-buffer": { - "version": "2.1.2", - "resolved": false, - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", - "optional": true - }, - "sax": { - "version": "1.2.4", - "resolved": false, - "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==", - "optional": true - }, - "semver": { - "version": "5.6.0", - "resolved": false, - "integrity": "sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg==", - "optional": true - }, - "set-blocking": { - "version": "2.0.0", - "resolved": false, - "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", - "optional": true - }, - "signal-exit": { - "version": "3.0.2", - "resolved": false, - "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", - "optional": true - }, - "string-width": { - "version": "1.0.2", - "resolved": false, - "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", - "optional": true, - "requires": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" - } - }, - "string_decoder": { - "version": "1.1.1", - "resolved": false, - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "optional": true, - "requires": { - "safe-buffer": "~5.1.0" - } - }, - "strip-ansi": { - "version": "3.0.1", - "resolved": false, - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", - "optional": true, - "requires": { - "ansi-regex": "^2.0.0" - } - }, - "strip-json-comments": { - "version": "2.0.1", - "resolved": false, - "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", - "optional": true - }, - "tar": { - "version": "4.4.8", - "resolved": false, - "integrity": "sha512-LzHF64s5chPQQS0IYBn9IN5h3i98c12bo4NCO7e0sGM2llXQ3p2FGC5sdENN4cTW48O915Sh+x+EXx7XW96xYQ==", - "optional": true, - "requires": { - "chownr": "^1.1.1", - "fs-minipass": "^1.2.5", - "minipass": "^2.3.4", - "minizlib": "^1.1.1", - "mkdirp": "^0.5.0", - "safe-buffer": "^5.1.2", - "yallist": "^3.0.2" - } - }, - "util-deprecate": { - "version": "1.0.2", - "resolved": false, - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", - "optional": true - }, - "wide-align": { - "version": "1.1.3", - "resolved": false, - "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", - "optional": true, - "requires": { - "string-width": "^1.0.2 || 2" - } - }, - "wrappy": { - "version": "1.0.2", - "resolved": false, - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", - "optional": true - }, - "yallist": { - "version": "3.0.3", - "resolved": false, - "integrity": "sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A==", - "optional": true - } - } - }, - "function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", - "dev": true - }, - "gensync": { - "version": "1.0.0-beta.1", - "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.1.tgz", - "integrity": "sha512-r8EC6NO1sngH/zdD9fiRDLdcgnbayXah+mLgManTaIZJqEC1MZstmnox8KpnI2/fxQwrp5OpCOYWLp4rBl4Jcg==", - "dev": true - }, - "get-value": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", - "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=", - "optional": true - }, - "glob": { - "version": "7.1.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", - "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "graceful-fs": { - "version": "4.1.15", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.15.tgz", - "integrity": "sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA==", - "optional": true - }, - "growl": { - "version": "1.10.5", - "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", - "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==", - "dev": true - }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true - }, - "has-symbols": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.1.tgz", - "integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==", - "dev": true - }, - "has-value": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", - "integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=", - "optional": true, - "requires": { - "get-value": "^2.0.6", - "has-values": "^1.0.0", - "isobject": "^3.0.0" - }, - "dependencies": { - "isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", - "optional": true - } - } - }, - "has-values": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz", - "integrity": "sha1-lbC2P+whRmGab+V/51Yo1aOe/k8=", - "optional": true, - "requires": { - "is-number": "^3.0.0", - "kind-of": "^4.0.0" - }, - "dependencies": { - "is-number": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", - "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", - "optional": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "optional": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "kind-of": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", - "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", - "optional": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "he": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/he/-/he-1.1.1.tgz", - "integrity": "sha1-k0EP0hsAlzUVH4howvJx80J+I/0=", - "dev": true - }, - "inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "requires": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "inherits": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" - }, - "invariant": { - "version": "2.2.4", - "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz", - "integrity": "sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==", - "dev": true, - "requires": { - "loose-envify": "^1.0.0" - } - }, - "is-accessor-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", - "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", - "optional": true, - "requires": { - "kind-of": "^3.0.2" - } - }, - "is-binary-path": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz", - "integrity": "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=", - "optional": true, - "requires": { - "binary-extensions": "^1.0.0" - } - }, - "is-buffer": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", - "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", - "optional": true - }, - "is-data-descriptor": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", - "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", - "optional": true, - "requires": { - "kind-of": "^3.0.2" - } - }, - "is-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", - "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", - "optional": true, - "requires": { - "is-accessor-descriptor": "^0.1.6", - "is-data-descriptor": "^0.1.4", - "kind-of": "^5.0.0" - }, - "dependencies": { - "kind-of": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", - "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", - "optional": true - } - } - }, - "is-extendable": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", - "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", - "optional": true - }, - "is-plain-object": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", - "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", - "optional": true, - "requires": { - "isobject": "^3.0.1" - }, - "dependencies": { - "isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", - "optional": true - } - } - }, - "is-windows": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", - "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", - "optional": true - }, - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" - }, - "js-tokens": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", - "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=", - "dev": true - }, - "just-extend": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/just-extend/-/just-extend-4.1.0.tgz", - "integrity": "sha512-ApcjaOdVTJ7y4r08xI5wIqpvwS48Q0PBG4DJROcEkH1f8MdAiNFyFxz3xoL0LWAVwjrwPYZdVHHxhRHcx/uGLA==", - "dev": true - }, - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "optional": true, - "requires": { - "is-buffer": "^1.1.5" - } - }, - "leven": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz", - "integrity": "sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==", - "dev": true - }, - "levenary": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/levenary/-/levenary-1.1.1.tgz", - "integrity": "sha512-mkAdOIt79FD6irqjYSs4rdbnlT5vRonMEvBVPVb3XmevfS8kgRXwfes0dhPdEtzTWD/1eNE/Bm/G1iRt6DcnQQ==", - "dev": true, - "requires": { - "leven": "^3.1.0" - } - }, - "locate-path": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", - "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", - "dev": true, - "requires": { - "p-locate": "^2.0.0", - "path-exists": "^3.0.0" - } - }, - "lolex": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/lolex/-/lolex-4.2.0.tgz", - "integrity": "sha512-gKO5uExCXvSm6zbF562EvM+rd1kQDnB9AZBbiQVzf1ZmdDpxUSvpnAaVOP83N/31mRK8Ml8/VE8DMvsAZQ+7wg==", - "dev": true - }, - "loose-envify": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", - "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", - "dev": true, - "requires": { - "js-tokens": "^3.0.0 || ^4.0.0" - } - }, - "make-dir": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz", - "integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==", - "requires": { - "pify": "^4.0.1", - "semver": "^5.6.0" - } - }, - "map-cache": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", - "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=", - "optional": true - }, - "map-visit": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", - "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=", - "optional": true, - "requires": { - "object-visit": "^1.0.0" - } - }, - "methods": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", - "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=" - }, - "mime": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", - "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==" - }, - "mime-db": { - "version": "1.37.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.37.0.tgz", - "integrity": "sha512-R3C4db6bgQhlIhPU48fUtdVmKnflq+hRdad7IyKhtFj06VPNVdk2RhiYL3UjQIlso8L+YxAtFkobT0VK+S/ybg==" - }, - "mime-types": { - "version": "2.1.21", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.21.tgz", - "integrity": "sha512-3iL6DbwpyLzjR3xHSFNFeb9Nz/M8WDkX33t1GFQnFOllWk8pOrh/LSrB5OXlnlW5P9LH73X6loW/eogc+F5lJg==", - "requires": { - "mime-db": "~1.37.0" - } - }, - "minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", - "requires": { - "brace-expansion": "^1.1.7" - } - }, - "minimist": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", - "dev": true - }, - "mixin-deep": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.1.tgz", - "integrity": "sha512-8ZItLHeEgaqEvd5lYBXfm4EZSFCX29Jb9K+lAHhDKzReKBQKj3R+7NOF6tjqYi9t4oI8VUfaWITJQm86wnXGNQ==", - "optional": true, - "requires": { - "for-in": "^1.0.2", - "is-extendable": "^1.0.1" - }, - "dependencies": { - "is-extendable": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", - "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", - "optional": true, - "requires": { - "is-plain-object": "^2.0.4" - } - } - } - }, - "mkdirp": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", - "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", - "dev": true, - "requires": { - "minimist": "0.0.8" - } - }, - "mocha": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-5.2.0.tgz", - "integrity": "sha512-2IUgKDhc3J7Uug+FxMXuqIyYzH7gJjXECKe/w43IGgQHTSj3InJi+yAA7T24L9bQMRKiUEHxEX37G5JpVUGLcQ==", - "dev": true, - "requires": { - "browser-stdout": "1.3.1", - "commander": "2.15.1", - "debug": "3.1.0", - "diff": "3.5.0", - "escape-string-regexp": "1.0.5", - "glob": "7.1.2", - "growl": "1.10.5", - "he": "1.1.1", - "minimatch": "3.0.4", - "mkdirp": "0.5.1", - "supports-color": "5.4.0" - }, - "dependencies": { - "commander": { - "version": "2.15.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.15.1.tgz", - "integrity": "sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag==", - "dev": true - }, - "debug": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", - "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", - "dev": true, - "requires": { - "ms": "2.0.0" - } - }, - "glob": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", - "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", - "dev": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "supports-color": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", - "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - } - } - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" - }, - "nan": { - "version": "2.12.1", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.12.1.tgz", - "integrity": "sha512-JY7V6lRkStKcKTvHO5NVSQRv+RV+FIL5pvDoLiAtSL9pKlC5x9PKQcZDsq7m4FO4d57mkhC6Z+QhAh3Jdk5JFw==", - "optional": true - }, - "nanomatch": { - "version": "1.2.13", - "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", - "integrity": "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==", - "optional": true, - "requires": { - "arr-diff": "^4.0.0", - "array-unique": "^0.3.2", - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "fragment-cache": "^0.2.1", - "is-windows": "^1.0.2", - "kind-of": "^6.0.2", - "object.pick": "^1.3.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" - }, - "dependencies": { - "arr-diff": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", - "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", - "optional": true - }, - "array-unique": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", - "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", - "optional": true - }, - "kind-of": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", - "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", - "optional": true - } - } - }, - "nise": { - "version": "1.5.3", - "resolved": "https://registry.npmjs.org/nise/-/nise-1.5.3.tgz", - "integrity": "sha512-Ymbac/94xeIrMf59REBPOv0thr+CJVFMhrlAkW/gjCIE58BGQdCj0x7KRCb3yz+Ga2Rz3E9XXSvUyyxqqhjQAQ==", - "dev": true, - "requires": { - "@sinonjs/formatio": "^3.2.1", - "@sinonjs/text-encoding": "^0.7.1", - "just-extend": "^4.0.2", - "lolex": "^5.0.1", - "path-to-regexp": "^1.7.0" - }, - "dependencies": { - "lolex": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/lolex/-/lolex-5.1.2.tgz", - "integrity": "sha512-h4hmjAvHTmd+25JSwrtTIuwbKdwg5NzZVRMLn9saij4SZaepCrTCxPr35H/3bjwfMJtN+t3CX8672UIkglz28A==", - "dev": true, - "requires": { - "@sinonjs/commons": "^1.7.0" - } - } - } - }, - "node-modules-regexp": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/node-modules-regexp/-/node-modules-regexp-1.0.0.tgz", - "integrity": "sha1-jZ2+KJZKSsVxLpExZCEHxx6Q7EA=", - "dev": true - }, - "node-releases": { - "version": "1.1.56", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.56.tgz", - "integrity": "sha512-EVo605FhWLygH8a64TjgpjyHYOihkxECwX1bHHr8tETJKWEiWS2YJjPbvsX2jFjnjTNEgBCmk9mLjKG1Mf11cw==", - "dev": true - }, - "object-copy": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", - "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=", - "optional": true, - "requires": { - "copy-descriptor": "^0.1.0", - "define-property": "^0.2.5", - "kind-of": "^3.0.3" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "optional": true, - "requires": { - "is-descriptor": "^0.1.0" - } - } - } - }, - "object-keys": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", - "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", - "dev": true - }, - "object-visit": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", - "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=", - "optional": true, - "requires": { - "isobject": "^3.0.0" - }, - "dependencies": { - "isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", - "optional": true - } - } - }, - "object.assign": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.0.tgz", - "integrity": "sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w==", - "dev": true, - "requires": { - "define-properties": "^1.1.2", - "function-bind": "^1.1.1", - "has-symbols": "^1.0.0", - "object-keys": "^1.0.11" - } - }, - "object.pick": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", - "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", - "optional": true, - "requires": { - "isobject": "^3.0.1" - }, - "dependencies": { - "isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", - "optional": true - } - } - }, - "once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "requires": { - "wrappy": "1" - } - }, - "p-limit": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", - "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", - "dev": true, - "requires": { - "p-try": "^1.0.0" - } - }, - "p-locate": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", - "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", - "dev": true, - "requires": { - "p-limit": "^1.1.0" - } - }, - "p-try": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", - "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", - "dev": true - }, - "pascalcase": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", - "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=", - "optional": true - }, - "path-dirname": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/path-dirname/-/path-dirname-1.0.2.tgz", - "integrity": "sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA=", - "optional": true - }, - "path-exists": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", - "dev": true - }, - "path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" - }, - "path-parse": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", - "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", - "dev": true - }, - "path-to-regexp": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.8.0.tgz", - "integrity": "sha512-n43JRhlUKUAlibEJhPeir1ncUID16QnEjNpwzNdO3Lm4ywrBpBZ5oLD0I6br9evr1Y9JTqwRtAh7JLoOzAQdVA==", - "dev": true, - "requires": { - "isarray": "0.0.1" - }, - "dependencies": { - "isarray": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", - "dev": true - } - } - }, - "pify": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", - "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==" - }, - "pirates": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.1.tgz", - "integrity": "sha512-WuNqLTbMI3tmfef2TKxlQmAiLHKtFhlsCZnPIpuv2Ow0RDVO8lfy1Opf4NUzlMXLjPl+Men7AuVdX6TA+s+uGA==", - "dev": true, - "requires": { - "node-modules-regexp": "^1.0.0" - } - }, - "pkg-dir": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-3.0.0.tgz", - "integrity": "sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw==", - "dev": true, - "requires": { - "find-up": "^3.0.0" - }, - "dependencies": { - "find-up": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", - "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", - "dev": true, - "requires": { - "locate-path": "^3.0.0" - } - }, - "locate-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", - "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", - "dev": true, - "requires": { - "p-locate": "^3.0.0", - "path-exists": "^3.0.0" - } - }, - "p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", - "dev": true, - "requires": { - "p-try": "^2.0.0" - } - }, - "p-locate": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", - "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", - "dev": true, - "requires": { - "p-limit": "^2.0.0" - } - }, - "p-try": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", - "dev": true - } - } - }, - "pkg-up": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/pkg-up/-/pkg-up-2.0.0.tgz", - "integrity": "sha1-yBmscoBZpGHKscOImivjxJoATX8=", - "dev": true, - "requires": { - "find-up": "^2.1.0" - } - }, - "posix-character-classes": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz", - "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=", - "optional": true - }, - "private": { - "version": "0.1.8", - "resolved": "https://registry.npmjs.org/private/-/private-0.1.8.tgz", - "integrity": "sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg==", - "dev": true - }, - "process-nextick-args": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", - "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==" - }, - "qs": { - "version": "6.6.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.6.0.tgz", - "integrity": "sha512-KIJqT9jQJDQx5h5uAVPimw6yVg2SekOKu959OCtktD3FjzbpvaPr8i4zzg07DOMz+igA4W/aNM7OV8H37pFYfA==" - }, - "readable-stream": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "readdirp": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.2.1.tgz", - "integrity": "sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ==", - "optional": true, - "requires": { - "graceful-fs": "^4.1.11", - "micromatch": "^3.1.10", - "readable-stream": "^2.0.2" - }, - "dependencies": { - "arr-diff": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", - "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", - "optional": true - }, - "array-unique": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", - "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", - "optional": true - }, - "braces": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", - "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", - "optional": true, - "requires": { - "arr-flatten": "^1.1.0", - "array-unique": "^0.3.2", - "extend-shallow": "^2.0.1", - "fill-range": "^4.0.0", - "isobject": "^3.0.1", - "repeat-element": "^1.1.2", - "snapdragon": "^0.8.1", - "snapdragon-node": "^2.0.1", - "split-string": "^3.0.2", - "to-regex": "^3.0.1" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "optional": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "expand-brackets": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", - "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", - "optional": true, - "requires": { - "debug": "^2.3.3", - "define-property": "^0.2.5", - "extend-shallow": "^2.0.1", - "posix-character-classes": "^0.1.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "optional": true, - "requires": { - "is-descriptor": "^0.1.0" - } - }, - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "optional": true, - "requires": { - "is-extendable": "^0.1.0" - } - }, - "is-accessor-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", - "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", - "optional": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "optional": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "is-data-descriptor": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", - "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", - "optional": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "optional": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "is-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", - "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", - "optional": true, - "requires": { - "is-accessor-descriptor": "^0.1.6", - "is-data-descriptor": "^0.1.4", - "kind-of": "^5.0.0" - } - }, - "kind-of": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", - "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", - "optional": true - } - } - }, - "extglob": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", - "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", - "optional": true, - "requires": { - "array-unique": "^0.3.2", - "define-property": "^1.0.0", - "expand-brackets": "^2.1.4", - "extend-shallow": "^2.0.1", - "fragment-cache": "^0.2.1", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" - }, - "dependencies": { - "define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", - "optional": true, - "requires": { - "is-descriptor": "^1.0.0" - } - }, - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "optional": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "fill-range": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", - "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", - "optional": true, - "requires": { - "extend-shallow": "^2.0.1", - "is-number": "^3.0.0", - "repeat-string": "^1.6.1", - "to-regex-range": "^2.1.0" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "optional": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "optional": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "optional": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "optional": true, - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - } - }, - "is-number": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", - "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", - "optional": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "optional": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", - "optional": true - }, - "kind-of": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", - "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", - "optional": true - }, - "micromatch": { - "version": "3.1.10", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", - "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", - "optional": true, - "requires": { - "arr-diff": "^4.0.0", - "array-unique": "^0.3.2", - "braces": "^2.3.1", - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "extglob": "^2.0.4", - "fragment-cache": "^0.2.1", - "kind-of": "^6.0.2", - "nanomatch": "^1.2.9", - "object.pick": "^1.3.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.2" - } - } - } - }, - "regenerate": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.0.tgz", - "integrity": "sha512-1G6jJVDWrt0rK99kBjvEtziZNCICAuvIPkSiUFIQxVP06RCVpq3dmDo2oi6ABpYaDYaTRr67BEhL8r1wgEZZKg==", - "dev": true - }, - "regenerate-unicode-properties": { - "version": "8.2.0", - "resolved": "https://registry.npmjs.org/regenerate-unicode-properties/-/regenerate-unicode-properties-8.2.0.tgz", - "integrity": "sha512-F9DjY1vKLo/tPePDycuH3dn9H1OTPIkVD9Kz4LODu+F2C75mgjAJ7x/gwy6ZcSNRAAkhNlJSOHRe8k3p+K9WhA==", - "dev": true, - "requires": { - "regenerate": "^1.4.0" - } - }, - "regex-not": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", - "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", - "optional": true, - "requires": { - "extend-shallow": "^3.0.2", - "safe-regex": "^1.1.0" - } - }, - "remove-trailing-separator": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", - "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=", - "optional": true - }, - "repeat-element": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.3.tgz", - "integrity": "sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g==", - "optional": true - }, - "repeat-string": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", - "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", - "optional": true - }, - "resolve": { - "version": "1.17.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz", - "integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==", - "dev": true, - "requires": { - "path-parse": "^1.0.6" - } - }, - "resolve-url": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", - "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=", - "optional": true - }, - "ret": { - "version": "0.1.15", - "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", - "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", - "optional": true - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - }, - "safe-regex": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", - "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", - "optional": true, - "requires": { - "ret": "~0.1.10" - } - }, - "semver": { - "version": "5.6.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.6.0.tgz", - "integrity": "sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg==" - }, - "set-value": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.0.tgz", - "integrity": "sha512-hw0yxk9GT/Hr5yJEYnHNKYXkIA8mVJgd9ditYZCe16ZczcaELYYcfvaXesNACk2O8O0nTiPQcQhGUQj8JLzeeg==", - "optional": true, - "requires": { - "extend-shallow": "^2.0.1", - "is-extendable": "^0.1.1", - "is-plain-object": "^2.0.3", - "split-string": "^3.0.1" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "optional": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "sinon": { - "version": "7.5.0", - "resolved": "https://registry.npmjs.org/sinon/-/sinon-7.5.0.tgz", - "integrity": "sha512-AoD0oJWerp0/rY9czP/D6hDTTUYGpObhZjMpd7Cl/A6+j0xBE+ayL/ldfggkBXUs0IkvIiM1ljM8+WkOc5k78Q==", - "dev": true, - "requires": { - "@sinonjs/commons": "^1.4.0", - "@sinonjs/formatio": "^3.2.1", - "@sinonjs/samsam": "^3.3.3", - "diff": "^3.5.0", - "lolex": "^4.2.0", - "nise": "^1.5.2", - "supports-color": "^5.5.0" - }, - "dependencies": { - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - } - } - }, - "snapdragon": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", - "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==", - "optional": true, - "requires": { - "base": "^0.11.1", - "debug": "^2.2.0", - "define-property": "^0.2.5", - "extend-shallow": "^2.0.1", - "map-cache": "^0.2.2", - "source-map": "^0.5.6", - "source-map-resolve": "^0.5.0", - "use": "^3.1.0" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "optional": true, - "requires": { - "is-descriptor": "^0.1.0" - } - }, - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "optional": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "snapdragon-node": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz", - "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==", - "optional": true, - "requires": { - "define-property": "^1.0.0", - "isobject": "^3.0.0", - "snapdragon-util": "^3.0.1" - }, - "dependencies": { - "define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", - "optional": true, - "requires": { - "is-descriptor": "^1.0.0" - } - }, - "is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "optional": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "optional": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "optional": true, - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - } - }, - "isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", - "optional": true - }, - "kind-of": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", - "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", - "optional": true - } - } - }, - "snapdragon-util": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz", - "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==", - "optional": true, - "requires": { - "kind-of": "^3.2.0" - } - }, - "source-map": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=" - }, - "source-map-resolve": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.2.tgz", - "integrity": "sha512-MjqsvNwyz1s0k81Goz/9vRBe9SZdB09Bdw+/zYyO+3CuPk6fouTaxscHkgtE8jKvf01kVfl8riHzERQ/kefaSA==", - "optional": true, - "requires": { - "atob": "^2.1.1", - "decode-uri-component": "^0.2.0", - "resolve-url": "^0.2.1", - "source-map-url": "^0.4.0", - "urix": "^0.1.0" - } - }, - "source-map-url": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.0.tgz", - "integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM=", - "optional": true - }, - "split-string": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", - "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", - "optional": true, - "requires": { - "extend-shallow": "^3.0.0" - } - }, - "static-extend": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", - "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=", - "optional": true, - "requires": { - "define-property": "^0.2.5", - "object-copy": "^0.1.0" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "optional": true, - "requires": { - "is-descriptor": "^0.1.0" - } - } - } - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "requires": { - "safe-buffer": "~5.1.0" - } - }, - "superagent": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/superagent/-/superagent-3.7.0.tgz", - "integrity": "sha512-/8trxO6NbLx4YXb7IeeFTSmsQ35pQBiTBsLNvobZx7qBzBeHYvKCyIIhW2gNcWbLzYxPAjdgFbiepd8ypwC0Gw==", - "requires": { - "component-emitter": "^1.2.0", - "cookiejar": "^2.1.0", - "debug": "^3.1.0", - "extend": "^3.0.0", - "form-data": "^2.3.1", - "formidable": "^1.1.1", - "methods": "^1.1.1", - "mime": "^1.4.1", - "qs": "^6.5.1", - "readable-stream": "^2.0.5" - }, - "dependencies": { - "debug": { - "version": "3.2.6", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", - "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", - "requires": { - "ms": "^2.1.1" - } - }, - "ms": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", - "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==" - } - } - }, - "to-object-path": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz", - "integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=", - "optional": true, - "requires": { - "kind-of": "^3.0.2" - } - }, - "to-regex": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz", - "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==", - "optional": true, - "requires": { - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "regex-not": "^1.0.2", - "safe-regex": "^1.1.0" - } - }, - "to-regex-range": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", - "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", - "optional": true, - "requires": { - "is-number": "^3.0.0", - "repeat-string": "^1.6.1" - }, - "dependencies": { - "is-number": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", - "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", - "optional": true, - "requires": { - "kind-of": "^3.0.2" - } - } - } - }, - "type-detect": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", - "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", - "dev": true - }, - "unicode-canonical-property-names-ecmascript": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-1.0.4.tgz", - "integrity": "sha512-jDrNnXWHd4oHiTZnx/ZG7gtUTVp+gCcTTKr8L0HjlwphROEW3+Him+IpvC+xcJEFegapiMZyZe02CyuOnRmbnQ==", - "dev": true - }, - "unicode-match-property-ecmascript": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-1.0.4.tgz", - "integrity": "sha512-L4Qoh15vTfntsn4P1zqnHulG0LdXgjSO035fEpdtp6YxXhMT51Q6vgM5lYdG/5X3MjS+k/Y9Xw4SFCY9IkR0rg==", - "dev": true, - "requires": { - "unicode-canonical-property-names-ecmascript": "^1.0.4", - "unicode-property-aliases-ecmascript": "^1.0.4" - } - }, - "unicode-match-property-value-ecmascript": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-1.2.0.tgz", - "integrity": "sha512-wjuQHGQVofmSJv1uVISKLE5zO2rNGzM/KCYZch/QQvez7C1hUhBIuZ701fYXExuufJFMPhv2SyL8CyoIfMLbIQ==", - "dev": true - }, - "unicode-property-aliases-ecmascript": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-1.1.0.tgz", - "integrity": "sha512-PqSoPh/pWetQ2phoj5RLiaqIk4kCNwoV3CI+LfGmWLKI3rE3kl1h59XpX2BjgDrmbxD9ARtQobPGU1SguCYuQg==", - "dev": true - }, - "union-value": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.0.tgz", - "integrity": "sha1-XHHDTLW61dzr4+oM0IIHulqhrqQ=", - "optional": true, - "requires": { - "arr-union": "^3.1.0", - "get-value": "^2.0.6", - "is-extendable": "^0.1.1", - "set-value": "^0.4.3" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "optional": true, - "requires": { - "is-extendable": "^0.1.0" - } - }, - "set-value": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/set-value/-/set-value-0.4.3.tgz", - "integrity": "sha1-fbCPnT0i3H945Trzw79GZuzfzPE=", - "optional": true, - "requires": { - "extend-shallow": "^2.0.1", - "is-extendable": "^0.1.1", - "is-plain-object": "^2.0.1", - "to-object-path": "^0.3.0" - } - } - } - }, - "unset-value": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", - "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=", - "optional": true, - "requires": { - "has-value": "^0.3.1", - "isobject": "^3.0.0" - }, - "dependencies": { - "has-value": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz", - "integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=", - "optional": true, - "requires": { - "get-value": "^2.0.3", - "has-values": "^0.1.4", - "isobject": "^2.0.0" - }, - "dependencies": { - "isobject": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", - "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", - "optional": true, - "requires": { - "isarray": "1.0.0" - } - } - } - }, - "has-values": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz", - "integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E=", - "optional": true - }, - "isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", - "optional": true - } - } - }, - "upath": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/upath/-/upath-1.2.0.tgz", - "integrity": "sha512-aZwGpamFO61g3OlfT7OQCHqhGnW43ieH9WZeP7QxN/G/jS4jfqUkZxoryvJgVPEcrl5NL/ggHsSmLMHuH64Lhg==", - "optional": true - }, - "urix": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", - "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=", - "optional": true - }, - "use": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", - "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==", - "optional": true - }, - "util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" - }, - "wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" - } - } -} diff --git a/samples/client/petstore/javascript-es6/package.json b/samples/client/petstore/javascript-es6/package.json index 0032c37d4775..6c8020661c9a 100644 --- a/samples/client/petstore/javascript-es6/package.json +++ b/samples/client/petstore/javascript-es6/package.json @@ -14,7 +14,7 @@ }, "dependencies": { "@babel/cli": "^7.0.0", - "superagent": "3.7.0" + "superagent": "^5.3.0" }, "devDependencies": { "@babel/core": "^7.0.0", @@ -37,7 +37,7 @@ "@babel/preset-env": "^7.0.0", "@babel/register": "^7.0.0", "expect.js": "^0.3.1", - "mocha": "^5.2.0", + "mocha": "^8.0.1", "sinon": "^7.2.0" }, "files": [ diff --git a/samples/client/petstore/javascript-promise-es6/package-lock.json b/samples/client/petstore/javascript-promise-es6/package-lock.json deleted file mode 100644 index c00cfcc04103..000000000000 --- a/samples/client/petstore/javascript-promise-es6/package-lock.json +++ /dev/null @@ -1,3395 +0,0 @@ -{ - "name": "open_api_petstore", - "version": "1.0.0", - "lockfileVersion": 1, - "requires": true, - "dependencies": { - "@babel/cli": { - "version": "7.8.4", - "resolved": "https://registry.npmjs.org/@babel/cli/-/cli-7.8.4.tgz", - "integrity": "sha512-XXLgAm6LBbaNxaGhMAznXXaxtCWfuv6PIDJ9Alsy9JYTOh+j2jJz+L/162kkfU1j/pTSxK1xGmlwI4pdIMkoag==", - "requires": { - "chokidar": "^2.1.8", - "commander": "^4.0.1", - "convert-source-map": "^1.1.0", - "fs-readdir-recursive": "^1.1.0", - "glob": "^7.0.0", - "lodash": "^4.17.13", - "make-dir": "^2.1.0", - "slash": "^2.0.0", - "source-map": "^0.5.0" - } - }, - "@babel/code-frame": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.8.3.tgz", - "integrity": "sha512-a9gxpmdXtZEInkCSHUJDLHZVBgb1QS0jhss4cPP93EW7s+uC5bikET2twEF3KV+7rDblJcmNvTR7VJejqd2C2g==", - "dev": true, - "requires": { - "@babel/highlight": "^7.8.3" - } - }, - "@babel/compat-data": { - "version": "7.9.6", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.9.6.tgz", - "integrity": "sha512-5QPTrNen2bm7RBc7dsOmcA5hbrS4O2Vhmk5XOL4zWW/zD/hV0iinpefDlkm+tBBy8kDtFaaeEvmAqt+nURAV2g==", - "dev": true, - "requires": { - "browserslist": "^4.11.1", - "invariant": "^2.2.4", - "semver": "^5.5.0" - } - }, - "@babel/core": { - "version": "7.9.6", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.9.6.tgz", - "integrity": "sha512-nD3deLvbsApbHAHttzIssYqgb883yU/d9roe4RZymBCDaZryMJDbptVpEpeQuRh4BJ+SYI8le9YGxKvFEvl1Wg==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.8.3", - "@babel/generator": "^7.9.6", - "@babel/helper-module-transforms": "^7.9.0", - "@babel/helpers": "^7.9.6", - "@babel/parser": "^7.9.6", - "@babel/template": "^7.8.6", - "@babel/traverse": "^7.9.6", - "@babel/types": "^7.9.6", - "convert-source-map": "^1.7.0", - "debug": "^4.1.0", - "gensync": "^1.0.0-beta.1", - "json5": "^2.1.2", - "lodash": "^4.17.13", - "resolve": "^1.3.2", - "semver": "^5.4.1", - "source-map": "^0.5.0" - }, - "dependencies": { - "debug": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", - "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", - "dev": true, - "requires": { - "ms": "^2.1.1" - } - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - } - } - }, - "@babel/generator": { - "version": "7.9.6", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.9.6.tgz", - "integrity": "sha512-+htwWKJbH2bL72HRluF8zumBxzuX0ZZUFl3JLNyoUjM/Ho8wnVpPXM6aUz8cfKDqQ/h7zHqKt4xzJteUosckqQ==", - "dev": true, - "requires": { - "@babel/types": "^7.9.6", - "jsesc": "^2.5.1", - "lodash": "^4.17.13", - "source-map": "^0.5.0" - } - }, - "@babel/helper-annotate-as-pure": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.8.3.tgz", - "integrity": "sha512-6o+mJrZBxOoEX77Ezv9zwW7WV8DdluouRKNY/IR5u/YTMuKHgugHOzYWlYvYLpLA9nPsQCAAASpCIbjI9Mv+Uw==", - "dev": true, - "requires": { - "@babel/types": "^7.8.3" - } - }, - "@babel/helper-builder-binary-assignment-operator-visitor": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.8.3.tgz", - "integrity": "sha512-5eFOm2SyFPK4Rh3XMMRDjN7lBH0orh3ss0g3rTYZnBQ+r6YPj7lgDyCvPphynHvUrobJmeMignBr6Acw9mAPlw==", - "dev": true, - "requires": { - "@babel/helper-explode-assignable-expression": "^7.8.3", - "@babel/types": "^7.8.3" - } - }, - "@babel/helper-compilation-targets": { - "version": "7.9.6", - "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.9.6.tgz", - "integrity": "sha512-x2Nvu0igO0ejXzx09B/1fGBxY9NXQlBW2kZsSxCJft+KHN8t9XWzIvFxtPHnBOAXpVsdxZKZFbRUC8TsNKajMw==", - "dev": true, - "requires": { - "@babel/compat-data": "^7.9.6", - "browserslist": "^4.11.1", - "invariant": "^2.2.4", - "levenary": "^1.1.1", - "semver": "^5.5.0" - } - }, - "@babel/helper-create-class-features-plugin": { - "version": "7.9.6", - "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.9.6.tgz", - "integrity": "sha512-6N9IeuyHvMBRyjNYOMJHrhwtu4WJMrYf8hVbEHD3pbbbmNOk1kmXSQs7bA4dYDUaIx4ZEzdnvo6NwC3WHd/Qow==", - "dev": true, - "requires": { - "@babel/helper-function-name": "^7.9.5", - "@babel/helper-member-expression-to-functions": "^7.8.3", - "@babel/helper-optimise-call-expression": "^7.8.3", - "@babel/helper-plugin-utils": "^7.8.3", - "@babel/helper-replace-supers": "^7.9.6", - "@babel/helper-split-export-declaration": "^7.8.3" - } - }, - "@babel/helper-create-regexp-features-plugin": { - "version": "7.8.8", - "resolved": "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.8.8.tgz", - "integrity": "sha512-LYVPdwkrQEiX9+1R29Ld/wTrmQu1SSKYnuOk3g0CkcZMA1p0gsNxJFj/3gBdaJ7Cg0Fnek5z0DsMULePP7Lrqg==", - "dev": true, - "requires": { - "@babel/helper-annotate-as-pure": "^7.8.3", - "@babel/helper-regex": "^7.8.3", - "regexpu-core": "^4.7.0" - } - }, - "@babel/helper-define-map": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-define-map/-/helper-define-map-7.8.3.tgz", - "integrity": "sha512-PoeBYtxoZGtct3md6xZOCWPcKuMuk3IHhgxsRRNtnNShebf4C8YonTSblsK4tvDbm+eJAw2HAPOfCr+Q/YRG/g==", - "dev": true, - "requires": { - "@babel/helper-function-name": "^7.8.3", - "@babel/types": "^7.8.3", - "lodash": "^4.17.13" - } - }, - "@babel/helper-explode-assignable-expression": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.8.3.tgz", - "integrity": "sha512-N+8eW86/Kj147bO9G2uclsg5pwfs/fqqY5rwgIL7eTBklgXjcOJ3btzS5iM6AitJcftnY7pm2lGsrJVYLGjzIw==", - "dev": true, - "requires": { - "@babel/traverse": "^7.8.3", - "@babel/types": "^7.8.3" - } - }, - "@babel/helper-function-name": { - "version": "7.9.5", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.9.5.tgz", - "integrity": "sha512-JVcQZeXM59Cd1qanDUxv9fgJpt3NeKUaqBqUEvfmQ+BCOKq2xUgaWZW2hr0dkbyJgezYuplEoh5knmrnS68efw==", - "dev": true, - "requires": { - "@babel/helper-get-function-arity": "^7.8.3", - "@babel/template": "^7.8.3", - "@babel/types": "^7.9.5" - } - }, - "@babel/helper-get-function-arity": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.8.3.tgz", - "integrity": "sha512-FVDR+Gd9iLjUMY1fzE2SR0IuaJToR4RkCDARVfsBBPSP53GEqSFjD8gNyxg246VUyc/ALRxFaAK8rVG7UT7xRA==", - "dev": true, - "requires": { - "@babel/types": "^7.8.3" - } - }, - "@babel/helper-hoist-variables": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.8.3.tgz", - "integrity": "sha512-ky1JLOjcDUtSc+xkt0xhYff7Z6ILTAHKmZLHPxAhOP0Nd77O+3nCsd6uSVYur6nJnCI029CrNbYlc0LoPfAPQg==", - "dev": true, - "requires": { - "@babel/types": "^7.8.3" - } - }, - "@babel/helper-member-expression-to-functions": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.8.3.tgz", - "integrity": "sha512-fO4Egq88utkQFjbPrSHGmGLFqmrshs11d46WI+WZDESt7Wu7wN2G2Iu+NMMZJFDOVRHAMIkB5SNh30NtwCA7RA==", - "dev": true, - "requires": { - "@babel/types": "^7.8.3" - } - }, - "@babel/helper-module-imports": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.8.3.tgz", - "integrity": "sha512-R0Bx3jippsbAEtzkpZ/6FIiuzOURPcMjHp+Z6xPe6DtApDJx+w7UYyOLanZqO8+wKR9G10s/FmHXvxaMd9s6Kg==", - "dev": true, - "requires": { - "@babel/types": "^7.8.3" - } - }, - "@babel/helper-module-transforms": { - "version": "7.9.0", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.9.0.tgz", - "integrity": "sha512-0FvKyu0gpPfIQ8EkxlrAydOWROdHpBmiCiRwLkUiBGhCUPRRbVD2/tm3sFr/c/GWFrQ/ffutGUAnx7V0FzT2wA==", - "dev": true, - "requires": { - "@babel/helper-module-imports": "^7.8.3", - "@babel/helper-replace-supers": "^7.8.6", - "@babel/helper-simple-access": "^7.8.3", - "@babel/helper-split-export-declaration": "^7.8.3", - "@babel/template": "^7.8.6", - "@babel/types": "^7.9.0", - "lodash": "^4.17.13" - } - }, - "@babel/helper-optimise-call-expression": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.8.3.tgz", - "integrity": "sha512-Kag20n86cbO2AvHca6EJsvqAd82gc6VMGule4HwebwMlwkpXuVqrNRj6CkCV2sKxgi9MyAUnZVnZ6lJ1/vKhHQ==", - "dev": true, - "requires": { - "@babel/types": "^7.8.3" - } - }, - "@babel/helper-plugin-utils": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.8.3.tgz", - "integrity": "sha512-j+fq49Xds2smCUNYmEHF9kGNkhbet6yVIBp4e6oeQpH1RUs/Ir06xUKzDjDkGcaaokPiTNs2JBWHjaE4csUkZQ==", - "dev": true - }, - "@babel/helper-regex": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-regex/-/helper-regex-7.8.3.tgz", - "integrity": "sha512-BWt0QtYv/cg/NecOAZMdcn/waj/5P26DR4mVLXfFtDokSR6fyuG0Pj+e2FqtSME+MqED1khnSMulkmGl8qWiUQ==", - "dev": true, - "requires": { - "lodash": "^4.17.13" - } - }, - "@babel/helper-remap-async-to-generator": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.8.3.tgz", - "integrity": "sha512-kgwDmw4fCg7AVgS4DukQR/roGp+jP+XluJE5hsRZwxCYGg+Rv9wSGErDWhlI90FODdYfd4xG4AQRiMDjjN0GzA==", - "dev": true, - "requires": { - "@babel/helper-annotate-as-pure": "^7.8.3", - "@babel/helper-wrap-function": "^7.8.3", - "@babel/template": "^7.8.3", - "@babel/traverse": "^7.8.3", - "@babel/types": "^7.8.3" - } - }, - "@babel/helper-replace-supers": { - "version": "7.9.6", - "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.9.6.tgz", - "integrity": "sha512-qX+chbxkbArLyCImk3bWV+jB5gTNU/rsze+JlcF6Nf8tVTigPJSI1o1oBow/9Resa1yehUO9lIipsmu9oG4RzA==", - "dev": true, - "requires": { - "@babel/helper-member-expression-to-functions": "^7.8.3", - "@babel/helper-optimise-call-expression": "^7.8.3", - "@babel/traverse": "^7.9.6", - "@babel/types": "^7.9.6" - } - }, - "@babel/helper-simple-access": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.8.3.tgz", - "integrity": "sha512-VNGUDjx5cCWg4vvCTR8qQ7YJYZ+HBjxOgXEl7ounz+4Sn7+LMD3CFrCTEU6/qXKbA2nKg21CwhhBzO0RpRbdCw==", - "dev": true, - "requires": { - "@babel/template": "^7.8.3", - "@babel/types": "^7.8.3" - } - }, - "@babel/helper-split-export-declaration": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.8.3.tgz", - "integrity": "sha512-3x3yOeyBhW851hroze7ElzdkeRXQYQbFIb7gLK1WQYsw2GWDay5gAJNw1sWJ0VFP6z5J1whqeXH/WCdCjZv6dA==", - "dev": true, - "requires": { - "@babel/types": "^7.8.3" - } - }, - "@babel/helper-validator-identifier": { - "version": "7.9.5", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.9.5.tgz", - "integrity": "sha512-/8arLKUFq882w4tWGj9JYzRpAlZgiWUJ+dtteNTDqrRBz9Iguck9Rn3ykuBDoUwh2TO4tSAJlrxDUOXWklJe4g==", - "dev": true - }, - "@babel/helper-wrap-function": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.8.3.tgz", - "integrity": "sha512-LACJrbUET9cQDzb6kG7EeD7+7doC3JNvUgTEQOx2qaO1fKlzE/Bf05qs9w1oXQMmXlPO65lC3Tq9S6gZpTErEQ==", - "dev": true, - "requires": { - "@babel/helper-function-name": "^7.8.3", - "@babel/template": "^7.8.3", - "@babel/traverse": "^7.8.3", - "@babel/types": "^7.8.3" - } - }, - "@babel/helpers": { - "version": "7.9.6", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.9.6.tgz", - "integrity": "sha512-tI4bUbldloLcHWoRUMAj4g1bF313M/o6fBKhIsb3QnGVPwRm9JsNf/gqMkQ7zjqReABiffPV6RWj7hEglID5Iw==", - "dev": true, - "requires": { - "@babel/template": "^7.8.3", - "@babel/traverse": "^7.9.6", - "@babel/types": "^7.9.6" - } - }, - "@babel/highlight": { - "version": "7.9.0", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.9.0.tgz", - "integrity": "sha512-lJZPilxX7Op3Nv/2cvFdnlepPXDxi29wxteT57Q965oc5R9v86ztx0jfxVrTcBk8C2kcPkkDa2Z4T3ZsPPVWsQ==", - "dev": true, - "requires": { - "@babel/helper-validator-identifier": "^7.9.0", - "chalk": "^2.0.0", - "js-tokens": "^4.0.0" - } - }, - "@babel/parser": { - "version": "7.9.6", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.9.6.tgz", - "integrity": "sha512-AoeIEJn8vt+d/6+PXDRPaksYhnlbMIiejioBZvvMQsOjW/JYK6k/0dKnvvP3EhK5GfMBWDPtrxRtegWdAcdq9Q==", - "dev": true - }, - "@babel/plugin-proposal-async-generator-functions": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.8.3.tgz", - "integrity": "sha512-NZ9zLv848JsV3hs8ryEh7Uaz/0KsmPLqv0+PdkDJL1cJy0K4kOCFa8zc1E3mp+RHPQcpdfb/6GovEsW4VDrOMw==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.3", - "@babel/helper-remap-async-to-generator": "^7.8.3", - "@babel/plugin-syntax-async-generators": "^7.8.0" - } - }, - "@babel/plugin-proposal-class-properties": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.8.3.tgz", - "integrity": "sha512-EqFhbo7IosdgPgZggHaNObkmO1kNUe3slaKu54d5OWvy+p9QIKOzK1GAEpAIsZtWVtPXUHSMcT4smvDrCfY4AA==", - "dev": true, - "requires": { - "@babel/helper-create-class-features-plugin": "^7.8.3", - "@babel/helper-plugin-utils": "^7.8.3" - } - }, - "@babel/plugin-proposal-decorators": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-decorators/-/plugin-proposal-decorators-7.8.3.tgz", - "integrity": "sha512-e3RvdvS4qPJVTe288DlXjwKflpfy1hr0j5dz5WpIYYeP7vQZg2WfAEIp8k5/Lwis/m5REXEteIz6rrcDtXXG7w==", - "dev": true, - "requires": { - "@babel/helper-create-class-features-plugin": "^7.8.3", - "@babel/helper-plugin-utils": "^7.8.3", - "@babel/plugin-syntax-decorators": "^7.8.3" - } - }, - "@babel/plugin-proposal-do-expressions": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-do-expressions/-/plugin-proposal-do-expressions-7.8.3.tgz", - "integrity": "sha512-NoMcN+0+SS1DVswjDCfz+Jfm9ViOYuFtv1lm0QInEugbEXK2iH3jeSq38WmIiTP+2QKqo2zt8xku77gqHINZkw==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.3", - "@babel/plugin-syntax-do-expressions": "^7.8.3" - } - }, - "@babel/plugin-proposal-dynamic-import": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-dynamic-import/-/plugin-proposal-dynamic-import-7.8.3.tgz", - "integrity": "sha512-NyaBbyLFXFLT9FP+zk0kYlUlA8XtCUbehs67F0nnEg7KICgMc2mNkIeu9TYhKzyXMkrapZFwAhXLdnt4IYHy1w==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.3", - "@babel/plugin-syntax-dynamic-import": "^7.8.0" - } - }, - "@babel/plugin-proposal-export-default-from": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-export-default-from/-/plugin-proposal-export-default-from-7.8.3.tgz", - "integrity": "sha512-PYtv2S2OdCdp7GSPDg5ndGZFm9DmWFvuLoS5nBxZCgOBggluLnhTScspJxng96alHQzPyrrHxvC9/w4bFuspeA==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.3", - "@babel/plugin-syntax-export-default-from": "^7.8.3" - } - }, - "@babel/plugin-proposal-export-namespace-from": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-export-namespace-from/-/plugin-proposal-export-namespace-from-7.8.3.tgz", - "integrity": "sha512-WKK+9jz6TWUTX1uej9/EUVOmM1sK7aHv6bZyxbUV3NJjbiIZRqJITeXGMo7D631J72PEnIORh5VOlFCSlrLicg==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.3", - "@babel/plugin-syntax-export-namespace-from": "^7.8.3" - } - }, - "@babel/plugin-proposal-function-bind": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-function-bind/-/plugin-proposal-function-bind-7.8.3.tgz", - "integrity": "sha512-6q7VAHJQa9x4P6Lm6h6KHoJUEhx2r1buFKseHICe0ogb1LWxducO4tsQp3hd/7BVBo485YBsn6tJnpuwWm/9cA==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.3", - "@babel/plugin-syntax-function-bind": "^7.8.3" - } - }, - "@babel/plugin-proposal-function-sent": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-function-sent/-/plugin-proposal-function-sent-7.8.3.tgz", - "integrity": "sha512-lu9wQjLnXd6Zy6eBKr0gE175xfD+da1rv2wOWEnZlD5KIxl894Tg34ppZ7ANR0jzQJMn+7pGuzSdy6JK4zGtKg==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.3", - "@babel/helper-wrap-function": "^7.8.3", - "@babel/plugin-syntax-function-sent": "^7.8.3" - } - }, - "@babel/plugin-proposal-json-strings": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.8.3.tgz", - "integrity": "sha512-KGhQNZ3TVCQG/MjRbAUwuH+14y9q0tpxs1nWWs3pbSleRdDro9SAMMDyye8HhY1gqZ7/NqIc8SKhya0wRDgP1Q==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.3", - "@babel/plugin-syntax-json-strings": "^7.8.0" - } - }, - "@babel/plugin-proposal-logical-assignment-operators": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-logical-assignment-operators/-/plugin-proposal-logical-assignment-operators-7.8.3.tgz", - "integrity": "sha512-TLPLojGZYBeeoesO2NQIMLUJKD9N5oJlxG6iHLx7l7EvNQP5DfzeyxdI2lMPo5I7ih4Jv/vxrlwIPf6aJw422Q==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.3", - "@babel/plugin-syntax-logical-assignment-operators": "^7.8.3" - } - }, - "@babel/plugin-proposal-nullish-coalescing-operator": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-nullish-coalescing-operator/-/plugin-proposal-nullish-coalescing-operator-7.8.3.tgz", - "integrity": "sha512-TS9MlfzXpXKt6YYomudb/KU7nQI6/xnapG6in1uZxoxDghuSMZsPb6D2fyUwNYSAp4l1iR7QtFOjkqcRYcUsfw==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.3", - "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.0" - } - }, - "@babel/plugin-proposal-numeric-separator": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-numeric-separator/-/plugin-proposal-numeric-separator-7.8.3.tgz", - "integrity": "sha512-jWioO1s6R/R+wEHizfaScNsAx+xKgwTLNXSh7tTC4Usj3ItsPEhYkEpU4h+lpnBwq7NBVOJXfO6cRFYcX69JUQ==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.3", - "@babel/plugin-syntax-numeric-separator": "^7.8.3" - } - }, - "@babel/plugin-proposal-object-rest-spread": { - "version": "7.9.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.9.6.tgz", - "integrity": "sha512-Ga6/fhGqA9Hj+y6whNpPv8psyaK5xzrQwSPsGPloVkvmH+PqW1ixdnfJ9uIO06OjQNYol3PMnfmJ8vfZtkzF+A==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.3", - "@babel/plugin-syntax-object-rest-spread": "^7.8.0", - "@babel/plugin-transform-parameters": "^7.9.5" - } - }, - "@babel/plugin-proposal-optional-catch-binding": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.8.3.tgz", - "integrity": "sha512-0gkX7J7E+AtAw9fcwlVQj8peP61qhdg/89D5swOkjYbkboA2CVckn3kiyum1DE0wskGb7KJJxBdyEBApDLLVdw==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.3", - "@babel/plugin-syntax-optional-catch-binding": "^7.8.0" - } - }, - "@babel/plugin-proposal-optional-chaining": { - "version": "7.9.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.9.0.tgz", - "integrity": "sha512-NDn5tu3tcv4W30jNhmc2hyD5c56G6cXx4TesJubhxrJeCvuuMpttxr0OnNCqbZGhFjLrg+NIhxxC+BK5F6yS3w==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.3", - "@babel/plugin-syntax-optional-chaining": "^7.8.0" - } - }, - "@babel/plugin-proposal-pipeline-operator": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-pipeline-operator/-/plugin-proposal-pipeline-operator-7.8.3.tgz", - "integrity": "sha512-Z0qV3aUYoLUAnVLdfLTlz/GJYfcrbX7Mhrp897Twik29wQseAFAAXQ4TPvN1oswVBHdN74sLPIn9HVfTXtjuQA==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.3", - "@babel/plugin-syntax-pipeline-operator": "^7.8.3" - } - }, - "@babel/plugin-proposal-throw-expressions": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-throw-expressions/-/plugin-proposal-throw-expressions-7.8.3.tgz", - "integrity": "sha512-tH40s9JnoR+r45ZXKWW+PC5xzPQfVJix3pR1D8Ty5l9sn5NnrbZUzw8MtnNxu/Bz7p0imyeSYj9FQVccEymOEg==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.3", - "@babel/plugin-syntax-throw-expressions": "^7.8.3" - } - }, - "@babel/plugin-proposal-unicode-property-regex": { - "version": "7.8.8", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.8.8.tgz", - "integrity": "sha512-EVhjVsMpbhLw9ZfHWSx2iy13Q8Z/eg8e8ccVWt23sWQK5l1UdkoLJPN5w69UA4uITGBnEZD2JOe4QOHycYKv8A==", - "dev": true, - "requires": { - "@babel/helper-create-regexp-features-plugin": "^7.8.8", - "@babel/helper-plugin-utils": "^7.8.3" - } - }, - "@babel/plugin-syntax-async-generators": { - "version": "7.8.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz", - "integrity": "sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.0" - } - }, - "@babel/plugin-syntax-decorators": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-decorators/-/plugin-syntax-decorators-7.8.3.tgz", - "integrity": "sha512-8Hg4dNNT9/LcA1zQlfwuKR8BUc/if7Q7NkTam9sGTcJphLwpf2g4S42uhspQrIrR+dpzE0dtTqBVFoHl8GtnnQ==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.3" - } - }, - "@babel/plugin-syntax-do-expressions": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-do-expressions/-/plugin-syntax-do-expressions-7.8.3.tgz", - "integrity": "sha512-puRiUTVDQ69iRX41eeVWqOftZK31waWqZfwKB/TGzPfgi7097twx/DpwfOfyqEGqYtvpQF3jpHwT6UBzvSyAjw==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.3" - } - }, - "@babel/plugin-syntax-dynamic-import": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.8.3.tgz", - "integrity": "sha512-5gdGbFon+PszYzqs83S3E5mpi7/y/8M9eC90MRTZfduQOYW76ig6SOSPNe41IG5LoP3FGBn2N0RjVDSQiS94kQ==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.0" - } - }, - "@babel/plugin-syntax-export-default-from": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-export-default-from/-/plugin-syntax-export-default-from-7.8.3.tgz", - "integrity": "sha512-a1qnnsr73KLNIQcQlcQ4ZHxqqfBKM6iNQZW2OMTyxNbA2WC7SHWHtGVpFzWtQAuS2pspkWVzdEBXXx8Ik0Za4w==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.3" - } - }, - "@babel/plugin-syntax-export-namespace-from": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-export-namespace-from/-/plugin-syntax-export-namespace-from-7.8.3.tgz", - "integrity": "sha512-MXf5laXo6c1IbEbegDmzGPwGNTsHZmEy6QGznu5Sh2UCWvueywb2ee+CCE4zQiZstxU9BMoQO9i6zUFSY0Kj0Q==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.3" - } - }, - "@babel/plugin-syntax-function-bind": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-function-bind/-/plugin-syntax-function-bind-7.8.3.tgz", - "integrity": "sha512-gEYag4Q3CfqlQcJQQw/KSWdV2husGOnIsOsRlyzkoaNqj2V/V/CSdSJDCGSl67oJ1bdIYP6TjORWPH561dSJpA==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.3" - } - }, - "@babel/plugin-syntax-function-sent": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-function-sent/-/plugin-syntax-function-sent-7.8.3.tgz", - "integrity": "sha512-NNEutF0x2PdWYij2bmf/i50dSq4SUdgFij4BZwj3I4qDZgql3dlFJRyvwGHAhwKYElUKHaP0wQ/yO1d/enpJaw==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.3" - } - }, - "@babel/plugin-syntax-import-meta": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-meta/-/plugin-syntax-import-meta-7.8.3.tgz", - "integrity": "sha512-vYiGd4wQ9gx0Lngb7+bPCwQXGK/PR6FeTIJ+TIOlq+OfOKG/kCAOO2+IBac3oMM9qV7/fU76hfcqxUaLKZf1hQ==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.3" - } - }, - "@babel/plugin-syntax-json-strings": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.8.3.tgz", - "integrity": "sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.0" - } - }, - "@babel/plugin-syntax-logical-assignment-operators": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.8.3.tgz", - "integrity": "sha512-Zpg2Sgc++37kuFl6ppq2Q7Awc6E6AIW671x5PY8E/f7MCIyPPGK/EoeZXvvY3P42exZ3Q4/t3YOzP/HiN79jDg==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.3" - } - }, - "@babel/plugin-syntax-nullish-coalescing-operator": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz", - "integrity": "sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.0" - } - }, - "@babel/plugin-syntax-numeric-separator": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.8.3.tgz", - "integrity": "sha512-H7dCMAdN83PcCmqmkHB5dtp+Xa9a6LKSvA2hiFBC/5alSHxM5VgWZXFqDi0YFe8XNGT6iCa+z4V4zSt/PdZ7Dw==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.3" - } - }, - "@babel/plugin-syntax-object-rest-spread": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz", - "integrity": "sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.0" - } - }, - "@babel/plugin-syntax-optional-catch-binding": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.8.3.tgz", - "integrity": "sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.0" - } - }, - "@babel/plugin-syntax-optional-chaining": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz", - "integrity": "sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.0" - } - }, - "@babel/plugin-syntax-pipeline-operator": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-pipeline-operator/-/plugin-syntax-pipeline-operator-7.8.3.tgz", - "integrity": "sha512-GhiBvlXZLWeP+MjKaEv33KmiR/QMCv4iCwz1AuuAp7pHxBvOxxyQmIPukh+N/py6PRLYG10bvRCNeenG34QbDA==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.3" - } - }, - "@babel/plugin-syntax-throw-expressions": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-throw-expressions/-/plugin-syntax-throw-expressions-7.8.3.tgz", - "integrity": "sha512-Mv3shY1i7ZssY4OY+eLZJAmNCwqTcpv2qOKO9x6irELSygfKWVSMXk0igJsA9UhU4hOdw0qMGkjj9TAk4MqzwQ==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.3" - } - }, - "@babel/plugin-syntax-top-level-await": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.8.3.tgz", - "integrity": "sha512-kwj1j9lL/6Wd0hROD3b/OZZ7MSrZLqqn9RAZ5+cYYsflQ9HZBIKCUkr3+uL1MEJ1NePiUbf98jjiMQSv0NMR9g==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.3" - } - }, - "@babel/plugin-transform-arrow-functions": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.8.3.tgz", - "integrity": "sha512-0MRF+KC8EqH4dbuITCWwPSzsyO3HIWWlm30v8BbbpOrS1B++isGxPnnuq/IZvOX5J2D/p7DQalQm+/2PnlKGxg==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.3" - } - }, - "@babel/plugin-transform-async-to-generator": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.8.3.tgz", - "integrity": "sha512-imt9tFLD9ogt56Dd5CI/6XgpukMwd/fLGSrix2httihVe7LOGVPhyhMh1BU5kDM7iHD08i8uUtmV2sWaBFlHVQ==", - "dev": true, - "requires": { - "@babel/helper-module-imports": "^7.8.3", - "@babel/helper-plugin-utils": "^7.8.3", - "@babel/helper-remap-async-to-generator": "^7.8.3" - } - }, - "@babel/plugin-transform-block-scoped-functions": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.8.3.tgz", - "integrity": "sha512-vo4F2OewqjbB1+yaJ7k2EJFHlTP3jR634Z9Cj9itpqNjuLXvhlVxgnjsHsdRgASR8xYDrx6onw4vW5H6We0Jmg==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.3" - } - }, - "@babel/plugin-transform-block-scoping": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.8.3.tgz", - "integrity": "sha512-pGnYfm7RNRgYRi7bids5bHluENHqJhrV4bCZRwc5GamaWIIs07N4rZECcmJL6ZClwjDz1GbdMZFtPs27hTB06w==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.3", - "lodash": "^4.17.13" - } - }, - "@babel/plugin-transform-classes": { - "version": "7.9.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.9.5.tgz", - "integrity": "sha512-x2kZoIuLC//O5iA7PEvecB105o7TLzZo8ofBVhP79N+DO3jaX+KYfww9TQcfBEZD0nikNyYcGB1IKtRq36rdmg==", - "dev": true, - "requires": { - "@babel/helper-annotate-as-pure": "^7.8.3", - "@babel/helper-define-map": "^7.8.3", - "@babel/helper-function-name": "^7.9.5", - "@babel/helper-optimise-call-expression": "^7.8.3", - "@babel/helper-plugin-utils": "^7.8.3", - "@babel/helper-replace-supers": "^7.8.6", - "@babel/helper-split-export-declaration": "^7.8.3", - "globals": "^11.1.0" - } - }, - "@babel/plugin-transform-computed-properties": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.8.3.tgz", - "integrity": "sha512-O5hiIpSyOGdrQZRQ2ccwtTVkgUDBBiCuK//4RJ6UfePllUTCENOzKxfh6ulckXKc0DixTFLCfb2HVkNA7aDpzA==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.3" - } - }, - "@babel/plugin-transform-destructuring": { - "version": "7.9.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.9.5.tgz", - "integrity": "sha512-j3OEsGel8nHL/iusv/mRd5fYZ3DrOxWC82x0ogmdN/vHfAP4MYw+AFKYanzWlktNwikKvlzUV//afBW5FTp17Q==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.3" - } - }, - "@babel/plugin-transform-dotall-regex": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.8.3.tgz", - "integrity": "sha512-kLs1j9Nn4MQoBYdRXH6AeaXMbEJFaFu/v1nQkvib6QzTj8MZI5OQzqmD83/2jEM1z0DLilra5aWO5YpyC0ALIw==", - "dev": true, - "requires": { - "@babel/helper-create-regexp-features-plugin": "^7.8.3", - "@babel/helper-plugin-utils": "^7.8.3" - } - }, - "@babel/plugin-transform-duplicate-keys": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.8.3.tgz", - "integrity": "sha512-s8dHiBUbcbSgipS4SMFuWGqCvyge5V2ZeAWzR6INTVC3Ltjig/Vw1G2Gztv0vU/hRG9X8IvKvYdoksnUfgXOEQ==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.3" - } - }, - "@babel/plugin-transform-exponentiation-operator": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.8.3.tgz", - "integrity": "sha512-zwIpuIymb3ACcInbksHaNcR12S++0MDLKkiqXHl3AzpgdKlFNhog+z/K0+TGW+b0w5pgTq4H6IwV/WhxbGYSjQ==", - "dev": true, - "requires": { - "@babel/helper-builder-binary-assignment-operator-visitor": "^7.8.3", - "@babel/helper-plugin-utils": "^7.8.3" - } - }, - "@babel/plugin-transform-for-of": { - "version": "7.9.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.9.0.tgz", - "integrity": "sha512-lTAnWOpMwOXpyDx06N+ywmF3jNbafZEqZ96CGYabxHrxNX8l5ny7dt4bK/rGwAh9utyP2b2Hv7PlZh1AAS54FQ==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.3" - } - }, - "@babel/plugin-transform-function-name": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.8.3.tgz", - "integrity": "sha512-rO/OnDS78Eifbjn5Py9v8y0aR+aSYhDhqAwVfsTl0ERuMZyr05L1aFSCJnbv2mmsLkit/4ReeQ9N2BgLnOcPCQ==", - "dev": true, - "requires": { - "@babel/helper-function-name": "^7.8.3", - "@babel/helper-plugin-utils": "^7.8.3" - } - }, - "@babel/plugin-transform-literals": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-literals/-/plugin-transform-literals-7.8.3.tgz", - "integrity": "sha512-3Tqf8JJ/qB7TeldGl+TT55+uQei9JfYaregDcEAyBZ7akutriFrt6C/wLYIer6OYhleVQvH/ntEhjE/xMmy10A==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.3" - } - }, - "@babel/plugin-transform-member-expression-literals": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.8.3.tgz", - "integrity": "sha512-3Wk2EXhnw+rP+IDkK6BdtPKsUE5IeZ6QOGrPYvw52NwBStw9V1ZVzxgK6fSKSxqUvH9eQPR3tm3cOq79HlsKYA==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.3" - } - }, - "@babel/plugin-transform-modules-amd": { - "version": "7.9.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.9.6.tgz", - "integrity": "sha512-zoT0kgC3EixAyIAU+9vfaUVKTv9IxBDSabgHoUCBP6FqEJ+iNiN7ip7NBKcYqbfUDfuC2mFCbM7vbu4qJgOnDw==", - "dev": true, - "requires": { - "@babel/helper-module-transforms": "^7.9.0", - "@babel/helper-plugin-utils": "^7.8.3", - "babel-plugin-dynamic-import-node": "^2.3.3" - } - }, - "@babel/plugin-transform-modules-commonjs": { - "version": "7.9.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.9.6.tgz", - "integrity": "sha512-7H25fSlLcn+iYimmsNe3uK1at79IE6SKW9q0/QeEHTMC9MdOZ+4bA+T1VFB5fgOqBWoqlifXRzYD0JPdmIrgSQ==", - "dev": true, - "requires": { - "@babel/helper-module-transforms": "^7.9.0", - "@babel/helper-plugin-utils": "^7.8.3", - "@babel/helper-simple-access": "^7.8.3", - "babel-plugin-dynamic-import-node": "^2.3.3" - } - }, - "@babel/plugin-transform-modules-systemjs": { - "version": "7.9.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.9.6.tgz", - "integrity": "sha512-NW5XQuW3N2tTHim8e1b7qGy7s0kZ2OH3m5octc49K1SdAKGxYxeIx7hiIz05kS1R2R+hOWcsr1eYwcGhrdHsrg==", - "dev": true, - "requires": { - "@babel/helper-hoist-variables": "^7.8.3", - "@babel/helper-module-transforms": "^7.9.0", - "@babel/helper-plugin-utils": "^7.8.3", - "babel-plugin-dynamic-import-node": "^2.3.3" - } - }, - "@babel/plugin-transform-modules-umd": { - "version": "7.9.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.9.0.tgz", - "integrity": "sha512-uTWkXkIVtg/JGRSIABdBoMsoIeoHQHPTL0Y2E7xf5Oj7sLqwVsNXOkNk0VJc7vF0IMBsPeikHxFjGe+qmwPtTQ==", - "dev": true, - "requires": { - "@babel/helper-module-transforms": "^7.9.0", - "@babel/helper-plugin-utils": "^7.8.3" - } - }, - "@babel/plugin-transform-named-capturing-groups-regex": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.8.3.tgz", - "integrity": "sha512-f+tF/8UVPU86TrCb06JoPWIdDpTNSGGcAtaD9mLP0aYGA0OS0j7j7DHJR0GTFrUZPUU6loZhbsVZgTh0N+Qdnw==", - "dev": true, - "requires": { - "@babel/helper-create-regexp-features-plugin": "^7.8.3" - } - }, - "@babel/plugin-transform-new-target": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.8.3.tgz", - "integrity": "sha512-QuSGysibQpyxexRyui2vca+Cmbljo8bcRckgzYV4kRIsHpVeyeC3JDO63pY+xFZ6bWOBn7pfKZTqV4o/ix9sFw==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.3" - } - }, - "@babel/plugin-transform-object-super": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.8.3.tgz", - "integrity": "sha512-57FXk+gItG/GejofIyLIgBKTas4+pEU47IXKDBWFTxdPd7F80H8zybyAY7UoblVfBhBGs2EKM+bJUu2+iUYPDQ==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.3", - "@babel/helper-replace-supers": "^7.8.3" - } - }, - "@babel/plugin-transform-parameters": { - "version": "7.9.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.9.5.tgz", - "integrity": "sha512-0+1FhHnMfj6lIIhVvS4KGQJeuhe1GI//h5uptK4PvLt+BGBxsoUJbd3/IW002yk//6sZPlFgsG1hY6OHLcy6kA==", - "dev": true, - "requires": { - "@babel/helper-get-function-arity": "^7.8.3", - "@babel/helper-plugin-utils": "^7.8.3" - } - }, - "@babel/plugin-transform-property-literals": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.8.3.tgz", - "integrity": "sha512-uGiiXAZMqEoQhRWMK17VospMZh5sXWg+dlh2soffpkAl96KAm+WZuJfa6lcELotSRmooLqg0MWdH6UUq85nmmg==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.3" - } - }, - "@babel/plugin-transform-regenerator": { - "version": "7.8.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.8.7.tgz", - "integrity": "sha512-TIg+gAl4Z0a3WmD3mbYSk+J9ZUH6n/Yc57rtKRnlA/7rcCvpekHXe0CMZHP1gYp7/KLe9GHTuIba0vXmls6drA==", - "dev": true, - "requires": { - "regenerator-transform": "^0.14.2" - } - }, - "@babel/plugin-transform-reserved-words": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.8.3.tgz", - "integrity": "sha512-mwMxcycN3omKFDjDQUl+8zyMsBfjRFr0Zn/64I41pmjv4NJuqcYlEtezwYtw9TFd9WR1vN5kiM+O0gMZzO6L0A==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.3" - } - }, - "@babel/plugin-transform-shorthand-properties": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.8.3.tgz", - "integrity": "sha512-I9DI6Odg0JJwxCHzbzW08ggMdCezoWcuQRz3ptdudgwaHxTjxw5HgdFJmZIkIMlRymL6YiZcped4TTCB0JcC8w==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.3" - } - }, - "@babel/plugin-transform-spread": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-spread/-/plugin-transform-spread-7.8.3.tgz", - "integrity": "sha512-CkuTU9mbmAoFOI1tklFWYYbzX5qCIZVXPVy0jpXgGwkplCndQAa58s2jr66fTeQnA64bDox0HL4U56CFYoyC7g==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.3" - } - }, - "@babel/plugin-transform-sticky-regex": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.8.3.tgz", - "integrity": "sha512-9Spq0vGCD5Bb4Z/ZXXSK5wbbLFMG085qd2vhL1JYu1WcQ5bXqZBAYRzU1d+p79GcHs2szYv5pVQCX13QgldaWw==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.3", - "@babel/helper-regex": "^7.8.3" - } - }, - "@babel/plugin-transform-template-literals": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.8.3.tgz", - "integrity": "sha512-820QBtykIQOLFT8NZOcTRJ1UNuztIELe4p9DCgvj4NK+PwluSJ49we7s9FB1HIGNIYT7wFUJ0ar2QpCDj0escQ==", - "dev": true, - "requires": { - "@babel/helper-annotate-as-pure": "^7.8.3", - "@babel/helper-plugin-utils": "^7.8.3" - } - }, - "@babel/plugin-transform-typeof-symbol": { - "version": "7.8.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.8.4.tgz", - "integrity": "sha512-2QKyfjGdvuNfHsb7qnBBlKclbD4CfshH2KvDabiijLMGXPHJXGxtDzwIF7bQP+T0ysw8fYTtxPafgfs/c1Lrqg==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.3" - } - }, - "@babel/plugin-transform-unicode-regex": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.8.3.tgz", - "integrity": "sha512-+ufgJjYdmWfSQ+6NS9VGUR2ns8cjJjYbrbi11mZBTaWm+Fui/ncTLFF28Ei1okavY+xkojGr1eJxNsWYeA5aZw==", - "dev": true, - "requires": { - "@babel/helper-create-regexp-features-plugin": "^7.8.3", - "@babel/helper-plugin-utils": "^7.8.3" - } - }, - "@babel/preset-env": { - "version": "7.9.6", - "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.9.6.tgz", - "integrity": "sha512-0gQJ9RTzO0heXOhzftog+a/WyOuqMrAIugVYxMYf83gh1CQaQDjMtsOpqOwXyDL/5JcWsrCm8l4ju8QC97O7EQ==", - "dev": true, - "requires": { - "@babel/compat-data": "^7.9.6", - "@babel/helper-compilation-targets": "^7.9.6", - "@babel/helper-module-imports": "^7.8.3", - "@babel/helper-plugin-utils": "^7.8.3", - "@babel/plugin-proposal-async-generator-functions": "^7.8.3", - "@babel/plugin-proposal-dynamic-import": "^7.8.3", - "@babel/plugin-proposal-json-strings": "^7.8.3", - "@babel/plugin-proposal-nullish-coalescing-operator": "^7.8.3", - "@babel/plugin-proposal-numeric-separator": "^7.8.3", - "@babel/plugin-proposal-object-rest-spread": "^7.9.6", - "@babel/plugin-proposal-optional-catch-binding": "^7.8.3", - "@babel/plugin-proposal-optional-chaining": "^7.9.0", - "@babel/plugin-proposal-unicode-property-regex": "^7.8.3", - "@babel/plugin-syntax-async-generators": "^7.8.0", - "@babel/plugin-syntax-dynamic-import": "^7.8.0", - "@babel/plugin-syntax-json-strings": "^7.8.0", - "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.0", - "@babel/plugin-syntax-numeric-separator": "^7.8.0", - "@babel/plugin-syntax-object-rest-spread": "^7.8.0", - "@babel/plugin-syntax-optional-catch-binding": "^7.8.0", - "@babel/plugin-syntax-optional-chaining": "^7.8.0", - "@babel/plugin-syntax-top-level-await": "^7.8.3", - "@babel/plugin-transform-arrow-functions": "^7.8.3", - "@babel/plugin-transform-async-to-generator": "^7.8.3", - "@babel/plugin-transform-block-scoped-functions": "^7.8.3", - "@babel/plugin-transform-block-scoping": "^7.8.3", - "@babel/plugin-transform-classes": "^7.9.5", - "@babel/plugin-transform-computed-properties": "^7.8.3", - "@babel/plugin-transform-destructuring": "^7.9.5", - "@babel/plugin-transform-dotall-regex": "^7.8.3", - "@babel/plugin-transform-duplicate-keys": "^7.8.3", - "@babel/plugin-transform-exponentiation-operator": "^7.8.3", - "@babel/plugin-transform-for-of": "^7.9.0", - "@babel/plugin-transform-function-name": "^7.8.3", - "@babel/plugin-transform-literals": "^7.8.3", - "@babel/plugin-transform-member-expression-literals": "^7.8.3", - "@babel/plugin-transform-modules-amd": "^7.9.6", - "@babel/plugin-transform-modules-commonjs": "^7.9.6", - "@babel/plugin-transform-modules-systemjs": "^7.9.6", - "@babel/plugin-transform-modules-umd": "^7.9.0", - "@babel/plugin-transform-named-capturing-groups-regex": "^7.8.3", - "@babel/plugin-transform-new-target": "^7.8.3", - "@babel/plugin-transform-object-super": "^7.8.3", - "@babel/plugin-transform-parameters": "^7.9.5", - "@babel/plugin-transform-property-literals": "^7.8.3", - "@babel/plugin-transform-regenerator": "^7.8.7", - "@babel/plugin-transform-reserved-words": "^7.8.3", - "@babel/plugin-transform-shorthand-properties": "^7.8.3", - "@babel/plugin-transform-spread": "^7.8.3", - "@babel/plugin-transform-sticky-regex": "^7.8.3", - "@babel/plugin-transform-template-literals": "^7.8.3", - "@babel/plugin-transform-typeof-symbol": "^7.8.4", - "@babel/plugin-transform-unicode-regex": "^7.8.3", - "@babel/preset-modules": "^0.1.3", - "@babel/types": "^7.9.6", - "browserslist": "^4.11.1", - "core-js-compat": "^3.6.2", - "invariant": "^2.2.2", - "levenary": "^1.1.1", - "semver": "^5.5.0" - } - }, - "@babel/preset-modules": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/@babel/preset-modules/-/preset-modules-0.1.3.tgz", - "integrity": "sha512-Ra3JXOHBq2xd56xSF7lMKXdjBn3T772Y1Wet3yWnkDly9zHvJki029tAFzvAAK5cf4YV3yoxuP61crYRol6SVg==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.0.0", - "@babel/plugin-proposal-unicode-property-regex": "^7.4.4", - "@babel/plugin-transform-dotall-regex": "^7.4.4", - "@babel/types": "^7.4.4", - "esutils": "^2.0.2" - } - }, - "@babel/register": { - "version": "7.9.0", - "resolved": "https://registry.npmjs.org/@babel/register/-/register-7.9.0.tgz", - "integrity": "sha512-Tv8Zyi2J2VRR8g7pC5gTeIN8Ihultbmk0ocyNz8H2nEZbmhp1N6q0A1UGsQbDvGP/sNinQKUHf3SqXwqjtFv4Q==", - "dev": true, - "requires": { - "find-cache-dir": "^2.0.0", - "lodash": "^4.17.13", - "make-dir": "^2.1.0", - "pirates": "^4.0.0", - "source-map-support": "^0.5.16" - } - }, - "@babel/runtime": { - "version": "7.9.6", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.9.6.tgz", - "integrity": "sha512-64AF1xY3OAkFHqOb9s4jpgk1Mm5vDZ4L3acHvAml+53nO1XbXLuDodsVpO4OIUsmemlUHMxNdYMNJmsvOwLrvQ==", - "dev": true, - "requires": { - "regenerator-runtime": "^0.13.4" - } - }, - "@babel/template": { - "version": "7.8.6", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.8.6.tgz", - "integrity": "sha512-zbMsPMy/v0PWFZEhQJ66bqjhH+z0JgMoBWuikXybgG3Gkd/3t5oQ1Rw2WQhnSrsOmsKXnZOx15tkC4qON/+JPg==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.8.3", - "@babel/parser": "^7.8.6", - "@babel/types": "^7.8.6" - } - }, - "@babel/traverse": { - "version": "7.9.6", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.9.6.tgz", - "integrity": "sha512-b3rAHSjbxy6VEAvlxM8OV/0X4XrG72zoxme6q1MOoe2vd0bEc+TwayhuC1+Dfgqh1QEG+pj7atQqvUprHIccsg==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.8.3", - "@babel/generator": "^7.9.6", - "@babel/helper-function-name": "^7.9.5", - "@babel/helper-split-export-declaration": "^7.8.3", - "@babel/parser": "^7.9.6", - "@babel/types": "^7.9.6", - "debug": "^4.1.0", - "globals": "^11.1.0", - "lodash": "^4.17.13" - }, - "dependencies": { - "debug": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", - "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", - "dev": true, - "requires": { - "ms": "^2.1.1" - } - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - } - } - }, - "@babel/types": { - "version": "7.9.6", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.9.6.tgz", - "integrity": "sha512-qxXzvBO//jO9ZnoasKF1uJzHd2+M6Q2ZPIVfnFps8JJvXy0ZBbwbNOmE6SGIY5XOY6d1Bo5lb9d9RJ8nv3WSeA==", - "dev": true, - "requires": { - "@babel/helper-validator-identifier": "^7.9.5", - "lodash": "^4.17.13", - "to-fast-properties": "^2.0.0" - } - }, - "@sinonjs/commons": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.8.0.tgz", - "integrity": "sha512-wEj54PfsZ5jGSwMX68G8ZXFawcSglQSXqCftWX3ec8MDUzQdHgcKvw97awHbY0efQEL5iKUOAmmVtoYgmrSG4Q==", - "dev": true, - "requires": { - "type-detect": "4.0.8" - } - }, - "@sinonjs/formatio": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/@sinonjs/formatio/-/formatio-3.2.2.tgz", - "integrity": "sha512-B8SEsgd8gArBLMD6zpRw3juQ2FVSsmdd7qlevyDqzS9WTCtvF55/gAL+h6gue8ZvPYcdiPdvueM/qm//9XzyTQ==", - "dev": true, - "requires": { - "@sinonjs/commons": "^1", - "@sinonjs/samsam": "^3.1.0" - } - }, - "@sinonjs/samsam": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/@sinonjs/samsam/-/samsam-3.3.3.tgz", - "integrity": "sha512-bKCMKZvWIjYD0BLGnNrxVuw4dkWCYsLqFOUWw8VgKF/+5Y+mE7LfHWPIYoDXowH+3a9LsWDMo0uAP8YDosPvHQ==", - "dev": true, - "requires": { - "@sinonjs/commons": "^1.3.0", - "array-from": "^2.1.1", - "lodash": "^4.17.15" - } - }, - "@sinonjs/text-encoding": { - "version": "0.7.1", - "resolved": "https://registry.npmjs.org/@sinonjs/text-encoding/-/text-encoding-0.7.1.tgz", - "integrity": "sha512-+iTbntw2IZPb/anVDbypzfQa+ay64MW0Zo8aJ8gZPWMMK6/OubMVb6lUPMagqjOPnmtauXnFCACVl3O7ogjeqQ==", - "dev": true - }, - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "anymatch": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-2.0.0.tgz", - "integrity": "sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw==", - "optional": true, - "requires": { - "micromatch": "^3.1.4", - "normalize-path": "^2.1.1" - }, - "dependencies": { - "normalize-path": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", - "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", - "optional": true, - "requires": { - "remove-trailing-separator": "^1.0.1" - } - } - } - }, - "arr-diff": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", - "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", - "optional": true - }, - "arr-flatten": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", - "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==", - "optional": true - }, - "arr-union": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", - "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=", - "optional": true - }, - "array-from": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/array-from/-/array-from-2.1.1.tgz", - "integrity": "sha1-z+nYwmYoudxa7MYqn12PHzUsEZU=", - "dev": true - }, - "array-unique": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", - "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", - "optional": true - }, - "assign-symbols": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", - "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=", - "optional": true - }, - "async-each": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.3.tgz", - "integrity": "sha512-z/WhQ5FPySLdvREByI2vZiTWwCnF0moMJ1hK9YQwDTHKh6I7/uSckMetoRGb5UBZPC1z0jlw+n/XCgjeH7y1AQ==", - "optional": true - }, - "asynckit": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" - }, - "atob": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz", - "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==", - "optional": true - }, - "babel-plugin-dynamic-import-node": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/babel-plugin-dynamic-import-node/-/babel-plugin-dynamic-import-node-2.3.3.tgz", - "integrity": "sha512-jZVI+s9Zg3IqA/kdi0i6UDCybUI3aSBLnglhYbSSjKlV7yF1F/5LWv8MakQmvYpnbJDS6fcBL2KzHSxNCMtWSQ==", - "dev": true, - "requires": { - "object.assign": "^4.1.0" - } - }, - "balanced-match": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" - }, - "base": { - "version": "0.11.2", - "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", - "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", - "optional": true, - "requires": { - "cache-base": "^1.0.1", - "class-utils": "^0.3.5", - "component-emitter": "^1.2.1", - "define-property": "^1.0.0", - "isobject": "^3.0.1", - "mixin-deep": "^1.2.0", - "pascalcase": "^0.1.1" - }, - "dependencies": { - "define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", - "optional": true, - "requires": { - "is-descriptor": "^1.0.0" - } - }, - "is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "optional": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "optional": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "optional": true, - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - } - } - } - }, - "binary-extensions": { - "version": "1.13.1", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.13.1.tgz", - "integrity": "sha512-Un7MIEDdUC5gNpcGDV97op1Ywk748MpHcFTHoYs6qnj1Z3j7I53VG3nwZhKzoBZmbdRNnb6WRdFlwl7tSDuZGw==", - "optional": true - }, - "bindings": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", - "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", - "optional": true, - "requires": { - "file-uri-to-path": "1.0.0" - } - }, - "brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "braces": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", - "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", - "optional": true, - "requires": { - "arr-flatten": "^1.1.0", - "array-unique": "^0.3.2", - "extend-shallow": "^2.0.1", - "fill-range": "^4.0.0", - "isobject": "^3.0.1", - "repeat-element": "^1.1.2", - "snapdragon": "^0.8.1", - "snapdragon-node": "^2.0.1", - "split-string": "^3.0.2", - "to-regex": "^3.0.1" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "optional": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "browser-stdout": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", - "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", - "dev": true - }, - "browserslist": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.12.0.tgz", - "integrity": "sha512-UH2GkcEDSI0k/lRkuDSzFl9ZZ87skSy9w2XAn1MsZnL+4c4rqbBd3e82UWHbYDpztABrPBhZsTEeuxVfHppqDg==", - "dev": true, - "requires": { - "caniuse-lite": "^1.0.30001043", - "electron-to-chromium": "^1.3.413", - "node-releases": "^1.1.53", - "pkg-up": "^2.0.0" - } - }, - "buffer-from": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", - "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", - "dev": true - }, - "cache-base": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", - "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", - "optional": true, - "requires": { - "collection-visit": "^1.0.0", - "component-emitter": "^1.2.1", - "get-value": "^2.0.6", - "has-value": "^1.0.0", - "isobject": "^3.0.1", - "set-value": "^2.0.0", - "to-object-path": "^0.3.0", - "union-value": "^1.0.0", - "unset-value": "^1.0.0" - } - }, - "caniuse-lite": { - "version": "1.0.30001064", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001064.tgz", - "integrity": "sha512-hdBcQMFvJIrOhkpAZiRXz04Cmetwc9NekeuNl0qZfHOugxOhJKxsjF1RmISMPFjIF4PPx1reliIzbfN42EiQ5A==", - "dev": true - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "chokidar": { - "version": "2.1.8", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.1.8.tgz", - "integrity": "sha512-ZmZUazfOzf0Nve7duiCKD23PFSCs4JPoYyccjUFF3aQkQadqBhfzhjkwBH2mNOG9cTBwhamM37EIsIkZw3nRgg==", - "optional": true, - "requires": { - "anymatch": "^2.0.0", - "async-each": "^1.0.1", - "braces": "^2.3.2", - "fsevents": "^1.2.7", - "glob-parent": "^3.1.0", - "inherits": "^2.0.3", - "is-binary-path": "^1.0.0", - "is-glob": "^4.0.0", - "normalize-path": "^3.0.0", - "path-is-absolute": "^1.0.0", - "readdirp": "^2.2.1", - "upath": "^1.1.1" - } - }, - "class-utils": { - "version": "0.3.6", - "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", - "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==", - "optional": true, - "requires": { - "arr-union": "^3.1.0", - "define-property": "^0.2.5", - "isobject": "^3.0.0", - "static-extend": "^0.1.1" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "optional": true, - "requires": { - "is-descriptor": "^0.1.0" - } - } - } - }, - "collection-visit": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", - "integrity": "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=", - "optional": true, - "requires": { - "map-visit": "^1.0.0", - "object-visit": "^1.0.0" - } - }, - "color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "requires": { - "color-name": "1.1.3" - } - }, - "color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", - "dev": true - }, - "combined-stream": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", - "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", - "requires": { - "delayed-stream": "~1.0.0" - } - }, - "commander": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-4.1.1.tgz", - "integrity": "sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==" - }, - "commondir": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", - "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=", - "dev": true - }, - "component-emitter": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", - "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==" - }, - "concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" - }, - "convert-source-map": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.7.0.tgz", - "integrity": "sha512-4FJkXzKXEDB1snCFZlLP4gpC3JILicCpGbzG9f9G7tGqGCzETQ2hWPrcinA9oU4wtf2biUaEH5065UnMeR33oA==", - "requires": { - "safe-buffer": "~5.1.1" - } - }, - "cookiejar": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/cookiejar/-/cookiejar-2.1.2.tgz", - "integrity": "sha512-Mw+adcfzPxcPeI+0WlvRrr/3lGVO0bD75SxX6811cxSh1Wbxx7xZBGK1eVtDf6si8rg2lhnUjsVLMFMfbRIuwA==" - }, - "copy-descriptor": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", - "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=", - "optional": true - }, - "core-js-compat": { - "version": "3.6.5", - "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.6.5.tgz", - "integrity": "sha512-7ItTKOhOZbznhXAQ2g/slGg1PJV5zDO/WdkTwi7UEOJmkvsE32PWvx6mKtDjiMpjnR2CNf6BAD6sSxIlv7ptng==", - "dev": true, - "requires": { - "browserslist": "^4.8.5", - "semver": "7.0.0" - }, - "dependencies": { - "semver": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.0.0.tgz", - "integrity": "sha512-+GB6zVA9LWh6zovYQLALHwv5rb2PHGlJi3lfiqIHxR0uuwCgefcOJc59v9fv1w8GbStwxuuqqAjI9NMAOOgq1A==", - "dev": true - } - } - }, - "core-util-is": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" - }, - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "optional": true, - "requires": { - "ms": "2.0.0" - } - }, - "decode-uri-component": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", - "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=", - "optional": true - }, - "define-properties": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", - "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", - "dev": true, - "requires": { - "object-keys": "^1.0.12" - } - }, - "define-property": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", - "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", - "optional": true, - "requires": { - "is-descriptor": "^1.0.2", - "isobject": "^3.0.1" - }, - "dependencies": { - "is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "optional": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "optional": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "optional": true, - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - } - } - } - }, - "delayed-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" - }, - "diff": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", - "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", - "dev": true - }, - "electron-to-chromium": { - "version": "1.3.451", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.451.tgz", - "integrity": "sha512-2fvco0F2bBIgqzO8GRP0Jt/91pdrf9KfZ5FsmkYkjERmIJG585cFeFZV4+CO6oTmU3HmCTgfcZuEa7kW8VUh3A==", - "dev": true - }, - "escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", - "dev": true - }, - "esutils": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", - "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", - "dev": true - }, - "expand-brackets": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", - "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", - "optional": true, - "requires": { - "debug": "^2.3.3", - "define-property": "^0.2.5", - "extend-shallow": "^2.0.1", - "posix-character-classes": "^0.1.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "optional": true, - "requires": { - "is-descriptor": "^0.1.0" - } - }, - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "optional": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "expect.js": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/expect.js/-/expect.js-0.3.1.tgz", - "integrity": "sha1-sKWaDS7/VDdUTr8M6qYBWEHQm1s=", - "dev": true - }, - "extend": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", - "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" - }, - "extend-shallow": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", - "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", - "optional": true, - "requires": { - "assign-symbols": "^1.0.0", - "is-extendable": "^1.0.1" - }, - "dependencies": { - "is-extendable": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", - "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", - "optional": true, - "requires": { - "is-plain-object": "^2.0.4" - } - } - } - }, - "extglob": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", - "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", - "optional": true, - "requires": { - "array-unique": "^0.3.2", - "define-property": "^1.0.0", - "expand-brackets": "^2.1.4", - "extend-shallow": "^2.0.1", - "fragment-cache": "^0.2.1", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" - }, - "dependencies": { - "define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", - "optional": true, - "requires": { - "is-descriptor": "^1.0.0" - } - }, - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "optional": true, - "requires": { - "is-extendable": "^0.1.0" - } - }, - "is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "optional": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "optional": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "optional": true, - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - } - } - } - }, - "file-uri-to-path": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", - "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==", - "optional": true - }, - "fill-range": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", - "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", - "optional": true, - "requires": { - "extend-shallow": "^2.0.1", - "is-number": "^3.0.0", - "repeat-string": "^1.6.1", - "to-regex-range": "^2.1.0" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "optional": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "find-cache-dir": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-2.1.0.tgz", - "integrity": "sha512-Tq6PixE0w/VMFfCgbONnkiQIVol/JJL7nRMi20fqzA4NRs9AfeqMGeRdPi3wIhYkxjeBaWh2rxwapn5Tu3IqOQ==", - "dev": true, - "requires": { - "commondir": "^1.0.1", - "make-dir": "^2.0.0", - "pkg-dir": "^3.0.0" - } - }, - "find-up": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", - "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", - "dev": true, - "requires": { - "locate-path": "^2.0.0" - } - }, - "for-in": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", - "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", - "optional": true - }, - "form-data": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.5.1.tgz", - "integrity": "sha512-m21N3WOmEEURgk6B9GLOE4RuWOFf28Lhh9qGYeNlGq4VDXUlJy2th2slBNU8Gp8EzloYZOibZJ7t5ecIrFSjVA==", - "requires": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.6", - "mime-types": "^2.1.12" - } - }, - "formidable": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/formidable/-/formidable-1.2.2.tgz", - "integrity": "sha512-V8gLm+41I/8kguQ4/o1D3RIHRmhYFG4pnNyonvua+40rqcEmT4+V71yaZ3B457xbbgCsCfjSPi65u/W6vK1U5Q==" - }, - "fragment-cache": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", - "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", - "optional": true, - "requires": { - "map-cache": "^0.2.2" - } - }, - "fs-readdir-recursive": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/fs-readdir-recursive/-/fs-readdir-recursive-1.1.0.tgz", - "integrity": "sha512-GNanXlVr2pf02+sPN40XN8HG+ePaNcvM0q5mZBd668Obwb0yD5GiUbZOFgwn8kGMY6I3mdyDJzieUy3PTYyTRA==" - }, - "fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" - }, - "fsevents": { - "version": "1.2.13", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.13.tgz", - "integrity": "sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw==", - "optional": true, - "requires": { - "bindings": "^1.5.0", - "nan": "^2.12.1" - } - }, - "function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", - "dev": true - }, - "gensync": { - "version": "1.0.0-beta.1", - "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.1.tgz", - "integrity": "sha512-r8EC6NO1sngH/zdD9fiRDLdcgnbayXah+mLgManTaIZJqEC1MZstmnox8KpnI2/fxQwrp5OpCOYWLp4rBl4Jcg==", - "dev": true - }, - "get-value": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", - "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=", - "optional": true - }, - "glob": { - "version": "7.1.6", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", - "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "glob-parent": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", - "integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=", - "optional": true, - "requires": { - "is-glob": "^3.1.0", - "path-dirname": "^1.0.0" - }, - "dependencies": { - "is-glob": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", - "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", - "optional": true, - "requires": { - "is-extglob": "^2.1.0" - } - } - } - }, - "globals": { - "version": "11.12.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", - "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", - "dev": true - }, - "graceful-fs": { - "version": "4.2.4", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz", - "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==", - "optional": true - }, - "growl": { - "version": "1.10.5", - "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", - "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==", - "dev": true - }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true - }, - "has-symbols": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.1.tgz", - "integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==", - "dev": true - }, - "has-value": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", - "integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=", - "optional": true, - "requires": { - "get-value": "^2.0.6", - "has-values": "^1.0.0", - "isobject": "^3.0.0" - } - }, - "has-values": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz", - "integrity": "sha1-lbC2P+whRmGab+V/51Yo1aOe/k8=", - "optional": true, - "requires": { - "is-number": "^3.0.0", - "kind-of": "^4.0.0" - }, - "dependencies": { - "kind-of": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", - "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", - "optional": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "he": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/he/-/he-1.1.1.tgz", - "integrity": "sha1-k0EP0hsAlzUVH4howvJx80J+I/0=", - "dev": true - }, - "inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "requires": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" - }, - "invariant": { - "version": "2.2.4", - "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz", - "integrity": "sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==", - "dev": true, - "requires": { - "loose-envify": "^1.0.0" - } - }, - "is-accessor-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", - "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", - "optional": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "optional": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "is-binary-path": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz", - "integrity": "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=", - "optional": true, - "requires": { - "binary-extensions": "^1.0.0" - } - }, - "is-buffer": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", - "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", - "optional": true - }, - "is-data-descriptor": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", - "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", - "optional": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "optional": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "is-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", - "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", - "optional": true, - "requires": { - "is-accessor-descriptor": "^0.1.6", - "is-data-descriptor": "^0.1.4", - "kind-of": "^5.0.0" - }, - "dependencies": { - "kind-of": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", - "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", - "optional": true - } - } - }, - "is-extendable": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", - "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", - "optional": true - }, - "is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", - "optional": true - }, - "is-glob": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", - "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", - "optional": true, - "requires": { - "is-extglob": "^2.1.1" - } - }, - "is-number": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", - "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", - "optional": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "optional": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "is-plain-object": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", - "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", - "optional": true, - "requires": { - "isobject": "^3.0.1" - } - }, - "is-windows": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", - "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", - "optional": true - }, - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" - }, - "isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", - "optional": true - }, - "js-tokens": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", - "dev": true - }, - "jsesc": { - "version": "2.5.2", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", - "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", - "dev": true - }, - "json5": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.1.3.tgz", - "integrity": "sha512-KXPvOm8K9IJKFM0bmdn8QXh7udDh1g/giieX0NLCaMnb4hEiVFqnop2ImTXCc5e0/oHz3LTqmHGtExn5hfMkOA==", - "dev": true, - "requires": { - "minimist": "^1.2.5" - } - }, - "just-extend": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/just-extend/-/just-extend-4.1.0.tgz", - "integrity": "sha512-ApcjaOdVTJ7y4r08xI5wIqpvwS48Q0PBG4DJROcEkH1f8MdAiNFyFxz3xoL0LWAVwjrwPYZdVHHxhRHcx/uGLA==", - "dev": true - }, - "kind-of": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", - "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", - "optional": true - }, - "leven": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz", - "integrity": "sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==", - "dev": true - }, - "levenary": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/levenary/-/levenary-1.1.1.tgz", - "integrity": "sha512-mkAdOIt79FD6irqjYSs4rdbnlT5vRonMEvBVPVb3XmevfS8kgRXwfes0dhPdEtzTWD/1eNE/Bm/G1iRt6DcnQQ==", - "dev": true, - "requires": { - "leven": "^3.1.0" - } - }, - "locate-path": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", - "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", - "dev": true, - "requires": { - "p-locate": "^2.0.0", - "path-exists": "^3.0.0" - } - }, - "lodash": { - "version": "4.17.15", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", - "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==" - }, - "lolex": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/lolex/-/lolex-4.2.0.tgz", - "integrity": "sha512-gKO5uExCXvSm6zbF562EvM+rd1kQDnB9AZBbiQVzf1ZmdDpxUSvpnAaVOP83N/31mRK8Ml8/VE8DMvsAZQ+7wg==", - "dev": true - }, - "loose-envify": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", - "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", - "dev": true, - "requires": { - "js-tokens": "^3.0.0 || ^4.0.0" - } - }, - "make-dir": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz", - "integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==", - "requires": { - "pify": "^4.0.1", - "semver": "^5.6.0" - } - }, - "map-cache": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", - "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=", - "optional": true - }, - "map-visit": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", - "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=", - "optional": true, - "requires": { - "object-visit": "^1.0.0" - } - }, - "methods": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", - "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=" - }, - "micromatch": { - "version": "3.1.10", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", - "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", - "optional": true, - "requires": { - "arr-diff": "^4.0.0", - "array-unique": "^0.3.2", - "braces": "^2.3.1", - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "extglob": "^2.0.4", - "fragment-cache": "^0.2.1", - "kind-of": "^6.0.2", - "nanomatch": "^1.2.9", - "object.pick": "^1.3.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.2" - } - }, - "mime": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", - "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==" - }, - "mime-db": { - "version": "1.44.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.44.0.tgz", - "integrity": "sha512-/NOTfLrsPBVeH7YtFPgsVWveuL+4SjjYxaQ1xtM1KMFj7HdxlBlxeyNLzhyJVx7r4rZGJAZ/6lkKCitSc/Nmpg==" - }, - "mime-types": { - "version": "2.1.27", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.27.tgz", - "integrity": "sha512-JIhqnCasI9yD+SsmkquHBxTSEuZdQX5BuQnS2Vc7puQQQ+8yiP5AY5uWhpdv4YL4VM5c6iliiYWPgJ/nJQLp7w==", - "requires": { - "mime-db": "1.44.0" - } - }, - "minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", - "requires": { - "brace-expansion": "^1.1.7" - } - }, - "minimist": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", - "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", - "dev": true - }, - "mixin-deep": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz", - "integrity": "sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA==", - "optional": true, - "requires": { - "for-in": "^1.0.2", - "is-extendable": "^1.0.1" - }, - "dependencies": { - "is-extendable": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", - "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", - "optional": true, - "requires": { - "is-plain-object": "^2.0.4" - } - } - } - }, - "mkdirp": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", - "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", - "dev": true, - "requires": { - "minimist": "0.0.8" - }, - "dependencies": { - "minimist": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", - "dev": true - } - } - }, - "mocha": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-5.2.0.tgz", - "integrity": "sha512-2IUgKDhc3J7Uug+FxMXuqIyYzH7gJjXECKe/w43IGgQHTSj3InJi+yAA7T24L9bQMRKiUEHxEX37G5JpVUGLcQ==", - "dev": true, - "requires": { - "browser-stdout": "1.3.1", - "commander": "2.15.1", - "debug": "3.1.0", - "diff": "3.5.0", - "escape-string-regexp": "1.0.5", - "glob": "7.1.2", - "growl": "1.10.5", - "he": "1.1.1", - "minimatch": "3.0.4", - "mkdirp": "0.5.1", - "supports-color": "5.4.0" - }, - "dependencies": { - "commander": { - "version": "2.15.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.15.1.tgz", - "integrity": "sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag==", - "dev": true - }, - "debug": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", - "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", - "dev": true, - "requires": { - "ms": "2.0.0" - } - }, - "glob": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", - "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", - "dev": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "supports-color": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", - "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - } - } - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" - }, - "nan": { - "version": "2.14.1", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.1.tgz", - "integrity": "sha512-isWHgVjnFjh2x2yuJ/tj3JbwoHu3UC2dX5G/88Cm24yB6YopVgxvBObDY7n5xW6ExmFhJpSEQqFPvq9zaXc8Jw==", - "optional": true - }, - "nanomatch": { - "version": "1.2.13", - "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", - "integrity": "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==", - "optional": true, - "requires": { - "arr-diff": "^4.0.0", - "array-unique": "^0.3.2", - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "fragment-cache": "^0.2.1", - "is-windows": "^1.0.2", - "kind-of": "^6.0.2", - "object.pick": "^1.3.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" - } - }, - "nise": { - "version": "1.5.3", - "resolved": "https://registry.npmjs.org/nise/-/nise-1.5.3.tgz", - "integrity": "sha512-Ymbac/94xeIrMf59REBPOv0thr+CJVFMhrlAkW/gjCIE58BGQdCj0x7KRCb3yz+Ga2Rz3E9XXSvUyyxqqhjQAQ==", - "dev": true, - "requires": { - "@sinonjs/formatio": "^3.2.1", - "@sinonjs/text-encoding": "^0.7.1", - "just-extend": "^4.0.2", - "lolex": "^5.0.1", - "path-to-regexp": "^1.7.0" - }, - "dependencies": { - "lolex": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/lolex/-/lolex-5.1.2.tgz", - "integrity": "sha512-h4hmjAvHTmd+25JSwrtTIuwbKdwg5NzZVRMLn9saij4SZaepCrTCxPr35H/3bjwfMJtN+t3CX8672UIkglz28A==", - "dev": true, - "requires": { - "@sinonjs/commons": "^1.7.0" - } - } - } - }, - "node-modules-regexp": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/node-modules-regexp/-/node-modules-regexp-1.0.0.tgz", - "integrity": "sha1-jZ2+KJZKSsVxLpExZCEHxx6Q7EA=", - "dev": true - }, - "node-releases": { - "version": "1.1.56", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.56.tgz", - "integrity": "sha512-EVo605FhWLygH8a64TjgpjyHYOihkxECwX1bHHr8tETJKWEiWS2YJjPbvsX2jFjnjTNEgBCmk9mLjKG1Mf11cw==", - "dev": true - }, - "normalize-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", - "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", - "optional": true - }, - "object-copy": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", - "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=", - "optional": true, - "requires": { - "copy-descriptor": "^0.1.0", - "define-property": "^0.2.5", - "kind-of": "^3.0.3" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "optional": true, - "requires": { - "is-descriptor": "^0.1.0" - } - }, - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "optional": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "object-keys": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", - "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", - "dev": true - }, - "object-visit": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", - "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=", - "optional": true, - "requires": { - "isobject": "^3.0.0" - } - }, - "object.assign": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.0.tgz", - "integrity": "sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w==", - "dev": true, - "requires": { - "define-properties": "^1.1.2", - "function-bind": "^1.1.1", - "has-symbols": "^1.0.0", - "object-keys": "^1.0.11" - } - }, - "object.pick": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", - "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", - "optional": true, - "requires": { - "isobject": "^3.0.1" - } - }, - "once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "requires": { - "wrappy": "1" - } - }, - "p-limit": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", - "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", - "dev": true, - "requires": { - "p-try": "^1.0.0" - } - }, - "p-locate": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", - "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", - "dev": true, - "requires": { - "p-limit": "^1.1.0" - } - }, - "p-try": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", - "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", - "dev": true - }, - "pascalcase": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", - "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=", - "optional": true - }, - "path-dirname": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/path-dirname/-/path-dirname-1.0.2.tgz", - "integrity": "sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA=", - "optional": true - }, - "path-exists": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", - "dev": true - }, - "path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" - }, - "path-parse": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", - "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", - "dev": true - }, - "path-to-regexp": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.8.0.tgz", - "integrity": "sha512-n43JRhlUKUAlibEJhPeir1ncUID16QnEjNpwzNdO3Lm4ywrBpBZ5oLD0I6br9evr1Y9JTqwRtAh7JLoOzAQdVA==", - "dev": true, - "requires": { - "isarray": "0.0.1" - }, - "dependencies": { - "isarray": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", - "dev": true - } - } - }, - "pify": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", - "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==" - }, - "pirates": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.1.tgz", - "integrity": "sha512-WuNqLTbMI3tmfef2TKxlQmAiLHKtFhlsCZnPIpuv2Ow0RDVO8lfy1Opf4NUzlMXLjPl+Men7AuVdX6TA+s+uGA==", - "dev": true, - "requires": { - "node-modules-regexp": "^1.0.0" - } - }, - "pkg-dir": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-3.0.0.tgz", - "integrity": "sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw==", - "dev": true, - "requires": { - "find-up": "^3.0.0" - }, - "dependencies": { - "find-up": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", - "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", - "dev": true, - "requires": { - "locate-path": "^3.0.0" - } - }, - "locate-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", - "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", - "dev": true, - "requires": { - "p-locate": "^3.0.0", - "path-exists": "^3.0.0" - } - }, - "p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", - "dev": true, - "requires": { - "p-try": "^2.0.0" - } - }, - "p-locate": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", - "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", - "dev": true, - "requires": { - "p-limit": "^2.0.0" - } - }, - "p-try": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", - "dev": true - } - } - }, - "pkg-up": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/pkg-up/-/pkg-up-2.0.0.tgz", - "integrity": "sha1-yBmscoBZpGHKscOImivjxJoATX8=", - "dev": true, - "requires": { - "find-up": "^2.1.0" - } - }, - "posix-character-classes": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz", - "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=", - "optional": true - }, - "private": { - "version": "0.1.8", - "resolved": "https://registry.npmjs.org/private/-/private-0.1.8.tgz", - "integrity": "sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg==", - "dev": true - }, - "process-nextick-args": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", - "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" - }, - "qs": { - "version": "6.9.4", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.9.4.tgz", - "integrity": "sha512-A1kFqHekCTM7cz0udomYUoYNWjBebHm/5wzU/XqrBRBNWectVH0QIiN+NEcZ0Dte5hvzHwbr8+XQmguPhJ6WdQ==" - }, - "readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "readdirp": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.2.1.tgz", - "integrity": "sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ==", - "optional": true, - "requires": { - "graceful-fs": "^4.1.11", - "micromatch": "^3.1.10", - "readable-stream": "^2.0.2" - } - }, - "regenerate": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.0.tgz", - "integrity": "sha512-1G6jJVDWrt0rK99kBjvEtziZNCICAuvIPkSiUFIQxVP06RCVpq3dmDo2oi6ABpYaDYaTRr67BEhL8r1wgEZZKg==", - "dev": true - }, - "regenerate-unicode-properties": { - "version": "8.2.0", - "resolved": "https://registry.npmjs.org/regenerate-unicode-properties/-/regenerate-unicode-properties-8.2.0.tgz", - "integrity": "sha512-F9DjY1vKLo/tPePDycuH3dn9H1OTPIkVD9Kz4LODu+F2C75mgjAJ7x/gwy6ZcSNRAAkhNlJSOHRe8k3p+K9WhA==", - "dev": true, - "requires": { - "regenerate": "^1.4.0" - } - }, - "regenerator-runtime": { - "version": "0.13.5", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.5.tgz", - "integrity": "sha512-ZS5w8CpKFinUzOwW3c83oPeVXoNsrLsaCoLtJvAClH135j/R77RuymhiSErhm2lKcwSCIpmvIWSbDkIfAqKQlA==", - "dev": true - }, - "regenerator-transform": { - "version": "0.14.4", - "resolved": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.14.4.tgz", - "integrity": "sha512-EaJaKPBI9GvKpvUz2mz4fhx7WPgvwRLY9v3hlNHWmAuJHI13T4nwKnNvm5RWJzEdnI5g5UwtOww+S8IdoUC2bw==", - "dev": true, - "requires": { - "@babel/runtime": "^7.8.4", - "private": "^0.1.8" - } - }, - "regex-not": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", - "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", - "optional": true, - "requires": { - "extend-shallow": "^3.0.2", - "safe-regex": "^1.1.0" - } - }, - "regexpu-core": { - "version": "4.7.0", - "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-4.7.0.tgz", - "integrity": "sha512-TQ4KXRnIn6tz6tjnrXEkD/sshygKH/j5KzK86X8MkeHyZ8qst/LZ89j3X4/8HEIfHANTFIP/AbXakeRhWIl5YQ==", - "dev": true, - "requires": { - "regenerate": "^1.4.0", - "regenerate-unicode-properties": "^8.2.0", - "regjsgen": "^0.5.1", - "regjsparser": "^0.6.4", - "unicode-match-property-ecmascript": "^1.0.4", - "unicode-match-property-value-ecmascript": "^1.2.0" - } - }, - "regjsgen": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.5.1.tgz", - "integrity": "sha512-5qxzGZjDs9w4tzT3TPhCJqWdCc3RLYwy9J2NB0nm5Lz+S273lvWcpjaTGHsT1dc6Hhfq41uSEOw8wBmxrKOuyg==", - "dev": true - }, - "regjsparser": { - "version": "0.6.4", - "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.6.4.tgz", - "integrity": "sha512-64O87/dPDgfk8/RQqC4gkZoGyyWFIEUTTh80CU6CWuK5vkCGyekIx+oKcEIYtP/RAxSQltCZHCNu/mdd7fqlJw==", - "dev": true, - "requires": { - "jsesc": "~0.5.0" - }, - "dependencies": { - "jsesc": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", - "integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=", - "dev": true - } - } - }, - "remove-trailing-separator": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", - "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=", - "optional": true - }, - "repeat-element": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.3.tgz", - "integrity": "sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g==", - "optional": true - }, - "repeat-string": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", - "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", - "optional": true - }, - "resolve": { - "version": "1.17.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz", - "integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==", - "dev": true, - "requires": { - "path-parse": "^1.0.6" - } - }, - "resolve-url": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", - "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=", - "optional": true - }, - "ret": { - "version": "0.1.15", - "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", - "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", - "optional": true - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - }, - "safe-regex": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", - "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", - "optional": true, - "requires": { - "ret": "~0.1.10" - } - }, - "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==" - }, - "set-value": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz", - "integrity": "sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw==", - "optional": true, - "requires": { - "extend-shallow": "^2.0.1", - "is-extendable": "^0.1.1", - "is-plain-object": "^2.0.3", - "split-string": "^3.0.1" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "optional": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "sinon": { - "version": "7.5.0", - "resolved": "https://registry.npmjs.org/sinon/-/sinon-7.5.0.tgz", - "integrity": "sha512-AoD0oJWerp0/rY9czP/D6hDTTUYGpObhZjMpd7Cl/A6+j0xBE+ayL/ldfggkBXUs0IkvIiM1ljM8+WkOc5k78Q==", - "dev": true, - "requires": { - "@sinonjs/commons": "^1.4.0", - "@sinonjs/formatio": "^3.2.1", - "@sinonjs/samsam": "^3.3.3", - "diff": "^3.5.0", - "lolex": "^4.2.0", - "nise": "^1.5.2", - "supports-color": "^5.5.0" - } - }, - "slash": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-2.0.0.tgz", - "integrity": "sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A==" - }, - "snapdragon": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", - "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==", - "optional": true, - "requires": { - "base": "^0.11.1", - "debug": "^2.2.0", - "define-property": "^0.2.5", - "extend-shallow": "^2.0.1", - "map-cache": "^0.2.2", - "source-map": "^0.5.6", - "source-map-resolve": "^0.5.0", - "use": "^3.1.0" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "optional": true, - "requires": { - "is-descriptor": "^0.1.0" - } - }, - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "optional": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "snapdragon-node": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz", - "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==", - "optional": true, - "requires": { - "define-property": "^1.0.0", - "isobject": "^3.0.0", - "snapdragon-util": "^3.0.1" - }, - "dependencies": { - "define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", - "optional": true, - "requires": { - "is-descriptor": "^1.0.0" - } - }, - "is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "optional": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "optional": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "optional": true, - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - } - } - } - }, - "snapdragon-util": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz", - "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==", - "optional": true, - "requires": { - "kind-of": "^3.2.0" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "optional": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "source-map": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=" - }, - "source-map-resolve": { - "version": "0.5.3", - "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.3.tgz", - "integrity": "sha512-Htz+RnsXWk5+P2slx5Jh3Q66vhQj1Cllm0zvnaY98+NFx+Dv2CF/f5O/t8x+KaNdrdIAsruNzoh/KpialbqAnw==", - "optional": true, - "requires": { - "atob": "^2.1.2", - "decode-uri-component": "^0.2.0", - "resolve-url": "^0.2.1", - "source-map-url": "^0.4.0", - "urix": "^0.1.0" - } - }, - "source-map-support": { - "version": "0.5.19", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz", - "integrity": "sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==", - "dev": true, - "requires": { - "buffer-from": "^1.0.0", - "source-map": "^0.6.0" - }, - "dependencies": { - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - } - } - }, - "source-map-url": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.0.tgz", - "integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM=", - "optional": true - }, - "split-string": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", - "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", - "optional": true, - "requires": { - "extend-shallow": "^3.0.0" - } - }, - "static-extend": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", - "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=", - "optional": true, - "requires": { - "define-property": "^0.2.5", - "object-copy": "^0.1.0" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "optional": true, - "requires": { - "is-descriptor": "^0.1.0" - } - } - } - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "requires": { - "safe-buffer": "~5.1.0" - } - }, - "superagent": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/superagent/-/superagent-3.7.0.tgz", - "integrity": "sha512-/8trxO6NbLx4YXb7IeeFTSmsQ35pQBiTBsLNvobZx7qBzBeHYvKCyIIhW2gNcWbLzYxPAjdgFbiepd8ypwC0Gw==", - "requires": { - "component-emitter": "^1.2.0", - "cookiejar": "^2.1.0", - "debug": "^3.1.0", - "extend": "^3.0.0", - "form-data": "^2.3.1", - "formidable": "^1.1.1", - "methods": "^1.1.1", - "mime": "^1.4.1", - "qs": "^6.5.1", - "readable-stream": "^2.0.5" - }, - "dependencies": { - "debug": { - "version": "3.2.6", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", - "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", - "requires": { - "ms": "^2.1.1" - } - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" - } - } - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - }, - "to-fast-properties": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", - "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", - "dev": true - }, - "to-object-path": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz", - "integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=", - "optional": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "optional": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "to-regex": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz", - "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==", - "optional": true, - "requires": { - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "regex-not": "^1.0.2", - "safe-regex": "^1.1.0" - } - }, - "to-regex-range": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", - "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", - "optional": true, - "requires": { - "is-number": "^3.0.0", - "repeat-string": "^1.6.1" - } - }, - "type-detect": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", - "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", - "dev": true - }, - "unicode-canonical-property-names-ecmascript": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-1.0.4.tgz", - "integrity": "sha512-jDrNnXWHd4oHiTZnx/ZG7gtUTVp+gCcTTKr8L0HjlwphROEW3+Him+IpvC+xcJEFegapiMZyZe02CyuOnRmbnQ==", - "dev": true - }, - "unicode-match-property-ecmascript": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-1.0.4.tgz", - "integrity": "sha512-L4Qoh15vTfntsn4P1zqnHulG0LdXgjSO035fEpdtp6YxXhMT51Q6vgM5lYdG/5X3MjS+k/Y9Xw4SFCY9IkR0rg==", - "dev": true, - "requires": { - "unicode-canonical-property-names-ecmascript": "^1.0.4", - "unicode-property-aliases-ecmascript": "^1.0.4" - } - }, - "unicode-match-property-value-ecmascript": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-1.2.0.tgz", - "integrity": "sha512-wjuQHGQVofmSJv1uVISKLE5zO2rNGzM/KCYZch/QQvez7C1hUhBIuZ701fYXExuufJFMPhv2SyL8CyoIfMLbIQ==", - "dev": true - }, - "unicode-property-aliases-ecmascript": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-1.1.0.tgz", - "integrity": "sha512-PqSoPh/pWetQ2phoj5RLiaqIk4kCNwoV3CI+LfGmWLKI3rE3kl1h59XpX2BjgDrmbxD9ARtQobPGU1SguCYuQg==", - "dev": true - }, - "union-value": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz", - "integrity": "sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg==", - "optional": true, - "requires": { - "arr-union": "^3.1.0", - "get-value": "^2.0.6", - "is-extendable": "^0.1.1", - "set-value": "^2.0.1" - } - }, - "unset-value": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", - "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=", - "optional": true, - "requires": { - "has-value": "^0.3.1", - "isobject": "^3.0.0" - }, - "dependencies": { - "has-value": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz", - "integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=", - "optional": true, - "requires": { - "get-value": "^2.0.3", - "has-values": "^0.1.4", - "isobject": "^2.0.0" - }, - "dependencies": { - "isobject": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", - "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", - "optional": true, - "requires": { - "isarray": "1.0.0" - } - } - } - }, - "has-values": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz", - "integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E=", - "optional": true - } - } - }, - "upath": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/upath/-/upath-1.2.0.tgz", - "integrity": "sha512-aZwGpamFO61g3OlfT7OQCHqhGnW43ieH9WZeP7QxN/G/jS4jfqUkZxoryvJgVPEcrl5NL/ggHsSmLMHuH64Lhg==", - "optional": true - }, - "urix": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", - "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=", - "optional": true - }, - "use": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", - "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==", - "optional": true - }, - "util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" - }, - "wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" - } - } -} diff --git a/samples/client/petstore/javascript-promise-es6/package.json b/samples/client/petstore/javascript-promise-es6/package.json index 0032c37d4775..6c8020661c9a 100644 --- a/samples/client/petstore/javascript-promise-es6/package.json +++ b/samples/client/petstore/javascript-promise-es6/package.json @@ -14,7 +14,7 @@ }, "dependencies": { "@babel/cli": "^7.0.0", - "superagent": "3.7.0" + "superagent": "^5.3.0" }, "devDependencies": { "@babel/core": "^7.0.0", @@ -37,7 +37,7 @@ "@babel/preset-env": "^7.0.0", "@babel/register": "^7.0.0", "expect.js": "^0.3.1", - "mocha": "^5.2.0", + "mocha": "^8.0.1", "sinon": "^7.2.0" }, "files": [ From b3bc69c8f1b319642d513bdfc0649f248e503134 Mon Sep 17 00:00:00 2001 From: Sebastian Appl <34442173+svd-sea@users.noreply.github.com> Date: Tue, 7 Jul 2020 13:41:57 +0200 Subject: [PATCH 002/129] [typescript] Add default values for typescript types (#6871) * Typescript: * Added default values for DateTimeSchema, DateSchema and BooleanSchema. * Added simple tests for default value parsing * Fixed date tests for default value parsing --- .../AbstractTypeScriptClientCodegen.java | 9 ++ .../fetch/TypeScriptFetchModelTest.java | 90 +++++++++++++++++-- .../TypeScriptAngularModelTest.java | 85 +++++++++++++++++- .../TypeScriptAngularJsModelTest.java | 84 ++++++++++++++++- .../TypeScriptNodeModelTest.java | 84 ++++++++++++++++- 5 files changed, 339 insertions(+), 13 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractTypeScriptClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractTypeScriptClientCodegen.java index 4b5f43e46008..5e84b3fec18e 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractTypeScriptClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractTypeScriptClientCodegen.java @@ -464,10 +464,19 @@ private String numericEnumValuesToEnumTypeUnion(List values) { @Override public String toDefaultValue(Schema p) { if (ModelUtils.isBooleanSchema(p)) { + if (p.getDefault() != null) { + return p.getDefault().toString(); + } return UNDEFINED_VALUE; } else if (ModelUtils.isDateSchema(p)) { + if (p.getDefault() != null) { + return p.getDefault().toString(); + } return UNDEFINED_VALUE; } else if (ModelUtils.isDateTimeSchema(p)) { + if (p.getDefault() != null) { + return p.getDefault().toString(); + } return UNDEFINED_VALUE; } else if (ModelUtils.isNumberSchema(p) || ModelUtils.isIntegerSchema(p)) { if (p.getDefault() != null) { diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/fetch/TypeScriptFetchModelTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/fetch/TypeScriptFetchModelTest.java index 1317a43af639..061e18bbaf07 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/fetch/TypeScriptFetchModelTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/fetch/TypeScriptFetchModelTest.java @@ -29,8 +29,15 @@ import org.testng.Assert; import org.testng.annotations.Test; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.time.LocalDateTime; +import java.time.OffsetDateTime; +import java.time.ZoneOffset; import java.util.Arrays; +import java.util.Date; import java.util.HashMap; +import java.util.Locale; /* import static io.swagger.codegen.CodegenConstants.IS_ENUM_EXT_NAME; @@ -49,6 +56,7 @@ public void simpleModelTest() { .addProperties("name", new StringSchema()) .addProperties("createdAt", new DateTimeSchema()) .addProperties("birthDate", new DateSchema()) + .addProperties("active", new BooleanSchema()) .addRequiredItem("id") .addRequiredItem("name"); @@ -60,7 +68,7 @@ public void simpleModelTest() { Assert.assertEquals(cm.name, "sample"); Assert.assertEquals(cm.classname, "Sample"); Assert.assertEquals(cm.description, "a sample model"); - Assert.assertEquals(cm.vars.size(), 4); + Assert.assertEquals(cm.vars.size(), 5); final CodegenProperty property1 = cm.vars.get(0); Assert.assertEquals(property1.baseName, "id"); @@ -98,9 +106,79 @@ public void simpleModelTest() { Assert.assertEquals(property4.dataType, "Date"); Assert.assertEquals(property4.name, "birthDate"); Assert.assertEquals(property4.defaultValue, "undefined"); - Assert.assertFalse(property4.hasMore); + Assert.assertTrue(property4.hasMore); Assert.assertFalse(property4.required); Assert.assertFalse(property4.isContainer); + + final CodegenProperty property5 = cm.vars.get(4); + Assert.assertEquals(property5.baseName, "active"); + Assert.assertEquals(property5.complexType, null); + Assert.assertEquals(property5.dataType, "boolean"); + Assert.assertEquals(property5.name, "active"); + Assert.assertEquals(property5.defaultValue, "undefined"); + Assert.assertFalse(property5.hasMore); + Assert.assertFalse(property5.required); + Assert.assertFalse(property5.isContainer); + } + + @Test(description = "convert and check default values for a simple TypeScript Angular model") + public void simpleModelDefaultValuesTest() throws ParseException { + IntegerSchema integerSchema = new IntegerSchema().format(SchemaTypeUtil.INTEGER64_FORMAT); + integerSchema.setDefault(1234); + + StringSchema stringSchema = new StringSchema(); + stringSchema.setDefault("Jack"); + + OffsetDateTime testOffsetDateTime = OffsetDateTime.of(LocalDateTime.of(2020, 1, 1, 12, 0), ZoneOffset.UTC); + DateTimeSchema dateTimeSchema = new DateTimeSchema(); + dateTimeSchema.setDefault(testOffsetDateTime); + + Date testDate = Date.from(testOffsetDateTime.toInstant()); + DateSchema dateSchema = new DateSchema(); + dateSchema.setDefault(testDate); + + BooleanSchema booleanSchema = new BooleanSchema(); + booleanSchema.setDefault(true); + + final Schema model = new Schema() + .description("a sample model") + .addProperties("id", integerSchema) + .addProperties("name", stringSchema) + .addProperties("createdAt", dateTimeSchema) + .addProperties("birthDate", dateSchema) + .addProperties("active", booleanSchema) + .addRequiredItem("id") + .addRequiredItem("name"); + + final DefaultCodegen codegen = new TypeScriptFetchClientCodegen(); + 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(), 5); + + final CodegenProperty property1 = cm.vars.get(0); + Assert.assertEquals(property1.baseName, "id"); + Assert.assertEquals(property1.defaultValue, "1234"); + + final CodegenProperty property2 = cm.vars.get(1); + Assert.assertEquals(property2.baseName, "name"); + Assert.assertEquals(property2.defaultValue, "'Jack'"); + + final CodegenProperty property3 = cm.vars.get(2); + Assert.assertEquals(property3.baseName, "createdAt"); + Assert.assertEquals(OffsetDateTime.parse(property3.defaultValue), testOffsetDateTime); + + final CodegenProperty property4 = cm.vars.get(3); + Assert.assertEquals(property4.baseName, "birthDate"); + Assert.assertEquals(new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy", Locale.ENGLISH).parse(property4.defaultValue), testDate); + + final CodegenProperty property5 = cm.vars.get(4); + Assert.assertEquals(property5.baseName, "active"); + Assert.assertEquals(property5.defaultValue, "true"); } @Test(description = "convert a model with list property") @@ -223,7 +301,7 @@ public void mapModelTest() { } @Test(description = "test enum array model") - public void enumArrayMdoelTest() { + public void enumArrayModelTest() { // TODO: update yaml file. final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml"); final DefaultCodegen codegen = new TypeScriptFetchClientCodegen(); @@ -262,7 +340,7 @@ public void enumArrayMdoelTest() { } @Test(description = "test enum model for values (numeric, string, etc)") - public void enumMdoelValueTest() { + public void enumModelValueTest() { final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml"); final DefaultCodegen codegen = new TypeScriptFetchClientCodegen(); codegen.processOpts(); @@ -297,7 +375,7 @@ public void enumMdoelValueTest() { @Test(description = "Add null safe additional property indexer when enabled") public void testNullSafeAdditionalProps() { final Schema model = new Schema() - .additionalProperties(new StringSchema()); + .additionalProperties(new StringSchema()); final DefaultCodegen codegen = new TypeScriptFetchClientCodegen(); codegen.additionalProperties().put("nullSafeAdditionalProps", true); codegen.processOpts(); @@ -308,7 +386,7 @@ public void testNullSafeAdditionalProps() { @Test(description = "Don't add null safe additional property indexer by default") public void testWithoutNullSafeAdditionalProps() { final Schema model = new Schema() - .additionalProperties(new StringSchema()); + .additionalProperties(new StringSchema()); final DefaultCodegen codegen = new TypeScriptFetchClientCodegen(); codegen.processOpts(); diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptangular/TypeScriptAngularModelTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptangular/TypeScriptAngularModelTest.java index 2116d62bfc53..5cb2635050c2 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptangular/TypeScriptAngularModelTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptangular/TypeScriptAngularModelTest.java @@ -21,15 +21,23 @@ import io.swagger.v3.oas.models.OpenAPI; import io.swagger.v3.oas.models.media.*; import io.swagger.v3.parser.util.SchemaTypeUtil; -import org.openapitools.codegen.CodegenConstants; 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.TypeScriptAngularClientCodegen; +import org.openapitools.codegen.languages.TypeScriptFetchClientCodegen; import org.testng.Assert; import org.testng.annotations.Test; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.time.LocalDateTime; +import java.time.OffsetDateTime; +import java.time.ZoneOffset; +import java.util.Date; +import java.util.Locale; + @SuppressWarnings("static-method") public class TypeScriptAngularModelTest { @@ -41,6 +49,7 @@ public void simpleModelTest() { .addProperties("name", new StringSchema()) .addProperties("createdAt", new DateTimeSchema()) .addProperties("birthDate", new DateSchema()) + .addProperties("active", new BooleanSchema()) .addRequiredItem("id") .addRequiredItem("name"); final DefaultCodegen codegen = new TypeScriptAngularClientCodegen(); @@ -51,7 +60,7 @@ public void simpleModelTest() { Assert.assertEquals(cm.name, "sample"); Assert.assertEquals(cm.classname, "Sample"); Assert.assertEquals(cm.description, "a sample model"); - Assert.assertEquals(cm.vars.size(), 4); + Assert.assertEquals(cm.vars.size(), 5); final CodegenProperty property1 = cm.vars.get(0); Assert.assertEquals(property1.baseName, "id"); @@ -91,9 +100,79 @@ public void simpleModelTest() { Assert.assertEquals(property4.name, "birthDate"); Assert.assertEquals(property4.baseType, "string"); Assert.assertEquals(property4.defaultValue, "undefined"); - Assert.assertFalse(property4.hasMore); + Assert.assertTrue(property4.hasMore); Assert.assertFalse(property4.required); Assert.assertFalse(property4.isContainer); + + final CodegenProperty property5 = cm.vars.get(4); + Assert.assertEquals(property5.baseName, "active"); + Assert.assertEquals(property5.complexType, null); + Assert.assertEquals(property5.dataType, "boolean"); + Assert.assertEquals(property5.name, "active"); + Assert.assertEquals(property5.defaultValue, "undefined"); + Assert.assertFalse(property5.hasMore); + Assert.assertFalse(property5.required); + Assert.assertFalse(property5.isContainer); + } + + @Test(description = "convert and check default values for a simple TypeScript Angular model") + public void simpleModelDefaultValuesTest() throws ParseException { + IntegerSchema integerSchema = new IntegerSchema().format(SchemaTypeUtil.INTEGER64_FORMAT); + integerSchema.setDefault(1234); + + StringSchema stringSchema = new StringSchema(); + stringSchema.setDefault("Jack"); + + OffsetDateTime testOffsetDateTime = OffsetDateTime.of(LocalDateTime.of(2020, 1, 1, 12, 0), ZoneOffset.UTC); + DateTimeSchema dateTimeSchema = new DateTimeSchema(); + dateTimeSchema.setDefault(testOffsetDateTime); + + Date testDate = Date.from(testOffsetDateTime.toInstant()); + DateSchema dateSchema = new DateSchema(); + dateSchema.setDefault(testDate); + + BooleanSchema booleanSchema = new BooleanSchema(); + booleanSchema.setDefault(true); + + final Schema model = new Schema() + .description("a sample model") + .addProperties("id", integerSchema) + .addProperties("name", stringSchema) + .addProperties("createdAt", dateTimeSchema) + .addProperties("birthDate", dateSchema) + .addProperties("active", booleanSchema) + .addRequiredItem("id") + .addRequiredItem("name"); + + final DefaultCodegen codegen = new TypeScriptFetchClientCodegen(); + 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(), 5); + + final CodegenProperty property1 = cm.vars.get(0); + Assert.assertEquals(property1.baseName, "id"); + Assert.assertEquals(property1.defaultValue, "1234"); + + final CodegenProperty property2 = cm.vars.get(1); + Assert.assertEquals(property2.baseName, "name"); + Assert.assertEquals(property2.defaultValue, "'Jack'"); + + final CodegenProperty property3 = cm.vars.get(2); + Assert.assertEquals(property3.baseName, "createdAt"); + Assert.assertEquals(OffsetDateTime.parse(property3.defaultValue), testOffsetDateTime); + + final CodegenProperty property4 = cm.vars.get(3); + Assert.assertEquals(property4.baseName, "birthDate"); + Assert.assertEquals(new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy", Locale.ENGLISH).parse(property4.defaultValue), testDate); + + final CodegenProperty property5 = cm.vars.get(4); + Assert.assertEquals(property5.baseName, "active"); + Assert.assertEquals(property5.defaultValue, "true"); } @Test(description = "convert a model with list property") diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptangularjs/TypeScriptAngularJsModelTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptangularjs/TypeScriptAngularJsModelTest.java index 30cb23de1d25..98877ed7a7b1 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptangularjs/TypeScriptAngularJsModelTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptangularjs/TypeScriptAngularJsModelTest.java @@ -26,9 +26,18 @@ import org.openapitools.codegen.DefaultCodegen; import org.openapitools.codegen.TestUtils; import org.openapitools.codegen.languages.TypeScriptAngularJsClientCodegen; +import org.openapitools.codegen.languages.TypeScriptFetchClientCodegen; import org.testng.Assert; import org.testng.annotations.Test; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.time.LocalDateTime; +import java.time.OffsetDateTime; +import java.time.ZoneOffset; +import java.util.Date; +import java.util.Locale; + @SuppressWarnings("static-method") public class TypeScriptAngularJsModelTest { @@ -40,6 +49,7 @@ public void simpleModelTest() { .addProperties("name", new StringSchema()) .addProperties("createdAt", new DateTimeSchema()) .addProperties("birthDate", new DateSchema()) + .addProperties("active", new BooleanSchema()) .addRequiredItem("id") .addRequiredItem("name"); final DefaultCodegen codegen = new TypeScriptAngularJsClientCodegen(); @@ -50,7 +60,7 @@ public void simpleModelTest() { Assert.assertEquals(cm.name, "sample"); Assert.assertEquals(cm.classname, "Sample"); Assert.assertEquals(cm.description, "a sample model"); - Assert.assertEquals(cm.vars.size(), 4); + Assert.assertEquals(cm.vars.size(), 5); final CodegenProperty property1 = cm.vars.get(0); Assert.assertEquals(property1.baseName, "id"); @@ -88,9 +98,79 @@ public void simpleModelTest() { Assert.assertEquals(property4.dataType, "string"); Assert.assertEquals(property4.name, "birthDate"); Assert.assertEquals(property4.defaultValue, "undefined"); - Assert.assertFalse(property4.hasMore); + Assert.assertTrue(property4.hasMore); Assert.assertFalse(property4.required); Assert.assertFalse(property4.isContainer); + + final CodegenProperty property5 = cm.vars.get(4); + Assert.assertEquals(property5.baseName, "active"); + Assert.assertEquals(property5.complexType, null); + Assert.assertEquals(property5.dataType, "boolean"); + Assert.assertEquals(property5.name, "active"); + Assert.assertEquals(property5.defaultValue, "undefined"); + Assert.assertFalse(property5.hasMore); + Assert.assertFalse(property5.required); + Assert.assertFalse(property5.isContainer); + } + + @Test(description = "convert and check default values for a simple TypeScript Angular model") + public void simpleModelDefaultValuesTest() throws ParseException { + IntegerSchema integerSchema = new IntegerSchema().format(SchemaTypeUtil.INTEGER64_FORMAT); + integerSchema.setDefault(1234); + + StringSchema stringSchema = new StringSchema(); + stringSchema.setDefault("Jack"); + + OffsetDateTime testOffsetDateTime = OffsetDateTime.of(LocalDateTime.of(2020, 1, 1, 12, 0), ZoneOffset.UTC); + DateTimeSchema dateTimeSchema = new DateTimeSchema(); + dateTimeSchema.setDefault(testOffsetDateTime); + + Date testDate = Date.from(testOffsetDateTime.toInstant()); + DateSchema dateSchema = new DateSchema(); + dateSchema.setDefault(testDate); + + BooleanSchema booleanSchema = new BooleanSchema(); + booleanSchema.setDefault(true); + + final Schema model = new Schema() + .description("a sample model") + .addProperties("id", integerSchema) + .addProperties("name", stringSchema) + .addProperties("createdAt", dateTimeSchema) + .addProperties("birthDate", dateSchema) + .addProperties("active", booleanSchema) + .addRequiredItem("id") + .addRequiredItem("name"); + + final DefaultCodegen codegen = new TypeScriptFetchClientCodegen(); + 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(), 5); + + final CodegenProperty property1 = cm.vars.get(0); + Assert.assertEquals(property1.baseName, "id"); + Assert.assertEquals(property1.defaultValue, "1234"); + + final CodegenProperty property2 = cm.vars.get(1); + Assert.assertEquals(property2.baseName, "name"); + Assert.assertEquals(property2.defaultValue, "'Jack'"); + + final CodegenProperty property3 = cm.vars.get(2); + Assert.assertEquals(property3.baseName, "createdAt"); + Assert.assertEquals(OffsetDateTime.parse(property3.defaultValue), testOffsetDateTime); + + final CodegenProperty property4 = cm.vars.get(3); + Assert.assertEquals(property4.baseName, "birthDate"); + Assert.assertEquals(new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy", Locale.ENGLISH).parse(property4.defaultValue), testDate); + + final CodegenProperty property5 = cm.vars.get(4); + Assert.assertEquals(property5.baseName, "active"); + Assert.assertEquals(property5.defaultValue, "true"); } @Test(description = "convert a model with list property") diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptnode/TypeScriptNodeModelTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptnode/TypeScriptNodeModelTest.java index e2f3b7c40d56..0c69c6026d28 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptnode/TypeScriptNodeModelTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptnode/TypeScriptNodeModelTest.java @@ -27,10 +27,19 @@ import org.openapitools.codegen.CodegenProperty; import org.openapitools.codegen.DefaultCodegen; import org.openapitools.codegen.TestUtils; +import org.openapitools.codegen.languages.TypeScriptFetchClientCodegen; import org.openapitools.codegen.languages.TypeScriptNodeClientCodegen; import org.testng.Assert; import org.testng.annotations.Test; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.time.LocalDateTime; +import java.time.OffsetDateTime; +import java.time.ZoneOffset; +import java.util.Date; +import java.util.Locale; + @SuppressWarnings("static-method") public class TypeScriptNodeModelTest { @@ -42,6 +51,7 @@ public void simpleModelTest() { .addProperties("name", new StringSchema()) .addProperties("createdAt", new DateTimeSchema()) .addProperties("birthDate", new DateSchema()) + .addProperties("active", new BooleanSchema()) .addRequiredItem("id") .addRequiredItem("name"); final DefaultCodegen codegen = new TypeScriptNodeClientCodegen(); @@ -52,7 +62,7 @@ public void simpleModelTest() { Assert.assertEquals(cm.name, "sample"); Assert.assertEquals(cm.classname, "Sample"); Assert.assertEquals(cm.description, "a sample model"); - Assert.assertEquals(cm.vars.size(), 4); + Assert.assertEquals(cm.vars.size(), 5); final CodegenProperty property1 = cm.vars.get(0); Assert.assertEquals(property1.baseName, "id"); @@ -87,8 +97,78 @@ public void simpleModelTest() { Assert.assertEquals(property4.dataType, "string"); Assert.assertEquals(property4.name, "birthDate"); Assert.assertEquals(property4.defaultValue, "undefined"); - Assert.assertFalse(property4.hasMore); + Assert.assertTrue(property4.hasMore); Assert.assertFalse(property4.required); + + final CodegenProperty property5 = cm.vars.get(4); + Assert.assertEquals(property5.baseName, "active"); + Assert.assertEquals(property5.complexType, null); + Assert.assertEquals(property5.dataType, "boolean"); + Assert.assertEquals(property5.name, "active"); + Assert.assertEquals(property5.defaultValue, "undefined"); + Assert.assertFalse(property5.hasMore); + Assert.assertFalse(property5.required); + Assert.assertFalse(property5.isContainer); + } + + @Test(description = "convert and check default values for a simple TypeScript Angular model") + public void simpleModelDefaultValuesTest() throws ParseException { + IntegerSchema integerSchema = new IntegerSchema().format(SchemaTypeUtil.INTEGER64_FORMAT); + integerSchema.setDefault(1234); + + StringSchema stringSchema = new StringSchema(); + stringSchema.setDefault("Jack"); + + OffsetDateTime testOffsetDateTime = OffsetDateTime.of(LocalDateTime.of(2020, 1, 1, 12, 0), ZoneOffset.UTC); + DateTimeSchema dateTimeSchema = new DateTimeSchema(); + dateTimeSchema.setDefault(testOffsetDateTime); + + Date testDate = Date.from(testOffsetDateTime.toInstant()); + DateSchema dateSchema = new DateSchema(); + dateSchema.setDefault(testDate); + + BooleanSchema booleanSchema = new BooleanSchema(); + booleanSchema.setDefault(true); + + final Schema model = new Schema() + .description("a sample model") + .addProperties("id", integerSchema) + .addProperties("name", stringSchema) + .addProperties("createdAt", dateTimeSchema) + .addProperties("birthDate", dateSchema) + .addProperties("active", booleanSchema) + .addRequiredItem("id") + .addRequiredItem("name"); + + final DefaultCodegen codegen = new TypeScriptFetchClientCodegen(); + 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(), 5); + + final CodegenProperty property1 = cm.vars.get(0); + Assert.assertEquals(property1.baseName, "id"); + Assert.assertEquals(property1.defaultValue, "1234"); + + final CodegenProperty property2 = cm.vars.get(1); + Assert.assertEquals(property2.baseName, "name"); + Assert.assertEquals(property2.defaultValue, "'Jack'"); + + final CodegenProperty property3 = cm.vars.get(2); + Assert.assertEquals(property3.baseName, "createdAt"); + Assert.assertEquals(OffsetDateTime.parse(property3.defaultValue), testOffsetDateTime); + + final CodegenProperty property4 = cm.vars.get(3); + Assert.assertEquals(property4.baseName, "birthDate"); + Assert.assertEquals(new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy", Locale.ENGLISH).parse(property4.defaultValue), testDate); + + final CodegenProperty property5 = cm.vars.get(4); + Assert.assertEquals(property5.baseName, "active"); + Assert.assertEquals(property5.defaultValue, "true"); } @Test(description = "convert a model with list property") From 566b2b76477b3d1f6de222dd3f9f29f5f5051b18 Mon Sep 17 00:00:00 2001 From: Harald Fernengel Date: Tue, 7 Jul 2020 13:44:25 +0200 Subject: [PATCH 003/129] Revert "[typescript-fetch] Support deepObject query params (#6075)" (#6860) This reverts commit 354f195ec09293cfd731b72e67c3cc977b8c0894. It became superfluous due to some other changes in runtime and changing of the queryParameters in d9a6f4d --- .../languages/TypeScriptFetchClientCodegen.java | 14 -------------- .../main/resources/typescript-fetch/apis.mustache | 5 ----- 2 files changed, 19 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptFetchClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptFetchClientCodegen.java index c5b857ef2cd9..eec358455da5 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptFetchClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptFetchClientCodegen.java @@ -247,23 +247,9 @@ public Map postProcessOperationsWithModels(Map o this.addOperationObjectResponseInformation(operations); this.addOperationPrefixParameterInterfacesInformation(operations); this.escapeOperationIds(operations); - this.addDeepObjectVendorExtension(operations); return operations; } - private void addDeepObjectVendorExtension(Map operations) { - Map _operations = (Map) operations.get("operations"); - List operationList = (List) _operations.get("operation"); - - for (CodegenOperation op : operationList) { - for (CodegenParameter param : op.queryParams) { - if (param.style != null && param.style.equals("deepObject")) { - param.vendorExtensions.put("x-codegen-isDeepObject", true); - } - } - } - } - private void escapeOperationIds(Map operations) { Map _operations = (Map) operations.get("operations"); List operationList = (List) _operations.get("operation"); diff --git a/modules/openapi-generator/src/main/resources/typescript-fetch/apis.mustache b/modules/openapi-generator/src/main/resources/typescript-fetch/apis.mustache index be03f0eb1771..056e0dbb2677 100644 --- a/modules/openapi-generator/src/main/resources/typescript-fetch/apis.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-fetch/apis.mustache @@ -122,12 +122,7 @@ export class {{classname}} extends runtime.BaseAPI { queryParameters['{{baseName}}'] = (requestParameters.{{paramName}} as any).toISOString().substr(0,10); {{/isDate}} {{^isDate}} - {{#vendorExtensions.x-codegen-isDeepObject}} - queryParameters['{{baseName}}'] = runtime.querystring(requestParameters.{{paramName}} as unknown as runtime.HTTPQuery, '{{baseName}}'); - {{/vendorExtensions.x-codegen-isDeepObject}} - {{^vendorExtensions.x-codegen-isDeepObject}} queryParameters['{{baseName}}'] = requestParameters.{{paramName}}; - {{/vendorExtensions.x-codegen-isDeepObject}} {{/isDate}} {{/isDateTime}} } From ce177a7fb654cce1d8b7ac7461696744867ecb65 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Wed, 8 Jul 2020 11:30:16 +0800 Subject: [PATCH 004/129] Add isAdditionalPropertiesTrue (#6880) * move postProcessModel to the end * add isAdditionalPropertiesTrue * remove supportsAdditionalPropertiesWithComposedSchema from go exp * remove x-additional-properties * update comment --- .../openapitools/codegen/CodegenModel.java | 5 +++ .../openapitools/codegen/DefaultCodegen.java | 39 ++++++++++++------- .../GoClientExperimentalCodegen.java | 5 --- .../go-experimental/model_simple.mustache | 16 ++++---- .../model_additional_properties_any_type.go | 25 ------------ .../go-petstore/model_nullable_class.go | 36 ----------------- 6 files changed, 39 insertions(+), 87 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenModel.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenModel.java index e868c2b1131b..1617a10e13d2 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenModel.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenModel.java @@ -129,6 +129,11 @@ public class CodegenModel implements IJsonSchemaValidationProperties { */ public String additionalPropertiesType; + /** + * True if additionalProperties is set to true (boolean value) + */ + public boolean isAdditionalPropertiesTrue; + private Integer maxProperties; private Integer minProperties; private boolean uniqueItems; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java index a331c1a126a2..1ee020cee2bb 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java @@ -2483,19 +2483,6 @@ public CodegenModel fromModel(String name, Schema schema) { // remove duplicated properties m.removeAllDuplicatedProperty(); - // 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); - } - } - // set isDiscriminator on the discriminator property if (m.discriminator != null) { String discPropName = m.discriminator.getPropertyBaseName(); @@ -2525,6 +2512,32 @@ public int compare(CodegenProperty one, CodegenProperty another) { Collections.sort(m.allVars, comparator); } + // process 'additionalProperties' + if (schema.getAdditionalProperties() == null) { + m.isAdditionalPropertiesTrue = false; // TODO fix the old (incorrect) behaviour (likely with an option) + } else if (schema.getAdditionalProperties() instanceof Boolean) { + if (Boolean.TRUE.equals(schema.getAdditionalProperties())) { + m.isAdditionalPropertiesTrue = true; + } else { + m.isAdditionalPropertiesTrue = false; + } + } else { + m.isAdditionalPropertiesTrue = false; + } + + // 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); + } + } + return m; } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoClientExperimentalCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoClientExperimentalCodegen.java index b9e9fbedbec2..c52e87e65afc 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoClientExperimentalCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoClientExperimentalCodegen.java @@ -222,11 +222,6 @@ public Map postProcessModels(Map objs) { if (model.anyOf != null && !model.anyOf.isEmpty()) { imports.add(createMapping("import", "fmt")); } - - // add x-additional-properties - if ("map[string]map[string]interface{}".equals(model.parent)) { - model.vendorExtensions.put("x-additional-properties", true); - } } } return objs; diff --git a/modules/openapi-generator/src/main/resources/go-experimental/model_simple.mustache b/modules/openapi-generator/src/main/resources/go-experimental/model_simple.mustache index c4d8d5f684f3..2707045b2443 100644 --- a/modules/openapi-generator/src/main/resources/go-experimental/model_simple.mustache +++ b/modules/openapi-generator/src/main/resources/go-experimental/model_simple.mustache @@ -13,15 +13,15 @@ type {{classname}} struct { {{/description}} {{name}} {{^required}}{{^isNullable}}*{{/isNullable}}{{/required}}{{{dataType}}} `json:"{{baseName}}{{^required}},omitempty{{/required}}"{{#withXml}} xml:"{{baseName}}{{#isXmlAttribute}},attr{{/isXmlAttribute}}"{{/withXml}}{{#vendorExtensions.x-go-custom-tag}} {{{.}}}{{/vendorExtensions.x-go-custom-tag}}` {{/vars}} -{{#vendorExtensions.x-additional-properties}} +{{#isAdditionalPropertiesTrue}} AdditionalProperties map[string]interface{} -{{/vendorExtensions.x-additional-properties}} +{{/isAdditionalPropertiesTrue}} } -{{#vendorExtensions.x-additional-properties}} +{{#isAdditionalPropertiesTrue}} type _{{{classname}}} {{{classname}}} -{{/vendorExtensions.x-additional-properties}} +{{/isAdditionalPropertiesTrue}} // New{{classname}} instantiates a new {{classname}} object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -253,17 +253,17 @@ func (o {{classname}}) MarshalJSON() ([]byte, error) { } {{/isNullable}} {{/vars}} - {{#vendorExtensions.x-additional-properties}} + {{#isAdditionalPropertiesTrue}} for key, value := range o.AdditionalProperties { toSerialize[key] = value } - {{/vendorExtensions.x-additional-properties}} + {{/isAdditionalPropertiesTrue}} return json.Marshal(toSerialize) } -{{#vendorExtensions.x-additional-properties}} +{{#isAdditionalPropertiesTrue}} func (o *{{{classname}}}) UnmarshalJSON(bytes []byte) (err error) { var{{{classname}}} := _{{{classname}}}{} @@ -283,5 +283,5 @@ func (o *{{{classname}}}) UnmarshalJSON(bytes []byte) (err error) { return err } -{{/vendorExtensions.x-additional-properties}} +{{/isAdditionalPropertiesTrue}} {{>nullable_model}} diff --git a/samples/client/petstore/go-experimental/go-petstore/model_additional_properties_any_type.go b/samples/client/petstore/go-experimental/go-petstore/model_additional_properties_any_type.go index 59e7a4dec0ae..a511ab6d5be9 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_additional_properties_any_type.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_additional_properties_any_type.go @@ -16,11 +16,8 @@ import ( // AdditionalPropertiesAnyType struct for AdditionalPropertiesAnyType type AdditionalPropertiesAnyType struct { Name *string `json:"name,omitempty"` - AdditionalProperties map[string]interface{} } -type _AdditionalPropertiesAnyType AdditionalPropertiesAnyType - // NewAdditionalPropertiesAnyType instantiates a new AdditionalPropertiesAnyType object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -75,31 +72,9 @@ func (o AdditionalPropertiesAnyType) MarshalJSON() ([]byte, error) { if o.Name != nil { toSerialize["name"] = o.Name } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - return json.Marshal(toSerialize) } -func (o *AdditionalPropertiesAnyType) UnmarshalJSON(bytes []byte) (err error) { - varAdditionalPropertiesAnyType := _AdditionalPropertiesAnyType{} - - if err = json.Unmarshal(bytes, &varAdditionalPropertiesAnyType); err == nil { - *o = AdditionalPropertiesAnyType(varAdditionalPropertiesAnyType) - } - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(bytes, &additionalProperties); err == nil { - delete(additionalProperties, "name") - o.AdditionalProperties = additionalProperties - } - - return err -} - type NullableAdditionalPropertiesAnyType struct { value *AdditionalPropertiesAnyType isSet bool diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_nullable_class.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_nullable_class.go index d2eb6062f6e8..72deb6ecf442 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_nullable_class.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_nullable_class.go @@ -28,11 +28,8 @@ type NullableClass struct { ObjectNullableProp map[string]map[string]interface{} `json:"object_nullable_prop,omitempty"` ObjectAndItemsNullableProp map[string]map[string]interface{} `json:"object_and_items_nullable_prop,omitempty"` ObjectItemsNullable *map[string]map[string]interface{} `json:"object_items_nullable,omitempty"` - AdditionalProperties map[string]interface{} } -type _NullableClass NullableClass - // NewNullableClass instantiates a new NullableClass object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -536,42 +533,9 @@ func (o NullableClass) MarshalJSON() ([]byte, error) { if o.ObjectItemsNullable != nil { toSerialize["object_items_nullable"] = o.ObjectItemsNullable } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - return json.Marshal(toSerialize) } -func (o *NullableClass) UnmarshalJSON(bytes []byte) (err error) { - varNullableClass := _NullableClass{} - - if err = json.Unmarshal(bytes, &varNullableClass); err == nil { - *o = NullableClass(varNullableClass) - } - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(bytes, &additionalProperties); err == nil { - delete(additionalProperties, "integer_prop") - delete(additionalProperties, "number_prop") - delete(additionalProperties, "boolean_prop") - delete(additionalProperties, "string_prop") - delete(additionalProperties, "date_prop") - delete(additionalProperties, "datetime_prop") - delete(additionalProperties, "array_nullable_prop") - delete(additionalProperties, "array_and_items_nullable_prop") - delete(additionalProperties, "array_items_nullable") - delete(additionalProperties, "object_nullable_prop") - delete(additionalProperties, "object_and_items_nullable_prop") - delete(additionalProperties, "object_items_nullable") - o.AdditionalProperties = additionalProperties - } - - return err -} - type NullableNullableClass struct { value *NullableClass isSet bool From 0be0a06d8417db7694840f699f346e95c2c9183b Mon Sep 17 00:00:00 2001 From: jekkel Date: Wed, 8 Jul 2020 10:30:31 +0200 Subject: [PATCH 005/129] [Java][Client][vert.x] Support per-call authentication and JsonNullable in client request bodies, fix path parameter encoding (#5732) * Support per-call authentication and JsonNullable in client request bodies Extensions ---------- Since vertx is an asynchronous/reactive toolkit usage of mutable fields of `ApiClient` to store authentication prohibits delegation of authentication from incoming call without recreating the client everytime (which is prohibitively expensive due to instantiation of objectmapper). This commit adds a per call authentication override which takes precedence over the mutable fields so a single client can be safely reused. To ease usage a simple builder-style auxiliary `AuthInfo` object is provided providing methods for each specified authentication. A new configuration option for `ApiClient` has been added: `timeout`. It gets applied as timeout for the vertx http request. Fixes ----- Request bodies have been wrongly serialized using vert.x built-in objectmapper instead of the embedded instance thus usage of beans with `JsonNullable` wrapped fields in request bodies led to bad requests. * update vertx samples * Client Java Vertx: Add url encode for path parameters. * update vertx samples --- .../Java/libraries/vertx/ApiClient.mustache | 80 +- .../Java/libraries/vertx/api.mustache | 3 + .../Java/libraries/vertx/apiImpl.mustache | 44 +- .../Java/libraries/vertx/api_test.mustache | 4 +- .../Java/libraries/vertx/rxApiImpl.mustache | 75 +- .../org/openapitools/client/ApiClient.java | 80 +- .../client/api/AnotherFakeApi.java | 3 + .../client/api/AnotherFakeApiImpl.java | 34 +- .../org/openapitools/client/api/FakeApi.java | 29 + .../openapitools/client/api/FakeApiImpl.java | 426 +++++--- .../client/api/FakeClassnameTags123Api.java | 3 + .../api/FakeClassnameTags123ApiImpl.java | 34 +- .../org/openapitools/client/api/PetApi.java | 19 + .../openapitools/client/api/PetApiImpl.java | 249 +++-- .../org/openapitools/client/api/StoreApi.java | 9 + .../openapitools/client/api/StoreApiImpl.java | 104 +- .../org/openapitools/client/api/UserApi.java | 17 + .../openapitools/client/api/UserApiImpl.java | 204 +++- .../client/api/rxjava/AnotherFakeApi.java | 63 +- .../client/api/rxjava/FakeApi.java | 915 +++++++++++++----- .../api/rxjava/FakeClassnameTags123Api.java | 63 +- .../client/api/rxjava/PetApi.java | 517 +++++++--- .../client/api/rxjava/StoreApi.java | 207 ++-- .../client/api/rxjava/UserApi.java | 419 +++++--- 24 files changed, 2679 insertions(+), 922 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/vertx/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/vertx/ApiClient.mustache index bc19a9253086..c7d0056fef87 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/vertx/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/vertx/ApiClient.mustache @@ -9,6 +9,7 @@ import {{invokerPackage}}.auth.OAuth; {{/hasOAuthMethods}} import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.ObjectMapper; @@ -55,6 +56,7 @@ public class ApiClient { private DateFormat dateFormat; private ObjectMapper objectMapper; private String downloadsDir = ""; + private int timeout = -1; public ApiClient(Vertx vertx, JsonObject config) { Objects.requireNonNull(vertx, "Vertx must not be null"); @@ -96,6 +98,7 @@ public class ApiClient { this.downloadsDir = config.getString("downloadsDir", this.downloadsDir); this.config = config; this.identifier = UUID.randomUUID().toString(); + this.timeout = config.getInteger("timeout", -1); } public Vertx getVertx() { @@ -428,7 +431,11 @@ public class ApiClient { AsyncFile file = (AsyncFile) body; request.sendStream(file, responseHandler); } else { - request.sendJson(body, responseHandler); + try { + request.sendBuffer(Buffer.buffer(this.objectMapper.writeValueAsBytes(body)), responseHandler); + } catch (JsonProcessingException jsonProcessingException) { + responseHandler.handle(Future.failedFuture(jsonProcessingException)); + } } } @@ -446,14 +453,15 @@ public class ApiClient { * @param accepts The request's Accept headers * @param contentTypes The request's Content-Type headers * @param authNames The authentications to apply + * @param authInfo The call specific auth override * @param returnType The return type into which to deserialize the response * @param resultHandler The asynchronous response handler */ public void invokeAPI(String path, String method, List queryParams, Object body, MultiMap headerParams, - MultiMap cookieParams, Map formParams, String[] accepts, String[] contentTypes, String[] authNames, + MultiMap cookieParams, Map formParams, String[] accepts, String[] contentTypes, String[] authNames, AuthInfo authInfo, TypeReference returnType, Handler> resultHandler) { - updateParamsForAuth(authNames, queryParams, headerParams, cookieParams); + updateParamsForAuth(authNames, authInfo, queryParams, headerParams, cookieParams); if (accepts != null && accepts.length > 0) { headerParams.add(HttpHeaders.ACCEPT, selectHeaderAccept(accepts)); @@ -465,6 +473,7 @@ public class ApiClient { HttpMethod httpMethod = HttpMethod.valueOf(method); HttpRequest request = getWebClient().requestAbs(httpMethod, basePath + path); + request.timeout(this.timeout); if (httpMethod == HttpMethod.PATCH) { request.putHeader("X-HTTP-Method-Override", "PATCH"); @@ -645,11 +654,72 @@ public class ApiClient { * * @param authNames The authentications to apply */ - protected void updateParamsForAuth(String[] authNames, List queryParams, MultiMap headerParams, MultiMap cookieParams) { + protected void updateParamsForAuth(String[] authNames, AuthInfo authInfo, List queryParams, MultiMap headerParams, MultiMap cookieParams) { for (String authName : authNames) { - Authentication auth = authentications.get(authName); + Authentication auth; + if (authInfo != null && authInfo.authentications.containsKey(authName)) { + auth = authInfo.authentications.get(authName); + } else { + auth = authentications.get(authName); + } if (auth == null) throw new RuntimeException("Authentication undefined: " + authName); auth.applyToParams(queryParams, headerParams, cookieParams); } } + + public static class AuthInfo { + + private final Map authentications = new LinkedHashMap<>();{{#authMethods}}{{#isBasic}}{{#isBasicBasic}} + + public void add{{#lambda.titlecase}}{{name}}{{/lambda.titlecase}}Authentication(String username, String password) { + HttpBasicAuth auth = new HttpBasicAuth(); + auth.setUsername(username); + auth.setPassword(password); + authentications.put("{{name}}", auth); + }{{/isBasicBasic}}{{^isBasicBasic}} + + public void add{{#lambda.titlecase}}{{name}}{{/lambda.titlecase}}Authentication(String bearerToken) { + HttpBearerAuth auth = new + HttpBearerAuth("{{scheme}}"); + auth.setBearerToken(bearerToken); + authentications.put("{{name}}", auth); + }{{/isBasicBasic}}{{/isBasic}}{{#isApiKey}} + + public void add{{#lambda.titlecase}}{{name}}{{/lambda.titlecase}}Authentication(String apikey, String apiKeyPrefix) { + ApiKeyAuth auth = new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{#isKeyInQuery}}"query"{{/isKeyInQuery}}{{#isKeyInCookie}}"cookie"{{/isKeyInCookie}},"{{keyParamName}}"); + auth.setApiKey(apikey); + auth.setApiKeyPrefix(apiKeyPrefix); + authentications.put("{{name}}", auth); + }{{/isApiKey}}{{#isOAuth}} + + public void add{{#lambda.titlecase}}{{name}}{{/lambda.titlecase}}Authentication(String accessToken) { + OAuth auth = new OAuth(); + auth.setAccessToken(accessToken); + authentications.put("{{name}}", auth); + }{{/isOAuth}}{{/authMethods}}{{#authMethods}}{{#isBasic}}{{#isBasicBasic}} + + public static AuthInfo for{{#lambda.titlecase}}{{name}}{{/lambda.titlecase}}(String username, String password) { + AuthInfo authInfo = new AuthInfo(); + authInfo.add{{#lambda.titlecase}}{{name}}{{/lambda.titlecase}}Authentication(username, password); + return authInfo; + }{{/isBasicBasic}}{{^isBasicBasic}} + + public static AuthInfo for{{#lambda.titlecase}}{{name}}{{/lambda.titlecase}}Authentication(String bearerToken) { + AuthInfo authInfo = new AuthInfo(); + authInfo.add{{#lambda.titlecase}}{{name}}{{/lambda.titlecase}}Authentication(bearerToken); + return authInfo; + }{{/isBasicBasic}}{{/isBasic}}{{#isApiKey}} + + public static AuthInfo for{{#lambda.titlecase}}{{name}}{{/lambda.titlecase}}Authentication(String apikey, String apiKeyPrefix) { + AuthInfo authInfo = new AuthInfo(); + authInfo.add{{#lambda.titlecase}}{{name}}{{/lambda.titlecase}}Authentication(apikey, apiKeyPrefix); + return authInfo; + }{{/isApiKey}}{{#isOAuth}} + + public static AuthInfo for{{#lambda.titlecase}}{{name}}{{/lambda.titlecase}}Authentication(String accessToken) { + AuthInfo authInfo = new AuthInfo(); + authInfo.add{{#lambda.titlecase}}{{name}}{{/lambda.titlecase}}Authentication(accessToken); + return authInfo; + }{{/isOAuth}}{{/authMethods}} + } } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/vertx/api.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/vertx/api.mustache index dcf9df4cc709..8cb5bd953738 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/vertx/api.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/vertx/api.mustache @@ -1,5 +1,6 @@ package {{package}}; +import {{invokerPackage}}.ApiClient; {{#imports}}import {{import}}; {{/imports}} import io.vertx.core.AsyncResult; @@ -14,6 +15,8 @@ public interface {{classname}} { {{#operation}} void {{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}, {{/allParams}}Handler> handler); + void {{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}, {{/allParams}}ApiClient.AuthInfo authInfo, Handler> handler); + {{/operation}} {{/operations}} } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/vertx/apiImpl.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/vertx/apiImpl.mustache index 5ea569f4ab2b..ed38fe794384 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/vertx/apiImpl.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/vertx/apiImpl.mustache @@ -11,6 +11,9 @@ import io.vertx.core.json.JsonObject; import com.fasterxml.jackson.core.type.TypeReference; import java.util.*; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; import {{invokerPackage}}.ApiClient; import {{invokerPackage}}.ApiException; @@ -41,14 +44,27 @@ public class {{classname}}Impl implements {{classname}} { {{#operation}} /** - * {{summary}} - * {{notes}} - {{#allParams}} - * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} - {{/allParams}} - * @param resultHandler Asynchronous result handler - */ + * {{summary}} + * {{notes}} + {{#allParams}} + * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} + {{/allParams}} + * @param resultHandler Asynchronous result handler + */ public void {{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}, {{/allParams}}Handler> resultHandler) { + {{operationId}}({{#allParams}}{{paramName}}, {{/allParams}}null, resultHandler); + } + + /** + * {{summary}} + * {{notes}} + {{#allParams}} + * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} + {{/allParams}} + * @param authInfo per call authentication override. + * @param resultHandler Asynchronous result handler + */ + public void {{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}, {{/allParams}}ApiClient.AuthInfo authInfo, Handler> resultHandler) { Object localVarBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}}; {{#allParams}}{{#required}} // verify the required parameter '{{paramName}}' is set @@ -58,7 +74,7 @@ public class {{classname}}Impl implements {{classname}} { } {{/required}}{{/allParams}} // create path and map variables - String localVarPath = "{{{path}}}"{{#pathParams}}.replaceAll("\\{" + "{{baseName}}" + "\\}", {{{paramName}}}.toString()){{/pathParams}}; + String localVarPath = "{{{path}}}"{{#pathParams}}.replaceAll("\\{" + "{{baseName}}" + "\\}", encodeParameter({{{paramName}}}.toString())){{/pathParams}}; // query params List localVarQueryParams = new ArrayList<>(); @@ -89,9 +105,17 @@ public class {{classname}}Impl implements {{classname}} { String[] localVarAuthNames = new String[] { {{#authMethods}}"{{name}}"{{#hasMore}}, {{/hasMore}}{{/authMethods}} }; {{#returnType}} TypeReference<{{{returnType}}}> localVarReturnType = new TypeReference<{{{returnType}}}>() {}; - apiClient.invokeAPI(localVarPath, "{{httpMethod}}", localVarQueryParams, localVarBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccepts, localVarContentTypes, localVarAuthNames, localVarReturnType, resultHandler);{{/returnType}}{{^returnType}} - apiClient.invokeAPI(localVarPath, "{{httpMethod}}", localVarQueryParams, localVarBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccepts, localVarContentTypes, localVarAuthNames, null, resultHandler);{{/returnType}} + apiClient.invokeAPI(localVarPath, "{{httpMethod}}", localVarQueryParams, localVarBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccepts, localVarContentTypes, localVarAuthNames, authInfo, localVarReturnType, resultHandler);{{/returnType}}{{^returnType}} + apiClient.invokeAPI(localVarPath, "{{httpMethod}}", localVarQueryParams, localVarBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccepts, localVarContentTypes, localVarAuthNames, authInfo, null, resultHandler);{{/returnType}} } {{/operation}} + + private String encodeParameter(String parameter) { + try { + return URLEncoder.encode(parameter, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + return parameter; + } + } } {{/operations}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/vertx/api_test.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/vertx/api_test.mustache index 77010f248c1e..5eb2ec7276a6 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/vertx/api_test.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/vertx/api_test.mustache @@ -56,8 +56,8 @@ public class {{classname}}Test { * @param context Vertx test context for doing assertions */ @Test - public void {{operationId}}Test(TestContext context) { - Async async = context.async(); + public void {{operationId}}Test(TestContext testContext) { + Async async = testContext.async(); {{#allParams}} {{{dataType}}} {{paramName}} = null; {{/allParams}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/vertx/rxApiImpl.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/vertx/rxApiImpl.mustache index be144ff3eaaa..abb6e8458d46 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/vertx/rxApiImpl.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/vertx/rxApiImpl.mustache @@ -2,6 +2,7 @@ package {{package}}.rxjava; {{#imports}}import {{import}}; {{/imports}} +import {{invokerPackage}}.ApiClient; import java.util.*; @@ -13,41 +14,69 @@ import io.vertx.core.Handler; {{#operations}} public class {{classname}} { - private final {{package}}.{{classname}} delegate; + private final {{package}}.{{classname}} delegate; - public {{classname}}({{package}}.{{classname}} delegate) { - this.delegate = delegate; + public {{classname}}({{package}}.{{classname}} delegate) { + this.delegate = delegate; } - public {{package}}.{{classname}} getDelegate() { - return delegate; - } + public {{package}}.{{classname}} getDelegate() { + return delegate; + } {{#operation}} /** - * {{summary}} - * {{notes}} - {{#allParams}} - * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} - {{/allParams}} - * @param resultHandler Asynchronous result handler - */ + * {{summary}} + * {{notes}} + {{#allParams}} + * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} + {{/allParams}} + * @param resultHandler Asynchronous result handler + */ public void {{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}, {{/allParams}}Handler> resultHandler) { delegate.{{operationId}}({{#allParams}}{{paramName}}, {{/allParams}}resultHandler); } /** - * {{summary}} - * {{notes}} - {{#allParams}} - * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} - {{/allParams}} - * @return Asynchronous result handler (RxJava Single) - */ + * {{summary}} + * {{notes}} + {{#allParams}} + * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} + {{/allParams}} + * @param authInfo call specific auth overrides + * @param resultHandler Asynchronous result handler + */ + public void {{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}, {{/allParams}}ApiClient.AuthInfo authInfo, Handler> resultHandler) { + delegate.{{operationId}}({{#allParams}}{{paramName}}, {{/allParams}}authInfo, resultHandler); + } + + /** + * {{summary}} + * {{notes}} + {{#allParams}} + * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} + {{/allParams}} + * @return Asynchronous result handler (RxJava Single) + */ public Single<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> rx{{operationIdCamelCase}}({{#allParams}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) { - return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> { - delegate.{{operationId}}({{#allParams}}{{paramName}}, {{/allParams}}fut); - })); + return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> + delegate.{{operationId}}({{#allParams}}{{paramName}}, {{/allParams}}fut) + )); + } + + /** + * {{summary}} + * {{notes}} + {{#allParams}} + * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} + {{/allParams}} + * @param authInfo call specific auth overrides + * @return Asynchronous result handler (RxJava Single) + */ + public Single<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> rx{{operationIdCamelCase}}({{#allParams}}{{{dataType}}} {{paramName}}, {{/allParams}}ApiClient.AuthInfo authInfo) { + return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> + delegate.{{operationId}}({{#allParams}}{{paramName}}, {{/allParams}}authInfo, fut) + )); } {{/operation}} diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/ApiClient.java index d02e49265593..9f059c98c96a 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/ApiClient.java @@ -7,6 +7,7 @@ import org.openapitools.client.auth.OAuth; import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.ObjectMapper; @@ -53,6 +54,7 @@ public class ApiClient { private DateFormat dateFormat; private ObjectMapper objectMapper; private String downloadsDir = ""; + private int timeout = -1; public ApiClient(Vertx vertx, JsonObject config) { Objects.requireNonNull(vertx, "Vertx must not be null"); @@ -94,6 +96,7 @@ public ApiClient(Vertx vertx, JsonObject config) { this.downloadsDir = config.getString("downloadsDir", this.downloadsDir); this.config = config; this.identifier = UUID.randomUUID().toString(); + this.timeout = config.getInteger("timeout", -1); } public Vertx getVertx() { @@ -424,7 +427,11 @@ public void sendBody(HttpRequest request, AsyncFile file = (AsyncFile) body; request.sendStream(file, responseHandler); } else { - request.sendJson(body, responseHandler); + try { + request.sendBuffer(Buffer.buffer(this.objectMapper.writeValueAsBytes(body)), responseHandler); + } catch (JsonProcessingException jsonProcessingException) { + responseHandler.handle(Future.failedFuture(jsonProcessingException)); + } } } @@ -442,14 +449,15 @@ public void sendBody(HttpRequest request, * @param accepts The request's Accept headers * @param contentTypes The request's Content-Type headers * @param authNames The authentications to apply + * @param authInfo The call specific auth override * @param returnType The return type into which to deserialize the response * @param resultHandler The asynchronous response handler */ public void invokeAPI(String path, String method, List queryParams, Object body, MultiMap headerParams, - MultiMap cookieParams, Map formParams, String[] accepts, String[] contentTypes, String[] authNames, + MultiMap cookieParams, Map formParams, String[] accepts, String[] contentTypes, String[] authNames, AuthInfo authInfo, TypeReference returnType, Handler> resultHandler) { - updateParamsForAuth(authNames, queryParams, headerParams, cookieParams); + updateParamsForAuth(authNames, authInfo, queryParams, headerParams, cookieParams); if (accepts != null && accepts.length > 0) { headerParams.add(HttpHeaders.ACCEPT, selectHeaderAccept(accepts)); @@ -461,6 +469,7 @@ public void invokeAPI(String path, String method, List queryParams, Ob HttpMethod httpMethod = HttpMethod.valueOf(method); HttpRequest request = getWebClient().requestAbs(httpMethod, basePath + path); + request.timeout(this.timeout); if (httpMethod == HttpMethod.PATCH) { request.putHeader("X-HTTP-Method-Override", "PATCH"); @@ -641,11 +650,72 @@ protected WebClient buildWebClient(Vertx vertx, JsonObject config) { * * @param authNames The authentications to apply */ - protected void updateParamsForAuth(String[] authNames, List queryParams, MultiMap headerParams, MultiMap cookieParams) { + protected void updateParamsForAuth(String[] authNames, AuthInfo authInfo, List queryParams, MultiMap headerParams, MultiMap cookieParams) { for (String authName : authNames) { - Authentication auth = authentications.get(authName); + Authentication auth; + if (authInfo != null && authInfo.authentications.containsKey(authName)) { + auth = authInfo.authentications.get(authName); + } else { + auth = authentications.get(authName); + } if (auth == null) throw new RuntimeException("Authentication undefined: " + authName); auth.applyToParams(queryParams, headerParams, cookieParams); } } + + public static class AuthInfo { + + private final Map authentications = new LinkedHashMap<>(); + + public void addApi_keyAuthentication(String apikey, String apiKeyPrefix) { + ApiKeyAuth auth = new ApiKeyAuth("header","api_key"); + auth.setApiKey(apikey); + auth.setApiKeyPrefix(apiKeyPrefix); + authentications.put("api_key", auth); + } + + public void addApi_key_queryAuthentication(String apikey, String apiKeyPrefix) { + ApiKeyAuth auth = new ApiKeyAuth("query","api_key_query"); + auth.setApiKey(apikey); + auth.setApiKeyPrefix(apiKeyPrefix); + authentications.put("api_key_query", auth); + } + + public void addHttp_basic_testAuthentication(String username, String password) { + HttpBasicAuth auth = new HttpBasicAuth(); + auth.setUsername(username); + auth.setPassword(password); + authentications.put("http_basic_test", auth); + } + + public void addPetstore_authAuthentication(String accessToken) { + OAuth auth = new OAuth(); + auth.setAccessToken(accessToken); + authentications.put("petstore_auth", auth); + } + + public static AuthInfo forApi_keyAuthentication(String apikey, String apiKeyPrefix) { + AuthInfo authInfo = new AuthInfo(); + authInfo.addApi_keyAuthentication(apikey, apiKeyPrefix); + return authInfo; + } + + public static AuthInfo forApi_key_queryAuthentication(String apikey, String apiKeyPrefix) { + AuthInfo authInfo = new AuthInfo(); + authInfo.addApi_key_queryAuthentication(apikey, apiKeyPrefix); + return authInfo; + } + + public static AuthInfo forHttp_basic_test(String username, String password) { + AuthInfo authInfo = new AuthInfo(); + authInfo.addHttp_basic_testAuthentication(username, password); + return authInfo; + } + + public static AuthInfo forPetstore_authAuthentication(String accessToken) { + AuthInfo authInfo = new AuthInfo(); + authInfo.addPetstore_authAuthentication(accessToken); + return authInfo; + } + } } diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/AnotherFakeApi.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/AnotherFakeApi.java index 787cd307f1b5..d6abe6d93382 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/AnotherFakeApi.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/AnotherFakeApi.java @@ -1,5 +1,6 @@ package org.openapitools.client.api; +import org.openapitools.client.ApiClient; import org.openapitools.client.model.Client; import io.vertx.core.AsyncResult; import io.vertx.core.Handler; @@ -11,4 +12,6 @@ public interface AnotherFakeApi { void call123testSpecialTags(Client body, Handler> handler); + void call123testSpecialTags(Client body, ApiClient.AuthInfo authInfo, Handler> handler); + } diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/AnotherFakeApiImpl.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/AnotherFakeApiImpl.java index 0256fef27de5..362a4a5174fe 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/AnotherFakeApiImpl.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/AnotherFakeApiImpl.java @@ -10,6 +10,9 @@ import com.fasterxml.jackson.core.type.TypeReference; import java.util.*; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; @@ -38,12 +41,23 @@ public void setApiClient(ApiClient apiClient) { } /** - * To test special tags - * To test special tags and operation ID starting with number - * @param body client model (required) - * @param resultHandler Asynchronous result handler - */ + * To test special tags + * To test special tags and operation ID starting with number + * @param body client model (required) + * @param resultHandler Asynchronous result handler + */ public void call123testSpecialTags(Client body, Handler> resultHandler) { + call123testSpecialTags(body, null, resultHandler); + } + + /** + * To test special tags + * To test special tags and operation ID starting with number + * @param body client model (required) + * @param authInfo per call authentication override. + * @param resultHandler Asynchronous result handler + */ + public void call123testSpecialTags(Client body, ApiClient.AuthInfo authInfo, Handler> resultHandler) { Object localVarBody = body; // verify the required parameter 'body' is set @@ -72,6 +86,14 @@ public void call123testSpecialTags(Client body, Handler> res String[] localVarContentTypes = { "application/json" }; String[] localVarAuthNames = new String[] { }; TypeReference localVarReturnType = new TypeReference() {}; - apiClient.invokeAPI(localVarPath, "PATCH", localVarQueryParams, localVarBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccepts, localVarContentTypes, localVarAuthNames, localVarReturnType, resultHandler); + apiClient.invokeAPI(localVarPath, "PATCH", localVarQueryParams, localVarBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccepts, localVarContentTypes, localVarAuthNames, authInfo, localVarReturnType, resultHandler); + } + + private String encodeParameter(String parameter) { + try { + return URLEncoder.encode(parameter, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + return parameter; + } } } diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/FakeApi.java index ff2793b4245a..2a30781bdad8 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/FakeApi.java @@ -1,5 +1,6 @@ package org.openapitools.client.api; +import org.openapitools.client.ApiClient; import io.vertx.core.file.AsyncFile; import java.math.BigDecimal; import org.openapitools.client.model.Client; @@ -19,30 +20,58 @@ public interface FakeApi { void createXmlItem(XmlItem xmlItem, Handler> handler); + void createXmlItem(XmlItem xmlItem, ApiClient.AuthInfo authInfo, Handler> handler); + void fakeOuterBooleanSerialize(Boolean body, Handler> handler); + void fakeOuterBooleanSerialize(Boolean body, ApiClient.AuthInfo authInfo, Handler> handler); + void fakeOuterCompositeSerialize(OuterComposite body, Handler> handler); + void fakeOuterCompositeSerialize(OuterComposite body, ApiClient.AuthInfo authInfo, Handler> handler); + void fakeOuterNumberSerialize(BigDecimal body, Handler> handler); + void fakeOuterNumberSerialize(BigDecimal body, ApiClient.AuthInfo authInfo, Handler> handler); + void fakeOuterStringSerialize(String body, Handler> handler); + void fakeOuterStringSerialize(String body, ApiClient.AuthInfo authInfo, Handler> handler); + void testBodyWithFileSchema(FileSchemaTestClass body, Handler> handler); + void testBodyWithFileSchema(FileSchemaTestClass body, ApiClient.AuthInfo authInfo, Handler> handler); + void testBodyWithQueryParams(String query, User body, Handler> handler); + void testBodyWithQueryParams(String query, User body, ApiClient.AuthInfo authInfo, Handler> handler); + void testClientModel(Client body, Handler> handler); + void testClientModel(Client body, ApiClient.AuthInfo authInfo, Handler> handler); + void testEndpointParameters(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, AsyncFile binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback, Handler> handler); + void testEndpointParameters(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, AsyncFile binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback, ApiClient.AuthInfo authInfo, Handler> handler); + void testEnumParameters(List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List enumFormStringArray, String enumFormString, Handler> handler); + void testEnumParameters(List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List enumFormStringArray, String enumFormString, ApiClient.AuthInfo authInfo, Handler> handler); + void testGroupParameters(Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group, Handler> handler); + void testGroupParameters(Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group, ApiClient.AuthInfo authInfo, Handler> handler); + void testInlineAdditionalProperties(Map param, Handler> handler); + void testInlineAdditionalProperties(Map param, ApiClient.AuthInfo authInfo, Handler> handler); + void testJsonFormData(String param, String param2, Handler> handler); + void testJsonFormData(String param, String param2, ApiClient.AuthInfo authInfo, Handler> handler); + void testQueryParameterCollectionFormat(List pipe, List ioutil, List http, List url, List context, Handler> handler); + void testQueryParameterCollectionFormat(List pipe, List ioutil, List http, List url, List context, ApiClient.AuthInfo authInfo, Handler> handler); + } diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/FakeApiImpl.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/FakeApiImpl.java index fc14c5491002..6627a5efb3c8 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/FakeApiImpl.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/FakeApiImpl.java @@ -18,6 +18,9 @@ import com.fasterxml.jackson.core.type.TypeReference; import java.util.*; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; @@ -46,12 +49,23 @@ public void setApiClient(ApiClient apiClient) { } /** - * creates an XmlItem - * this route creates an XmlItem - * @param xmlItem XmlItem Body (required) - * @param resultHandler Asynchronous result handler - */ + * creates an XmlItem + * this route creates an XmlItem + * @param xmlItem XmlItem Body (required) + * @param resultHandler Asynchronous result handler + */ public void createXmlItem(XmlItem xmlItem, Handler> resultHandler) { + createXmlItem(xmlItem, null, resultHandler); + } + + /** + * creates an XmlItem + * this route creates an XmlItem + * @param xmlItem XmlItem Body (required) + * @param authInfo per call authentication override. + * @param resultHandler Asynchronous result handler + */ + public void createXmlItem(XmlItem xmlItem, ApiClient.AuthInfo authInfo, Handler> resultHandler) { Object localVarBody = xmlItem; // verify the required parameter 'xmlItem' is set @@ -80,15 +94,26 @@ public void createXmlItem(XmlItem xmlItem, Handler> resultHand String[] localVarContentTypes = { "application/xml", "application/xml; charset=utf-8", "application/xml; charset=utf-16", "text/xml", "text/xml; charset=utf-8", "text/xml; charset=utf-16" }; String[] localVarAuthNames = new String[] { }; - apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccepts, localVarContentTypes, localVarAuthNames, null, resultHandler); + apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccepts, localVarContentTypes, localVarAuthNames, authInfo, null, resultHandler); } /** - * - * Test serialization of outer boolean types - * @param body Input boolean as post body (optional) - * @param resultHandler Asynchronous result handler - */ + * + * Test serialization of outer boolean types + * @param body Input boolean as post body (optional) + * @param resultHandler Asynchronous result handler + */ public void fakeOuterBooleanSerialize(Boolean body, Handler> resultHandler) { + fakeOuterBooleanSerialize(body, null, resultHandler); + } + + /** + * + * Test serialization of outer boolean types + * @param body Input boolean as post body (optional) + * @param authInfo per call authentication override. + * @param resultHandler Asynchronous result handler + */ + public void fakeOuterBooleanSerialize(Boolean body, ApiClient.AuthInfo authInfo, Handler> resultHandler) { Object localVarBody = body; // create path and map variables @@ -111,15 +136,26 @@ public void fakeOuterBooleanSerialize(Boolean body, Handler String[] localVarContentTypes = { }; String[] localVarAuthNames = new String[] { }; TypeReference localVarReturnType = new TypeReference() {}; - apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccepts, localVarContentTypes, localVarAuthNames, localVarReturnType, resultHandler); + apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccepts, localVarContentTypes, localVarAuthNames, authInfo, localVarReturnType, resultHandler); } /** - * - * Test serialization of object with outer number type - * @param body Input composite as post body (optional) - * @param resultHandler Asynchronous result handler - */ + * + * Test serialization of object with outer number type + * @param body Input composite as post body (optional) + * @param resultHandler Asynchronous result handler + */ public void fakeOuterCompositeSerialize(OuterComposite body, Handler> resultHandler) { + fakeOuterCompositeSerialize(body, null, resultHandler); + } + + /** + * + * Test serialization of object with outer number type + * @param body Input composite as post body (optional) + * @param authInfo per call authentication override. + * @param resultHandler Asynchronous result handler + */ + public void fakeOuterCompositeSerialize(OuterComposite body, ApiClient.AuthInfo authInfo, Handler> resultHandler) { Object localVarBody = body; // create path and map variables @@ -142,15 +178,26 @@ public void fakeOuterCompositeSerialize(OuterComposite body, Handler localVarReturnType = new TypeReference() {}; - apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccepts, localVarContentTypes, localVarAuthNames, localVarReturnType, resultHandler); + apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccepts, localVarContentTypes, localVarAuthNames, authInfo, localVarReturnType, resultHandler); } /** - * - * Test serialization of outer number types - * @param body Input number as post body (optional) - * @param resultHandler Asynchronous result handler - */ + * + * Test serialization of outer number types + * @param body Input number as post body (optional) + * @param resultHandler Asynchronous result handler + */ public void fakeOuterNumberSerialize(BigDecimal body, Handler> resultHandler) { + fakeOuterNumberSerialize(body, null, resultHandler); + } + + /** + * + * Test serialization of outer number types + * @param body Input number as post body (optional) + * @param authInfo per call authentication override. + * @param resultHandler Asynchronous result handler + */ + public void fakeOuterNumberSerialize(BigDecimal body, ApiClient.AuthInfo authInfo, Handler> resultHandler) { Object localVarBody = body; // create path and map variables @@ -173,15 +220,26 @@ public void fakeOuterNumberSerialize(BigDecimal body, Handler localVarReturnType = new TypeReference() {}; - apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccepts, localVarContentTypes, localVarAuthNames, localVarReturnType, resultHandler); + apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccepts, localVarContentTypes, localVarAuthNames, authInfo, localVarReturnType, resultHandler); } /** - * - * Test serialization of outer string types - * @param body Input string as post body (optional) - * @param resultHandler Asynchronous result handler - */ + * + * Test serialization of outer string types + * @param body Input string as post body (optional) + * @param resultHandler Asynchronous result handler + */ public void fakeOuterStringSerialize(String body, Handler> resultHandler) { + fakeOuterStringSerialize(body, null, resultHandler); + } + + /** + * + * Test serialization of outer string types + * @param body Input string as post body (optional) + * @param authInfo per call authentication override. + * @param resultHandler Asynchronous result handler + */ + public void fakeOuterStringSerialize(String body, ApiClient.AuthInfo authInfo, Handler> resultHandler) { Object localVarBody = body; // create path and map variables @@ -204,15 +262,26 @@ public void fakeOuterStringSerialize(String body, Handler> r String[] localVarContentTypes = { }; String[] localVarAuthNames = new String[] { }; TypeReference localVarReturnType = new TypeReference() {}; - apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccepts, localVarContentTypes, localVarAuthNames, localVarReturnType, resultHandler); + apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccepts, localVarContentTypes, localVarAuthNames, authInfo, localVarReturnType, resultHandler); } /** - * - * For this test, the body for this request much reference a schema named `File`. - * @param body (required) - * @param resultHandler Asynchronous result handler - */ + * + * For this test, the body for this request much reference a schema named `File`. + * @param body (required) + * @param resultHandler Asynchronous result handler + */ public void testBodyWithFileSchema(FileSchemaTestClass body, Handler> resultHandler) { + testBodyWithFileSchema(body, null, resultHandler); + } + + /** + * + * For this test, the body for this request much reference a schema named `File`. + * @param body (required) + * @param authInfo per call authentication override. + * @param resultHandler Asynchronous result handler + */ + public void testBodyWithFileSchema(FileSchemaTestClass body, ApiClient.AuthInfo authInfo, Handler> resultHandler) { Object localVarBody = body; // verify the required parameter 'body' is set @@ -241,16 +310,28 @@ public void testBodyWithFileSchema(FileSchemaTestClass body, Handler> resultHandler) { + testBodyWithQueryParams(query, body, null, resultHandler); + } + + /** + * + * + * @param query (required) + * @param body (required) + * @param authInfo per call authentication override. + * @param resultHandler Asynchronous result handler + */ + public void testBodyWithQueryParams(String query, User body, ApiClient.AuthInfo authInfo, Handler> resultHandler) { Object localVarBody = body; // verify the required parameter 'query' is set @@ -286,15 +367,26 @@ public void testBodyWithQueryParams(String query, User body, Handler> resultHandler) { + testClientModel(body, null, resultHandler); + } + + /** + * To test \"client\" model + * To test \"client\" model + * @param body client model (required) + * @param authInfo per call authentication override. + * @param resultHandler Asynchronous result handler + */ + public void testClientModel(Client body, ApiClient.AuthInfo authInfo, Handler> resultHandler) { Object localVarBody = body; // verify the required parameter 'body' is set @@ -323,28 +415,52 @@ public void testClientModel(Client body, Handler> resultHand String[] localVarContentTypes = { "application/json" }; String[] localVarAuthNames = new String[] { }; TypeReference localVarReturnType = new TypeReference() {}; - apiClient.invokeAPI(localVarPath, "PATCH", localVarQueryParams, localVarBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccepts, localVarContentTypes, localVarAuthNames, localVarReturnType, resultHandler); + apiClient.invokeAPI(localVarPath, "PATCH", localVarQueryParams, localVarBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccepts, localVarContentTypes, localVarAuthNames, authInfo, localVarReturnType, resultHandler); } /** - * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * @param number None (required) - * @param _double None (required) - * @param patternWithoutDelimiter None (required) - * @param _byte None (required) - * @param integer None (optional) - * @param int32 None (optional) - * @param int64 None (optional) - * @param _float None (optional) - * @param string None (optional) - * @param binary None (optional) - * @param date None (optional) - * @param dateTime None (optional) - * @param password None (optional) - * @param paramCallback None (optional) - * @param resultHandler Asynchronous result handler - */ + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * @param number None (required) + * @param _double None (required) + * @param patternWithoutDelimiter None (required) + * @param _byte None (required) + * @param integer None (optional) + * @param int32 None (optional) + * @param int64 None (optional) + * @param _float None (optional) + * @param string None (optional) + * @param binary None (optional) + * @param date None (optional) + * @param dateTime None (optional) + * @param password None (optional) + * @param paramCallback None (optional) + * @param resultHandler Asynchronous result handler + */ public void testEndpointParameters(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, AsyncFile binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback, Handler> resultHandler) { + testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback, null, resultHandler); + } + + /** + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * @param number None (required) + * @param _double None (required) + * @param patternWithoutDelimiter None (required) + * @param _byte None (required) + * @param integer None (optional) + * @param int32 None (optional) + * @param int64 None (optional) + * @param _float None (optional) + * @param string None (optional) + * @param binary None (optional) + * @param date None (optional) + * @param dateTime None (optional) + * @param password None (optional) + * @param paramCallback None (optional) + * @param authInfo per call authentication override. + * @param resultHandler Asynchronous result handler + */ + public void testEndpointParameters(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, AsyncFile binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback, ApiClient.AuthInfo authInfo, Handler> resultHandler) { Object localVarBody = null; // verify the required parameter 'number' is set @@ -405,22 +521,40 @@ public void testEndpointParameters(BigDecimal number, Double _double, String pat String[] localVarContentTypes = { "application/x-www-form-urlencoded" }; String[] localVarAuthNames = new String[] { "http_basic_test" }; - apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccepts, localVarContentTypes, localVarAuthNames, null, resultHandler); + apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccepts, localVarContentTypes, localVarAuthNames, authInfo, null, resultHandler); } /** - * To test enum parameters - * To test enum parameters - * @param enumHeaderStringArray Header parameter enum test (string array) (optional, default to new ArrayList<>()) - * @param enumHeaderString Header parameter enum test (string) (optional, default to -efg) - * @param enumQueryStringArray Query parameter enum test (string array) (optional, default to new ArrayList<>()) - * @param enumQueryString Query parameter enum test (string) (optional, default to -efg) - * @param enumQueryInteger Query parameter enum test (double) (optional) - * @param enumQueryDouble Query parameter enum test (double) (optional) - * @param enumFormStringArray Form parameter enum test (string array) (optional, default to $) - * @param enumFormString Form parameter enum test (string) (optional, default to -efg) - * @param resultHandler Asynchronous result handler - */ + * To test enum parameters + * To test enum parameters + * @param enumHeaderStringArray Header parameter enum test (string array) (optional, default to new ArrayList<>()) + * @param enumHeaderString Header parameter enum test (string) (optional, default to -efg) + * @param enumQueryStringArray Query parameter enum test (string array) (optional, default to new ArrayList<>()) + * @param enumQueryString Query parameter enum test (string) (optional, default to -efg) + * @param enumQueryInteger Query parameter enum test (double) (optional) + * @param enumQueryDouble Query parameter enum test (double) (optional) + * @param enumFormStringArray Form parameter enum test (string array) (optional, default to $) + * @param enumFormString Form parameter enum test (string) (optional, default to -efg) + * @param resultHandler Asynchronous result handler + */ public void testEnumParameters(List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List enumFormStringArray, String enumFormString, Handler> resultHandler) { + testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString, null, resultHandler); + } + + /** + * To test enum parameters + * To test enum parameters + * @param enumHeaderStringArray Header parameter enum test (string array) (optional, default to new ArrayList<>()) + * @param enumHeaderString Header parameter enum test (string) (optional, default to -efg) + * @param enumQueryStringArray Query parameter enum test (string array) (optional, default to new ArrayList<>()) + * @param enumQueryString Query parameter enum test (string) (optional, default to -efg) + * @param enumQueryInteger Query parameter enum test (double) (optional) + * @param enumQueryDouble Query parameter enum test (double) (optional) + * @param enumFormStringArray Form parameter enum test (string array) (optional, default to $) + * @param enumFormString Form parameter enum test (string) (optional, default to -efg) + * @param authInfo per call authentication override. + * @param resultHandler Asynchronous result handler + */ + public void testEnumParameters(List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List enumFormStringArray, String enumFormString, ApiClient.AuthInfo authInfo, Handler> resultHandler) { Object localVarBody = null; // create path and map variables @@ -453,20 +587,36 @@ public void testEnumParameters(List enumHeaderStringArray, String enumHe String[] localVarContentTypes = { "application/x-www-form-urlencoded" }; String[] localVarAuthNames = new String[] { }; - apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccepts, localVarContentTypes, localVarAuthNames, null, resultHandler); + apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccepts, localVarContentTypes, localVarAuthNames, authInfo, null, resultHandler); } /** - * Fake endpoint to test group parameters (optional) - * Fake endpoint to test group parameters (optional) - * @param requiredStringGroup Required String in group parameters (required) - * @param requiredBooleanGroup Required Boolean in group parameters (required) - * @param requiredInt64Group Required Integer in group parameters (required) - * @param stringGroup String in group parameters (optional) - * @param booleanGroup Boolean in group parameters (optional) - * @param int64Group Integer in group parameters (optional) - * @param resultHandler Asynchronous result handler - */ + * Fake endpoint to test group parameters (optional) + * Fake endpoint to test group parameters (optional) + * @param requiredStringGroup Required String in group parameters (required) + * @param requiredBooleanGroup Required Boolean in group parameters (required) + * @param requiredInt64Group Required Integer in group parameters (required) + * @param stringGroup String in group parameters (optional) + * @param booleanGroup Boolean in group parameters (optional) + * @param int64Group Integer in group parameters (optional) + * @param resultHandler Asynchronous result handler + */ public void testGroupParameters(Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group, Handler> resultHandler) { + testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group, null, resultHandler); + } + + /** + * Fake endpoint to test group parameters (optional) + * Fake endpoint to test group parameters (optional) + * @param requiredStringGroup Required String in group parameters (required) + * @param requiredBooleanGroup Required Boolean in group parameters (required) + * @param requiredInt64Group Required Integer in group parameters (required) + * @param stringGroup String in group parameters (optional) + * @param booleanGroup Boolean in group parameters (optional) + * @param int64Group Integer in group parameters (optional) + * @param authInfo per call authentication override. + * @param resultHandler Asynchronous result handler + */ + public void testGroupParameters(Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group, ApiClient.AuthInfo authInfo, Handler> resultHandler) { Object localVarBody = null; // verify the required parameter 'requiredStringGroup' is set @@ -515,15 +665,26 @@ public void testGroupParameters(Integer requiredStringGroup, Boolean requiredBoo String[] localVarContentTypes = { }; String[] localVarAuthNames = new String[] { }; - apiClient.invokeAPI(localVarPath, "DELETE", localVarQueryParams, localVarBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccepts, localVarContentTypes, localVarAuthNames, null, resultHandler); + apiClient.invokeAPI(localVarPath, "DELETE", localVarQueryParams, localVarBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccepts, localVarContentTypes, localVarAuthNames, authInfo, null, resultHandler); } /** - * test inline additionalProperties - * - * @param param request body (required) - * @param resultHandler Asynchronous result handler - */ + * test inline additionalProperties + * + * @param param request body (required) + * @param resultHandler Asynchronous result handler + */ public void testInlineAdditionalProperties(Map param, Handler> resultHandler) { + testInlineAdditionalProperties(param, null, resultHandler); + } + + /** + * test inline additionalProperties + * + * @param param request body (required) + * @param authInfo per call authentication override. + * @param resultHandler Asynchronous result handler + */ + public void testInlineAdditionalProperties(Map param, ApiClient.AuthInfo authInfo, Handler> resultHandler) { Object localVarBody = param; // verify the required parameter 'param' is set @@ -552,16 +713,28 @@ public void testInlineAdditionalProperties(Map param, Handler> resultHandler) { + testJsonFormData(param, param2, null, resultHandler); + } + + /** + * test json serialization of form data + * + * @param param field1 (required) + * @param param2 field2 (required) + * @param authInfo per call authentication override. + * @param resultHandler Asynchronous result handler + */ + public void testJsonFormData(String param, String param2, ApiClient.AuthInfo authInfo, Handler> resultHandler) { Object localVarBody = null; // verify the required parameter 'param' is set @@ -598,19 +771,34 @@ public void testJsonFormData(String param, String param2, Handler pipe, List ioutil, List http, List url, List context, Handler> resultHandler) { + testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, null, resultHandler); + } + + /** + * + * To test the collection format in query parameters + * @param pipe (required) + * @param ioutil (required) + * @param http (required) + * @param url (required) + * @param context (required) + * @param authInfo per call authentication override. + * @param resultHandler Asynchronous result handler + */ + public void testQueryParameterCollectionFormat(List pipe, List ioutil, List http, List url, List context, ApiClient.AuthInfo authInfo, Handler> resultHandler) { Object localVarBody = null; // verify the required parameter 'pipe' is set @@ -668,6 +856,14 @@ public void testQueryParameterCollectionFormat(List pipe, List i String[] localVarContentTypes = { }; String[] localVarAuthNames = new String[] { }; - apiClient.invokeAPI(localVarPath, "PUT", localVarQueryParams, localVarBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccepts, localVarContentTypes, localVarAuthNames, null, resultHandler); + apiClient.invokeAPI(localVarPath, "PUT", localVarQueryParams, localVarBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccepts, localVarContentTypes, localVarAuthNames, authInfo, null, resultHandler); + } + + private String encodeParameter(String parameter) { + try { + return URLEncoder.encode(parameter, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + return parameter; + } } } diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java index ab26b6fa2d62..abae7a76d133 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java @@ -1,5 +1,6 @@ package org.openapitools.client.api; +import org.openapitools.client.ApiClient; import org.openapitools.client.model.Client; import io.vertx.core.AsyncResult; import io.vertx.core.Handler; @@ -11,4 +12,6 @@ public interface FakeClassnameTags123Api { void testClassname(Client body, Handler> handler); + void testClassname(Client body, ApiClient.AuthInfo authInfo, Handler> handler); + } diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/FakeClassnameTags123ApiImpl.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/FakeClassnameTags123ApiImpl.java index bc1707415818..cb6d45057866 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/FakeClassnameTags123ApiImpl.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/FakeClassnameTags123ApiImpl.java @@ -10,6 +10,9 @@ import com.fasterxml.jackson.core.type.TypeReference; import java.util.*; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; @@ -38,12 +41,23 @@ public void setApiClient(ApiClient apiClient) { } /** - * To test class name in snake case - * To test class name in snake case - * @param body client model (required) - * @param resultHandler Asynchronous result handler - */ + * To test class name in snake case + * To test class name in snake case + * @param body client model (required) + * @param resultHandler Asynchronous result handler + */ public void testClassname(Client body, Handler> resultHandler) { + testClassname(body, null, resultHandler); + } + + /** + * To test class name in snake case + * To test class name in snake case + * @param body client model (required) + * @param authInfo per call authentication override. + * @param resultHandler Asynchronous result handler + */ + public void testClassname(Client body, ApiClient.AuthInfo authInfo, Handler> resultHandler) { Object localVarBody = body; // verify the required parameter 'body' is set @@ -72,6 +86,14 @@ public void testClassname(Client body, Handler> resultHandle String[] localVarContentTypes = { "application/json" }; String[] localVarAuthNames = new String[] { "api_key_query" }; TypeReference localVarReturnType = new TypeReference() {}; - apiClient.invokeAPI(localVarPath, "PATCH", localVarQueryParams, localVarBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccepts, localVarContentTypes, localVarAuthNames, localVarReturnType, resultHandler); + apiClient.invokeAPI(localVarPath, "PATCH", localVarQueryParams, localVarBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccepts, localVarContentTypes, localVarAuthNames, authInfo, localVarReturnType, resultHandler); + } + + private String encodeParameter(String parameter) { + try { + return URLEncoder.encode(parameter, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + return parameter; + } } } diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/PetApi.java index e7fed648a489..ef76f70591a6 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/PetApi.java @@ -1,5 +1,6 @@ package org.openapitools.client.api; +import org.openapitools.client.ApiClient; import io.vertx.core.file.AsyncFile; import org.openapitools.client.model.ModelApiResponse; import org.openapitools.client.model.Pet; @@ -14,20 +15,38 @@ public interface PetApi { void addPet(Pet body, Handler> handler); + void addPet(Pet body, ApiClient.AuthInfo authInfo, Handler> handler); + void deletePet(Long petId, String apiKey, Handler> handler); + void deletePet(Long petId, String apiKey, ApiClient.AuthInfo authInfo, Handler> handler); + void findPetsByStatus(List status, Handler>> handler); + void findPetsByStatus(List status, ApiClient.AuthInfo authInfo, Handler>> handler); + void findPetsByTags(Set tags, Handler>> handler); + void findPetsByTags(Set tags, ApiClient.AuthInfo authInfo, Handler>> handler); + void getPetById(Long petId, Handler> handler); + void getPetById(Long petId, ApiClient.AuthInfo authInfo, Handler> handler); + void updatePet(Pet body, Handler> handler); + void updatePet(Pet body, ApiClient.AuthInfo authInfo, Handler> handler); + void updatePetWithForm(Long petId, String name, String status, Handler> handler); + void updatePetWithForm(Long petId, String name, String status, ApiClient.AuthInfo authInfo, Handler> handler); + void uploadFile(Long petId, String additionalMetadata, AsyncFile file, Handler> handler); + void uploadFile(Long petId, String additionalMetadata, AsyncFile file, ApiClient.AuthInfo authInfo, Handler> handler); + void uploadFileWithRequiredFile(Long petId, AsyncFile requiredFile, String additionalMetadata, Handler> handler); + void uploadFileWithRequiredFile(Long petId, AsyncFile requiredFile, String additionalMetadata, ApiClient.AuthInfo authInfo, Handler> handler); + } diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/PetApiImpl.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/PetApiImpl.java index fd1575fe9bc8..b9c8a9034c42 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/PetApiImpl.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/PetApiImpl.java @@ -13,6 +13,9 @@ import com.fasterxml.jackson.core.type.TypeReference; import java.util.*; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; @@ -41,12 +44,23 @@ public void setApiClient(ApiClient apiClient) { } /** - * Add a new pet to the store - * - * @param body Pet object that needs to be added to the store (required) - * @param resultHandler Asynchronous result handler - */ + * Add a new pet to the store + * + * @param body Pet object that needs to be added to the store (required) + * @param resultHandler Asynchronous result handler + */ public void addPet(Pet body, Handler> resultHandler) { + addPet(body, null, resultHandler); + } + + /** + * Add a new pet to the store + * + * @param body Pet object that needs to be added to the store (required) + * @param authInfo per call authentication override. + * @param resultHandler Asynchronous result handler + */ + public void addPet(Pet body, ApiClient.AuthInfo authInfo, Handler> resultHandler) { Object localVarBody = body; // verify the required parameter 'body' is set @@ -75,16 +89,28 @@ public void addPet(Pet body, Handler> resultHandler) { String[] localVarContentTypes = { "application/json", "application/xml" }; String[] localVarAuthNames = new String[] { "petstore_auth" }; - apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccepts, localVarContentTypes, localVarAuthNames, null, resultHandler); + apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccepts, localVarContentTypes, localVarAuthNames, authInfo, null, resultHandler); } /** - * Deletes a pet - * - * @param petId Pet id to delete (required) - * @param apiKey (optional) - * @param resultHandler Asynchronous result handler - */ + * Deletes a pet + * + * @param petId Pet id to delete (required) + * @param apiKey (optional) + * @param resultHandler Asynchronous result handler + */ public void deletePet(Long petId, String apiKey, Handler> resultHandler) { + deletePet(petId, apiKey, null, resultHandler); + } + + /** + * Deletes a pet + * + * @param petId Pet id to delete (required) + * @param apiKey (optional) + * @param authInfo per call authentication override. + * @param resultHandler Asynchronous result handler + */ + public void deletePet(Long petId, String apiKey, ApiClient.AuthInfo authInfo, Handler> resultHandler) { Object localVarBody = null; // verify the required parameter 'petId' is set @@ -94,7 +120,7 @@ public void deletePet(Long petId, String apiKey, Handler> resu } // create path and map variables - String localVarPath = "/pet/{petId}".replaceAll("\\{" + "petId" + "\\}", petId.toString()); + String localVarPath = "/pet/{petId}".replaceAll("\\{" + "petId" + "\\}", encodeParameter(petId.toString())); // query params List localVarQueryParams = new ArrayList<>(); @@ -115,15 +141,26 @@ public void deletePet(Long petId, String apiKey, Handler> resu String[] localVarContentTypes = { }; String[] localVarAuthNames = new String[] { "petstore_auth" }; - apiClient.invokeAPI(localVarPath, "DELETE", localVarQueryParams, localVarBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccepts, localVarContentTypes, localVarAuthNames, null, resultHandler); + apiClient.invokeAPI(localVarPath, "DELETE", localVarQueryParams, localVarBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccepts, localVarContentTypes, localVarAuthNames, authInfo, null, resultHandler); } /** - * Finds Pets by status - * Multiple status values can be provided with comma separated strings - * @param status Status values that need to be considered for filter (required) - * @param resultHandler Asynchronous result handler - */ + * Finds Pets by status + * Multiple status values can be provided with comma separated strings + * @param status Status values that need to be considered for filter (required) + * @param resultHandler Asynchronous result handler + */ public void findPetsByStatus(List status, Handler>> resultHandler) { + findPetsByStatus(status, null, resultHandler); + } + + /** + * Finds Pets by status + * Multiple status values can be provided with comma separated strings + * @param status Status values that need to be considered for filter (required) + * @param authInfo per call authentication override. + * @param resultHandler Asynchronous result handler + */ + public void findPetsByStatus(List status, ApiClient.AuthInfo authInfo, Handler>> resultHandler) { Object localVarBody = null; // verify the required parameter 'status' is set @@ -153,15 +190,26 @@ public void findPetsByStatus(List status, Handler> String[] localVarContentTypes = { }; String[] localVarAuthNames = new String[] { "petstore_auth" }; TypeReference> localVarReturnType = new TypeReference>() {}; - apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccepts, localVarContentTypes, localVarAuthNames, localVarReturnType, resultHandler); + apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccepts, localVarContentTypes, localVarAuthNames, authInfo, localVarReturnType, resultHandler); } /** - * Finds Pets by tags - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * @param tags Tags to filter by (required) - * @param resultHandler Asynchronous result handler - */ + * Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * @param tags Tags to filter by (required) + * @param resultHandler Asynchronous result handler + */ public void findPetsByTags(Set tags, Handler>> resultHandler) { + findPetsByTags(tags, null, resultHandler); + } + + /** + * Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * @param tags Tags to filter by (required) + * @param authInfo per call authentication override. + * @param resultHandler Asynchronous result handler + */ + public void findPetsByTags(Set tags, ApiClient.AuthInfo authInfo, Handler>> resultHandler) { Object localVarBody = null; // verify the required parameter 'tags' is set @@ -191,15 +239,26 @@ public void findPetsByTags(Set tags, Handler>> resu String[] localVarContentTypes = { }; String[] localVarAuthNames = new String[] { "petstore_auth" }; TypeReference> localVarReturnType = new TypeReference>() {}; - apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccepts, localVarContentTypes, localVarAuthNames, localVarReturnType, resultHandler); + apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccepts, localVarContentTypes, localVarAuthNames, authInfo, localVarReturnType, resultHandler); } /** - * Find pet by ID - * Returns a single pet - * @param petId ID of pet to return (required) - * @param resultHandler Asynchronous result handler - */ + * Find pet by ID + * Returns a single pet + * @param petId ID of pet to return (required) + * @param resultHandler Asynchronous result handler + */ public void getPetById(Long petId, Handler> resultHandler) { + getPetById(petId, null, resultHandler); + } + + /** + * Find pet by ID + * Returns a single pet + * @param petId ID of pet to return (required) + * @param authInfo per call authentication override. + * @param resultHandler Asynchronous result handler + */ + public void getPetById(Long petId, ApiClient.AuthInfo authInfo, Handler> resultHandler) { Object localVarBody = null; // verify the required parameter 'petId' is set @@ -209,7 +268,7 @@ public void getPetById(Long petId, Handler> resultHandler) { } // create path and map variables - String localVarPath = "/pet/{petId}".replaceAll("\\{" + "petId" + "\\}", petId.toString()); + String localVarPath = "/pet/{petId}".replaceAll("\\{" + "petId" + "\\}", encodeParameter(petId.toString())); // query params List localVarQueryParams = new ArrayList<>(); @@ -228,15 +287,26 @@ public void getPetById(Long petId, Handler> resultHandler) { String[] localVarContentTypes = { }; String[] localVarAuthNames = new String[] { "api_key" }; TypeReference localVarReturnType = new TypeReference() {}; - apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccepts, localVarContentTypes, localVarAuthNames, localVarReturnType, resultHandler); + apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccepts, localVarContentTypes, localVarAuthNames, authInfo, localVarReturnType, resultHandler); } /** - * Update an existing pet - * - * @param body Pet object that needs to be added to the store (required) - * @param resultHandler Asynchronous result handler - */ + * Update an existing pet + * + * @param body Pet object that needs to be added to the store (required) + * @param resultHandler Asynchronous result handler + */ public void updatePet(Pet body, Handler> resultHandler) { + updatePet(body, null, resultHandler); + } + + /** + * Update an existing pet + * + * @param body Pet object that needs to be added to the store (required) + * @param authInfo per call authentication override. + * @param resultHandler Asynchronous result handler + */ + public void updatePet(Pet body, ApiClient.AuthInfo authInfo, Handler> resultHandler) { Object localVarBody = body; // verify the required parameter 'body' is set @@ -265,17 +335,30 @@ public void updatePet(Pet body, Handler> resultHandler) { String[] localVarContentTypes = { "application/json", "application/xml" }; String[] localVarAuthNames = new String[] { "petstore_auth" }; - apiClient.invokeAPI(localVarPath, "PUT", localVarQueryParams, localVarBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccepts, localVarContentTypes, localVarAuthNames, null, resultHandler); + apiClient.invokeAPI(localVarPath, "PUT", localVarQueryParams, localVarBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccepts, localVarContentTypes, localVarAuthNames, authInfo, null, resultHandler); } /** - * Updates a pet in the store with form data - * - * @param petId ID of pet that needs to be updated (required) - * @param name Updated name of the pet (optional) - * @param status Updated status of the pet (optional) - * @param resultHandler Asynchronous result handler - */ + * Updates a pet in the store with form data + * + * @param petId ID of pet that needs to be updated (required) + * @param name Updated name of the pet (optional) + * @param status Updated status of the pet (optional) + * @param resultHandler Asynchronous result handler + */ public void updatePetWithForm(Long petId, String name, String status, Handler> resultHandler) { + updatePetWithForm(petId, name, status, null, resultHandler); + } + + /** + * Updates a pet in the store with form data + * + * @param petId ID of pet that needs to be updated (required) + * @param name Updated name of the pet (optional) + * @param status Updated status of the pet (optional) + * @param authInfo per call authentication override. + * @param resultHandler Asynchronous result handler + */ + public void updatePetWithForm(Long petId, String name, String status, ApiClient.AuthInfo authInfo, Handler> resultHandler) { Object localVarBody = null; // verify the required parameter 'petId' is set @@ -285,7 +368,7 @@ public void updatePetWithForm(Long petId, String name, String status, Handler localVarQueryParams = new ArrayList<>(); @@ -306,17 +389,30 @@ public void updatePetWithForm(Long petId, String name, String status, Handler> resultHandler) { + uploadFile(petId, additionalMetadata, file, null, resultHandler); + } + + /** + * uploads an image + * + * @param petId ID of pet to update (required) + * @param additionalMetadata Additional data to pass to server (optional) + * @param file file to upload (optional) + * @param authInfo per call authentication override. + * @param resultHandler Asynchronous result handler + */ + public void uploadFile(Long petId, String additionalMetadata, AsyncFile file, ApiClient.AuthInfo authInfo, Handler> resultHandler) { Object localVarBody = null; // verify the required parameter 'petId' is set @@ -326,7 +422,7 @@ public void uploadFile(Long petId, String additionalMetadata, AsyncFile file, Ha } // create path and map variables - String localVarPath = "/pet/{petId}/uploadImage".replaceAll("\\{" + "petId" + "\\}", petId.toString()); + String localVarPath = "/pet/{petId}/uploadImage".replaceAll("\\{" + "petId" + "\\}", encodeParameter(petId.toString())); // query params List localVarQueryParams = new ArrayList<>(); @@ -347,17 +443,30 @@ public void uploadFile(Long petId, String additionalMetadata, AsyncFile file, Ha String[] localVarContentTypes = { "multipart/form-data" }; String[] localVarAuthNames = new String[] { "petstore_auth" }; TypeReference localVarReturnType = new TypeReference() {}; - apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccepts, localVarContentTypes, localVarAuthNames, localVarReturnType, resultHandler); + apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccepts, localVarContentTypes, localVarAuthNames, authInfo, localVarReturnType, resultHandler); } /** - * uploads an image (required) - * - * @param petId ID of pet to update (required) - * @param requiredFile file to upload (required) - * @param additionalMetadata Additional data to pass to server (optional) - * @param resultHandler Asynchronous result handler - */ + * uploads an image (required) + * + * @param petId ID of pet to update (required) + * @param requiredFile file to upload (required) + * @param additionalMetadata Additional data to pass to server (optional) + * @param resultHandler Asynchronous result handler + */ public void uploadFileWithRequiredFile(Long petId, AsyncFile requiredFile, String additionalMetadata, Handler> resultHandler) { + uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata, null, resultHandler); + } + + /** + * uploads an image (required) + * + * @param petId ID of pet to update (required) + * @param requiredFile file to upload (required) + * @param additionalMetadata Additional data to pass to server (optional) + * @param authInfo per call authentication override. + * @param resultHandler Asynchronous result handler + */ + public void uploadFileWithRequiredFile(Long petId, AsyncFile requiredFile, String additionalMetadata, ApiClient.AuthInfo authInfo, Handler> resultHandler) { Object localVarBody = null; // verify the required parameter 'petId' is set @@ -373,7 +482,7 @@ public void uploadFileWithRequiredFile(Long petId, AsyncFile requiredFile, Strin } // create path and map variables - String localVarPath = "/fake/{petId}/uploadImageWithRequiredFile".replaceAll("\\{" + "petId" + "\\}", petId.toString()); + String localVarPath = "/fake/{petId}/uploadImageWithRequiredFile".replaceAll("\\{" + "petId" + "\\}", encodeParameter(petId.toString())); // query params List localVarQueryParams = new ArrayList<>(); @@ -394,6 +503,14 @@ public void uploadFileWithRequiredFile(Long petId, AsyncFile requiredFile, Strin String[] localVarContentTypes = { "multipart/form-data" }; String[] localVarAuthNames = new String[] { "petstore_auth" }; TypeReference localVarReturnType = new TypeReference() {}; - apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccepts, localVarContentTypes, localVarAuthNames, localVarReturnType, resultHandler); + apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccepts, localVarContentTypes, localVarAuthNames, authInfo, localVarReturnType, resultHandler); + } + + private String encodeParameter(String parameter) { + try { + return URLEncoder.encode(parameter, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + return parameter; + } } } diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/StoreApi.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/StoreApi.java index beae7610b2c1..563c8e6a46ca 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/StoreApi.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/StoreApi.java @@ -1,5 +1,6 @@ package org.openapitools.client.api; +import org.openapitools.client.ApiClient; import org.openapitools.client.model.Order; import io.vertx.core.AsyncResult; import io.vertx.core.Handler; @@ -11,10 +12,18 @@ public interface StoreApi { void deleteOrder(String orderId, Handler> handler); + void deleteOrder(String orderId, ApiClient.AuthInfo authInfo, Handler> handler); + void getInventory(Handler>> handler); + void getInventory(ApiClient.AuthInfo authInfo, Handler>> handler); + void getOrderById(Long orderId, Handler> handler); + void getOrderById(Long orderId, ApiClient.AuthInfo authInfo, Handler> handler); + void placeOrder(Order body, Handler> handler); + void placeOrder(Order body, ApiClient.AuthInfo authInfo, Handler> handler); + } diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/StoreApiImpl.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/StoreApiImpl.java index ae8f8302b474..bc264d4447e0 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/StoreApiImpl.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/StoreApiImpl.java @@ -10,6 +10,9 @@ import com.fasterxml.jackson.core.type.TypeReference; import java.util.*; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; @@ -38,12 +41,23 @@ public void setApiClient(ApiClient apiClient) { } /** - * Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * @param orderId ID of the order that needs to be deleted (required) - * @param resultHandler Asynchronous result handler - */ + * Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * @param orderId ID of the order that needs to be deleted (required) + * @param resultHandler Asynchronous result handler + */ public void deleteOrder(String orderId, Handler> resultHandler) { + deleteOrder(orderId, null, resultHandler); + } + + /** + * Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * @param orderId ID of the order that needs to be deleted (required) + * @param authInfo per call authentication override. + * @param resultHandler Asynchronous result handler + */ + public void deleteOrder(String orderId, ApiClient.AuthInfo authInfo, Handler> resultHandler) { Object localVarBody = null; // verify the required parameter 'orderId' is set @@ -53,7 +67,7 @@ public void deleteOrder(String orderId, Handler> resultHandler } // create path and map variables - String localVarPath = "/store/order/{order_id}".replaceAll("\\{" + "order_id" + "\\}", orderId.toString()); + String localVarPath = "/store/order/{order_id}".replaceAll("\\{" + "order_id" + "\\}", encodeParameter(orderId.toString())); // query params List localVarQueryParams = new ArrayList<>(); @@ -72,14 +86,24 @@ public void deleteOrder(String orderId, Handler> resultHandler String[] localVarContentTypes = { }; String[] localVarAuthNames = new String[] { }; - apiClient.invokeAPI(localVarPath, "DELETE", localVarQueryParams, localVarBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccepts, localVarContentTypes, localVarAuthNames, null, resultHandler); + apiClient.invokeAPI(localVarPath, "DELETE", localVarQueryParams, localVarBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccepts, localVarContentTypes, localVarAuthNames, authInfo, null, resultHandler); } /** - * Returns pet inventories by status - * Returns a map of status codes to quantities - * @param resultHandler Asynchronous result handler - */ + * Returns pet inventories by status + * Returns a map of status codes to quantities + * @param resultHandler Asynchronous result handler + */ public void getInventory(Handler>> resultHandler) { + getInventory(null, resultHandler); + } + + /** + * Returns pet inventories by status + * Returns a map of status codes to quantities + * @param authInfo per call authentication override. + * @param resultHandler Asynchronous result handler + */ + public void getInventory(ApiClient.AuthInfo authInfo, Handler>> resultHandler) { Object localVarBody = null; // create path and map variables @@ -102,15 +126,26 @@ public void getInventory(Handler>> resultHandle String[] localVarContentTypes = { }; String[] localVarAuthNames = new String[] { "api_key" }; TypeReference> localVarReturnType = new TypeReference>() {}; - apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccepts, localVarContentTypes, localVarAuthNames, localVarReturnType, resultHandler); + apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccepts, localVarContentTypes, localVarAuthNames, authInfo, localVarReturnType, resultHandler); } /** - * Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * @param orderId ID of pet that needs to be fetched (required) - * @param resultHandler Asynchronous result handler - */ + * Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * @param orderId ID of pet that needs to be fetched (required) + * @param resultHandler Asynchronous result handler + */ public void getOrderById(Long orderId, Handler> resultHandler) { + getOrderById(orderId, null, resultHandler); + } + + /** + * Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * @param orderId ID of pet that needs to be fetched (required) + * @param authInfo per call authentication override. + * @param resultHandler Asynchronous result handler + */ + public void getOrderById(Long orderId, ApiClient.AuthInfo authInfo, Handler> resultHandler) { Object localVarBody = null; // verify the required parameter 'orderId' is set @@ -120,7 +155,7 @@ public void getOrderById(Long orderId, Handler> resultHandler } // create path and map variables - String localVarPath = "/store/order/{order_id}".replaceAll("\\{" + "order_id" + "\\}", orderId.toString()); + String localVarPath = "/store/order/{order_id}".replaceAll("\\{" + "order_id" + "\\}", encodeParameter(orderId.toString())); // query params List localVarQueryParams = new ArrayList<>(); @@ -139,15 +174,26 @@ public void getOrderById(Long orderId, Handler> resultHandler String[] localVarContentTypes = { }; String[] localVarAuthNames = new String[] { }; TypeReference localVarReturnType = new TypeReference() {}; - apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccepts, localVarContentTypes, localVarAuthNames, localVarReturnType, resultHandler); + apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccepts, localVarContentTypes, localVarAuthNames, authInfo, localVarReturnType, resultHandler); } /** - * Place an order for a pet - * - * @param body order placed for purchasing the pet (required) - * @param resultHandler Asynchronous result handler - */ + * Place an order for a pet + * + * @param body order placed for purchasing the pet (required) + * @param resultHandler Asynchronous result handler + */ public void placeOrder(Order body, Handler> resultHandler) { + placeOrder(body, null, resultHandler); + } + + /** + * Place an order for a pet + * + * @param body order placed for purchasing the pet (required) + * @param authInfo per call authentication override. + * @param resultHandler Asynchronous result handler + */ + public void placeOrder(Order body, ApiClient.AuthInfo authInfo, Handler> resultHandler) { Object localVarBody = body; // verify the required parameter 'body' is set @@ -176,6 +222,14 @@ public void placeOrder(Order body, Handler> resultHandler) { String[] localVarContentTypes = { }; String[] localVarAuthNames = new String[] { }; TypeReference localVarReturnType = new TypeReference() {}; - apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccepts, localVarContentTypes, localVarAuthNames, localVarReturnType, resultHandler); + apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccepts, localVarContentTypes, localVarAuthNames, authInfo, localVarReturnType, resultHandler); + } + + private String encodeParameter(String parameter) { + try { + return URLEncoder.encode(parameter, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + return parameter; + } } } diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/UserApi.java index a7213558a58c..e5c33d583abf 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/UserApi.java @@ -1,5 +1,6 @@ package org.openapitools.client.api; +import org.openapitools.client.ApiClient; import org.openapitools.client.model.User; import io.vertx.core.AsyncResult; import io.vertx.core.Handler; @@ -11,18 +12,34 @@ public interface UserApi { void createUser(User body, Handler> handler); + void createUser(User body, ApiClient.AuthInfo authInfo, Handler> handler); + void createUsersWithArrayInput(List body, Handler> handler); + void createUsersWithArrayInput(List body, ApiClient.AuthInfo authInfo, Handler> handler); + void createUsersWithListInput(List body, Handler> handler); + void createUsersWithListInput(List body, ApiClient.AuthInfo authInfo, Handler> handler); + void deleteUser(String username, Handler> handler); + void deleteUser(String username, ApiClient.AuthInfo authInfo, Handler> handler); + void getUserByName(String username, Handler> handler); + void getUserByName(String username, ApiClient.AuthInfo authInfo, Handler> handler); + void loginUser(String username, String password, Handler> handler); + void loginUser(String username, String password, ApiClient.AuthInfo authInfo, Handler> handler); + void logoutUser(Handler> handler); + void logoutUser(ApiClient.AuthInfo authInfo, Handler> handler); + void updateUser(String username, User body, Handler> handler); + void updateUser(String username, User body, ApiClient.AuthInfo authInfo, Handler> handler); + } diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/UserApiImpl.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/UserApiImpl.java index 1d5ce3d77224..7c2885ba3bc1 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/UserApiImpl.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/UserApiImpl.java @@ -10,6 +10,9 @@ import com.fasterxml.jackson.core.type.TypeReference; import java.util.*; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; @@ -38,12 +41,23 @@ public void setApiClient(ApiClient apiClient) { } /** - * Create user - * This can only be done by the logged in user. - * @param body Created user object (required) - * @param resultHandler Asynchronous result handler - */ + * Create user + * This can only be done by the logged in user. + * @param body Created user object (required) + * @param resultHandler Asynchronous result handler + */ public void createUser(User body, Handler> resultHandler) { + createUser(body, null, resultHandler); + } + + /** + * Create user + * This can only be done by the logged in user. + * @param body Created user object (required) + * @param authInfo per call authentication override. + * @param resultHandler Asynchronous result handler + */ + public void createUser(User body, ApiClient.AuthInfo authInfo, Handler> resultHandler) { Object localVarBody = body; // verify the required parameter 'body' is set @@ -72,15 +86,26 @@ public void createUser(User body, Handler> resultHandler) { String[] localVarContentTypes = { }; String[] localVarAuthNames = new String[] { }; - apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccepts, localVarContentTypes, localVarAuthNames, null, resultHandler); + apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccepts, localVarContentTypes, localVarAuthNames, authInfo, null, resultHandler); } /** - * Creates list of users with given input array - * - * @param body List of user object (required) - * @param resultHandler Asynchronous result handler - */ + * Creates list of users with given input array + * + * @param body List of user object (required) + * @param resultHandler Asynchronous result handler + */ public void createUsersWithArrayInput(List body, Handler> resultHandler) { + createUsersWithArrayInput(body, null, resultHandler); + } + + /** + * Creates list of users with given input array + * + * @param body List of user object (required) + * @param authInfo per call authentication override. + * @param resultHandler Asynchronous result handler + */ + public void createUsersWithArrayInput(List body, ApiClient.AuthInfo authInfo, Handler> resultHandler) { Object localVarBody = body; // verify the required parameter 'body' is set @@ -109,15 +134,26 @@ public void createUsersWithArrayInput(List body, Handler String[] localVarContentTypes = { }; String[] localVarAuthNames = new String[] { }; - apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccepts, localVarContentTypes, localVarAuthNames, null, resultHandler); + apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccepts, localVarContentTypes, localVarAuthNames, authInfo, null, resultHandler); } /** - * Creates list of users with given input array - * - * @param body List of user object (required) - * @param resultHandler Asynchronous result handler - */ + * Creates list of users with given input array + * + * @param body List of user object (required) + * @param resultHandler Asynchronous result handler + */ public void createUsersWithListInput(List body, Handler> resultHandler) { + createUsersWithListInput(body, null, resultHandler); + } + + /** + * Creates list of users with given input array + * + * @param body List of user object (required) + * @param authInfo per call authentication override. + * @param resultHandler Asynchronous result handler + */ + public void createUsersWithListInput(List body, ApiClient.AuthInfo authInfo, Handler> resultHandler) { Object localVarBody = body; // verify the required parameter 'body' is set @@ -146,15 +182,26 @@ public void createUsersWithListInput(List body, Handler> String[] localVarContentTypes = { }; String[] localVarAuthNames = new String[] { }; - apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccepts, localVarContentTypes, localVarAuthNames, null, resultHandler); + apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccepts, localVarContentTypes, localVarAuthNames, authInfo, null, resultHandler); } /** - * Delete user - * This can only be done by the logged in user. - * @param username The name that needs to be deleted (required) - * @param resultHandler Asynchronous result handler - */ + * Delete user + * This can only be done by the logged in user. + * @param username The name that needs to be deleted (required) + * @param resultHandler Asynchronous result handler + */ public void deleteUser(String username, Handler> resultHandler) { + deleteUser(username, null, resultHandler); + } + + /** + * Delete user + * This can only be done by the logged in user. + * @param username The name that needs to be deleted (required) + * @param authInfo per call authentication override. + * @param resultHandler Asynchronous result handler + */ + public void deleteUser(String username, ApiClient.AuthInfo authInfo, Handler> resultHandler) { Object localVarBody = null; // verify the required parameter 'username' is set @@ -164,7 +211,7 @@ public void deleteUser(String username, Handler> resultHandler } // create path and map variables - String localVarPath = "/user/{username}".replaceAll("\\{" + "username" + "\\}", username.toString()); + String localVarPath = "/user/{username}".replaceAll("\\{" + "username" + "\\}", encodeParameter(username.toString())); // query params List localVarQueryParams = new ArrayList<>(); @@ -183,15 +230,26 @@ public void deleteUser(String username, Handler> resultHandler String[] localVarContentTypes = { }; String[] localVarAuthNames = new String[] { }; - apiClient.invokeAPI(localVarPath, "DELETE", localVarQueryParams, localVarBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccepts, localVarContentTypes, localVarAuthNames, null, resultHandler); + apiClient.invokeAPI(localVarPath, "DELETE", localVarQueryParams, localVarBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccepts, localVarContentTypes, localVarAuthNames, authInfo, null, resultHandler); } /** - * Get user by user name - * - * @param username The name that needs to be fetched. Use user1 for testing. (required) - * @param resultHandler Asynchronous result handler - */ + * Get user by user name + * + * @param username The name that needs to be fetched. Use user1 for testing. (required) + * @param resultHandler Asynchronous result handler + */ public void getUserByName(String username, Handler> resultHandler) { + getUserByName(username, null, resultHandler); + } + + /** + * Get user by user name + * + * @param username The name that needs to be fetched. Use user1 for testing. (required) + * @param authInfo per call authentication override. + * @param resultHandler Asynchronous result handler + */ + public void getUserByName(String username, ApiClient.AuthInfo authInfo, Handler> resultHandler) { Object localVarBody = null; // verify the required parameter 'username' is set @@ -201,7 +259,7 @@ public void getUserByName(String username, Handler> resultHand } // create path and map variables - String localVarPath = "/user/{username}".replaceAll("\\{" + "username" + "\\}", username.toString()); + String localVarPath = "/user/{username}".replaceAll("\\{" + "username" + "\\}", encodeParameter(username.toString())); // query params List localVarQueryParams = new ArrayList<>(); @@ -220,16 +278,28 @@ public void getUserByName(String username, Handler> resultHand String[] localVarContentTypes = { }; String[] localVarAuthNames = new String[] { }; TypeReference localVarReturnType = new TypeReference() {}; - apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccepts, localVarContentTypes, localVarAuthNames, localVarReturnType, resultHandler); + apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccepts, localVarContentTypes, localVarAuthNames, authInfo, localVarReturnType, resultHandler); } /** - * Logs user into the system - * - * @param username The user name for login (required) - * @param password The password for login in clear text (required) - * @param resultHandler Asynchronous result handler - */ + * Logs user into the system + * + * @param username The user name for login (required) + * @param password The password for login in clear text (required) + * @param resultHandler Asynchronous result handler + */ public void loginUser(String username, String password, Handler> resultHandler) { + loginUser(username, password, null, resultHandler); + } + + /** + * Logs user into the system + * + * @param username The user name for login (required) + * @param password The password for login in clear text (required) + * @param authInfo per call authentication override. + * @param resultHandler Asynchronous result handler + */ + public void loginUser(String username, String password, ApiClient.AuthInfo authInfo, Handler> resultHandler) { Object localVarBody = null; // verify the required parameter 'username' is set @@ -266,14 +336,24 @@ public void loginUser(String username, String password, Handler localVarReturnType = new TypeReference() {}; - apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccepts, localVarContentTypes, localVarAuthNames, localVarReturnType, resultHandler); + apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccepts, localVarContentTypes, localVarAuthNames, authInfo, localVarReturnType, resultHandler); } /** - * Logs out current logged in user session - * - * @param resultHandler Asynchronous result handler - */ + * Logs out current logged in user session + * + * @param resultHandler Asynchronous result handler + */ public void logoutUser(Handler> resultHandler) { + logoutUser(null, resultHandler); + } + + /** + * Logs out current logged in user session + * + * @param authInfo per call authentication override. + * @param resultHandler Asynchronous result handler + */ + public void logoutUser(ApiClient.AuthInfo authInfo, Handler> resultHandler) { Object localVarBody = null; // create path and map variables @@ -296,16 +376,28 @@ public void logoutUser(Handler> resultHandler) { String[] localVarContentTypes = { }; String[] localVarAuthNames = new String[] { }; - apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccepts, localVarContentTypes, localVarAuthNames, null, resultHandler); + apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccepts, localVarContentTypes, localVarAuthNames, authInfo, null, resultHandler); } /** - * Updated user - * This can only be done by the logged in user. - * @param username name that need to be deleted (required) - * @param body Updated user object (required) - * @param resultHandler Asynchronous result handler - */ + * Updated user + * This can only be done by the logged in user. + * @param username name that need to be deleted (required) + * @param body Updated user object (required) + * @param resultHandler Asynchronous result handler + */ public void updateUser(String username, User body, Handler> resultHandler) { + updateUser(username, body, null, resultHandler); + } + + /** + * Updated user + * This can only be done by the logged in user. + * @param username name that need to be deleted (required) + * @param body Updated user object (required) + * @param authInfo per call authentication override. + * @param resultHandler Asynchronous result handler + */ + public void updateUser(String username, User body, ApiClient.AuthInfo authInfo, Handler> resultHandler) { Object localVarBody = body; // verify the required parameter 'username' is set @@ -321,7 +413,7 @@ public void updateUser(String username, User body, Handler> re } // create path and map variables - String localVarPath = "/user/{username}".replaceAll("\\{" + "username" + "\\}", username.toString()); + String localVarPath = "/user/{username}".replaceAll("\\{" + "username" + "\\}", encodeParameter(username.toString())); // query params List localVarQueryParams = new ArrayList<>(); @@ -340,6 +432,14 @@ public void updateUser(String username, User body, Handler> re String[] localVarContentTypes = { }; String[] localVarAuthNames = new String[] { }; - apiClient.invokeAPI(localVarPath, "PUT", localVarQueryParams, localVarBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccepts, localVarContentTypes, localVarAuthNames, null, resultHandler); + apiClient.invokeAPI(localVarPath, "PUT", localVarQueryParams, localVarBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccepts, localVarContentTypes, localVarAuthNames, authInfo, null, resultHandler); + } + + private String encodeParameter(String parameter) { + try { + return URLEncoder.encode(parameter, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + return parameter; + } } } diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/rxjava/AnotherFakeApi.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/rxjava/AnotherFakeApi.java index 4d85babec214..c7ce2478c765 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/rxjava/AnotherFakeApi.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/rxjava/AnotherFakeApi.java @@ -1,6 +1,7 @@ package org.openapitools.client.api.rxjava; import org.openapitools.client.model.Client; +import org.openapitools.client.ApiClient; import java.util.*; @@ -11,36 +12,60 @@ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AnotherFakeApi { - private final org.openapitools.client.api.AnotherFakeApi delegate; + private final org.openapitools.client.api.AnotherFakeApi delegate; - public AnotherFakeApi(org.openapitools.client.api.AnotherFakeApi delegate) { - this.delegate = delegate; + public AnotherFakeApi(org.openapitools.client.api.AnotherFakeApi delegate) { + this.delegate = delegate; } - public org.openapitools.client.api.AnotherFakeApi getDelegate() { - return delegate; - } + public org.openapitools.client.api.AnotherFakeApi getDelegate() { + return delegate; + } /** - * To test special tags - * To test special tags and operation ID starting with number - * @param body client model (required) - * @param resultHandler Asynchronous result handler - */ + * To test special tags + * To test special tags and operation ID starting with number + * @param body client model (required) + * @param resultHandler Asynchronous result handler + */ public void call123testSpecialTags(Client body, Handler> resultHandler) { delegate.call123testSpecialTags(body, resultHandler); } /** - * To test special tags - * To test special tags and operation ID starting with number - * @param body client model (required) - * @return Asynchronous result handler (RxJava Single) - */ + * To test special tags + * To test special tags and operation ID starting with number + * @param body client model (required) + * @param authInfo call specific auth overrides + * @param resultHandler Asynchronous result handler + */ + public void call123testSpecialTags(Client body, ApiClient.AuthInfo authInfo, Handler> resultHandler) { + delegate.call123testSpecialTags(body, authInfo, resultHandler); + } + + /** + * To test special tags + * To test special tags and operation ID starting with number + * @param body client model (required) + * @return Asynchronous result handler (RxJava Single) + */ public Single rxCall123testSpecialTags(Client body) { - return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> { - delegate.call123testSpecialTags(body, fut); - })); + return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> + delegate.call123testSpecialTags(body, fut) + )); + } + + /** + * To test special tags + * To test special tags and operation ID starting with number + * @param body client model (required) + * @param authInfo call specific auth overrides + * @return Asynchronous result handler (RxJava Single) + */ + public Single rxCall123testSpecialTags(Client body, ApiClient.AuthInfo authInfo) { + return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> + delegate.call123testSpecialTags(body, authInfo, fut) + )); } public static AnotherFakeApi newInstance(org.openapitools.client.api.AnotherFakeApi arg) { diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/rxjava/FakeApi.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/rxjava/FakeApi.java index 5d022cb70877..f3a3b9b131b2 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/rxjava/FakeApi.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/rxjava/FakeApi.java @@ -9,6 +9,7 @@ import org.openapitools.client.model.OuterComposite; import org.openapitools.client.model.User; import org.openapitools.client.model.XmlItem; +import org.openapitools.client.ApiClient; import java.util.*; @@ -19,371 +20,769 @@ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class FakeApi { - private final org.openapitools.client.api.FakeApi delegate; + private final org.openapitools.client.api.FakeApi delegate; - public FakeApi(org.openapitools.client.api.FakeApi delegate) { - this.delegate = delegate; + public FakeApi(org.openapitools.client.api.FakeApi delegate) { + this.delegate = delegate; } - public org.openapitools.client.api.FakeApi getDelegate() { - return delegate; - } + public org.openapitools.client.api.FakeApi getDelegate() { + return delegate; + } /** - * creates an XmlItem - * this route creates an XmlItem - * @param xmlItem XmlItem Body (required) - * @param resultHandler Asynchronous result handler - */ + * creates an XmlItem + * this route creates an XmlItem + * @param xmlItem XmlItem Body (required) + * @param resultHandler Asynchronous result handler + */ public void createXmlItem(XmlItem xmlItem, Handler> resultHandler) { delegate.createXmlItem(xmlItem, resultHandler); } /** - * creates an XmlItem - * this route creates an XmlItem - * @param xmlItem XmlItem Body (required) - * @return Asynchronous result handler (RxJava Single) - */ + * creates an XmlItem + * this route creates an XmlItem + * @param xmlItem XmlItem Body (required) + * @param authInfo call specific auth overrides + * @param resultHandler Asynchronous result handler + */ + public void createXmlItem(XmlItem xmlItem, ApiClient.AuthInfo authInfo, Handler> resultHandler) { + delegate.createXmlItem(xmlItem, authInfo, resultHandler); + } + + /** + * creates an XmlItem + * this route creates an XmlItem + * @param xmlItem XmlItem Body (required) + * @return Asynchronous result handler (RxJava Single) + */ public Single rxCreateXmlItem(XmlItem xmlItem) { - return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> { - delegate.createXmlItem(xmlItem, fut); - })); + return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> + delegate.createXmlItem(xmlItem, fut) + )); + } + + /** + * creates an XmlItem + * this route creates an XmlItem + * @param xmlItem XmlItem Body (required) + * @param authInfo call specific auth overrides + * @return Asynchronous result handler (RxJava Single) + */ + public Single rxCreateXmlItem(XmlItem xmlItem, ApiClient.AuthInfo authInfo) { + return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> + delegate.createXmlItem(xmlItem, authInfo, fut) + )); } /** - * - * Test serialization of outer boolean types - * @param body Input boolean as post body (optional) - * @param resultHandler Asynchronous result handler - */ + * + * Test serialization of outer boolean types + * @param body Input boolean as post body (optional) + * @param resultHandler Asynchronous result handler + */ public void fakeOuterBooleanSerialize(Boolean body, Handler> resultHandler) { delegate.fakeOuterBooleanSerialize(body, resultHandler); } /** - * - * Test serialization of outer boolean types - * @param body Input boolean as post body (optional) - * @return Asynchronous result handler (RxJava Single) - */ + * + * Test serialization of outer boolean types + * @param body Input boolean as post body (optional) + * @param authInfo call specific auth overrides + * @param resultHandler Asynchronous result handler + */ + public void fakeOuterBooleanSerialize(Boolean body, ApiClient.AuthInfo authInfo, Handler> resultHandler) { + delegate.fakeOuterBooleanSerialize(body, authInfo, resultHandler); + } + + /** + * + * Test serialization of outer boolean types + * @param body Input boolean as post body (optional) + * @return Asynchronous result handler (RxJava Single) + */ public Single rxFakeOuterBooleanSerialize(Boolean body) { - return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> { - delegate.fakeOuterBooleanSerialize(body, fut); - })); + return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> + delegate.fakeOuterBooleanSerialize(body, fut) + )); + } + + /** + * + * Test serialization of outer boolean types + * @param body Input boolean as post body (optional) + * @param authInfo call specific auth overrides + * @return Asynchronous result handler (RxJava Single) + */ + public Single rxFakeOuterBooleanSerialize(Boolean body, ApiClient.AuthInfo authInfo) { + return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> + delegate.fakeOuterBooleanSerialize(body, authInfo, fut) + )); } /** - * - * Test serialization of object with outer number type - * @param body Input composite as post body (optional) - * @param resultHandler Asynchronous result handler - */ + * + * Test serialization of object with outer number type + * @param body Input composite as post body (optional) + * @param resultHandler Asynchronous result handler + */ public void fakeOuterCompositeSerialize(OuterComposite body, Handler> resultHandler) { delegate.fakeOuterCompositeSerialize(body, resultHandler); } /** - * - * Test serialization of object with outer number type - * @param body Input composite as post body (optional) - * @return Asynchronous result handler (RxJava Single) - */ + * + * Test serialization of object with outer number type + * @param body Input composite as post body (optional) + * @param authInfo call specific auth overrides + * @param resultHandler Asynchronous result handler + */ + public void fakeOuterCompositeSerialize(OuterComposite body, ApiClient.AuthInfo authInfo, Handler> resultHandler) { + delegate.fakeOuterCompositeSerialize(body, authInfo, resultHandler); + } + + /** + * + * Test serialization of object with outer number type + * @param body Input composite as post body (optional) + * @return Asynchronous result handler (RxJava Single) + */ public Single rxFakeOuterCompositeSerialize(OuterComposite body) { - return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> { - delegate.fakeOuterCompositeSerialize(body, fut); - })); + return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> + delegate.fakeOuterCompositeSerialize(body, fut) + )); + } + + /** + * + * Test serialization of object with outer number type + * @param body Input composite as post body (optional) + * @param authInfo call specific auth overrides + * @return Asynchronous result handler (RxJava Single) + */ + public Single rxFakeOuterCompositeSerialize(OuterComposite body, ApiClient.AuthInfo authInfo) { + return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> + delegate.fakeOuterCompositeSerialize(body, authInfo, fut) + )); } /** - * - * Test serialization of outer number types - * @param body Input number as post body (optional) - * @param resultHandler Asynchronous result handler - */ + * + * Test serialization of outer number types + * @param body Input number as post body (optional) + * @param resultHandler Asynchronous result handler + */ public void fakeOuterNumberSerialize(BigDecimal body, Handler> resultHandler) { delegate.fakeOuterNumberSerialize(body, resultHandler); } /** - * - * Test serialization of outer number types - * @param body Input number as post body (optional) - * @return Asynchronous result handler (RxJava Single) - */ + * + * Test serialization of outer number types + * @param body Input number as post body (optional) + * @param authInfo call specific auth overrides + * @param resultHandler Asynchronous result handler + */ + public void fakeOuterNumberSerialize(BigDecimal body, ApiClient.AuthInfo authInfo, Handler> resultHandler) { + delegate.fakeOuterNumberSerialize(body, authInfo, resultHandler); + } + + /** + * + * Test serialization of outer number types + * @param body Input number as post body (optional) + * @return Asynchronous result handler (RxJava Single) + */ public Single rxFakeOuterNumberSerialize(BigDecimal body) { - return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> { - delegate.fakeOuterNumberSerialize(body, fut); - })); + return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> + delegate.fakeOuterNumberSerialize(body, fut) + )); } + /** - * - * Test serialization of outer string types - * @param body Input string as post body (optional) - * @param resultHandler Asynchronous result handler - */ + * + * Test serialization of outer number types + * @param body Input number as post body (optional) + * @param authInfo call specific auth overrides + * @return Asynchronous result handler (RxJava Single) + */ + public Single rxFakeOuterNumberSerialize(BigDecimal body, ApiClient.AuthInfo authInfo) { + return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> + delegate.fakeOuterNumberSerialize(body, authInfo, fut) + )); + } + /** + * + * Test serialization of outer string types + * @param body Input string as post body (optional) + * @param resultHandler Asynchronous result handler + */ public void fakeOuterStringSerialize(String body, Handler> resultHandler) { delegate.fakeOuterStringSerialize(body, resultHandler); } /** - * - * Test serialization of outer string types - * @param body Input string as post body (optional) - * @return Asynchronous result handler (RxJava Single) - */ + * + * Test serialization of outer string types + * @param body Input string as post body (optional) + * @param authInfo call specific auth overrides + * @param resultHandler Asynchronous result handler + */ + public void fakeOuterStringSerialize(String body, ApiClient.AuthInfo authInfo, Handler> resultHandler) { + delegate.fakeOuterStringSerialize(body, authInfo, resultHandler); + } + + /** + * + * Test serialization of outer string types + * @param body Input string as post body (optional) + * @return Asynchronous result handler (RxJava Single) + */ public Single rxFakeOuterStringSerialize(String body) { - return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> { - delegate.fakeOuterStringSerialize(body, fut); - })); + return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> + delegate.fakeOuterStringSerialize(body, fut) + )); + } + + /** + * + * Test serialization of outer string types + * @param body Input string as post body (optional) + * @param authInfo call specific auth overrides + * @return Asynchronous result handler (RxJava Single) + */ + public Single rxFakeOuterStringSerialize(String body, ApiClient.AuthInfo authInfo) { + return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> + delegate.fakeOuterStringSerialize(body, authInfo, fut) + )); } /** - * - * For this test, the body for this request much reference a schema named `File`. - * @param body (required) - * @param resultHandler Asynchronous result handler - */ + * + * For this test, the body for this request much reference a schema named `File`. + * @param body (required) + * @param resultHandler Asynchronous result handler + */ public void testBodyWithFileSchema(FileSchemaTestClass body, Handler> resultHandler) { delegate.testBodyWithFileSchema(body, resultHandler); } /** - * - * For this test, the body for this request much reference a schema named `File`. - * @param body (required) - * @return Asynchronous result handler (RxJava Single) - */ + * + * For this test, the body for this request much reference a schema named `File`. + * @param body (required) + * @param authInfo call specific auth overrides + * @param resultHandler Asynchronous result handler + */ + public void testBodyWithFileSchema(FileSchemaTestClass body, ApiClient.AuthInfo authInfo, Handler> resultHandler) { + delegate.testBodyWithFileSchema(body, authInfo, resultHandler); + } + + /** + * + * For this test, the body for this request much reference a schema named `File`. + * @param body (required) + * @return Asynchronous result handler (RxJava Single) + */ public Single rxTestBodyWithFileSchema(FileSchemaTestClass body) { - return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> { - delegate.testBodyWithFileSchema(body, fut); - })); + return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> + delegate.testBodyWithFileSchema(body, fut) + )); } + /** - * - * - * @param query (required) - * @param body (required) - * @param resultHandler Asynchronous result handler - */ + * + * For this test, the body for this request much reference a schema named `File`. + * @param body (required) + * @param authInfo call specific auth overrides + * @return Asynchronous result handler (RxJava Single) + */ + public Single rxTestBodyWithFileSchema(FileSchemaTestClass body, ApiClient.AuthInfo authInfo) { + return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> + delegate.testBodyWithFileSchema(body, authInfo, fut) + )); + } + /** + * + * + * @param query (required) + * @param body (required) + * @param resultHandler Asynchronous result handler + */ public void testBodyWithQueryParams(String query, User body, Handler> resultHandler) { delegate.testBodyWithQueryParams(query, body, resultHandler); } /** - * - * - * @param query (required) - * @param body (required) - * @return Asynchronous result handler (RxJava Single) - */ + * + * + * @param query (required) + * @param body (required) + * @param authInfo call specific auth overrides + * @param resultHandler Asynchronous result handler + */ + public void testBodyWithQueryParams(String query, User body, ApiClient.AuthInfo authInfo, Handler> resultHandler) { + delegate.testBodyWithQueryParams(query, body, authInfo, resultHandler); + } + + /** + * + * + * @param query (required) + * @param body (required) + * @return Asynchronous result handler (RxJava Single) + */ public Single rxTestBodyWithQueryParams(String query, User body) { - return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> { - delegate.testBodyWithQueryParams(query, body, fut); - })); + return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> + delegate.testBodyWithQueryParams(query, body, fut) + )); } + /** - * To test \"client\" model - * To test \"client\" model - * @param body client model (required) - * @param resultHandler Asynchronous result handler - */ + * + * + * @param query (required) + * @param body (required) + * @param authInfo call specific auth overrides + * @return Asynchronous result handler (RxJava Single) + */ + public Single rxTestBodyWithQueryParams(String query, User body, ApiClient.AuthInfo authInfo) { + return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> + delegate.testBodyWithQueryParams(query, body, authInfo, fut) + )); + } + /** + * To test \"client\" model + * To test \"client\" model + * @param body client model (required) + * @param resultHandler Asynchronous result handler + */ public void testClientModel(Client body, Handler> resultHandler) { delegate.testClientModel(body, resultHandler); } /** - * To test \"client\" model - * To test \"client\" model - * @param body client model (required) - * @return Asynchronous result handler (RxJava Single) - */ + * To test \"client\" model + * To test \"client\" model + * @param body client model (required) + * @param authInfo call specific auth overrides + * @param resultHandler Asynchronous result handler + */ + public void testClientModel(Client body, ApiClient.AuthInfo authInfo, Handler> resultHandler) { + delegate.testClientModel(body, authInfo, resultHandler); + } + + /** + * To test \"client\" model + * To test \"client\" model + * @param body client model (required) + * @return Asynchronous result handler (RxJava Single) + */ public Single rxTestClientModel(Client body) { - return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> { - delegate.testClientModel(body, fut); - })); - } - /** - * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * @param number None (required) - * @param _double None (required) - * @param patternWithoutDelimiter None (required) - * @param _byte None (required) - * @param integer None (optional) - * @param int32 None (optional) - * @param int64 None (optional) - * @param _float None (optional) - * @param string None (optional) - * @param binary None (optional) - * @param date None (optional) - * @param dateTime None (optional) - * @param password None (optional) - * @param paramCallback None (optional) - * @param resultHandler Asynchronous result handler - */ + return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> + delegate.testClientModel(body, fut) + )); + } + + /** + * To test \"client\" model + * To test \"client\" model + * @param body client model (required) + * @param authInfo call specific auth overrides + * @return Asynchronous result handler (RxJava Single) + */ + public Single rxTestClientModel(Client body, ApiClient.AuthInfo authInfo) { + return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> + delegate.testClientModel(body, authInfo, fut) + )); + } + /** + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * @param number None (required) + * @param _double None (required) + * @param patternWithoutDelimiter None (required) + * @param _byte None (required) + * @param integer None (optional) + * @param int32 None (optional) + * @param int64 None (optional) + * @param _float None (optional) + * @param string None (optional) + * @param binary None (optional) + * @param date None (optional) + * @param dateTime None (optional) + * @param password None (optional) + * @param paramCallback None (optional) + * @param resultHandler Asynchronous result handler + */ public void testEndpointParameters(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, AsyncFile binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback, Handler> resultHandler) { delegate.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback, resultHandler); } /** - * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * @param number None (required) - * @param _double None (required) - * @param patternWithoutDelimiter None (required) - * @param _byte None (required) - * @param integer None (optional) - * @param int32 None (optional) - * @param int64 None (optional) - * @param _float None (optional) - * @param string None (optional) - * @param binary None (optional) - * @param date None (optional) - * @param dateTime None (optional) - * @param password None (optional) - * @param paramCallback None (optional) - * @return Asynchronous result handler (RxJava Single) - */ + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * @param number None (required) + * @param _double None (required) + * @param patternWithoutDelimiter None (required) + * @param _byte None (required) + * @param integer None (optional) + * @param int32 None (optional) + * @param int64 None (optional) + * @param _float None (optional) + * @param string None (optional) + * @param binary None (optional) + * @param date None (optional) + * @param dateTime None (optional) + * @param password None (optional) + * @param paramCallback None (optional) + * @param authInfo call specific auth overrides + * @param resultHandler Asynchronous result handler + */ + public void testEndpointParameters(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, AsyncFile binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback, ApiClient.AuthInfo authInfo, Handler> resultHandler) { + delegate.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback, authInfo, resultHandler); + } + + /** + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * @param number None (required) + * @param _double None (required) + * @param patternWithoutDelimiter None (required) + * @param _byte None (required) + * @param integer None (optional) + * @param int32 None (optional) + * @param int64 None (optional) + * @param _float None (optional) + * @param string None (optional) + * @param binary None (optional) + * @param date None (optional) + * @param dateTime None (optional) + * @param password None (optional) + * @param paramCallback None (optional) + * @return Asynchronous result handler (RxJava Single) + */ public Single rxTestEndpointParameters(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, AsyncFile binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback) { - return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> { - delegate.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback, fut); - })); - } - /** - * To test enum parameters - * To test enum parameters - * @param enumHeaderStringArray Header parameter enum test (string array) (optional, default to new ArrayList<>()) - * @param enumHeaderString Header parameter enum test (string) (optional, default to -efg) - * @param enumQueryStringArray Query parameter enum test (string array) (optional, default to new ArrayList<>()) - * @param enumQueryString Query parameter enum test (string) (optional, default to -efg) - * @param enumQueryInteger Query parameter enum test (double) (optional) - * @param enumQueryDouble Query parameter enum test (double) (optional) - * @param enumFormStringArray Form parameter enum test (string array) (optional, default to $) - * @param enumFormString Form parameter enum test (string) (optional, default to -efg) - * @param resultHandler Asynchronous result handler - */ + return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> + delegate.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback, fut) + )); + } + + /** + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * @param number None (required) + * @param _double None (required) + * @param patternWithoutDelimiter None (required) + * @param _byte None (required) + * @param integer None (optional) + * @param int32 None (optional) + * @param int64 None (optional) + * @param _float None (optional) + * @param string None (optional) + * @param binary None (optional) + * @param date None (optional) + * @param dateTime None (optional) + * @param password None (optional) + * @param paramCallback None (optional) + * @param authInfo call specific auth overrides + * @return Asynchronous result handler (RxJava Single) + */ + public Single rxTestEndpointParameters(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, AsyncFile binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback, ApiClient.AuthInfo authInfo) { + return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> + delegate.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback, authInfo, fut) + )); + } + /** + * To test enum parameters + * To test enum parameters + * @param enumHeaderStringArray Header parameter enum test (string array) (optional, default to new ArrayList<>()) + * @param enumHeaderString Header parameter enum test (string) (optional, default to -efg) + * @param enumQueryStringArray Query parameter enum test (string array) (optional, default to new ArrayList<>()) + * @param enumQueryString Query parameter enum test (string) (optional, default to -efg) + * @param enumQueryInteger Query parameter enum test (double) (optional) + * @param enumQueryDouble Query parameter enum test (double) (optional) + * @param enumFormStringArray Form parameter enum test (string array) (optional, default to $) + * @param enumFormString Form parameter enum test (string) (optional, default to -efg) + * @param resultHandler Asynchronous result handler + */ public void testEnumParameters(List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List enumFormStringArray, String enumFormString, Handler> resultHandler) { delegate.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString, resultHandler); } /** - * To test enum parameters - * To test enum parameters - * @param enumHeaderStringArray Header parameter enum test (string array) (optional, default to new ArrayList<>()) - * @param enumHeaderString Header parameter enum test (string) (optional, default to -efg) - * @param enumQueryStringArray Query parameter enum test (string array) (optional, default to new ArrayList<>()) - * @param enumQueryString Query parameter enum test (string) (optional, default to -efg) - * @param enumQueryInteger Query parameter enum test (double) (optional) - * @param enumQueryDouble Query parameter enum test (double) (optional) - * @param enumFormStringArray Form parameter enum test (string array) (optional, default to $) - * @param enumFormString Form parameter enum test (string) (optional, default to -efg) - * @return Asynchronous result handler (RxJava Single) - */ + * To test enum parameters + * To test enum parameters + * @param enumHeaderStringArray Header parameter enum test (string array) (optional, default to new ArrayList<>()) + * @param enumHeaderString Header parameter enum test (string) (optional, default to -efg) + * @param enumQueryStringArray Query parameter enum test (string array) (optional, default to new ArrayList<>()) + * @param enumQueryString Query parameter enum test (string) (optional, default to -efg) + * @param enumQueryInteger Query parameter enum test (double) (optional) + * @param enumQueryDouble Query parameter enum test (double) (optional) + * @param enumFormStringArray Form parameter enum test (string array) (optional, default to $) + * @param enumFormString Form parameter enum test (string) (optional, default to -efg) + * @param authInfo call specific auth overrides + * @param resultHandler Asynchronous result handler + */ + public void testEnumParameters(List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List enumFormStringArray, String enumFormString, ApiClient.AuthInfo authInfo, Handler> resultHandler) { + delegate.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString, authInfo, resultHandler); + } + + /** + * To test enum parameters + * To test enum parameters + * @param enumHeaderStringArray Header parameter enum test (string array) (optional, default to new ArrayList<>()) + * @param enumHeaderString Header parameter enum test (string) (optional, default to -efg) + * @param enumQueryStringArray Query parameter enum test (string array) (optional, default to new ArrayList<>()) + * @param enumQueryString Query parameter enum test (string) (optional, default to -efg) + * @param enumQueryInteger Query parameter enum test (double) (optional) + * @param enumQueryDouble Query parameter enum test (double) (optional) + * @param enumFormStringArray Form parameter enum test (string array) (optional, default to $) + * @param enumFormString Form parameter enum test (string) (optional, default to -efg) + * @return Asynchronous result handler (RxJava Single) + */ public Single rxTestEnumParameters(List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List enumFormStringArray, String enumFormString) { - return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> { - delegate.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString, fut); - })); - } - /** - * Fake endpoint to test group parameters (optional) - * Fake endpoint to test group parameters (optional) - * @param requiredStringGroup Required String in group parameters (required) - * @param requiredBooleanGroup Required Boolean in group parameters (required) - * @param requiredInt64Group Required Integer in group parameters (required) - * @param stringGroup String in group parameters (optional) - * @param booleanGroup Boolean in group parameters (optional) - * @param int64Group Integer in group parameters (optional) - * @param resultHandler Asynchronous result handler - */ + return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> + delegate.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString, fut) + )); + } + + /** + * To test enum parameters + * To test enum parameters + * @param enumHeaderStringArray Header parameter enum test (string array) (optional, default to new ArrayList<>()) + * @param enumHeaderString Header parameter enum test (string) (optional, default to -efg) + * @param enumQueryStringArray Query parameter enum test (string array) (optional, default to new ArrayList<>()) + * @param enumQueryString Query parameter enum test (string) (optional, default to -efg) + * @param enumQueryInteger Query parameter enum test (double) (optional) + * @param enumQueryDouble Query parameter enum test (double) (optional) + * @param enumFormStringArray Form parameter enum test (string array) (optional, default to $) + * @param enumFormString Form parameter enum test (string) (optional, default to -efg) + * @param authInfo call specific auth overrides + * @return Asynchronous result handler (RxJava Single) + */ + public Single rxTestEnumParameters(List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List enumFormStringArray, String enumFormString, ApiClient.AuthInfo authInfo) { + return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> + delegate.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString, authInfo, fut) + )); + } + /** + * Fake endpoint to test group parameters (optional) + * Fake endpoint to test group parameters (optional) + * @param requiredStringGroup Required String in group parameters (required) + * @param requiredBooleanGroup Required Boolean in group parameters (required) + * @param requiredInt64Group Required Integer in group parameters (required) + * @param stringGroup String in group parameters (optional) + * @param booleanGroup Boolean in group parameters (optional) + * @param int64Group Integer in group parameters (optional) + * @param resultHandler Asynchronous result handler + */ public void testGroupParameters(Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group, Handler> resultHandler) { delegate.testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group, resultHandler); } /** - * Fake endpoint to test group parameters (optional) - * Fake endpoint to test group parameters (optional) - * @param requiredStringGroup Required String in group parameters (required) - * @param requiredBooleanGroup Required Boolean in group parameters (required) - * @param requiredInt64Group Required Integer in group parameters (required) - * @param stringGroup String in group parameters (optional) - * @param booleanGroup Boolean in group parameters (optional) - * @param int64Group Integer in group parameters (optional) - * @return Asynchronous result handler (RxJava Single) - */ + * Fake endpoint to test group parameters (optional) + * Fake endpoint to test group parameters (optional) + * @param requiredStringGroup Required String in group parameters (required) + * @param requiredBooleanGroup Required Boolean in group parameters (required) + * @param requiredInt64Group Required Integer in group parameters (required) + * @param stringGroup String in group parameters (optional) + * @param booleanGroup Boolean in group parameters (optional) + * @param int64Group Integer in group parameters (optional) + * @param authInfo call specific auth overrides + * @param resultHandler Asynchronous result handler + */ + public void testGroupParameters(Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group, ApiClient.AuthInfo authInfo, Handler> resultHandler) { + delegate.testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group, authInfo, resultHandler); + } + + /** + * Fake endpoint to test group parameters (optional) + * Fake endpoint to test group parameters (optional) + * @param requiredStringGroup Required String in group parameters (required) + * @param requiredBooleanGroup Required Boolean in group parameters (required) + * @param requiredInt64Group Required Integer in group parameters (required) + * @param stringGroup String in group parameters (optional) + * @param booleanGroup Boolean in group parameters (optional) + * @param int64Group Integer in group parameters (optional) + * @return Asynchronous result handler (RxJava Single) + */ public Single rxTestGroupParameters(Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group) { - return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> { - delegate.testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group, fut); - })); + return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> + delegate.testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group, fut) + )); + } + + /** + * Fake endpoint to test group parameters (optional) + * Fake endpoint to test group parameters (optional) + * @param requiredStringGroup Required String in group parameters (required) + * @param requiredBooleanGroup Required Boolean in group parameters (required) + * @param requiredInt64Group Required Integer in group parameters (required) + * @param stringGroup String in group parameters (optional) + * @param booleanGroup Boolean in group parameters (optional) + * @param int64Group Integer in group parameters (optional) + * @param authInfo call specific auth overrides + * @return Asynchronous result handler (RxJava Single) + */ + public Single rxTestGroupParameters(Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group, ApiClient.AuthInfo authInfo) { + return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> + delegate.testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group, authInfo, fut) + )); } /** - * test inline additionalProperties - * - * @param param request body (required) - * @param resultHandler Asynchronous result handler - */ + * test inline additionalProperties + * + * @param param request body (required) + * @param resultHandler Asynchronous result handler + */ public void testInlineAdditionalProperties(Map param, Handler> resultHandler) { delegate.testInlineAdditionalProperties(param, resultHandler); } /** - * test inline additionalProperties - * - * @param param request body (required) - * @return Asynchronous result handler (RxJava Single) - */ + * test inline additionalProperties + * + * @param param request body (required) + * @param authInfo call specific auth overrides + * @param resultHandler Asynchronous result handler + */ + public void testInlineAdditionalProperties(Map param, ApiClient.AuthInfo authInfo, Handler> resultHandler) { + delegate.testInlineAdditionalProperties(param, authInfo, resultHandler); + } + + /** + * test inline additionalProperties + * + * @param param request body (required) + * @return Asynchronous result handler (RxJava Single) + */ public Single rxTestInlineAdditionalProperties(Map param) { - return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> { - delegate.testInlineAdditionalProperties(param, fut); - })); + return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> + delegate.testInlineAdditionalProperties(param, fut) + )); + } + + /** + * test inline additionalProperties + * + * @param param request body (required) + * @param authInfo call specific auth overrides + * @return Asynchronous result handler (RxJava Single) + */ + public Single rxTestInlineAdditionalProperties(Map param, ApiClient.AuthInfo authInfo) { + return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> + delegate.testInlineAdditionalProperties(param, authInfo, fut) + )); } /** - * test json serialization of form data - * - * @param param field1 (required) - * @param param2 field2 (required) - * @param resultHandler Asynchronous result handler - */ + * test json serialization of form data + * + * @param param field1 (required) + * @param param2 field2 (required) + * @param resultHandler Asynchronous result handler + */ public void testJsonFormData(String param, String param2, Handler> resultHandler) { delegate.testJsonFormData(param, param2, resultHandler); } /** - * test json serialization of form data - * - * @param param field1 (required) - * @param param2 field2 (required) - * @return Asynchronous result handler (RxJava Single) - */ + * test json serialization of form data + * + * @param param field1 (required) + * @param param2 field2 (required) + * @param authInfo call specific auth overrides + * @param resultHandler Asynchronous result handler + */ + public void testJsonFormData(String param, String param2, ApiClient.AuthInfo authInfo, Handler> resultHandler) { + delegate.testJsonFormData(param, param2, authInfo, resultHandler); + } + + /** + * test json serialization of form data + * + * @param param field1 (required) + * @param param2 field2 (required) + * @return Asynchronous result handler (RxJava Single) + */ public Single rxTestJsonFormData(String param, String param2) { - return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> { - delegate.testJsonFormData(param, param2, fut); - })); - } - /** - * - * To test the collection format in query parameters - * @param pipe (required) - * @param ioutil (required) - * @param http (required) - * @param url (required) - * @param context (required) - * @param resultHandler Asynchronous result handler - */ + return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> + delegate.testJsonFormData(param, param2, fut) + )); + } + + /** + * test json serialization of form data + * + * @param param field1 (required) + * @param param2 field2 (required) + * @param authInfo call specific auth overrides + * @return Asynchronous result handler (RxJava Single) + */ + public Single rxTestJsonFormData(String param, String param2, ApiClient.AuthInfo authInfo) { + return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> + delegate.testJsonFormData(param, param2, authInfo, fut) + )); + } + /** + * + * To test the collection format in query parameters + * @param pipe (required) + * @param ioutil (required) + * @param http (required) + * @param url (required) + * @param context (required) + * @param resultHandler Asynchronous result handler + */ public void testQueryParameterCollectionFormat(List pipe, List ioutil, List http, List url, List context, Handler> resultHandler) { delegate.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, resultHandler); } /** - * - * To test the collection format in query parameters - * @param pipe (required) - * @param ioutil (required) - * @param http (required) - * @param url (required) - * @param context (required) - * @return Asynchronous result handler (RxJava Single) - */ + * + * To test the collection format in query parameters + * @param pipe (required) + * @param ioutil (required) + * @param http (required) + * @param url (required) + * @param context (required) + * @param authInfo call specific auth overrides + * @param resultHandler Asynchronous result handler + */ + public void testQueryParameterCollectionFormat(List pipe, List ioutil, List http, List url, List context, ApiClient.AuthInfo authInfo, Handler> resultHandler) { + delegate.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, authInfo, resultHandler); + } + + /** + * + * To test the collection format in query parameters + * @param pipe (required) + * @param ioutil (required) + * @param http (required) + * @param url (required) + * @param context (required) + * @return Asynchronous result handler (RxJava Single) + */ public Single rxTestQueryParameterCollectionFormat(List pipe, List ioutil, List http, List url, List context) { - return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> { - delegate.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, fut); - })); + return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> + delegate.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, fut) + )); + } + + /** + * + * To test the collection format in query parameters + * @param pipe (required) + * @param ioutil (required) + * @param http (required) + * @param url (required) + * @param context (required) + * @param authInfo call specific auth overrides + * @return Asynchronous result handler (RxJava Single) + */ + public Single rxTestQueryParameterCollectionFormat(List pipe, List ioutil, List http, List url, List context, ApiClient.AuthInfo authInfo) { + return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> + delegate.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, authInfo, fut) + )); } public static FakeApi newInstance(org.openapitools.client.api.FakeApi arg) { diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/rxjava/FakeClassnameTags123Api.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/rxjava/FakeClassnameTags123Api.java index 0b75f9f18fe3..13fba337d6e4 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/rxjava/FakeClassnameTags123Api.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/rxjava/FakeClassnameTags123Api.java @@ -1,6 +1,7 @@ package org.openapitools.client.api.rxjava; import org.openapitools.client.model.Client; +import org.openapitools.client.ApiClient; import java.util.*; @@ -11,36 +12,60 @@ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class FakeClassnameTags123Api { - private final org.openapitools.client.api.FakeClassnameTags123Api delegate; + private final org.openapitools.client.api.FakeClassnameTags123Api delegate; - public FakeClassnameTags123Api(org.openapitools.client.api.FakeClassnameTags123Api delegate) { - this.delegate = delegate; + public FakeClassnameTags123Api(org.openapitools.client.api.FakeClassnameTags123Api delegate) { + this.delegate = delegate; } - public org.openapitools.client.api.FakeClassnameTags123Api getDelegate() { - return delegate; - } + public org.openapitools.client.api.FakeClassnameTags123Api getDelegate() { + return delegate; + } /** - * To test class name in snake case - * To test class name in snake case - * @param body client model (required) - * @param resultHandler Asynchronous result handler - */ + * To test class name in snake case + * To test class name in snake case + * @param body client model (required) + * @param resultHandler Asynchronous result handler + */ public void testClassname(Client body, Handler> resultHandler) { delegate.testClassname(body, resultHandler); } /** - * To test class name in snake case - * To test class name in snake case - * @param body client model (required) - * @return Asynchronous result handler (RxJava Single) - */ + * To test class name in snake case + * To test class name in snake case + * @param body client model (required) + * @param authInfo call specific auth overrides + * @param resultHandler Asynchronous result handler + */ + public void testClassname(Client body, ApiClient.AuthInfo authInfo, Handler> resultHandler) { + delegate.testClassname(body, authInfo, resultHandler); + } + + /** + * To test class name in snake case + * To test class name in snake case + * @param body client model (required) + * @return Asynchronous result handler (RxJava Single) + */ public Single rxTestClassname(Client body) { - return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> { - delegate.testClassname(body, fut); - })); + return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> + delegate.testClassname(body, fut) + )); + } + + /** + * To test class name in snake case + * To test class name in snake case + * @param body client model (required) + * @param authInfo call specific auth overrides + * @return Asynchronous result handler (RxJava Single) + */ + public Single rxTestClassname(Client body, ApiClient.AuthInfo authInfo) { + return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> + delegate.testClassname(body, authInfo, fut) + )); } public static FakeClassnameTags123Api newInstance(org.openapitools.client.api.FakeClassnameTags123Api arg) { diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/rxjava/PetApi.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/rxjava/PetApi.java index 5a986b10a785..ceeec1744846 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/rxjava/PetApi.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/rxjava/PetApi.java @@ -4,6 +4,7 @@ import org.openapitools.client.model.ModelApiResponse; import org.openapitools.client.model.Pet; import java.util.Set; +import org.openapitools.client.ApiClient; import java.util.*; @@ -14,218 +15,448 @@ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class PetApi { - private final org.openapitools.client.api.PetApi delegate; + private final org.openapitools.client.api.PetApi delegate; - public PetApi(org.openapitools.client.api.PetApi delegate) { - this.delegate = delegate; + public PetApi(org.openapitools.client.api.PetApi delegate) { + this.delegate = delegate; } - public org.openapitools.client.api.PetApi getDelegate() { - return delegate; - } + public org.openapitools.client.api.PetApi getDelegate() { + return delegate; + } /** - * Add a new pet to the store - * - * @param body Pet object that needs to be added to the store (required) - * @param resultHandler Asynchronous result handler - */ + * Add a new pet to the store + * + * @param body Pet object that needs to be added to the store (required) + * @param resultHandler Asynchronous result handler + */ public void addPet(Pet body, Handler> resultHandler) { delegate.addPet(body, resultHandler); } /** - * Add a new pet to the store - * - * @param body Pet object that needs to be added to the store (required) - * @return Asynchronous result handler (RxJava Single) - */ + * Add a new pet to the store + * + * @param body Pet object that needs to be added to the store (required) + * @param authInfo call specific auth overrides + * @param resultHandler Asynchronous result handler + */ + public void addPet(Pet body, ApiClient.AuthInfo authInfo, Handler> resultHandler) { + delegate.addPet(body, authInfo, resultHandler); + } + + /** + * Add a new pet to the store + * + * @param body Pet object that needs to be added to the store (required) + * @return Asynchronous result handler (RxJava Single) + */ public Single rxAddPet(Pet body) { - return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> { - delegate.addPet(body, fut); - })); + return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> + delegate.addPet(body, fut) + )); + } + + /** + * Add a new pet to the store + * + * @param body Pet object that needs to be added to the store (required) + * @param authInfo call specific auth overrides + * @return Asynchronous result handler (RxJava Single) + */ + public Single rxAddPet(Pet body, ApiClient.AuthInfo authInfo) { + return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> + delegate.addPet(body, authInfo, fut) + )); } /** - * Deletes a pet - * - * @param petId Pet id to delete (required) - * @param apiKey (optional) - * @param resultHandler Asynchronous result handler - */ + * Deletes a pet + * + * @param petId Pet id to delete (required) + * @param apiKey (optional) + * @param resultHandler Asynchronous result handler + */ public void deletePet(Long petId, String apiKey, Handler> resultHandler) { delegate.deletePet(petId, apiKey, resultHandler); } /** - * Deletes a pet - * - * @param petId Pet id to delete (required) - * @param apiKey (optional) - * @return Asynchronous result handler (RxJava Single) - */ + * Deletes a pet + * + * @param petId Pet id to delete (required) + * @param apiKey (optional) + * @param authInfo call specific auth overrides + * @param resultHandler Asynchronous result handler + */ + public void deletePet(Long petId, String apiKey, ApiClient.AuthInfo authInfo, Handler> resultHandler) { + delegate.deletePet(petId, apiKey, authInfo, resultHandler); + } + + /** + * Deletes a pet + * + * @param petId Pet id to delete (required) + * @param apiKey (optional) + * @return Asynchronous result handler (RxJava Single) + */ public Single rxDeletePet(Long petId, String apiKey) { - return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> { - delegate.deletePet(petId, apiKey, fut); - })); + return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> + delegate.deletePet(petId, apiKey, fut) + )); + } + + /** + * Deletes a pet + * + * @param petId Pet id to delete (required) + * @param apiKey (optional) + * @param authInfo call specific auth overrides + * @return Asynchronous result handler (RxJava Single) + */ + public Single rxDeletePet(Long petId, String apiKey, ApiClient.AuthInfo authInfo) { + return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> + delegate.deletePet(petId, apiKey, authInfo, fut) + )); } /** - * Finds Pets by status - * Multiple status values can be provided with comma separated strings - * @param status Status values that need to be considered for filter (required) - * @param resultHandler Asynchronous result handler - */ + * Finds Pets by status + * Multiple status values can be provided with comma separated strings + * @param status Status values that need to be considered for filter (required) + * @param resultHandler Asynchronous result handler + */ public void findPetsByStatus(List status, Handler>> resultHandler) { delegate.findPetsByStatus(status, resultHandler); } /** - * Finds Pets by status - * Multiple status values can be provided with comma separated strings - * @param status Status values that need to be considered for filter (required) - * @return Asynchronous result handler (RxJava Single) - */ + * Finds Pets by status + * Multiple status values can be provided with comma separated strings + * @param status Status values that need to be considered for filter (required) + * @param authInfo call specific auth overrides + * @param resultHandler Asynchronous result handler + */ + public void findPetsByStatus(List status, ApiClient.AuthInfo authInfo, Handler>> resultHandler) { + delegate.findPetsByStatus(status, authInfo, resultHandler); + } + + /** + * Finds Pets by status + * Multiple status values can be provided with comma separated strings + * @param status Status values that need to be considered for filter (required) + * @return Asynchronous result handler (RxJava Single) + */ public Single> rxFindPetsByStatus(List status) { - return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> { - delegate.findPetsByStatus(status, fut); - })); + return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> + delegate.findPetsByStatus(status, fut) + )); + } + + /** + * Finds Pets by status + * Multiple status values can be provided with comma separated strings + * @param status Status values that need to be considered for filter (required) + * @param authInfo call specific auth overrides + * @return Asynchronous result handler (RxJava Single) + */ + public Single> rxFindPetsByStatus(List status, ApiClient.AuthInfo authInfo) { + return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> + delegate.findPetsByStatus(status, authInfo, fut) + )); } /** - * Finds Pets by tags - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * @param tags Tags to filter by (required) - * @param resultHandler Asynchronous result handler - */ + * Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * @param tags Tags to filter by (required) + * @param resultHandler Asynchronous result handler + */ public void findPetsByTags(Set tags, Handler>> resultHandler) { delegate.findPetsByTags(tags, resultHandler); } /** - * Finds Pets by tags - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * @param tags Tags to filter by (required) - * @return Asynchronous result handler (RxJava Single) - */ + * Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * @param tags Tags to filter by (required) + * @param authInfo call specific auth overrides + * @param resultHandler Asynchronous result handler + */ + public void findPetsByTags(Set tags, ApiClient.AuthInfo authInfo, Handler>> resultHandler) { + delegate.findPetsByTags(tags, authInfo, resultHandler); + } + + /** + * Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * @param tags Tags to filter by (required) + * @return Asynchronous result handler (RxJava Single) + */ public Single> rxFindPetsByTags(Set tags) { - return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> { - delegate.findPetsByTags(tags, fut); - })); + return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> + delegate.findPetsByTags(tags, fut) + )); } + /** - * Find pet by ID - * Returns a single pet - * @param petId ID of pet to return (required) - * @param resultHandler Asynchronous result handler - */ + * Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * @param tags Tags to filter by (required) + * @param authInfo call specific auth overrides + * @return Asynchronous result handler (RxJava Single) + */ + public Single> rxFindPetsByTags(Set tags, ApiClient.AuthInfo authInfo) { + return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> + delegate.findPetsByTags(tags, authInfo, fut) + )); + } + /** + * Find pet by ID + * Returns a single pet + * @param petId ID of pet to return (required) + * @param resultHandler Asynchronous result handler + */ public void getPetById(Long petId, Handler> resultHandler) { delegate.getPetById(petId, resultHandler); } /** - * Find pet by ID - * Returns a single pet - * @param petId ID of pet to return (required) - * @return Asynchronous result handler (RxJava Single) - */ + * Find pet by ID + * Returns a single pet + * @param petId ID of pet to return (required) + * @param authInfo call specific auth overrides + * @param resultHandler Asynchronous result handler + */ + public void getPetById(Long petId, ApiClient.AuthInfo authInfo, Handler> resultHandler) { + delegate.getPetById(petId, authInfo, resultHandler); + } + + /** + * Find pet by ID + * Returns a single pet + * @param petId ID of pet to return (required) + * @return Asynchronous result handler (RxJava Single) + */ public Single rxGetPetById(Long petId) { - return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> { - delegate.getPetById(petId, fut); - })); + return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> + delegate.getPetById(petId, fut) + )); + } + + /** + * Find pet by ID + * Returns a single pet + * @param petId ID of pet to return (required) + * @param authInfo call specific auth overrides + * @return Asynchronous result handler (RxJava Single) + */ + public Single rxGetPetById(Long petId, ApiClient.AuthInfo authInfo) { + return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> + delegate.getPetById(petId, authInfo, fut) + )); } /** - * Update an existing pet - * - * @param body Pet object that needs to be added to the store (required) - * @param resultHandler Asynchronous result handler - */ + * Update an existing pet + * + * @param body Pet object that needs to be added to the store (required) + * @param resultHandler Asynchronous result handler + */ public void updatePet(Pet body, Handler> resultHandler) { delegate.updatePet(body, resultHandler); } /** - * Update an existing pet - * - * @param body Pet object that needs to be added to the store (required) - * @return Asynchronous result handler (RxJava Single) - */ + * Update an existing pet + * + * @param body Pet object that needs to be added to the store (required) + * @param authInfo call specific auth overrides + * @param resultHandler Asynchronous result handler + */ + public void updatePet(Pet body, ApiClient.AuthInfo authInfo, Handler> resultHandler) { + delegate.updatePet(body, authInfo, resultHandler); + } + + /** + * Update an existing pet + * + * @param body Pet object that needs to be added to the store (required) + * @return Asynchronous result handler (RxJava Single) + */ public Single rxUpdatePet(Pet body) { - return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> { - delegate.updatePet(body, fut); - })); - } - /** - * Updates a pet in the store with form data - * - * @param petId ID of pet that needs to be updated (required) - * @param name Updated name of the pet (optional) - * @param status Updated status of the pet (optional) - * @param resultHandler Asynchronous result handler - */ + return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> + delegate.updatePet(body, fut) + )); + } + + /** + * Update an existing pet + * + * @param body Pet object that needs to be added to the store (required) + * @param authInfo call specific auth overrides + * @return Asynchronous result handler (RxJava Single) + */ + public Single rxUpdatePet(Pet body, ApiClient.AuthInfo authInfo) { + return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> + delegate.updatePet(body, authInfo, fut) + )); + } + /** + * Updates a pet in the store with form data + * + * @param petId ID of pet that needs to be updated (required) + * @param name Updated name of the pet (optional) + * @param status Updated status of the pet (optional) + * @param resultHandler Asynchronous result handler + */ public void updatePetWithForm(Long petId, String name, String status, Handler> resultHandler) { delegate.updatePetWithForm(petId, name, status, resultHandler); } /** - * Updates a pet in the store with form data - * - * @param petId ID of pet that needs to be updated (required) - * @param name Updated name of the pet (optional) - * @param status Updated status of the pet (optional) - * @return Asynchronous result handler (RxJava Single) - */ + * Updates a pet in the store with form data + * + * @param petId ID of pet that needs to be updated (required) + * @param name Updated name of the pet (optional) + * @param status Updated status of the pet (optional) + * @param authInfo call specific auth overrides + * @param resultHandler Asynchronous result handler + */ + public void updatePetWithForm(Long petId, String name, String status, ApiClient.AuthInfo authInfo, Handler> resultHandler) { + delegate.updatePetWithForm(petId, name, status, authInfo, resultHandler); + } + + /** + * Updates a pet in the store with form data + * + * @param petId ID of pet that needs to be updated (required) + * @param name Updated name of the pet (optional) + * @param status Updated status of the pet (optional) + * @return Asynchronous result handler (RxJava Single) + */ public Single rxUpdatePetWithForm(Long petId, String name, String status) { - return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> { - delegate.updatePetWithForm(petId, name, status, fut); - })); - } - /** - * uploads an image - * - * @param petId ID of pet to update (required) - * @param additionalMetadata Additional data to pass to server (optional) - * @param file file to upload (optional) - * @param resultHandler Asynchronous result handler - */ + return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> + delegate.updatePetWithForm(petId, name, status, fut) + )); + } + + /** + * Updates a pet in the store with form data + * + * @param petId ID of pet that needs to be updated (required) + * @param name Updated name of the pet (optional) + * @param status Updated status of the pet (optional) + * @param authInfo call specific auth overrides + * @return Asynchronous result handler (RxJava Single) + */ + public Single rxUpdatePetWithForm(Long petId, String name, String status, ApiClient.AuthInfo authInfo) { + return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> + delegate.updatePetWithForm(petId, name, status, authInfo, fut) + )); + } + /** + * uploads an image + * + * @param petId ID of pet to update (required) + * @param additionalMetadata Additional data to pass to server (optional) + * @param file file to upload (optional) + * @param resultHandler Asynchronous result handler + */ public void uploadFile(Long petId, String additionalMetadata, AsyncFile file, Handler> resultHandler) { delegate.uploadFile(petId, additionalMetadata, file, resultHandler); } /** - * uploads an image - * - * @param petId ID of pet to update (required) - * @param additionalMetadata Additional data to pass to server (optional) - * @param file file to upload (optional) - * @return Asynchronous result handler (RxJava Single) - */ + * uploads an image + * + * @param petId ID of pet to update (required) + * @param additionalMetadata Additional data to pass to server (optional) + * @param file file to upload (optional) + * @param authInfo call specific auth overrides + * @param resultHandler Asynchronous result handler + */ + public void uploadFile(Long petId, String additionalMetadata, AsyncFile file, ApiClient.AuthInfo authInfo, Handler> resultHandler) { + delegate.uploadFile(petId, additionalMetadata, file, authInfo, resultHandler); + } + + /** + * uploads an image + * + * @param petId ID of pet to update (required) + * @param additionalMetadata Additional data to pass to server (optional) + * @param file file to upload (optional) + * @return Asynchronous result handler (RxJava Single) + */ public Single rxUploadFile(Long petId, String additionalMetadata, AsyncFile file) { - return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> { - delegate.uploadFile(petId, additionalMetadata, file, fut); - })); - } - /** - * uploads an image (required) - * - * @param petId ID of pet to update (required) - * @param requiredFile file to upload (required) - * @param additionalMetadata Additional data to pass to server (optional) - * @param resultHandler Asynchronous result handler - */ + return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> + delegate.uploadFile(petId, additionalMetadata, file, fut) + )); + } + + /** + * uploads an image + * + * @param petId ID of pet to update (required) + * @param additionalMetadata Additional data to pass to server (optional) + * @param file file to upload (optional) + * @param authInfo call specific auth overrides + * @return Asynchronous result handler (RxJava Single) + */ + public Single rxUploadFile(Long petId, String additionalMetadata, AsyncFile file, ApiClient.AuthInfo authInfo) { + return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> + delegate.uploadFile(petId, additionalMetadata, file, authInfo, fut) + )); + } + /** + * uploads an image (required) + * + * @param petId ID of pet to update (required) + * @param requiredFile file to upload (required) + * @param additionalMetadata Additional data to pass to server (optional) + * @param resultHandler Asynchronous result handler + */ public void uploadFileWithRequiredFile(Long petId, AsyncFile requiredFile, String additionalMetadata, Handler> resultHandler) { delegate.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata, resultHandler); } /** - * uploads an image (required) - * - * @param petId ID of pet to update (required) - * @param requiredFile file to upload (required) - * @param additionalMetadata Additional data to pass to server (optional) - * @return Asynchronous result handler (RxJava Single) - */ + * uploads an image (required) + * + * @param petId ID of pet to update (required) + * @param requiredFile file to upload (required) + * @param additionalMetadata Additional data to pass to server (optional) + * @param authInfo call specific auth overrides + * @param resultHandler Asynchronous result handler + */ + public void uploadFileWithRequiredFile(Long petId, AsyncFile requiredFile, String additionalMetadata, ApiClient.AuthInfo authInfo, Handler> resultHandler) { + delegate.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata, authInfo, resultHandler); + } + + /** + * uploads an image (required) + * + * @param petId ID of pet to update (required) + * @param requiredFile file to upload (required) + * @param additionalMetadata Additional data to pass to server (optional) + * @return Asynchronous result handler (RxJava Single) + */ public Single rxUploadFileWithRequiredFile(Long petId, AsyncFile requiredFile, String additionalMetadata) { - return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> { - delegate.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata, fut); - })); + return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> + delegate.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata, fut) + )); + } + + /** + * uploads an image (required) + * + * @param petId ID of pet to update (required) + * @param requiredFile file to upload (required) + * @param additionalMetadata Additional data to pass to server (optional) + * @param authInfo call specific auth overrides + * @return Asynchronous result handler (RxJava Single) + */ + public Single rxUploadFileWithRequiredFile(Long petId, AsyncFile requiredFile, String additionalMetadata, ApiClient.AuthInfo authInfo) { + return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> + delegate.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata, authInfo, fut) + )); } public static PetApi newInstance(org.openapitools.client.api.PetApi arg) { diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/rxjava/StoreApi.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/rxjava/StoreApi.java index 0be88ae9886b..d8972b50a133 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/rxjava/StoreApi.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/rxjava/StoreApi.java @@ -1,6 +1,7 @@ package org.openapitools.client.api.rxjava; import org.openapitools.client.model.Order; +import org.openapitools.client.ApiClient; import java.util.*; @@ -11,97 +12,191 @@ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class StoreApi { - private final org.openapitools.client.api.StoreApi delegate; + private final org.openapitools.client.api.StoreApi delegate; - public StoreApi(org.openapitools.client.api.StoreApi delegate) { - this.delegate = delegate; + public StoreApi(org.openapitools.client.api.StoreApi delegate) { + this.delegate = delegate; } - public org.openapitools.client.api.StoreApi getDelegate() { - return delegate; - } + public org.openapitools.client.api.StoreApi getDelegate() { + return delegate; + } /** - * Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * @param orderId ID of the order that needs to be deleted (required) - * @param resultHandler Asynchronous result handler - */ + * Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * @param orderId ID of the order that needs to be deleted (required) + * @param resultHandler Asynchronous result handler + */ public void deleteOrder(String orderId, Handler> resultHandler) { delegate.deleteOrder(orderId, resultHandler); } /** - * Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * @param orderId ID of the order that needs to be deleted (required) - * @return Asynchronous result handler (RxJava Single) - */ + * Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * @param orderId ID of the order that needs to be deleted (required) + * @param authInfo call specific auth overrides + * @param resultHandler Asynchronous result handler + */ + public void deleteOrder(String orderId, ApiClient.AuthInfo authInfo, Handler> resultHandler) { + delegate.deleteOrder(orderId, authInfo, resultHandler); + } + + /** + * Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * @param orderId ID of the order that needs to be deleted (required) + * @return Asynchronous result handler (RxJava Single) + */ public Single rxDeleteOrder(String orderId) { - return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> { - delegate.deleteOrder(orderId, fut); - })); + return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> + delegate.deleteOrder(orderId, fut) + )); + } + + /** + * Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * @param orderId ID of the order that needs to be deleted (required) + * @param authInfo call specific auth overrides + * @return Asynchronous result handler (RxJava Single) + */ + public Single rxDeleteOrder(String orderId, ApiClient.AuthInfo authInfo) { + return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> + delegate.deleteOrder(orderId, authInfo, fut) + )); } /** - * Returns pet inventories by status - * Returns a map of status codes to quantities - * @param resultHandler Asynchronous result handler - */ + * Returns pet inventories by status + * Returns a map of status codes to quantities + * @param resultHandler Asynchronous result handler + */ public void getInventory(Handler>> resultHandler) { delegate.getInventory(resultHandler); } /** - * Returns pet inventories by status - * Returns a map of status codes to quantities - * @return Asynchronous result handler (RxJava Single) - */ + * Returns pet inventories by status + * Returns a map of status codes to quantities + * @param authInfo call specific auth overrides + * @param resultHandler Asynchronous result handler + */ + public void getInventory(ApiClient.AuthInfo authInfo, Handler>> resultHandler) { + delegate.getInventory(authInfo, resultHandler); + } + + /** + * Returns pet inventories by status + * Returns a map of status codes to quantities + * @return Asynchronous result handler (RxJava Single) + */ public Single> rxGetInventory() { - return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> { - delegate.getInventory(fut); - })); + return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> + delegate.getInventory(fut) + )); + } + + /** + * Returns pet inventories by status + * Returns a map of status codes to quantities + * @param authInfo call specific auth overrides + * @return Asynchronous result handler (RxJava Single) + */ + public Single> rxGetInventory(ApiClient.AuthInfo authInfo) { + return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> + delegate.getInventory(authInfo, fut) + )); } /** - * Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * @param orderId ID of pet that needs to be fetched (required) - * @param resultHandler Asynchronous result handler - */ + * Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * @param orderId ID of pet that needs to be fetched (required) + * @param resultHandler Asynchronous result handler + */ public void getOrderById(Long orderId, Handler> resultHandler) { delegate.getOrderById(orderId, resultHandler); } /** - * Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * @param orderId ID of pet that needs to be fetched (required) - * @return Asynchronous result handler (RxJava Single) - */ + * Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * @param orderId ID of pet that needs to be fetched (required) + * @param authInfo call specific auth overrides + * @param resultHandler Asynchronous result handler + */ + public void getOrderById(Long orderId, ApiClient.AuthInfo authInfo, Handler> resultHandler) { + delegate.getOrderById(orderId, authInfo, resultHandler); + } + + /** + * Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * @param orderId ID of pet that needs to be fetched (required) + * @return Asynchronous result handler (RxJava Single) + */ public Single rxGetOrderById(Long orderId) { - return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> { - delegate.getOrderById(orderId, fut); - })); + return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> + delegate.getOrderById(orderId, fut) + )); + } + + /** + * Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * @param orderId ID of pet that needs to be fetched (required) + * @param authInfo call specific auth overrides + * @return Asynchronous result handler (RxJava Single) + */ + public Single rxGetOrderById(Long orderId, ApiClient.AuthInfo authInfo) { + return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> + delegate.getOrderById(orderId, authInfo, fut) + )); } /** - * Place an order for a pet - * - * @param body order placed for purchasing the pet (required) - * @param resultHandler Asynchronous result handler - */ + * Place an order for a pet + * + * @param body order placed for purchasing the pet (required) + * @param resultHandler Asynchronous result handler + */ public void placeOrder(Order body, Handler> resultHandler) { delegate.placeOrder(body, resultHandler); } /** - * Place an order for a pet - * - * @param body order placed for purchasing the pet (required) - * @return Asynchronous result handler (RxJava Single) - */ + * Place an order for a pet + * + * @param body order placed for purchasing the pet (required) + * @param authInfo call specific auth overrides + * @param resultHandler Asynchronous result handler + */ + public void placeOrder(Order body, ApiClient.AuthInfo authInfo, Handler> resultHandler) { + delegate.placeOrder(body, authInfo, resultHandler); + } + + /** + * Place an order for a pet + * + * @param body order placed for purchasing the pet (required) + * @return Asynchronous result handler (RxJava Single) + */ public Single rxPlaceOrder(Order body) { - return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> { - delegate.placeOrder(body, fut); - })); + return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> + delegate.placeOrder(body, fut) + )); + } + + /** + * Place an order for a pet + * + * @param body order placed for purchasing the pet (required) + * @param authInfo call specific auth overrides + * @return Asynchronous result handler (RxJava Single) + */ + public Single rxPlaceOrder(Order body, ApiClient.AuthInfo authInfo) { + return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> + delegate.placeOrder(body, authInfo, fut) + )); } public static StoreApi newInstance(org.openapitools.client.api.StoreApi arg) { diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/rxjava/UserApi.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/rxjava/UserApi.java index f7e2e887655d..51280eef3804 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/rxjava/UserApi.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/rxjava/UserApi.java @@ -1,6 +1,7 @@ package org.openapitools.client.api.rxjava; import org.openapitools.client.model.User; +import org.openapitools.client.ApiClient; import java.util.*; @@ -11,185 +12,379 @@ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class UserApi { - private final org.openapitools.client.api.UserApi delegate; + private final org.openapitools.client.api.UserApi delegate; - public UserApi(org.openapitools.client.api.UserApi delegate) { - this.delegate = delegate; + public UserApi(org.openapitools.client.api.UserApi delegate) { + this.delegate = delegate; } - public org.openapitools.client.api.UserApi getDelegate() { - return delegate; - } + public org.openapitools.client.api.UserApi getDelegate() { + return delegate; + } /** - * Create user - * This can only be done by the logged in user. - * @param body Created user object (required) - * @param resultHandler Asynchronous result handler - */ + * Create user + * This can only be done by the logged in user. + * @param body Created user object (required) + * @param resultHandler Asynchronous result handler + */ public void createUser(User body, Handler> resultHandler) { delegate.createUser(body, resultHandler); } /** - * Create user - * This can only be done by the logged in user. - * @param body Created user object (required) - * @return Asynchronous result handler (RxJava Single) - */ + * Create user + * This can only be done by the logged in user. + * @param body Created user object (required) + * @param authInfo call specific auth overrides + * @param resultHandler Asynchronous result handler + */ + public void createUser(User body, ApiClient.AuthInfo authInfo, Handler> resultHandler) { + delegate.createUser(body, authInfo, resultHandler); + } + + /** + * Create user + * This can only be done by the logged in user. + * @param body Created user object (required) + * @return Asynchronous result handler (RxJava Single) + */ public Single rxCreateUser(User body) { - return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> { - delegate.createUser(body, fut); - })); + return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> + delegate.createUser(body, fut) + )); + } + + /** + * Create user + * This can only be done by the logged in user. + * @param body Created user object (required) + * @param authInfo call specific auth overrides + * @return Asynchronous result handler (RxJava Single) + */ + public Single rxCreateUser(User body, ApiClient.AuthInfo authInfo) { + return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> + delegate.createUser(body, authInfo, fut) + )); } /** - * Creates list of users with given input array - * - * @param body List of user object (required) - * @param resultHandler Asynchronous result handler - */ + * Creates list of users with given input array + * + * @param body List of user object (required) + * @param resultHandler Asynchronous result handler + */ public void createUsersWithArrayInput(List body, Handler> resultHandler) { delegate.createUsersWithArrayInput(body, resultHandler); } /** - * Creates list of users with given input array - * - * @param body List of user object (required) - * @return Asynchronous result handler (RxJava Single) - */ + * Creates list of users with given input array + * + * @param body List of user object (required) + * @param authInfo call specific auth overrides + * @param resultHandler Asynchronous result handler + */ + public void createUsersWithArrayInput(List body, ApiClient.AuthInfo authInfo, Handler> resultHandler) { + delegate.createUsersWithArrayInput(body, authInfo, resultHandler); + } + + /** + * Creates list of users with given input array + * + * @param body List of user object (required) + * @return Asynchronous result handler (RxJava Single) + */ public Single rxCreateUsersWithArrayInput(List body) { - return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> { - delegate.createUsersWithArrayInput(body, fut); - })); + return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> + delegate.createUsersWithArrayInput(body, fut) + )); + } + + /** + * Creates list of users with given input array + * + * @param body List of user object (required) + * @param authInfo call specific auth overrides + * @return Asynchronous result handler (RxJava Single) + */ + public Single rxCreateUsersWithArrayInput(List body, ApiClient.AuthInfo authInfo) { + return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> + delegate.createUsersWithArrayInput(body, authInfo, fut) + )); } /** - * Creates list of users with given input array - * - * @param body List of user object (required) - * @param resultHandler Asynchronous result handler - */ + * Creates list of users with given input array + * + * @param body List of user object (required) + * @param resultHandler Asynchronous result handler + */ public void createUsersWithListInput(List body, Handler> resultHandler) { delegate.createUsersWithListInput(body, resultHandler); } /** - * Creates list of users with given input array - * - * @param body List of user object (required) - * @return Asynchronous result handler (RxJava Single) - */ + * Creates list of users with given input array + * + * @param body List of user object (required) + * @param authInfo call specific auth overrides + * @param resultHandler Asynchronous result handler + */ + public void createUsersWithListInput(List body, ApiClient.AuthInfo authInfo, Handler> resultHandler) { + delegate.createUsersWithListInput(body, authInfo, resultHandler); + } + + /** + * Creates list of users with given input array + * + * @param body List of user object (required) + * @return Asynchronous result handler (RxJava Single) + */ public Single rxCreateUsersWithListInput(List body) { - return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> { - delegate.createUsersWithListInput(body, fut); - })); + return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> + delegate.createUsersWithListInput(body, fut) + )); + } + + /** + * Creates list of users with given input array + * + * @param body List of user object (required) + * @param authInfo call specific auth overrides + * @return Asynchronous result handler (RxJava Single) + */ + public Single rxCreateUsersWithListInput(List body, ApiClient.AuthInfo authInfo) { + return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> + delegate.createUsersWithListInput(body, authInfo, fut) + )); } /** - * Delete user - * This can only be done by the logged in user. - * @param username The name that needs to be deleted (required) - * @param resultHandler Asynchronous result handler - */ + * Delete user + * This can only be done by the logged in user. + * @param username The name that needs to be deleted (required) + * @param resultHandler Asynchronous result handler + */ public void deleteUser(String username, Handler> resultHandler) { delegate.deleteUser(username, resultHandler); } /** - * Delete user - * This can only be done by the logged in user. - * @param username The name that needs to be deleted (required) - * @return Asynchronous result handler (RxJava Single) - */ + * Delete user + * This can only be done by the logged in user. + * @param username The name that needs to be deleted (required) + * @param authInfo call specific auth overrides + * @param resultHandler Asynchronous result handler + */ + public void deleteUser(String username, ApiClient.AuthInfo authInfo, Handler> resultHandler) { + delegate.deleteUser(username, authInfo, resultHandler); + } + + /** + * Delete user + * This can only be done by the logged in user. + * @param username The name that needs to be deleted (required) + * @return Asynchronous result handler (RxJava Single) + */ public Single rxDeleteUser(String username) { - return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> { - delegate.deleteUser(username, fut); - })); + return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> + delegate.deleteUser(username, fut) + )); + } + + /** + * Delete user + * This can only be done by the logged in user. + * @param username The name that needs to be deleted (required) + * @param authInfo call specific auth overrides + * @return Asynchronous result handler (RxJava Single) + */ + public Single rxDeleteUser(String username, ApiClient.AuthInfo authInfo) { + return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> + delegate.deleteUser(username, authInfo, fut) + )); } /** - * Get user by user name - * - * @param username The name that needs to be fetched. Use user1 for testing. (required) - * @param resultHandler Asynchronous result handler - */ + * Get user by user name + * + * @param username The name that needs to be fetched. Use user1 for testing. (required) + * @param resultHandler Asynchronous result handler + */ public void getUserByName(String username, Handler> resultHandler) { delegate.getUserByName(username, resultHandler); } /** - * Get user by user name - * - * @param username The name that needs to be fetched. Use user1 for testing. (required) - * @return Asynchronous result handler (RxJava Single) - */ + * Get user by user name + * + * @param username The name that needs to be fetched. Use user1 for testing. (required) + * @param authInfo call specific auth overrides + * @param resultHandler Asynchronous result handler + */ + public void getUserByName(String username, ApiClient.AuthInfo authInfo, Handler> resultHandler) { + delegate.getUserByName(username, authInfo, resultHandler); + } + + /** + * Get user by user name + * + * @param username The name that needs to be fetched. Use user1 for testing. (required) + * @return Asynchronous result handler (RxJava Single) + */ public Single rxGetUserByName(String username) { - return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> { - delegate.getUserByName(username, fut); - })); + return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> + delegate.getUserByName(username, fut) + )); + } + + /** + * Get user by user name + * + * @param username The name that needs to be fetched. Use user1 for testing. (required) + * @param authInfo call specific auth overrides + * @return Asynchronous result handler (RxJava Single) + */ + public Single rxGetUserByName(String username, ApiClient.AuthInfo authInfo) { + return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> + delegate.getUserByName(username, authInfo, fut) + )); } /** - * Logs user into the system - * - * @param username The user name for login (required) - * @param password The password for login in clear text (required) - * @param resultHandler Asynchronous result handler - */ + * Logs user into the system + * + * @param username The user name for login (required) + * @param password The password for login in clear text (required) + * @param resultHandler Asynchronous result handler + */ public void loginUser(String username, String password, Handler> resultHandler) { delegate.loginUser(username, password, resultHandler); } /** - * Logs user into the system - * - * @param username The user name for login (required) - * @param password The password for login in clear text (required) - * @return Asynchronous result handler (RxJava Single) - */ + * Logs user into the system + * + * @param username The user name for login (required) + * @param password The password for login in clear text (required) + * @param authInfo call specific auth overrides + * @param resultHandler Asynchronous result handler + */ + public void loginUser(String username, String password, ApiClient.AuthInfo authInfo, Handler> resultHandler) { + delegate.loginUser(username, password, authInfo, resultHandler); + } + + /** + * Logs user into the system + * + * @param username The user name for login (required) + * @param password The password for login in clear text (required) + * @return Asynchronous result handler (RxJava Single) + */ public Single rxLoginUser(String username, String password) { - return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> { - delegate.loginUser(username, password, fut); - })); + return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> + delegate.loginUser(username, password, fut) + )); + } + + /** + * Logs user into the system + * + * @param username The user name for login (required) + * @param password The password for login in clear text (required) + * @param authInfo call specific auth overrides + * @return Asynchronous result handler (RxJava Single) + */ + public Single rxLoginUser(String username, String password, ApiClient.AuthInfo authInfo) { + return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> + delegate.loginUser(username, password, authInfo, fut) + )); } /** - * Logs out current logged in user session - * - * @param resultHandler Asynchronous result handler - */ + * Logs out current logged in user session + * + * @param resultHandler Asynchronous result handler + */ public void logoutUser(Handler> resultHandler) { delegate.logoutUser(resultHandler); } /** - * Logs out current logged in user session - * - * @return Asynchronous result handler (RxJava Single) - */ + * Logs out current logged in user session + * + * @param authInfo call specific auth overrides + * @param resultHandler Asynchronous result handler + */ + public void logoutUser(ApiClient.AuthInfo authInfo, Handler> resultHandler) { + delegate.logoutUser(authInfo, resultHandler); + } + + /** + * Logs out current logged in user session + * + * @return Asynchronous result handler (RxJava Single) + */ public Single rxLogoutUser() { - return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> { - delegate.logoutUser(fut); - })); + return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> + delegate.logoutUser(fut) + )); + } + + /** + * Logs out current logged in user session + * + * @param authInfo call specific auth overrides + * @return Asynchronous result handler (RxJava Single) + */ + public Single rxLogoutUser(ApiClient.AuthInfo authInfo) { + return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> + delegate.logoutUser(authInfo, fut) + )); } /** - * Updated user - * This can only be done by the logged in user. - * @param username name that need to be deleted (required) - * @param body Updated user object (required) - * @param resultHandler Asynchronous result handler - */ + * Updated user + * This can only be done by the logged in user. + * @param username name that need to be deleted (required) + * @param body Updated user object (required) + * @param resultHandler Asynchronous result handler + */ public void updateUser(String username, User body, Handler> resultHandler) { delegate.updateUser(username, body, resultHandler); } /** - * Updated user - * This can only be done by the logged in user. - * @param username name that need to be deleted (required) - * @param body Updated user object (required) - * @return Asynchronous result handler (RxJava Single) - */ + * Updated user + * This can only be done by the logged in user. + * @param username name that need to be deleted (required) + * @param body Updated user object (required) + * @param authInfo call specific auth overrides + * @param resultHandler Asynchronous result handler + */ + public void updateUser(String username, User body, ApiClient.AuthInfo authInfo, Handler> resultHandler) { + delegate.updateUser(username, body, authInfo, resultHandler); + } + + /** + * Updated user + * This can only be done by the logged in user. + * @param username name that need to be deleted (required) + * @param body Updated user object (required) + * @return Asynchronous result handler (RxJava Single) + */ public Single rxUpdateUser(String username, User body) { - return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> { - delegate.updateUser(username, body, fut); - })); + return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> + delegate.updateUser(username, body, fut) + )); + } + + /** + * Updated user + * This can only be done by the logged in user. + * @param username name that need to be deleted (required) + * @param body Updated user object (required) + * @param authInfo call specific auth overrides + * @return Asynchronous result handler (RxJava Single) + */ + public Single rxUpdateUser(String username, User body, ApiClient.AuthInfo authInfo) { + return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> + delegate.updateUser(username, body, authInfo, fut) + )); } public static UserApi newInstance(org.openapitools.client.api.UserApi arg) { From ffac26facef90e304767eec7ad925c8b33f4bc62 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Wed, 8 Jul 2020 16:45:30 +0800 Subject: [PATCH 006/129] replace x-additional-properties with isAdditionalPropertiesTrue (#6886) --- .../languages/PowerShellClientCodegen.java | 5 ----- .../resources/powershell/model_simple.mustache | 16 ++++++++-------- 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PowerShellClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PowerShellClientCodegen.java index 7f166b6a241e..9c92c878aee3 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PowerShellClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PowerShellClientCodegen.java @@ -953,11 +953,6 @@ public Map postProcessModels(Map objs) { model.isNullable = true; model.anyOf.remove("ModelNull"); } - - // add vendor extension for additonalProperties: true - if ("null".equals(model.parent)) { - model.vendorExtensions.put("x-additional-properties", true); - } } return objs; diff --git a/modules/openapi-generator/src/main/resources/powershell/model_simple.mustache b/modules/openapi-generator/src/main/resources/powershell/model_simple.mustache index 95310597e615..8e013e386d90 100644 --- a/modules/openapi-generator/src/main/resources/powershell/model_simple.mustache +++ b/modules/openapi-generator/src/main/resources/powershell/model_simple.mustache @@ -223,24 +223,24 @@ function ConvertFrom-{{{apiNamePrefix}}}JsonTo{{{classname}}} { $PSBoundParameters | Out-DebugParameter | Write-Debug $JsonParameters = ConvertFrom-Json -InputObject $Json - {{#vendorExtensions.x-additional-properties}} + {{#isAdditionalPropertiesTrue}} ${{{apiNamePrefix}}}{{{classname}}}AdditionalProperties = @{} - {{/vendorExtensions.x-additional-properties}} + {{/isAdditionalPropertiesTrue}} # check if Json contains properties not defined in {{{apiNamePrefix}}}{{{classname}}} $AllProperties = ({{#allVars}}"{{{baseName}}}"{{^-last}}, {{/-last}}{{/allVars}}) foreach ($name in $JsonParameters.PsObject.Properties.Name) { - {{^vendorExtensions.x-additional-properties}} + {{^isAdditionalPropertiesTrue}} if (!($AllProperties.Contains($name))) { throw "Error! JSON key '$name' not found in the properties: $($AllProperties)" } - {{/vendorExtensions.x-additional-properties}} - {{#vendorExtensions.x-additional-properties}} + {{/isAdditionalPropertiesTrue}} + {{#isAdditionalPropertiesTrue}} # store undefined properties in additionalProperties if (!($AllProperties.Contains($name))) { ${{{apiNamePrefix}}}{{{classname}}}AdditionalProperties[$name] = $JsonParameters.PSobject.Properties[$name].value } - {{/vendorExtensions.x-additional-properties}} + {{/isAdditionalPropertiesTrue}} } {{#requiredVars}} @@ -271,9 +271,9 @@ function ConvertFrom-{{{apiNamePrefix}}}JsonTo{{{classname}}} { "<>" = ${<>} <> <<={{ }}=>> - {{#vendorExtensions.x-additional-properties}} + {{#isAdditionalPropertiesTrue}} "AdditionalProperties" = ${{{apiNamePrefix}}}{{{classname}}}AdditionalProperties - {{/vendorExtensions.x-additional-properties}} + {{/isAdditionalPropertiesTrue}} } return $PSO From 850c958d83b32de9f2274349ef3a111631fd938a Mon Sep 17 00:00:00 2001 From: William Cheng Date: Wed, 8 Jul 2020 16:45:47 +0800 Subject: [PATCH 007/129] add splitit as the user (#6887) --- README.md | 1 + website/src/dynamic/users.yml | 5 +++++ website/static/img/companies/splitit.png | Bin 0 -> 18953 bytes 3 files changed, 6 insertions(+) create mode 100644 website/static/img/companies/splitit.png diff --git a/README.md b/README.md index d7a3dcb45dd0..78759e30a8e8 100644 --- a/README.md +++ b/README.md @@ -629,6 +629,7 @@ Here are some companies/projects (alphabetical order) using OpenAPI Generator in - [REST United](https://restunited.com) - [Robotinfra](https://www.robotinfra.com) - [Sony Interactive Entertainment](https://www.sie.com/en/index.html) +- [Splitit](https://www.splitit.com/) - [Stingray](http://www.stingray.com) - [Suva](https://www.suva.ch/) - [Telstra](https://dev.telstra.com) diff --git a/website/src/dynamic/users.yml b/website/src/dynamic/users.yml index 8a3a90cc1f8f..96283d568631 100644 --- a/website/src/dynamic/users.yml +++ b/website/src/dynamic/users.yml @@ -328,6 +328,11 @@ image: "img/companies/sie.jpeg" infoLink: "https://www.sie.com/en/index.html" pinned: false +- + caption: "Splitit" + image: "img/companies/splitit.png" + infoLink: "https://www.splitit.com/" + pinned: false - caption: Stingray image: "img/companies/stingray.png" diff --git a/website/static/img/companies/splitit.png b/website/static/img/companies/splitit.png new file mode 100644 index 0000000000000000000000000000000000000000..ddef072e45902fcd62114ac7e3f35d6e38a3df8c GIT binary patch literal 18953 zcmZ6zby(Eh^FNFNg3_pTr{qdYOE(Bemvo2Z(n?5oNlS~AbS)s#xzgR8ORs>y^Ip8~ z@8|wK7k{wV?!M1CGv_rkubDGv!`>*%U_Bvuf`o*GB_}JXhJ=I+MnZakg8m42#|tlc z0r>aGL_tOp=??MtrKKnV2}!P1PEzbGc=jOkG5DEA-3QvM`R@0;NvW}}8XhE0kqi&! z`QEg`|R;riqQ{dEuFTW!&($G*&L*RVoNgF5fo z4i@)e@SlYW3*naCF+M}>YR|>bZV`lv)4y#l^M_PGe)hIS=415+dOU7D#Wg}mNZYU1 z*4HJod!{(M)`sLchK!j$aR_$318688SR8)N@K|7^5-wP38SMvuqk+VL_U35jYlzpyZC zx_9mPQg|`lmx4=$&cQW&r7XU}C~QzC1Oo*J3CX0ppPzD~-rT|O_^MtqSHwrkVkrZ+ zaW*tt7+IUw=HN=|DPIzMR^|DyMnQ@4`cqV-53er=0&d8tWF zxqadIUTR>Uab1#!78bvl^e100Qq;FPcbl@b)k(>r<&?-le3n*kT(S&qRszD(8Rit^ z2Kq~%{_cE$v}{FYt+P=nPZofNgv4RmcXlvD*ivI1DJ;R4Q{f$SXc??>aW&-YFmw@~ z!iQDgmCW)0iAscjv`RkP*pFN;PT~j<*Gr9&OZ&9Dj3xVIxoY8<##JU_v{hqruPO#g zu#n_ZU*Hssgwzlt%U&W0eErA!URd17Z8Ea?{s;;uU7!d%jq3$jwZ(qvDJ%#u%yQ_nLr*!oFJOmmiwqMyfMU;4C4 z>xUsB;h9~Q;y`uJPBsb6L>IJr^$so$S}s>-c@zrmTOvvxBfSRs^tGO9BncRxsss(u z{uElZ(h>6~q4^kLR(D2u(l)jBEl8WQ{9Tx;zV`c@-+xX7ySKFJn3zf%3h3It?eykW zC0LXHiZ0-)pQj5`BcLc=BzwPaJat^1;-nVv012r*g0G!R>2!+54X5|`u=Kz)e48x^ zy8f_SF_dA=TZ@;8=_{F<{+r6p-nFKaif%$p#aPihU$EwLg?urCQkoLOjl?0T>MS3) zOAu>#wHI>AenJ%_$FWBYq=cwqE|7MyuPxO_5Anq_M_o!n%gxRsYpac2?`V z)$XtgOx-HN6=zdQ4hOfQUua%RIc86=ZWg zsv>Y-_XDx=w_n*fZ@qY*m^RhYMkL>+O$L8{2diYsuDRS{k|;JPIvZ7DA`o@lzhd6q z0l*0sc#`ESRJG-x6FGc$DjgQ}LJp-iwz>b0Rn!KZ*udcEWI@kZKdwfy;?m?NHMFZF z?eBZo>}+#`dQ?bAC@Q4wr=-#;+F5M|3Na$nE{F{8s6yzcV^Z#`EG8OW-vomKek8(ca^oEOL_BaeQ{QROkJ;QMztmp2_ zW7fOCu@>ghmhVS_SVsJE!9>L!27i`;a&2H{V?xPAFSoL?a^mQ7Hg%yz*0=^^8kcH& zj^t_oh6~rc<(V)QGqUq+?dTbKjDbe>9Cy~#%7csIXUsA6Gmsk$quIA6mNFaINJy`b zGNh9&4Oh(sdojn^j{SzbgtC_M!9qj%K9aU=)&ya_N&P1i%+}eC(Y3-0FTjAaWe>gl z%+|JQm{sVcI34J%Q^nV(To!ZIX$iSK`=+8fJd@Q81hx;${LEkqm_c-1aL+y-&Q!sT zC*KL!=fW-nYPuQTi6v^q%WiV8Bi)`bitf<`8Gi5Q`EjnIZxr&)sISpbSM5zIy-|qV zAhD6QCrgVgn>MHA9)ER6#Vt`EHN!%itI20h8KCv%INw&X+-f4MtA#~P;Yq(<42TsJf11u*sk-_r zKl(Dsep@O!?weNqrV>emE2Xmp*;~i1G*Q0}A;Caq4|HG?2v09Khm-+h7h0p=hBv-kljuxLak z{vA)18Ga8g!l!t+%xoq!dILI!X#aXqIYO*FEPEO6vqcR?UmW?Y`_}DSWSogEiAvmI%Np{GLVUaKsW=~?{3FgpR#lNkH=*~f;z4c3hXm| z#h2CK7twu-qPAj&c=-}NQBvDTt>Gx9sU9tWklGBo zfR7UVRY8%oZk6;}>Oltw!aMW)p@5Z%bo>!8*|JOP(4(WXS^&_oOP#vs7{{SuUnhS+ zW~9xpJtgdcZukuB{pZsq`V-ZnST&M}B8SH>pCJ~JXg@%=^ys*Ml&QC+V zK8r6v3yqn<-pfQtYA{Sd+FCWK)^)fJgXj|?bfwiEpjL@Ge(Ch#4}to}3z^6G7_e~p zfvyx!FFHFr)fe3DslhOG@Aq9W(`eP`kttfH53gA++!6(`_O?=RKj1@xne|u73l8Q4n(ikB2Nj2-w2C zFl6cs3YAQpHpjEDYe|s71r!ys445tj6&U;b?}?#I1urccMoG!lA;PKh&0}N$&xlX& zXJ^f>J($;e6!$hbR1q@ne|($dQde~R`vI_Di0RvrQ9#{x>~lUa0oa`Xoy(;|nB#5VKfHaz7Z%?J- zDo6$hfd5mlI_=lSmlo2>+UQ2x+ssfr#Q7i4v7BO=?Oj_;05km?X49@-j0WLW* zljpQnM$;!kvY0$(UQdmsQSen&+Pe15?Nty@Vb7nh6ng^z-PGgs2x(sfvc-S*9YR$7 z?q|0a-iumOJ1DB=@+yTJ0R)z}c4<&XT^|#!J2@l;vM1@t`+pxnAe!N#WHttv4cXC` z*TmVwDTw{RTsV%0KDS5UVC4ByIpASvVo3hG#=&_!SWC?7VshH%#NcWZX^ErOn5-%6 zI%zjgE}9-7gR{ksA^z_JiW4Pzr?@Z9Y45Jk@|ZoAWI`+qO3`3sq{^FWbEZjzkLEl( z|APoZQ-otI#L_#)dRX8tlzEeulu8jEw(Lu}P`>LZyyQ8|L1~LHNW1RIf&br=%!Z5H zWFOUpP6o=@wJxHH=gIY7+WCj^%hf9_T9sVkEbB&$Q}_)#FlwSexn%%;Gl|O#AZGlv5VQf((y^zC4W0_V$$+8Nl-|e&!(-3YgF0ews*LA;(&WXsAWv^h(K}v6&|p4`z;R40}F6t z=t~hF$I9BXb2t|`zae1Fd~#h}=XO#d$R^q~R`5COM_Z!y3*<9PsXxwk#I*%)uRp3g z_cuBlW*0y0_E%F^SBadwoE6nGq?u=*n)hL>U~DsHueQt=rhq!)3c)e5pj+2Ty6~Bm zj`aN&np}{oS)X%Iw0-@fDa~sWRq*^Bc-oBX4CsFsIz@@C~gvPibE2rHLwJug7@#}AP4`joZG3`j}3DQSJP z>LMw%S8eUI_I*5NtG!P6$7PP@S-{RWH@Y#FY46?4Ec;sOo0j=26nim7hB0Yzg?gB> zYphZ50aJ78d11fK4zGI1Qr(AxIxWg(qv^^VLm(Vm;I!4deAV8&Z?7hVz2EGmxcX>j z%Hv6ZRz&Pga-2^wl{ed5FZAa1@yA+L9NxofORxKIKpTBzM>ZV#u-zqNr$f^(O0t+V zuNhh|khP>i+P>#^{vq4X(bC=K0_F*MA+(%e9vRR#4*T_TnSpDZ z>zl!|AsGA8HI_;(H;9;>Uh^0 zgwunhUG?h15I(|id`;r{;rZjsh;nA87mfxgFW5^P7Q;+I_6A-)1~E6wvB$2)W+)Y_ z#j+GyN_pGb3ekw9eMmO3=~#bwPt!tLHesEaUvt>}Qs$P=I>*<3Oi({mlZnb*j>%6D znLhIf+HELU8QJ3c@_cZ73>P9{B36c$_-RDa@MWn}pWDg%pp+6CM4&A4{2Ke&+DGhi z4v#3Jb*r;dh3%WbbDZCIFW6Y&lMTn3gR}45t(TZdlvlRj58YhRX*T+8L+_eve%xYj zq3M0m9*)&)y9G&VKa$@%B_}`P=pp0`rL>qbmN@e3eR*lkrYwd38;rrzSLab0c!-A2 zE!!S_uK`8;GW|&4Rb2S{;3Pg^rbVWiR}s?cd=$1^s-%qrK(w7`)k#Uaxvp8hZB`T1 z&qPv2|4AaSD9gH%7_g6KVYl1$`&8W#cMYDcGv;D7-*5~v*V!`D!r8@i(dQnJx#s~z zO1VkictR*3HR=KG=JAGOLvL`G2X|U-;i7F$l8am`Z@|>vEOpNrY%Y9#!PEVsz)CAJ z*~|;#p%8M4mFXafrtQ5iYi9Lo{3#+xLWm&y$DacM zSb_qM?V?B=`fAENMznXkzszM#NgoOrjLg|+mG}na`07}HEZo*Q`;OX~rTV2hO1?B2 zPMaDZ#3SVJzX1tE0Ab~e($89XpVIj(7Vt?FhrpF{ zLM0N_!@9i&7GAx(UK)40cXw)-zK)ZP3+itwd!HI&TYh%gvC5<8T};7+P+nw`+b@ID z1>tiOb_}58YRElfVXD=?7A}Ihp+Gf``=GqDn^i-MDoy@7A|wh!+rDERvxAEpwIt8N zva7EbBXf=N%;GwR7oRJit1yxdVV&LJLXJcdm}H(k?)Y8QlE^c>w3t0h} z6|ACZIk?%57-d(XPhmx!LFa?ACa?s(vs+jrqj|1Y6izZjmdS6~Y6o@Cmr3~7gMSF$ zE1+vZKBf)8h#?Am#hjwD9l;C?i91gepRcWWciYl>v`3tlUMSJFsl2&ZZwW4(pdgmS zE>d?hdZg5a3KeMJeRn=cKGmBuHK=u>_J#U>jqlHBewl6}?0cOdfSFRjB#wS0r{L1@6WmKNw`qIm{=`+oSQ`liEFbvy3%bh-f?jnQ#uHWc zR{W+CH-*R0dg=ENtvz9J6w0s67y7B2FQ3y3O4*3^JxgtAK71hK=V+0zoUPi}K}*_@ zU5M=F|40c1npD|cOw;=pF`Oged_b~J!5^bQ%jI5Smp9+1MBHS@XHuXn1m4mH0-UQ{ zg_E(1rJuhQw1w?Zm^f3=?1!W5R%HbC_zf{Po={5R8@{3F`_UTzi10yh?qh+rfaM&j zY?1&61B{%-N!7z1rNVpQLG-PkPInV_!FAt$rg7w#)5sXiH1sUnH3_`%&utI{??3?+ za*zYM%ay)lNvDu09S^&`yH4bFo~o7d=ZP+`{*F{8_>9J@+DHe~~Fy zL@bJsK?}B{e;>rMN=%K^)JB;AaR{GVh&1kEtjkCB+VW`URiWd2rO#lUC^gKoX8$r4 znGLL*Lg(ThF=OCDkvKg&4)f(fjvTaY;$}4|)wpJpfY%>s z*?7vxShW4wQ?0dJn5wYbF56f!G4=cCvySVuPO>oO%VrOH_pg2w#l^*pG+@b~HS>E^ z=^GGi@FKAOYQWN=jiS+6B)ouC{BR?97TxgHO=4W1H;rOGAu0A;^zr-fP*ra%ff`3T zhMDV#KNKpvm9lXL0k0R`dCxqBrl#-OdY6zcuf8P)O%qfg#GmRh6l7t)H+KgtN5}hF zk}B*xG25L*KFy2B1EH&>lnQdEJh5h*P5@?!Ms*DMNj^g;5;IfueyzJLvb!;R;Y&Nr zhr&oRf6s^-S=b6m5!$5z zFO;{c+^j)fUB|rN_UMtbJg&?|j_#M1lfyEZr#Sxu1bI$9cWmfM*t;eUV9N;!`!t#F zP2a_y6|fOVC>J~!UPq%dEWIQuS{OBdZspm=-g6}enaOOKR~-^B-^@jn8ZsRyyka<9{VYbyKIUy-q!2@L+E0f&#ZV>F`xuu{~IQyCRpqO(csq1jir{%68kxYlbHo>i?7LSP5 zxr+NLkCYhmt|ySsm?E4OkY~wk-7;Gp*W`}&qh_BRl9Lom&3Ot9nLTo7AUjQ|9r|L; z_(AL_)M_}07Qt$^Mz8fQVt|*1o!Y$Dfef8z~U7K^vu z0rw0e_%}LcL`X<&c%Tk3?u{Yb{kid15HV-Ox{rt&N1z26dKPOsPgX5lanjl1npuZg zXeR4{ix}r8%X_TcSAAe#S<@PdpUs5(M($n}0(8t$$>N8&<`jVx$v~#0w3AB4;4+gI zO*;WjeN6@Cp>lF+9xHzZ8?*T@*UDvIQ^Km4w+o%03}H!}M+U{7Eu~*^3h&X47<>p7 zcCdO5qtdU8S>zM`IXXxrlYSPvXL+3Oa>YxLlGv3tK0f}mpw;lAy?`KN@C%}DPhVl0 zSGhEpe70*|KYQ4bU|wu_@5}D1OpAC-q_ytCKcCNm8N9u~nu-ye$V!4b?GY#X)L{ED ziDv!VQW3)u>{G0I-Uc>|D(bcbHm|xfVB^A|>jkg(wsE*yg0C#bxE;h0zV*Iv0-@#f z{_RakZBQAp8sJ=_5aBl~t9pBm(;$9$>)&YIBUCT)b!>O)F1RZ7&gA7g4=-uxj;T|~ zvgcM$6~Wu{R(Y(aWuIgIsYn4!UBpX86wYufrn@@eiB_}{2$F%#8MwvJo?yme)O0Sk zKtsKP5{yP_G!xj3^7<&6Y>oUYEjT0d=50rv7aHK~|5;jeZ;gzWPXxG&p?mYbQjimc zxlv2D&eM)7K~+r^_Fv)mOa9Tg#kT?xycXkW+u)Gl(vl!Je5fRX>7Vb01V zf8>&>xPSf@_1iUeb#I2y-J@-}0L{Jm*qAM_wU~r)Cf4`O;vx-m)Cf-sMph45!77z} zw0)XL0X{_KKfAYrT7eTlcu<9&S+QLP-On88ry;97x@`P-=Qh`&`^ZO)P*hA><|rmP zxAzVK_VOxOVWC1yBnIZp-?gU7Uxo^!_5M(5Lt6Lhjg4f2Z|Nq%Ux5C_sR@~>*I>PX z;V&i9l^wsK58!w~@6=7dsi9?0AAjeZW%3$W@1M7=1Oti#Fy*<9Rx?nC&i?m|6QcXT+OR0{W*T^0GnyVpJ6^=9S`l zElGaV`nr)Io$>}d*#)PPR>2lwpC<rpxO6o!(B>p=@#<*;OCwunxN6{F5wUTwkrgjc(|FY=(LeWY~tpU*a8!K2*awcCLN+d4hYY zzcHUt&BG}_xYczoa8CKhhtdfq_dY7?8nYEesiW05M~W`tj{^7*$#cre z!Tz&V#;F(E{h8=e!{RL8?m_@c~oG+S0*R{4-~&&7~Ha6$={6VK-zMT|w*W{78ak2jy3 zRxZI^5*@3*)X_XO*f6F(Y4?EX8fEE!LqR%DE*j1;;_A|5fFll857u1P0MZoeLR6N8 z+t(>AQuUk(gk6g16plbj6Ceymvw&zgLL2{eKZxLw|MsVPsNT@uWS&)w$tr7tj?lBj z(}w~F#|@~CmO)>(N%!W~f}rSB;Mo+p2HimMEw2A?pYN>Mt>+ea&zsm-CwA2^gq`exE2j7#?cmrXG%M-xtj{z2;LRI2N1qCn5br*gjT;y=YIO zZv@m||AibZ6vE@RAWwI=oughA51gooP1+dXfL^|$#;!zTk3YOCcFM(FXLU}+#&U_{ zb`(ZYX(onvb2rpc+~?H)P$4y-OAnpyu=m(3q<9uxKIF7n8%Wo}ODDW8xQ?X7$!K$( za$KDqX)N&;SdyZat?SV$N=~MdtS|o0hH)XZRc2Qgo1yb@12nEpx%DE|9#b6NT0N31 zdQX3_pUtZYGzX*WO0HsbyuAIeY^}jy{QZOrTsZUiU(=B|itfK}9C8im4)ll~kydtQ zAE@W#a*nMLcx?6UTGRo1Viqdk}9JQCY_Q+&jhcrcVYUCPpqFG(_ zm<=Ca892QzG6Z*PoYS%R-KG9-4e;vwKFQvNk3a%0OG>>XWs(#styx{FK2o1%N~oA} z^SZtle;A)w+b6h}++HWMf3(&-p;`FZwk@hxrSvBDM?*lelqM1q%@*ufNzELgM78a2a+O3uA#z%Uvu zO$B<8frSRch|&y&Qyyj;5hA7tSMH%!RE-irM8^JUfbH{U-spRW*GE5(#ke2g0>wDg z9@9TaUkS{y zQ?Vg$>j><>51%~|$gaQ(C}MZcNEkQD-SK_+@4_UGYzF7IChcOh8c7%K4|fUeCG%|~ z{Lpo{QDBhQqOPpF$OQ=pGcCxd1uYt*m4^|e?Oc)mG+=p*MYLVeInTrYXLQBBhvS3(+WL+D#(R<$ZPfFL8)JN5-Pyr|YwMR+&9-S5J_ph*3#+ z@aI2NSIaax+5Xl|h<%IK#8jbUm^YeciJ0SYGyf>JCx=A7;UFpaxP5uUNIqS^m6>PE zpo9}pG#?RY$7aKnX7M)RHISzm3Sne{`lfJ!#p$zvc^zZ)+FnwiIKJD%n+=uO+Vo|L zz)c{A{IWWe1JTiLZH)4Re#x9fD&Prql~Z@S@6?RNgT55i4uQaa&g) z3?Wq3nT}YQS9?iX)7rS!BhbR0K>GlwzKI(&TEzOZHc=|nIzRYu@=|OA4jztEwlNiA zt{3%iQ5&#kvy>_l4CX$+^L&Qlkf_Q3SWDNy8 zCN%% zer_3vv4==a%LyUoF7tg*CT&`qxWms$^)au7Gy5WHJotlALZgl z89Bjp)T3sgUoo^yT`|CTUZ4?fieKAVbBv%>U7)a)Re}oLMD)>&7#w*S6sZ7Vy-c=r zRn`mzZgZO@mR+k{kq#ZU7*rMAAY!FU?J`^T?QPf7t6jke_}go(+PFyUEsr?g0E0L- zON*n{iA(B<7fi)sYyy>c{gK_V-Je$6^w1`OzW1&UJInz1X$GRyY4+i=$(_pst>4BK z!SHV2%hpNb+t<^eo3$ftx>tzzdOq`cEpU==ls9~t?{B#$28mKmYDc$urxN{J$NK6; z^gx@w#v?R7I;&P34)FuLvi7MgSsY~^JjjAty3^b6o-x+RDKUu(xV$y|K%hUhy6_M{0!^cOcZnMLTqGyc<_bdTB6oFKy)Np| zJnJ%d+uG*R zaWxDWiWBR|aY*;VeoNoAn}MYfM+Y^8knSkbyHWZ8!Z7nGa=>w`FeMKz7(;}d`a}#+ zDz+G zzIqX`CEm_bifOfgi($0Lt%=s?&F)bLc);qk_1=>~AG(1Z;&FxM%!0<{E}QHT#+BUK z!b`a9FhnwR?WZ?=qJi_)5OALV+}(ZJU%@UBTEF{))8w?{Xi)^-x&eE(myW2NmX0Sx_{31G zi|T;Xv~S#=yqoYFi$_eouMTPDHrSZ2#I$-CJ$VdBBnnQ2i+}x4Om4+`Rik_OdCKOcbAfbN5ZtYm@;U64X!2(Vg=|*AJ*vQ| zJ-Wy8d599LtxNgJ!_9aHqvXc3*lazEqWCG3Uk;zwaD{Rim}WBj-$fuc%9ohY{82+2 zPSDM~^wId2nyFkDnrgHPlK>VJ$C(T`Y4K+#^P>aW+PHA#6nGuym_%>V6Jl^KJa?L@&M546GL%ujO*`U%IY%;m_2$HO@Nm6VN`4&tAZ28bC4rRdHj6TAun|I zS7`*V+DNUG=(>EImA7G!U`yL@{VV03(QYNN#>> zC7$0GS4aw_;_E6L?<6*JOkz((-U*{RTjz#S0|g*Qnb5hT%CDm_(TI~v|)xLW9UjaHcT5u<$1fFTW-ccYcHK{ann3cK)uh^ zHKEFW8@O%E8E)rPIKfVvFQ*d(P?`5Co${&Z)|u}Lg3ZbkvDX9zl#*=Ii1}#1ozPCf z3w%V?$)$Q(!_wzA`FcSQ=u{2N7>MruEqnO`g|BjZLn$wl0CK3cRHUjCgci$OYmzVw z&(8cFG^}>8pURf2Edun&NbS1|>^uZKQkPR#AItn{x0Z72FR>%PQHslr2%2?T(lV62 z1{6LHcq6<{fF2-ywgJ4HalWcJB@$!GvPo*!uz;979~hz+tg!m6m#2j?w2wa(oEAiw99c2UK>K;z# zP29*Pnc&&sD~?|-mar54c&#%s(`+>*D1PL+6k*CBI;ivD4D`?twtbL+lziMa?_gdU=;&1F-a+H zL}WHwG@$5oQSsEat;Z#rlZyor?MnOxxV?{^dwLOorfWO-B-hn|STnmCXjX2C<4vm z_CdlMd+|R{L>uK#G@CBgSUmcZah#ob9J$kY8?Il4Nc3v~vT`&tt32=1{P2mac(i@xwgVHF; zAod+|bDklouj7$&vmj_99R+4uQaIEklN-5xjJddSew$AGo0s&c z8)c@8?=TqbeAwcnxELHiCi&)w43IY)aUsR2aSLQkjTPNsX7%_4eXQm@&J@lAqKg5F zO3X+21(3~+Ldg&dSZ_ML6ms6r?%8p^1^DMK6${F#iO%EKW-x_IT_(5R78+Bl-kO~U zV#Nh~4f$W3Wwn=|^veuP@t?p;?8SusK#P5P;~pW}e5z!5x_#?~%A#JowtSh}c^N0nPj&%7#Cn1tQ!VEL50j4~ZS3 zo&3Ij?Z*ExYYJ;bn#!w=rZT*Lgefm!=M!3-YiNor8b_2^jcMhWC6T|&31aN%op`4$ zSNr6Cz;3eEKx|PxtNX;2DDCP_1faH6I8IVZsX zfS1ZB$l6!%=8nb(`Lb>KklhR6cS+v#c(LKn$sU<~4Z=~4eJcCCIn7I*tk;e665r_h#>QqhOkPenJA#DgQ1R4FkoLD>judO9k;Z<^1HnzQRgnpA|LEfhS#o{tU!1Zeq30Foc+SOuAnPVe^iV@@ z72Dr_E|!H0J$ORF^cC;IsJEKLko)EgbZg{OC!`*;Z27$PpByU@5uR_4?#(PiR7@E7 ztAwfv@e9rto0o@CUL9$UuURv2d3WTyT*iuB;hCn?j5rbNXB3}UhAs2cxfklp{(5=4 zUATn^i^aF`qph&{h8og#b<)1lRM#(5jjPq*mVvP(n}+i-QQ;dWw-c`#h!Lshw%Y+N ziu~n9YCEH9GvyfKw3Zlm{#``mproDYGDWn%LWrIjQ8%UQZ%iOHfzh?PwbveJ`c`lQ zH_;q?fbL}UEP|=x9+#*L%L3agvK^o~@tlc;STSKPypJyO#==waG=TUt5?(?^^wpP%gI3>vV6Bl=teR#65&tU!JYHV77#I%Lr17|T$@`57Wb@|&P!P`k*vqUW?7OVQ{AX>Xq9`foi`3i>^S@JQ z$OwBaJt{h5ch{d_l-LSRO5N^n=-c8z@?TO^n=cWh6I4<1EIL{V>g5QhmwC~>QjgBf z!nQXB1sB?0eO&Ve%E;?L2K zE`6B$;}1LqNJmA+d(Q+QIMmS|5!9P593 z^Fs*y9w(K0FR%2~b|MNxR^A#axv!9y2|M{G=$b84ZTn$zeL~Cr#~NW5hGS(n&J@}G z)ZdB%gYf*0j4eJ0Xl7t1pB7rjx7_So@m2`9z4zVHX&tgRr^9+M!>c3jQ!TmYG#$tv z!#9wHg?U$RZD@&8xIb8V;YJ+8<$~n&YakD3@@p=%{!L6>ZMovxPEjqHrS8&!Z}FLw zUZmWx;N((8s_g1ITf;J^?(U%byO7sl>d9Sc;C&PbhjngMS5 zaw|VYqoEacrm%>TQ70-BZ9*+V-XDa?3U|%oyOX ziN@M)FuhQ_c#jI|m-zA)nvqJO-;*b;v`?>cQg>PJzQyRMLpqD>v||UV>-v@TyasJ^ zMbz6TWzL_`JBRb9W3f3?ghSXH07*}P8?_&zBM$Ygf@H9zGPyKv1`XtlW(PK`iDg>qp(5Miai zj6*Z57ra%KB`6pXwM^i59dJ#}vd3$(Nx!3k4w<|c!^sFk5a*m1N`lmH!euNH-aYpq zK%DjgU+w(dJQ_Y6|KReL1Z$SdxfD1OO0F0-FW-NU$jP4hH2Qb@taKF;LlvLyN6u)2qw&UzCfBVoene01*Bo+sWv z-C(#cCQOYYf(RI$JRShf7PvzAIx>zm#AwRxb+)&TpW^Na&}kebWQ}W|_K0F-_#xn+ zkO6gR4;bhU-{2{Hr5<27Ehn}zH~PiHJo>9uhmqy_=OKFH)iLV-CMIfrV-L{KMOmC9 zLGC@9^TgCTSr zeI^H+&80la7pocSweHFMSAUhs%?vqnna>{RP1^|MS;E!^T7)P+s`*{8AF=h1a`O z_ElU+zEp9_yM^_3Bxb^ zGcH~P!$-11X5h9NfEKbZLyi2@`9Y!Y2G`3U0(WD8AABH=woRv)k4nVFoArQ;)Ia-Y z;1OQovnM9vk}q1D>$_SQU9=uhA%MJ$L_R8zK_7T>6Z%*cp3j`)3%5AqZY%+=o&ujb zh1LOI-LZf_z32WOSEda>UK!*S6c2bGHVoVi8K?G)Eu40 zyK@IA+k*xV|BhzS`=J%3m>N6Wk&~;6tAPtxn+Wim4Ms9mJN){lXzU7jww$Rgd>7D zfofMxm?>9vZ{6ay5Y6DrdCmrFFPxqV5@%r8`gDicbJn)>W$b0jk$h)wEN#EWdWm^u zOcz*I!0?tSuh^F4{uS*PL%@PSU0eA(pXSC5 zo-V2Om%=_jdNRpk=?-9g`ak4i0;>?U+!q`5z)^7Td4U~=&t7ZYclr#+xl_JpzZR?n z%Qu+a_n_Os4r5&oG0 zj7i`o(RVw)_si-}v(3`?;@wgD)`;o;i8#BfOU~QPd$00FNHEy=a?!uUZmsz;U}GJ4 zH%zzK=E;9Y&0Eerby@4Q?ugoy^FL1J+?;pf{I8q#`Z1p#-Ub#_{wXV;zAAfpQ~$Kw zp*I&q7aIRG0qbX2j;<&w9DSQ3N z>npGRw>8tYHPQLJCm?aQ+RfbCrkr Date: Thu, 9 Jul 2020 17:46:52 +0800 Subject: [PATCH 008/129] Remove JDK7 tests in CircleCI (#6890) * remove jdk7 tests in circleci * test microprofile-rest-client in jdk8 --- CI/circle_parallel.sh | 6 +++--- pom.xml | 48 ++++--------------------------------------- 2 files changed, 7 insertions(+), 47 deletions(-) diff --git a/CI/circle_parallel.sh b/CI/circle_parallel.sh index 3b9bb9760853..7f6efdbf94b9 100755 --- a/CI/circle_parallel.sh +++ b/CI/circle_parallel.sh @@ -60,8 +60,8 @@ elif [ "$NODE_INDEX" = "2" ]; then # run integration tests mvn --no-snapshot-updates --quiet verify -Psamples.misc -Dorg.slf4j.simpleLogger.defaultLogLevel=error else - echo "Running node $NODE_INDEX to test 'samples.circleci.jdk7' defined in pom.xml ..." - sudo update-java-alternatives -s java-1.7.0-openjdk-amd64 + echo "Running node $NODE_INDEX to test 'samples.circleci.others' defined in pom.xml ..." + #sudo update-java-alternatives -s java-1.7.0-openjdk-amd64 java -version # install dart2 @@ -73,7 +73,7 @@ else sudo apt-get install dart export PATH="$PATH:/usr/lib/dart/bin" - mvn --no-snapshot-updates --quiet verify -Psamples.circleci.jdk7 -Dorg.slf4j.simpleLogger.defaultLogLevel=error + mvn --no-snapshot-updates --quiet verify -Psamples.circleci.others -Dorg.slf4j.simpleLogger.defaultLogLevel=error fi diff --git a/pom.xml b/pom.xml index 9786aabd6276..dc7ebf7a3ba1 100644 --- a/pom.xml +++ b/pom.xml @@ -1267,6 +1267,7 @@ samples/client/petstore/java/google-api-client samples/client/petstore/java/rest-assured samples/client/petstore/java/rest-assured-jackson + samples/client/petstore/java/microprofile-rest-client samples/client/petstore/groovy samples/server/petstore/jaxrs-jersey @@ -1322,13 +1323,13 @@ samples/server/petstore/kotlin-springboot - + - samples.circleci.jdk7 + samples.circleci.others env - samples.circleci.jdk7 + samples.circleci.others @@ -1336,50 +1337,9 @@ samples/client/petstore/javascript-promise-es6 samples/server/petstore/go-api-server samples/server/petstore/go-gin-api-server - samples/client/petstore/dart2/petstore samples/client/petstore/dart-jaguar/openapi samples/client/petstore/dart-jaguar/flutter_petstore/openapi - samples/client/petstore/scala-akka - samples/client/petstore/scala-httpclient - samples/client/petstore/java/jersey1 - samples/client/petstore/java/okhttp-gson - samples/client/petstore/java/retrofit2 - samples/client/petstore/jaxrs-cxf-client - samples/client/petstore/java/resttemplate - samples/client/petstore/java/resttemplate-withXml - samples/client/petstore/java/vertx - samples/client/petstore/java/resteasy - samples/client/petstore/java/google-api-client - samples/client/petstore/java/microprofile-rest-client - - samples/server/petstore/jaxrs-jersey - samples/server/petstore/jaxrs-spec - samples/server/petstore/jaxrs-spec-interface - samples/server/petstore/jaxrs-spec-interface-response - samples/server/petstore/java-vertx/rx - samples/server/petstore/java-vertx/async - samples/server/petstore/java-inflector - samples/server/petstore/java-undertow - samples/server/petstore/jaxrs/jersey1 - samples/server/petstore/jaxrs/jersey2 - samples/server/petstore/jaxrs/jersey1-useTags - samples/server/petstore/jaxrs/jersey2-useTags - samples/server/petstore/jaxrs-resteasy/default - samples/server/petstore/jaxrs-resteasy/eap - samples/server/petstore/jaxrs-resteasy/eap-joda - samples/server/petstore/jaxrs-resteasy/eap-java8 - samples/server/petstore/jaxrs-resteasy/joda - samples/server/petstore/spring-mvc - samples/client/petstore/spring-cloud - samples/server/petstore/springboot - samples/server/petstore/springboot-beanvalidation - samples/server/petstore/springboot-useoptional - samples/server/petstore/jaxrs-cxf - samples/server/petstore/jaxrs-cxf-annotated-base-path - samples/server/petstore/jaxrs-cxf-cdi - samples/server/petstore/jaxrs-cxf-non-spring-app - samples/server/petstore/java-msf4j From 57bf9e85a1bb9340e8fda8748a9b36be4dabfbe7 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Sat, 11 Jul 2020 16:53:28 +0800 Subject: [PATCH 009/129] [Go][Experimental] Add the option disallowAdditionalPropertiesIfNotPresent (#6908) * add disallowAdditionalPropertiesIfNotPresent to go exp generator * update cache key * fix spring.xml with 5.0.0-SNAPSHOT --- circle.yml | 8 ++++---- docs/generators/go-experimental.md | 1 + .../examples/spring.xml | 2 +- .../openapitools/codegen/DefaultCodegen.java | 6 +++++- .../GoClientExperimentalCodegen.java | 20 +++++++++++++++++++ 5 files changed, 31 insertions(+), 6 deletions(-) diff --git a/circle.yml b/circle.yml index 04eb415803bc..78ebec264186 100644 --- a/circle.yml +++ b/circle.yml @@ -22,9 +22,9 @@ jobs: - restore_cache: keys: # Default branch if not - - source-v1-{{ .Branch }}-{{ .Revision }} - - source-v1-{{ .Branch }}- - - source-v1- + - source-v2-{{ .Branch }}-{{ .Revision }} + - source-v2-{{ .Branch }}- + - source-v2- # Machine Setup # If you break your build into multiple jobs with workflows, you will probably want to do the parts of this that are relevant in each # The following `checkout` command checks out your code to your working directory. In 1.0 we did this implicitly. In 2.0 you can choose where in the course of a job your code should be checked out. @@ -70,7 +70,7 @@ jobs: - run: ./CI/circle_parallel.sh # Save dependency cache - save_cache: - key: source-v1-{{ .Branch }}-{{ .Revision }} + key: source-v2-{{ .Branch }}-{{ .Revision }} paths: # This is a broad list of cache paths to include many possible development environments # You can probably delete some of these entries diff --git a/docs/generators/go-experimental.md b/docs/generators/go-experimental.md index 80e9630d6a2f..e4c738c0e3c7 100644 --- a/docs/generators/go-experimental.md +++ b/docs/generators/go-experimental.md @@ -5,6 +5,7 @@ sidebar_label: go-experimental | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | +|disallowAdditionalPropertiesIfNotPresent|Specify the behavior when the 'additionalProperties' keyword is not present in the OAS document. If false: the 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications. If true: when the 'additionalProperties' keyword is not present in a schema, the value of 'additionalProperties' is set to false, i.e. no additional properties are allowed. Note: this mode is not compliant with the JSON schema specification. This is the original openapi-generator behavior.This setting is currently ignored for OAS 2.0 documents: 1) When the 'additionalProperties' keyword is not present in a 2.0 schema, additional properties are NOT allowed. 2) Boolean values of the 'additionalProperties' keyword are ignored. It's as if additional properties are NOT allowed.Note: the root cause are issues #1369 and #1371, which must be resolved in the swagger-parser project.|
**false**
The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
**true**
when the 'additionalProperties' keyword is not present in a schema, the value of 'additionalProperties' is automatically set to false, i.e. no additional properties are allowed. Note: this mode is not compliant with the JSON schema specification. This is the original openapi-generator behavior.
|true| |enumClassPrefix|Prefix enum with class name| |false| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true| |isGoSubmodule|whether the generated Go module is a submodule| |false| diff --git a/modules/openapi-generator-maven-plugin/examples/spring.xml b/modules/openapi-generator-maven-plugin/examples/spring.xml index a0654ffe260d..2befe89eb0ac 100644 --- a/modules/openapi-generator-maven-plugin/examples/spring.xml +++ b/modules/openapi-generator-maven-plugin/examples/spring.xml @@ -20,7 +20,7 @@ org.openapitools openapi-generator-maven-plugin - 4.3.1-SNAPSHOT + 5.0.0-SNAPSHOT diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java index 1ee020cee2bb..fd949a0e9a9d 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java @@ -2514,7 +2514,11 @@ public int compare(CodegenProperty one, CodegenProperty another) { // process 'additionalProperties' if (schema.getAdditionalProperties() == null) { - m.isAdditionalPropertiesTrue = false; // TODO fix the old (incorrect) behaviour (likely with an option) + if (disallowAdditionalPropertiesIfNotPresent) { + m.isAdditionalPropertiesTrue = false; + } else { + m.isAdditionalPropertiesTrue = true; + } } else if (schema.getAdditionalProperties() instanceof Boolean) { if (Boolean.TRUE.equals(schema.getAdditionalProperties())) { m.isAdditionalPropertiesTrue = true; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoClientExperimentalCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoClientExperimentalCodegen.java index c52e87e65afc..a5434dedf139 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoClientExperimentalCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoClientExperimentalCodegen.java @@ -47,6 +47,21 @@ public GoClientExperimentalCodegen() { generatorMetadata = GeneratorMetadata.newBuilder(generatorMetadata).stability(Stability.EXPERIMENTAL).build(); cliOptions.add(new CliOption(CodegenConstants.USE_ONEOF_DISCRIMINATOR_LOOKUP, CodegenConstants.USE_ONEOF_DISCRIMINATOR_LOOKUP_DESC).defaultValue("false")); + // 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", + "when the 'additionalProperties' keyword is not present in a schema, " + + "the value of 'additionalProperties' is automatically set to false, i.e. no additional properties are allowed. " + + "Note: this mode is not compliant with the JSON schema specification. " + + "This is the original openapi-generator behavior."); + disallowAdditionalPropertiesIfNotPresentOpt.setEnum(disallowAdditionalPropertiesIfNotPresentOpts); + cliOptions.add(disallowAdditionalPropertiesIfNotPresentOpt); + this.setDisallowAdditionalPropertiesIfNotPresent(true); } /** @@ -102,6 +117,11 @@ public void processOpts() { additionalProperties.put(CodegenConstants.USE_ONEOF_DISCRIMINATOR_LOOKUP, useOneOfDiscriminatorLookup); } + if (additionalProperties.containsKey(CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT)) { + this.setDisallowAdditionalPropertiesIfNotPresent(Boolean.valueOf(additionalProperties + .get(CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT).toString())); + } + } public void setUseOneOfDiscriminatorLookup(boolean useOneOfDiscriminatorLookup) { From 6a49c4ec02444ee145f50de58910abb0b341eb14 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Sat, 11 Jul 2020 22:41:24 +0800 Subject: [PATCH 010/129] add option disallowAdditionalPropertiesIfNotPresent to ps generator (#6909) --- docs/generators/powershell.md | 1 + .../languages/PowerShellClientCodegen.java | 20 +++++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/docs/generators/powershell.md b/docs/generators/powershell.md index d3a39dfb6d95..03d638a3c8fa 100644 --- a/docs/generators/powershell.md +++ b/docs/generators/powershell.md @@ -7,6 +7,7 @@ sidebar_label: powershell | ------ | ----------- | ------ | ------- | |apiNamePrefix|Prefix that will be appended to all PS objects. Default: empty string. e.g. Pet => PSPet.| |null| |commonVerbs|PS common verb mappings. e.g. Delete=Remove:Patch=Update to map Delete with Remove and Patch with Update accordingly.| |null| +|disallowAdditionalPropertiesIfNotPresent|Specify the behavior when the 'additionalProperties' keyword is not present in the OAS document. If false: the 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications. If true: when the 'additionalProperties' keyword is not present in a schema, the value of 'additionalProperties' is set to false, i.e. no additional properties are allowed. Note: this mode is not compliant with the JSON schema specification. This is the original openapi-generator behavior.This setting is currently ignored for OAS 2.0 documents: 1) When the 'additionalProperties' keyword is not present in a 2.0 schema, additional properties are NOT allowed. 2) Boolean values of the 'additionalProperties' keyword are ignored. It's as if additional properties are NOT allowed.Note: the root cause are issues #1369 and #1371, which must be resolved in the swagger-parser project.|
**false**
The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
**true**
when the 'additionalProperties' keyword is not present in a schema, the value of 'additionalProperties' is automatically set to false, i.e. no additional properties are allowed. Note: this mode is not compliant with the JSON schema specification. This is the original openapi-generator behavior.
|true| |discardReadOnly|Set discardReadonly to true to generate the Initialize cmdlet without readonly parameters| |null| |packageGuid|GUID for PowerShell module (e.g. a27b908d-2a20-467f-bc32-af6f3a654ac5). A random GUID will be generated by default.| |null| |packageName|Client package name (e.g. PSTwitter).| |PSOpenAPITools| diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PowerShellClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PowerShellClientCodegen.java index 9c92c878aee3..60a72de9c9d4 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PowerShellClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PowerShellClientCodegen.java @@ -501,6 +501,21 @@ public PowerShellClientCodegen() { cliOptions.add(new CliOption("commonVerbs", "PS common verb mappings. e.g. Delete=Remove:Patch=Update to map Delete with Remove and Patch with Update accordingly.")); cliOptions.add(new CliOption(CodegenConstants.USE_ONEOF_DISCRIMINATOR_LOOKUP, CodegenConstants.USE_ONEOF_DISCRIMINATOR_LOOKUP_DESC)); cliOptions.add(new CliOption("discardReadOnly", "Set discardReadonly to true to generate the Initialize cmdlet without readonly parameters")); + // 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", + "when the 'additionalProperties' keyword is not present in a schema, " + + "the value of 'additionalProperties' is automatically set to false, i.e. no additional properties are allowed. " + + "Note: this mode is not compliant with the JSON schema specification. " + + "This is the original openapi-generator behavior."); + disallowAdditionalPropertiesIfNotPresentOpt.setEnum(disallowAdditionalPropertiesIfNotPresentOpts); + cliOptions.add(disallowAdditionalPropertiesIfNotPresentOpt); + this.setDisallowAdditionalPropertiesIfNotPresent(true); // default value in the template additionalProperties.put("powershellVersion", "6.2"); // minimal PS version @@ -632,6 +647,11 @@ public void processOpts() { LOGGER.warn(CodegenConstants.API_PACKAGE + " with " + this.getName() + " generator is ignored. Setting this value independently of " + CodegenConstants.PACKAGE_NAME + " is not currently supported."); } + if (additionalProperties.containsKey(CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT)) { + this.setDisallowAdditionalPropertiesIfNotPresent(Boolean.valueOf(additionalProperties + .get(CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT).toString())); + } + additionalProperties.put(CodegenConstants.API_PACKAGE, apiPackage()); additionalProperties.put(CodegenConstants.MODEL_PACKAGE, modelPackage()); From 53950f8affc96f0e1cb4fe312abcfc306f9fb249 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Sat, 11 Jul 2020 23:09:52 +0800 Subject: [PATCH 011/129] Add a link to DreamFactory blog (#6910) --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 78759e30a8e8..02ce7c2736c2 100644 --- a/README.md +++ b/README.md @@ -757,6 +757,8 @@ Here are some companies/projects (alphabetical order) using OpenAPI Generator in - 2020-05-22 - [TypeScript REST API Client](https://dev.to/unhurried/typescript-rest-api-client-4in3) by ["unhurried"](https://dev.to/unhurried) - 2020-05-28 - [【使用 lotify + Swagger 建置可共用的 LINE Notify bot】 - #NiJia @ Chatbot Developer Taiwan 第 #19 小聚](https://www.youtube.com/watch?v=agYVz6dzh1I) by [Chatbot Developer Taiwan](https://www.youtube.com/channel/UCxeYUyZNnHmpX23YNF-ewvw) - 2020-06-23 - [新規サーバーアプリケーションにTypeScriptを採用してみた](https://www.cam-inc.co.jp/news/20200623) at [CAM Tech Blog](https://www.cam-inc.co.jp/news/tech-blog/) +- 2020-07-07 - [5 Best API Documentation Tools](https://blog.dreamfactory.com/5-best-api-documentation-tools/) by Susanna Bouse at [DreamFactory Blog](https://blog.dreamfactory.com/) + ## [6 - About Us](#table-of-contents) From a7446983e837c4b1355d7c15d3fc7c0d19094848 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Mon, 13 Jul 2020 10:18:43 +0800 Subject: [PATCH 012/129] Add a link to Go article in Qiita Blog (#6919) --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 02ce7c2736c2..0a94dd195a9d 100644 --- a/README.md +++ b/README.md @@ -758,6 +758,7 @@ Here are some companies/projects (alphabetical order) using OpenAPI Generator in - 2020-05-28 - [【使用 lotify + Swagger 建置可共用的 LINE Notify bot】 - #NiJia @ Chatbot Developer Taiwan 第 #19 小聚](https://www.youtube.com/watch?v=agYVz6dzh1I) by [Chatbot Developer Taiwan](https://www.youtube.com/channel/UCxeYUyZNnHmpX23YNF-ewvw) - 2020-06-23 - [新規サーバーアプリケーションにTypeScriptを採用してみた](https://www.cam-inc.co.jp/news/20200623) at [CAM Tech Blog](https://www.cam-inc.co.jp/news/tech-blog/) - 2020-07-07 - [5 Best API Documentation Tools](https://blog.dreamfactory.com/5-best-api-documentation-tools/) by Susanna Bouse at [DreamFactory Blog](https://blog.dreamfactory.com/) +- 2020-07-12 - [Open API 3.0の定義からgolangのサーバコードのスケルトンを作成する](https://qiita.com/professor/items/4cbd04ec084d13057bc2) by [@professor (Qiita Blog)](https://qiita.com/professor) ## [6 - About Us](#table-of-contents) From 1044c302930833b02e7558791dca48dbfc62f72d Mon Sep 17 00:00:00 2001 From: William Cheng Date: Mon, 13 Jul 2020 10:19:06 +0800 Subject: [PATCH 013/129] add cake addin (#6918) --- docs/integration.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/integration.md b/docs/integration.md index 8b5b2ca52195..d53882d9599c 100644 --- a/docs/integration.md +++ b/docs/integration.md @@ -27,6 +27,10 @@ Please refer to https://github.com/upstart-commerce/sbt-openapi-generator Please refer to https://github.com/OpenAPITools/openapi-generator-bazel +### Cake Addin + +3rd-party Cake Addin provided by [Lukas Körfer](https://github.com/lukoerfer): https://github.com/lukoerfer/cake-openapi-generator + ### GitHub Integration To push the auto-generated SDK to GitHub, we provide `git_push.sh` to streamline the process. For example: From 29183e0280ad597b4237f47d6847144f6484ffa9 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Mon, 13 Jul 2020 13:41:10 +0800 Subject: [PATCH 014/129] [PowerShell] support default value in models (#6920) * support default value in ps * revert changes to the spec --- .../languages/PowerShellClientCodegen.java | 31 +++++++++++-- .../powershell/model_simple.mustache | 4 +- .../petstore/powershell/docs/ApiResponse.md | 6 +-- .../petstore/powershell/docs/Category.md | 4 +- .../petstore/powershell/docs/InlineObject.md | 4 +- .../petstore/powershell/docs/InlineObject1.md | 4 +- .../client/petstore/powershell/docs/Order.md | 12 ++--- .../petstore/powershell/docs/PSPetApi.md | 44 +++++++++---------- .../petstore/powershell/docs/PSStoreApi.md | 8 ++-- .../petstore/powershell/docs/PSUserApi.md | 20 ++++----- .../client/petstore/powershell/docs/Pet.md | 12 ++--- .../client/petstore/powershell/docs/Tag.md | 4 +- .../client/petstore/powershell/docs/User.md | 16 +++---- .../powershell/src/PSPetstore/Model/Order.ps1 | 2 +- 14 files changed, 98 insertions(+), 73 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PowerShellClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PowerShellClientCodegen.java index 60a72de9c9d4..2d037b0f3334 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PowerShellClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PowerShellClientCodegen.java @@ -565,7 +565,7 @@ public void setUseOneOfDiscriminatorLookup(boolean useOneOfDiscriminatorLookup) public boolean getUseOneOfDiscriminatorLookup() { return this.useOneOfDiscriminatorLookup; } - + public void setDiscardReadOnly(boolean discardReadOnly) { this.discardReadOnly = discardReadOnly; } @@ -951,13 +951,13 @@ public Map postProcessModels(Map objs) { for (CodegenProperty cp : model.allVars) { cp.vendorExtensions.put("x-powershell-data-type", getPSDataType(cp)); - if(this.discardReadOnly && !cp.isReadOnly) { + if (this.discardReadOnly && !cp.isReadOnly) { lastWritableProperty = cp; } } // Mark the last readonly false property - if(this.discardReadOnly && lastWritableProperty != null) { + if (this.discardReadOnly && lastWritableProperty != null) { lastWritableProperty.vendorExtensions.put("x-powershell-last-writable", true); model.allVars.set(model.allVars.indexOf(lastWritableProperty), lastWritableProperty); } @@ -1201,4 +1201,29 @@ public String toRegularExpression(String pattern) { return escapeText(pattern); } + @Override + public String toDefaultValue(Schema p) { + if (p.getDefault() != null) { + if (ModelUtils.isBooleanSchema(p)) { + if (Boolean.valueOf(p.getDefault().toString())) { + return "$true"; + } else { + return "$false"; + } + } else if (ModelUtils.isDateSchema(p)) { + LOGGER.warn("Default value for `date` not yet supported. Please open an issue with https://github.com/openapitools/openapi-generator"); + } else if (ModelUtils.isDateTimeSchema(p)) { + LOGGER.warn("Default value for `datetime` not yet supported. Please open an issue with https://github.com/openapitools/openapi-generator"); + } else if (ModelUtils.isNumberSchema(p)) { + return p.getDefault().toString(); + } else if (ModelUtils.isIntegerSchema(p)) { + return p.getDefault().toString(); + } else if (ModelUtils.isStringSchema(p)) { + return "\"" + p.getDefault() + "\""; + } + } + + return null; + } + } diff --git a/modules/openapi-generator/src/main/resources/powershell/model_simple.mustache b/modules/openapi-generator/src/main/resources/powershell/model_simple.mustache index 8e013e386d90..bef6bd67a85f 100644 --- a/modules/openapi-generator/src/main/resources/powershell/model_simple.mustache +++ b/modules/openapi-generator/src/main/resources/powershell/model_simple.mustache @@ -41,7 +41,7 @@ function Initialize-{{{apiNamePrefix}}}{{{classname}}} { {{/isEnum}} [{{vendorExtensions.x-powershell-data-type}}] {{=<% %>=}} - ${<%name%>}<%^vendorExtensions.x-powershell-last-writable%>,<%/vendorExtensions.x-powershell-last-writable%> + ${<%name%>}<%#defaultValue%> = <%&.%><%/defaultValue%><%^vendorExtensions.x-powershell-last-writable%>,<%/vendorExtensions.x-powershell-last-writable%> <%={{ }}=%> {{/isReadOnly}} {{/allVars}} @@ -59,7 +59,7 @@ function Initialize-{{{apiNamePrefix}}}{{{classname}}} { {{/isEnum}} [{{vendorExtensions.x-powershell-data-type}}] {{=<% %>=}} - ${<%name%>}<%^-last%>,<%/-last%> + ${<%name%>}<%#defaultValue%> = <%&.%><%/defaultValue%><%^-last%>,<%/-last%> <%={{ }}=%> {{/allVars}} {{/discardReadOnly}} diff --git a/samples/client/petstore/powershell/docs/ApiResponse.md b/samples/client/petstore/powershell/docs/ApiResponse.md index 5b4baf95c1a6..057aa02b5428 100644 --- a/samples/client/petstore/powershell/docs/ApiResponse.md +++ b/samples/client/petstore/powershell/docs/ApiResponse.md @@ -3,9 +3,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Code** | **Int32** | | [optional] [default to null] -**Type** | **String** | | [optional] [default to null] -**Message** | **String** | | [optional] [default to null] +**Code** | **Int32** | | [optional] +**Type** | **String** | | [optional] +**Message** | **String** | | [optional] ## Examples diff --git a/samples/client/petstore/powershell/docs/Category.md b/samples/client/petstore/powershell/docs/Category.md index 921e4af15d87..81f0f234f616 100644 --- a/samples/client/petstore/powershell/docs/Category.md +++ b/samples/client/petstore/powershell/docs/Category.md @@ -3,8 +3,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Id** | **Int64** | | [optional] [default to null] -**Name** | **String** | | [optional] [default to null] +**Id** | **Int64** | | [optional] +**Name** | **String** | | [optional] ## Examples diff --git a/samples/client/petstore/powershell/docs/InlineObject.md b/samples/client/petstore/powershell/docs/InlineObject.md index 42c762d20221..8d5ee1ebe23e 100644 --- a/samples/client/petstore/powershell/docs/InlineObject.md +++ b/samples/client/petstore/powershell/docs/InlineObject.md @@ -3,8 +3,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Name** | **String** | Updated name of the pet | [optional] [default to null] -**Status** | **String** | Updated status of the pet | [optional] [default to null] +**Name** | **String** | Updated name of the pet | [optional] +**Status** | **String** | Updated status of the pet | [optional] ## Examples diff --git a/samples/client/petstore/powershell/docs/InlineObject1.md b/samples/client/petstore/powershell/docs/InlineObject1.md index 18aa07009d1f..01d5068fb1cb 100644 --- a/samples/client/petstore/powershell/docs/InlineObject1.md +++ b/samples/client/petstore/powershell/docs/InlineObject1.md @@ -3,8 +3,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**AdditionalMetadata** | **String** | Additional data to pass to server | [optional] [default to null] -**File** | **System.IO.FileInfo** | file to upload | [optional] [default to null] +**AdditionalMetadata** | **String** | Additional data to pass to server | [optional] +**File** | **System.IO.FileInfo** | file to upload | [optional] ## Examples diff --git a/samples/client/petstore/powershell/docs/Order.md b/samples/client/petstore/powershell/docs/Order.md index aa40bbb2b8c4..bb7a8650570b 100644 --- a/samples/client/petstore/powershell/docs/Order.md +++ b/samples/client/petstore/powershell/docs/Order.md @@ -3,12 +3,12 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Id** | **Int64** | | [optional] [default to null] -**PetId** | **Int64** | | [optional] [default to null] -**Quantity** | **Int32** | | [optional] [default to null] -**ShipDate** | **System.DateTime** | | [optional] [default to null] -**Status** | **String** | Order Status | [optional] [default to null] -**Complete** | **Boolean** | | [optional] [default to false] +**Id** | **Int64** | | [optional] +**PetId** | **Int64** | | [optional] +**Quantity** | **Int32** | | [optional] +**ShipDate** | **System.DateTime** | | [optional] +**Status** | **String** | Order Status | [optional] +**Complete** | **Boolean** | | [optional] [default to $false] ## Examples diff --git a/samples/client/petstore/powershell/docs/PSPetApi.md b/samples/client/petstore/powershell/docs/PSPetApi.md index 78129e0be7bc..843fd4ea73b8 100644 --- a/samples/client/petstore/powershell/docs/PSPetApi.md +++ b/samples/client/petstore/powershell/docs/PSPetApi.md @@ -77,8 +77,8 @@ $Configuration = Get-PSPetstoreConfiguration # Configure OAuth2 access token for authorization: petstore_auth $Configuration["AccessToken"] = "YOUR_ACCESS_TOKEN"; -$PetId = 987 # Int64 | Pet id to delete (default to null) -$ApiKey = "ApiKey_example" # String | (optional) (default to null) +$PetId = 987 # Int64 | Pet id to delete +$ApiKey = "ApiKey_example" # String | (optional) # Deletes a pet try { @@ -93,8 +93,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **PetId** | **Int64**| Pet id to delete | [default to null] - **ApiKey** | **String**| | [optional] [default to null] + **PetId** | **Int64**| Pet id to delete | + **ApiKey** | **String**| | [optional] ### Return type @@ -128,7 +128,7 @@ $Configuration = Get-PSPetstoreConfiguration # Configure OAuth2 access token for authorization: petstore_auth $Configuration["AccessToken"] = "YOUR_ACCESS_TOKEN"; -$Status = @("Status_example") # String[] | Status values that need to be considered for filter (default to null) +$Status = @("Status_example") # String[] | Status values that need to be considered for filter # Finds Pets by status try { @@ -143,7 +143,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **Status** | [**String[]**](String.md)| Status values that need to be considered for filter | [default to null] + **Status** | [**String[]**](String.md)| Status values that need to be considered for filter | ### Return type @@ -177,7 +177,7 @@ $Configuration = Get-PSPetstoreConfiguration # Configure OAuth2 access token for authorization: petstore_auth $Configuration["AccessToken"] = "YOUR_ACCESS_TOKEN"; -$Tags = @("Inner_example") # String[] | Tags to filter by (default to null) +$Tags = @("Inner_example") # String[] | Tags to filter by # Finds Pets by tags try { @@ -192,7 +192,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **Tags** | [**String[]**](String.md)| Tags to filter by | [default to null] + **Tags** | [**String[]**](String.md)| Tags to filter by | ### Return type @@ -228,7 +228,7 @@ $Configuration["ApiKey"]["api_key"] = "YOUR_API_KEY" # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed #$Configuration["ApiKeyPrefix"]["api_key"] = "Bearer" -$PetId = 987 # Int64 | ID of pet to return (default to null) +$PetId = 987 # Int64 | ID of pet to return # Find pet by ID try { @@ -243,7 +243,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **PetId** | **Int64**| ID of pet to return | [default to null] + **PetId** | **Int64**| ID of pet to return | ### Return type @@ -324,9 +324,9 @@ $Configuration = Get-PSPetstoreConfiguration # Configure OAuth2 access token for authorization: petstore_auth $Configuration["AccessToken"] = "YOUR_ACCESS_TOKEN"; -$PetId = 987 # Int64 | ID of pet that needs to be updated (default to null) -$Name = "Name_example" # String | Updated name of the pet (optional) (default to null) -$Status = "Status_example" # String | Updated status of the pet (optional) (default to null) +$PetId = 987 # Int64 | ID of pet that needs to be updated +$Name = "Name_example" # String | Updated name of the pet (optional) +$Status = "Status_example" # String | Updated status of the pet (optional) # Updates a pet in the store with form data try { @@ -341,9 +341,9 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **PetId** | **Int64**| ID of pet that needs to be updated | [default to null] - **Name** | **String**| Updated name of the pet | [optional] [default to null] - **Status** | **String**| Updated status of the pet | [optional] [default to null] + **PetId** | **Int64**| ID of pet that needs to be updated | + **Name** | **String**| Updated name of the pet | [optional] + **Status** | **String**| Updated status of the pet | [optional] ### Return type @@ -377,9 +377,9 @@ $Configuration = Get-PSPetstoreConfiguration # Configure OAuth2 access token for authorization: petstore_auth $Configuration["AccessToken"] = "YOUR_ACCESS_TOKEN"; -$PetId = 987 # Int64 | ID of pet to update (default to null) -$AdditionalMetadata = "AdditionalMetadata_example" # String | Additional data to pass to server (optional) (default to null) -$File = 987 # System.IO.FileInfo | file to upload (optional) (default to null) +$PetId = 987 # Int64 | ID of pet to update +$AdditionalMetadata = "AdditionalMetadata_example" # String | Additional data to pass to server (optional) +$File = 987 # System.IO.FileInfo | file to upload (optional) # uploads an image try { @@ -394,9 +394,9 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **PetId** | **Int64**| ID of pet to update | [default to null] - **AdditionalMetadata** | **String**| Additional data to pass to server | [optional] [default to null] - **File** | **System.IO.FileInfo****System.IO.FileInfo**| file to upload | [optional] [default to null] + **PetId** | **Int64**| ID of pet to update | + **AdditionalMetadata** | **String**| Additional data to pass to server | [optional] + **File** | **System.IO.FileInfo****System.IO.FileInfo**| file to upload | [optional] ### Return type diff --git a/samples/client/petstore/powershell/docs/PSStoreApi.md b/samples/client/petstore/powershell/docs/PSStoreApi.md index bfb991c51291..216d46534bad 100644 --- a/samples/client/petstore/powershell/docs/PSStoreApi.md +++ b/samples/client/petstore/powershell/docs/PSStoreApi.md @@ -23,7 +23,7 @@ For valid response try integer IDs with value < 1000. Anything above 1000 or non ```powershell Import-Module -Name PSPetstore -$OrderId = "OrderId_example" # String | ID of the order that needs to be deleted (default to null) +$OrderId = "OrderId_example" # String | ID of the order that needs to be deleted # Delete purchase order by ID try { @@ -38,7 +38,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **OrderId** | **String**| ID of the order that needs to be deleted | [default to null] + **OrderId** | **String**| ID of the order that needs to be deleted | ### Return type @@ -114,7 +114,7 @@ For valid response try integer IDs with value <= 5 or > 10. Other values will ge ```powershell Import-Module -Name PSPetstore -$OrderId = 987 # Int64 | ID of pet that needs to be fetched (default to null) +$OrderId = 987 # Int64 | ID of pet that needs to be fetched # Find purchase order by ID try { @@ -129,7 +129,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **OrderId** | **Int64**| ID of pet that needs to be fetched | [default to null] + **OrderId** | **Int64**| ID of pet that needs to be fetched | ### Return type diff --git a/samples/client/petstore/powershell/docs/PSUserApi.md b/samples/client/petstore/powershell/docs/PSUserApi.md index 1b5de280e7df..253b1ba1af80 100644 --- a/samples/client/petstore/powershell/docs/PSUserApi.md +++ b/samples/client/petstore/powershell/docs/PSUserApi.md @@ -182,7 +182,7 @@ $Configuration["ApiKey"]["AUTH_KEY"] = "YOUR_API_KEY" # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed #$Configuration["ApiKeyPrefix"]["AUTH_KEY"] = "Bearer" -$Username = "Username_example" # String | The name that needs to be deleted (default to null) +$Username = "Username_example" # String | The name that needs to be deleted # Delete user try { @@ -197,7 +197,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **Username** | **String**| The name that needs to be deleted | [default to null] + **Username** | **String**| The name that needs to be deleted | ### Return type @@ -225,7 +225,7 @@ Get user by user name ```powershell Import-Module -Name PSPetstore -$Username = "Username_example" # String | The name that needs to be fetched. Use user1 for testing. (default to null) +$Username = "Username_example" # String | The name that needs to be fetched. Use user1 for testing. # Get user by user name try { @@ -240,7 +240,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **Username** | **String**| The name that needs to be fetched. Use user1 for testing. | [default to null] + **Username** | **String**| The name that needs to be fetched. Use user1 for testing. | ### Return type @@ -269,8 +269,8 @@ Logs user into the system ```powershell Import-Module -Name PSPetstore -$Username = "Username_example" # String | The user name for login (default to null) -$Password = "Password_example" # String | The password for login in clear text (default to null) +$Username = "Username_example" # String | The user name for login +$Password = "Password_example" # String | The password for login in clear text # Logs user into the system try { @@ -285,8 +285,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **Username** | **String**| The user name for login | [default to null] - **Password** | **String**| The password for login in clear text | [default to null] + **Username** | **String**| The user name for login | + **Password** | **String**| The password for login in clear text | ### Return type @@ -367,7 +367,7 @@ $Configuration["ApiKey"]["AUTH_KEY"] = "YOUR_API_KEY" # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed #$Configuration["ApiKeyPrefix"]["AUTH_KEY"] = "Bearer" -$Username = "Username_example" # String | name that need to be deleted (default to null) +$Username = "Username_example" # String | name that need to be deleted $User = # User | Updated user object # Updated user @@ -383,7 +383,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **Username** | **String**| name that need to be deleted | [default to null] + **Username** | **String**| name that need to be deleted | **User** | [**User**](User.md)| Updated user object | ### Return type diff --git a/samples/client/petstore/powershell/docs/Pet.md b/samples/client/petstore/powershell/docs/Pet.md index ff21eb39d434..479fb7848592 100644 --- a/samples/client/petstore/powershell/docs/Pet.md +++ b/samples/client/petstore/powershell/docs/Pet.md @@ -3,12 +3,12 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Id** | **Int64** | | [optional] [default to null] -**Category** | [**Category**](Category.md) | | [optional] [default to null] -**Name** | **String** | | [default to null] -**PhotoUrls** | **String[]** | | [default to null] -**Tags** | [**Tag[]**](Tag.md) | | [optional] [default to null] -**Status** | **String** | pet status in the store | [optional] [default to null] +**Id** | **Int64** | | [optional] +**Category** | [**Category**](Category.md) | | [optional] +**Name** | **String** | | +**PhotoUrls** | **String[]** | | +**Tags** | [**Tag[]**](Tag.md) | | [optional] +**Status** | **String** | pet status in the store | [optional] ## Examples diff --git a/samples/client/petstore/powershell/docs/Tag.md b/samples/client/petstore/powershell/docs/Tag.md index 0207dc90690a..3a2fbd7e6f13 100644 --- a/samples/client/petstore/powershell/docs/Tag.md +++ b/samples/client/petstore/powershell/docs/Tag.md @@ -3,8 +3,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Id** | **Int64** | | [optional] [default to null] -**Name** | **String** | | [optional] [default to null] +**Id** | **Int64** | | [optional] +**Name** | **String** | | [optional] ## Examples diff --git a/samples/client/petstore/powershell/docs/User.md b/samples/client/petstore/powershell/docs/User.md index 4d97541aac4c..d6a5ee88d4ed 100644 --- a/samples/client/petstore/powershell/docs/User.md +++ b/samples/client/petstore/powershell/docs/User.md @@ -3,14 +3,14 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Id** | **Int64** | | [optional] [default to null] -**Username** | **String** | | [optional] [default to null] -**FirstName** | **String** | | [optional] [default to null] -**LastName** | **String** | | [optional] [default to null] -**Email** | **String** | | [optional] [default to null] -**Password** | **String** | | [optional] [default to null] -**Phone** | **String** | | [optional] [default to null] -**UserStatus** | **Int32** | User Status | [optional] [default to null] +**Id** | **Int64** | | [optional] +**Username** | **String** | | [optional] +**FirstName** | **String** | | [optional] +**LastName** | **String** | | [optional] +**Email** | **String** | | [optional] +**Password** | **String** | | [optional] +**Phone** | **String** | | [optional] +**UserStatus** | **Int32** | User Status | [optional] ## Examples diff --git a/samples/client/petstore/powershell/src/PSPetstore/Model/Order.ps1 b/samples/client/petstore/powershell/src/PSPetstore/Model/Order.ps1 index 253b47593210..1b931e6b197f 100644 --- a/samples/client/petstore/powershell/src/PSPetstore/Model/Order.ps1 +++ b/samples/client/petstore/powershell/src/PSPetstore/Model/Order.ps1 @@ -52,7 +52,7 @@ function Initialize-PSOrder { ${Status}, [Parameter(Position = 5, ValueFromPipelineByPropertyName = $true)] [System.Nullable[Boolean]] - ${Complete} + ${Complete} = $false ) Process { From dad931a25a54d6d1500654b96499d5239240c659 Mon Sep 17 00:00:00 2001 From: Justin Black Date: Mon, 13 Jul 2020 10:22:03 -0700 Subject: [PATCH 015/129] Python exp sample component renaming + additions (#6917) * Stops converting primitive models into object models, adds ComposedSchemas with mixed type * Reverts java and mustache changes * Reverts mroe files * Samples regen * Fixes remaining tests --- ...ith-fake-endpoints-models-for-testing.yaml | 86 ++-- ...odels-for-testing-with-http-signature.yaml | 282 +++++++----- .../.openapi-generator/FILES | 12 +- .../petstore/python-experimental/README.md | 17 +- .../python-experimental/docs/EnumTest.md | 2 +- .../python-experimental/docs/FakeApi.md | 191 +++++--- ...uterNumber.md => NumberWithValidations.md} | 2 +- ...omposite.md => ObjectModelWithRefProps.md} | 5 +- .../docs/{OuterEnum.md => StringEnum.md} | 2 +- .../petstore_api/api/fake_api.py | 289 ++++++++---- .../petstore_api/model/enum_test.py | 12 +- ...r_number.py => number_with_validations.py} | 4 +- ...site.py => object_model_with_ref_props.py} | 14 +- .../model/{outer_enum.py => string_enum.py} | 4 +- .../petstore_api/models/__init__.py | 6 +- .../test/test_enum_test.py | 6 +- .../python-experimental/test/test_fake_api.py | 61 ++- .../test/test_number_with_validations.py | 45 ++ .../test/test_object_model_with_ref_props.py | 49 +++ ...test_outer_enum.py => test_string_enum.py} | 18 +- .../tests/test_deserialization.py | 32 +- .../tests/test_serialization.py | 11 +- .../.openapi-generator/FILES | 24 +- .../petstore/python-experimental/README.md | 26 +- .../python-experimental/docs/ArrayOfEnums.md | 2 +- .../python-experimental/docs/EnumTest.md | 9 +- .../python-experimental/docs/FakeApi.md | 309 +++++++++---- .../{OuterEnumInteger.md => IntegerEnum.md} | 2 +- ...DefaultValue.md => IntegerEnumOneValue.md} | 2 +- .../docs/IntegerEnumWithDefaultValue.md | 10 + .../docs/NumberWithValidations.md | 10 + ...omposite.md => ObjectModelWithRefProps.md} | 5 +- .../docs/{OuterEnum.md => StringEnum.md} | 2 +- ...Value.md => StringEnumWithDefaultValue.md} | 2 +- .../petstore_api/api/fake_api.py | 416 ++++++++++++++---- .../petstore_api/model/array_of_enums.py | 10 +- .../petstore_api/model/enum_test.py | 56 ++- ...{outer_enum_integer.py => integer_enum.py} | 4 +- .../model/integer_enum_one_value.py | 174 ++++++++ ....py => integer_enum_with_default_value.py} | 4 +- .../model/number_with_validations.py | 174 ++++++++ ...site.py => object_model_with_ref_props.py} | 13 +- .../model/{outer_enum.py => string_enum.py} | 4 +- ...e.py => string_enum_with_default_value.py} | 4 +- .../petstore_api/models/__init__.py | 12 +- .../test/test_array_of_enums.py | 6 +- .../test/test_enum_test.py | 29 +- .../python-experimental/test/test_fake_api.py | 182 +++++++- .../test/test_fruit_req.py | 4 + .../test/test_integer_enum.py} | 12 +- .../test/test_integer_enum_one_value.py} | 23 +- ...> test_integer_enum_with_default_value.py} | 12 +- .../test/test_number_with_validations.py | 44 ++ .../test/test_object_model_with_ref_props.py | 49 +++ .../test/test_outer_composite.py | 38 -- .../test_outer_enum_integer_default_value.py | 38 -- ...test_outer_enum.py => test_string_enum.py} | 28 +- ...=> test_string_enum_with_default_value.py} | 12 +- .../tests/test_api_validation.py | 4 +- .../tests/test_deserialization.py | 27 ++ 60 files changed, 2151 insertions(+), 781 deletions(-) rename samples/client/petstore/python-experimental/docs/{OuterNumber.md => NumberWithValidations.md} (86%) rename samples/client/petstore/python-experimental/docs/{OuterComposite.md => ObjectModelWithRefProps.md} (54%) rename samples/client/petstore/python-experimental/docs/{OuterEnum.md => StringEnum.md} (92%) rename samples/client/petstore/python-experimental/petstore_api/model/{outer_number.py => number_with_validations.py} (98%) rename samples/client/petstore/python-experimental/petstore_api/model/{outer_composite.py => object_model_with_ref_props.py} (93%) rename samples/client/petstore/python-experimental/petstore_api/model/{outer_enum.py => string_enum.py} (98%) create mode 100644 samples/client/petstore/python-experimental/test/test_number_with_validations.py create mode 100644 samples/client/petstore/python-experimental/test/test_object_model_with_ref_props.py rename samples/client/petstore/python-experimental/test/{test_outer_enum.py => test_string_enum.py} (68%) rename samples/openapi3/client/petstore/python-experimental/docs/{OuterEnumInteger.md => IntegerEnum.md} (88%) rename samples/openapi3/client/petstore/python-experimental/docs/{OuterEnumIntegerDefaultValue.md => IntegerEnumOneValue.md} (83%) create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/IntegerEnumWithDefaultValue.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/NumberWithValidations.md rename samples/openapi3/client/petstore/python-experimental/docs/{OuterComposite.md => ObjectModelWithRefProps.md} (54%) rename samples/openapi3/client/petstore/python-experimental/docs/{OuterEnum.md => StringEnum.md} (92%) rename samples/openapi3/client/petstore/python-experimental/docs/{OuterEnumDefaultValue.md => StringEnumWithDefaultValue.md} (84%) rename samples/openapi3/client/petstore/python-experimental/petstore_api/model/{outer_enum_integer.py => integer_enum.py} (98%) create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_one_value.py rename samples/openapi3/client/petstore/python-experimental/petstore_api/model/{outer_enum_integer_default_value.py => integer_enum_with_default_value.py} (97%) create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/number_with_validations.py rename samples/openapi3/client/petstore/python-experimental/petstore_api/model/{outer_composite.py => object_model_with_ref_props.py} (93%) rename samples/openapi3/client/petstore/python-experimental/petstore_api/model/{outer_enum.py => string_enum.py} (98%) rename samples/openapi3/client/petstore/python-experimental/petstore_api/model/{outer_enum_default_value.py => string_enum_with_default_value.py} (97%) rename samples/{client/petstore/python-experimental/test/test_outer_number.py => openapi3/client/petstore/python-experimental/test/test_integer_enum.py} (71%) rename samples/{client/petstore/python-experimental/test/test_outer_composite.py => openapi3/client/petstore/python-experimental/test/test_integer_enum_one_value.py} (51%) rename samples/openapi3/client/petstore/python-experimental/test/{test_outer_enum_default_value.py => test_integer_enum_with_default_value.py} (63%) create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_number_with_validations.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_object_model_with_ref_props.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_outer_composite.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_outer_enum_integer_default_value.py rename samples/openapi3/client/petstore/python-experimental/test/{test_outer_enum.py => test_string_enum.py} (51%) rename samples/openapi3/client/petstore/python-experimental/test/{test_outer_enum_integer.py => test_string_enum_with_default_value.py} (64%) diff --git a/modules/openapi-generator/src/test/resources/2_0/python-client-experimental/petstore-with-fake-endpoints-models-for-testing.yaml b/modules/openapi-generator/src/test/resources/2_0/python-client-experimental/petstore-with-fake-endpoints-models-for-testing.yaml index cd6d793ec819..9e9451dcc5be 100644 --- a/modules/openapi-generator/src/test/resources/2_0/python-client-experimental/petstore-with-fake-endpoints-models-for-testing.yaml +++ b/modules/openapi-generator/src/test/resources/2_0/python-client-experimental/petstore-with-fake-endpoints-models-for-testing.yaml @@ -843,91 +843,108 @@ paths: responses: '400': description: Someting wrong - /fake/outer/number: + /fake/refs/number: post: tags: - fake description: Test serialization of outer number types - operationId: fakeOuterNumberSerialize + operationId: NumberWithValidations parameters: - name: body in: body description: Input number as post body schema: - $ref: '#/definitions/OuterNumber' + $ref: '#/definitions/NumberWithValidations' responses: '200': description: Output number schema: - $ref: '#/definitions/OuterNumber' - /fake/outer/string: + $ref: '#/definitions/NumberWithValidations' + /fake/refs/string: post: tags: - fake description: Test serialization of outer string types - operationId: fakeOuterStringSerialize + operationId: String parameters: - name: body in: body description: Input string as post body schema: - $ref: '#/definitions/OuterString' + $ref: '#/definitions/String' responses: '200': description: Output string schema: - $ref: '#/definitions/OuterString' - /fake/outer/boolean: + $ref: '#/definitions/String' + /fake/refs/boolean: post: tags: - fake description: Test serialization of outer boolean types - operationId: fakeOuterBooleanSerialize + operationId: Boolean parameters: - name: body in: body description: Input boolean as post body schema: - $ref: '#/definitions/OuterBoolean' + $ref: '#/definitions/Boolean' responses: '200': description: Output boolean schema: - $ref: '#/definitions/OuterBoolean' - /fake/outer/composite: + $ref: '#/definitions/Boolean' + /fake/refs/arraymodel: post: tags: - fake - description: Test serialization of object with outer number type - operationId: fakeOuterCompositeSerialize + description: Test serialization of ArrayModel + operationId: ArrayModel parameters: - name: body in: body - description: Input composite as post body + description: Input model schema: - $ref: '#/definitions/OuterComposite' + $ref: '#/definitions/AnimalFarm' responses: '200': - description: Output composite + description: Output model schema: - $ref: '#/definitions/OuterComposite' - /fake/outer/enum: + $ref: '#/definitions/AnimalFarm' + /fake/refs/object_model_with_ref_props: + post: + tags: + - fake + description: Test serialization of object with $refed properties + operationId: ObjectModelWithRefProps + parameters: + - name: body + in: body + description: Input model + schema: + $ref: '#/definitions/ObjectModelWithRefProps' + responses: + '200': + description: Output model + schema: + $ref: '#/definitions/ObjectModelWithRefProps' + /fake/refs/enum: post: tags: - fake description: Test serialization of outer enum - operationId: fakeOuterEnumSerialize + operationId: StringEnum parameters: - name: body in: body - description: Input enum as post body + description: Input enum schema: - $ref: '#/definitions/OuterEnum' + $ref: '#/definitions/StringEnum' responses: '200': description: Output enum schema: - $ref: '#/definitions/OuterEnum' + $ref: '#/definitions/StringEnum' /fake/jsonFormData: get: tags: @@ -1475,8 +1492,8 @@ definitions: enum: - 1.1 - -1.2 - outerEnum: - $ref: '#/definitions/OuterEnum' + stringEnum: + $ref: '#/definitions/StringEnum' AdditionalPropertiesClass: type: object properties: @@ -1743,28 +1760,29 @@ definitions: # enum: # - Cat # - Dog - OuterEnum: + StringEnum: type: string enum: - "placed" - "approved" - "delivered" - OuterComposite: + 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: my_number: - $ref: '#/definitions/OuterNumber' + $ref: '#/definitions/NumberWithValidations' my_string: - $ref: '#/definitions/OuterString' + $ref: '#/definitions/String' my_boolean: - $ref: '#/definitions/OuterBoolean' - OuterNumber: + $ref: '#/definitions/Boolean' + NumberWithValidations: type: number minimum: 10 maximum: 20 - OuterString: + String: type: string - OuterBoolean: + Boolean: type: boolean x-codegen-body-parameter-name: boolean_post_body StringBooleanMap: diff --git a/modules/openapi-generator/src/test/resources/3_0/python-experimental/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml b/modules/openapi-generator/src/test/resources/3_0/python-experimental/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml index 1e22fe1eccc9..fa89ac56e604 100644 --- a/modules/openapi-generator/src/test/resources/3_0/python-experimental/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/python-experimental/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml @@ -31,8 +31,8 @@ paths: $ref: '#/components/schemas/Foo' /pet: servers: - - url: 'http://petstore.swagger.io/v2' - - url: 'http://path-server-test.petstore.local/v2' + - url: 'http://petstore.swagger.io/v2' + - url: 'http://path-server-test.petstore.local/v2' post: tags: - pet @@ -822,82 +822,171 @@ paths: responses: '400': description: Someting wrong - /fake/outer/number: + /fake/refs/number: post: tags: - fake description: Test serialization of outer number types - operationId: fakeOuterNumberSerialize + 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/OuterNumber' + $ref: '#/components/schemas/NumberWithValidations' + /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/OuterNumber' - description: Input number as post body - /fake/outer/string: + $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 string types - operationId: fakeOuterStringSerialize + 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 string + description: Output boolean content: - '*/*': + application/json: schema: - $ref: '#/components/schemas/OuterString' + $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/OuterString' - description: Input string as post body - /fake/outer/boolean: + $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/object_model_with_ref_props: post: tags: - fake - description: Test serialization of outer boolean types - operationId: fakeOuterBooleanSerialize + 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 boolean + description: Output model content: - '*/*': + application/json: schema: - $ref: '#/components/schemas/OuterBoolean' + $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/OuterBoolean' - description: Input boolean as post body - /fake/outer/composite: + $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 - description: Test serialization of object with outer number type - operationId: fakeOuterCompositeSerialize + summary: Array of Enums + operationId: ArrayOfEnums + requestBody: + description: Input enum + content: + application/json: + schema: + $ref: '#/components/schemas/ArrayOfEnums' + required: false responses: - '200': - description: Output composite + 200: + description: Got named array of enums content: - '*/*': + application/json: schema: - $ref: '#/components/schemas/OuterComposite' + $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/OuterComposite' - description: Input composite as post body + $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: @@ -1099,32 +1188,6 @@ paths: application/json: schema: $ref: '#/components/schemas/HealthCheckResult' - /fake/array-of-enums: - get: - tags: - - fake - summary: Array of Enums - operationId: getArrayOfEnums - 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: getAdditionalPropertiesWithArrayOfEnums - responses: - 200: - description: Got object with additional properties with array of enums - content: - application/json: - schema: - $ref: '#/components/schemas/AdditionalPropertiesWithArrayOfEnums' servers: - url: 'http://{server}.swagger.io:{port}/v2' description: petstore server @@ -1430,7 +1493,7 @@ components: Address: type: object additionalProperties: - type: integer + type: integer Animal: type: object discriminator: @@ -1553,14 +1616,16 @@ components: enum: - 1.1 - -1.2 - outerEnum: - $ref: '#/components/schemas/OuterEnum' - outerEnumInteger: - $ref: '#/components/schemas/OuterEnumInteger' - outerEnumDefaultValue: - $ref: '#/components/schemas/OuterEnumDefaultValue' - outerEnumIntegerDefaultValue: - $ref: '#/components/schemas/OuterEnumIntegerDefaultValue' + 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: @@ -1727,47 +1792,56 @@ components: enum: - fish - crab - OuterEnum: + StringEnum: nullable: true type: string enum: - - placed - - approved - - delivered - OuterEnumInteger: + - "placed" + - "approved" + - "delivered" + IntegerEnum: type: integer enum: - - 0 - - 1 - - 2 - OuterEnumDefaultValue: + - 0 + - 1 + - 2 + StringEnumWithDefaultValue: type: string enum: - - placed - - approved - - delivered + - placed + - approved + - delivered default: placed - OuterEnumIntegerDefaultValue: + IntegerEnumWithDefaultValue: type: integer enum: - - 0 - - 1 - - 2 + - 0 + - 1 + - 2 default: 0 - OuterComposite: + IntegerEnumOneValue: + type: integer + enum: + - 0 + 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: my_number: - $ref: '#/components/schemas/OuterNumber' + $ref: '#/definitions/NumberWithValidations' my_string: - $ref: '#/components/schemas/OuterString' + $ref: '#/definitions/String' my_boolean: - $ref: '#/components/schemas/OuterBoolean' - OuterNumber: + $ref: '#/definitions/Boolean' + NumberWithValidations: type: number - OuterString: + minimum: 10 + maximum: 20 + Number: + type: number + String: type: string - OuterBoolean: + Boolean: type: boolean x-codegen-body-parameter-name: boolean_post_body StringBooleanMap: @@ -1939,19 +2013,19 @@ components: required: - className gmFruit: - properties: - color: - type: string - anyOf: - - $ref: '#/components/schemas/apple' - - $ref: '#/components/schemas/banana' - additionalProperties: false + properties: + color: + type: string + anyOf: + - $ref: '#/components/schemas/apple' + - $ref: '#/components/schemas/banana' + additionalProperties: false fruitReq: - oneOf: - - type: 'null' - - $ref: '#/components/schemas/appleReq' - - $ref: '#/components/schemas/bananaReq' - additionalProperties: false + oneOf: + - type: 'null' + - $ref: '#/components/schemas/appleReq' + - $ref: '#/components/schemas/bananaReq' + additionalProperties: false appleReq: type: object properties: @@ -2103,7 +2177,7 @@ components: ArrayOfEnums: type: array items: - $ref: '#/components/schemas/OuterEnum' + $ref: '#/components/schemas/StringEnum' AdditionalPropertiesWithArrayOfEnums: type: object additionalProperties: diff --git a/samples/client/petstore/python-experimental/.openapi-generator/FILES b/samples/client/petstore/python-experimental/.openapi-generator/FILES index 6e7ed3cb31ab..a5adeaaddc68 100644 --- a/samples/client/petstore/python-experimental/.openapi-generator/FILES +++ b/samples/client/petstore/python-experimental/.openapi-generator/FILES @@ -51,10 +51,9 @@ docs/Model200Response.md docs/ModelReturn.md docs/Name.md docs/NumberOnly.md +docs/NumberWithValidations.md +docs/ObjectModelWithRefProps.md docs/Order.md -docs/OuterComposite.md -docs/OuterEnum.md -docs/OuterNumber.md docs/Parent.md docs/ParentAllOf.md docs/ParentPet.md @@ -65,6 +64,7 @@ docs/ReadOnlyFirst.md docs/SpecialModelName.md docs/StoreApi.md docs/StringBooleanMap.md +docs/StringEnum.md docs/Tag.md docs/TypeHolderDefault.md docs/TypeHolderExample.md @@ -131,10 +131,9 @@ petstore_api/model/model200_response.py petstore_api/model/model_return.py petstore_api/model/name.py petstore_api/model/number_only.py +petstore_api/model/number_with_validations.py +petstore_api/model/object_model_with_ref_props.py petstore_api/model/order.py -petstore_api/model/outer_composite.py -petstore_api/model/outer_enum.py -petstore_api/model/outer_number.py petstore_api/model/parent.py petstore_api/model/parent_all_of.py petstore_api/model/parent_pet.py @@ -143,6 +142,7 @@ petstore_api/model/player.py petstore_api/model/read_only_first.py petstore_api/model/special_model_name.py petstore_api/model/string_boolean_map.py +petstore_api/model/string_enum.py petstore_api/model/tag.py petstore_api/model/type_holder_default.py petstore_api/model/type_holder_example.py diff --git a/samples/client/petstore/python-experimental/README.md b/samples/client/petstore/python-experimental/README.md index 9826cfaf9872..62a22ec0ed67 100644 --- a/samples/client/petstore/python-experimental/README.md +++ b/samples/client/petstore/python-experimental/README.md @@ -81,12 +81,13 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- *AnotherFakeApi* | [**call_123_test_special_tags**](docs/AnotherFakeApi.md#call_123_test_special_tags) | **PATCH** /another-fake/dummy | To test special tags +*FakeApi* | [**array_model**](docs/FakeApi.md#array_model) | **POST** /fake/refs/arraymodel | +*FakeApi* | [**boolean**](docs/FakeApi.md#boolean) | **POST** /fake/refs/boolean | *FakeApi* | [**create_xml_item**](docs/FakeApi.md#create_xml_item) | **POST** /fake/create_xml_item | creates an XmlItem -*FakeApi* | [**fake_outer_boolean_serialize**](docs/FakeApi.md#fake_outer_boolean_serialize) | **POST** /fake/outer/boolean | -*FakeApi* | [**fake_outer_composite_serialize**](docs/FakeApi.md#fake_outer_composite_serialize) | **POST** /fake/outer/composite | -*FakeApi* | [**fake_outer_enum_serialize**](docs/FakeApi.md#fake_outer_enum_serialize) | **POST** /fake/outer/enum | -*FakeApi* | [**fake_outer_number_serialize**](docs/FakeApi.md#fake_outer_number_serialize) | **POST** /fake/outer/number | -*FakeApi* | [**fake_outer_string_serialize**](docs/FakeApi.md#fake_outer_string_serialize) | **POST** /fake/outer/string | +*FakeApi* | [**number_with_validations**](docs/FakeApi.md#number_with_validations) | **POST** /fake/refs/number | +*FakeApi* | [**object_model_with_ref_props**](docs/FakeApi.md#object_model_with_ref_props) | **POST** /fake/refs/object_model_with_ref_props | +*FakeApi* | [**string**](docs/FakeApi.md#string) | **POST** /fake/refs/string | +*FakeApi* | [**string_enum**](docs/FakeApi.md#string_enum) | **POST** /fake/refs/enum | *FakeApi* | [**test_body_with_file_schema**](docs/FakeApi.md#test_body_with_file_schema) | **PUT** /fake/body-with-file-schema | *FakeApi* | [**test_body_with_query_params**](docs/FakeApi.md#test_body_with_query_params) | **PUT** /fake/body-with-query-params | *FakeApi* | [**test_client_model**](docs/FakeApi.md#test_client_model) | **PATCH** /fake | To test \"client\" model @@ -168,10 +169,9 @@ Class | Method | HTTP request | Description - [model_return.ModelReturn](docs/ModelReturn.md) - [name.Name](docs/Name.md) - [number_only.NumberOnly](docs/NumberOnly.md) + - [number_with_validations.NumberWithValidations](docs/NumberWithValidations.md) + - [object_model_with_ref_props.ObjectModelWithRefProps](docs/ObjectModelWithRefProps.md) - [order.Order](docs/Order.md) - - [outer_composite.OuterComposite](docs/OuterComposite.md) - - [outer_enum.OuterEnum](docs/OuterEnum.md) - - [outer_number.OuterNumber](docs/OuterNumber.md) - [parent.Parent](docs/Parent.md) - [parent_all_of.ParentAllOf](docs/ParentAllOf.md) - [parent_pet.ParentPet](docs/ParentPet.md) @@ -180,6 +180,7 @@ Class | Method | HTTP request | Description - [read_only_first.ReadOnlyFirst](docs/ReadOnlyFirst.md) - [special_model_name.SpecialModelName](docs/SpecialModelName.md) - [string_boolean_map.StringBooleanMap](docs/StringBooleanMap.md) + - [string_enum.StringEnum](docs/StringEnum.md) - [tag.Tag](docs/Tag.md) - [type_holder_default.TypeHolderDefault](docs/TypeHolderDefault.md) - [type_holder_example.TypeHolderExample](docs/TypeHolderExample.md) diff --git a/samples/client/petstore/python-experimental/docs/EnumTest.md b/samples/client/petstore/python-experimental/docs/EnumTest.md index 94477ea5a511..24b09db3344d 100644 --- a/samples/client/petstore/python-experimental/docs/EnumTest.md +++ b/samples/client/petstore/python-experimental/docs/EnumTest.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes **enum_string** | **str** | | [optional] **enum_integer** | **int** | | [optional] **enum_number** | **float** | | [optional] -**outer_enum** | [**outer_enum.OuterEnum**](OuterEnum.md) | | [optional] +**string_enum** | [**string_enum.StringEnum**](StringEnum.md) | | [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/client/petstore/python-experimental/docs/FakeApi.md b/samples/client/petstore/python-experimental/docs/FakeApi.md index 7f813d160f77..eeabb02c3c82 100644 --- a/samples/client/petstore/python-experimental/docs/FakeApi.md +++ b/samples/client/petstore/python-experimental/docs/FakeApi.md @@ -4,12 +4,13 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- +[**array_model**](FakeApi.md#array_model) | **POST** /fake/refs/arraymodel | +[**boolean**](FakeApi.md#boolean) | **POST** /fake/refs/boolean | [**create_xml_item**](FakeApi.md#create_xml_item) | **POST** /fake/create_xml_item | creates an XmlItem -[**fake_outer_boolean_serialize**](FakeApi.md#fake_outer_boolean_serialize) | **POST** /fake/outer/boolean | -[**fake_outer_composite_serialize**](FakeApi.md#fake_outer_composite_serialize) | **POST** /fake/outer/composite | -[**fake_outer_enum_serialize**](FakeApi.md#fake_outer_enum_serialize) | **POST** /fake/outer/enum | -[**fake_outer_number_serialize**](FakeApi.md#fake_outer_number_serialize) | **POST** /fake/outer/number | -[**fake_outer_string_serialize**](FakeApi.md#fake_outer_string_serialize) | **POST** /fake/outer/string | +[**number_with_validations**](FakeApi.md#number_with_validations) | **POST** /fake/refs/number | +[**object_model_with_ref_props**](FakeApi.md#object_model_with_ref_props) | **POST** /fake/refs/object_model_with_ref_props | +[**string**](FakeApi.md#string) | **POST** /fake/refs/string | +[**string_enum**](FakeApi.md#string_enum) | **POST** /fake/refs/enum | [**test_body_with_file_schema**](FakeApi.md#test_body_with_file_schema) | **PUT** /fake/body-with-file-schema | [**test_body_with_query_params**](FakeApi.md#test_body_with_query_params) | **PUT** /fake/body-with-query-params | [**test_client_model**](FakeApi.md#test_client_model) | **PATCH** /fake | To test \"client\" model @@ -21,12 +22,12 @@ Method | HTTP request | Description [**test_json_form_data**](FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data -# **create_xml_item** -> create_xml_item(xml_item) +# **array_model** +> animal_farm.AnimalFarm array_model() -creates an XmlItem -this route creates an XmlItem + +Test serialization of ArrayModel ### Example @@ -35,7 +36,7 @@ from __future__ import print_function import time import petstore_api from petstore_api.api import fake_api -from petstore_api.model import xml_item +from petstore_api.model import animal_farm 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. @@ -48,25 +49,26 @@ configuration = petstore_api.Configuration( with petstore_api.ApiClient() as api_client: # Create an instance of the API class api_instance = fake_api.FakeApi(api_client) - xml_item = xml_item.XmlItem() # xml_item.XmlItem | XmlItem Body - + body = animal_farm.AnimalFarm() # animal_farm.AnimalFarm | Input model (optional) + # example passing only required values which don't have defaults set + # and optional values try: - # creates an XmlItem - api_instance.create_xml_item(xml_item) + api_response = api_instance.array_model(body=body) + pprint(api_response) except petstore_api.ApiException as e: - print("Exception when calling FakeApi->create_xml_item: %s\n" % e) + print("Exception when calling FakeApi->array_model: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **xml_item** | [**xml_item.XmlItem**](XmlItem.md)| XmlItem Body | + **body** | [**animal_farm.AnimalFarm**](AnimalFarm.md)| Input model | [optional] ### Return type -void (empty response body) +[**animal_farm.AnimalFarm**](AnimalFarm.md) ### Authorization @@ -74,18 +76,18 @@ No authorization required ### HTTP request headers - - **Content-Type**: application/xml, application/xml; charset=utf-8, application/xml; charset=utf-16, text/xml, text/xml; charset=utf-8, text/xml; charset=utf-16 - - **Accept**: Not defined + - **Content-Type**: Not defined + - **Accept**: */* ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | successful operation | - | +**200** | Output model | - | [[Back to top]](#) [[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_outer_boolean_serialize** -> bool fake_outer_boolean_serialize() +# **boolean** +> bool boolean() @@ -115,10 +117,10 @@ with petstore_api.ApiClient() as api_client: # example passing only required values which don't have defaults set # and optional values try: - api_response = api_instance.fake_outer_boolean_serialize(body=body) + api_response = api_instance.boolean(body=body) pprint(api_response) except petstore_api.ApiException as e: - print("Exception when calling FakeApi->fake_outer_boolean_serialize: %s\n" % e) + print("Exception when calling FakeApi->boolean: %s\n" % e) ``` ### Parameters @@ -147,12 +149,75 @@ No authorization required [[Back to top]](#) [[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_outer_composite_serialize** -> outer_composite.OuterComposite fake_outer_composite_serialize() +# **create_xml_item** +> create_xml_item(xml_item) + +creates an XmlItem + +this route creates an XmlItem + +### Example + +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.api import fake_api +from petstore_api.model import xml_item +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() as api_client: + # Create an instance of the API class + api_instance = fake_api.FakeApi(api_client) + xml_item = xml_item.XmlItem() # xml_item.XmlItem | XmlItem Body + + # example passing only required values which don't have defaults set + try: + # creates an XmlItem + api_instance.create_xml_item(xml_item) + except petstore_api.ApiException as e: + print("Exception when calling FakeApi->create_xml_item: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xml_item** | [**xml_item.XmlItem**](XmlItem.md)| XmlItem Body | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/xml, application/xml; charset=utf-8, application/xml; charset=utf-16, text/xml, text/xml; charset=utf-8, text/xml; charset=utf-16 + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | + +[[Back to top]](#) [[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** +> number_with_validations.NumberWithValidations number_with_validations() -Test serialization of object with outer number type +Test serialization of outer number types ### Example @@ -161,7 +226,7 @@ from __future__ import print_function import time import petstore_api from petstore_api.api import fake_api -from petstore_api.model import outer_composite +from petstore_api.model import number_with_validations 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. @@ -174,26 +239,26 @@ configuration = petstore_api.Configuration( with petstore_api.ApiClient() as api_client: # Create an instance of the API class api_instance = fake_api.FakeApi(api_client) - body = outer_composite.OuterComposite() # outer_composite.OuterComposite | Input composite as post body (optional) + body = number_with_validations.NumberWithValidations(3.4) # number_with_validations.NumberWithValidations | Input number as post body (optional) # example passing only required values which don't have defaults set # and optional values try: - api_response = api_instance.fake_outer_composite_serialize(body=body) + api_response = api_instance.number_with_validations(body=body) pprint(api_response) except petstore_api.ApiException as e: - print("Exception when calling FakeApi->fake_outer_composite_serialize: %s\n" % e) + print("Exception when calling FakeApi->number_with_validations: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**outer_composite.OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] + **body** | [**number_with_validations.NumberWithValidations**](NumberWithValidations.md)| Input number as post body | [optional] ### Return type -[**outer_composite.OuterComposite**](OuterComposite.md) +[**number_with_validations.NumberWithValidations**](NumberWithValidations.md) ### Authorization @@ -207,16 +272,16 @@ No authorization required ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Output composite | - | +**200** | Output number | - | [[Back to top]](#) [[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_outer_enum_serialize** -> outer_enum.OuterEnum fake_outer_enum_serialize() +# **object_model_with_ref_props** +> object_model_with_ref_props.ObjectModelWithRefProps object_model_with_ref_props() -Test serialization of outer enum +Test serialization of object with $refed properties ### Example @@ -225,7 +290,7 @@ from __future__ import print_function import time import petstore_api from petstore_api.api import fake_api -from petstore_api.model import outer_enum +from petstore_api.model import object_model_with_ref_props 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. @@ -238,26 +303,26 @@ configuration = petstore_api.Configuration( with petstore_api.ApiClient() as api_client: # Create an instance of the API class api_instance = fake_api.FakeApi(api_client) - body = outer_enum.OuterEnum("placed") # outer_enum.OuterEnum | Input enum as post body (optional) + body = object_model_with_ref_props.ObjectModelWithRefProps() # object_model_with_ref_props.ObjectModelWithRefProps | Input model (optional) # example passing only required values which don't have defaults set # and optional values try: - api_response = api_instance.fake_outer_enum_serialize(body=body) + 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->fake_outer_enum_serialize: %s\n" % e) + print("Exception when calling FakeApi->object_model_with_ref_props: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**outer_enum.OuterEnum**](OuterEnum.md)| Input enum as post body | [optional] + **body** | [**object_model_with_ref_props.ObjectModelWithRefProps**](ObjectModelWithRefProps.md)| Input model | [optional] ### Return type -[**outer_enum.OuterEnum**](OuterEnum.md) +[**object_model_with_ref_props.ObjectModelWithRefProps**](ObjectModelWithRefProps.md) ### Authorization @@ -271,16 +336,16 @@ No authorization required ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Output enum | - | +**200** | Output model | - | [[Back to top]](#) [[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_outer_number_serialize** -> outer_number.OuterNumber fake_outer_number_serialize() +# **string** +> str string() -Test serialization of outer number types +Test serialization of outer string types ### Example @@ -289,7 +354,6 @@ from __future__ import print_function import time import petstore_api from petstore_api.api import fake_api -from petstore_api.model import outer_number 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. @@ -302,26 +366,26 @@ configuration = petstore_api.Configuration( with petstore_api.ApiClient() as api_client: # Create an instance of the API class api_instance = fake_api.FakeApi(api_client) - body = outer_number.OuterNumber(3.4) # outer_number.OuterNumber | Input number as post body (optional) + body = 'body_example' # str | Input string as post body (optional) # example passing only required values which don't have defaults set # and optional values try: - api_response = api_instance.fake_outer_number_serialize(body=body) + api_response = api_instance.string(body=body) pprint(api_response) except petstore_api.ApiException as e: - print("Exception when calling FakeApi->fake_outer_number_serialize: %s\n" % e) + print("Exception when calling FakeApi->string: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**outer_number.OuterNumber**](OuterNumber.md)| Input number as post body | [optional] + **body** | **str**| Input string as post body | [optional] ### Return type -[**outer_number.OuterNumber**](OuterNumber.md) +**str** ### Authorization @@ -335,16 +399,16 @@ No authorization required ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Output number | - | +**200** | Output string | - | [[Back to top]](#) [[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_outer_string_serialize** -> str fake_outer_string_serialize() +# **string_enum** +> string_enum.StringEnum string_enum() -Test serialization of outer string types +Test serialization of outer enum ### Example @@ -353,6 +417,7 @@ from __future__ import print_function import time import petstore_api from petstore_api.api import fake_api +from petstore_api.model import string_enum 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. @@ -365,26 +430,26 @@ configuration = petstore_api.Configuration( with petstore_api.ApiClient() as api_client: # Create an instance of the API class api_instance = fake_api.FakeApi(api_client) - body = 'body_example' # str | Input string as post body (optional) + body = string_enum.StringEnum("placed") # string_enum.StringEnum | Input enum (optional) # example passing only required values which don't have defaults set # and optional values try: - api_response = api_instance.fake_outer_string_serialize(body=body) + api_response = api_instance.string_enum(body=body) pprint(api_response) except petstore_api.ApiException as e: - print("Exception when calling FakeApi->fake_outer_string_serialize: %s\n" % e) + print("Exception when calling FakeApi->string_enum: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | **str**| Input string as post body | [optional] + **body** | [**string_enum.StringEnum**](StringEnum.md)| Input enum | [optional] ### Return type -**str** +[**string_enum.StringEnum**](StringEnum.md) ### Authorization @@ -398,7 +463,7 @@ No authorization required ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Output string | - | +**200** | Output enum | - | [[Back to top]](#) [[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/client/petstore/python-experimental/docs/OuterNumber.md b/samples/client/petstore/python-experimental/docs/NumberWithValidations.md similarity index 86% rename from samples/client/petstore/python-experimental/docs/OuterNumber.md rename to samples/client/petstore/python-experimental/docs/NumberWithValidations.md index 7e3728b519cb..b6eb738a2a8d 100644 --- a/samples/client/petstore/python-experimental/docs/OuterNumber.md +++ b/samples/client/petstore/python-experimental/docs/NumberWithValidations.md @@ -1,4 +1,4 @@ -# outer_number.OuterNumber +# number_with_validations.NumberWithValidations ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/python-experimental/docs/OuterComposite.md b/samples/client/petstore/python-experimental/docs/ObjectModelWithRefProps.md similarity index 54% rename from samples/client/petstore/python-experimental/docs/OuterComposite.md rename to samples/client/petstore/python-experimental/docs/ObjectModelWithRefProps.md index 88a190c7df99..6c308497b60b 100644 --- a/samples/client/petstore/python-experimental/docs/OuterComposite.md +++ b/samples/client/petstore/python-experimental/docs/ObjectModelWithRefProps.md @@ -1,9 +1,10 @@ -# outer_composite.OuterComposite +# 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 ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**my_number** | [**outer_number.OuterNumber**](OuterNumber.md) | | [optional] +**my_number** | [**number_with_validations.NumberWithValidations**](NumberWithValidations.md) | | [optional] **my_string** | **str** | | [optional] **my_boolean** | **bool** | | [optional] diff --git a/samples/client/petstore/python-experimental/docs/OuterEnum.md b/samples/client/petstore/python-experimental/docs/StringEnum.md similarity index 92% rename from samples/client/petstore/python-experimental/docs/OuterEnum.md rename to samples/client/petstore/python-experimental/docs/StringEnum.md index 1428a27552db..614a64b88aab 100644 --- a/samples/client/petstore/python-experimental/docs/OuterEnum.md +++ b/samples/client/petstore/python-experimental/docs/StringEnum.md @@ -1,4 +1,4 @@ -# outer_enum.OuterEnum +# string_enum.StringEnum ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/python-experimental/petstore_api/api/fake_api.py b/samples/client/petstore/python-experimental/petstore_api/api/fake_api.py index 12629f8357e9..d7607077f590 100644 --- a/samples/client/petstore/python-experimental/petstore_api/api/fake_api.py +++ b/samples/client/petstore/python-experimental/petstore_api/api/fake_api.py @@ -30,10 +30,11 @@ str, validate_and_convert_types ) +from petstore_api.model import animal_farm from petstore_api.model import xml_item -from petstore_api.model import outer_composite -from petstore_api.model import outer_enum -from petstore_api.model import outer_number +from petstore_api.model import number_with_validations +from petstore_api.model import object_model_with_ref_props +from petstore_api.model import string_enum from petstore_api.model import file_schema_test_class from petstore_api.model import user from petstore_api.model import client @@ -51,24 +52,22 @@ def __init__(self, api_client=None): api_client = ApiClient() self.api_client = api_client - def __create_xml_item( + def __array_model( self, - xml_item, **kwargs ): - """creates an XmlItem # noqa: E501 + """array_model # noqa: E501 - this route creates an XmlItem # noqa: E501 + Test serialization of ArrayModel # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_xml_item(xml_item, async_req=True) + >>> thread = api.array_model(async_req=True) >>> result = thread.get() - Args: - xml_item (xml_item.XmlItem): XmlItem Body Keyword Args: + body (animal_farm.AnimalFarm): Input model. [optional] _return_http_data_only (bool): response data without head status code and headers. Default is True. _preload_content (bool): if False, the urllib3.HTTPResponse object @@ -90,7 +89,7 @@ def __create_xml_item( async_req (bool): execute request asynchronously Returns: - None + animal_farm.AnimalFarm If the method is called asynchronously, returns the request thread. """ @@ -113,26 +112,22 @@ def __create_xml_item( '_check_return_type', True ) kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['xml_item'] = \ - xml_item return self.call_with_http_info(**kwargs) - self.create_xml_item = Endpoint( + self.array_model = Endpoint( settings={ - 'response_type': None, + 'response_type': (animal_farm.AnimalFarm,), 'auth': [], - 'endpoint_path': '/fake/create_xml_item', - 'operation_id': 'create_xml_item', + 'endpoint_path': '/fake/refs/arraymodel', + 'operation_id': 'array_model', 'http_method': 'POST', 'servers': None, }, params_map={ 'all': [ - 'xml_item', - ], - 'required': [ - 'xml_item', + 'body', ], + 'required': [], 'nullable': [ ], 'enum': [ @@ -146,43 +141,38 @@ def __create_xml_item( 'allowed_values': { }, 'openapi_types': { - 'xml_item': - (xml_item.XmlItem,), + 'body': + (animal_farm.AnimalFarm,), }, 'attribute_map': { }, 'location_map': { - 'xml_item': 'body', + 'body': 'body', }, 'collection_format_map': { } }, headers_map={ - 'accept': [], - 'content_type': [ - 'application/xml', - 'application/xml; charset=utf-8', - 'application/xml; charset=utf-16', - 'text/xml', - 'text/xml; charset=utf-8', - 'text/xml; charset=utf-16' - ] + 'accept': [ + '*/*' + ], + 'content_type': [], }, api_client=api_client, - callable=__create_xml_item + callable=__array_model ) - def __fake_outer_boolean_serialize( + def __boolean( self, **kwargs ): - """fake_outer_boolean_serialize # noqa: E501 + """boolean # noqa: E501 Test serialization of outer boolean types # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.fake_outer_boolean_serialize(async_req=True) + >>> thread = api.boolean(async_req=True) >>> result = thread.get() @@ -234,12 +224,12 @@ def __fake_outer_boolean_serialize( kwargs['_host_index'] = kwargs.get('_host_index') return self.call_with_http_info(**kwargs) - self.fake_outer_boolean_serialize = Endpoint( + self.boolean = Endpoint( settings={ 'response_type': (bool,), 'auth': [], - 'endpoint_path': '/fake/outer/boolean', - 'operation_id': 'fake_outer_boolean_serialize', + 'endpoint_path': '/fake/refs/boolean', + 'operation_id': 'boolean', 'http_method': 'POST', 'servers': None, }, @@ -279,25 +269,146 @@ def __fake_outer_boolean_serialize( 'content_type': [], }, api_client=api_client, - callable=__fake_outer_boolean_serialize + callable=__boolean + ) + + def __create_xml_item( + self, + xml_item, + **kwargs + ): + """creates an XmlItem # noqa: E501 + + this route creates an XmlItem # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_xml_item(xml_item, async_req=True) + >>> result = thread.get() + + Args: + xml_item (xml_item.XmlItem): XmlItem Body + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): 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. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['xml_item'] = \ + xml_item + return self.call_with_http_info(**kwargs) + + self.create_xml_item = Endpoint( + settings={ + 'response_type': None, + 'auth': [], + 'endpoint_path': '/fake/create_xml_item', + 'operation_id': 'create_xml_item', + 'http_method': 'POST', + 'servers': None, + }, + params_map={ + 'all': [ + 'xml_item', + ], + 'required': [ + 'xml_item', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'xml_item': + (xml_item.XmlItem,), + }, + 'attribute_map': { + }, + 'location_map': { + 'xml_item': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [], + 'content_type': [ + 'application/xml', + 'application/xml; charset=utf-8', + 'application/xml; charset=utf-16', + 'text/xml', + 'text/xml; charset=utf-8', + 'text/xml; charset=utf-16' + ] + }, + api_client=api_client, + callable=__create_xml_item ) - def __fake_outer_composite_serialize( + def __number_with_validations( self, **kwargs ): - """fake_outer_composite_serialize # noqa: E501 + """number_with_validations # noqa: E501 - Test serialization of object with outer number type # noqa: E501 + Test serialization of outer number types # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.fake_outer_composite_serialize(async_req=True) + >>> thread = api.number_with_validations(async_req=True) >>> result = thread.get() Keyword Args: - body (outer_composite.OuterComposite): Input composite as post body. [optional] + body (number_with_validations.NumberWithValidations): Input number as post body. [optional] _return_http_data_only (bool): response data without head status code and headers. Default is True. _preload_content (bool): if False, the urllib3.HTTPResponse object @@ -319,7 +430,7 @@ def __fake_outer_composite_serialize( async_req (bool): execute request asynchronously Returns: - outer_composite.OuterComposite + number_with_validations.NumberWithValidations If the method is called asynchronously, returns the request thread. """ @@ -344,12 +455,12 @@ def __fake_outer_composite_serialize( kwargs['_host_index'] = kwargs.get('_host_index') return self.call_with_http_info(**kwargs) - self.fake_outer_composite_serialize = Endpoint( + self.number_with_validations = Endpoint( settings={ - 'response_type': (outer_composite.OuterComposite,), + 'response_type': (number_with_validations.NumberWithValidations,), 'auth': [], - 'endpoint_path': '/fake/outer/composite', - 'operation_id': 'fake_outer_composite_serialize', + 'endpoint_path': '/fake/refs/number', + 'operation_id': 'number_with_validations', 'http_method': 'POST', 'servers': None, }, @@ -372,7 +483,7 @@ def __fake_outer_composite_serialize( }, 'openapi_types': { 'body': - (outer_composite.OuterComposite,), + (number_with_validations.NumberWithValidations,), }, 'attribute_map': { }, @@ -389,25 +500,25 @@ def __fake_outer_composite_serialize( 'content_type': [], }, api_client=api_client, - callable=__fake_outer_composite_serialize + callable=__number_with_validations ) - def __fake_outer_enum_serialize( + def __object_model_with_ref_props( self, **kwargs ): - """fake_outer_enum_serialize # noqa: E501 + """object_model_with_ref_props # noqa: E501 - Test serialization of outer enum # noqa: E501 + Test serialization of object with $refed properties # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.fake_outer_enum_serialize(async_req=True) + >>> thread = api.object_model_with_ref_props(async_req=True) >>> result = thread.get() Keyword Args: - body (outer_enum.OuterEnum): Input enum as post body. [optional] + body (object_model_with_ref_props.ObjectModelWithRefProps): Input model. [optional] _return_http_data_only (bool): response data without head status code and headers. Default is True. _preload_content (bool): if False, the urllib3.HTTPResponse object @@ -429,7 +540,7 @@ def __fake_outer_enum_serialize( async_req (bool): execute request asynchronously Returns: - outer_enum.OuterEnum + object_model_with_ref_props.ObjectModelWithRefProps If the method is called asynchronously, returns the request thread. """ @@ -454,12 +565,12 @@ def __fake_outer_enum_serialize( kwargs['_host_index'] = kwargs.get('_host_index') return self.call_with_http_info(**kwargs) - self.fake_outer_enum_serialize = Endpoint( + self.object_model_with_ref_props = Endpoint( settings={ - 'response_type': (outer_enum.OuterEnum,), + 'response_type': (object_model_with_ref_props.ObjectModelWithRefProps,), 'auth': [], - 'endpoint_path': '/fake/outer/enum', - 'operation_id': 'fake_outer_enum_serialize', + 'endpoint_path': '/fake/refs/object_model_with_ref_props', + 'operation_id': 'object_model_with_ref_props', 'http_method': 'POST', 'servers': None, }, @@ -482,7 +593,7 @@ def __fake_outer_enum_serialize( }, 'openapi_types': { 'body': - (outer_enum.OuterEnum,), + (object_model_with_ref_props.ObjectModelWithRefProps,), }, 'attribute_map': { }, @@ -499,25 +610,25 @@ def __fake_outer_enum_serialize( 'content_type': [], }, api_client=api_client, - callable=__fake_outer_enum_serialize + callable=__object_model_with_ref_props ) - def __fake_outer_number_serialize( + def __string( self, **kwargs ): - """fake_outer_number_serialize # noqa: E501 + """string # noqa: E501 - Test serialization of outer number types # noqa: E501 + Test serialization of outer string types # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.fake_outer_number_serialize(async_req=True) + >>> thread = api.string(async_req=True) >>> result = thread.get() Keyword Args: - body (outer_number.OuterNumber): Input number as post body. [optional] + body (str): Input string as post body. [optional] _return_http_data_only (bool): response data without head status code and headers. Default is True. _preload_content (bool): if False, the urllib3.HTTPResponse object @@ -539,7 +650,7 @@ def __fake_outer_number_serialize( async_req (bool): execute request asynchronously Returns: - outer_number.OuterNumber + str If the method is called asynchronously, returns the request thread. """ @@ -564,12 +675,12 @@ def __fake_outer_number_serialize( kwargs['_host_index'] = kwargs.get('_host_index') return self.call_with_http_info(**kwargs) - self.fake_outer_number_serialize = Endpoint( + self.string = Endpoint( settings={ - 'response_type': (outer_number.OuterNumber,), + 'response_type': (str,), 'auth': [], - 'endpoint_path': '/fake/outer/number', - 'operation_id': 'fake_outer_number_serialize', + 'endpoint_path': '/fake/refs/string', + 'operation_id': 'string', 'http_method': 'POST', 'servers': None, }, @@ -592,7 +703,7 @@ def __fake_outer_number_serialize( }, 'openapi_types': { 'body': - (outer_number.OuterNumber,), + (str,), }, 'attribute_map': { }, @@ -609,25 +720,25 @@ def __fake_outer_number_serialize( 'content_type': [], }, api_client=api_client, - callable=__fake_outer_number_serialize + callable=__string ) - def __fake_outer_string_serialize( + def __string_enum( self, **kwargs ): - """fake_outer_string_serialize # noqa: E501 + """string_enum # noqa: E501 - Test serialization of outer string types # noqa: E501 + Test serialization of outer enum # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.fake_outer_string_serialize(async_req=True) + >>> thread = api.string_enum(async_req=True) >>> result = thread.get() Keyword Args: - body (str): Input string as post body. [optional] + body (string_enum.StringEnum): Input enum. [optional] _return_http_data_only (bool): response data without head status code and headers. Default is True. _preload_content (bool): if False, the urllib3.HTTPResponse object @@ -649,7 +760,7 @@ def __fake_outer_string_serialize( async_req (bool): execute request asynchronously Returns: - str + string_enum.StringEnum If the method is called asynchronously, returns the request thread. """ @@ -674,12 +785,12 @@ def __fake_outer_string_serialize( kwargs['_host_index'] = kwargs.get('_host_index') return self.call_with_http_info(**kwargs) - self.fake_outer_string_serialize = Endpoint( + self.string_enum = Endpoint( settings={ - 'response_type': (str,), + 'response_type': (string_enum.StringEnum,), 'auth': [], - 'endpoint_path': '/fake/outer/string', - 'operation_id': 'fake_outer_string_serialize', + 'endpoint_path': '/fake/refs/enum', + 'operation_id': 'string_enum', 'http_method': 'POST', 'servers': None, }, @@ -702,7 +813,7 @@ def __fake_outer_string_serialize( }, 'openapi_types': { 'body': - (str,), + (string_enum.StringEnum,), }, 'attribute_map': { }, @@ -719,7 +830,7 @@ def __fake_outer_string_serialize( 'content_type': [], }, api_client=api_client, - callable=__fake_outer_string_serialize + callable=__string_enum ) def __test_body_with_file_schema( diff --git a/samples/client/petstore/python-experimental/petstore_api/model/enum_test.py b/samples/client/petstore/python-experimental/petstore_api/model/enum_test.py index bc0d1025261f..67916bf70944 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/enum_test.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/enum_test.py @@ -34,10 +34,10 @@ validate_get_composed_info, ) try: - from petstore_api.model import outer_enum + from petstore_api.model import string_enum except ImportError: - outer_enum = sys.modules[ - 'petstore_api.model.outer_enum'] + string_enum = sys.modules[ + 'petstore_api.model.string_enum'] class EnumTest(ModelNormal): @@ -107,7 +107,7 @@ def openapi_types(): 'enum_string': (str,), # noqa: E501 'enum_integer': (int,), # noqa: E501 'enum_number': (float,), # noqa: E501 - 'outer_enum': (outer_enum.OuterEnum,), # noqa: E501 + 'string_enum': (string_enum.StringEnum,), # noqa: E501 } @cached_property @@ -119,7 +119,7 @@ def discriminator(): 'enum_string': 'enum_string', # noqa: E501 'enum_integer': 'enum_integer', # noqa: E501 'enum_number': 'enum_number', # noqa: E501 - 'outer_enum': 'outerEnum', # noqa: E501 + 'string_enum': 'stringEnum', # noqa: E501 } _composed_schemas = {} @@ -174,7 +174,7 @@ def __init__(self, enum_string_required, *args, **kwargs): # noqa: E501 enum_string (str): [optional] # noqa: E501 enum_integer (int): [optional] # noqa: E501 enum_number (float): [optional] # noqa: E501 - outer_enum (outer_enum.OuterEnum): [optional] # noqa: E501 + string_enum (string_enum.StringEnum): [optional] # noqa: E501 """ _check_type = kwargs.pop('_check_type', True) diff --git a/samples/client/petstore/python-experimental/petstore_api/model/outer_number.py b/samples/client/petstore/python-experimental/petstore_api/model/number_with_validations.py similarity index 98% rename from samples/client/petstore/python-experimental/petstore_api/model/outer_number.py rename to samples/client/petstore/python-experimental/petstore_api/model/number_with_validations.py index e6d4d8d2768f..68e0e7e30e80 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/outer_number.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/number_with_validations.py @@ -35,7 +35,7 @@ ) -class OuterNumber(ModelSimple): +class NumberWithValidations(ModelSimple): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech @@ -102,7 +102,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, value, *args, **kwargs): # noqa: E501 - """outer_number.OuterNumber - a model defined in OpenAPI + """number_with_validations.NumberWithValidations - a model defined in OpenAPI Args: value (float): diff --git a/samples/client/petstore/python-experimental/petstore_api/model/outer_composite.py b/samples/client/petstore/python-experimental/petstore_api/model/object_model_with_ref_props.py similarity index 93% rename from samples/client/petstore/python-experimental/petstore_api/model/outer_composite.py rename to samples/client/petstore/python-experimental/petstore_api/model/object_model_with_ref_props.py index 5614b9afe422..f76243bc365e 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/outer_composite.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/object_model_with_ref_props.py @@ -34,13 +34,13 @@ validate_get_composed_info, ) try: - from petstore_api.model import outer_number + from petstore_api.model import number_with_validations except ImportError: - outer_number = sys.modules[ - 'petstore_api.model.outer_number'] + number_with_validations = sys.modules[ + 'petstore_api.model.number_with_validations'] -class OuterComposite(ModelNormal): +class ObjectModelWithRefProps(ModelNormal): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech @@ -85,7 +85,7 @@ def openapi_types(): and the value is attribute type. """ return { - 'my_number': (outer_number.OuterNumber,), # noqa: E501 + 'my_number': (number_with_validations.NumberWithValidations,), # noqa: E501 'my_string': (str,), # noqa: E501 'my_boolean': (bool,), # noqa: E501 } @@ -113,7 +113,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """outer_composite.OuterComposite - a model defined in OpenAPI + """object_model_with_ref_props.ObjectModelWithRefProps - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types @@ -146,7 +146,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 Animal class but this time we won't travel through its discriminator because we passed in _visited_composed_classes = (Animal,) - my_number (outer_number.OuterNumber): [optional] # noqa: E501 + my_number (number_with_validations.NumberWithValidations): [optional] # noqa: E501 my_string (str): [optional] # noqa: E501 my_boolean (bool): [optional] # noqa: E501 """ diff --git a/samples/client/petstore/python-experimental/petstore_api/model/outer_enum.py b/samples/client/petstore/python-experimental/petstore_api/model/string_enum.py similarity index 98% rename from samples/client/petstore/python-experimental/petstore_api/model/outer_enum.py rename to samples/client/petstore/python-experimental/petstore_api/model/string_enum.py index cbf2d5920fa8..9afa80bdc0b3 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/outer_enum.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/string_enum.py @@ -35,7 +35,7 @@ ) -class OuterEnum(ModelSimple): +class StringEnum(ModelSimple): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech @@ -103,7 +103,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, value, *args, **kwargs): # noqa: E501 - """outer_enum.OuterEnum - a model defined in OpenAPI + """string_enum.StringEnum - a model defined in OpenAPI Args: value (str): diff --git a/samples/client/petstore/python-experimental/petstore_api/models/__init__.py b/samples/client/petstore/python-experimental/petstore_api/models/__init__.py index e70777afd690..fcd25ce643ca 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/__init__.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/__init__.py @@ -57,10 +57,9 @@ from petstore_api.model.model_return import ModelReturn from petstore_api.model.name import Name from petstore_api.model.number_only import NumberOnly +from petstore_api.model.number_with_validations import NumberWithValidations +from petstore_api.model.object_model_with_ref_props import ObjectModelWithRefProps from petstore_api.model.order import Order -from petstore_api.model.outer_composite import OuterComposite -from petstore_api.model.outer_enum import OuterEnum -from petstore_api.model.outer_number import OuterNumber from petstore_api.model.parent import Parent from petstore_api.model.parent_all_of import ParentAllOf from petstore_api.model.parent_pet import ParentPet @@ -69,6 +68,7 @@ from petstore_api.model.read_only_first import ReadOnlyFirst from petstore_api.model.special_model_name import SpecialModelName from petstore_api.model.string_boolean_map import StringBooleanMap +from petstore_api.model.string_enum import StringEnum from petstore_api.model.tag import Tag from petstore_api.model.type_holder_default import TypeHolderDefault from petstore_api.model.type_holder_example import TypeHolderExample diff --git a/samples/client/petstore/python-experimental/test/test_enum_test.py b/samples/client/petstore/python-experimental/test/test_enum_test.py index 0ada34cdc1f2..7b4c1b6b66ac 100644 --- a/samples/client/petstore/python-experimental/test/test_enum_test.py +++ b/samples/client/petstore/python-experimental/test/test_enum_test.py @@ -16,10 +16,10 @@ import petstore_api try: - from petstore_api.model import outer_enum + from petstore_api.model import string_enum except ImportError: - outer_enum = sys.modules[ - 'petstore_api.model.outer_enum'] + string_enum = sys.modules[ + 'petstore_api.model.string_enum'] from petstore_api.model.enum_test import EnumTest diff --git a/samples/client/petstore/python-experimental/test/test_fake_api.py b/samples/client/petstore/python-experimental/test/test_fake_api.py index 8c49c709ef5e..2e11cdbc377a 100644 --- a/samples/client/petstore/python-experimental/test/test_fake_api.py +++ b/samples/client/petstore/python-experimental/test/test_fake_api.py @@ -34,43 +34,58 @@ def test_create_xml_item(self): """ pass - def test_fake_outer_boolean_serialize(self): - """Test case for fake_outer_boolean_serialize + def test_boolean(self): + """Test case for boolean """ - pass + endpoint = self.api.boolean + assert endpoint.openapi_types['body'] == (bool,) + assert endpoint.settings['response_type'] == (bool,) - def test_fake_outer_composite_serialize(self): - """Test case for fake_outer_composite_serialize + def test_string(self): + """Test case for string """ - pass + from petstore_api.model_utils import str + endpoint = self.api.string + assert endpoint.openapi_types['body'] == (str,) + assert endpoint.settings['response_type'] == (str,) - def test_fake_outer_enum_serialize(self): - """Test case for fake_outer_enum_serialize + def test_object_model_with_ref_props(self): + """Test case for object_model_with_ref_props """ - # verify that the input and output are type OuterEnum - from petstore_api.model import outer_enum - endpoint = self.api.fake_outer_enum_serialize - assert endpoint.openapi_types['body'] == (outer_enum.OuterEnum,) - assert endpoint.settings['response_type'] == (outer_enum.OuterEnum,) + from petstore_api.model import object_model_with_ref_props + endpoint = self.api.object_model_with_ref_props + assert endpoint.openapi_types['body'] == (object_model_with_ref_props.ObjectModelWithRefProps,) + assert endpoint.settings['response_type'] == (object_model_with_ref_props.ObjectModelWithRefProps,) - def test_fake_outer_number_serialize(self): - """Test case for fake_outer_number_serialize + def test_string_enum(self): + """Test case for string_enum """ - # verify that the input and output are the correct type - from petstore_api.model import outer_number - endpoint = self.api.fake_outer_number_serialize - assert endpoint.openapi_types['body'] == (outer_number.OuterNumber,) - assert endpoint.settings['response_type'] == (outer_number.OuterNumber,) + from petstore_api.model import string_enum + endpoint = self.api.string_enum + assert endpoint.openapi_types['body'] == (string_enum.StringEnum,) + assert endpoint.settings['response_type'] == (string_enum.StringEnum,) - def test_fake_outer_string_serialize(self): - """Test case for fake_outer_string_serialize + def test_array_model(self): + """Test case for array_model """ - pass + from petstore_api.model import animal_farm + endpoint = self.api.array_model + assert endpoint.openapi_types['body'] == (animal_farm.AnimalFarm,) + assert endpoint.settings['response_type'] == (animal_farm.AnimalFarm,) + + def test_number_with_validations(self): + """Test case for number_with_validations + + """ + from petstore_api.model import number_with_validations + endpoint = self.api.number_with_validations + assert endpoint.openapi_types['body'] == (number_with_validations.NumberWithValidations,) + assert endpoint.settings['response_type'] == (number_with_validations.NumberWithValidations,) def test_test_body_with_file_schema(self): """Test case for test_body_with_file_schema diff --git a/samples/client/petstore/python-experimental/test/test_number_with_validations.py b/samples/client/petstore/python-experimental/test/test_number_with_validations.py new file mode 100644 index 000000000000..3f0b78835d4b --- /dev/null +++ b/samples/client/petstore/python-experimental/test/test_number_with_validations.py @@ -0,0 +1,45 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use 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 __future__ import absolute_import +import sys +import unittest + +import petstore_api +from petstore_api.model.number_with_validations import NumberWithValidations + + +class TestNumberWithValidations(unittest.TestCase): + """NumberWithValidations unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testNumberWithValidations(self): + """Test NumberWithValidations""" + valid_values = [10.0, 15.0, 20.0] + for valid_value in valid_values: + model = NumberWithValidations(valid_value) + assert model.value == valid_value + + invalid_values = [9.0, 21.0] + for invalid_value in invalid_values: + with self.assertRaises(petstore_api.ApiValueError): + NumberWithValidations(invalid_value) + + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python-experimental/test/test_object_model_with_ref_props.py b/samples/client/petstore/python-experimental/test/test_object_model_with_ref_props.py new file mode 100644 index 000000000000..e0a8b842685b --- /dev/null +++ b/samples/client/petstore/python-experimental/test/test_object_model_with_ref_props.py @@ -0,0 +1,49 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use 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 __future__ import absolute_import +import sys +import unittest + +import petstore_api +try: + from petstore_api.model import number_with_validations +except ImportError: + number_with_validations = sys.modules[ + 'petstore_api.model.number_with_validations'] +from petstore_api.model.object_model_with_ref_props import ObjectModelWithRefProps + + +class TestObjectModelWithRefProps(unittest.TestCase): + """ObjectModelWithRefProps unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testObjectModelWithRefProps(self): + """Test ObjectModelWithRefProps""" + from petstore_api.model.object_model_with_ref_props import str, number_with_validations + self.assertEqual( + ObjectModelWithRefProps.openapi_types, + { + 'my_number': (number_with_validations.NumberWithValidations,), + 'my_string': (str,), + 'my_boolean': (bool,), + } + ) + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python-experimental/test/test_outer_enum.py b/samples/client/petstore/python-experimental/test/test_string_enum.py similarity index 68% rename from samples/client/petstore/python-experimental/test/test_outer_enum.py rename to samples/client/petstore/python-experimental/test/test_string_enum.py index ff84ad3ba6d4..5eed0ad6f0e9 100644 --- a/samples/client/petstore/python-experimental/test/test_outer_enum.py +++ b/samples/client/petstore/python-experimental/test/test_string_enum.py @@ -15,11 +15,11 @@ import unittest import petstore_api -from petstore_api.model.outer_enum import OuterEnum +from petstore_api.model.string_enum import StringEnum -class TestOuterEnum(unittest.TestCase): - """OuterEnum unit test stubs""" +class TestStringEnum(unittest.TestCase): + """StringEnum unit test stubs""" def setUp(self): pass @@ -27,20 +27,22 @@ def setUp(self): def tearDown(self): pass - def testOuterEnum(self): + def testStringEnum(self): + """Test StringEnum""" + """Test OuterEnum""" # make sure that we can access its allowed_values - assert OuterEnum.allowed_values[('value',)] == { + assert StringEnum.allowed_values[('value',)] == { 'PLACED': "placed", 'APPROVED': "approved", 'DELIVERED': "delivered" } # make sure that an exception is thrown on an invalid value with self.assertRaises(petstore_api.ApiValueError): - OuterEnum('bad_value') + StringEnum('bad_value') # make sure valid value works - valid_value = OuterEnum.allowed_values[('value',)]['PLACED'] - assert valid_value == OuterEnum(valid_value).value + valid_value = StringEnum.allowed_values[('value',)]['PLACED'] + assert valid_value == StringEnum(valid_value).value if __name__ == '__main__': diff --git a/samples/client/petstore/python-experimental/tests/test_deserialization.py b/samples/client/petstore/python-experimental/tests/test_deserialization.py index f73af24a9425..a3eca81f32fc 100644 --- a/samples/client/petstore/python-experimental/tests/test_deserialization.py +++ b/samples/client/petstore/python-experimental/tests/test_deserialization.py @@ -32,8 +32,8 @@ parent_pet, child_lizard, category, - outer_enum, - outer_number, + string_enum, + number_with_validations, string_boolean_map, ) from petstore_api.model_utils import ( @@ -61,7 +61,7 @@ def test_enum_test(self): "enum_string_required": "lower", "enum_integer": 1, "enum_number": 1.1, - "outerEnum": "placed" + "stringEnum": "placed" } } response = MockResponse(data=json.dumps(data)) @@ -72,14 +72,14 @@ def test_enum_test(self): self.assertTrue( isinstance(deserialized['enum_test'], enum_test.EnumTest)) value = ( - outer_enum.OuterEnum.allowed_values[('value',)]["PLACED"]) - outer_enum_val = outer_enum.OuterEnum(value) + string_enum.StringEnum.allowed_values[('value',)]["PLACED"]) + string_enum_val = string_enum.StringEnum(value) sample_instance = enum_test.EnumTest( enum_string="UPPER", enum_string_required="lower", enum_integer=1, enum_number=1.1, - outer_enum=outer_enum_val + string_enum=string_enum_val ) self.assertEqual(deserialized['enum_test'], sample_instance) @@ -305,27 +305,27 @@ def test_deserialize_OuterEnum(self): with self.assertRaises(ApiValueError): self.deserialize( MockResponse(data=json.dumps("test str")), - (outer_enum.OuterEnum,), + (string_enum.StringEnum,), True ) # valid value works placed_str = ( - outer_enum.OuterEnum.allowed_values[('value',)]["PLACED"] + string_enum.StringEnum.allowed_values[('value',)]["PLACED"] ) response = MockResponse(data=json.dumps(placed_str)) deserialized = self.deserialize(response, - (outer_enum.OuterEnum,), True) - self.assertTrue(isinstance(deserialized, outer_enum.OuterEnum)) + (string_enum.StringEnum,), True) + self.assertTrue(isinstance(deserialized, string_enum.StringEnum)) self.assertTrue(deserialized.value == placed_str) - def test_deserialize_OuterNumber(self): - """ deserialize OuterNumber """ + def test_deserialize_NumberWithValidations(self): + """ deserialize NumberWithValidations """ # make sure that an exception is thrown on an invalid type value with self.assertRaises(ApiTypeError): deserialized = self.deserialize( MockResponse(data=json.dumps("test str")), - (outer_number.OuterNumber,), + (number_with_validations.NumberWithValidations,), True ) @@ -333,7 +333,7 @@ def test_deserialize_OuterNumber(self): with self.assertRaises(ApiValueError): deserialized = self.deserialize( MockResponse(data=json.dumps(21.0)), - (outer_number.OuterNumber,), + (number_with_validations.NumberWithValidations,), True ) @@ -341,8 +341,8 @@ def test_deserialize_OuterNumber(self): number_val = 11.0 response = MockResponse(data=json.dumps(number_val)) number = self.deserialize(response, - (outer_number.OuterNumber,), True) - self.assertTrue(isinstance(number, outer_number.OuterNumber)) + (number_with_validations.NumberWithValidations,), True) + self.assertTrue(isinstance(number, number_with_validations.NumberWithValidations)) self.assertTrue(number.value == number_val) def test_deserialize_file(self): diff --git a/samples/client/petstore/python-experimental/tests/test_serialization.py b/samples/client/petstore/python-experimental/tests/test_serialization.py index 4b9e57652c5d..497c3b6dfcfb 100644 --- a/samples/client/petstore/python-experimental/tests/test_serialization.py +++ b/samples/client/petstore/python-experimental/tests/test_serialization.py @@ -32,8 +32,7 @@ parent_pet, child_lizard, category, - outer_enum, - outer_number, + string_enum, string_boolean_map, ) from petstore_api.model_utils import ( @@ -56,15 +55,15 @@ def setUp(self): def test_enum_test(self): """ serialize dict(str, Enum_Test) """ value = ( - outer_enum.OuterEnum.allowed_values[('value',)]["PLACED"]) - outer_enum_val = outer_enum.OuterEnum(value) + string_enum.StringEnum.allowed_values[('value',)]["PLACED"]) + string_enum_val = string_enum.StringEnum(value) source = enum_test.EnumTest( enum_string="UPPER", enum_string_required="lower", enum_integer=1, enum_number=1.1, - outer_enum=outer_enum_val + string_enum=string_enum_val ) result = { @@ -73,7 +72,7 @@ def test_enum_test(self): "enum_string_required": "lower", "enum_integer": 1, "enum_number": 1.1, - "outerEnum": "placed" + "stringEnum": "placed" } } serialized = self.serialize({"enum_test": source}) diff --git a/samples/openapi3/client/petstore/python-experimental/.openapi-generator/FILES b/samples/openapi3/client/petstore/python-experimental/.openapi-generator/FILES index c66cd6a9744a..6fe59537b824 100644 --- a/samples/openapi3/client/petstore/python-experimental/.openapi-generator/FILES +++ b/samples/openapi3/client/petstore/python-experimental/.openapi-generator/FILES @@ -55,6 +55,9 @@ docs/InlineObject3.md docs/InlineObject4.md docs/InlineObject5.md docs/InlineResponseDefault.md +docs/IntegerEnum.md +docs/IntegerEnumOneValue.md +docs/IntegerEnumWithDefaultValue.md docs/IsoscelesTriangle.md docs/List.md docs/Mammal.md @@ -66,12 +69,9 @@ docs/Name.md docs/NullableClass.md docs/NullableShape.md docs/NumberOnly.md +docs/NumberWithValidations.md +docs/ObjectModelWithRefProps.md docs/Order.md -docs/OuterComposite.md -docs/OuterEnum.md -docs/OuterEnumDefaultValue.md -docs/OuterEnumInteger.md -docs/OuterEnumIntegerDefaultValue.md docs/ParentPet.md docs/Pet.md docs/PetApi.md @@ -87,6 +87,8 @@ docs/SimpleQuadrilateral.md docs/SpecialModelName.md docs/StoreApi.md docs/StringBooleanMap.md +docs/StringEnum.md +docs/StringEnumWithDefaultValue.md docs/Tag.md docs/Triangle.md docs/TriangleInterface.md @@ -158,6 +160,9 @@ petstore_api/model/inline_object3.py petstore_api/model/inline_object4.py petstore_api/model/inline_object5.py petstore_api/model/inline_response_default.py +petstore_api/model/integer_enum.py +petstore_api/model/integer_enum_one_value.py +petstore_api/model/integer_enum_with_default_value.py petstore_api/model/isosceles_triangle.py petstore_api/model/list.py petstore_api/model/mammal.py @@ -169,12 +174,9 @@ petstore_api/model/name.py petstore_api/model/nullable_class.py petstore_api/model/nullable_shape.py petstore_api/model/number_only.py +petstore_api/model/number_with_validations.py +petstore_api/model/object_model_with_ref_props.py petstore_api/model/order.py -petstore_api/model/outer_composite.py -petstore_api/model/outer_enum.py -petstore_api/model/outer_enum_default_value.py -petstore_api/model/outer_enum_integer.py -petstore_api/model/outer_enum_integer_default_value.py petstore_api/model/parent_pet.py petstore_api/model/pet.py petstore_api/model/pig.py @@ -188,6 +190,8 @@ petstore_api/model/shape_or_null.py petstore_api/model/simple_quadrilateral.py petstore_api/model/special_model_name.py petstore_api/model/string_boolean_map.py +petstore_api/model/string_enum.py +petstore_api/model/string_enum_with_default_value.py petstore_api/model/tag.py petstore_api/model/triangle.py petstore_api/model/triangle_interface.py diff --git a/samples/openapi3/client/petstore/python-experimental/README.md b/samples/openapi3/client/petstore/python-experimental/README.md index 867771e629f3..566caf9dd196 100644 --- a/samples/openapi3/client/petstore/python-experimental/README.md +++ b/samples/openapi3/client/petstore/python-experimental/README.md @@ -82,13 +82,15 @@ Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- *AnotherFakeApi* | [**call_123_test_special_tags**](docs/AnotherFakeApi.md#call_123_test_special_tags) | **PATCH** /another-fake/dummy | To test special tags *DefaultApi* | [**foo_get**](docs/DefaultApi.md#foo_get) | **GET** /foo | +*FakeApi* | [**additional_properties_with_array_of_enums**](docs/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/FakeApi.md#array_model) | **POST** /fake/refs/arraymodel | +*FakeApi* | [**array_of_enums**](docs/FakeApi.md#array_of_enums) | **POST** /fake/refs/array-of-enums | Array of Enums +*FakeApi* | [**boolean**](docs/FakeApi.md#boolean) | **POST** /fake/refs/boolean | *FakeApi* | [**fake_health_get**](docs/FakeApi.md#fake_health_get) | **GET** /fake/health | Health check endpoint -*FakeApi* | [**fake_outer_boolean_serialize**](docs/FakeApi.md#fake_outer_boolean_serialize) | **POST** /fake/outer/boolean | -*FakeApi* | [**fake_outer_composite_serialize**](docs/FakeApi.md#fake_outer_composite_serialize) | **POST** /fake/outer/composite | -*FakeApi* | [**fake_outer_number_serialize**](docs/FakeApi.md#fake_outer_number_serialize) | **POST** /fake/outer/number | -*FakeApi* | [**fake_outer_string_serialize**](docs/FakeApi.md#fake_outer_string_serialize) | **POST** /fake/outer/string | -*FakeApi* | [**get_additional_properties_with_array_of_enums**](docs/FakeApi.md#get_additional_properties_with_array_of_enums) | **GET** /fake/additional-properties-with-array-of-enums | Additional Properties with Array of Enums -*FakeApi* | [**get_array_of_enums**](docs/FakeApi.md#get_array_of_enums) | **GET** /fake/array-of-enums | Array of Enums +*FakeApi* | [**number_with_validations**](docs/FakeApi.md#number_with_validations) | **POST** /fake/refs/number | +*FakeApi* | [**object_model_with_ref_props**](docs/FakeApi.md#object_model_with_ref_props) | **POST** /fake/refs/object_model_with_ref_props | +*FakeApi* | [**string**](docs/FakeApi.md#string) | **POST** /fake/refs/string | +*FakeApi* | [**string_enum**](docs/FakeApi.md#string_enum) | **POST** /fake/refs/enum | *FakeApi* | [**test_body_with_file_schema**](docs/FakeApi.md#test_body_with_file_schema) | **PUT** /fake/body-with-file-schema | *FakeApi* | [**test_body_with_query_params**](docs/FakeApi.md#test_body_with_query_params) | **PUT** /fake/body-with-query-params | *FakeApi* | [**test_client_model**](docs/FakeApi.md#test_client_model) | **PATCH** /fake | To test \"client\" model @@ -173,6 +175,9 @@ Class | Method | HTTP request | Description - [inline_object4.InlineObject4](docs/InlineObject4.md) - [inline_object5.InlineObject5](docs/InlineObject5.md) - [inline_response_default.InlineResponseDefault](docs/InlineResponseDefault.md) + - [integer_enum.IntegerEnum](docs/IntegerEnum.md) + - [integer_enum_one_value.IntegerEnumOneValue](docs/IntegerEnumOneValue.md) + - [integer_enum_with_default_value.IntegerEnumWithDefaultValue](docs/IntegerEnumWithDefaultValue.md) - [isosceles_triangle.IsoscelesTriangle](docs/IsoscelesTriangle.md) - [list.List](docs/List.md) - [mammal.Mammal](docs/Mammal.md) @@ -184,12 +189,9 @@ Class | Method | HTTP request | Description - [nullable_class.NullableClass](docs/NullableClass.md) - [nullable_shape.NullableShape](docs/NullableShape.md) - [number_only.NumberOnly](docs/NumberOnly.md) + - [number_with_validations.NumberWithValidations](docs/NumberWithValidations.md) + - [object_model_with_ref_props.ObjectModelWithRefProps](docs/ObjectModelWithRefProps.md) - [order.Order](docs/Order.md) - - [outer_composite.OuterComposite](docs/OuterComposite.md) - - [outer_enum.OuterEnum](docs/OuterEnum.md) - - [outer_enum_default_value.OuterEnumDefaultValue](docs/OuterEnumDefaultValue.md) - - [outer_enum_integer.OuterEnumInteger](docs/OuterEnumInteger.md) - - [outer_enum_integer_default_value.OuterEnumIntegerDefaultValue](docs/OuterEnumIntegerDefaultValue.md) - [parent_pet.ParentPet](docs/ParentPet.md) - [pet.Pet](docs/Pet.md) - [pig.Pig](docs/Pig.md) @@ -203,6 +205,8 @@ Class | Method | HTTP request | Description - [simple_quadrilateral.SimpleQuadrilateral](docs/SimpleQuadrilateral.md) - [special_model_name.SpecialModelName](docs/SpecialModelName.md) - [string_boolean_map.StringBooleanMap](docs/StringBooleanMap.md) + - [string_enum.StringEnum](docs/StringEnum.md) + - [string_enum_with_default_value.StringEnumWithDefaultValue](docs/StringEnumWithDefaultValue.md) - [tag.Tag](docs/Tag.md) - [triangle.Triangle](docs/Triangle.md) - [triangle_interface.TriangleInterface](docs/TriangleInterface.md) diff --git a/samples/openapi3/client/petstore/python-experimental/docs/ArrayOfEnums.md b/samples/openapi3/client/petstore/python-experimental/docs/ArrayOfEnums.md index ad9394655bcb..e12fa68b8e97 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/ArrayOfEnums.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/ArrayOfEnums.md @@ -3,7 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**value** | [**[outer_enum.OuterEnum, none_type]**](OuterEnum.md) | | +**value** | [**[string_enum.StringEnum, none_type]**](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-experimental/docs/EnumTest.md b/samples/openapi3/client/petstore/python-experimental/docs/EnumTest.md index aee196204f99..2cc9d528f009 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/EnumTest.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/EnumTest.md @@ -7,10 +7,11 @@ Name | Type | Description | Notes **enum_string** | **str** | | [optional] **enum_integer** | **int** | | [optional] **enum_number** | **float** | | [optional] -**outer_enum** | [**outer_enum.OuterEnum**](OuterEnum.md) | | [optional] -**outer_enum_integer** | [**outer_enum_integer.OuterEnumInteger**](OuterEnumInteger.md) | | [optional] -**outer_enum_default_value** | [**outer_enum_default_value.OuterEnumDefaultValue**](OuterEnumDefaultValue.md) | | [optional] -**outer_enum_integer_default_value** | [**outer_enum_integer_default_value.OuterEnumIntegerDefaultValue**](OuterEnumIntegerDefaultValue.md) | | [optional] +**string_enum** | [**string_enum.StringEnum**](StringEnum.md) | | [optional] +**integer_enum** | [**integer_enum.IntegerEnum**](IntegerEnum.md) | | [optional] +**string_enum_with_default_value** | [**string_enum_with_default_value.StringEnumWithDefaultValue**](StringEnumWithDefaultValue.md) | | [optional] +**integer_enum_with_default_value** | [**integer_enum_with_default_value.IntegerEnumWithDefaultValue**](IntegerEnumWithDefaultValue.md) | | [optional] +**integer_enum_one_value** | [**integer_enum_one_value.IntegerEnumOneValue**](IntegerEnumOneValue.md) | | [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-experimental/docs/FakeApi.md b/samples/openapi3/client/petstore/python-experimental/docs/FakeApi.md index 44c53b45962a..ee5ce04f55f5 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/FakeApi.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/FakeApi.md @@ -4,13 +4,15 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- +[**additional_properties_with_array_of_enums**](FakeApi.md#additional_properties_with_array_of_enums) | **GET** /fake/additional-properties-with-array-of-enums | Additional Properties with Array of Enums +[**array_model**](FakeApi.md#array_model) | **POST** /fake/refs/arraymodel | +[**array_of_enums**](FakeApi.md#array_of_enums) | **POST** /fake/refs/array-of-enums | Array of Enums +[**boolean**](FakeApi.md#boolean) | **POST** /fake/refs/boolean | [**fake_health_get**](FakeApi.md#fake_health_get) | **GET** /fake/health | Health check endpoint -[**fake_outer_boolean_serialize**](FakeApi.md#fake_outer_boolean_serialize) | **POST** /fake/outer/boolean | -[**fake_outer_composite_serialize**](FakeApi.md#fake_outer_composite_serialize) | **POST** /fake/outer/composite | -[**fake_outer_number_serialize**](FakeApi.md#fake_outer_number_serialize) | **POST** /fake/outer/number | -[**fake_outer_string_serialize**](FakeApi.md#fake_outer_string_serialize) | **POST** /fake/outer/string | -[**get_additional_properties_with_array_of_enums**](FakeApi.md#get_additional_properties_with_array_of_enums) | **GET** /fake/additional-properties-with-array-of-enums | Additional Properties with Array of Enums -[**get_array_of_enums**](FakeApi.md#get_array_of_enums) | **GET** /fake/array-of-enums | Array of Enums +[**number_with_validations**](FakeApi.md#number_with_validations) | **POST** /fake/refs/number | +[**object_model_with_ref_props**](FakeApi.md#object_model_with_ref_props) | **POST** /fake/refs/object_model_with_ref_props | +[**string**](FakeApi.md#string) | **POST** /fake/refs/string | +[**string_enum**](FakeApi.md#string_enum) | **POST** /fake/refs/enum | [**test_body_with_file_schema**](FakeApi.md#test_body_with_file_schema) | **PUT** /fake/body-with-file-schema | [**test_body_with_query_params**](FakeApi.md#test_body_with_query_params) | **PUT** /fake/body-with-query-params | [**test_client_model**](FakeApi.md#test_client_model) | **PATCH** /fake | To test \"client\" model @@ -22,10 +24,10 @@ Method | HTTP request | Description [**test_query_parameter_collection_format**](FakeApi.md#test_query_parameter_collection_format) | **PUT** /fake/test-query-paramters | -# **fake_health_get** -> health_check_result.HealthCheckResult fake_health_get() +# **additional_properties_with_array_of_enums** +> additional_properties_with_array_of_enums.AdditionalPropertiesWithArrayOfEnums additional_properties_with_array_of_enums() -Health check endpoint +Additional Properties with Array of Enums ### Example @@ -34,7 +36,7 @@ from __future__ import print_function import time import petstore_api from petstore_api.api import fake_api -from petstore_api.model import health_check_result +from petstore_api.model import additional_properties_with_array_of_enums 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. @@ -47,22 +49,27 @@ configuration = petstore_api.Configuration( with petstore_api.ApiClient() 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 + additional_properties_with_array_of_enums_additional_properties_with_array_of_enums = additional_properties_with_array_of_enums.AdditionalPropertiesWithArrayOfEnums() # additional_properties_with_array_of_enums.AdditionalPropertiesWithArrayOfEnums | Input enum (optional) + + # example passing only required values which don't have defaults set + # and optional values try: - # Health check endpoint - api_response = api_instance.fake_health_get() + # Additional Properties with Array of Enums + api_response = api_instance.additional_properties_with_array_of_enums(additional_properties_with_array_of_enums_additional_properties_with_array_of_enums=additional_properties_with_array_of_enums_additional_properties_with_array_of_enums) pprint(api_response) except petstore_api.ApiException as e: - print("Exception when calling FakeApi->fake_health_get: %s\n" % e) + print("Exception when calling FakeApi->additional_properties_with_array_of_enums: %s\n" % e) ``` ### Parameters -This endpoint does not need any parameter. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **additional_properties_with_array_of_enums_additional_properties_with_array_of_enums** | [**additional_properties_with_array_of_enums.AdditionalPropertiesWithArrayOfEnums**](AdditionalPropertiesWithArrayOfEnums.md)| Input enum | [optional] ### Return type -[**health_check_result.HealthCheckResult**](HealthCheckResult.md) +[**additional_properties_with_array_of_enums.AdditionalPropertiesWithArrayOfEnums**](AdditionalPropertiesWithArrayOfEnums.md) ### Authorization @@ -70,22 +77,22 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: application/json - **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | The instance started successfully | - | +**200** | Got object with additional properties with array of enums | - | [[Back to top]](#) [[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_outer_boolean_serialize** -> bool fake_outer_boolean_serialize() +# **array_model** +> animal_farm.AnimalFarm array_model() -Test serialization of outer boolean types +Test serialization of ArrayModel ### Example @@ -94,6 +101,7 @@ from __future__ import print_function import time import petstore_api from petstore_api.api import fake_api +from petstore_api.model import animal_farm 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. @@ -106,26 +114,26 @@ configuration = petstore_api.Configuration( with petstore_api.ApiClient() as api_client: # Create an instance of the API class api_instance = fake_api.FakeApi(api_client) - body = True # bool | Input boolean as post body (optional) + body = animal_farm.AnimalFarm() # animal_farm.AnimalFarm | Input model (optional) # example passing only required values which don't have defaults set # and optional values try: - api_response = api_instance.fake_outer_boolean_serialize(body=body) + api_response = api_instance.array_model(body=body) pprint(api_response) except petstore_api.ApiException as e: - print("Exception when calling FakeApi->fake_outer_boolean_serialize: %s\n" % e) + print("Exception when calling FakeApi->array_model: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | **bool**| Input boolean as post body | [optional] + **body** | [**animal_farm.AnimalFarm**](AnimalFarm.md)| Input model | [optional] ### Return type -**bool** +[**animal_farm.AnimalFarm**](AnimalFarm.md) ### Authorization @@ -134,21 +142,84 @@ No authorization required ### HTTP request headers - **Content-Type**: application/json - - **Accept**: */* + - **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Output boolean | - | +**200** | Output model | - | + +[[Back to top]](#) [[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** +> array_of_enums.ArrayOfEnums array_of_enums() + +Array of Enums + +### Example + +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.api import fake_api +from petstore_api.model import array_of_enums +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() as api_client: + # Create an instance of the API class + api_instance = fake_api.FakeApi(api_client) + array_of_enums_array_of_enums = array_of_enums.ArrayOfEnums() # array_of_enums.ArrayOfEnums | Input enum (optional) + + # example passing only required values which don't have defaults set + # and optional values + try: + # Array of Enums + api_response = api_instance.array_of_enums(array_of_enums_array_of_enums=array_of_enums_array_of_enums) + 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 +------------- | ------------- | ------------- | ------------- + **array_of_enums_array_of_enums** | [**array_of_enums.ArrayOfEnums**](ArrayOfEnums.md)| Input enum | [optional] + +### Return type + +[**array_of_enums.ArrayOfEnums**](ArrayOfEnums.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Got named array of enums | - | [[Back to top]](#) [[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_outer_composite_serialize** -> outer_composite.OuterComposite fake_outer_composite_serialize() +# **boolean** +> bool boolean() -Test serialization of object with outer number type +Test serialization of outer boolean types ### Example @@ -157,7 +228,6 @@ from __future__ import print_function import time import petstore_api from petstore_api.api import fake_api -from petstore_api.model import outer_composite 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. @@ -170,26 +240,26 @@ configuration = petstore_api.Configuration( with petstore_api.ApiClient() as api_client: # Create an instance of the API class api_instance = fake_api.FakeApi(api_client) - outer_composite_outer_composite = outer_composite.OuterComposite() # outer_composite.OuterComposite | Input composite as post body (optional) + body = True # bool | Input boolean as post body (optional) # example passing only required values which don't have defaults set # and optional values try: - api_response = api_instance.fake_outer_composite_serialize(outer_composite_outer_composite=outer_composite_outer_composite) + api_response = api_instance.boolean(body=body) pprint(api_response) except petstore_api.ApiException as e: - print("Exception when calling FakeApi->fake_outer_composite_serialize: %s\n" % e) + print("Exception when calling FakeApi->boolean: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **outer_composite_outer_composite** | [**outer_composite.OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] + **body** | **bool**| Input boolean as post body | [optional] ### Return type -[**outer_composite.OuterComposite**](OuterComposite.md) +**bool** ### Authorization @@ -198,17 +268,75 @@ No authorization required ### HTTP request headers - **Content-Type**: application/json - - **Accept**: */* + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Output boolean | - | + +[[Back to top]](#) [[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** +> health_check_result.HealthCheckResult fake_health_get() + +Health check endpoint + +### Example + +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.api import fake_api +from petstore_api.model import health_check_result +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() 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 type + +[**health_check_result.HealthCheckResult**](HealthCheckResult.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Output composite | - | +**200** | The instance started successfully | - | [[Back to top]](#) [[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_outer_number_serialize** -> float fake_outer_number_serialize() +# **number_with_validations** +> number_with_validations.NumberWithValidations number_with_validations() @@ -221,6 +349,7 @@ from __future__ import print_function import time import petstore_api from petstore_api.api import fake_api +from petstore_api.model import number_with_validations 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. @@ -233,26 +362,26 @@ configuration = petstore_api.Configuration( with petstore_api.ApiClient() as api_client: # Create an instance of the API class api_instance = fake_api.FakeApi(api_client) - body = 3.4 # float | Input number as post body (optional) + body = number_with_validations.NumberWithValidations(3.4) # number_with_validations.NumberWithValidations | Input number as post body (optional) # example passing only required values which don't have defaults set # and optional values try: - api_response = api_instance.fake_outer_number_serialize(body=body) + api_response = api_instance.number_with_validations(body=body) pprint(api_response) except petstore_api.ApiException as e: - print("Exception when calling FakeApi->fake_outer_number_serialize: %s\n" % e) + print("Exception when calling FakeApi->number_with_validations: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | **float**| Input number as post body | [optional] + **body** | [**number_with_validations.NumberWithValidations**](NumberWithValidations.md)| Input number as post body | [optional] ### Return type -**float** +[**number_with_validations.NumberWithValidations**](NumberWithValidations.md) ### Authorization @@ -261,7 +390,7 @@ No authorization required ### HTTP request headers - **Content-Type**: application/json - - **Accept**: */* + - **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | @@ -270,12 +399,12 @@ No authorization required [[Back to top]](#) [[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_outer_string_serialize** -> str fake_outer_string_serialize() +# **object_model_with_ref_props** +> object_model_with_ref_props.ObjectModelWithRefProps object_model_with_ref_props() -Test serialization of outer string types +Test serialization of object with $refed properties ### Example @@ -284,6 +413,7 @@ from __future__ import print_function import time import petstore_api from petstore_api.api import fake_api +from petstore_api.model import object_model_with_ref_props 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. @@ -296,26 +426,26 @@ configuration = petstore_api.Configuration( with petstore_api.ApiClient() as api_client: # Create an instance of the API class api_instance = fake_api.FakeApi(api_client) - body = 'body_example' # str | Input string as post body (optional) + body = object_model_with_ref_props.ObjectModelWithRefProps() # object_model_with_ref_props.ObjectModelWithRefProps | Input model (optional) # example passing only required values which don't have defaults set # and optional values try: - api_response = api_instance.fake_outer_string_serialize(body=body) + 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->fake_outer_string_serialize: %s\n" % e) + print("Exception when calling FakeApi->object_model_with_ref_props: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | **str**| Input string as post body | [optional] + **body** | [**object_model_with_ref_props.ObjectModelWithRefProps**](ObjectModelWithRefProps.md)| Input model | [optional] ### Return type -**str** +[**object_model_with_ref_props.ObjectModelWithRefProps**](ObjectModelWithRefProps.md) ### Authorization @@ -324,19 +454,21 @@ No authorization required ### HTTP request headers - **Content-Type**: application/json - - **Accept**: */* + - **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Output string | - | +**200** | Output model | - | [[Back to top]](#) [[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_additional_properties_with_array_of_enums** -> additional_properties_with_array_of_enums.AdditionalPropertiesWithArrayOfEnums get_additional_properties_with_array_of_enums() +# **string** +> str string() -Additional Properties with Array of Enums + + +Test serialization of outer string types ### Example @@ -345,7 +477,6 @@ from __future__ import print_function import time import petstore_api from petstore_api.api import fake_api -from petstore_api.model import additional_properties_with_array_of_enums 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. @@ -358,22 +489,26 @@ configuration = petstore_api.Configuration( with petstore_api.ApiClient() 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 + body = 'body_example' # str | Input string as post body (optional) + + # example passing only required values which don't have defaults set + # and optional values try: - # Additional Properties with Array of Enums - api_response = api_instance.get_additional_properties_with_array_of_enums() + api_response = api_instance.string(body=body) pprint(api_response) except petstore_api.ApiException as e: - print("Exception when calling FakeApi->get_additional_properties_with_array_of_enums: %s\n" % e) + print("Exception when calling FakeApi->string: %s\n" % e) ``` ### Parameters -This endpoint does not need any parameter. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | **str**| Input string as post body | [optional] ### Return type -[**additional_properties_with_array_of_enums.AdditionalPropertiesWithArrayOfEnums**](AdditionalPropertiesWithArrayOfEnums.md) +**str** ### Authorization @@ -381,20 +516,22 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: application/json - **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Got object with additional properties with array of enums | - | +**200** | Output string | - | [[Back to top]](#) [[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_array_of_enums** -> array_of_enums.ArrayOfEnums get_array_of_enums() +# **string_enum** +> string_enum.StringEnum string_enum() -Array of Enums + + +Test serialization of outer enum ### Example @@ -403,7 +540,7 @@ from __future__ import print_function import time import petstore_api from petstore_api.api import fake_api -from petstore_api.model import array_of_enums +from petstore_api.model import string_enum 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. @@ -416,22 +553,26 @@ configuration = petstore_api.Configuration( with petstore_api.ApiClient() 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 + body = string_enum.StringEnum("placed") # string_enum.StringEnum | Input enum (optional) + + # example passing only required values which don't have defaults set + # and optional values try: - # Array of Enums - api_response = api_instance.get_array_of_enums() + api_response = api_instance.string_enum(body=body) pprint(api_response) except petstore_api.ApiException as e: - print("Exception when calling FakeApi->get_array_of_enums: %s\n" % e) + print("Exception when calling FakeApi->string_enum: %s\n" % e) ``` ### Parameters -This endpoint does not need any parameter. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**string_enum.StringEnum**](StringEnum.md)| Input enum | [optional] ### Return type -[**array_of_enums.ArrayOfEnums**](ArrayOfEnums.md) +[**string_enum.StringEnum**](StringEnum.md) ### Authorization @@ -439,13 +580,13 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: application/json - **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Got named array of enums | - | +**200** | Output enum | - | [[Back to top]](#) [[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-experimental/docs/OuterEnumInteger.md b/samples/openapi3/client/petstore/python-experimental/docs/IntegerEnum.md similarity index 88% rename from samples/openapi3/client/petstore/python-experimental/docs/OuterEnumInteger.md rename to samples/openapi3/client/petstore/python-experimental/docs/IntegerEnum.md index de77d44d702f..321f3f84020f 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/OuterEnumInteger.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/IntegerEnum.md @@ -1,4 +1,4 @@ -# outer_enum_integer.OuterEnumInteger +# integer_enum.IntegerEnum ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/OuterEnumIntegerDefaultValue.md b/samples/openapi3/client/petstore/python-experimental/docs/IntegerEnumOneValue.md similarity index 83% rename from samples/openapi3/client/petstore/python-experimental/docs/OuterEnumIntegerDefaultValue.md rename to samples/openapi3/client/petstore/python-experimental/docs/IntegerEnumOneValue.md index b8d9b9c0b01d..5076d652c1d6 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/OuterEnumIntegerDefaultValue.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/IntegerEnumOneValue.md @@ -1,4 +1,4 @@ -# outer_enum_integer_default_value.OuterEnumIntegerDefaultValue +# integer_enum_one_value.IntegerEnumOneValue ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/IntegerEnumWithDefaultValue.md b/samples/openapi3/client/petstore/python-experimental/docs/IntegerEnumWithDefaultValue.md new file mode 100644 index 000000000000..e3c7a1a8cf18 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/IntegerEnumWithDefaultValue.md @@ -0,0 +1,10 @@ +# integer_enum_with_default_value.IntegerEnumWithDefaultValue + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **int** | | defaults to 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-experimental/docs/NumberWithValidations.md b/samples/openapi3/client/petstore/python-experimental/docs/NumberWithValidations.md new file mode 100644 index 000000000000..b6eb738a2a8d --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/NumberWithValidations.md @@ -0,0 +1,10 @@ +# number_with_validations.NumberWithValidations + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **float** | | + +[[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-experimental/docs/OuterComposite.md b/samples/openapi3/client/petstore/python-experimental/docs/ObjectModelWithRefProps.md similarity index 54% rename from samples/openapi3/client/petstore/python-experimental/docs/OuterComposite.md rename to samples/openapi3/client/petstore/python-experimental/docs/ObjectModelWithRefProps.md index a389115ee5a9..6c308497b60b 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/OuterComposite.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/ObjectModelWithRefProps.md @@ -1,9 +1,10 @@ -# outer_composite.OuterComposite +# 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 ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**my_number** | **float** | | [optional] +**my_number** | [**number_with_validations.NumberWithValidations**](NumberWithValidations.md) | | [optional] **my_string** | **str** | | [optional] **my_boolean** | **bool** | | [optional] diff --git a/samples/openapi3/client/petstore/python-experimental/docs/OuterEnum.md b/samples/openapi3/client/petstore/python-experimental/docs/StringEnum.md similarity index 92% rename from samples/openapi3/client/petstore/python-experimental/docs/OuterEnum.md rename to samples/openapi3/client/petstore/python-experimental/docs/StringEnum.md index d1414ba4e613..02c6d0a00e39 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/OuterEnum.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/StringEnum.md @@ -1,4 +1,4 @@ -# outer_enum.OuterEnum +# string_enum.StringEnum ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/OuterEnumDefaultValue.md b/samples/openapi3/client/petstore/python-experimental/docs/StringEnumWithDefaultValue.md similarity index 84% rename from samples/openapi3/client/petstore/python-experimental/docs/OuterEnumDefaultValue.md rename to samples/openapi3/client/petstore/python-experimental/docs/StringEnumWithDefaultValue.md index 648f964b6b0e..2c54632d5749 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/OuterEnumDefaultValue.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/StringEnumWithDefaultValue.md @@ -1,4 +1,4 @@ -# outer_enum_default_value.OuterEnumDefaultValue +# string_enum_with_default_value.StringEnumWithDefaultValue ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api.py index 26d8620c808a..338cbf18ff0e 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api.py @@ -30,10 +30,13 @@ str, validate_and_convert_types ) -from petstore_api.model import health_check_result -from petstore_api.model import outer_composite from petstore_api.model import additional_properties_with_array_of_enums +from petstore_api.model import animal_farm from petstore_api.model import array_of_enums +from petstore_api.model import health_check_result +from petstore_api.model import number_with_validations +from petstore_api.model import object_model_with_ref_props +from petstore_api.model import string_enum from petstore_api.model import file_schema_test_class from petstore_api.model import user from petstore_api.model import client @@ -51,20 +54,21 @@ def __init__(self, api_client=None): api_client = ApiClient() self.api_client = api_client - def __fake_health_get( + def __additional_properties_with_array_of_enums( self, **kwargs ): - """Health check endpoint # noqa: E501 + """Additional Properties with Array of Enums # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.fake_health_get(async_req=True) + >>> thread = api.additional_properties_with_array_of_enums(async_req=True) >>> result = thread.get() Keyword Args: + additional_properties_with_array_of_enums_additional_properties_with_array_of_enums (additional_properties_with_array_of_enums.AdditionalPropertiesWithArrayOfEnums): Input enum. [optional] _return_http_data_only (bool): response data without head status code and headers. Default is True. _preload_content (bool): if False, the urllib3.HTTPResponse object @@ -86,7 +90,7 @@ def __fake_health_get( async_req (bool): execute request asynchronously Returns: - health_check_result.HealthCheckResult + additional_properties_with_array_of_enums.AdditionalPropertiesWithArrayOfEnums If the method is called asynchronously, returns the request thread. """ @@ -111,17 +115,18 @@ def __fake_health_get( kwargs['_host_index'] = kwargs.get('_host_index') return self.call_with_http_info(**kwargs) - self.fake_health_get = Endpoint( + self.additional_properties_with_array_of_enums = Endpoint( settings={ - 'response_type': (health_check_result.HealthCheckResult,), + 'response_type': (additional_properties_with_array_of_enums.AdditionalPropertiesWithArrayOfEnums,), 'auth': [], - 'endpoint_path': '/fake/health', - 'operation_id': 'fake_health_get', + 'endpoint_path': '/fake/additional-properties-with-array-of-enums', + 'operation_id': 'additional_properties_with_array_of_enums', 'http_method': 'GET', 'servers': None, }, params_map={ 'all': [ + 'additional_properties_with_array_of_enums_additional_properties_with_array_of_enums', ], 'required': [], 'nullable': [ @@ -137,10 +142,13 @@ def __fake_health_get( 'allowed_values': { }, 'openapi_types': { + 'additional_properties_with_array_of_enums_additional_properties_with_array_of_enums': + (additional_properties_with_array_of_enums.AdditionalPropertiesWithArrayOfEnums,), }, 'attribute_map': { }, 'location_map': { + 'additional_properties_with_array_of_enums_additional_properties_with_array_of_enums': 'body', }, 'collection_format_map': { } @@ -149,23 +157,248 @@ def __fake_health_get( 'accept': [ 'application/json' ], - 'content_type': [], + 'content_type': [ + 'application/json' + ] }, api_client=api_client, - callable=__fake_health_get + callable=__additional_properties_with_array_of_enums + ) + + def __array_model( + self, + **kwargs + ): + """array_model # noqa: E501 + + Test serialization of ArrayModel # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.array_model(async_req=True) + >>> result = thread.get() + + + Keyword Args: + body (animal_farm.AnimalFarm): Input model. [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): 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. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + animal_farm.AnimalFarm + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + return self.call_with_http_info(**kwargs) + + self.array_model = Endpoint( + settings={ + 'response_type': (animal_farm.AnimalFarm,), + 'auth': [], + 'endpoint_path': '/fake/refs/arraymodel', + 'operation_id': 'array_model', + 'http_method': 'POST', + 'servers': None, + }, + params_map={ + 'all': [ + 'body', + ], + 'required': [], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'body': + (animal_farm.AnimalFarm,), + }, + 'attribute_map': { + }, + 'location_map': { + 'body': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [ + 'application/json' + ] + }, + api_client=api_client, + callable=__array_model ) - def __fake_outer_boolean_serialize( + def __array_of_enums( self, **kwargs ): - """fake_outer_boolean_serialize # noqa: E501 + """Array of Enums # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.array_of_enums(async_req=True) + >>> result = thread.get() + + + Keyword Args: + array_of_enums_array_of_enums (array_of_enums.ArrayOfEnums): Input enum. [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): 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. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + array_of_enums.ArrayOfEnums + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + return self.call_with_http_info(**kwargs) + + self.array_of_enums = Endpoint( + settings={ + 'response_type': (array_of_enums.ArrayOfEnums,), + 'auth': [], + 'endpoint_path': '/fake/refs/array-of-enums', + 'operation_id': 'array_of_enums', + 'http_method': 'POST', + 'servers': None, + }, + params_map={ + 'all': [ + 'array_of_enums_array_of_enums', + ], + 'required': [], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'array_of_enums_array_of_enums': + (array_of_enums.ArrayOfEnums,), + }, + 'attribute_map': { + }, + 'location_map': { + 'array_of_enums_array_of_enums': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [ + 'application/json' + ] + }, + api_client=api_client, + callable=__array_of_enums + ) + + def __boolean( + self, + **kwargs + ): + """boolean # noqa: E501 Test serialization of outer boolean types # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.fake_outer_boolean_serialize(async_req=True) + >>> thread = api.boolean(async_req=True) >>> result = thread.get() @@ -217,12 +450,12 @@ def __fake_outer_boolean_serialize( kwargs['_host_index'] = kwargs.get('_host_index') return self.call_with_http_info(**kwargs) - self.fake_outer_boolean_serialize = Endpoint( + self.boolean = Endpoint( settings={ 'response_type': (bool,), 'auth': [], - 'endpoint_path': '/fake/outer/boolean', - 'operation_id': 'fake_outer_boolean_serialize', + 'endpoint_path': '/fake/refs/boolean', + 'operation_id': 'boolean', 'http_method': 'POST', 'servers': None, }, @@ -257,32 +490,30 @@ def __fake_outer_boolean_serialize( }, headers_map={ 'accept': [ - '*/*' + 'application/json' ], 'content_type': [ 'application/json' ] }, api_client=api_client, - callable=__fake_outer_boolean_serialize + callable=__boolean ) - def __fake_outer_composite_serialize( + def __fake_health_get( self, **kwargs ): - """fake_outer_composite_serialize # noqa: E501 + """Health check endpoint # noqa: E501 - Test serialization of object with outer number type # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.fake_outer_composite_serialize(async_req=True) + >>> thread = api.fake_health_get(async_req=True) >>> result = thread.get() Keyword Args: - outer_composite_outer_composite (outer_composite.OuterComposite): Input composite as post body. [optional] _return_http_data_only (bool): response data without head status code and headers. Default is True. _preload_content (bool): if False, the urllib3.HTTPResponse object @@ -304,7 +535,7 @@ def __fake_outer_composite_serialize( async_req (bool): execute request asynchronously Returns: - outer_composite.OuterComposite + health_check_result.HealthCheckResult If the method is called asynchronously, returns the request thread. """ @@ -329,18 +560,17 @@ def __fake_outer_composite_serialize( kwargs['_host_index'] = kwargs.get('_host_index') return self.call_with_http_info(**kwargs) - self.fake_outer_composite_serialize = Endpoint( + self.fake_health_get = Endpoint( settings={ - 'response_type': (outer_composite.OuterComposite,), + 'response_type': (health_check_result.HealthCheckResult,), 'auth': [], - 'endpoint_path': '/fake/outer/composite', - 'operation_id': 'fake_outer_composite_serialize', - 'http_method': 'POST', + 'endpoint_path': '/fake/health', + 'operation_id': 'fake_health_get', + 'http_method': 'GET', 'servers': None, }, params_map={ 'all': [ - 'outer_composite_outer_composite', ], 'required': [], 'nullable': [ @@ -356,45 +586,40 @@ def __fake_outer_composite_serialize( 'allowed_values': { }, 'openapi_types': { - 'outer_composite_outer_composite': - (outer_composite.OuterComposite,), }, 'attribute_map': { }, 'location_map': { - 'outer_composite_outer_composite': 'body', }, 'collection_format_map': { } }, headers_map={ 'accept': [ - '*/*' - ], - 'content_type': [ 'application/json' - ] + ], + 'content_type': [], }, api_client=api_client, - callable=__fake_outer_composite_serialize + callable=__fake_health_get ) - def __fake_outer_number_serialize( + def __number_with_validations( self, **kwargs ): - """fake_outer_number_serialize # noqa: E501 + """number_with_validations # noqa: E501 Test serialization of outer number types # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.fake_outer_number_serialize(async_req=True) + >>> thread = api.number_with_validations(async_req=True) >>> result = thread.get() Keyword Args: - body (float): Input number as post body. [optional] + body (number_with_validations.NumberWithValidations): Input number as post body. [optional] _return_http_data_only (bool): response data without head status code and headers. Default is True. _preload_content (bool): if False, the urllib3.HTTPResponse object @@ -416,7 +641,7 @@ def __fake_outer_number_serialize( async_req (bool): execute request asynchronously Returns: - float + number_with_validations.NumberWithValidations If the method is called asynchronously, returns the request thread. """ @@ -441,12 +666,12 @@ def __fake_outer_number_serialize( kwargs['_host_index'] = kwargs.get('_host_index') return self.call_with_http_info(**kwargs) - self.fake_outer_number_serialize = Endpoint( + self.number_with_validations = Endpoint( settings={ - 'response_type': (float,), + 'response_type': (number_with_validations.NumberWithValidations,), 'auth': [], - 'endpoint_path': '/fake/outer/number', - 'operation_id': 'fake_outer_number_serialize', + 'endpoint_path': '/fake/refs/number', + 'operation_id': 'number_with_validations', 'http_method': 'POST', 'servers': None, }, @@ -469,7 +694,7 @@ def __fake_outer_number_serialize( }, 'openapi_types': { 'body': - (float,), + (number_with_validations.NumberWithValidations,), }, 'attribute_map': { }, @@ -481,32 +706,32 @@ def __fake_outer_number_serialize( }, headers_map={ 'accept': [ - '*/*' + 'application/json' ], 'content_type': [ 'application/json' ] }, api_client=api_client, - callable=__fake_outer_number_serialize + callable=__number_with_validations ) - def __fake_outer_string_serialize( + def __object_model_with_ref_props( self, **kwargs ): - """fake_outer_string_serialize # noqa: E501 + """object_model_with_ref_props # noqa: E501 - Test serialization of outer string types # noqa: E501 + Test serialization of object with $refed properties # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.fake_outer_string_serialize(async_req=True) + >>> thread = api.object_model_with_ref_props(async_req=True) >>> result = thread.get() Keyword Args: - body (str): Input string as post body. [optional] + body (object_model_with_ref_props.ObjectModelWithRefProps): Input model. [optional] _return_http_data_only (bool): response data without head status code and headers. Default is True. _preload_content (bool): if False, the urllib3.HTTPResponse object @@ -528,7 +753,7 @@ def __fake_outer_string_serialize( async_req (bool): execute request asynchronously Returns: - str + object_model_with_ref_props.ObjectModelWithRefProps If the method is called asynchronously, returns the request thread. """ @@ -553,12 +778,12 @@ def __fake_outer_string_serialize( kwargs['_host_index'] = kwargs.get('_host_index') return self.call_with_http_info(**kwargs) - self.fake_outer_string_serialize = Endpoint( + self.object_model_with_ref_props = Endpoint( settings={ - 'response_type': (str,), + 'response_type': (object_model_with_ref_props.ObjectModelWithRefProps,), 'auth': [], - 'endpoint_path': '/fake/outer/string', - 'operation_id': 'fake_outer_string_serialize', + 'endpoint_path': '/fake/refs/object_model_with_ref_props', + 'operation_id': 'object_model_with_ref_props', 'http_method': 'POST', 'servers': None, }, @@ -581,7 +806,7 @@ def __fake_outer_string_serialize( }, 'openapi_types': { 'body': - (str,), + (object_model_with_ref_props.ObjectModelWithRefProps,), }, 'attribute_map': { }, @@ -593,30 +818,32 @@ def __fake_outer_string_serialize( }, headers_map={ 'accept': [ - '*/*' + 'application/json' ], 'content_type': [ 'application/json' ] }, api_client=api_client, - callable=__fake_outer_string_serialize + callable=__object_model_with_ref_props ) - def __get_additional_properties_with_array_of_enums( + def __string( self, **kwargs ): - """Additional Properties with Array of Enums # noqa: E501 + """string # noqa: E501 + Test serialization of outer string types # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_additional_properties_with_array_of_enums(async_req=True) + >>> thread = api.string(async_req=True) >>> result = thread.get() Keyword Args: + body (str): Input string as post body. [optional] _return_http_data_only (bool): response data without head status code and headers. Default is True. _preload_content (bool): if False, the urllib3.HTTPResponse object @@ -638,7 +865,7 @@ def __get_additional_properties_with_array_of_enums( async_req (bool): execute request asynchronously Returns: - additional_properties_with_array_of_enums.AdditionalPropertiesWithArrayOfEnums + str If the method is called asynchronously, returns the request thread. """ @@ -663,17 +890,18 @@ def __get_additional_properties_with_array_of_enums( kwargs['_host_index'] = kwargs.get('_host_index') return self.call_with_http_info(**kwargs) - self.get_additional_properties_with_array_of_enums = Endpoint( + self.string = Endpoint( settings={ - 'response_type': (additional_properties_with_array_of_enums.AdditionalPropertiesWithArrayOfEnums,), + 'response_type': (str,), 'auth': [], - 'endpoint_path': '/fake/additional-properties-with-array-of-enums', - 'operation_id': 'get_additional_properties_with_array_of_enums', - 'http_method': 'GET', + 'endpoint_path': '/fake/refs/string', + 'operation_id': 'string', + 'http_method': 'POST', 'servers': None, }, params_map={ 'all': [ + 'body', ], 'required': [], 'nullable': [ @@ -689,10 +917,13 @@ def __get_additional_properties_with_array_of_enums( 'allowed_values': { }, 'openapi_types': { + 'body': + (str,), }, 'attribute_map': { }, 'location_map': { + 'body': 'body', }, 'collection_format_map': { } @@ -701,26 +932,30 @@ def __get_additional_properties_with_array_of_enums( 'accept': [ 'application/json' ], - 'content_type': [], + 'content_type': [ + 'application/json' + ] }, api_client=api_client, - callable=__get_additional_properties_with_array_of_enums + callable=__string ) - def __get_array_of_enums( + def __string_enum( self, **kwargs ): - """Array of Enums # noqa: E501 + """string_enum # noqa: E501 + Test serialization of outer enum # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_array_of_enums(async_req=True) + >>> thread = api.string_enum(async_req=True) >>> result = thread.get() Keyword Args: + body (string_enum.StringEnum): Input enum. [optional] _return_http_data_only (bool): response data without head status code and headers. Default is True. _preload_content (bool): if False, the urllib3.HTTPResponse object @@ -742,7 +977,7 @@ def __get_array_of_enums( async_req (bool): execute request asynchronously Returns: - array_of_enums.ArrayOfEnums + string_enum.StringEnum If the method is called asynchronously, returns the request thread. """ @@ -767,20 +1002,22 @@ def __get_array_of_enums( kwargs['_host_index'] = kwargs.get('_host_index') return self.call_with_http_info(**kwargs) - self.get_array_of_enums = Endpoint( + self.string_enum = Endpoint( settings={ - 'response_type': (array_of_enums.ArrayOfEnums,), + 'response_type': (string_enum.StringEnum,), 'auth': [], - 'endpoint_path': '/fake/array-of-enums', - 'operation_id': 'get_array_of_enums', - 'http_method': 'GET', + 'endpoint_path': '/fake/refs/enum', + 'operation_id': 'string_enum', + 'http_method': 'POST', 'servers': None, }, params_map={ 'all': [ + 'body', ], 'required': [], 'nullable': [ + 'body', ], 'enum': [ ], @@ -793,10 +1030,13 @@ def __get_array_of_enums( 'allowed_values': { }, 'openapi_types': { + 'body': + (string_enum.StringEnum,), }, 'attribute_map': { }, 'location_map': { + 'body': 'body', }, 'collection_format_map': { } @@ -805,10 +1045,12 @@ def __get_array_of_enums( 'accept': [ 'application/json' ], - 'content_type': [], + 'content_type': [ + 'application/json' + ] }, api_client=api_client, - callable=__get_array_of_enums + callable=__string_enum ) def __test_body_with_file_schema( diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_enums.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_enums.py index 302cc30d9798..5ce0b86cd088 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_enums.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_enums.py @@ -34,10 +34,10 @@ validate_get_composed_info, ) try: - from petstore_api.model import outer_enum + from petstore_api.model import string_enum except ImportError: - outer_enum = sys.modules[ - 'petstore_api.model.outer_enum'] + string_enum = sys.modules[ + 'petstore_api.model.string_enum'] class ArrayOfEnums(ModelSimple): @@ -81,7 +81,7 @@ def openapi_types(): and the value is attribute type. """ return { - 'value': ([outer_enum.OuterEnum, none_type],), # noqa: E501 + 'value': ([string_enum.StringEnum, none_type],), # noqa: E501 } @cached_property @@ -106,7 +106,7 @@ def __init__(self, value, *args, **kwargs): # noqa: E501 """array_of_enums.ArrayOfEnums - a model defined in OpenAPI Args: - value ([outer_enum.OuterEnum, none_type]): + value ([string_enum.StringEnum, none_type]): Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_test.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_test.py index 1320cc416e7d..68e839ae9228 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_test.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_test.py @@ -34,25 +34,30 @@ validate_get_composed_info, ) try: - from petstore_api.model import outer_enum + from petstore_api.model import integer_enum except ImportError: - outer_enum = sys.modules[ - 'petstore_api.model.outer_enum'] + integer_enum = sys.modules[ + 'petstore_api.model.integer_enum'] try: - from petstore_api.model import outer_enum_default_value + from petstore_api.model import integer_enum_one_value except ImportError: - outer_enum_default_value = sys.modules[ - 'petstore_api.model.outer_enum_default_value'] + integer_enum_one_value = sys.modules[ + 'petstore_api.model.integer_enum_one_value'] try: - from petstore_api.model import outer_enum_integer + from petstore_api.model import integer_enum_with_default_value except ImportError: - outer_enum_integer = sys.modules[ - 'petstore_api.model.outer_enum_integer'] + integer_enum_with_default_value = sys.modules[ + 'petstore_api.model.integer_enum_with_default_value'] try: - from petstore_api.model import outer_enum_integer_default_value + from petstore_api.model import string_enum except ImportError: - outer_enum_integer_default_value = sys.modules[ - 'petstore_api.model.outer_enum_integer_default_value'] + string_enum = sys.modules[ + 'petstore_api.model.string_enum'] +try: + from petstore_api.model import string_enum_with_default_value +except ImportError: + string_enum_with_default_value = sys.modules[ + 'petstore_api.model.string_enum_with_default_value'] class EnumTest(ModelNormal): @@ -122,10 +127,11 @@ def openapi_types(): 'enum_string': (str,), # noqa: E501 'enum_integer': (int,), # noqa: E501 'enum_number': (float,), # noqa: E501 - 'outer_enum': (outer_enum.OuterEnum,), # noqa: E501 - 'outer_enum_integer': (outer_enum_integer.OuterEnumInteger,), # noqa: E501 - 'outer_enum_default_value': (outer_enum_default_value.OuterEnumDefaultValue,), # noqa: E501 - 'outer_enum_integer_default_value': (outer_enum_integer_default_value.OuterEnumIntegerDefaultValue,), # noqa: E501 + 'string_enum': (string_enum.StringEnum,), # noqa: E501 + 'integer_enum': (integer_enum.IntegerEnum,), # noqa: E501 + 'string_enum_with_default_value': (string_enum_with_default_value.StringEnumWithDefaultValue,), # noqa: E501 + 'integer_enum_with_default_value': (integer_enum_with_default_value.IntegerEnumWithDefaultValue,), # noqa: E501 + 'integer_enum_one_value': (integer_enum_one_value.IntegerEnumOneValue,), # noqa: E501 } @cached_property @@ -137,10 +143,11 @@ def discriminator(): 'enum_string': 'enum_string', # noqa: E501 'enum_integer': 'enum_integer', # noqa: E501 'enum_number': 'enum_number', # noqa: E501 - 'outer_enum': 'outerEnum', # noqa: E501 - 'outer_enum_integer': 'outerEnumInteger', # noqa: E501 - 'outer_enum_default_value': 'outerEnumDefaultValue', # noqa: E501 - 'outer_enum_integer_default_value': 'outerEnumIntegerDefaultValue', # noqa: E501 + 'string_enum': 'stringEnum', # noqa: E501 + 'integer_enum': 'IntegerEnum', # noqa: E501 + 'string_enum_with_default_value': 'StringEnumWithDefaultValue', # noqa: E501 + 'integer_enum_with_default_value': 'IntegerEnumWithDefaultValue', # noqa: E501 + 'integer_enum_one_value': 'IntegerEnumOneValue', # noqa: E501 } _composed_schemas = {} @@ -195,10 +202,11 @@ def __init__(self, enum_string_required, *args, **kwargs): # noqa: E501 enum_string (str): [optional] # noqa: E501 enum_integer (int): [optional] # noqa: E501 enum_number (float): [optional] # noqa: E501 - outer_enum (outer_enum.OuterEnum): [optional] # noqa: E501 - outer_enum_integer (outer_enum_integer.OuterEnumInteger): [optional] # noqa: E501 - outer_enum_default_value (outer_enum_default_value.OuterEnumDefaultValue): [optional] # noqa: E501 - outer_enum_integer_default_value (outer_enum_integer_default_value.OuterEnumIntegerDefaultValue): [optional] # noqa: E501 + string_enum (string_enum.StringEnum): [optional] # noqa: E501 + integer_enum (integer_enum.IntegerEnum): [optional] # noqa: E501 + string_enum_with_default_value (string_enum_with_default_value.StringEnumWithDefaultValue): [optional] # noqa: E501 + integer_enum_with_default_value (integer_enum_with_default_value.IntegerEnumWithDefaultValue): [optional] # noqa: E501 + integer_enum_one_value (integer_enum_one_value.IntegerEnumOneValue): [optional] # noqa: E501 """ _check_type = kwargs.pop('_check_type', True) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/outer_enum_integer.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum.py similarity index 98% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/outer_enum_integer.py rename to samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum.py index ea44f5004428..1f6cfe0f79a5 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/outer_enum_integer.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum.py @@ -35,7 +35,7 @@ ) -class OuterEnumInteger(ModelSimple): +class IntegerEnum(ModelSimple): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech @@ -103,7 +103,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, value, *args, **kwargs): # noqa: E501 - """outer_enum_integer.OuterEnumInteger - a model defined in OpenAPI + """integer_enum.IntegerEnum - a model defined in OpenAPI Args: value (int): diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_one_value.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_one_value.py new file mode 100644 index 000000000000..d9f11a5f8a03 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_one_value.py @@ -0,0 +1,174 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use 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 __future__ import absolute_import +import re # noqa: F401 +import sys # noqa: F401 + +import six # noqa: F401 +import nulltype # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + int, + none_type, + str, + validate_get_composed_info, +) + + +class IntegerEnumOneValue(ModelSimple): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('value',): { + '0': 0, + }, + } + + validations = { + } + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a class method so a model may have properties that are + of type self, this ensures that we don't create a cyclic import + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'value': (int,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + attribute_map = {} + + _composed_schemas = None + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """integer_enum_one_value.IntegerEnumOneValue - a model defined in OpenAPI + + Args: + + Keyword Args: + value (int): defaults to 0, must be one of [0, ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + value = kwargs.get('value', 0) + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.value = value + for var_name, var_value in six.iteritems(kwargs): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/outer_enum_integer_default_value.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_with_default_value.py similarity index 97% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/outer_enum_integer_default_value.py rename to samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_with_default_value.py index 46d5c61d310b..474241f0414f 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/outer_enum_integer_default_value.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_with_default_value.py @@ -35,7 +35,7 @@ ) -class OuterEnumIntegerDefaultValue(ModelSimple): +class IntegerEnumWithDefaultValue(ModelSimple): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech @@ -103,7 +103,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """outer_enum_integer_default_value.OuterEnumIntegerDefaultValue - a model defined in OpenAPI + """integer_enum_with_default_value.IntegerEnumWithDefaultValue - a model defined in OpenAPI Args: diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/number_with_validations.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/number_with_validations.py new file mode 100644 index 000000000000..787ac947db04 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/number_with_validations.py @@ -0,0 +1,174 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use 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 __future__ import absolute_import +import re # noqa: F401 +import sys # noqa: F401 + +import six # noqa: F401 +import nulltype # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + int, + none_type, + str, + validate_get_composed_info, +) + + +class NumberWithValidations(ModelSimple): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + ('value',): { + 'inclusive_maximum': 20, + 'inclusive_minimum': 10, + }, + } + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a class method so a model may have properties that are + of type self, this ensures that we don't create a cyclic import + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'value': (float,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + attribute_map = {} + + _composed_schemas = None + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, value, *args, **kwargs): # noqa: E501 + """number_with_validations.NumberWithValidations - a model defined in OpenAPI + + Args: + value (float): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.value = value + for var_name, var_value in six.iteritems(kwargs): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/outer_composite.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_model_with_ref_props.py similarity index 93% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/outer_composite.py rename to samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_model_with_ref_props.py index 0011802050d3..f76243bc365e 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/outer_composite.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_model_with_ref_props.py @@ -33,9 +33,14 @@ str, validate_get_composed_info, ) +try: + from petstore_api.model import number_with_validations +except ImportError: + number_with_validations = sys.modules[ + 'petstore_api.model.number_with_validations'] -class OuterComposite(ModelNormal): +class ObjectModelWithRefProps(ModelNormal): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech @@ -80,7 +85,7 @@ def openapi_types(): and the value is attribute type. """ return { - 'my_number': (float,), # noqa: E501 + 'my_number': (number_with_validations.NumberWithValidations,), # noqa: E501 'my_string': (str,), # noqa: E501 'my_boolean': (bool,), # noqa: E501 } @@ -108,7 +113,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """outer_composite.OuterComposite - a model defined in OpenAPI + """object_model_with_ref_props.ObjectModelWithRefProps - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types @@ -141,7 +146,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 Animal class but this time we won't travel through its discriminator because we passed in _visited_composed_classes = (Animal,) - my_number (float): [optional] # noqa: E501 + my_number (number_with_validations.NumberWithValidations): [optional] # noqa: E501 my_string (str): [optional] # noqa: E501 my_boolean (bool): [optional] # noqa: E501 """ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/outer_enum.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_enum.py similarity index 98% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/outer_enum.py rename to samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_enum.py index 4efdce9d10c5..e6f9cb9d6b9f 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/outer_enum.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_enum.py @@ -35,7 +35,7 @@ ) -class OuterEnum(ModelSimple): +class StringEnum(ModelSimple): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech @@ -104,7 +104,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, value, *args, **kwargs): # noqa: E501 - """outer_enum.OuterEnum - a model defined in OpenAPI + """string_enum.StringEnum - a model defined in OpenAPI Args: value (str, none_type): diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/outer_enum_default_value.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_enum_with_default_value.py similarity index 97% rename from samples/openapi3/client/petstore/python-experimental/petstore_api/model/outer_enum_default_value.py rename to samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_enum_with_default_value.py index 0fddcf33d6ae..e2f9933eef66 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/outer_enum_default_value.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_enum_with_default_value.py @@ -35,7 +35,7 @@ ) -class OuterEnumDefaultValue(ModelSimple): +class StringEnumWithDefaultValue(ModelSimple): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech @@ -103,7 +103,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """outer_enum_default_value.OuterEnumDefaultValue - a model defined in OpenAPI + """string_enum_with_default_value.StringEnumWithDefaultValue - a model defined in OpenAPI Args: diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/__init__.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/__init__.py index 3783cbc42783..47aa61feb41a 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/__init__.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/__init__.py @@ -60,6 +60,9 @@ from petstore_api.model.inline_object4 import InlineObject4 from petstore_api.model.inline_object5 import InlineObject5 from petstore_api.model.inline_response_default import InlineResponseDefault +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.isosceles_triangle import IsoscelesTriangle from petstore_api.model.list import List from petstore_api.model.mammal import Mammal @@ -71,12 +74,9 @@ from petstore_api.model.nullable_class import NullableClass from petstore_api.model.nullable_shape import NullableShape from petstore_api.model.number_only import NumberOnly +from petstore_api.model.number_with_validations import NumberWithValidations +from petstore_api.model.object_model_with_ref_props import ObjectModelWithRefProps from petstore_api.model.order import Order -from petstore_api.model.outer_composite import OuterComposite -from petstore_api.model.outer_enum import OuterEnum -from petstore_api.model.outer_enum_default_value import OuterEnumDefaultValue -from petstore_api.model.outer_enum_integer import OuterEnumInteger -from petstore_api.model.outer_enum_integer_default_value import OuterEnumIntegerDefaultValue from petstore_api.model.parent_pet import ParentPet from petstore_api.model.pet import Pet from petstore_api.model.pig import Pig @@ -90,6 +90,8 @@ from petstore_api.model.simple_quadrilateral import SimpleQuadrilateral from petstore_api.model.special_model_name import SpecialModelName 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.tag import Tag from petstore_api.model.triangle import Triangle from petstore_api.model.triangle_interface import TriangleInterface diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_array_of_enums.py b/samples/openapi3/client/petstore/python-experimental/test/test_array_of_enums.py index 2b9007e564f0..8f0fbf184483 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_array_of_enums.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_array_of_enums.py @@ -16,10 +16,10 @@ import petstore_api try: - from petstore_api.model import outer_enum + from petstore_api.model import string_enum except ImportError: - outer_enum = sys.modules[ - 'petstore_api.model.outer_enum'] + string_enum = sys.modules[ + 'petstore_api.model.string_enum'] from petstore_api.model.array_of_enums import ArrayOfEnums diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_enum_test.py b/samples/openapi3/client/petstore/python-experimental/test/test_enum_test.py index 6a98e49b9689..d442443504e0 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_enum_test.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_enum_test.py @@ -16,25 +16,30 @@ import petstore_api try: - from petstore_api.model import outer_enum + from petstore_api.model import integer_enum except ImportError: - outer_enum = sys.modules[ - 'petstore_api.model.outer_enum'] + integer_enum = sys.modules[ + 'petstore_api.model.integer_enum'] try: - from petstore_api.model import outer_enum_default_value + from petstore_api.model import integer_enum_one_value except ImportError: - outer_enum_default_value = sys.modules[ - 'petstore_api.model.outer_enum_default_value'] + integer_enum_one_value = sys.modules[ + 'petstore_api.model.integer_enum_one_value'] try: - from petstore_api.model import outer_enum_integer + from petstore_api.model import integer_enum_with_default_value except ImportError: - outer_enum_integer = sys.modules[ - 'petstore_api.model.outer_enum_integer'] + integer_enum_with_default_value = sys.modules[ + 'petstore_api.model.integer_enum_with_default_value'] try: - from petstore_api.model import outer_enum_integer_default_value + from petstore_api.model import string_enum except ImportError: - outer_enum_integer_default_value = sys.modules[ - 'petstore_api.model.outer_enum_integer_default_value'] + string_enum = sys.modules[ + 'petstore_api.model.string_enum'] +try: + from petstore_api.model import string_enum_with_default_value +except ImportError: + string_enum_with_default_value = sys.modules[ + 'petstore_api.model.string_enum_with_default_value'] from petstore_api.model.enum_test import EnumTest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_fake_api.py b/samples/openapi3/client/petstore/python-experimental/test/test_fake_api.py index f6678a59b240..f79919650e73 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_fake_api.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_fake_api.py @@ -9,13 +9,32 @@ Generated by: https://openapi-generator.tech """ - from __future__ import absolute_import +from collections import namedtuple import unittest +import json + +import six +if six.PY3: + from unittest.mock import patch +else: + from mock import patch import petstore_api from petstore_api.api.fake_api import FakeApi # noqa: E501 +from petstore_api.rest import RESTClientObject, RESTResponse + +HTTPResponse = namedtuple( + 'urllib3_response_HTTPResponse', + ['status', 'reason', 'data', 'getheaders', 'getheader'] +) + +headers = {'Content-Type': 'application/json'} +def get_headers(): + return {} +def get_header(name, default=None): + return {}.get(name, default) class TestFakeApi(unittest.TestCase): @@ -27,6 +46,65 @@ def setUp(self): def tearDown(self): pass + @staticmethod + def mock_response(body_value): + http_response = HTTPResponse( + status=200, + reason='OK', + data=json.dumps(body_value).encode('utf-8'), + getheaders=get_headers, + getheader=get_header + ) + return RESTResponse(http_response) + + @staticmethod + def assert_request_called_with(mock_method, url, value): + mock_method.assert_called_with( + 'POST', + url, + _preload_content=True, + _request_timeout=None, + body=value, + headers={ + 'Accept': 'application/json', + 'User-Agent': 'OpenAPI-Generator/1.0.0/python', + 'Content-Type': 'application/json' + }, + post_params=[], + query_params=[] + ) + + + def test_array_model(self): + """Test case for array_model + + """ + from petstore_api.model import animal_farm, animal + endpoint = self.api.array_model + assert endpoint.openapi_types['body'] == (animal_farm.AnimalFarm,) + assert endpoint.settings['response_type'] == (animal_farm.AnimalFarm,) + + # serialization + deserialization works + with patch.object(RESTClientObject, 'request') as mock_method: + cat = animal.Animal(class_name="Cat", color="black") + body = animal_farm.AnimalFarm([cat]) + json_data = [{"className": "Cat", "color": "black"}] + mock_method.return_value = self.mock_response(json_data) + + response = endpoint(body=body) + self.assert_request_called_with(mock_method, 'http://petstore.swagger.io:80/v2/fake/refs/arraymodel', json_data) + + assert isinstance(response, animal_farm.AnimalFarm) + assert response == body + + def test_boolean(self): + """Test case for boolean + + """ + endpoint = self.api.boolean + assert endpoint.openapi_types['body'] == (bool,) + assert endpoint.settings['response_type'] == (bool,) + def test_fake_health_get(self): """Test case for fake_health_get @@ -34,29 +112,109 @@ def test_fake_health_get(self): """ pass - def test_fake_outer_boolean_serialize(self): - """Test case for fake_outer_boolean_serialize + def test_additional_properties_with_array_of_enums(self): + """Test case for additional_properties_with_array_of_enums + Additional Properties with Array of Enums # noqa: E501 """ pass - def test_fake_outer_composite_serialize(self): - """Test case for fake_outer_composite_serialize + def test_array_of_enums(self): + """Test case for array_of_enums + Array of Enums # noqa: E501 """ - pass + from petstore_api.model import array_of_enums, string_enum + endpoint = self.api.array_of_enums + assert endpoint.openapi_types['array_of_enums_array_of_enums'] == (array_of_enums.ArrayOfEnums,) + assert endpoint.settings['response_type'] == (array_of_enums.ArrayOfEnums,) + + # serialization + deserialization works + with patch.object(RESTClientObject, 'request') as mock_method: + value = [string_enum.StringEnum("placed")] + body = array_of_enums.ArrayOfEnums(value) + value_simple = ["placed"] + mock_method.return_value = self.mock_response(value_simple) + + response = endpoint(array_of_enums_array_of_enums=body) + self.assert_request_called_with(mock_method, 'http://petstore.swagger.io:80/v2/fake/refs/array-of-enums', value_simple) - def test_fake_outer_number_serialize(self): - """Test case for fake_outer_number_serialize + assert isinstance(response, array_of_enums.ArrayOfEnums) + assert response.value == value + + + def test_number_with_validations(self): + """Test case for number_with_validations """ - pass + from petstore_api.model import number_with_validations + endpoint = self.api.number_with_validations + assert endpoint.openapi_types['body'] == (number_with_validations.NumberWithValidations,) + assert endpoint.settings['response_type'] == (number_with_validations.NumberWithValidations,) + + # serialization + deserialization works + with patch.object(RESTClientObject, 'request') as mock_method: + value = 10.0 + body = number_with_validations.NumberWithValidations(value) + mock_method.return_value = self.mock_response(value) - def test_fake_outer_string_serialize(self): - """Test case for fake_outer_string_serialize + response = endpoint(body=body) + self.assert_request_called_with(mock_method, 'http://petstore.swagger.io:80/v2/fake/refs/number', value) + + assert isinstance(response, number_with_validations.NumberWithValidations) + assert response.value == value + + def test_object_model_with_ref_props(self): + """Test case for object_model_with_ref_props """ - pass + from petstore_api.model import object_model_with_ref_props + endpoint = self.api.object_model_with_ref_props + assert endpoint.openapi_types['body'] == (object_model_with_ref_props.ObjectModelWithRefProps,) + assert endpoint.settings['response_type'] == (object_model_with_ref_props.ObjectModelWithRefProps,) + + def test_string(self): + """Test case for string + + """ + from petstore_api.model_utils import str + endpoint = self.api.string + assert endpoint.openapi_types['body'] == (str,) + assert endpoint.settings['response_type'] == (str,) + + # serialization + deserialization works + with patch.object(RESTClientObject, 'request') as mock_method: + body = "blah" + value_simple = body + mock_method.return_value = self.mock_response(value_simple) + + response = endpoint(body=body) + self.assert_request_called_with(mock_method, 'http://petstore.swagger.io:80/v2/fake/refs/string', value_simple) + + assert isinstance(response, str) + assert response == value_simple + + def test_string_enum(self): + """Test case for string_enum + + """ + from petstore_api.model import string_enum + endpoint = self.api.string_enum + assert endpoint.openapi_types['body'] == (string_enum.StringEnum,) + assert endpoint.settings['response_type'] == (string_enum.StringEnum,) + + # serialization + deserialization works + from petstore_api.rest import RESTClientObject, RESTResponse + with patch.object(RESTClientObject, 'request') as mock_method: + value = "placed" + body = string_enum.StringEnum(value) + mock_method.return_value = self.mock_response(value) + + response = endpoint(body=body) + self.assert_request_called_with(mock_method, 'http://petstore.swagger.io:80/v2/fake/refs/enum', value) + + assert isinstance(response, string_enum.StringEnum) + assert response.value == value def test_test_body_with_file_schema(self): """Test case for test_body_with_file_schema diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_fruit_req.py b/samples/openapi3/client/petstore/python-experimental/test/test_fruit_req.py index 3a1aa8fc283b..c161570df03c 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_fruit_req.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_fruit_req.py @@ -176,5 +176,9 @@ def testFruitReq(self): fruit._additional_properties_model_instances, [] ) + # we can pass in None + fruit = FruitReq(None) + assert fruit is None + if __name__ == '__main__': unittest.main() diff --git a/samples/client/petstore/python-experimental/test/test_outer_number.py b/samples/openapi3/client/petstore/python-experimental/test/test_integer_enum.py similarity index 71% rename from samples/client/petstore/python-experimental/test/test_outer_number.py rename to samples/openapi3/client/petstore/python-experimental/test/test_integer_enum.py index e0ab10d91d61..25667e2a8d09 100644 --- a/samples/client/petstore/python-experimental/test/test_outer_number.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_integer_enum.py @@ -15,11 +15,11 @@ import unittest import petstore_api -from petstore_api.model.outer_number import OuterNumber +from petstore_api.model.integer_enum import IntegerEnum -class TestOuterNumber(unittest.TestCase): - """OuterNumber unit test stubs""" +class TestIntegerEnum(unittest.TestCase): + """IntegerEnum unit test stubs""" def setUp(self): pass @@ -27,10 +27,10 @@ def setUp(self): def tearDown(self): pass - def testOuterNumber(self): - """Test OuterNumber""" + def testIntegerEnum(self): + """Test IntegerEnum""" # FIXME: construct object with mandatory attributes with example values - # model = OuterNumber() # noqa: E501 + # model = IntegerEnum() # noqa: E501 pass diff --git a/samples/client/petstore/python-experimental/test/test_outer_composite.py b/samples/openapi3/client/petstore/python-experimental/test/test_integer_enum_one_value.py similarity index 51% rename from samples/client/petstore/python-experimental/test/test_outer_composite.py rename to samples/openapi3/client/petstore/python-experimental/test/test_integer_enum_one_value.py index f3ad1beff9e4..8cf89c4de1c4 100644 --- a/samples/client/petstore/python-experimental/test/test_outer_composite.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_integer_enum_one_value.py @@ -15,16 +15,11 @@ import unittest import petstore_api -try: - from petstore_api.model import outer_number -except ImportError: - outer_number = sys.modules[ - 'petstore_api.model.outer_number'] -from petstore_api.model.outer_composite import OuterComposite +from petstore_api.model.integer_enum_one_value import IntegerEnumOneValue -class TestOuterComposite(unittest.TestCase): - """OuterComposite unit test stubs""" +class TestIntegerEnumOneValue(unittest.TestCase): + """IntegerEnumOneValue unit test stubs""" def setUp(self): pass @@ -32,11 +27,13 @@ def setUp(self): def tearDown(self): pass - def testOuterComposite(self): - """Test OuterComposite""" - # FIXME: construct object with mandatory attributes with example values - # model = OuterComposite() # noqa: E501 - pass + def testIntegerEnumOneValue(self): + """Test IntegerEnumOneValue""" + model = IntegerEnumOneValue() + assert model.value == 0, "With only one option, the value is assigned automatically" + + model = IntegerEnumOneValue(value=0) + assert model.value == 0, "We can also pass in the value as a named argument" if __name__ == '__main__': diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_outer_enum_default_value.py b/samples/openapi3/client/petstore/python-experimental/test/test_integer_enum_with_default_value.py similarity index 63% rename from samples/openapi3/client/petstore/python-experimental/test/test_outer_enum_default_value.py rename to samples/openapi3/client/petstore/python-experimental/test/test_integer_enum_with_default_value.py index a0f6fb3cef51..0a83cb2f3f74 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_outer_enum_default_value.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_integer_enum_with_default_value.py @@ -15,11 +15,11 @@ import unittest import petstore_api -from petstore_api.model.outer_enum_default_value import OuterEnumDefaultValue +from petstore_api.model.integer_enum_with_default_value import IntegerEnumWithDefaultValue -class TestOuterEnumDefaultValue(unittest.TestCase): - """OuterEnumDefaultValue unit test stubs""" +class TestIntegerEnumWithDefaultValue(unittest.TestCase): + """IntegerEnumWithDefaultValue unit test stubs""" def setUp(self): pass @@ -27,10 +27,10 @@ def setUp(self): def tearDown(self): pass - def testOuterEnumDefaultValue(self): - """Test OuterEnumDefaultValue""" + def testIntegerEnumWithDefaultValue(self): + """Test IntegerEnumWithDefaultValue""" # FIXME: construct object with mandatory attributes with example values - # model = OuterEnumDefaultValue() # noqa: E501 + # model = IntegerEnumWithDefaultValue() # noqa: E501 pass diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_number_with_validations.py b/samples/openapi3/client/petstore/python-experimental/test/test_number_with_validations.py new file mode 100644 index 000000000000..b48904c59c70 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_number_with_validations.py @@ -0,0 +1,44 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use 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 __future__ import absolute_import +import sys +import unittest + +import petstore_api +from petstore_api.model.number_with_validations import NumberWithValidations + + +class TestNumberWithValidations(unittest.TestCase): + """NumberWithValidations unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testNumberWithValidations(self): + """Test NumberWithValidations""" + valid_values = [10.0, 15.0, 20.0] + for valid_value in valid_values: + model = NumberWithValidations(valid_value) + assert model.value == valid_value + + invalid_values = [9.0, 21.0] + for invalid_value in invalid_values: + with self.assertRaises(petstore_api.ApiValueError): + NumberWithValidations(invalid_value) + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_object_model_with_ref_props.py b/samples/openapi3/client/petstore/python-experimental/test/test_object_model_with_ref_props.py new file mode 100644 index 000000000000..e0a8b842685b --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_object_model_with_ref_props.py @@ -0,0 +1,49 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use 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 __future__ import absolute_import +import sys +import unittest + +import petstore_api +try: + from petstore_api.model import number_with_validations +except ImportError: + number_with_validations = sys.modules[ + 'petstore_api.model.number_with_validations'] +from petstore_api.model.object_model_with_ref_props import ObjectModelWithRefProps + + +class TestObjectModelWithRefProps(unittest.TestCase): + """ObjectModelWithRefProps unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testObjectModelWithRefProps(self): + """Test ObjectModelWithRefProps""" + from petstore_api.model.object_model_with_ref_props import str, number_with_validations + self.assertEqual( + ObjectModelWithRefProps.openapi_types, + { + 'my_number': (number_with_validations.NumberWithValidations,), + 'my_string': (str,), + 'my_boolean': (bool,), + } + ) + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_outer_composite.py b/samples/openapi3/client/petstore/python-experimental/test/test_outer_composite.py deleted file mode 100644 index 7da5c1f09b59..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/test/test_outer_composite.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 __future__ import absolute_import -import sys -import unittest - -import petstore_api -from petstore_api.model.outer_composite import OuterComposite - - -class TestOuterComposite(unittest.TestCase): - """OuterComposite unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testOuterComposite(self): - """Test OuterComposite""" - # FIXME: construct object with mandatory attributes with example values - # model = OuterComposite() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_outer_enum_integer_default_value.py b/samples/openapi3/client/petstore/python-experimental/test/test_outer_enum_integer_default_value.py deleted file mode 100644 index 6eb78f95b0cf..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/test/test_outer_enum_integer_default_value.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 __future__ import absolute_import -import sys -import unittest - -import petstore_api -from petstore_api.model.outer_enum_integer_default_value import OuterEnumIntegerDefaultValue - - -class TestOuterEnumIntegerDefaultValue(unittest.TestCase): - """OuterEnumIntegerDefaultValue unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testOuterEnumIntegerDefaultValue(self): - """Test OuterEnumIntegerDefaultValue""" - # FIXME: construct object with mandatory attributes with example values - # model = OuterEnumIntegerDefaultValue() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_outer_enum.py b/samples/openapi3/client/petstore/python-experimental/test/test_string_enum.py similarity index 51% rename from samples/openapi3/client/petstore/python-experimental/test/test_outer_enum.py rename to samples/openapi3/client/petstore/python-experimental/test/test_string_enum.py index ab9dac9d612b..3a2c316a0797 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_outer_enum.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_string_enum.py @@ -15,11 +15,11 @@ import unittest import petstore_api -from petstore_api.model.outer_enum import OuterEnum +from petstore_api.model.string_enum import StringEnum -class TestOuterEnum(unittest.TestCase): - """OuterEnum unit test stubs""" +class TestStringEnum(unittest.TestCase): + """StringEnum unit test stubs""" def setUp(self): pass @@ -27,18 +27,24 @@ def setUp(self): def tearDown(self): pass - def testOuterEnum(self): - """Test OuterEnum""" - # Since 'OuterEnum' is nullable, validate the null value can be assigned - # to OuterEnum. - inst = OuterEnum(None) + def testStringEnum(self): + """Test StringEnum""" + inst = StringEnum(None) self.assertIsNone(inst) - inst = OuterEnum('approved') - assert isinstance(inst, OuterEnum) + inst = StringEnum('approved') + assert isinstance(inst, StringEnum) with self.assertRaises(petstore_api.ApiValueError): - OuterEnum('garbage') + StringEnum('garbage') + + # make sure that we can access its allowed_values + assert StringEnum.allowed_values[('value',)] == { + 'None': None, + 'PLACED': "placed", + 'APPROVED': "approved", + 'DELIVERED': "delivered" + } if __name__ == '__main__': diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_outer_enum_integer.py b/samples/openapi3/client/petstore/python-experimental/test/test_string_enum_with_default_value.py similarity index 64% rename from samples/openapi3/client/petstore/python-experimental/test/test_outer_enum_integer.py rename to samples/openapi3/client/petstore/python-experimental/test/test_string_enum_with_default_value.py index 9e0fa2975b4b..fbf963edfa33 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_outer_enum_integer.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_string_enum_with_default_value.py @@ -15,11 +15,11 @@ import unittest import petstore_api -from petstore_api.model.outer_enum_integer import OuterEnumInteger +from petstore_api.model.string_enum_with_default_value import StringEnumWithDefaultValue -class TestOuterEnumInteger(unittest.TestCase): - """OuterEnumInteger unit test stubs""" +class TestStringEnumWithDefaultValue(unittest.TestCase): + """StringEnumWithDefaultValue unit test stubs""" def setUp(self): pass @@ -27,10 +27,10 @@ def setUp(self): def tearDown(self): pass - def testOuterEnumInteger(self): - """Test OuterEnumInteger""" + def testStringEnumWithDefaultValue(self): + """Test StringEnumWithDefaultValue""" # FIXME: construct object with mandatory attributes with example values - # model = OuterEnumInteger() # noqa: E501 + # model = StringEnumWithDefaultValue() # noqa: E501 pass diff --git a/samples/openapi3/client/petstore/python-experimental/tests/test_api_validation.py b/samples/openapi3/client/petstore/python-experimental/tests/test_api_validation.py index ced6a6c23186..696b05e548b3 100644 --- a/samples/openapi3/client/petstore/python-experimental/tests/test_api_validation.py +++ b/samples/openapi3/client/petstore/python-experimental/tests/test_api_validation.py @@ -25,7 +25,7 @@ from petstore_api.api import pet_api from petstore_api.model import array_of_enums from petstore_api.model import format_test -from petstore_api.model import outer_enum +from petstore_api.model import string_enum import petstore_api.configuration HOST = 'http://petstore.swagger.io/v2' @@ -74,7 +74,7 @@ def test_array_of_enums(self): response = MockResponse(data=json.dumps(data)) deserialized = self.api_client.deserialize(response, (array_of_enums.ArrayOfEnums, ), True) assert isinstance(deserialized, array_of_enums.ArrayOfEnums) - assert array_of_enums.ArrayOfEnums([outer_enum.OuterEnum(v) for v in data]) == deserialized + assert array_of_enums.ArrayOfEnums([string_enum.StringEnum(v) for v in data]) == deserialized def checkRaiseRegex(self, expected_exception, expected_regex): if sys.version_info < (3, 0): diff --git a/samples/openapi3/client/petstore/python-experimental/tests/test_deserialization.py b/samples/openapi3/client/petstore/python-experimental/tests/test_deserialization.py index 23e597d9bf54..ec30635b0794 100644 --- a/samples/openapi3/client/petstore/python-experimental/tests/test_deserialization.py +++ b/samples/openapi3/client/petstore/python-experimental/tests/test_deserialization.py @@ -29,6 +29,7 @@ fruit_req, drawing, banana_req, + number_with_validations, ) @@ -301,3 +302,29 @@ def test_deserialize_with_additional_properties_and_reference(self): } response = MockResponse(data=json.dumps(data)) deserialized = self.deserialize(response, (drawing.Drawing,), True) + + def test_deserialize_NumberWithValidations(self): + """ deserialize NumberWithValidations """ + # make sure that an exception is thrown on an invalid type value + with self.assertRaises(petstore_api.ApiTypeError): + self.deserialize( + MockResponse(data=json.dumps("test str")), + (number_with_validations.NumberWithValidations,), + True + ) + + # make sure that an exception is thrown on an invalid value + with self.assertRaises(petstore_api.ApiValueError): + self.deserialize( + MockResponse(data=json.dumps(21.0)), + (number_with_validations.NumberWithValidations,), + True + ) + + # valid value works + number_val = 11.0 + response = MockResponse(data=json.dumps(number_val)) + number = self.deserialize(response, + (number_with_validations.NumberWithValidations,), True) + self.assertTrue(isinstance(number, number_with_validations.NumberWithValidations)) + self.assertTrue(number.value == number_val) \ No newline at end of file From 5980c420e3c3eefda13d86010397e351b523b300 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Tue, 14 Jul 2020 12:36:05 +0800 Subject: [PATCH 016/129] minor fix to sample code (java jersey2) (#6921) --- .../Java/libraries/jersey2/api_doc.mustache | 2 +- .../java/jersey2-java8/docs/AnotherFakeApi.md | 2 +- .../java/jersey2-java8/docs/FakeApi.md | 28 ++++++++--------- .../docs/FakeClassnameTags123Api.md | 2 +- .../java/jersey2-java8/docs/PetApi.md | 18 +++++------ .../java/jersey2-java8/docs/StoreApi.md | 8 ++--- .../java/jersey2-java8/docs/UserApi.md | 16 +++++----- .../java/jersey2-java8/docs/AnotherFakeApi.md | 2 +- .../java/jersey2-java8/docs/DefaultApi.md | 2 +- .../java/jersey2-java8/docs/FakeApi.md | 30 +++++++++---------- .../docs/FakeClassnameTags123Api.md | 2 +- .../java/jersey2-java8/docs/PetApi.md | 18 +++++------ .../java/jersey2-java8/docs/StoreApi.md | 8 ++--- .../java/jersey2-java8/docs/UserApi.md | 16 +++++----- 14 files changed, 77 insertions(+), 77 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/api_doc.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/api_doc.mustache index f162d1cc9748..0e43b4af0bd0 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/api_doc.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/api_doc.mustache @@ -33,7 +33,7 @@ import {{{invokerPackage}}}.ApiClient; import {{{invokerPackage}}}.ApiException; import {{{invokerPackage}}}.Configuration;{{#hasAuthMethods}} import {{{invokerPackage}}}.auth.*;{{/hasAuthMethods}} -import {{{invokerPackage}}}.models.*; +import {{{invokerPackage}}}.model.*; import {{{package}}}.{{{classname}}}; public class Example { diff --git a/samples/client/petstore/java/jersey2-java8/docs/AnotherFakeApi.md b/samples/client/petstore/java/jersey2-java8/docs/AnotherFakeApi.md index 059616ec6baa..1634ef64dbbb 100644 --- a/samples/client/petstore/java/jersey2-java8/docs/AnotherFakeApi.md +++ b/samples/client/petstore/java/jersey2-java8/docs/AnotherFakeApi.md @@ -23,7 +23,7 @@ To test special tags and operation ID starting with number import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; import org.openapitools.client.Configuration; -import org.openapitools.client.models.*; +import org.openapitools.client.model.*; import org.openapitools.client.api.AnotherFakeApi; public class Example { diff --git a/samples/client/petstore/java/jersey2-java8/docs/FakeApi.md b/samples/client/petstore/java/jersey2-java8/docs/FakeApi.md index 543c51f066c5..86d830ab8237 100644 --- a/samples/client/petstore/java/jersey2-java8/docs/FakeApi.md +++ b/samples/client/petstore/java/jersey2-java8/docs/FakeApi.md @@ -36,7 +36,7 @@ this route creates an XmlItem import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; import org.openapitools.client.Configuration; -import org.openapitools.client.models.*; +import org.openapitools.client.model.*; import org.openapitools.client.api.FakeApi; public class Example { @@ -100,7 +100,7 @@ Test serialization of outer boolean types import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; import org.openapitools.client.Configuration; -import org.openapitools.client.models.*; +import org.openapitools.client.model.*; import org.openapitools.client.api.FakeApi; public class Example { @@ -165,7 +165,7 @@ Test serialization of object with outer number type import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; import org.openapitools.client.Configuration; -import org.openapitools.client.models.*; +import org.openapitools.client.model.*; import org.openapitools.client.api.FakeApi; public class Example { @@ -230,7 +230,7 @@ Test serialization of outer number types import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; import org.openapitools.client.Configuration; -import org.openapitools.client.models.*; +import org.openapitools.client.model.*; import org.openapitools.client.api.FakeApi; public class Example { @@ -295,7 +295,7 @@ Test serialization of outer string types import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; import org.openapitools.client.Configuration; -import org.openapitools.client.models.*; +import org.openapitools.client.model.*; import org.openapitools.client.api.FakeApi; public class Example { @@ -360,7 +360,7 @@ For this test, the body for this request much reference a schema named `File`. import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; import org.openapitools.client.Configuration; -import org.openapitools.client.models.*; +import org.openapitools.client.model.*; import org.openapitools.client.api.FakeApi; public class Example { @@ -422,7 +422,7 @@ No authorization required import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; import org.openapitools.client.Configuration; -import org.openapitools.client.models.*; +import org.openapitools.client.model.*; import org.openapitools.client.api.FakeApi; public class Example { @@ -488,7 +488,7 @@ To test "client" model import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; import org.openapitools.client.Configuration; -import org.openapitools.client.models.*; +import org.openapitools.client.model.*; import org.openapitools.client.api.FakeApi; public class Example { @@ -557,7 +557,7 @@ import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; import org.openapitools.client.Configuration; import org.openapitools.client.auth.*; -import org.openapitools.client.models.*; +import org.openapitools.client.model.*; import org.openapitools.client.api.FakeApi; public class Example { @@ -653,7 +653,7 @@ To test enum parameters import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; import org.openapitools.client.Configuration; -import org.openapitools.client.models.*; +import org.openapitools.client.model.*; import org.openapitools.client.api.FakeApi; public class Example { @@ -732,7 +732,7 @@ Fake endpoint to test group parameters (optional) import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; import org.openapitools.client.Configuration; -import org.openapitools.client.models.*; +import org.openapitools.client.model.*; import org.openapitools.client.api.FakeApi; public class Example { @@ -811,7 +811,7 @@ test inline additionalProperties import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; import org.openapitools.client.Configuration; -import org.openapitools.client.models.*; +import org.openapitools.client.model.*; import org.openapitools.client.api.FakeApi; public class Example { @@ -873,7 +873,7 @@ test json serialization of form data import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; import org.openapitools.client.Configuration; -import org.openapitools.client.models.*; +import org.openapitools.client.model.*; import org.openapitools.client.api.FakeApi; public class Example { @@ -939,7 +939,7 @@ To test the collection format in query parameters import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; import org.openapitools.client.Configuration; -import org.openapitools.client.models.*; +import org.openapitools.client.model.*; import org.openapitools.client.api.FakeApi; public class Example { diff --git a/samples/client/petstore/java/jersey2-java8/docs/FakeClassnameTags123Api.md b/samples/client/petstore/java/jersey2-java8/docs/FakeClassnameTags123Api.md index 14a74a37a4e2..66d3f7890a3a 100644 --- a/samples/client/petstore/java/jersey2-java8/docs/FakeClassnameTags123Api.md +++ b/samples/client/petstore/java/jersey2-java8/docs/FakeClassnameTags123Api.md @@ -24,7 +24,7 @@ import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; import org.openapitools.client.Configuration; import org.openapitools.client.auth.*; -import org.openapitools.client.models.*; +import org.openapitools.client.model.*; import org.openapitools.client.api.FakeClassnameTags123Api; public class Example { diff --git a/samples/client/petstore/java/jersey2-java8/docs/PetApi.md b/samples/client/petstore/java/jersey2-java8/docs/PetApi.md index d56efcd59677..fc2832ffb503 100644 --- a/samples/client/petstore/java/jersey2-java8/docs/PetApi.md +++ b/samples/client/petstore/java/jersey2-java8/docs/PetApi.md @@ -30,7 +30,7 @@ import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; import org.openapitools.client.Configuration; import org.openapitools.client.auth.*; -import org.openapitools.client.models.*; +import org.openapitools.client.model.*; import org.openapitools.client.api.PetApi; public class Example { @@ -98,7 +98,7 @@ import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; import org.openapitools.client.Configuration; import org.openapitools.client.auth.*; -import org.openapitools.client.models.*; +import org.openapitools.client.model.*; import org.openapitools.client.api.PetApi; public class Example { @@ -170,7 +170,7 @@ import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; import org.openapitools.client.Configuration; import org.openapitools.client.auth.*; -import org.openapitools.client.models.*; +import org.openapitools.client.model.*; import org.openapitools.client.api.PetApi; public class Example { @@ -241,7 +241,7 @@ import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; import org.openapitools.client.Configuration; import org.openapitools.client.auth.*; -import org.openapitools.client.models.*; +import org.openapitools.client.model.*; import org.openapitools.client.api.PetApi; public class Example { @@ -312,7 +312,7 @@ import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; import org.openapitools.client.Configuration; import org.openapitools.client.auth.*; -import org.openapitools.client.models.*; +import org.openapitools.client.model.*; import org.openapitools.client.api.PetApi; public class Example { @@ -384,7 +384,7 @@ import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; import org.openapitools.client.Configuration; import org.openapitools.client.auth.*; -import org.openapitools.client.models.*; +import org.openapitools.client.model.*; import org.openapitools.client.api.PetApi; public class Example { @@ -454,7 +454,7 @@ import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; import org.openapitools.client.Configuration; import org.openapitools.client.auth.*; -import org.openapitools.client.models.*; +import org.openapitools.client.model.*; import org.openapitools.client.api.PetApi; public class Example { @@ -525,7 +525,7 @@ import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; import org.openapitools.client.Configuration; import org.openapitools.client.auth.*; -import org.openapitools.client.models.*; +import org.openapitools.client.model.*; import org.openapitools.client.api.PetApi; public class Example { @@ -597,7 +597,7 @@ import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; import org.openapitools.client.Configuration; import org.openapitools.client.auth.*; -import org.openapitools.client.models.*; +import org.openapitools.client.model.*; import org.openapitools.client.api.PetApi; public class Example { diff --git a/samples/client/petstore/java/jersey2-java8/docs/StoreApi.md b/samples/client/petstore/java/jersey2-java8/docs/StoreApi.md index 6625d5969ee4..6335befe4714 100644 --- a/samples/client/petstore/java/jersey2-java8/docs/StoreApi.md +++ b/samples/client/petstore/java/jersey2-java8/docs/StoreApi.md @@ -26,7 +26,7 @@ For valid response try integer IDs with value < 1000. Anything above 1000 or non import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; import org.openapitools.client.Configuration; -import org.openapitools.client.models.*; +import org.openapitools.client.model.*; import org.openapitools.client.api.StoreApi; public class Example { @@ -92,7 +92,7 @@ import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; import org.openapitools.client.Configuration; import org.openapitools.client.auth.*; -import org.openapitools.client.models.*; +import org.openapitools.client.model.*; import org.openapitools.client.api.StoreApi; public class Example { @@ -159,7 +159,7 @@ For valid response try integer IDs with value <= 5 or > 10. Other values will ge import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; import org.openapitools.client.Configuration; -import org.openapitools.client.models.*; +import org.openapitools.client.model.*; import org.openapitools.client.api.StoreApi; public class Example { @@ -224,7 +224,7 @@ Place an order for a pet import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; import org.openapitools.client.Configuration; -import org.openapitools.client.models.*; +import org.openapitools.client.model.*; import org.openapitools.client.api.StoreApi; public class Example { diff --git a/samples/client/petstore/java/jersey2-java8/docs/UserApi.md b/samples/client/petstore/java/jersey2-java8/docs/UserApi.md index ca9f550c3167..d81d5f802230 100644 --- a/samples/client/petstore/java/jersey2-java8/docs/UserApi.md +++ b/samples/client/petstore/java/jersey2-java8/docs/UserApi.md @@ -30,7 +30,7 @@ This can only be done by the logged in user. import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; import org.openapitools.client.Configuration; -import org.openapitools.client.models.*; +import org.openapitools.client.model.*; import org.openapitools.client.api.UserApi; public class Example { @@ -92,7 +92,7 @@ Creates list of users with given input array import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; import org.openapitools.client.Configuration; -import org.openapitools.client.models.*; +import org.openapitools.client.model.*; import org.openapitools.client.api.UserApi; public class Example { @@ -154,7 +154,7 @@ Creates list of users with given input array import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; import org.openapitools.client.Configuration; -import org.openapitools.client.models.*; +import org.openapitools.client.model.*; import org.openapitools.client.api.UserApi; public class Example { @@ -218,7 +218,7 @@ This can only be done by the logged in user. import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; import org.openapitools.client.Configuration; -import org.openapitools.client.models.*; +import org.openapitools.client.model.*; import org.openapitools.client.api.UserApi; public class Example { @@ -281,7 +281,7 @@ Get user by user name import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; import org.openapitools.client.Configuration; -import org.openapitools.client.models.*; +import org.openapitools.client.model.*; import org.openapitools.client.api.UserApi; public class Example { @@ -346,7 +346,7 @@ Logs user into the system import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; import org.openapitools.client.Configuration; -import org.openapitools.client.models.*; +import org.openapitools.client.model.*; import org.openapitools.client.api.UserApi; public class Example { @@ -412,7 +412,7 @@ Logs out current logged in user session import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; import org.openapitools.client.Configuration; -import org.openapitools.client.models.*; +import org.openapitools.client.model.*; import org.openapitools.client.api.UserApi; public class Example { @@ -472,7 +472,7 @@ This can only be done by the logged in user. import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; import org.openapitools.client.Configuration; -import org.openapitools.client.models.*; +import org.openapitools.client.model.*; import org.openapitools.client.api.UserApi; public class Example { diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/docs/AnotherFakeApi.md b/samples/openapi3/client/petstore/java/jersey2-java8/docs/AnotherFakeApi.md index 6740d5770dae..4524daa6f9c7 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/docs/AnotherFakeApi.md +++ b/samples/openapi3/client/petstore/java/jersey2-java8/docs/AnotherFakeApi.md @@ -23,7 +23,7 @@ To test special tags and operation ID starting with number import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; import org.openapitools.client.Configuration; -import org.openapitools.client.models.*; +import org.openapitools.client.model.*; import org.openapitools.client.api.AnotherFakeApi; public class Example { diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/docs/DefaultApi.md b/samples/openapi3/client/petstore/java/jersey2-java8/docs/DefaultApi.md index afb01fb82916..6ceb1705e7ed 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/docs/DefaultApi.md +++ b/samples/openapi3/client/petstore/java/jersey2-java8/docs/DefaultApi.md @@ -21,7 +21,7 @@ Method | HTTP request | Description import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; import org.openapitools.client.Configuration; -import org.openapitools.client.models.*; +import org.openapitools.client.model.*; import org.openapitools.client.api.DefaultApi; public class Example { diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/docs/FakeApi.md b/samples/openapi3/client/petstore/java/jersey2-java8/docs/FakeApi.md index 406019f765a8..8fdd5102fa6c 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/docs/FakeApi.md +++ b/samples/openapi3/client/petstore/java/jersey2-java8/docs/FakeApi.md @@ -35,7 +35,7 @@ Health check endpoint import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; import org.openapitools.client.Configuration; -import org.openapitools.client.models.*; +import org.openapitools.client.model.*; import org.openapitools.client.api.FakeApi; public class Example { @@ -96,7 +96,7 @@ Test serialization of outer boolean types import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; import org.openapitools.client.Configuration; -import org.openapitools.client.models.*; +import org.openapitools.client.model.*; import org.openapitools.client.api.FakeApi; public class Example { @@ -161,7 +161,7 @@ Test serialization of object with outer number type import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; import org.openapitools.client.Configuration; -import org.openapitools.client.models.*; +import org.openapitools.client.model.*; import org.openapitools.client.api.FakeApi; public class Example { @@ -226,7 +226,7 @@ Test serialization of outer number types import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; import org.openapitools.client.Configuration; -import org.openapitools.client.models.*; +import org.openapitools.client.model.*; import org.openapitools.client.api.FakeApi; public class Example { @@ -291,7 +291,7 @@ Test serialization of outer string types import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; import org.openapitools.client.Configuration; -import org.openapitools.client.models.*; +import org.openapitools.client.model.*; import org.openapitools.client.api.FakeApi; public class Example { @@ -354,7 +354,7 @@ Array of Enums import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; import org.openapitools.client.Configuration; -import org.openapitools.client.models.*; +import org.openapitools.client.model.*; import org.openapitools.client.api.FakeApi; public class Example { @@ -415,7 +415,7 @@ For this test, the body for this request much reference a schema named `File`. import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; import org.openapitools.client.Configuration; -import org.openapitools.client.models.*; +import org.openapitools.client.model.*; import org.openapitools.client.api.FakeApi; public class Example { @@ -477,7 +477,7 @@ No authorization required import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; import org.openapitools.client.Configuration; -import org.openapitools.client.models.*; +import org.openapitools.client.model.*; import org.openapitools.client.api.FakeApi; public class Example { @@ -543,7 +543,7 @@ To test "client" model import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; import org.openapitools.client.Configuration; -import org.openapitools.client.models.*; +import org.openapitools.client.model.*; import org.openapitools.client.api.FakeApi; public class Example { @@ -613,7 +613,7 @@ import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; import org.openapitools.client.Configuration; import org.openapitools.client.auth.*; -import org.openapitools.client.models.*; +import org.openapitools.client.model.*; import org.openapitools.client.api.FakeApi; public class Example { @@ -709,7 +709,7 @@ To test enum parameters import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; import org.openapitools.client.Configuration; -import org.openapitools.client.models.*; +import org.openapitools.client.model.*; import org.openapitools.client.api.FakeApi; public class Example { @@ -789,7 +789,7 @@ import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; import org.openapitools.client.Configuration; import org.openapitools.client.auth.*; -import org.openapitools.client.models.*; +import org.openapitools.client.model.*; import org.openapitools.client.api.FakeApi; public class Example { @@ -872,7 +872,7 @@ test inline additionalProperties import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; import org.openapitools.client.Configuration; -import org.openapitools.client.models.*; +import org.openapitools.client.model.*; import org.openapitools.client.api.FakeApi; public class Example { @@ -934,7 +934,7 @@ test json serialization of form data import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; import org.openapitools.client.Configuration; -import org.openapitools.client.models.*; +import org.openapitools.client.model.*; import org.openapitools.client.api.FakeApi; public class Example { @@ -1000,7 +1000,7 @@ To test the collection format in query parameters import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; import org.openapitools.client.Configuration; -import org.openapitools.client.models.*; +import org.openapitools.client.model.*; import org.openapitools.client.api.FakeApi; public class Example { diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/docs/FakeClassnameTags123Api.md b/samples/openapi3/client/petstore/java/jersey2-java8/docs/FakeClassnameTags123Api.md index db98afa721ec..1222c2676d37 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/docs/FakeClassnameTags123Api.md +++ b/samples/openapi3/client/petstore/java/jersey2-java8/docs/FakeClassnameTags123Api.md @@ -24,7 +24,7 @@ import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; import org.openapitools.client.Configuration; import org.openapitools.client.auth.*; -import org.openapitools.client.models.*; +import org.openapitools.client.model.*; import org.openapitools.client.api.FakeClassnameTags123Api; public class Example { diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/docs/PetApi.md b/samples/openapi3/client/petstore/java/jersey2-java8/docs/PetApi.md index 481aad16d4c9..6a15b0122195 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/docs/PetApi.md +++ b/samples/openapi3/client/petstore/java/jersey2-java8/docs/PetApi.md @@ -30,7 +30,7 @@ import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; import org.openapitools.client.Configuration; import org.openapitools.client.auth.*; -import org.openapitools.client.models.*; +import org.openapitools.client.model.*; import org.openapitools.client.api.PetApi; public class Example { @@ -98,7 +98,7 @@ import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; import org.openapitools.client.Configuration; import org.openapitools.client.auth.*; -import org.openapitools.client.models.*; +import org.openapitools.client.model.*; import org.openapitools.client.api.PetApi; public class Example { @@ -169,7 +169,7 @@ import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; import org.openapitools.client.Configuration; import org.openapitools.client.auth.*; -import org.openapitools.client.models.*; +import org.openapitools.client.model.*; import org.openapitools.client.api.PetApi; public class Example { @@ -241,7 +241,7 @@ import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; import org.openapitools.client.Configuration; import org.openapitools.client.auth.*; -import org.openapitools.client.models.*; +import org.openapitools.client.model.*; import org.openapitools.client.api.PetApi; public class Example { @@ -313,7 +313,7 @@ import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; import org.openapitools.client.Configuration; import org.openapitools.client.auth.*; -import org.openapitools.client.models.*; +import org.openapitools.client.model.*; import org.openapitools.client.api.PetApi; public class Example { @@ -385,7 +385,7 @@ import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; import org.openapitools.client.Configuration; import org.openapitools.client.auth.*; -import org.openapitools.client.models.*; +import org.openapitools.client.model.*; import org.openapitools.client.api.PetApi; public class Example { @@ -455,7 +455,7 @@ import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; import org.openapitools.client.Configuration; import org.openapitools.client.auth.*; -import org.openapitools.client.models.*; +import org.openapitools.client.model.*; import org.openapitools.client.api.PetApi; public class Example { @@ -526,7 +526,7 @@ import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; import org.openapitools.client.Configuration; import org.openapitools.client.auth.*; -import org.openapitools.client.models.*; +import org.openapitools.client.model.*; import org.openapitools.client.api.PetApi; public class Example { @@ -598,7 +598,7 @@ import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; import org.openapitools.client.Configuration; import org.openapitools.client.auth.*; -import org.openapitools.client.models.*; +import org.openapitools.client.model.*; import org.openapitools.client.api.PetApi; public class Example { diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/docs/StoreApi.md b/samples/openapi3/client/petstore/java/jersey2-java8/docs/StoreApi.md index 5d2d7ad5118b..5f95c2a8d37a 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/docs/StoreApi.md +++ b/samples/openapi3/client/petstore/java/jersey2-java8/docs/StoreApi.md @@ -26,7 +26,7 @@ For valid response try integer IDs with value < 1000. Anything above 1000 or non import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; import org.openapitools.client.Configuration; -import org.openapitools.client.models.*; +import org.openapitools.client.model.*; import org.openapitools.client.api.StoreApi; public class Example { @@ -92,7 +92,7 @@ import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; import org.openapitools.client.Configuration; import org.openapitools.client.auth.*; -import org.openapitools.client.models.*; +import org.openapitools.client.model.*; import org.openapitools.client.api.StoreApi; public class Example { @@ -159,7 +159,7 @@ For valid response try integer IDs with value <= 5 or > 10. Other values will ge import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; import org.openapitools.client.Configuration; -import org.openapitools.client.models.*; +import org.openapitools.client.model.*; import org.openapitools.client.api.StoreApi; public class Example { @@ -224,7 +224,7 @@ Place an order for a pet import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; import org.openapitools.client.Configuration; -import org.openapitools.client.models.*; +import org.openapitools.client.model.*; import org.openapitools.client.api.StoreApi; public class Example { diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/docs/UserApi.md b/samples/openapi3/client/petstore/java/jersey2-java8/docs/UserApi.md index d7e613c24af5..49d31db2ee2c 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/docs/UserApi.md +++ b/samples/openapi3/client/petstore/java/jersey2-java8/docs/UserApi.md @@ -30,7 +30,7 @@ This can only be done by the logged in user. import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; import org.openapitools.client.Configuration; -import org.openapitools.client.models.*; +import org.openapitools.client.model.*; import org.openapitools.client.api.UserApi; public class Example { @@ -92,7 +92,7 @@ Creates list of users with given input array import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; import org.openapitools.client.Configuration; -import org.openapitools.client.models.*; +import org.openapitools.client.model.*; import org.openapitools.client.api.UserApi; public class Example { @@ -154,7 +154,7 @@ Creates list of users with given input array import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; import org.openapitools.client.Configuration; -import org.openapitools.client.models.*; +import org.openapitools.client.model.*; import org.openapitools.client.api.UserApi; public class Example { @@ -218,7 +218,7 @@ This can only be done by the logged in user. import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; import org.openapitools.client.Configuration; -import org.openapitools.client.models.*; +import org.openapitools.client.model.*; import org.openapitools.client.api.UserApi; public class Example { @@ -281,7 +281,7 @@ Get user by user name import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; import org.openapitools.client.Configuration; -import org.openapitools.client.models.*; +import org.openapitools.client.model.*; import org.openapitools.client.api.UserApi; public class Example { @@ -346,7 +346,7 @@ Logs user into the system import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; import org.openapitools.client.Configuration; -import org.openapitools.client.models.*; +import org.openapitools.client.model.*; import org.openapitools.client.api.UserApi; public class Example { @@ -412,7 +412,7 @@ Logs out current logged in user session import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; import org.openapitools.client.Configuration; -import org.openapitools.client.models.*; +import org.openapitools.client.model.*; import org.openapitools.client.api.UserApi; public class Example { @@ -472,7 +472,7 @@ This can only be done by the logged in user. import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; import org.openapitools.client.Configuration; -import org.openapitools.client.models.*; +import org.openapitools.client.model.*; import org.openapitools.client.api.UserApi; public class Example { From b86a51ae17e25feae0e0c9f9e6f423b8ff54057d Mon Sep 17 00:00:00 2001 From: Sebastien Rosset Date: Mon, 13 Jul 2020 23:03:04 -0700 Subject: [PATCH 017/129] fix typo (#6928) --- .../main/resources/Java/libraries/jersey2/ApiClient.mustache | 2 +- .../src/main/java/org/openapitools/client/ApiClient.java | 2 +- .../src/main/java/org/openapitools/client/ApiClient.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/ApiClient.mustache index dc15ec47491d..4e934eb0e334 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/ApiClient.mustache @@ -888,7 +888,7 @@ public class ApiClient { * @param obj Object * @param formParams Form parameters * @param contentType Context type - * @param isBodyNulalble True if the body is nullable + * @param isBodyNullable True if the body is nullable * @return String * @throws ApiException API exception */ diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java index 226aea1527c9..be654a23d821 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java @@ -805,7 +805,7 @@ public Entity serialize(Object obj, Map formParams, String co * @param obj Object * @param formParams Form parameters * @param contentType Context type - * @param isBodyNulalble True if the body is nullable + * @param isBodyNullable True if the body is nullable * @return String * @throws ApiException API exception */ diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java index 68024ca7114a..0e7b60361a5d 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java @@ -884,7 +884,7 @@ public Entity serialize(Object obj, Map formParams, String co * @param obj Object * @param formParams Form parameters * @param contentType Context type - * @param isBodyNulalble True if the body is nullable + * @param isBodyNullable True if the body is nullable * @return String * @throws ApiException API exception */ From 9d76ca291ee0d546cd6b9c1d15a9166fd5cb9aef Mon Sep 17 00:00:00 2001 From: William Cheng Date: Wed, 15 Jul 2020 00:19:13 +0800 Subject: [PATCH 018/129] add nullable body support to powershell (#6930) --- .../main/resources/powershell/api.mustache | 3 ++- .../resources/powershell/api_client.mustache | 9 +++++-- samples/client/petstore/powershell/Test1.ps1 | 9 +++---- .../src/PSPetstore/Api/PSPetApi.ps1 | 24 ++++++++++++------- .../src/PSPetstore/Api/PSStoreApi.ps1 | 12 ++++++---- .../src/PSPetstore/Api/PSUserApi.ps1 | 24 ++++++++++++------- .../src/PSPetstore/Private/PSApiClient.ps1 | 9 +++++-- 7 files changed, 61 insertions(+), 29 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/powershell/api.mustache b/modules/openapi-generator/src/main/resources/powershell/api.mustache index 114d14c81cec..2024cd79ff8c 100644 --- a/modules/openapi-generator/src/main/resources/powershell/api.mustache +++ b/modules/openapi-generator/src/main/resources/powershell/api.mustache @@ -221,7 +221,8 @@ function {{{vendorExtensions.x-powershell-method-name}}} { -QueryParameters $LocalVarQueryParameters ` -FormParameters $LocalVarFormParameters ` -CookieParameters $LocalVarCookieParameters ` - -ReturnType "{{#returnType}}{{{.}}}{{/returnType}}" + -ReturnType "{{#returnType}}{{{.}}}{{/returnType}}" ` + -IsBodyNullable {{#bodyParam}}{{#isNullable}}$true{{/isNullable}}{{^isNullable}}$false{{/isNullable}}{{/bodyParam}}{{^bodyParam}}$false{{/bodyParam}} {{#vendorExtensions.x-ps-return-type-one-of}} # process oneOf response diff --git a/modules/openapi-generator/src/main/resources/powershell/api_client.mustache b/modules/openapi-generator/src/main/resources/powershell/api_client.mustache index 95b23b26d5fa..a8af6c94f329 100644 --- a/modules/openapi-generator/src/main/resources/powershell/api_client.mustache +++ b/modules/openapi-generator/src/main/resources/powershell/api_client.mustache @@ -26,7 +26,9 @@ function Invoke-{{{apiNamePrefix}}}ApiClient { [string]$Method, [Parameter(Mandatory)] [AllowEmptyString()] - [string]$ReturnType + [string]$ReturnType, + [Parameter(Mandatory)] + [bool]$IsBodyNullable ) 'Calling method: Invoke-{{{apiNamePrefix}}}ApiClient' | Write-Debug @@ -85,8 +87,11 @@ function Invoke-{{{apiNamePrefix}}}ApiClient { $RequestBody = $FormParameters } - if ($Body) { + if ($Body -or $IsBodyNullable) { $RequestBody = $Body + if ([string]::IsNullOrEmpty($RequestBody) -and $IsBodyNullable -eq $true) { + $RequestBody = "null" + } } {{#hasHttpSignatureMethods}} diff --git a/samples/client/petstore/powershell/Test1.ps1 b/samples/client/petstore/powershell/Test1.ps1 index cf00308684a8..e695e6728064 100644 --- a/samples/client/petstore/powershell/Test1.ps1 +++ b/samples/client/petstore/powershell/Test1.ps1 @@ -27,13 +27,14 @@ $Id = 38369 ) -Status Available #Write-Host $pet - $Result = Add-PSPet -Pet $pet + #$Result = Add-PSPet -Pet $pet + $Result = Add-PSPet -Pet $null Set-PSConfigurationApiKey -Id "api_key" -ApiKey "zzZZZZZZZZZZZZZ" $Result2 = Get-PSPetById -petId ($Id) -Verbose -WithHttpInfo #-testHeader "testing only" -testQuery "testing something here" Write-Host $Result2["Headers"]["Content-Type"] - $Result3 = Get-PSPetById -petId ($Id) -Verbose -WithHttpInfo -ReturnType "application/xml" #-testHeader "testing only" -testQuery "testing something here" - Write-Host $Result3["Headers"]["Content-Type"] - Write-Host $Result3["Response"] + #$Result3 = Get-PSPetById -petId ($Id) -Verbose -WithHttpInfo -ReturnType "application/xml" #-testHeader "testing only" -testQuery "testing something here" + #Write-Host $Result3["Headers"]["Content-Type"] + #Write-Host $Result3["Response"] #} catch { # Write-Host ("Exception occured when calling '': {0}" -f ($_.ErrorDetails | ConvertFrom-Json)) # Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json)) diff --git a/samples/client/petstore/powershell/src/PSPetstore/Api/PSPetApi.ps1 b/samples/client/petstore/powershell/src/PSPetstore/Api/PSPetApi.ps1 index fd9df6cce81b..4024745d0ca5 100644 --- a/samples/client/petstore/powershell/src/PSPetstore/Api/PSPetApi.ps1 +++ b/samples/client/petstore/powershell/src/PSPetstore/Api/PSPetApi.ps1 @@ -85,7 +85,8 @@ function Add-PSPet { -QueryParameters $LocalVarQueryParameters ` -FormParameters $LocalVarFormParameters ` -CookieParameters $LocalVarCookieParameters ` - -ReturnType "Pet" + -ReturnType "Pet" ` + -IsBodyNullable $false if ($WithHttpInfo.IsPresent) { return $LocalVarResult @@ -165,7 +166,8 @@ function Remove-Pet { -QueryParameters $LocalVarQueryParameters ` -FormParameters $LocalVarFormParameters ` -CookieParameters $LocalVarCookieParameters ` - -ReturnType "" + -ReturnType "" ` + -IsBodyNullable $false if ($WithHttpInfo.IsPresent) { return $LocalVarResult @@ -252,7 +254,8 @@ function Find-PSPetsByStatus { -QueryParameters $LocalVarQueryParameters ` -FormParameters $LocalVarFormParameters ` -CookieParameters $LocalVarCookieParameters ` - -ReturnType "Pet[]" + -ReturnType "Pet[]" ` + -IsBodyNullable $false if ($WithHttpInfo.IsPresent) { return $LocalVarResult @@ -338,7 +341,8 @@ function Find-PSPetsByTags { -QueryParameters $LocalVarQueryParameters ` -FormParameters $LocalVarFormParameters ` -CookieParameters $LocalVarCookieParameters ` - -ReturnType "Pet[]" + -ReturnType "Pet[]" ` + -IsBodyNullable $false if ($WithHttpInfo.IsPresent) { return $LocalVarResult @@ -427,7 +431,8 @@ function Get-PSPetById { -QueryParameters $LocalVarQueryParameters ` -FormParameters $LocalVarFormParameters ` -CookieParameters $LocalVarCookieParameters ` - -ReturnType "Pet" + -ReturnType "Pet" ` + -IsBodyNullable $false if ($WithHttpInfo.IsPresent) { return $LocalVarResult @@ -517,7 +522,8 @@ function Update-PSPet { -QueryParameters $LocalVarQueryParameters ` -FormParameters $LocalVarFormParameters ` -CookieParameters $LocalVarCookieParameters ` - -ReturnType "Pet" + -ReturnType "Pet" ` + -IsBodyNullable $false if ($WithHttpInfo.IsPresent) { return $LocalVarResult @@ -610,7 +616,8 @@ function Update-PSPetWithForm { -QueryParameters $LocalVarQueryParameters ` -FormParameters $LocalVarFormParameters ` -CookieParameters $LocalVarCookieParameters ` - -ReturnType "" + -ReturnType "" ` + -IsBodyNullable $false if ($WithHttpInfo.IsPresent) { return $LocalVarResult @@ -706,7 +713,8 @@ function Invoke-PSUploadFile { -QueryParameters $LocalVarQueryParameters ` -FormParameters $LocalVarFormParameters ` -CookieParameters $LocalVarCookieParameters ` - -ReturnType "ApiResponse" + -ReturnType "ApiResponse" ` + -IsBodyNullable $false if ($WithHttpInfo.IsPresent) { return $LocalVarResult diff --git a/samples/client/petstore/powershell/src/PSPetstore/Api/PSStoreApi.ps1 b/samples/client/petstore/powershell/src/PSPetstore/Api/PSStoreApi.ps1 index dc4ffa2b974b..ae56dcdd258b 100644 --- a/samples/client/petstore/powershell/src/PSPetstore/Api/PSStoreApi.ps1 +++ b/samples/client/petstore/powershell/src/PSPetstore/Api/PSStoreApi.ps1 @@ -64,7 +64,8 @@ function Remove-PSOrder { -QueryParameters $LocalVarQueryParameters ` -FormParameters $LocalVarFormParameters ` -CookieParameters $LocalVarCookieParameters ` - -ReturnType "" + -ReturnType "" ` + -IsBodyNullable $false if ($WithHttpInfo.IsPresent) { return $LocalVarResult @@ -131,7 +132,8 @@ function Get-PSInventory { -QueryParameters $LocalVarQueryParameters ` -FormParameters $LocalVarFormParameters ` -CookieParameters $LocalVarCookieParameters ` - -ReturnType "System.Collections.Hashtable" + -ReturnType "System.Collections.Hashtable" ` + -IsBodyNullable $false if ($WithHttpInfo.IsPresent) { return $LocalVarResult @@ -215,7 +217,8 @@ function Get-PSOrderById { -QueryParameters $LocalVarQueryParameters ` -FormParameters $LocalVarFormParameters ` -CookieParameters $LocalVarCookieParameters ` - -ReturnType "Order" + -ReturnType "Order" ` + -IsBodyNullable $false if ($WithHttpInfo.IsPresent) { return $LocalVarResult @@ -304,7 +307,8 @@ function Invoke-PSPlaceOrder { -QueryParameters $LocalVarQueryParameters ` -FormParameters $LocalVarFormParameters ` -CookieParameters $LocalVarCookieParameters ` - -ReturnType "Order" + -ReturnType "Order" ` + -IsBodyNullable $false if ($WithHttpInfo.IsPresent) { return $LocalVarResult diff --git a/samples/client/petstore/powershell/src/PSPetstore/Api/PSUserApi.ps1 b/samples/client/petstore/powershell/src/PSPetstore/Api/PSUserApi.ps1 index e6fb9a8e081f..cbf47aace799 100644 --- a/samples/client/petstore/powershell/src/PSPetstore/Api/PSUserApi.ps1 +++ b/samples/client/petstore/powershell/src/PSPetstore/Api/PSUserApi.ps1 @@ -74,7 +74,8 @@ function New-PSUser { -QueryParameters $LocalVarQueryParameters ` -FormParameters $LocalVarFormParameters ` -CookieParameters $LocalVarCookieParameters ` - -ReturnType "" + -ReturnType "" ` + -IsBodyNullable $false if ($WithHttpInfo.IsPresent) { return $LocalVarResult @@ -153,7 +154,8 @@ function New-PSUsersWithArrayInput { -QueryParameters $LocalVarQueryParameters ` -FormParameters $LocalVarFormParameters ` -CookieParameters $LocalVarCookieParameters ` - -ReturnType "" + -ReturnType "" ` + -IsBodyNullable $false if ($WithHttpInfo.IsPresent) { return $LocalVarResult @@ -232,7 +234,8 @@ function New-PSUsersWithListInput { -QueryParameters $LocalVarQueryParameters ` -FormParameters $LocalVarFormParameters ` -CookieParameters $LocalVarCookieParameters ` - -ReturnType "" + -ReturnType "" ` + -IsBodyNullable $false if ($WithHttpInfo.IsPresent) { return $LocalVarResult @@ -306,7 +309,8 @@ function Remove-PSUser { -QueryParameters $LocalVarQueryParameters ` -FormParameters $LocalVarFormParameters ` -CookieParameters $LocalVarCookieParameters ` - -ReturnType "" + -ReturnType "" ` + -IsBodyNullable $false if ($WithHttpInfo.IsPresent) { return $LocalVarResult @@ -390,7 +394,8 @@ function Get-PSUserByName { -QueryParameters $LocalVarQueryParameters ` -FormParameters $LocalVarFormParameters ` -CookieParameters $LocalVarCookieParameters ` - -ReturnType "User" + -ReturnType "User" ` + -IsBodyNullable $false if ($WithHttpInfo.IsPresent) { return $LocalVarResult @@ -486,7 +491,8 @@ function Invoke-PSLoginUser { -QueryParameters $LocalVarQueryParameters ` -FormParameters $LocalVarFormParameters ` -CookieParameters $LocalVarCookieParameters ` - -ReturnType "String" + -ReturnType "String" ` + -IsBodyNullable $false if ($WithHttpInfo.IsPresent) { return $LocalVarResult @@ -550,7 +556,8 @@ function Invoke-PSLogoutUser { -QueryParameters $LocalVarQueryParameters ` -FormParameters $LocalVarFormParameters ` -CookieParameters $LocalVarCookieParameters ` - -ReturnType "" + -ReturnType "" ` + -IsBodyNullable $false if ($WithHttpInfo.IsPresent) { return $LocalVarResult @@ -639,7 +646,8 @@ function Update-PSUser { -QueryParameters $LocalVarQueryParameters ` -FormParameters $LocalVarFormParameters ` -CookieParameters $LocalVarCookieParameters ` - -ReturnType "" + -ReturnType "" ` + -IsBodyNullable $false if ($WithHttpInfo.IsPresent) { return $LocalVarResult diff --git a/samples/client/petstore/powershell/src/PSPetstore/Private/PSApiClient.ps1 b/samples/client/petstore/powershell/src/PSPetstore/Private/PSApiClient.ps1 index e965758e23a8..64e1407872c6 100644 --- a/samples/client/petstore/powershell/src/PSPetstore/Private/PSApiClient.ps1 +++ b/samples/client/petstore/powershell/src/PSPetstore/Private/PSApiClient.ps1 @@ -32,7 +32,9 @@ function Invoke-PSApiClient { [string]$Method, [Parameter(Mandatory)] [AllowEmptyString()] - [string]$ReturnType + [string]$ReturnType, + [Parameter(Mandatory)] + [bool]$IsBodyNullable ) 'Calling method: Invoke-PSApiClient' | Write-Debug @@ -91,8 +93,11 @@ function Invoke-PSApiClient { $RequestBody = $FormParameters } - if ($Body) { + if ($Body -or $IsBodyNullable) { $RequestBody = $Body + if ([string]::IsNullOrEmpty($RequestBody) -and $IsBodyNullable -eq $true) { + $RequestBody = "null" + } } if ($SkipCertificateCheck -eq $true) { From 38368c9bdaf1abbf5ed94b34b4e806cdbc5e7607 Mon Sep 17 00:00:00 2001 From: Sebastien Rosset Date: Tue, 14 Jul 2020 09:19:55 -0700 Subject: [PATCH 019/129] [Java][jersey2] Fix format of Date header in HTTP signature (#6925) * Use RFC 1123 date format for Date header in HTTP signature * Use RFC 1123 date format for Date header in HTTP signature --- .../Java/libraries/jersey2/auth/HttpSignatureAuth.mustache | 6 +++++- .../org/openapitools/client/auth/HttpSignatureAuth.java | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/auth/HttpSignatureAuth.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/auth/HttpSignatureAuth.mustache index 787bef3db0ca..9ff634208834 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/auth/HttpSignatureAuth.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/auth/HttpSignatureAuth.mustache @@ -12,10 +12,12 @@ import java.security.Key; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Base64; +import java.util.Calendar; import java.util.Date; import java.util.Locale; import java.util.Map; import java.util.List; +import java.util.TimeZone; import java.security.spec.AlgorithmParameterSpec; import java.security.InvalidKeyException; @@ -236,7 +238,9 @@ public class HttpSignatureAuth implements Authentication { } if (headers.contains("date")) { - headerParams.put("date", new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss zzz", Locale.US).format(new Date())); + SimpleDateFormat dateFormat = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss z", Locale.US); + dateFormat.setTimeZone(TimeZone.getTimeZone("GMT")); + headerParams.put("date", dateFormat.format(Calendar.getInstance().getTime())); } if (headers.contains("digest")) { diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/auth/HttpSignatureAuth.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/auth/HttpSignatureAuth.java index a85f4ae3a822..9c3bac079355 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/auth/HttpSignatureAuth.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/auth/HttpSignatureAuth.java @@ -23,10 +23,12 @@ import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Base64; +import java.util.Calendar; import java.util.Date; import java.util.Locale; import java.util.Map; import java.util.List; +import java.util.TimeZone; import java.security.spec.AlgorithmParameterSpec; import java.security.InvalidKeyException; @@ -247,7 +249,9 @@ public void applyToParams(List queryParams, Map headerPara } if (headers.contains("date")) { - headerParams.put("date", new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss zzz", Locale.US).format(new Date())); + SimpleDateFormat dateFormat = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss z", Locale.US); + dateFormat.setTimeZone(TimeZone.getTimeZone("GMT")); + headerParams.put("date", dateFormat.format(Calendar.getInstance().getTime())); } if (headers.contains("digest")) { From cef1bec4666e7841c39a37eec97b2e81c96ad9f0 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Wed, 15 Jul 2020 00:50:37 +0800 Subject: [PATCH 020/129] fix null payload in java jersey2 (#6933) --- .../main/resources/Java/libraries/jersey2/ApiClient.mustache | 4 ++-- .../src/main/java/org/openapitools/client/ApiClient.java | 4 ++-- .../src/main/java/org/openapitools/client/ApiClient.java | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/ApiClient.mustache index 4e934eb0e334..a10302b183df 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/ApiClient.mustache @@ -874,9 +874,9 @@ public class ApiClient { } else { // We let jersey handle the serialization if (isBodyNullable) { // payload is nullable - entity = Entity.entity(obj == null ? Entity.text("null") : obj, contentType); + entity = Entity.entity(obj == null ? "null" : obj, contentType); } else { - entity = Entity.entity(obj == null ? Entity.text("") : obj, contentType); + entity = Entity.entity(obj == null ? "" : obj, contentType); } } return entity; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java index be654a23d821..a8ce193dc362 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java @@ -791,9 +791,9 @@ public Entity serialize(Object obj, Map formParams, String co } else { // We let jersey handle the serialization if (isBodyNullable) { // payload is nullable - entity = Entity.entity(obj == null ? Entity.text("null") : obj, contentType); + entity = Entity.entity(obj == null ? "null" : obj, contentType); } else { - entity = Entity.entity(obj == null ? Entity.text("") : obj, contentType); + entity = Entity.entity(obj == null ? "" : obj, contentType); } } return entity; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java index 0e7b60361a5d..2e37397e8ab7 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java @@ -870,9 +870,9 @@ public Entity serialize(Object obj, Map formParams, String co } else { // We let jersey handle the serialization if (isBodyNullable) { // payload is nullable - entity = Entity.entity(obj == null ? Entity.text("null") : obj, contentType); + entity = Entity.entity(obj == null ? "null" : obj, contentType); } else { - entity = Entity.entity(obj == null ? Entity.text("") : obj, contentType); + entity = Entity.entity(obj == null ? "" : obj, contentType); } } return entity; From 02a8207b91baf36d94e8928ef26ffdb0be0465fc Mon Sep 17 00:00:00 2001 From: William Cheng Date: Wed, 15 Jul 2020 19:00:14 +0800 Subject: [PATCH 021/129] skip test for enum model, update readme (#6936) --- .../src/main/resources/r/README.mustache | 2 +- .../src/main/resources/r/model_test.mustache | 10 +++++++--- samples/client/petstore/R/README.md | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/r/README.mustache b/modules/openapi-generator/src/main/resources/r/README.mustache index 718fddaac3ef..ecad1f3c0778 100644 --- a/modules/openapi-generator/src/main/resources/r/README.mustache +++ b/modules/openapi-generator/src/main/resources/r/README.mustache @@ -35,7 +35,7 @@ install.packages("base64enc") git clone https://{{gitHost}}/{{{gitUserId}}}/{{{gitRepoId}}} cd {{{gitRepoId}}} R CMD build . -R CMD check {{{packageName}}}_{{{packageVersion}}}.tar.gz +R CMD check {{{packageName}}}_{{{packageVersion}}}.tar.gz --no-manual R CMD INSTALL {{{packageName}}}_{{{packageVersion}}}.tar.gz ``` diff --git a/modules/openapi-generator/src/main/resources/r/model_test.mustache b/modules/openapi-generator/src/main/resources/r/model_test.mustache index ee35a16fcc69..c8df23122cf9 100644 --- a/modules/openapi-generator/src/main/resources/r/model_test.mustache +++ b/modules/openapi-generator/src/main/resources/r/model_test.mustache @@ -2,12 +2,15 @@ # Please update as you see appropriate context("Test {{{classname}}}") - -model.instance <- {{{classname}}}$new() - {{#models}} {{#model}} +{{^isEnum}} {{#vars}} +{{#-first}} + +model.instance <- {{{classname}}}$new() + +{{/-first}} test_that("{{{name}}}", { # tests for the property `{{{name}}}` ({{dataType}}) {{#description}} @@ -19,5 +22,6 @@ test_that("{{{name}}}", { }) {{/vars}} +{{/isEnum}} {{/model}} {{/models}} diff --git a/samples/client/petstore/R/README.md b/samples/client/petstore/R/README.md index c0a42298c372..52f29ededaee 100644 --- a/samples/client/petstore/R/README.md +++ b/samples/client/petstore/R/README.md @@ -27,7 +27,7 @@ install.packages("base64enc") git clone https://github.com/GIT_USER_ID/GIT_REPO_ID cd GIT_REPO_ID R CMD build . -R CMD check petstore_1.0.0.tar.gz +R CMD check petstore_1.0.0.tar.gz --no-manual R CMD INSTALL petstore_1.0.0.tar.gz ``` From a348f5a170f7772f75c67a5bbec828502b4be698 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Thu, 16 Jul 2020 14:52:30 +0800 Subject: [PATCH 022/129] [Go] fix unmarshal for models with parents (#6946) * set disallowAdditionalPropertiesIfNotPresent to false in go exp oas3 * fix unmarshal in go * remove fields from embedded structs * fix typo --- bin/configs/go-experimental-go-petstore.yaml | 1 + .../GoClientExperimentalCodegen.java | 7 ++ .../go-experimental/model_simple.mustache | 86 +++++++++++++++++++ .../go-petstore/model_200_response.go | 26 ++++++ .../go-petstore/model__special_model_name_.go | 25 ++++++ .../model_additional_properties_class.go | 26 ++++++ .../go-petstore/model_animal.go | 26 ++++++ .../go-petstore/model_api_response.go | 27 ++++++ .../go-petstore/model_apple.go | 25 ++++++ .../go-petstore/model_apple_req.go | 26 ++++++ .../model_array_of_array_of_number_only.go | 25 ++++++ .../go-petstore/model_array_of_number_only.go | 25 ++++++ .../go-petstore/model_array_test_.go | 27 ++++++ .../go-petstore/model_banana_req.go | 26 ++++++ .../go-petstore/model_capitalization.go | 30 +++++++ .../go-experimental/go-petstore/model_cat.go | 64 ++++++++++++++ .../go-petstore/model_cat_all_of.go | 25 ++++++ .../go-petstore/model_category.go | 26 ++++++ .../go-petstore/model_class_model.go | 25 ++++++ .../go-petstore/model_client.go | 25 ++++++ .../go-experimental/go-petstore/model_dog.go | 64 ++++++++++++++ .../go-petstore/model_dog_all_of.go | 25 ++++++ .../go-petstore/model_enum_arrays.go | 26 ++++++ .../go-petstore/model_enum_test_.go | 32 +++++++ .../go-experimental/go-petstore/model_file.go | 25 ++++++ .../model_file_schema_test_class.go | 26 ++++++ .../go-experimental/go-petstore/model_foo.go | 25 ++++++ .../go-petstore/model_format_test_.go | 39 +++++++++ .../go-petstore/model_has_only_read_only.go | 26 ++++++ .../go-petstore/model_health_check_result.go | 25 ++++++ .../go-petstore/model_inline_object.go | 26 ++++++ .../go-petstore/model_inline_object_1.go | 26 ++++++ .../go-petstore/model_inline_object_2.go | 26 ++++++ .../go-petstore/model_inline_object_3.go | 38 ++++++++ .../go-petstore/model_inline_object_4.go | 26 ++++++ .../go-petstore/model_inline_object_5.go | 26 ++++++ .../model_inline_response_default.go | 25 ++++++ .../go-experimental/go-petstore/model_list.go | 25 ++++++ .../go-petstore/model_map_test_.go | 28 ++++++ ...perties_and_additional_properties_class.go | 27 ++++++ .../go-experimental/go-petstore/model_name.go | 28 ++++++ .../go-petstore/model_number_only.go | 25 ++++++ .../go-petstore/model_order.go | 30 +++++++ .../go-petstore/model_outer_composite.go | 27 ++++++ .../go-experimental/go-petstore/model_pet.go | 30 +++++++ .../go-petstore/model_read_only_first.go | 26 ++++++ .../go-petstore/model_return.go | 25 ++++++ .../go-experimental/go-petstore/model_tag.go | 26 ++++++ .../go-experimental/go-petstore/model_user.go | 36 ++++++++ .../go-petstore/model_whale.go | 27 ++++++ .../go-petstore/model_zebra.go | 26 ++++++ .../petstore/go-experimental/model_test.go | 57 ++++++------ 52 files changed, 1498 insertions(+), 24 deletions(-) diff --git a/bin/configs/go-experimental-go-petstore.yaml b/bin/configs/go-experimental-go-petstore.yaml index 53748e4009dc..5b81f347ca56 100644 --- a/bin/configs/go-experimental-go-petstore.yaml +++ b/bin/configs/go-experimental-go-petstore.yaml @@ -5,3 +5,4 @@ templateDir: modules/openapi-generator/src/main/resources/go-experimental additionalProperties: enumClassPrefix: "true" packageName: petstore + disallowAdditionalPropertiesIfNotPresent: false diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoClientExperimentalCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoClientExperimentalCodegen.java index a5434dedf139..9ee17ffbaf6e 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoClientExperimentalCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoClientExperimentalCodegen.java @@ -242,6 +242,13 @@ public Map postProcessModels(Map objs) { if (model.anyOf != null && !model.anyOf.isEmpty()) { imports.add(createMapping("import", "fmt")); } + + // additionalProperties: true and parent + if (model.isAdditionalPropertiesTrue && model.parent != null && Boolean.FALSE.equals(model.isMapModel)) { + imports.add(createMapping("import", "reflect")); + imports.add(createMapping("import", "strings")); + } + } } return objs; diff --git a/modules/openapi-generator/src/main/resources/go-experimental/model_simple.mustache b/modules/openapi-generator/src/main/resources/go-experimental/model_simple.mustache index 2707045b2443..da50f18f8e72 100644 --- a/modules/openapi-generator/src/main/resources/go-experimental/model_simple.mustache +++ b/modules/openapi-generator/src/main/resources/go-experimental/model_simple.mustache @@ -265,6 +265,91 @@ func (o {{classname}}) MarshalJSON() ([]byte, error) { {{#isAdditionalPropertiesTrue}} func (o *{{{classname}}}) UnmarshalJSON(bytes []byte) (err error) { +{{#parent}} +{{^isMapModel}} + type {{classname}}WithoutEmbeddedStruct struct { + {{#vars}} + {{^-first}} + {{/-first}} + {{#description}} + // {{{description}}} + {{/description}} + {{name}} {{^required}}{{^isNullable}}*{{/isNullable}}{{/required}}{{{dataType}}} `json:"{{baseName}}{{^required}},omitempty{{/required}}"{{#withXml}} xml:"{{baseName}}{{#isXmlAttribute}},attr{{/isXmlAttribute}}"{{/withXml}}{{#vendorExtensions.x-go-custom-tag}} {{{.}}}{{/vendorExtensions.x-go-custom-tag}}` + {{/vars}} + } + + var{{{classname}}}WithoutEmbeddedStruct := {{{classname}}}WithoutEmbeddedStruct{} + + err = json.Unmarshal(bytes, &var{{{classname}}}WithoutEmbeddedStruct) + if err == nil { + var{{{classname}}} := _{{{classname}}}{} + {{#vars}} + var{{{classname}}}.{{{name}}} = var{{{classname}}}WithoutEmbeddedStruct.{{{name}}} + {{/vars}} + *o = {{{classname}}}(var{{{classname}}}) + } else { + return err + } + + var{{{classname}}} := _{{{classname}}}{} + + err = json.Unmarshal(bytes, &var{{{classname}}}) + if err == nil { + o.{{{parent}}} = var{{{classname}}}.{{{parent}}} + } else { + return err + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + {{#vars}} + delete(additionalProperties, "{{{baseName}}}") + {{/vars}} + + // remove fields from embedded structs + reflect{{{parent}}} := reflect.ValueOf(o.{{{parent}}}) + for i := 0; i < reflect{{{parent}}}.Type().NumField(); i++ { + t := reflect{{{parent}}}.Type().Field(i) + + if jsonTag := t.Tag.Get("json"); jsonTag != "" { + fieldName := "" + if commaIdx := strings.Index(jsonTag, ","); commaIdx > 0 { + fieldName = jsonTag[:commaIdx] + } else { + fieldName = jsonTag + } + if fieldName != "AdditionalProperties" { + delete(additionalProperties, fieldName) + } + } + } + + o.AdditionalProperties = additionalProperties + } + + return err +{{/isMapModel}} +{{#isMapModel}} + var{{{classname}}} := _{{{classname}}}{} + + if err = json.Unmarshal(bytes, &var{{{classname}}}); err == nil { + *o = {{{classname}}}(var{{{classname}}}) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + {{#vars}} + delete(additionalProperties, "{{{baseName}}}") + {{/vars}} + o.AdditionalProperties = additionalProperties + } + + return err +{{/isMapModel}} +{{/parent}} +{{^parent}} var{{{classname}}} := _{{{classname}}}{} if err = json.Unmarshal(bytes, &var{{{classname}}}); err == nil { @@ -281,6 +366,7 @@ func (o *{{{classname}}}) UnmarshalJSON(bytes []byte) (err error) { } return err +{{/parent}} } {{/isAdditionalPropertiesTrue}} diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_200_response.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_200_response.go index c23c13c54c2b..f1dcea6f973f 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_200_response.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_200_response.go @@ -17,8 +17,11 @@ import ( type Model200Response struct { Name *int32 `json:"name,omitempty"` Class *string `json:"class,omitempty"` + AdditionalProperties map[string]interface{} } +type _Model200Response Model200Response + // NewModel200Response instantiates a new Model200Response object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -108,9 +111,32 @@ func (o Model200Response) MarshalJSON() ([]byte, error) { if o.Class != nil { toSerialize["class"] = o.Class } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return json.Marshal(toSerialize) } +func (o *Model200Response) UnmarshalJSON(bytes []byte) (err error) { + varModel200Response := _Model200Response{} + + if err = json.Unmarshal(bytes, &varModel200Response); err == nil { + *o = Model200Response(varModel200Response) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "class") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableModel200Response struct { value *Model200Response isSet bool diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model__special_model_name_.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model__special_model_name_.go index bbef383b796a..83aea0db4ea8 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model__special_model_name_.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model__special_model_name_.go @@ -16,8 +16,11 @@ import ( // SpecialModelName struct for SpecialModelName type SpecialModelName struct { SpecialPropertyName *int64 `json:"$special[property.name],omitempty"` + AdditionalProperties map[string]interface{} } +type _SpecialModelName SpecialModelName + // NewSpecialModelName instantiates a new SpecialModelName object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -72,9 +75,31 @@ func (o SpecialModelName) MarshalJSON() ([]byte, error) { if o.SpecialPropertyName != nil { toSerialize["$special[property.name]"] = o.SpecialPropertyName } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return json.Marshal(toSerialize) } +func (o *SpecialModelName) UnmarshalJSON(bytes []byte) (err error) { + varSpecialModelName := _SpecialModelName{} + + if err = json.Unmarshal(bytes, &varSpecialModelName); err == nil { + *o = SpecialModelName(varSpecialModelName) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "$special[property.name]") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableSpecialModelName struct { value *SpecialModelName isSet bool diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_additional_properties_class.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_additional_properties_class.go index 2ac0b72cfa23..927cd61dc499 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_additional_properties_class.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_additional_properties_class.go @@ -17,8 +17,11 @@ import ( type AdditionalPropertiesClass struct { MapProperty *map[string]string `json:"map_property,omitempty"` MapOfMapProperty *map[string]map[string]string `json:"map_of_map_property,omitempty"` + AdditionalProperties map[string]interface{} } +type _AdditionalPropertiesClass AdditionalPropertiesClass + // NewAdditionalPropertiesClass instantiates a new AdditionalPropertiesClass object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -108,9 +111,32 @@ func (o AdditionalPropertiesClass) MarshalJSON() ([]byte, error) { if o.MapOfMapProperty != nil { toSerialize["map_of_map_property"] = o.MapOfMapProperty } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return json.Marshal(toSerialize) } +func (o *AdditionalPropertiesClass) UnmarshalJSON(bytes []byte) (err error) { + varAdditionalPropertiesClass := _AdditionalPropertiesClass{} + + if err = json.Unmarshal(bytes, &varAdditionalPropertiesClass); err == nil { + *o = AdditionalPropertiesClass(varAdditionalPropertiesClass) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "map_property") + delete(additionalProperties, "map_of_map_property") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableAdditionalPropertiesClass struct { value *AdditionalPropertiesClass isSet bool diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_animal.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_animal.go index 5aa1f60f02fa..de5e106e58b3 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_animal.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_animal.go @@ -17,8 +17,11 @@ import ( type Animal struct { ClassName string `json:"className"` Color *string `json:"color,omitempty"` + AdditionalProperties map[string]interface{} } +type _Animal Animal + // NewAnimal instantiates a new Animal object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -105,9 +108,32 @@ func (o Animal) MarshalJSON() ([]byte, error) { if o.Color != nil { toSerialize["color"] = o.Color } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return json.Marshal(toSerialize) } +func (o *Animal) UnmarshalJSON(bytes []byte) (err error) { + varAnimal := _Animal{} + + if err = json.Unmarshal(bytes, &varAnimal); err == nil { + *o = Animal(varAnimal) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "className") + delete(additionalProperties, "color") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableAnimal struct { value *Animal isSet bool diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_api_response.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_api_response.go index 17bf558d1c9f..c73431ad1869 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_api_response.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_api_response.go @@ -18,8 +18,11 @@ type ApiResponse struct { Code *int32 `json:"code,omitempty"` Type *string `json:"type,omitempty"` Message *string `json:"message,omitempty"` + AdditionalProperties map[string]interface{} } +type _ApiResponse ApiResponse + // NewApiResponse instantiates a new ApiResponse object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -144,9 +147,33 @@ func (o ApiResponse) MarshalJSON() ([]byte, error) { if o.Message != nil { toSerialize["message"] = o.Message } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return json.Marshal(toSerialize) } +func (o *ApiResponse) UnmarshalJSON(bytes []byte) (err error) { + varApiResponse := _ApiResponse{} + + if err = json.Unmarshal(bytes, &varApiResponse); err == nil { + *o = ApiResponse(varApiResponse) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "code") + delete(additionalProperties, "type") + delete(additionalProperties, "message") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableApiResponse struct { value *ApiResponse isSet bool diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_apple.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_apple.go index 97b0b94f3e9e..afb785cf8306 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_apple.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_apple.go @@ -16,8 +16,11 @@ import ( // Apple struct for Apple type Apple struct { Cultivar *string `json:"cultivar,omitempty"` + AdditionalProperties map[string]interface{} } +type _Apple Apple + // NewApple instantiates a new Apple object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -72,9 +75,31 @@ func (o Apple) MarshalJSON() ([]byte, error) { if o.Cultivar != nil { toSerialize["cultivar"] = o.Cultivar } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return json.Marshal(toSerialize) } +func (o *Apple) UnmarshalJSON(bytes []byte) (err error) { + varApple := _Apple{} + + if err = json.Unmarshal(bytes, &varApple); err == nil { + *o = Apple(varApple) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "cultivar") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableApple struct { value *Apple isSet bool diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_apple_req.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_apple_req.go index 3879864cf14e..e10641dc978a 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_apple_req.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_apple_req.go @@ -17,8 +17,11 @@ import ( type AppleReq struct { Cultivar string `json:"cultivar"` Mealy *bool `json:"mealy,omitempty"` + AdditionalProperties map[string]interface{} } +type _AppleReq AppleReq + // NewAppleReq instantiates a new AppleReq object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -101,9 +104,32 @@ func (o AppleReq) MarshalJSON() ([]byte, error) { if o.Mealy != nil { toSerialize["mealy"] = o.Mealy } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return json.Marshal(toSerialize) } +func (o *AppleReq) UnmarshalJSON(bytes []byte) (err error) { + varAppleReq := _AppleReq{} + + if err = json.Unmarshal(bytes, &varAppleReq); err == nil { + *o = AppleReq(varAppleReq) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "cultivar") + delete(additionalProperties, "mealy") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableAppleReq struct { value *AppleReq isSet bool diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_array_of_array_of_number_only.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_array_of_array_of_number_only.go index 6b81323ac4dc..1af9a061306c 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_array_of_array_of_number_only.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_array_of_array_of_number_only.go @@ -16,8 +16,11 @@ import ( // ArrayOfArrayOfNumberOnly struct for ArrayOfArrayOfNumberOnly type ArrayOfArrayOfNumberOnly struct { ArrayArrayNumber *[][]float32 `json:"ArrayArrayNumber,omitempty"` + AdditionalProperties map[string]interface{} } +type _ArrayOfArrayOfNumberOnly ArrayOfArrayOfNumberOnly + // NewArrayOfArrayOfNumberOnly instantiates a new ArrayOfArrayOfNumberOnly object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -72,9 +75,31 @@ func (o ArrayOfArrayOfNumberOnly) MarshalJSON() ([]byte, error) { if o.ArrayArrayNumber != nil { toSerialize["ArrayArrayNumber"] = o.ArrayArrayNumber } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return json.Marshal(toSerialize) } +func (o *ArrayOfArrayOfNumberOnly) UnmarshalJSON(bytes []byte) (err error) { + varArrayOfArrayOfNumberOnly := _ArrayOfArrayOfNumberOnly{} + + if err = json.Unmarshal(bytes, &varArrayOfArrayOfNumberOnly); err == nil { + *o = ArrayOfArrayOfNumberOnly(varArrayOfArrayOfNumberOnly) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "ArrayArrayNumber") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableArrayOfArrayOfNumberOnly struct { value *ArrayOfArrayOfNumberOnly isSet bool diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_array_of_number_only.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_array_of_number_only.go index f43bffc1c874..7dcd1f46d307 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_array_of_number_only.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_array_of_number_only.go @@ -16,8 +16,11 @@ import ( // ArrayOfNumberOnly struct for ArrayOfNumberOnly type ArrayOfNumberOnly struct { ArrayNumber *[]float32 `json:"ArrayNumber,omitempty"` + AdditionalProperties map[string]interface{} } +type _ArrayOfNumberOnly ArrayOfNumberOnly + // NewArrayOfNumberOnly instantiates a new ArrayOfNumberOnly object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -72,9 +75,31 @@ func (o ArrayOfNumberOnly) MarshalJSON() ([]byte, error) { if o.ArrayNumber != nil { toSerialize["ArrayNumber"] = o.ArrayNumber } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return json.Marshal(toSerialize) } +func (o *ArrayOfNumberOnly) UnmarshalJSON(bytes []byte) (err error) { + varArrayOfNumberOnly := _ArrayOfNumberOnly{} + + if err = json.Unmarshal(bytes, &varArrayOfNumberOnly); err == nil { + *o = ArrayOfNumberOnly(varArrayOfNumberOnly) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "ArrayNumber") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableArrayOfNumberOnly struct { value *ArrayOfNumberOnly isSet bool diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_array_test_.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_array_test_.go index 42e2be66d629..40428c66d45a 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_array_test_.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_array_test_.go @@ -18,8 +18,11 @@ type ArrayTest struct { ArrayOfString *[]string `json:"array_of_string,omitempty"` ArrayArrayOfInteger *[][]int64 `json:"array_array_of_integer,omitempty"` ArrayArrayOfModel *[][]ReadOnlyFirst `json:"array_array_of_model,omitempty"` + AdditionalProperties map[string]interface{} } +type _ArrayTest ArrayTest + // NewArrayTest instantiates a new ArrayTest object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -144,9 +147,33 @@ func (o ArrayTest) MarshalJSON() ([]byte, error) { if o.ArrayArrayOfModel != nil { toSerialize["array_array_of_model"] = o.ArrayArrayOfModel } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return json.Marshal(toSerialize) } +func (o *ArrayTest) UnmarshalJSON(bytes []byte) (err error) { + varArrayTest := _ArrayTest{} + + if err = json.Unmarshal(bytes, &varArrayTest); err == nil { + *o = ArrayTest(varArrayTest) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "array_of_string") + delete(additionalProperties, "array_array_of_integer") + delete(additionalProperties, "array_array_of_model") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableArrayTest struct { value *ArrayTest isSet bool diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_banana_req.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_banana_req.go index ed874ef2e6fd..e6a809274376 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_banana_req.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_banana_req.go @@ -17,8 +17,11 @@ import ( type BananaReq struct { LengthCm float32 `json:"lengthCm"` Sweet *bool `json:"sweet,omitempty"` + AdditionalProperties map[string]interface{} } +type _BananaReq BananaReq + // NewBananaReq instantiates a new BananaReq object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -101,9 +104,32 @@ func (o BananaReq) MarshalJSON() ([]byte, error) { if o.Sweet != nil { toSerialize["sweet"] = o.Sweet } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return json.Marshal(toSerialize) } +func (o *BananaReq) UnmarshalJSON(bytes []byte) (err error) { + varBananaReq := _BananaReq{} + + if err = json.Unmarshal(bytes, &varBananaReq); err == nil { + *o = BananaReq(varBananaReq) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "lengthCm") + delete(additionalProperties, "sweet") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableBananaReq struct { value *BananaReq isSet bool diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_capitalization.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_capitalization.go index 7f2c90863e0c..8cf8aa20b0dd 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_capitalization.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_capitalization.go @@ -22,8 +22,11 @@ type Capitalization struct { SCAETHFlowPoints *string `json:"SCA_ETH_Flow_Points,omitempty"` // Name of the pet ATT_NAME *string `json:"ATT_NAME,omitempty"` + AdditionalProperties map[string]interface{} } +type _Capitalization Capitalization + // NewCapitalization instantiates a new Capitalization object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -253,9 +256,36 @@ func (o Capitalization) MarshalJSON() ([]byte, error) { if o.ATT_NAME != nil { toSerialize["ATT_NAME"] = o.ATT_NAME } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return json.Marshal(toSerialize) } +func (o *Capitalization) UnmarshalJSON(bytes []byte) (err error) { + varCapitalization := _Capitalization{} + + if err = json.Unmarshal(bytes, &varCapitalization); err == nil { + *o = Capitalization(varCapitalization) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "smallCamel") + delete(additionalProperties, "CapitalCamel") + delete(additionalProperties, "small_Snake") + delete(additionalProperties, "Capital_Snake") + delete(additionalProperties, "SCA_ETH_Flow_Points") + delete(additionalProperties, "ATT_NAME") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableCapitalization struct { value *Capitalization isSet bool diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_cat.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_cat.go index d6573c99bac3..5bd129f1f767 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_cat.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_cat.go @@ -11,14 +11,19 @@ package petstore import ( "encoding/json" + "reflect" + "strings" ) // Cat struct for Cat type Cat struct { Animal Declawed *bool `json:"declawed,omitempty"` + AdditionalProperties map[string]interface{} } +type _Cat Cat + // NewCat instantiates a new Cat object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -81,9 +86,68 @@ func (o Cat) MarshalJSON() ([]byte, error) { if o.Declawed != nil { toSerialize["declawed"] = o.Declawed } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return json.Marshal(toSerialize) } +func (o *Cat) UnmarshalJSON(bytes []byte) (err error) { + type CatWithoutEmbeddedStruct struct { + Declawed *bool `json:"declawed,omitempty"` + } + + varCatWithoutEmbeddedStruct := CatWithoutEmbeddedStruct{} + + err = json.Unmarshal(bytes, &varCatWithoutEmbeddedStruct) + if err == nil { + varCat := _Cat{} + varCat.Declawed = varCatWithoutEmbeddedStruct.Declawed + *o = Cat(varCat) + } else { + return err + } + + varCat := _Cat{} + + err = json.Unmarshal(bytes, &varCat) + if err == nil { + o.Animal = varCat.Animal + } else { + return err + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "declawed") + + // remove fields from embedded structs + reflectAnimal := reflect.ValueOf(o.Animal) + for i := 0; i < reflectAnimal.Type().NumField(); i++ { + t := reflectAnimal.Type().Field(i) + + if jsonTag := t.Tag.Get("json"); jsonTag != "" { + fieldName := "" + if commaIdx := strings.Index(jsonTag, ","); commaIdx > 0 { + fieldName = jsonTag[:commaIdx] + } else { + fieldName = jsonTag + } + if fieldName != "AdditionalProperties" { + delete(additionalProperties, fieldName) + } + } + } + + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableCat struct { value *Cat isSet bool diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_cat_all_of.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_cat_all_of.go index 643ba03973f4..ba8ba01e4eb6 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_cat_all_of.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_cat_all_of.go @@ -16,8 +16,11 @@ import ( // CatAllOf struct for CatAllOf type CatAllOf struct { Declawed *bool `json:"declawed,omitempty"` + AdditionalProperties map[string]interface{} } +type _CatAllOf CatAllOf + // NewCatAllOf instantiates a new CatAllOf object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -72,9 +75,31 @@ func (o CatAllOf) MarshalJSON() ([]byte, error) { if o.Declawed != nil { toSerialize["declawed"] = o.Declawed } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return json.Marshal(toSerialize) } +func (o *CatAllOf) UnmarshalJSON(bytes []byte) (err error) { + varCatAllOf := _CatAllOf{} + + if err = json.Unmarshal(bytes, &varCatAllOf); err == nil { + *o = CatAllOf(varCatAllOf) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "declawed") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableCatAllOf struct { value *CatAllOf isSet bool diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_category.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_category.go index 0c4628895331..6844fcaa2a63 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_category.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_category.go @@ -17,8 +17,11 @@ import ( type Category struct { Id *int64 `json:"id,omitempty"` Name string `json:"name"` + AdditionalProperties map[string]interface{} } +type _Category Category + // NewCategory instantiates a new Category object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -103,9 +106,32 @@ func (o Category) MarshalJSON() ([]byte, error) { if true { toSerialize["name"] = o.Name } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return json.Marshal(toSerialize) } +func (o *Category) UnmarshalJSON(bytes []byte) (err error) { + varCategory := _Category{} + + if err = json.Unmarshal(bytes, &varCategory); err == nil { + *o = Category(varCategory) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "name") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableCategory struct { value *Category isSet bool diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_class_model.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_class_model.go index 7236de0ee071..dd0e8da5128e 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_class_model.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_class_model.go @@ -16,8 +16,11 @@ import ( // ClassModel Model for testing model with \"_class\" property type ClassModel struct { Class *string `json:"_class,omitempty"` + AdditionalProperties map[string]interface{} } +type _ClassModel ClassModel + // NewClassModel instantiates a new ClassModel object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -72,9 +75,31 @@ func (o ClassModel) MarshalJSON() ([]byte, error) { if o.Class != nil { toSerialize["_class"] = o.Class } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return json.Marshal(toSerialize) } +func (o *ClassModel) UnmarshalJSON(bytes []byte) (err error) { + varClassModel := _ClassModel{} + + if err = json.Unmarshal(bytes, &varClassModel); err == nil { + *o = ClassModel(varClassModel) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "_class") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableClassModel struct { value *ClassModel isSet bool diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_client.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_client.go index edfdde067ef6..4fa9c5c96132 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_client.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_client.go @@ -16,8 +16,11 @@ import ( // Client struct for Client type Client struct { Client *string `json:"client,omitempty"` + AdditionalProperties map[string]interface{} } +type _Client Client + // NewClient instantiates a new Client object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -72,9 +75,31 @@ func (o Client) MarshalJSON() ([]byte, error) { if o.Client != nil { toSerialize["client"] = o.Client } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return json.Marshal(toSerialize) } +func (o *Client) UnmarshalJSON(bytes []byte) (err error) { + varClient := _Client{} + + if err = json.Unmarshal(bytes, &varClient); err == nil { + *o = Client(varClient) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "client") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableClient struct { value *Client isSet bool diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_dog.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_dog.go index ebbedeec53e8..b3a1dcf1a6ba 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_dog.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_dog.go @@ -11,14 +11,19 @@ package petstore import ( "encoding/json" + "reflect" + "strings" ) // Dog struct for Dog type Dog struct { Animal Breed *string `json:"breed,omitempty"` + AdditionalProperties map[string]interface{} } +type _Dog Dog + // NewDog instantiates a new Dog object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -81,9 +86,68 @@ func (o Dog) MarshalJSON() ([]byte, error) { if o.Breed != nil { toSerialize["breed"] = o.Breed } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return json.Marshal(toSerialize) } +func (o *Dog) UnmarshalJSON(bytes []byte) (err error) { + type DogWithoutEmbeddedStruct struct { + Breed *string `json:"breed,omitempty"` + } + + varDogWithoutEmbeddedStruct := DogWithoutEmbeddedStruct{} + + err = json.Unmarshal(bytes, &varDogWithoutEmbeddedStruct) + if err == nil { + varDog := _Dog{} + varDog.Breed = varDogWithoutEmbeddedStruct.Breed + *o = Dog(varDog) + } else { + return err + } + + varDog := _Dog{} + + err = json.Unmarshal(bytes, &varDog) + if err == nil { + o.Animal = varDog.Animal + } else { + return err + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "breed") + + // remove fields from embedded structs + reflectAnimal := reflect.ValueOf(o.Animal) + for i := 0; i < reflectAnimal.Type().NumField(); i++ { + t := reflectAnimal.Type().Field(i) + + if jsonTag := t.Tag.Get("json"); jsonTag != "" { + fieldName := "" + if commaIdx := strings.Index(jsonTag, ","); commaIdx > 0 { + fieldName = jsonTag[:commaIdx] + } else { + fieldName = jsonTag + } + if fieldName != "AdditionalProperties" { + delete(additionalProperties, fieldName) + } + } + } + + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableDog struct { value *Dog isSet bool diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_dog_all_of.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_dog_all_of.go index c13aa2b2cd57..5a63ff7ab1fe 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_dog_all_of.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_dog_all_of.go @@ -16,8 +16,11 @@ import ( // DogAllOf struct for DogAllOf type DogAllOf struct { Breed *string `json:"breed,omitempty"` + AdditionalProperties map[string]interface{} } +type _DogAllOf DogAllOf + // NewDogAllOf instantiates a new DogAllOf object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -72,9 +75,31 @@ func (o DogAllOf) MarshalJSON() ([]byte, error) { if o.Breed != nil { toSerialize["breed"] = o.Breed } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return json.Marshal(toSerialize) } +func (o *DogAllOf) UnmarshalJSON(bytes []byte) (err error) { + varDogAllOf := _DogAllOf{} + + if err = json.Unmarshal(bytes, &varDogAllOf); err == nil { + *o = DogAllOf(varDogAllOf) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "breed") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableDogAllOf struct { value *DogAllOf isSet bool diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_enum_arrays.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_enum_arrays.go index b18984ce7306..5db0ec9b52be 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_enum_arrays.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_enum_arrays.go @@ -17,8 +17,11 @@ import ( type EnumArrays struct { JustSymbol *string `json:"just_symbol,omitempty"` ArrayEnum *[]string `json:"array_enum,omitempty"` + AdditionalProperties map[string]interface{} } +type _EnumArrays EnumArrays + // NewEnumArrays instantiates a new EnumArrays object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -108,9 +111,32 @@ func (o EnumArrays) MarshalJSON() ([]byte, error) { if o.ArrayEnum != nil { toSerialize["array_enum"] = o.ArrayEnum } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return json.Marshal(toSerialize) } +func (o *EnumArrays) UnmarshalJSON(bytes []byte) (err error) { + varEnumArrays := _EnumArrays{} + + if err = json.Unmarshal(bytes, &varEnumArrays); err == nil { + *o = EnumArrays(varEnumArrays) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "just_symbol") + delete(additionalProperties, "array_enum") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableEnumArrays struct { value *EnumArrays isSet bool diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_enum_test_.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_enum_test_.go index d6da2e58bf99..bc208327afac 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_enum_test_.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_enum_test_.go @@ -23,8 +23,11 @@ type EnumTest struct { OuterEnumInteger *OuterEnumInteger `json:"outerEnumInteger,omitempty"` OuterEnumDefaultValue *OuterEnumDefaultValue `json:"outerEnumDefaultValue,omitempty"` OuterEnumIntegerDefaultValue *OuterEnumIntegerDefaultValue `json:"outerEnumIntegerDefaultValue,omitempty"` + AdditionalProperties map[string]interface{} } +type _EnumTest EnumTest + // NewEnumTest instantiates a new EnumTest object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -335,9 +338,38 @@ func (o EnumTest) MarshalJSON() ([]byte, error) { if o.OuterEnumIntegerDefaultValue != nil { toSerialize["outerEnumIntegerDefaultValue"] = o.OuterEnumIntegerDefaultValue } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return json.Marshal(toSerialize) } +func (o *EnumTest) UnmarshalJSON(bytes []byte) (err error) { + varEnumTest := _EnumTest{} + + if err = json.Unmarshal(bytes, &varEnumTest); err == nil { + *o = EnumTest(varEnumTest) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "enum_string") + delete(additionalProperties, "enum_string_required") + delete(additionalProperties, "enum_integer") + delete(additionalProperties, "enum_number") + delete(additionalProperties, "outerEnum") + delete(additionalProperties, "outerEnumInteger") + delete(additionalProperties, "outerEnumDefaultValue") + delete(additionalProperties, "outerEnumIntegerDefaultValue") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableEnumTest struct { value *EnumTest isSet bool diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_file.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_file.go index 43ec19f86383..edb530ef3830 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_file.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_file.go @@ -17,8 +17,11 @@ import ( type File struct { // Test capitalization SourceURI *string `json:"sourceURI,omitempty"` + AdditionalProperties map[string]interface{} } +type _File File + // NewFile instantiates a new File object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -73,9 +76,31 @@ func (o File) MarshalJSON() ([]byte, error) { if o.SourceURI != nil { toSerialize["sourceURI"] = o.SourceURI } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return json.Marshal(toSerialize) } +func (o *File) UnmarshalJSON(bytes []byte) (err error) { + varFile := _File{} + + if err = json.Unmarshal(bytes, &varFile); err == nil { + *o = File(varFile) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "sourceURI") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableFile struct { value *File isSet bool diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_file_schema_test_class.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_file_schema_test_class.go index 626a3765173a..389de1c92528 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_file_schema_test_class.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_file_schema_test_class.go @@ -17,8 +17,11 @@ import ( type FileSchemaTestClass struct { File *File `json:"file,omitempty"` Files *[]File `json:"files,omitempty"` + AdditionalProperties map[string]interface{} } +type _FileSchemaTestClass FileSchemaTestClass + // NewFileSchemaTestClass instantiates a new FileSchemaTestClass object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -108,9 +111,32 @@ func (o FileSchemaTestClass) MarshalJSON() ([]byte, error) { if o.Files != nil { toSerialize["files"] = o.Files } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return json.Marshal(toSerialize) } +func (o *FileSchemaTestClass) UnmarshalJSON(bytes []byte) (err error) { + varFileSchemaTestClass := _FileSchemaTestClass{} + + if err = json.Unmarshal(bytes, &varFileSchemaTestClass); err == nil { + *o = FileSchemaTestClass(varFileSchemaTestClass) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "file") + delete(additionalProperties, "files") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableFileSchemaTestClass struct { value *FileSchemaTestClass isSet bool diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_foo.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_foo.go index 723deec46aa4..d60c4a1c0178 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_foo.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_foo.go @@ -16,8 +16,11 @@ import ( // Foo struct for Foo type Foo struct { Bar *string `json:"bar,omitempty"` + AdditionalProperties map[string]interface{} } +type _Foo Foo + // NewFoo instantiates a new Foo object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -76,9 +79,31 @@ func (o Foo) MarshalJSON() ([]byte, error) { if o.Bar != nil { toSerialize["bar"] = o.Bar } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return json.Marshal(toSerialize) } +func (o *Foo) UnmarshalJSON(bytes []byte) (err error) { + varFoo := _Foo{} + + if err = json.Unmarshal(bytes, &varFoo); err == nil { + *o = Foo(varFoo) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "bar") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableFoo struct { value *Foo isSet bool diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_format_test_.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_format_test_.go index 67f0c80c72e5..bbc76b1285c7 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_format_test_.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_format_test_.go @@ -34,8 +34,11 @@ type FormatTest struct { PatternWithDigits *string `json:"pattern_with_digits,omitempty"` // A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. PatternWithDigitsAndDelimiter *string `json:"pattern_with_digits_and_delimiter,omitempty"` + AdditionalProperties map[string]interface{} } +type _FormatTest FormatTest + // NewFormatTest instantiates a new FormatTest object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -552,9 +555,45 @@ func (o FormatTest) MarshalJSON() ([]byte, error) { if o.PatternWithDigitsAndDelimiter != nil { toSerialize["pattern_with_digits_and_delimiter"] = o.PatternWithDigitsAndDelimiter } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return json.Marshal(toSerialize) } +func (o *FormatTest) UnmarshalJSON(bytes []byte) (err error) { + varFormatTest := _FormatTest{} + + if err = json.Unmarshal(bytes, &varFormatTest); err == nil { + *o = FormatTest(varFormatTest) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "integer") + delete(additionalProperties, "int32") + delete(additionalProperties, "int64") + delete(additionalProperties, "number") + delete(additionalProperties, "float") + delete(additionalProperties, "double") + delete(additionalProperties, "string") + delete(additionalProperties, "byte") + delete(additionalProperties, "binary") + delete(additionalProperties, "date") + delete(additionalProperties, "dateTime") + delete(additionalProperties, "uuid") + delete(additionalProperties, "password") + delete(additionalProperties, "pattern_with_digits") + delete(additionalProperties, "pattern_with_digits_and_delimiter") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableFormatTest struct { value *FormatTest isSet bool diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_has_only_read_only.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_has_only_read_only.go index 3400c73dca67..4eb331e77ebf 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_has_only_read_only.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_has_only_read_only.go @@ -17,8 +17,11 @@ import ( type HasOnlyReadOnly struct { Bar *string `json:"bar,omitempty"` Foo *string `json:"foo,omitempty"` + AdditionalProperties map[string]interface{} } +type _HasOnlyReadOnly HasOnlyReadOnly + // NewHasOnlyReadOnly instantiates a new HasOnlyReadOnly object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -108,9 +111,32 @@ func (o HasOnlyReadOnly) MarshalJSON() ([]byte, error) { if o.Foo != nil { toSerialize["foo"] = o.Foo } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return json.Marshal(toSerialize) } +func (o *HasOnlyReadOnly) UnmarshalJSON(bytes []byte) (err error) { + varHasOnlyReadOnly := _HasOnlyReadOnly{} + + if err = json.Unmarshal(bytes, &varHasOnlyReadOnly); err == nil { + *o = HasOnlyReadOnly(varHasOnlyReadOnly) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "bar") + delete(additionalProperties, "foo") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableHasOnlyReadOnly struct { value *HasOnlyReadOnly isSet bool diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_health_check_result.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_health_check_result.go index 70874db5605e..db44ec773845 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_health_check_result.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_health_check_result.go @@ -16,8 +16,11 @@ import ( // HealthCheckResult Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. type HealthCheckResult struct { NullableMessage NullableString `json:"NullableMessage,omitempty"` + AdditionalProperties map[string]interface{} } +type _HealthCheckResult HealthCheckResult + // NewHealthCheckResult instantiates a new HealthCheckResult object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -82,9 +85,31 @@ func (o HealthCheckResult) MarshalJSON() ([]byte, error) { if o.NullableMessage.IsSet() { toSerialize["NullableMessage"] = o.NullableMessage.Get() } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return json.Marshal(toSerialize) } +func (o *HealthCheckResult) UnmarshalJSON(bytes []byte) (err error) { + varHealthCheckResult := _HealthCheckResult{} + + if err = json.Unmarshal(bytes, &varHealthCheckResult); err == nil { + *o = HealthCheckResult(varHealthCheckResult) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "NullableMessage") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableHealthCheckResult struct { value *HealthCheckResult isSet bool diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_inline_object.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_inline_object.go index 35df941a0d62..758deb9dc15e 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_inline_object.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_inline_object.go @@ -19,8 +19,11 @@ type InlineObject struct { Name *string `json:"name,omitempty"` // Updated status of the pet Status *string `json:"status,omitempty"` + AdditionalProperties map[string]interface{} } +type _InlineObject InlineObject + // NewInlineObject instantiates a new InlineObject object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -110,9 +113,32 @@ func (o InlineObject) MarshalJSON() ([]byte, error) { if o.Status != nil { toSerialize["status"] = o.Status } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return json.Marshal(toSerialize) } +func (o *InlineObject) UnmarshalJSON(bytes []byte) (err error) { + varInlineObject := _InlineObject{} + + if err = json.Unmarshal(bytes, &varInlineObject); err == nil { + *o = InlineObject(varInlineObject) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "status") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableInlineObject struct { value *InlineObject isSet bool diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_inline_object_1.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_inline_object_1.go index a400eda20e36..90c0f63645d5 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_inline_object_1.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_inline_object_1.go @@ -20,8 +20,11 @@ type InlineObject1 struct { AdditionalMetadata *string `json:"additionalMetadata,omitempty"` // file to upload File **os.File `json:"file,omitempty"` + AdditionalProperties map[string]interface{} } +type _InlineObject1 InlineObject1 + // NewInlineObject1 instantiates a new InlineObject1 object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -111,9 +114,32 @@ func (o InlineObject1) MarshalJSON() ([]byte, error) { if o.File != nil { toSerialize["file"] = o.File } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return json.Marshal(toSerialize) } +func (o *InlineObject1) UnmarshalJSON(bytes []byte) (err error) { + varInlineObject1 := _InlineObject1{} + + if err = json.Unmarshal(bytes, &varInlineObject1); err == nil { + *o = InlineObject1(varInlineObject1) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "additionalMetadata") + delete(additionalProperties, "file") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableInlineObject1 struct { value *InlineObject1 isSet bool diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_inline_object_2.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_inline_object_2.go index a80ba9b9e5c5..3217b39c869e 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_inline_object_2.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_inline_object_2.go @@ -19,8 +19,11 @@ type InlineObject2 struct { EnumFormStringArray *[]string `json:"enum_form_string_array,omitempty"` // Form parameter enum test (string) EnumFormString *string `json:"enum_form_string,omitempty"` + AdditionalProperties map[string]interface{} } +type _InlineObject2 InlineObject2 + // NewInlineObject2 instantiates a new InlineObject2 object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -114,9 +117,32 @@ func (o InlineObject2) MarshalJSON() ([]byte, error) { if o.EnumFormString != nil { toSerialize["enum_form_string"] = o.EnumFormString } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return json.Marshal(toSerialize) } +func (o *InlineObject2) UnmarshalJSON(bytes []byte) (err error) { + varInlineObject2 := _InlineObject2{} + + if err = json.Unmarshal(bytes, &varInlineObject2); err == nil { + *o = InlineObject2(varInlineObject2) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "enum_form_string_array") + delete(additionalProperties, "enum_form_string") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableInlineObject2 struct { value *InlineObject2 isSet bool diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_inline_object_3.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_inline_object_3.go index 9dcc233d034d..8050df353aa7 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_inline_object_3.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_inline_object_3.go @@ -45,8 +45,11 @@ type InlineObject3 struct { Password *string `json:"password,omitempty"` // None Callback *string `json:"callback,omitempty"` + AdditionalProperties map[string]interface{} } +type _InlineObject3 InlineObject3 + // NewInlineObject3 instantiates a new InlineObject3 object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -528,9 +531,44 @@ func (o InlineObject3) MarshalJSON() ([]byte, error) { if o.Callback != nil { toSerialize["callback"] = o.Callback } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return json.Marshal(toSerialize) } +func (o *InlineObject3) UnmarshalJSON(bytes []byte) (err error) { + varInlineObject3 := _InlineObject3{} + + if err = json.Unmarshal(bytes, &varInlineObject3); err == nil { + *o = InlineObject3(varInlineObject3) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "integer") + delete(additionalProperties, "int32") + delete(additionalProperties, "int64") + delete(additionalProperties, "number") + delete(additionalProperties, "float") + delete(additionalProperties, "double") + delete(additionalProperties, "string") + delete(additionalProperties, "pattern_without_delimiter") + delete(additionalProperties, "byte") + delete(additionalProperties, "binary") + delete(additionalProperties, "date") + delete(additionalProperties, "dateTime") + delete(additionalProperties, "password") + delete(additionalProperties, "callback") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableInlineObject3 struct { value *InlineObject3 isSet bool diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_inline_object_4.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_inline_object_4.go index 783556ef23cc..bd624f9c4b57 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_inline_object_4.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_inline_object_4.go @@ -19,8 +19,11 @@ type InlineObject4 struct { Param string `json:"param"` // field2 Param2 string `json:"param2"` + AdditionalProperties map[string]interface{} } +type _InlineObject4 InlineObject4 + // NewInlineObject4 instantiates a new InlineObject4 object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -96,9 +99,32 @@ func (o InlineObject4) MarshalJSON() ([]byte, error) { if true { toSerialize["param2"] = o.Param2 } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return json.Marshal(toSerialize) } +func (o *InlineObject4) UnmarshalJSON(bytes []byte) (err error) { + varInlineObject4 := _InlineObject4{} + + if err = json.Unmarshal(bytes, &varInlineObject4); err == nil { + *o = InlineObject4(varInlineObject4) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "param") + delete(additionalProperties, "param2") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableInlineObject4 struct { value *InlineObject4 isSet bool diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_inline_object_5.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_inline_object_5.go index 055f4ff8fe28..47fcc6e2e29f 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_inline_object_5.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_inline_object_5.go @@ -20,8 +20,11 @@ type InlineObject5 struct { AdditionalMetadata *string `json:"additionalMetadata,omitempty"` // file to upload RequiredFile *os.File `json:"requiredFile"` + AdditionalProperties map[string]interface{} } +type _InlineObject5 InlineObject5 + // NewInlineObject5 instantiates a new InlineObject5 object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -104,9 +107,32 @@ func (o InlineObject5) MarshalJSON() ([]byte, error) { if true { toSerialize["requiredFile"] = o.RequiredFile } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return json.Marshal(toSerialize) } +func (o *InlineObject5) UnmarshalJSON(bytes []byte) (err error) { + varInlineObject5 := _InlineObject5{} + + if err = json.Unmarshal(bytes, &varInlineObject5); err == nil { + *o = InlineObject5(varInlineObject5) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "additionalMetadata") + delete(additionalProperties, "requiredFile") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableInlineObject5 struct { value *InlineObject5 isSet bool diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_inline_response_default.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_inline_response_default.go index 3c8ca5deafeb..70e9023e7316 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_inline_response_default.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_inline_response_default.go @@ -16,8 +16,11 @@ import ( // InlineResponseDefault struct for InlineResponseDefault type InlineResponseDefault struct { String *Foo `json:"string,omitempty"` + AdditionalProperties map[string]interface{} } +type _InlineResponseDefault InlineResponseDefault + // NewInlineResponseDefault instantiates a new InlineResponseDefault object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -72,9 +75,31 @@ func (o InlineResponseDefault) MarshalJSON() ([]byte, error) { if o.String != nil { toSerialize["string"] = o.String } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return json.Marshal(toSerialize) } +func (o *InlineResponseDefault) UnmarshalJSON(bytes []byte) (err error) { + varInlineResponseDefault := _InlineResponseDefault{} + + if err = json.Unmarshal(bytes, &varInlineResponseDefault); err == nil { + *o = InlineResponseDefault(varInlineResponseDefault) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "string") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableInlineResponseDefault struct { value *InlineResponseDefault isSet bool diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_list.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_list.go index f49afaa71f33..565452b20678 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_list.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_list.go @@ -16,8 +16,11 @@ import ( // List struct for List type List struct { Var123List *string `json:"123-list,omitempty"` + AdditionalProperties map[string]interface{} } +type _List List + // NewList instantiates a new List object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -72,9 +75,31 @@ func (o List) MarshalJSON() ([]byte, error) { if o.Var123List != nil { toSerialize["123-list"] = o.Var123List } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return json.Marshal(toSerialize) } +func (o *List) UnmarshalJSON(bytes []byte) (err error) { + varList := _List{} + + if err = json.Unmarshal(bytes, &varList); err == nil { + *o = List(varList) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "123-list") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableList struct { value *List isSet bool diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_map_test_.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_map_test_.go index 4fc2c0b47991..7bd5860170bd 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_map_test_.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_map_test_.go @@ -19,8 +19,11 @@ type MapTest struct { MapOfEnumString *map[string]string `json:"map_of_enum_string,omitempty"` DirectMap *map[string]bool `json:"direct_map,omitempty"` IndirectMap *map[string]bool `json:"indirect_map,omitempty"` + AdditionalProperties map[string]interface{} } +type _MapTest MapTest + // NewMapTest instantiates a new MapTest object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -180,9 +183,34 @@ func (o MapTest) MarshalJSON() ([]byte, error) { if o.IndirectMap != nil { toSerialize["indirect_map"] = o.IndirectMap } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return json.Marshal(toSerialize) } +func (o *MapTest) UnmarshalJSON(bytes []byte) (err error) { + varMapTest := _MapTest{} + + if err = json.Unmarshal(bytes, &varMapTest); err == nil { + *o = MapTest(varMapTest) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "map_map_of_string") + delete(additionalProperties, "map_of_enum_string") + delete(additionalProperties, "direct_map") + delete(additionalProperties, "indirect_map") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableMapTest struct { value *MapTest isSet bool diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_mixed_properties_and_additional_properties_class.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_mixed_properties_and_additional_properties_class.go index 69cc134169e7..752ccff41ea0 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_mixed_properties_and_additional_properties_class.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_mixed_properties_and_additional_properties_class.go @@ -19,8 +19,11 @@ type MixedPropertiesAndAdditionalPropertiesClass struct { Uuid *string `json:"uuid,omitempty"` DateTime *time.Time `json:"dateTime,omitempty"` Map *map[string]Animal `json:"map,omitempty"` + AdditionalProperties map[string]interface{} } +type _MixedPropertiesAndAdditionalPropertiesClass MixedPropertiesAndAdditionalPropertiesClass + // NewMixedPropertiesAndAdditionalPropertiesClass instantiates a new MixedPropertiesAndAdditionalPropertiesClass object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -145,9 +148,33 @@ func (o MixedPropertiesAndAdditionalPropertiesClass) MarshalJSON() ([]byte, erro if o.Map != nil { toSerialize["map"] = o.Map } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return json.Marshal(toSerialize) } +func (o *MixedPropertiesAndAdditionalPropertiesClass) UnmarshalJSON(bytes []byte) (err error) { + varMixedPropertiesAndAdditionalPropertiesClass := _MixedPropertiesAndAdditionalPropertiesClass{} + + if err = json.Unmarshal(bytes, &varMixedPropertiesAndAdditionalPropertiesClass); err == nil { + *o = MixedPropertiesAndAdditionalPropertiesClass(varMixedPropertiesAndAdditionalPropertiesClass) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "uuid") + delete(additionalProperties, "dateTime") + delete(additionalProperties, "map") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableMixedPropertiesAndAdditionalPropertiesClass struct { value *MixedPropertiesAndAdditionalPropertiesClass isSet bool diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_name.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_name.go index 82e49591874b..c66130c5bf3b 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_name.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_name.go @@ -19,8 +19,11 @@ type Name struct { SnakeCase *int32 `json:"snake_case,omitempty"` Property *string `json:"property,omitempty"` Var123Number *int32 `json:"123Number,omitempty"` + AdditionalProperties map[string]interface{} } +type _Name Name + // NewName instantiates a new Name object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -173,9 +176,34 @@ func (o Name) MarshalJSON() ([]byte, error) { if o.Var123Number != nil { toSerialize["123Number"] = o.Var123Number } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return json.Marshal(toSerialize) } +func (o *Name) UnmarshalJSON(bytes []byte) (err error) { + varName := _Name{} + + if err = json.Unmarshal(bytes, &varName); err == nil { + *o = Name(varName) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "snake_case") + delete(additionalProperties, "property") + delete(additionalProperties, "123Number") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableName struct { value *Name isSet bool diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_number_only.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_number_only.go index efa8b66a5bcc..a0a6f01be08f 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_number_only.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_number_only.go @@ -16,8 +16,11 @@ import ( // NumberOnly struct for NumberOnly type NumberOnly struct { JustNumber *float32 `json:"JustNumber,omitempty"` + AdditionalProperties map[string]interface{} } +type _NumberOnly NumberOnly + // NewNumberOnly instantiates a new NumberOnly object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -72,9 +75,31 @@ func (o NumberOnly) MarshalJSON() ([]byte, error) { if o.JustNumber != nil { toSerialize["JustNumber"] = o.JustNumber } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return json.Marshal(toSerialize) } +func (o *NumberOnly) UnmarshalJSON(bytes []byte) (err error) { + varNumberOnly := _NumberOnly{} + + if err = json.Unmarshal(bytes, &varNumberOnly); err == nil { + *o = NumberOnly(varNumberOnly) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "JustNumber") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableNumberOnly struct { value *NumberOnly isSet bool diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_order.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_order.go index b20a14298482..83e6d9fdeb37 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_order.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_order.go @@ -23,8 +23,11 @@ type Order struct { // Order Status Status *string `json:"status,omitempty"` Complete *bool `json:"complete,omitempty"` + AdditionalProperties map[string]interface{} } +type _Order Order + // NewOrder instantiates a new Order object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -258,9 +261,36 @@ func (o Order) MarshalJSON() ([]byte, error) { if o.Complete != nil { toSerialize["complete"] = o.Complete } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return json.Marshal(toSerialize) } +func (o *Order) UnmarshalJSON(bytes []byte) (err error) { + varOrder := _Order{} + + if err = json.Unmarshal(bytes, &varOrder); err == nil { + *o = Order(varOrder) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "petId") + delete(additionalProperties, "quantity") + delete(additionalProperties, "shipDate") + delete(additionalProperties, "status") + delete(additionalProperties, "complete") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableOrder struct { value *Order isSet bool diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_outer_composite.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_outer_composite.go index 9a76c753b644..2b399e1a97fc 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_outer_composite.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_outer_composite.go @@ -18,8 +18,11 @@ type OuterComposite struct { MyNumber *float32 `json:"my_number,omitempty"` MyString *string `json:"my_string,omitempty"` MyBoolean *bool `json:"my_boolean,omitempty"` + AdditionalProperties map[string]interface{} } +type _OuterComposite OuterComposite + // NewOuterComposite instantiates a new OuterComposite object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -144,9 +147,33 @@ func (o OuterComposite) MarshalJSON() ([]byte, error) { if o.MyBoolean != nil { toSerialize["my_boolean"] = o.MyBoolean } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return json.Marshal(toSerialize) } +func (o *OuterComposite) UnmarshalJSON(bytes []byte) (err error) { + varOuterComposite := _OuterComposite{} + + if err = json.Unmarshal(bytes, &varOuterComposite); err == nil { + *o = OuterComposite(varOuterComposite) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "my_number") + delete(additionalProperties, "my_string") + delete(additionalProperties, "my_boolean") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableOuterComposite struct { value *OuterComposite isSet bool diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_pet.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_pet.go index 8bc4457fc372..fc4505e1da47 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_pet.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_pet.go @@ -22,8 +22,11 @@ type Pet struct { Tags *[]Tag `json:"tags,omitempty"` // pet status in the store Status *string `json:"status,omitempty"` + AdditionalProperties map[string]interface{} } +type _Pet Pet + // NewPet instantiates a new Pet object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -239,9 +242,36 @@ func (o Pet) MarshalJSON() ([]byte, error) { if o.Status != nil { toSerialize["status"] = o.Status } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return json.Marshal(toSerialize) } +func (o *Pet) UnmarshalJSON(bytes []byte) (err error) { + varPet := _Pet{} + + if err = json.Unmarshal(bytes, &varPet); err == nil { + *o = Pet(varPet) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "category") + delete(additionalProperties, "name") + delete(additionalProperties, "photoUrls") + delete(additionalProperties, "tags") + delete(additionalProperties, "status") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullablePet struct { value *Pet isSet bool diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_read_only_first.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_read_only_first.go index dd00212c1d04..206e8ef240a7 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_read_only_first.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_read_only_first.go @@ -17,8 +17,11 @@ import ( type ReadOnlyFirst struct { Bar *string `json:"bar,omitempty"` Baz *string `json:"baz,omitempty"` + AdditionalProperties map[string]interface{} } +type _ReadOnlyFirst ReadOnlyFirst + // NewReadOnlyFirst instantiates a new ReadOnlyFirst object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -108,9 +111,32 @@ func (o ReadOnlyFirst) MarshalJSON() ([]byte, error) { if o.Baz != nil { toSerialize["baz"] = o.Baz } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return json.Marshal(toSerialize) } +func (o *ReadOnlyFirst) UnmarshalJSON(bytes []byte) (err error) { + varReadOnlyFirst := _ReadOnlyFirst{} + + if err = json.Unmarshal(bytes, &varReadOnlyFirst); err == nil { + *o = ReadOnlyFirst(varReadOnlyFirst) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "bar") + delete(additionalProperties, "baz") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableReadOnlyFirst struct { value *ReadOnlyFirst isSet bool diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_return.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_return.go index 2ed729e12eca..1d258ad1ef9c 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_return.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_return.go @@ -16,8 +16,11 @@ import ( // Return Model for testing reserved words type Return struct { Return *int32 `json:"return,omitempty"` + AdditionalProperties map[string]interface{} } +type _Return Return + // NewReturn instantiates a new Return object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -72,9 +75,31 @@ func (o Return) MarshalJSON() ([]byte, error) { if o.Return != nil { toSerialize["return"] = o.Return } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return json.Marshal(toSerialize) } +func (o *Return) UnmarshalJSON(bytes []byte) (err error) { + varReturn := _Return{} + + if err = json.Unmarshal(bytes, &varReturn); err == nil { + *o = Return(varReturn) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "return") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableReturn struct { value *Return isSet bool diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_tag.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_tag.go index 99135ba946be..22ede38add3a 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_tag.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_tag.go @@ -17,8 +17,11 @@ import ( type Tag struct { Id *int64 `json:"id,omitempty"` Name *string `json:"name,omitempty"` + AdditionalProperties map[string]interface{} } +type _Tag Tag + // NewTag instantiates a new Tag object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -108,9 +111,32 @@ func (o Tag) MarshalJSON() ([]byte, error) { if o.Name != nil { toSerialize["name"] = o.Name } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return json.Marshal(toSerialize) } +func (o *Tag) UnmarshalJSON(bytes []byte) (err error) { + varTag := _Tag{} + + if err = json.Unmarshal(bytes, &varTag); err == nil { + *o = Tag(varTag) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "name") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableTag struct { value *Tag isSet bool diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_user.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_user.go index ce40d756100f..eac34a34ab6a 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_user.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_user.go @@ -32,8 +32,11 @@ type User struct { ArbitraryTypeValue interface{} `json:"arbitraryTypeValue,omitempty"` // test code generation for any type Value can be any type - string, number, boolean, array, object or the 'null' value. ArbitraryNullableTypeValue interface{} `json:"arbitraryNullableTypeValue,omitempty"` + AdditionalProperties map[string]interface{} } +type _User User + // NewUser instantiates a new User object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -476,9 +479,42 @@ func (o User) MarshalJSON() ([]byte, error) { if o.ArbitraryNullableTypeValue != nil { toSerialize["arbitraryNullableTypeValue"] = o.ArbitraryNullableTypeValue } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return json.Marshal(toSerialize) } +func (o *User) UnmarshalJSON(bytes []byte) (err error) { + varUser := _User{} + + if err = json.Unmarshal(bytes, &varUser); err == nil { + *o = User(varUser) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "username") + delete(additionalProperties, "firstName") + delete(additionalProperties, "lastName") + delete(additionalProperties, "email") + delete(additionalProperties, "password") + delete(additionalProperties, "phone") + delete(additionalProperties, "userStatus") + delete(additionalProperties, "arbitraryObject") + delete(additionalProperties, "arbitraryNullableObject") + delete(additionalProperties, "arbitraryTypeValue") + delete(additionalProperties, "arbitraryNullableTypeValue") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableUser struct { value *User isSet bool diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_whale.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_whale.go index 0b81bcfa7ad4..4ed4891cb320 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_whale.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_whale.go @@ -18,8 +18,11 @@ type Whale struct { HasBaleen *bool `json:"hasBaleen,omitempty"` HasTeeth *bool `json:"hasTeeth,omitempty"` ClassName string `json:"className"` + AdditionalProperties map[string]interface{} } +type _Whale Whale + // NewWhale instantiates a new Whale object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -137,9 +140,33 @@ func (o Whale) MarshalJSON() ([]byte, error) { if true { toSerialize["className"] = o.ClassName } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return json.Marshal(toSerialize) } +func (o *Whale) UnmarshalJSON(bytes []byte) (err error) { + varWhale := _Whale{} + + if err = json.Unmarshal(bytes, &varWhale); err == nil { + *o = Whale(varWhale) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "hasBaleen") + delete(additionalProperties, "hasTeeth") + delete(additionalProperties, "className") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableWhale struct { value *Whale isSet bool diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_zebra.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_zebra.go index 82854d088349..88733e014ec9 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_zebra.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_zebra.go @@ -17,8 +17,11 @@ import ( type Zebra struct { Type *string `json:"type,omitempty"` ClassName string `json:"className"` + AdditionalProperties map[string]interface{} } +type _Zebra Zebra + // NewZebra instantiates a new Zebra object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -101,9 +104,32 @@ func (o Zebra) MarshalJSON() ([]byte, error) { if true { toSerialize["className"] = o.ClassName } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return json.Marshal(toSerialize) } +func (o *Zebra) UnmarshalJSON(bytes []byte) (err error) { + varZebra := _Zebra{} + + if err = json.Unmarshal(bytes, &varZebra); err == nil { + *o = Zebra(varZebra) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "type") + delete(additionalProperties, "className") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableZebra struct { value *Zebra isSet bool diff --git a/samples/openapi3/client/petstore/go-experimental/model_test.go b/samples/openapi3/client/petstore/go-experimental/model_test.go index 46012d009e62..39e73f008406 100644 --- a/samples/openapi3/client/petstore/go-experimental/model_test.go +++ b/samples/openapi3/client/petstore/go-experimental/model_test.go @@ -1,34 +1,43 @@ package main import ( + "encoding/json" "testing" - "encoding/json" - "github.com/stretchr/testify/assert" + sw "./go-petstore" + "github.com/stretchr/testify/assert" ) func TestBanana(t *testing.T) { - assert := assert.New(t) - - lengthCm := float32(2.3) - lengthCm2 := float32(2.4) - newBanana := (sw.Banana{LengthCm: &lengthCm}) - newBanana.LengthCm = &lengthCm2 - assert.Equal(newBanana.LengthCm, &lengthCm2, "Banana LengthCm should be equal") - - // test additioanl properties - jsonBanana:= `{"fruits":["apple","peach"],"lengthCm":3.1}` - jsonMap := make(map[string]interface{}) - json.Unmarshal([]byte(jsonBanana), &jsonMap) - - newBanana2 := (sw.Banana{}) - lengthCm3 := float32(3.1) - json.Unmarshal([]byte(jsonBanana), &newBanana2) - assert.Equal(newBanana2.LengthCm, &lengthCm3, "Banana2 LengthCm should be equal") - assert.Equal(newBanana2.AdditionalProperties["fruits"], jsonMap["fruits"], "Banana2 AdditonalProperties should be equal") - - newBanana2Json, _ := json.Marshal(newBanana2) - assert.Equal(string(newBanana2Json), jsonBanana, "Banana2 JSON string should be equal") - + assert := assert.New(t) + + lengthCm := float32(2.3) + lengthCm2 := float32(2.4) + newBanana := (sw.Banana{LengthCm: &lengthCm}) + newBanana.LengthCm = &lengthCm2 + assert.Equal(newBanana.LengthCm, &lengthCm2, "Banana LengthCm should be equal") + + // test additioanl properties + jsonBanana := `{"fruits":["apple","peach"],"lengthCm":3.1}` + jsonMap := make(map[string]interface{}) + json.Unmarshal([]byte(jsonBanana), &jsonMap) + + newBanana2 := (sw.Banana{}) + lengthCm3 := float32(3.1) + json.Unmarshal([]byte(jsonBanana), &newBanana2) + assert.Equal(newBanana2.LengthCm, &lengthCm3, "Banana2 LengthCm should be equal") + assert.Equal(newBanana2.AdditionalProperties["fruits"], jsonMap["fruits"], "Banana2 AdditonalProperties should be equal") + + newBanana2Json, _ := json.Marshal(newBanana2) + assert.Equal(string(newBanana2Json), jsonBanana, "Banana2 JSON string should be equal") } +func TestDog(t *testing.T) { + assert := assert.New(t) + newDog := (sw.Dog{}) + jsonDog := `{"breed":"Shepherd","className":"dog","color":"white"}` + json.Unmarshal([]byte(jsonDog), &newDog) + breedString := "Shepherd" + //assert.Nil(newDog) + assert.Equal(*newDog.Breed, breedString, "Breed should be `Shepherd`") +} From fce74884f831923fb21dcf20c90e9c1dbe96c2e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BF=A0=20/=20green?= Date: Thu, 16 Jul 2020 22:35:41 +0900 Subject: [PATCH 023/129] [typescript-axios] switched to new URL API (#6960) * [typescript-axios] switched to new URL API * [typescript-axios] fix tests --- .gitignore | 1 + .../resources/typescript-axios/api.mustache | 1 - .../typescript-axios/apiInner.mustache | 17 +- .../builds/composed-schemas/api.ts | 49 ++- .../typescript-axios/builds/default/api.ts | 321 ++++++++++++------ .../typescript-axios/builds/es6-target/api.ts | 321 ++++++++++++------ .../builds/with-complex-headers/api.ts | 321 ++++++++++++------ .../builds/with-interfaces/api.ts | 321 ++++++++++++------ .../api/another/level/pet-api.ts | 129 ++++--- .../api/another/level/store-api.ts | 65 ++-- .../api/another/level/user-api.ts | 129 ++++--- .../builds/with-npm-version/api.ts | 321 ++++++++++++------ .../with-single-request-parameters/api.ts | 321 ++++++++++++------ .../tests/default/package-lock.json | 86 +++-- .../tests/default/package.json | 4 +- .../tests/default/test/PetApi.ts | 2 +- .../tests/default/test/PetApiFactory.ts | 4 +- .../tests/default/test/StoreApi.ts | 2 +- .../tests/default/test/StoreApiFactory.ts | 4 +- 19 files changed, 1645 insertions(+), 774 deletions(-) diff --git a/.gitignore b/.gitignore index 4739673eb889..145ed6b6c01b 100644 --- a/.gitignore +++ b/.gitignore @@ -177,6 +177,7 @@ samples/client/petstore/python-tornado/.venv/ samples/client/petstore/typescript-angular2/npm/npm-debug.log samples/client/petstore/typescript-node/npm/npm-debug.log samples/client/petstore/typescript-angular/tsd-debug.log +samples/client/petstore/typescript-axios/tests/**/dist/ samples/client/petstore/typescript-fetch/tests/**/dist/ # aspnetcore diff --git a/modules/openapi-generator/src/main/resources/typescript-axios/api.mustache b/modules/openapi-generator/src/main/resources/typescript-axios/api.mustache index 19ce266882df..a723da260043 100644 --- a/modules/openapi-generator/src/main/resources/typescript-axios/api.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-axios/api.mustache @@ -3,7 +3,6 @@ {{>licenseInfo}} {{^withSeparateModelsAndApi}} -import * as globalImportUrl from 'url'; import { Configuration } from './configuration'; import globalAxios, { AxiosPromise, AxiosInstance } from 'axios'; // Some imports not used depending on template conditions diff --git a/modules/openapi-generator/src/main/resources/typescript-axios/apiInner.mustache b/modules/openapi-generator/src/main/resources/typescript-axios/apiInner.mustache index 10bb9f957615..832bca8e5132 100644 --- a/modules/openapi-generator/src/main/resources/typescript-axios/apiInner.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-axios/apiInner.mustache @@ -3,7 +3,6 @@ /* eslint-disable */ {{>licenseInfo}} -import * as globalImportUrl from 'url'; import globalAxios, { AxiosPromise, AxiosInstance } from 'axios'; import { Configuration } from '{{apiRelativeToRoot}}configuration'; // Some imports not used depending on template conditions @@ -47,7 +46,8 @@ export const {{classname}}AxiosParamCreator = function (configuration?: Configur {{/allParams}} const localVarPath = `{{{path}}}`{{#pathParams}} .replace(`{${"{{baseName}}"}}`, encodeURIComponent(String({{paramName}}))){{/pathParams}}; - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -188,9 +188,14 @@ export const {{classname}}AxiosParamCreator = function (configuration?: Configur {{/consumes.0}} {{/bodyParam}} - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; {{#hasFormParams}} @@ -202,7 +207,7 @@ export const {{classname}}AxiosParamCreator = function (configuration?: Configur {{/bodyParam}} return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, diff --git a/samples/client/petstore/typescript-axios/builds/composed-schemas/api.ts b/samples/client/petstore/typescript-axios/builds/composed-schemas/api.ts index 495012df96a6..0fd7f13b6fcd 100644 --- a/samples/client/petstore/typescript-axios/builds/composed-schemas/api.ts +++ b/samples/client/petstore/typescript-axios/builds/composed-schemas/api.ts @@ -13,7 +13,6 @@ */ -import * as globalImportUrl from 'url'; import { Configuration } from './configuration'; import globalAxios, { AxiosPromise, AxiosInstance } from 'axios'; // Some imports not used depending on template conditions @@ -196,7 +195,8 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati */ filePost: async (inlineObject?: InlineObject, options: any = {}): Promise => { const localVarPath = `/file`; - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -209,16 +209,21 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati localVarHeaderParameter['Content-Type'] = 'application/json'; - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; const needsSerialization = (typeof inlineObject !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; localVarRequestOptions.data = needsSerialization ? JSON.stringify(inlineObject !== undefined ? inlineObject : {}) : (inlineObject || ""); return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -230,7 +235,8 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati */ petsFilteredPatch: async (petByAgePetByType?: PetByAge | PetByType, options: any = {}): Promise => { const localVarPath = `/pets-filtered`; - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -243,16 +249,21 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati localVarHeaderParameter['Content-Type'] = 'application/json'; - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; const needsSerialization = (typeof petByAgePetByType !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; localVarRequestOptions.data = needsSerialization ? JSON.stringify(petByAgePetByType !== undefined ? petByAgePetByType : {}) : (petByAgePetByType || ""); return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -264,7 +275,8 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati */ petsPatch: async (catDog?: Cat | Dog, options: any = {}): Promise => { const localVarPath = `/pets`; - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -277,16 +289,21 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati localVarHeaderParameter['Content-Type'] = 'application/json'; - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; const needsSerialization = (typeof catDog !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; localVarRequestOptions.data = needsSerialization ? JSON.stringify(catDog !== undefined ? catDog : {}) : (catDog || ""); return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, diff --git a/samples/client/petstore/typescript-axios/builds/default/api.ts b/samples/client/petstore/typescript-axios/builds/default/api.ts index dcc79aff27a0..3e03d994edf3 100644 --- a/samples/client/petstore/typescript-axios/builds/default/api.ts +++ b/samples/client/petstore/typescript-axios/builds/default/api.ts @@ -13,7 +13,6 @@ */ -import * as globalImportUrl from 'url'; import { Configuration } from './configuration'; import globalAxios, { AxiosPromise, AxiosInstance } from 'axios'; // Some imports not used depending on template conditions @@ -266,7 +265,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) throw new RequiredError('body','Required parameter body was null or undefined when calling addPet.'); } const localVarPath = `/pet`; - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -288,16 +288,21 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) localVarHeaderParameter['Content-Type'] = 'application/json'; - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || ""); return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -316,7 +321,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) } const localVarPath = `/pet/{petId}` .replace(`{${"petId"}}`, encodeURIComponent(String(petId))); - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -340,14 +346,19 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -364,7 +375,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) throw new RequiredError('status','Required parameter status was null or undefined when calling findPetsByStatus.'); } const localVarPath = `/pet/findByStatus`; - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -388,14 +400,19 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -412,7 +429,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) throw new RequiredError('tags','Required parameter tags was null or undefined when calling findPetsByTags.'); } const localVarPath = `/pet/findByTags`; - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -436,14 +454,19 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -461,7 +484,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) } const localVarPath = `/pet/{petId}` .replace(`{${"petId"}}`, encodeURIComponent(String(petId))); - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -480,14 +504,19 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -504,7 +533,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) throw new RequiredError('body','Required parameter body was null or undefined when calling updatePet.'); } const localVarPath = `/pet`; - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -526,16 +556,21 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) localVarHeaderParameter['Content-Type'] = 'application/json'; - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || ""); return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -555,7 +590,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) } const localVarPath = `/pet/{petId}` .replace(`{${"petId"}}`, encodeURIComponent(String(petId))); - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -586,15 +622,20 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) localVarHeaderParameter['Content-Type'] = 'application/x-www-form-urlencoded'; - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = localVarFormParams.toString(); return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -614,7 +655,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) } const localVarPath = `/pet/{petId}/uploadImage` .replace(`{${"petId"}}`, encodeURIComponent(String(petId))); - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -645,15 +687,20 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) localVarHeaderParameter['Content-Type'] = 'multipart/form-data'; - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = localVarFormParams; return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -1010,7 +1057,8 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration } const localVarPath = `/store/order/{orderId}` .replace(`{${"orderId"}}`, encodeURIComponent(String(orderId))); - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1021,14 +1069,19 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -1040,7 +1093,8 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration */ getInventory: async (options: any = {}): Promise => { const localVarPath = `/store/inventory`; - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1059,14 +1113,19 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -1084,7 +1143,8 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration } const localVarPath = `/store/order/{orderId}` .replace(`{${"orderId"}}`, encodeURIComponent(String(orderId))); - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1095,14 +1155,19 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -1119,7 +1184,8 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration throw new RequiredError('body','Required parameter body was null or undefined when calling placeOrder.'); } const localVarPath = `/store/order`; - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1132,16 +1198,21 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration localVarHeaderParameter['Content-Type'] = 'application/json'; - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || ""); return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -1335,7 +1406,8 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) throw new RequiredError('body','Required parameter body was null or undefined when calling createUser.'); } const localVarPath = `/user`; - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1348,16 +1420,21 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) localVarHeaderParameter['Content-Type'] = 'application/json'; - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || ""); return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -1374,7 +1451,8 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) throw new RequiredError('body','Required parameter body was null or undefined when calling createUsersWithArrayInput.'); } const localVarPath = `/user/createWithArray`; - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1387,16 +1465,21 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) localVarHeaderParameter['Content-Type'] = 'application/json'; - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || ""); return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -1413,7 +1496,8 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) throw new RequiredError('body','Required parameter body was null or undefined when calling createUsersWithListInput.'); } const localVarPath = `/user/createWithList`; - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1426,16 +1510,21 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) localVarHeaderParameter['Content-Type'] = 'application/json'; - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || ""); return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -1453,7 +1542,8 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) } const localVarPath = `/user/{username}` .replace(`{${"username"}}`, encodeURIComponent(String(username))); - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1464,14 +1554,19 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -1489,7 +1584,8 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) } const localVarPath = `/user/{username}` .replace(`{${"username"}}`, encodeURIComponent(String(username))); - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1500,14 +1596,19 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -1529,7 +1630,8 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) throw new RequiredError('password','Required parameter password was null or undefined when calling loginUser.'); } const localVarPath = `/user/login`; - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1548,14 +1650,19 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -1567,7 +1674,8 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) */ logoutUser: async (options: any = {}): Promise => { const localVarPath = `/user/logout`; - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1578,14 +1686,19 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -1608,7 +1721,8 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) } const localVarPath = `/user/{username}` .replace(`{${"username"}}`, encodeURIComponent(String(username))); - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1621,16 +1735,21 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) localVarHeaderParameter['Content-Type'] = 'application/json'; - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || ""); return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, diff --git a/samples/client/petstore/typescript-axios/builds/es6-target/api.ts b/samples/client/petstore/typescript-axios/builds/es6-target/api.ts index dcc79aff27a0..3e03d994edf3 100644 --- a/samples/client/petstore/typescript-axios/builds/es6-target/api.ts +++ b/samples/client/petstore/typescript-axios/builds/es6-target/api.ts @@ -13,7 +13,6 @@ */ -import * as globalImportUrl from 'url'; import { Configuration } from './configuration'; import globalAxios, { AxiosPromise, AxiosInstance } from 'axios'; // Some imports not used depending on template conditions @@ -266,7 +265,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) throw new RequiredError('body','Required parameter body was null or undefined when calling addPet.'); } const localVarPath = `/pet`; - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -288,16 +288,21 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) localVarHeaderParameter['Content-Type'] = 'application/json'; - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || ""); return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -316,7 +321,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) } const localVarPath = `/pet/{petId}` .replace(`{${"petId"}}`, encodeURIComponent(String(petId))); - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -340,14 +346,19 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -364,7 +375,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) throw new RequiredError('status','Required parameter status was null or undefined when calling findPetsByStatus.'); } const localVarPath = `/pet/findByStatus`; - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -388,14 +400,19 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -412,7 +429,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) throw new RequiredError('tags','Required parameter tags was null or undefined when calling findPetsByTags.'); } const localVarPath = `/pet/findByTags`; - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -436,14 +454,19 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -461,7 +484,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) } const localVarPath = `/pet/{petId}` .replace(`{${"petId"}}`, encodeURIComponent(String(petId))); - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -480,14 +504,19 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -504,7 +533,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) throw new RequiredError('body','Required parameter body was null or undefined when calling updatePet.'); } const localVarPath = `/pet`; - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -526,16 +556,21 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) localVarHeaderParameter['Content-Type'] = 'application/json'; - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || ""); return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -555,7 +590,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) } const localVarPath = `/pet/{petId}` .replace(`{${"petId"}}`, encodeURIComponent(String(petId))); - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -586,15 +622,20 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) localVarHeaderParameter['Content-Type'] = 'application/x-www-form-urlencoded'; - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = localVarFormParams.toString(); return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -614,7 +655,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) } const localVarPath = `/pet/{petId}/uploadImage` .replace(`{${"petId"}}`, encodeURIComponent(String(petId))); - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -645,15 +687,20 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) localVarHeaderParameter['Content-Type'] = 'multipart/form-data'; - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = localVarFormParams; return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -1010,7 +1057,8 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration } const localVarPath = `/store/order/{orderId}` .replace(`{${"orderId"}}`, encodeURIComponent(String(orderId))); - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1021,14 +1069,19 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -1040,7 +1093,8 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration */ getInventory: async (options: any = {}): Promise => { const localVarPath = `/store/inventory`; - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1059,14 +1113,19 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -1084,7 +1143,8 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration } const localVarPath = `/store/order/{orderId}` .replace(`{${"orderId"}}`, encodeURIComponent(String(orderId))); - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1095,14 +1155,19 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -1119,7 +1184,8 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration throw new RequiredError('body','Required parameter body was null or undefined when calling placeOrder.'); } const localVarPath = `/store/order`; - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1132,16 +1198,21 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration localVarHeaderParameter['Content-Type'] = 'application/json'; - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || ""); return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -1335,7 +1406,8 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) throw new RequiredError('body','Required parameter body was null or undefined when calling createUser.'); } const localVarPath = `/user`; - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1348,16 +1420,21 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) localVarHeaderParameter['Content-Type'] = 'application/json'; - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || ""); return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -1374,7 +1451,8 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) throw new RequiredError('body','Required parameter body was null or undefined when calling createUsersWithArrayInput.'); } const localVarPath = `/user/createWithArray`; - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1387,16 +1465,21 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) localVarHeaderParameter['Content-Type'] = 'application/json'; - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || ""); return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -1413,7 +1496,8 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) throw new RequiredError('body','Required parameter body was null or undefined when calling createUsersWithListInput.'); } const localVarPath = `/user/createWithList`; - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1426,16 +1510,21 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) localVarHeaderParameter['Content-Type'] = 'application/json'; - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || ""); return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -1453,7 +1542,8 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) } const localVarPath = `/user/{username}` .replace(`{${"username"}}`, encodeURIComponent(String(username))); - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1464,14 +1554,19 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -1489,7 +1584,8 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) } const localVarPath = `/user/{username}` .replace(`{${"username"}}`, encodeURIComponent(String(username))); - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1500,14 +1596,19 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -1529,7 +1630,8 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) throw new RequiredError('password','Required parameter password was null or undefined when calling loginUser.'); } const localVarPath = `/user/login`; - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1548,14 +1650,19 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -1567,7 +1674,8 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) */ logoutUser: async (options: any = {}): Promise => { const localVarPath = `/user/logout`; - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1578,14 +1686,19 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -1608,7 +1721,8 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) } const localVarPath = `/user/{username}` .replace(`{${"username"}}`, encodeURIComponent(String(username))); - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1621,16 +1735,21 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) localVarHeaderParameter['Content-Type'] = 'application/json'; - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || ""); return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, diff --git a/samples/client/petstore/typescript-axios/builds/with-complex-headers/api.ts b/samples/client/petstore/typescript-axios/builds/with-complex-headers/api.ts index a1d3e7782694..8fa42b0091d0 100644 --- a/samples/client/petstore/typescript-axios/builds/with-complex-headers/api.ts +++ b/samples/client/petstore/typescript-axios/builds/with-complex-headers/api.ts @@ -13,7 +13,6 @@ */ -import * as globalImportUrl from 'url'; import { Configuration } from './configuration'; import globalAxios, { AxiosPromise, AxiosInstance } from 'axios'; // Some imports not used depending on template conditions @@ -306,7 +305,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) throw new RequiredError('pet','Required parameter pet was null or undefined when calling addPet.'); } const localVarPath = `/pet`; - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -337,16 +337,21 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) localVarHeaderParameter['Content-Type'] = 'application/json'; - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; const needsSerialization = (typeof pet !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; localVarRequestOptions.data = needsSerialization ? JSON.stringify(pet !== undefined ? pet : {}) : (pet || ""); return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -365,7 +370,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) } const localVarPath = `/pet/{petId}` .replace(`{${"petId"}}`, encodeURIComponent(String(petId))); - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -389,14 +395,19 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -413,7 +424,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) throw new RequiredError('status','Required parameter status was null or undefined when calling findPetsByStatus.'); } const localVarPath = `/pet/findByStatus`; - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -437,14 +449,19 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -461,7 +478,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) throw new RequiredError('tags','Required parameter tags was null or undefined when calling findPetsByTags.'); } const localVarPath = `/pet/findByTags`; - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -485,14 +503,19 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -510,7 +533,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) } const localVarPath = `/pet/{petId}` .replace(`{${"petId"}}`, encodeURIComponent(String(petId))); - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -529,14 +553,19 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -553,7 +582,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) throw new RequiredError('pet','Required parameter pet was null or undefined when calling updatePet.'); } const localVarPath = `/pet`; - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -575,16 +605,21 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) localVarHeaderParameter['Content-Type'] = 'application/json'; - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; const needsSerialization = (typeof pet !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; localVarRequestOptions.data = needsSerialization ? JSON.stringify(pet !== undefined ? pet : {}) : (pet || ""); return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -604,7 +639,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) } const localVarPath = `/pet/{petId}` .replace(`{${"petId"}}`, encodeURIComponent(String(petId))); - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -635,15 +671,20 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) localVarHeaderParameter['Content-Type'] = 'application/x-www-form-urlencoded'; - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = localVarFormParams.toString(); return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -663,7 +704,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) } const localVarPath = `/pet/{petId}/uploadImage` .replace(`{${"petId"}}`, encodeURIComponent(String(petId))); - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -694,15 +736,20 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) localVarHeaderParameter['Content-Type'] = 'multipart/form-data'; - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = localVarFormParams; return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -1065,7 +1112,8 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration } const localVarPath = `/store/order/{orderId}` .replace(`{${"orderId"}}`, encodeURIComponent(String(orderId))); - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1076,14 +1124,19 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -1095,7 +1148,8 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration */ getInventory: async (options: any = {}): Promise => { const localVarPath = `/store/inventory`; - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1114,14 +1168,19 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -1139,7 +1198,8 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration } const localVarPath = `/store/order/{orderId}` .replace(`{${"orderId"}}`, encodeURIComponent(String(orderId))); - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1150,14 +1210,19 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -1174,7 +1239,8 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration throw new RequiredError('order','Required parameter order was null or undefined when calling placeOrder.'); } const localVarPath = `/store/order`; - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1187,16 +1253,21 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration localVarHeaderParameter['Content-Type'] = 'application/json'; - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; const needsSerialization = (typeof order !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; localVarRequestOptions.data = needsSerialization ? JSON.stringify(order !== undefined ? order : {}) : (order || ""); return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -1390,7 +1461,8 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) throw new RequiredError('user','Required parameter user was null or undefined when calling createUser.'); } const localVarPath = `/user`; - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1403,16 +1475,21 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) localVarHeaderParameter['Content-Type'] = 'application/json'; - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; const needsSerialization = (typeof user !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; localVarRequestOptions.data = needsSerialization ? JSON.stringify(user !== undefined ? user : {}) : (user || ""); return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -1429,7 +1506,8 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) throw new RequiredError('user','Required parameter user was null or undefined when calling createUsersWithArrayInput.'); } const localVarPath = `/user/createWithArray`; - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1442,16 +1520,21 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) localVarHeaderParameter['Content-Type'] = 'application/json'; - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; const needsSerialization = (typeof user !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; localVarRequestOptions.data = needsSerialization ? JSON.stringify(user !== undefined ? user : {}) : (user || ""); return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -1468,7 +1551,8 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) throw new RequiredError('user','Required parameter user was null or undefined when calling createUsersWithListInput.'); } const localVarPath = `/user/createWithList`; - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1481,16 +1565,21 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) localVarHeaderParameter['Content-Type'] = 'application/json'; - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; const needsSerialization = (typeof user !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; localVarRequestOptions.data = needsSerialization ? JSON.stringify(user !== undefined ? user : {}) : (user || ""); return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -1508,7 +1597,8 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) } const localVarPath = `/user/{username}` .replace(`{${"username"}}`, encodeURIComponent(String(username))); - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1519,14 +1609,19 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -1544,7 +1639,8 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) } const localVarPath = `/user/{username}` .replace(`{${"username"}}`, encodeURIComponent(String(username))); - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1555,14 +1651,19 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -1584,7 +1685,8 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) throw new RequiredError('password','Required parameter password was null or undefined when calling loginUser.'); } const localVarPath = `/user/login`; - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1603,14 +1705,19 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -1622,7 +1729,8 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) */ logoutUser: async (options: any = {}): Promise => { const localVarPath = `/user/logout`; - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1633,14 +1741,19 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -1663,7 +1776,8 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) } const localVarPath = `/user/{username}` .replace(`{${"username"}}`, encodeURIComponent(String(username))); - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1676,16 +1790,21 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) localVarHeaderParameter['Content-Type'] = 'application/json'; - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; const needsSerialization = (typeof user !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; localVarRequestOptions.data = needsSerialization ? JSON.stringify(user !== undefined ? user : {}) : (user || ""); return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, diff --git a/samples/client/petstore/typescript-axios/builds/with-interfaces/api.ts b/samples/client/petstore/typescript-axios/builds/with-interfaces/api.ts index 0ff5c368f501..2c483d7f6589 100644 --- a/samples/client/petstore/typescript-axios/builds/with-interfaces/api.ts +++ b/samples/client/petstore/typescript-axios/builds/with-interfaces/api.ts @@ -13,7 +13,6 @@ */ -import * as globalImportUrl from 'url'; import { Configuration } from './configuration'; import globalAxios, { AxiosPromise, AxiosInstance } from 'axios'; // Some imports not used depending on template conditions @@ -266,7 +265,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) throw new RequiredError('body','Required parameter body was null or undefined when calling addPet.'); } const localVarPath = `/pet`; - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -288,16 +288,21 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) localVarHeaderParameter['Content-Type'] = 'application/json'; - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || ""); return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -316,7 +321,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) } const localVarPath = `/pet/{petId}` .replace(`{${"petId"}}`, encodeURIComponent(String(petId))); - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -340,14 +346,19 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -364,7 +375,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) throw new RequiredError('status','Required parameter status was null or undefined when calling findPetsByStatus.'); } const localVarPath = `/pet/findByStatus`; - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -388,14 +400,19 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -412,7 +429,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) throw new RequiredError('tags','Required parameter tags was null or undefined when calling findPetsByTags.'); } const localVarPath = `/pet/findByTags`; - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -436,14 +454,19 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -461,7 +484,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) } const localVarPath = `/pet/{petId}` .replace(`{${"petId"}}`, encodeURIComponent(String(petId))); - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -480,14 +504,19 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -504,7 +533,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) throw new RequiredError('body','Required parameter body was null or undefined when calling updatePet.'); } const localVarPath = `/pet`; - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -526,16 +556,21 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) localVarHeaderParameter['Content-Type'] = 'application/json'; - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || ""); return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -555,7 +590,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) } const localVarPath = `/pet/{petId}` .replace(`{${"petId"}}`, encodeURIComponent(String(petId))); - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -586,15 +622,20 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) localVarHeaderParameter['Content-Type'] = 'application/x-www-form-urlencoded'; - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = localVarFormParams.toString(); return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -614,7 +655,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) } const localVarPath = `/pet/{petId}/uploadImage` .replace(`{${"petId"}}`, encodeURIComponent(String(petId))); - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -645,15 +687,20 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) localVarHeaderParameter['Content-Type'] = 'multipart/form-data'; - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = localVarFormParams; return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -1103,7 +1150,8 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration } const localVarPath = `/store/order/{orderId}` .replace(`{${"orderId"}}`, encodeURIComponent(String(orderId))); - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1114,14 +1162,19 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -1133,7 +1186,8 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration */ getInventory: async (options: any = {}): Promise => { const localVarPath = `/store/inventory`; - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1152,14 +1206,19 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -1177,7 +1236,8 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration } const localVarPath = `/store/order/{orderId}` .replace(`{${"orderId"}}`, encodeURIComponent(String(orderId))); - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1188,14 +1248,19 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -1212,7 +1277,8 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration throw new RequiredError('body','Required parameter body was null or undefined when calling placeOrder.'); } const localVarPath = `/store/order`; - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1225,16 +1291,21 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration localVarHeaderParameter['Content-Type'] = 'application/json'; - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || ""); return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -1475,7 +1546,8 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) throw new RequiredError('body','Required parameter body was null or undefined when calling createUser.'); } const localVarPath = `/user`; - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1488,16 +1560,21 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) localVarHeaderParameter['Content-Type'] = 'application/json'; - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || ""); return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -1514,7 +1591,8 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) throw new RequiredError('body','Required parameter body was null or undefined when calling createUsersWithArrayInput.'); } const localVarPath = `/user/createWithArray`; - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1527,16 +1605,21 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) localVarHeaderParameter['Content-Type'] = 'application/json'; - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || ""); return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -1553,7 +1636,8 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) throw new RequiredError('body','Required parameter body was null or undefined when calling createUsersWithListInput.'); } const localVarPath = `/user/createWithList`; - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1566,16 +1650,21 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) localVarHeaderParameter['Content-Type'] = 'application/json'; - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || ""); return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -1593,7 +1682,8 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) } const localVarPath = `/user/{username}` .replace(`{${"username"}}`, encodeURIComponent(String(username))); - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1604,14 +1694,19 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -1629,7 +1724,8 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) } const localVarPath = `/user/{username}` .replace(`{${"username"}}`, encodeURIComponent(String(username))); - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1640,14 +1736,19 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -1669,7 +1770,8 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) throw new RequiredError('password','Required parameter password was null or undefined when calling loginUser.'); } const localVarPath = `/user/login`; - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1688,14 +1790,19 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -1707,7 +1814,8 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) */ logoutUser: async (options: any = {}): Promise => { const localVarPath = `/user/logout`; - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1718,14 +1826,19 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -1748,7 +1861,8 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) } const localVarPath = `/user/{username}` .replace(`{${"username"}}`, encodeURIComponent(String(username))); - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1761,16 +1875,21 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) localVarHeaderParameter['Content-Type'] = 'application/json'; - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || ""); return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, diff --git a/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/api/another/level/pet-api.ts b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/api/another/level/pet-api.ts index 688c880a0feb..26c6e9639ad6 100644 --- a/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/api/another/level/pet-api.ts +++ b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/api/another/level/pet-api.ts @@ -13,7 +13,6 @@ */ -import * as globalImportUrl from 'url'; import globalAxios, { AxiosPromise, AxiosInstance } from 'axios'; import { Configuration } from '../../../configuration'; // Some imports not used depending on template conditions @@ -42,7 +41,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) throw new RequiredError('body','Required parameter body was null or undefined when calling addPet.'); } const localVarPath = `/pet`; - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -64,16 +64,21 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) localVarHeaderParameter['Content-Type'] = 'application/json'; - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || ""); return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -92,7 +97,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) } const localVarPath = `/pet/{petId}` .replace(`{${"petId"}}`, encodeURIComponent(String(petId))); - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -116,14 +122,19 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -140,7 +151,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) throw new RequiredError('status','Required parameter status was null or undefined when calling findPetsByStatus.'); } const localVarPath = `/pet/findByStatus`; - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -164,14 +176,19 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -188,7 +205,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) throw new RequiredError('tags','Required parameter tags was null or undefined when calling findPetsByTags.'); } const localVarPath = `/pet/findByTags`; - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -212,14 +230,19 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -237,7 +260,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) } const localVarPath = `/pet/{petId}` .replace(`{${"petId"}}`, encodeURIComponent(String(petId))); - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -256,14 +280,19 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -280,7 +309,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) throw new RequiredError('body','Required parameter body was null or undefined when calling updatePet.'); } const localVarPath = `/pet`; - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -302,16 +332,21 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) localVarHeaderParameter['Content-Type'] = 'application/json'; - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || ""); return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -331,7 +366,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) } const localVarPath = `/pet/{petId}` .replace(`{${"petId"}}`, encodeURIComponent(String(petId))); - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -362,15 +398,20 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) localVarHeaderParameter['Content-Type'] = 'application/x-www-form-urlencoded'; - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = localVarFormParams.toString(); return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -390,7 +431,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) } const localVarPath = `/pet/{petId}/uploadImage` .replace(`{${"petId"}}`, encodeURIComponent(String(petId))); - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -421,15 +463,20 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) localVarHeaderParameter['Content-Type'] = 'multipart/form-data'; - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = localVarFormParams; return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, diff --git a/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/api/another/level/store-api.ts b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/api/another/level/store-api.ts index 4dc676eb0e38..f1b3baca90f2 100644 --- a/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/api/another/level/store-api.ts +++ b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/api/another/level/store-api.ts @@ -13,7 +13,6 @@ */ -import * as globalImportUrl from 'url'; import globalAxios, { AxiosPromise, AxiosInstance } from 'axios'; import { Configuration } from '../../../configuration'; // Some imports not used depending on template conditions @@ -41,7 +40,8 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration } const localVarPath = `/store/order/{orderId}` .replace(`{${"orderId"}}`, encodeURIComponent(String(orderId))); - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -52,14 +52,19 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -71,7 +76,8 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration */ getInventory: async (options: any = {}): Promise => { const localVarPath = `/store/inventory`; - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -90,14 +96,19 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -115,7 +126,8 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration } const localVarPath = `/store/order/{orderId}` .replace(`{${"orderId"}}`, encodeURIComponent(String(orderId))); - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -126,14 +138,19 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -150,7 +167,8 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration throw new RequiredError('body','Required parameter body was null or undefined when calling placeOrder.'); } const localVarPath = `/store/order`; - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -163,16 +181,21 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration localVarHeaderParameter['Content-Type'] = 'application/json'; - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || ""); return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, diff --git a/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/api/another/level/user-api.ts b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/api/another/level/user-api.ts index 6111d0a09e25..c14e9b22eec8 100644 --- a/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/api/another/level/user-api.ts +++ b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/api/another/level/user-api.ts @@ -13,7 +13,6 @@ */ -import * as globalImportUrl from 'url'; import globalAxios, { AxiosPromise, AxiosInstance } from 'axios'; import { Configuration } from '../../../configuration'; // Some imports not used depending on template conditions @@ -40,7 +39,8 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) throw new RequiredError('body','Required parameter body was null or undefined when calling createUser.'); } const localVarPath = `/user`; - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -53,16 +53,21 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) localVarHeaderParameter['Content-Type'] = 'application/json'; - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || ""); return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -79,7 +84,8 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) throw new RequiredError('body','Required parameter body was null or undefined when calling createUsersWithArrayInput.'); } const localVarPath = `/user/createWithArray`; - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -92,16 +98,21 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) localVarHeaderParameter['Content-Type'] = 'application/json'; - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || ""); return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -118,7 +129,8 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) throw new RequiredError('body','Required parameter body was null or undefined when calling createUsersWithListInput.'); } const localVarPath = `/user/createWithList`; - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -131,16 +143,21 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) localVarHeaderParameter['Content-Type'] = 'application/json'; - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || ""); return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -158,7 +175,8 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) } const localVarPath = `/user/{username}` .replace(`{${"username"}}`, encodeURIComponent(String(username))); - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -169,14 +187,19 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -194,7 +217,8 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) } const localVarPath = `/user/{username}` .replace(`{${"username"}}`, encodeURIComponent(String(username))); - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -205,14 +229,19 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -234,7 +263,8 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) throw new RequiredError('password','Required parameter password was null or undefined when calling loginUser.'); } const localVarPath = `/user/login`; - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -253,14 +283,19 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -272,7 +307,8 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) */ logoutUser: async (options: any = {}): Promise => { const localVarPath = `/user/logout`; - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -283,14 +319,19 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -313,7 +354,8 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) } const localVarPath = `/user/{username}` .replace(`{${"username"}}`, encodeURIComponent(String(username))); - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -326,16 +368,21 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) localVarHeaderParameter['Content-Type'] = 'application/json'; - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || ""); return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, diff --git a/samples/client/petstore/typescript-axios/builds/with-npm-version/api.ts b/samples/client/petstore/typescript-axios/builds/with-npm-version/api.ts index dcc79aff27a0..3e03d994edf3 100644 --- a/samples/client/petstore/typescript-axios/builds/with-npm-version/api.ts +++ b/samples/client/petstore/typescript-axios/builds/with-npm-version/api.ts @@ -13,7 +13,6 @@ */ -import * as globalImportUrl from 'url'; import { Configuration } from './configuration'; import globalAxios, { AxiosPromise, AxiosInstance } from 'axios'; // Some imports not used depending on template conditions @@ -266,7 +265,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) throw new RequiredError('body','Required parameter body was null or undefined when calling addPet.'); } const localVarPath = `/pet`; - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -288,16 +288,21 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) localVarHeaderParameter['Content-Type'] = 'application/json'; - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || ""); return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -316,7 +321,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) } const localVarPath = `/pet/{petId}` .replace(`{${"petId"}}`, encodeURIComponent(String(petId))); - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -340,14 +346,19 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -364,7 +375,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) throw new RequiredError('status','Required parameter status was null or undefined when calling findPetsByStatus.'); } const localVarPath = `/pet/findByStatus`; - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -388,14 +400,19 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -412,7 +429,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) throw new RequiredError('tags','Required parameter tags was null or undefined when calling findPetsByTags.'); } const localVarPath = `/pet/findByTags`; - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -436,14 +454,19 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -461,7 +484,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) } const localVarPath = `/pet/{petId}` .replace(`{${"petId"}}`, encodeURIComponent(String(petId))); - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -480,14 +504,19 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -504,7 +533,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) throw new RequiredError('body','Required parameter body was null or undefined when calling updatePet.'); } const localVarPath = `/pet`; - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -526,16 +556,21 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) localVarHeaderParameter['Content-Type'] = 'application/json'; - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || ""); return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -555,7 +590,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) } const localVarPath = `/pet/{petId}` .replace(`{${"petId"}}`, encodeURIComponent(String(petId))); - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -586,15 +622,20 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) localVarHeaderParameter['Content-Type'] = 'application/x-www-form-urlencoded'; - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = localVarFormParams.toString(); return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -614,7 +655,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) } const localVarPath = `/pet/{petId}/uploadImage` .replace(`{${"petId"}}`, encodeURIComponent(String(petId))); - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -645,15 +687,20 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) localVarHeaderParameter['Content-Type'] = 'multipart/form-data'; - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = localVarFormParams; return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -1010,7 +1057,8 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration } const localVarPath = `/store/order/{orderId}` .replace(`{${"orderId"}}`, encodeURIComponent(String(orderId))); - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1021,14 +1069,19 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -1040,7 +1093,8 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration */ getInventory: async (options: any = {}): Promise => { const localVarPath = `/store/inventory`; - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1059,14 +1113,19 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -1084,7 +1143,8 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration } const localVarPath = `/store/order/{orderId}` .replace(`{${"orderId"}}`, encodeURIComponent(String(orderId))); - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1095,14 +1155,19 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -1119,7 +1184,8 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration throw new RequiredError('body','Required parameter body was null or undefined when calling placeOrder.'); } const localVarPath = `/store/order`; - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1132,16 +1198,21 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration localVarHeaderParameter['Content-Type'] = 'application/json'; - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || ""); return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -1335,7 +1406,8 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) throw new RequiredError('body','Required parameter body was null or undefined when calling createUser.'); } const localVarPath = `/user`; - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1348,16 +1420,21 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) localVarHeaderParameter['Content-Type'] = 'application/json'; - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || ""); return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -1374,7 +1451,8 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) throw new RequiredError('body','Required parameter body was null or undefined when calling createUsersWithArrayInput.'); } const localVarPath = `/user/createWithArray`; - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1387,16 +1465,21 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) localVarHeaderParameter['Content-Type'] = 'application/json'; - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || ""); return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -1413,7 +1496,8 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) throw new RequiredError('body','Required parameter body was null or undefined when calling createUsersWithListInput.'); } const localVarPath = `/user/createWithList`; - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1426,16 +1510,21 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) localVarHeaderParameter['Content-Type'] = 'application/json'; - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || ""); return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -1453,7 +1542,8 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) } const localVarPath = `/user/{username}` .replace(`{${"username"}}`, encodeURIComponent(String(username))); - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1464,14 +1554,19 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -1489,7 +1584,8 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) } const localVarPath = `/user/{username}` .replace(`{${"username"}}`, encodeURIComponent(String(username))); - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1500,14 +1596,19 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -1529,7 +1630,8 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) throw new RequiredError('password','Required parameter password was null or undefined when calling loginUser.'); } const localVarPath = `/user/login`; - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1548,14 +1650,19 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -1567,7 +1674,8 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) */ logoutUser: async (options: any = {}): Promise => { const localVarPath = `/user/logout`; - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1578,14 +1686,19 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -1608,7 +1721,8 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) } const localVarPath = `/user/{username}` .replace(`{${"username"}}`, encodeURIComponent(String(username))); - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1621,16 +1735,21 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) localVarHeaderParameter['Content-Type'] = 'application/json'; - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || ""); return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, diff --git a/samples/client/petstore/typescript-axios/builds/with-single-request-parameters/api.ts b/samples/client/petstore/typescript-axios/builds/with-single-request-parameters/api.ts index d3bb2f8787f0..28f2240908e8 100644 --- a/samples/client/petstore/typescript-axios/builds/with-single-request-parameters/api.ts +++ b/samples/client/petstore/typescript-axios/builds/with-single-request-parameters/api.ts @@ -13,7 +13,6 @@ */ -import * as globalImportUrl from 'url'; import { Configuration } from './configuration'; import globalAxios, { AxiosPromise, AxiosInstance } from 'axios'; // Some imports not used depending on template conditions @@ -266,7 +265,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) throw new RequiredError('body','Required parameter body was null or undefined when calling addPet.'); } const localVarPath = `/pet`; - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -288,16 +288,21 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) localVarHeaderParameter['Content-Type'] = 'application/json'; - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || ""); return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -316,7 +321,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) } const localVarPath = `/pet/{petId}` .replace(`{${"petId"}}`, encodeURIComponent(String(petId))); - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -340,14 +346,19 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -364,7 +375,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) throw new RequiredError('status','Required parameter status was null or undefined when calling findPetsByStatus.'); } const localVarPath = `/pet/findByStatus`; - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -388,14 +400,19 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -412,7 +429,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) throw new RequiredError('tags','Required parameter tags was null or undefined when calling findPetsByTags.'); } const localVarPath = `/pet/findByTags`; - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -436,14 +454,19 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -461,7 +484,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) } const localVarPath = `/pet/{petId}` .replace(`{${"petId"}}`, encodeURIComponent(String(petId))); - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -480,14 +504,19 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -504,7 +533,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) throw new RequiredError('body','Required parameter body was null or undefined when calling updatePet.'); } const localVarPath = `/pet`; - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -526,16 +556,21 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) localVarHeaderParameter['Content-Type'] = 'application/json'; - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || ""); return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -555,7 +590,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) } const localVarPath = `/pet/{petId}` .replace(`{${"petId"}}`, encodeURIComponent(String(petId))); - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -586,15 +622,20 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) localVarHeaderParameter['Content-Type'] = 'application/x-www-form-urlencoded'; - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = localVarFormParams.toString(); return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -614,7 +655,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) } const localVarPath = `/pet/{petId}/uploadImage` .replace(`{${"petId"}}`, encodeURIComponent(String(petId))); - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -645,15 +687,20 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) localVarHeaderParameter['Content-Type'] = 'multipart/form-data'; - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = localVarFormParams; return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -1152,7 +1199,8 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration } const localVarPath = `/store/order/{orderId}` .replace(`{${"orderId"}}`, encodeURIComponent(String(orderId))); - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1163,14 +1211,19 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -1182,7 +1235,8 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration */ getInventory: async (options: any = {}): Promise => { const localVarPath = `/store/inventory`; - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1201,14 +1255,19 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -1226,7 +1285,8 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration } const localVarPath = `/store/order/{orderId}` .replace(`{${"orderId"}}`, encodeURIComponent(String(orderId))); - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1237,14 +1297,19 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -1257,7 +1322,8 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration */ placeOrder: async (body?: Order, options: any = {}): Promise => { const localVarPath = `/store/order`; - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1270,16 +1336,21 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration localVarHeaderParameter['Content-Type'] = 'application/json'; - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || ""); return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -1515,7 +1586,8 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) throw new RequiredError('body','Required parameter body was null or undefined when calling createUser.'); } const localVarPath = `/user`; - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1528,16 +1600,21 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) localVarHeaderParameter['Content-Type'] = 'application/json'; - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || ""); return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -1554,7 +1631,8 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) throw new RequiredError('body','Required parameter body was null or undefined when calling createUsersWithArrayInput.'); } const localVarPath = `/user/createWithArray`; - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1567,16 +1645,21 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) localVarHeaderParameter['Content-Type'] = 'application/json'; - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || ""); return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -1593,7 +1676,8 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) throw new RequiredError('body','Required parameter body was null or undefined when calling createUsersWithListInput.'); } const localVarPath = `/user/createWithList`; - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1606,16 +1690,21 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) localVarHeaderParameter['Content-Type'] = 'application/json'; - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || ""); return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -1633,7 +1722,8 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) } const localVarPath = `/user/{username}` .replace(`{${"username"}}`, encodeURIComponent(String(username))); - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1644,14 +1734,19 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -1669,7 +1764,8 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) } const localVarPath = `/user/{username}` .replace(`{${"username"}}`, encodeURIComponent(String(username))); - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1680,14 +1776,19 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -1709,7 +1810,8 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) throw new RequiredError('password','Required parameter password was null or undefined when calling loginUser.'); } const localVarPath = `/user/login`; - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1728,14 +1830,19 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -1747,7 +1854,8 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) */ logoutUser: async (options: any = {}): Promise => { const localVarPath = `/user/logout`; - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1758,14 +1866,19 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, @@ -1788,7 +1901,8 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) } const localVarPath = `/user/{username}` .replace(`{${"username"}}`, encodeURIComponent(String(username))); - const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1801,16 +1915,21 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) localVarHeaderParameter['Content-Type'] = 'application/json'; - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.query) { + query.set(key, options.query[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || ""); return { - url: globalImportUrl.format(localVarUrlObj), + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, diff --git a/samples/client/petstore/typescript-axios/tests/default/package-lock.json b/samples/client/petstore/typescript-axios/tests/default/package-lock.json index 468690463c6e..c955f21073a6 100644 --- a/samples/client/petstore/typescript-axios/tests/default/package-lock.json +++ b/samples/client/petstore/typescript-axios/tests/default/package-lock.json @@ -4,41 +4,40 @@ "lockfileVersion": 1, "requires": true, "dependencies": { - "@swagger/typescript-axios-petstore": { + "@openapitools/typescript-axios-petstore": { "version": "file:../../builds/with-npm-version", "requires": { - "axios": "^0.18.0" + "axios": "^0.19.2" }, "dependencies": { "axios": { - "version": "0.18.0", - "bundled": true, + "version": "0.19.2", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.19.2.tgz", + "integrity": "sha512-fjgm5MvRHLhx+osE2xoekY70AhARk3a6hkN+3Io1jc00jtquGvxYlKlsFUhmUET0V5te6CcZI7lcv2Ym61mjHA==", "requires": { - "follow-redirects": "^1.3.0", - "is-buffer": "^1.1.5" + "follow-redirects": "1.5.10" } }, "debug": { "version": "3.1.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", "requires": { "ms": "2.0.0" } }, "follow-redirects": { - "version": "1.5.8", - "bundled": true, + "version": "1.5.10", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.5.10.tgz", + "integrity": "sha512-0V5l4Cizzvqt5D44aTXbFZz+FtyXV1vrDN6qrelxtfYQKW0KO0W2T/hkE8xvGa/540LkZlkaUjO4ailYTFtHVQ==", "requires": { "debug": "=3.1.0" } }, - "is-buffer": { - "version": "1.1.6", - "bundled": true - }, "ms": { "version": "2.0.0", - "bundled": true + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" } } }, @@ -401,12 +400,11 @@ "dev": true }, "axios": { - "version": "0.18.0", - "resolved": "http://registry.npmjs.org/axios/-/axios-0.18.0.tgz", - "integrity": "sha1-MtU+SFHv3AoRmTts0AB4nXDAUQI=", + "version": "0.19.2", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.19.2.tgz", + "integrity": "sha512-fjgm5MvRHLhx+osE2xoekY70AhARk3a6hkN+3Io1jc00jtquGvxYlKlsFUhmUET0V5te6CcZI7lcv2Ym61mjHA==", "requires": { - "follow-redirects": "^1.3.0", - "is-buffer": "^1.1.5" + "follow-redirects": "1.5.10" } }, "balanced-match": { @@ -1674,9 +1672,9 @@ } }, "follow-redirects": { - "version": "1.5.8", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.5.8.tgz", - "integrity": "sha512-sy1mXPmv7kLAMKW/8XofG7o9T+6gAjzdZK4AJF6ryqQYUa/hnzgiypoeUecZ53x7XiqKNEpNqLtS97MshW2nxg==", + "version": "1.5.10", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.5.10.tgz", + "integrity": "sha512-0V5l4Cizzvqt5D44aTXbFZz+FtyXV1vrDN6qrelxtfYQKW0KO0W2T/hkE8xvGa/540LkZlkaUjO4ailYTFtHVQ==", "requires": { "debug": "=3.1.0" } @@ -1742,7 +1740,8 @@ "ansi-regex": { "version": "2.1.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "aproba": { "version": "1.2.0", @@ -1763,12 +1762,14 @@ "balanced-match": { "version": "1.0.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "brace-expansion": { "version": "1.1.11", "bundled": true, "dev": true, + "optional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -1783,17 +1784,20 @@ "code-point-at": { "version": "1.1.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "concat-map": { "version": "0.0.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "console-control-strings": { "version": "1.1.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "core-util-is": { "version": "1.0.2", @@ -1910,7 +1914,8 @@ "inherits": { "version": "2.0.3", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "ini": { "version": "1.3.5", @@ -1922,6 +1927,7 @@ "version": "1.0.0", "bundled": true, "dev": true, + "optional": true, "requires": { "number-is-nan": "^1.0.0" } @@ -1936,6 +1942,7 @@ "version": "3.0.4", "bundled": true, "dev": true, + "optional": true, "requires": { "brace-expansion": "^1.1.7" } @@ -1943,12 +1950,14 @@ "minimist": { "version": "0.0.8", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "minipass": { "version": "2.2.4", "bundled": true, "dev": true, + "optional": true, "requires": { "safe-buffer": "^5.1.1", "yallist": "^3.0.0" @@ -1967,6 +1976,7 @@ "version": "0.5.1", "bundled": true, "dev": true, + "optional": true, "requires": { "minimist": "0.0.8" } @@ -2047,7 +2057,8 @@ "number-is-nan": { "version": "1.0.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "object-assign": { "version": "4.1.1", @@ -2059,6 +2070,7 @@ "version": "1.4.0", "bundled": true, "dev": true, + "optional": true, "requires": { "wrappy": "1" } @@ -2144,7 +2156,8 @@ "safe-buffer": { "version": "5.1.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "safer-buffer": { "version": "2.1.2", @@ -2180,6 +2193,7 @@ "version": "1.0.2", "bundled": true, "dev": true, + "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", @@ -2199,6 +2213,7 @@ "version": "3.0.1", "bundled": true, "dev": true, + "optional": true, "requires": { "ansi-regex": "^2.0.0" } @@ -2242,12 +2257,14 @@ "wrappy": { "version": "1.0.2", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "yallist": { "version": "3.0.2", "bundled": true, - "dev": true + "dev": true, + "optional": true } } }, @@ -2679,7 +2696,8 @@ "is-buffer": { "version": "1.1.6", "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", - "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==" + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true }, "is-ci": { "version": "1.2.1", diff --git a/samples/client/petstore/typescript-axios/tests/default/package.json b/samples/client/petstore/typescript-axios/tests/default/package.json index 187f525f3968..a53f2f2f3d07 100644 --- a/samples/client/petstore/typescript-axios/tests/default/package.json +++ b/samples/client/petstore/typescript-axios/tests/default/package.json @@ -1,8 +1,8 @@ { "private": true, "dependencies": { - "@swagger/typescript-axios-petstore": "file:../../builds/with-npm-version", - "axios": "0.18.0", + "@openapitools/typescript-axios-petstore": "file:../../builds/with-npm-version", + "axios": "0.19.2", "chai": "^4.1.0", "ts-node": "^3.3.0" }, diff --git a/samples/client/petstore/typescript-axios/tests/default/test/PetApi.ts b/samples/client/petstore/typescript-axios/tests/default/test/PetApi.ts index 5653ce604309..dabb4d9a4f4f 100644 --- a/samples/client/petstore/typescript-axios/tests/default/test/PetApi.ts +++ b/samples/client/petstore/typescript-axios/tests/default/test/PetApi.ts @@ -1,5 +1,5 @@ import { expect } from "chai"; -import { PetApi, Pet, PetStatusEnum, Category } from "@swagger/typescript-axios-petstore"; +import { PetApi, Pet, PetStatusEnum, Category } from "@openapitools/typescript-axios-petstore"; import axios, {AxiosInstance, AxiosResponse} from "axios"; describe("PetApi", () => { diff --git a/samples/client/petstore/typescript-axios/tests/default/test/PetApiFactory.ts b/samples/client/petstore/typescript-axios/tests/default/test/PetApiFactory.ts index b1396fd12b67..b4d602e28ce4 100644 --- a/samples/client/petstore/typescript-axios/tests/default/test/PetApiFactory.ts +++ b/samples/client/petstore/typescript-axios/tests/default/test/PetApiFactory.ts @@ -4,8 +4,8 @@ import { Pet, PetStatusEnum, Category -} from "@swagger/typescript-axios-petstore"; -import { Configuration } from "@swagger/typescript-axios-petstore"; +} from "@openapitools/typescript-axios-petstore"; +import { Configuration } from "@openapitools/typescript-axios-petstore"; import axios, {AxiosInstance, AxiosResponse} from "axios"; let config: Configuration; diff --git a/samples/client/petstore/typescript-axios/tests/default/test/StoreApi.ts b/samples/client/petstore/typescript-axios/tests/default/test/StoreApi.ts index 6ae2d0a49187..35137340fcab 100644 --- a/samples/client/petstore/typescript-axios/tests/default/test/StoreApi.ts +++ b/samples/client/petstore/typescript-axios/tests/default/test/StoreApi.ts @@ -1,5 +1,5 @@ import { expect } from "chai"; -import { StoreApi } from "@swagger/typescript-axios-petstore"; +import { StoreApi } from "@openapitools/typescript-axios-petstore"; import axios, {AxiosInstance, AxiosResponse} from "axios"; describe("StoreApi", function() { diff --git a/samples/client/petstore/typescript-axios/tests/default/test/StoreApiFactory.ts b/samples/client/petstore/typescript-axios/tests/default/test/StoreApiFactory.ts index 37758eefe5cb..1b5bb44d89a5 100644 --- a/samples/client/petstore/typescript-axios/tests/default/test/StoreApiFactory.ts +++ b/samples/client/petstore/typescript-axios/tests/default/test/StoreApiFactory.ts @@ -1,6 +1,6 @@ import { expect } from "chai"; -import { StoreApiFactory } from "@swagger/typescript-axios-petstore"; -import { Configuration } from "@swagger/typescript-axios-petstore"; +import { StoreApiFactory } from "@openapitools/typescript-axios-petstore"; +import { Configuration } from "@openapitools/typescript-axios-petstore"; import {AxiosInstance, AxiosResponse} from "axios"; import axios from "axios"; From 7cb8766a5c67159dd47f3d20f8f5ea00e486196b Mon Sep 17 00:00:00 2001 From: Bodo Graumann Date: Thu, 16 Jul 2020 16:31:41 +0200 Subject: [PATCH 024/129] [Typescript] Fix array model of alias to array (#6888) * Add failing test * Add model unaliasing * Regenerate samples Not really related to this bug fix, but probably necessary for ci checks. --- .../languages/TypeScriptClientCodegen.java | 4 +- .../TypeScriptClientCodegenTest.java | 44 +++++++++++++++++++ .../typescript/builds/default/http/http.ts | 2 +- .../typescript/builds/deno/http/http.ts | 2 +- .../typescript/builds/inversify/http/http.ts | 2 +- .../typescript/builds/jquery/http/http.ts | 2 +- .../builds/object_params/http/http.ts | 2 +- 7 files changed, 51 insertions(+), 7 deletions(-) create mode 100644 modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/TypeScriptClientCodegenTest.java diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptClientCodegen.java index 512ddce35cbc..90de094757df 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptClientCodegen.java @@ -839,10 +839,10 @@ public String getTypeDeclaration(Schema p) { Schema inner; if (ModelUtils.isArraySchema(p)) { inner = ((ArraySchema) p).getItems(); - return this.getSchemaType(p) + "<" + this.getTypeDeclaration(inner) + ">"; + return this.getSchemaType(p) + "<" + this.getTypeDeclaration(ModelUtils.unaliasSchema(this.openAPI, inner)) + ">"; } else if (ModelUtils.isMapSchema(p)) { inner = (Schema) p.getAdditionalProperties(); - return "{ [key: string]: " + this.getTypeDeclaration(inner) + "; }"; + return "{ [key: string]: " + this.getTypeDeclaration(ModelUtils.unaliasSchema(this.openAPI, inner)) + "; }"; } else if (ModelUtils.isFileSchema(p)) { return "HttpFile"; } else if (ModelUtils.isBinarySchema(p)) { diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/TypeScriptClientCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/TypeScriptClientCodegenTest.java new file mode 100644 index 000000000000..20084678d3f0 --- /dev/null +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/TypeScriptClientCodegenTest.java @@ -0,0 +1,44 @@ +package org.openapitools.codegen.typescript.fetch; + +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.media.*; +import org.openapitools.codegen.TestUtils; +import org.openapitools.codegen.languages.TypeScriptClientCodegen; +import org.openapitools.codegen.utils.ModelUtils; +import org.testng.Assert; +import org.testng.annotations.Test; + + +public class TypeScriptClientCodegenTest { + @Test + public void getTypeDeclarationTest() { + Schema childSchema = new ArraySchema().items(new StringSchema()); + + OpenAPI api = TestUtils.createOpenAPI(); + api.getComponents().addSchemas("Child", childSchema); + + TypeScriptClientCodegen codegen = new TypeScriptClientCodegen(); + codegen.setOpenAPI(api); + + // Cf. issue #4968: Array of Alias of Array + Schema parentSchema = new ArraySchema().items( + new Schema().$ref("#/components/schemas/Child") + ); + + ModelUtils.setGenerateAliasAsModel(false); + Assert.assertEquals(codegen.getTypeDeclaration(parentSchema), "Array>"); + + ModelUtils.setGenerateAliasAsModel(true); + Assert.assertEquals(codegen.getTypeDeclaration(parentSchema), "Array"); + + // Same for Map + parentSchema = new MapSchema().additionalProperties(new Schema().$ref("#/components/schemas/Child")); + + ModelUtils.setGenerateAliasAsModel(false); + Assert.assertEquals(codegen.getTypeDeclaration(parentSchema), "{ [key: string]: Array; }"); + + ModelUtils.setGenerateAliasAsModel(true); + Assert.assertEquals(codegen.getTypeDeclaration(parentSchema), "{ [key: string]: Child; }"); + } + +} diff --git a/samples/openapi3/client/petstore/typescript/builds/default/http/http.ts b/samples/openapi3/client/petstore/typescript/builds/default/http/http.ts index 4241ca3d329b..ec8437b19ca8 100644 --- a/samples/openapi3/client/petstore/typescript/builds/default/http/http.ts +++ b/samples/openapi3/client/petstore/typescript/builds/default/http/http.ts @@ -73,7 +73,7 @@ export class RequestContext { * */ public setUrl(url: string) { - this.url = new URLParse(url, true); + this.url = new URLParse(url, true); } /** diff --git a/samples/openapi3/client/petstore/typescript/builds/deno/http/http.ts b/samples/openapi3/client/petstore/typescript/builds/deno/http/http.ts index 7bb54a77ff9c..8afe112b13b6 100644 --- a/samples/openapi3/client/petstore/typescript/builds/deno/http/http.ts +++ b/samples/openapi3/client/petstore/typescript/builds/deno/http/http.ts @@ -93,7 +93,7 @@ export class RequestContext { * */ public setUrl(url: string) { - this.url = new URLParse(url, true); + this.url = new URLParse(url, true); } /** diff --git a/samples/openapi3/client/petstore/typescript/builds/inversify/http/http.ts b/samples/openapi3/client/petstore/typescript/builds/inversify/http/http.ts index 4241ca3d329b..ec8437b19ca8 100644 --- a/samples/openapi3/client/petstore/typescript/builds/inversify/http/http.ts +++ b/samples/openapi3/client/petstore/typescript/builds/inversify/http/http.ts @@ -73,7 +73,7 @@ export class RequestContext { * */ public setUrl(url: string) { - this.url = new URLParse(url, true); + this.url = new URLParse(url, true); } /** diff --git a/samples/openapi3/client/petstore/typescript/builds/jquery/http/http.ts b/samples/openapi3/client/petstore/typescript/builds/jquery/http/http.ts index a32073360031..4ae3fd11b9f6 100644 --- a/samples/openapi3/client/petstore/typescript/builds/jquery/http/http.ts +++ b/samples/openapi3/client/petstore/typescript/builds/jquery/http/http.ts @@ -68,7 +68,7 @@ export class RequestContext { * */ public setUrl(url: string) { - this.url = new URLParse(url, true); + this.url = new URLParse(url, true); } /** diff --git a/samples/openapi3/client/petstore/typescript/builds/object_params/http/http.ts b/samples/openapi3/client/petstore/typescript/builds/object_params/http/http.ts index 4241ca3d329b..ec8437b19ca8 100644 --- a/samples/openapi3/client/petstore/typescript/builds/object_params/http/http.ts +++ b/samples/openapi3/client/petstore/typescript/builds/object_params/http/http.ts @@ -73,7 +73,7 @@ export class RequestContext { * */ public setUrl(url: string) { - this.url = new URLParse(url, true); + this.url = new URLParse(url, true); } /** From 9318833fa55249b792d73dc5fef7f49f99885422 Mon Sep 17 00:00:00 2001 From: Tomohiro Suwa Date: Fri, 17 Jul 2020 00:39:21 +0900 Subject: [PATCH 025/129] [Ruby] ruby client build from hash nullable (#6945) * Ruby Client: nullable for build_from_hash * Generate sameples with a8eed9ce38e --- .../src/main/resources/ruby-client/base_object.mustache | 4 +++- .../lib/petstore/models/additional_properties_class.rb | 4 +++- .../petstore/ruby-faraday/lib/petstore/models/animal.rb | 4 +++- .../petstore/ruby-faraday/lib/petstore/models/api_response.rb | 4 +++- .../lib/petstore/models/array_of_array_of_number_only.rb | 4 +++- .../ruby-faraday/lib/petstore/models/array_of_number_only.rb | 4 +++- .../petstore/ruby-faraday/lib/petstore/models/array_test.rb | 4 +++- .../ruby-faraday/lib/petstore/models/capitalization.rb | 4 +++- .../client/petstore/ruby-faraday/lib/petstore/models/cat.rb | 4 +++- .../petstore/ruby-faraday/lib/petstore/models/cat_all_of.rb | 4 +++- .../petstore/ruby-faraday/lib/petstore/models/category.rb | 4 +++- .../petstore/ruby-faraday/lib/petstore/models/class_model.rb | 4 +++- .../petstore/ruby-faraday/lib/petstore/models/client.rb | 4 +++- .../client/petstore/ruby-faraday/lib/petstore/models/dog.rb | 4 +++- .../petstore/ruby-faraday/lib/petstore/models/dog_all_of.rb | 4 +++- .../petstore/ruby-faraday/lib/petstore/models/enum_arrays.rb | 4 +++- .../petstore/ruby-faraday/lib/petstore/models/enum_test.rb | 4 +++- .../client/petstore/ruby-faraday/lib/petstore/models/file.rb | 4 +++- .../lib/petstore/models/file_schema_test_class.rb | 4 +++- .../client/petstore/ruby-faraday/lib/petstore/models/foo.rb | 4 +++- .../petstore/ruby-faraday/lib/petstore/models/format_test.rb | 4 +++- .../ruby-faraday/lib/petstore/models/has_only_read_only.rb | 4 +++- .../ruby-faraday/lib/petstore/models/health_check_result.rb | 4 +++- .../ruby-faraday/lib/petstore/models/inline_object.rb | 4 +++- .../ruby-faraday/lib/petstore/models/inline_object1.rb | 4 +++- .../ruby-faraday/lib/petstore/models/inline_object2.rb | 4 +++- .../ruby-faraday/lib/petstore/models/inline_object3.rb | 4 +++- .../ruby-faraday/lib/petstore/models/inline_object4.rb | 4 +++- .../ruby-faraday/lib/petstore/models/inline_object5.rb | 4 +++- .../lib/petstore/models/inline_response_default.rb | 4 +++- .../client/petstore/ruby-faraday/lib/petstore/models/list.rb | 4 +++- .../petstore/ruby-faraday/lib/petstore/models/map_test.rb | 4 +++- .../mixed_properties_and_additional_properties_class.rb | 4 +++- .../ruby-faraday/lib/petstore/models/model200_response.rb | 4 +++- .../petstore/ruby-faraday/lib/petstore/models/model_return.rb | 4 +++- .../client/petstore/ruby-faraday/lib/petstore/models/name.rb | 4 +++- .../ruby-faraday/lib/petstore/models/nullable_class.rb | 4 +++- .../petstore/ruby-faraday/lib/petstore/models/number_only.rb | 4 +++- .../client/petstore/ruby-faraday/lib/petstore/models/order.rb | 4 +++- .../ruby-faraday/lib/petstore/models/outer_composite.rb | 4 +++- .../client/petstore/ruby-faraday/lib/petstore/models/pet.rb | 4 +++- .../ruby-faraday/lib/petstore/models/read_only_first.rb | 4 +++- .../ruby-faraday/lib/petstore/models/special_model_name.rb | 4 +++- .../client/petstore/ruby-faraday/lib/petstore/models/tag.rb | 4 +++- .../client/petstore/ruby-faraday/lib/petstore/models/user.rb | 4 +++- .../ruby/lib/petstore/models/additional_properties_class.rb | 4 +++- samples/client/petstore/ruby/lib/petstore/models/animal.rb | 4 +++- .../client/petstore/ruby/lib/petstore/models/api_response.rb | 4 +++- .../ruby/lib/petstore/models/array_of_array_of_number_only.rb | 4 +++- .../petstore/ruby/lib/petstore/models/array_of_number_only.rb | 4 +++- .../client/petstore/ruby/lib/petstore/models/array_test.rb | 4 +++- .../petstore/ruby/lib/petstore/models/capitalization.rb | 4 +++- samples/client/petstore/ruby/lib/petstore/models/cat.rb | 4 +++- .../client/petstore/ruby/lib/petstore/models/cat_all_of.rb | 4 +++- samples/client/petstore/ruby/lib/petstore/models/category.rb | 4 +++- .../client/petstore/ruby/lib/petstore/models/class_model.rb | 4 +++- samples/client/petstore/ruby/lib/petstore/models/client.rb | 4 +++- samples/client/petstore/ruby/lib/petstore/models/dog.rb | 4 +++- .../client/petstore/ruby/lib/petstore/models/dog_all_of.rb | 4 +++- .../client/petstore/ruby/lib/petstore/models/enum_arrays.rb | 4 +++- samples/client/petstore/ruby/lib/petstore/models/enum_test.rb | 4 +++- samples/client/petstore/ruby/lib/petstore/models/file.rb | 4 +++- .../ruby/lib/petstore/models/file_schema_test_class.rb | 4 +++- samples/client/petstore/ruby/lib/petstore/models/foo.rb | 4 +++- .../client/petstore/ruby/lib/petstore/models/format_test.rb | 4 +++- .../petstore/ruby/lib/petstore/models/has_only_read_only.rb | 4 +++- .../petstore/ruby/lib/petstore/models/health_check_result.rb | 4 +++- .../client/petstore/ruby/lib/petstore/models/inline_object.rb | 4 +++- .../petstore/ruby/lib/petstore/models/inline_object1.rb | 4 +++- .../petstore/ruby/lib/petstore/models/inline_object2.rb | 4 +++- .../petstore/ruby/lib/petstore/models/inline_object3.rb | 4 +++- .../petstore/ruby/lib/petstore/models/inline_object4.rb | 4 +++- .../petstore/ruby/lib/petstore/models/inline_object5.rb | 4 +++- .../ruby/lib/petstore/models/inline_response_default.rb | 4 +++- samples/client/petstore/ruby/lib/petstore/models/list.rb | 4 +++- samples/client/petstore/ruby/lib/petstore/models/map_test.rb | 4 +++- .../mixed_properties_and_additional_properties_class.rb | 4 +++- .../petstore/ruby/lib/petstore/models/model200_response.rb | 4 +++- .../client/petstore/ruby/lib/petstore/models/model_return.rb | 4 +++- samples/client/petstore/ruby/lib/petstore/models/name.rb | 4 +++- .../petstore/ruby/lib/petstore/models/nullable_class.rb | 4 +++- .../client/petstore/ruby/lib/petstore/models/number_only.rb | 4 +++- samples/client/petstore/ruby/lib/petstore/models/order.rb | 4 +++- .../petstore/ruby/lib/petstore/models/outer_composite.rb | 4 +++- samples/client/petstore/ruby/lib/petstore/models/pet.rb | 4 +++- .../petstore/ruby/lib/petstore/models/read_only_first.rb | 4 +++- .../petstore/ruby/lib/petstore/models/special_model_name.rb | 4 +++- samples/client/petstore/ruby/lib/petstore/models/tag.rb | 4 +++- samples/client/petstore/ruby/lib/petstore/models/user.rb | 4 +++- 89 files changed, 267 insertions(+), 89 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/ruby-client/base_object.mustache b/modules/openapi-generator/src/main/resources/ruby-client/base_object.mustache index cf4a62a99eb2..f6ebfff37915 100644 --- a/modules/openapi-generator/src/main/resources/ruby-client/base_object.mustache +++ b/modules/openapi-generator/src/main/resources/ruby-client/base_object.mustache @@ -22,7 +22,9 @@ end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end end self diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_class.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_class.rb index 2e353ef8e464..907b30a85eda 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_class.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_class.rb @@ -123,7 +123,9 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end end self diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/animal.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/animal.rb index 55b0741b47f5..f0e70723770b 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/animal.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/animal.rb @@ -131,7 +131,9 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end end self diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/api_response.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/api_response.rb index eb3fd03a63cb..4e0353a7c0fc 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/api_response.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/api_response.rb @@ -128,7 +128,9 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end end self diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/array_of_array_of_number_only.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/array_of_array_of_number_only.rb index 1348124c720f..b7436abad64e 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/array_of_array_of_number_only.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/array_of_array_of_number_only.rb @@ -112,7 +112,9 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end end self diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/array_of_number_only.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/array_of_number_only.rb index 8ea8dff8ffaf..49e40ea4d2a1 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/array_of_number_only.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/array_of_number_only.rb @@ -112,7 +112,9 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end end self diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/array_test.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/array_test.rb index 7f3e302da040..4d0b7ccbe6a4 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/array_test.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/array_test.rb @@ -134,7 +134,9 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end end self diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/capitalization.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/capitalization.rb index 6d2a185d4086..c3e42cc34594 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/capitalization.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/capitalization.rb @@ -156,7 +156,9 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end end self diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/cat.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/cat.rb index edc40a27fc3a..7561974beca9 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/cat.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/cat.rb @@ -122,7 +122,9 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end end self diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/cat_all_of.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/cat_all_of.rb index ec0963e95123..85d785dcb85b 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/cat_all_of.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/cat_all_of.rb @@ -110,7 +110,9 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end end self diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/category.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/category.rb index 7a2e43d80871..7fea27bb0127 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/category.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/category.rb @@ -126,7 +126,9 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end end self diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/class_model.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/class_model.rb index c67cb4e2db8a..ec4ebfec1665 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/class_model.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/class_model.rb @@ -111,7 +111,9 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end end self diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/client.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/client.rb index fb11d2a9f046..d399fd798005 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/client.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/client.rb @@ -110,7 +110,9 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end end self diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/dog.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/dog.rb index e463e0dcd1ec..1a934fe57e86 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/dog.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/dog.rb @@ -122,7 +122,9 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end end self diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/dog_all_of.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/dog_all_of.rb index afaf911b6c21..50ee42f907cc 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/dog_all_of.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/dog_all_of.rb @@ -110,7 +110,9 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end end self diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_arrays.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_arrays.rb index de2ea593e9e2..a7574eb550d2 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_arrays.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_arrays.rb @@ -155,7 +155,9 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end end self diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_test.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_test.rb index 473d7994ad6d..93cf0be76bbc 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_test.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_test.rb @@ -249,7 +249,9 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end end self diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/file.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/file.rb index ae55f5eb63e1..748022245bc8 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/file.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/file.rb @@ -112,7 +112,9 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end end self diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/file_schema_test_class.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/file_schema_test_class.rb index 8291d10e6ac5..a417d92f2f29 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/file_schema_test_class.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/file_schema_test_class.rb @@ -121,7 +121,9 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end end self diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/foo.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/foo.rb index 780ef4ae7d53..bd586869942a 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/foo.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/foo.rb @@ -112,7 +112,9 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end end self diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/format_test.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/format_test.rb index d39e9c915806..beb1cdf45f07 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/format_test.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/format_test.rb @@ -461,7 +461,9 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end end self diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/has_only_read_only.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/has_only_read_only.rb index cae8b3bbe70c..e852e3474842 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/has_only_read_only.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/has_only_read_only.rb @@ -119,7 +119,9 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end end self diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/health_check_result.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/health_check_result.rb index 056413a4437b..f1c211ba33f2 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/health_check_result.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/health_check_result.rb @@ -112,7 +112,9 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end end self diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/inline_object.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/inline_object.rb index 7d2ce0e05f39..c21518bef1bd 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/inline_object.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/inline_object.rb @@ -121,7 +121,9 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end end self diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/inline_object1.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/inline_object1.rb index 45a9d5bfcd72..d1260093ec45 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/inline_object1.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/inline_object1.rb @@ -121,7 +121,9 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end end self diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/inline_object2.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/inline_object2.rb index 51784af066b6..ef0b9d20eb6d 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/inline_object2.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/inline_object2.rb @@ -159,7 +159,9 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end end self diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/inline_object3.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/inline_object3.rb index 71fe8bd38a82..5a3cbb638852 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/inline_object3.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/inline_object3.rb @@ -442,7 +442,9 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end end self diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/inline_object4.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/inline_object4.rb index 560e747ce79c..9dac16c49c82 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/inline_object4.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/inline_object4.rb @@ -131,7 +131,9 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end end self diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/inline_object5.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/inline_object5.rb index e75bb452989a..87c6d4c7fcfe 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/inline_object5.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/inline_object5.rb @@ -126,7 +126,9 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end end self diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/inline_response_default.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/inline_response_default.rb index a65f1ee87f46..a451606ee786 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/inline_response_default.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/inline_response_default.rb @@ -110,7 +110,9 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end end self diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/list.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/list.rb index 94873ca4d689..77df8f391ebb 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/list.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/list.rb @@ -110,7 +110,9 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end end self diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/map_test.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/map_test.rb index 65f0020e664c..1d5c6875cbdd 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/map_test.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/map_test.rb @@ -167,7 +167,9 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end end self diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/mixed_properties_and_additional_properties_class.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/mixed_properties_and_additional_properties_class.rb index 3c5cd7349f5f..74e20a063462 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/mixed_properties_and_additional_properties_class.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/mixed_properties_and_additional_properties_class.rb @@ -130,7 +130,9 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end end self diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/model200_response.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/model200_response.rb index 950b8408a093..ce843f3e5647 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/model200_response.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/model200_response.rb @@ -120,7 +120,9 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end end self diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/model_return.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/model_return.rb index a3b89b37c4b8..b0894f91daa9 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/model_return.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/model_return.rb @@ -111,7 +111,9 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end end self diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/name.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/name.rb index 6aaf40c05d5c..937a87d9a400 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/name.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/name.rb @@ -143,7 +143,9 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end end self diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/nullable_class.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/nullable_class.rb index dd0d1c2047e5..2250145bba43 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/nullable_class.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/nullable_class.rb @@ -231,7 +231,9 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end end self diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/number_only.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/number_only.rb index 2e62c4775e1b..337d7bd43bcb 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/number_only.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/number_only.rb @@ -110,7 +110,9 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end end self diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/order.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/order.rb index 5fc1828efeef..bb9c7b4fa152 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/order.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/order.rb @@ -192,7 +192,9 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end end self diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_composite.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_composite.rb index f8b23893297e..cacbd2575559 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_composite.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_composite.rb @@ -128,7 +128,9 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end end self diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/pet.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/pet.rb index 6c67989e4b2e..ae61ebf6feb9 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/pet.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/pet.rb @@ -204,7 +204,9 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end end self diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/read_only_first.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/read_only_first.rb index b8edc7ba8ea5..2e3b1e8ac522 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/read_only_first.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/read_only_first.rb @@ -119,7 +119,9 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end end self diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/special_model_name.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/special_model_name.rb index 5c1be0fd3bea..27ff34c4be81 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/special_model_name.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/special_model_name.rb @@ -110,7 +110,9 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end end self diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/tag.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/tag.rb index 86d8c0aa8c57..f67fcd1399b0 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/tag.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/tag.rb @@ -119,7 +119,9 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end end self diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/user.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/user.rb index 096f5452b0d8..2a6abc392a01 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/user.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/user.rb @@ -174,7 +174,9 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end end self diff --git a/samples/client/petstore/ruby/lib/petstore/models/additional_properties_class.rb b/samples/client/petstore/ruby/lib/petstore/models/additional_properties_class.rb index 2e353ef8e464..907b30a85eda 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/additional_properties_class.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/additional_properties_class.rb @@ -123,7 +123,9 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end end self diff --git a/samples/client/petstore/ruby/lib/petstore/models/animal.rb b/samples/client/petstore/ruby/lib/petstore/models/animal.rb index 55b0741b47f5..f0e70723770b 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/animal.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/animal.rb @@ -131,7 +131,9 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end end self diff --git a/samples/client/petstore/ruby/lib/petstore/models/api_response.rb b/samples/client/petstore/ruby/lib/petstore/models/api_response.rb index eb3fd03a63cb..4e0353a7c0fc 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/api_response.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/api_response.rb @@ -128,7 +128,9 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end end self diff --git a/samples/client/petstore/ruby/lib/petstore/models/array_of_array_of_number_only.rb b/samples/client/petstore/ruby/lib/petstore/models/array_of_array_of_number_only.rb index 1348124c720f..b7436abad64e 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/array_of_array_of_number_only.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/array_of_array_of_number_only.rb @@ -112,7 +112,9 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end end self diff --git a/samples/client/petstore/ruby/lib/petstore/models/array_of_number_only.rb b/samples/client/petstore/ruby/lib/petstore/models/array_of_number_only.rb index 8ea8dff8ffaf..49e40ea4d2a1 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/array_of_number_only.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/array_of_number_only.rb @@ -112,7 +112,9 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end end self diff --git a/samples/client/petstore/ruby/lib/petstore/models/array_test.rb b/samples/client/petstore/ruby/lib/petstore/models/array_test.rb index 7f3e302da040..4d0b7ccbe6a4 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/array_test.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/array_test.rb @@ -134,7 +134,9 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end end self diff --git a/samples/client/petstore/ruby/lib/petstore/models/capitalization.rb b/samples/client/petstore/ruby/lib/petstore/models/capitalization.rb index 6d2a185d4086..c3e42cc34594 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/capitalization.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/capitalization.rb @@ -156,7 +156,9 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end end self diff --git a/samples/client/petstore/ruby/lib/petstore/models/cat.rb b/samples/client/petstore/ruby/lib/petstore/models/cat.rb index edc40a27fc3a..7561974beca9 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/cat.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/cat.rb @@ -122,7 +122,9 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end end self diff --git a/samples/client/petstore/ruby/lib/petstore/models/cat_all_of.rb b/samples/client/petstore/ruby/lib/petstore/models/cat_all_of.rb index ec0963e95123..85d785dcb85b 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/cat_all_of.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/cat_all_of.rb @@ -110,7 +110,9 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end end self diff --git a/samples/client/petstore/ruby/lib/petstore/models/category.rb b/samples/client/petstore/ruby/lib/petstore/models/category.rb index 7a2e43d80871..7fea27bb0127 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/category.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/category.rb @@ -126,7 +126,9 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end end self diff --git a/samples/client/petstore/ruby/lib/petstore/models/class_model.rb b/samples/client/petstore/ruby/lib/petstore/models/class_model.rb index c67cb4e2db8a..ec4ebfec1665 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/class_model.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/class_model.rb @@ -111,7 +111,9 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end end self diff --git a/samples/client/petstore/ruby/lib/petstore/models/client.rb b/samples/client/petstore/ruby/lib/petstore/models/client.rb index fb11d2a9f046..d399fd798005 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/client.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/client.rb @@ -110,7 +110,9 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end end self diff --git a/samples/client/petstore/ruby/lib/petstore/models/dog.rb b/samples/client/petstore/ruby/lib/petstore/models/dog.rb index e463e0dcd1ec..1a934fe57e86 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/dog.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/dog.rb @@ -122,7 +122,9 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end end self diff --git a/samples/client/petstore/ruby/lib/petstore/models/dog_all_of.rb b/samples/client/petstore/ruby/lib/petstore/models/dog_all_of.rb index afaf911b6c21..50ee42f907cc 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/dog_all_of.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/dog_all_of.rb @@ -110,7 +110,9 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end end self diff --git a/samples/client/petstore/ruby/lib/petstore/models/enum_arrays.rb b/samples/client/petstore/ruby/lib/petstore/models/enum_arrays.rb index de2ea593e9e2..a7574eb550d2 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/enum_arrays.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/enum_arrays.rb @@ -155,7 +155,9 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end end self diff --git a/samples/client/petstore/ruby/lib/petstore/models/enum_test.rb b/samples/client/petstore/ruby/lib/petstore/models/enum_test.rb index 473d7994ad6d..93cf0be76bbc 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/enum_test.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/enum_test.rb @@ -249,7 +249,9 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end end self diff --git a/samples/client/petstore/ruby/lib/petstore/models/file.rb b/samples/client/petstore/ruby/lib/petstore/models/file.rb index ae55f5eb63e1..748022245bc8 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/file.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/file.rb @@ -112,7 +112,9 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end end self diff --git a/samples/client/petstore/ruby/lib/petstore/models/file_schema_test_class.rb b/samples/client/petstore/ruby/lib/petstore/models/file_schema_test_class.rb index 8291d10e6ac5..a417d92f2f29 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/file_schema_test_class.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/file_schema_test_class.rb @@ -121,7 +121,9 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end end self diff --git a/samples/client/petstore/ruby/lib/petstore/models/foo.rb b/samples/client/petstore/ruby/lib/petstore/models/foo.rb index 780ef4ae7d53..bd586869942a 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/foo.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/foo.rb @@ -112,7 +112,9 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end end self diff --git a/samples/client/petstore/ruby/lib/petstore/models/format_test.rb b/samples/client/petstore/ruby/lib/petstore/models/format_test.rb index d39e9c915806..beb1cdf45f07 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/format_test.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/format_test.rb @@ -461,7 +461,9 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end end self diff --git a/samples/client/petstore/ruby/lib/petstore/models/has_only_read_only.rb b/samples/client/petstore/ruby/lib/petstore/models/has_only_read_only.rb index cae8b3bbe70c..e852e3474842 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/has_only_read_only.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/has_only_read_only.rb @@ -119,7 +119,9 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end end self diff --git a/samples/client/petstore/ruby/lib/petstore/models/health_check_result.rb b/samples/client/petstore/ruby/lib/petstore/models/health_check_result.rb index 056413a4437b..f1c211ba33f2 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/health_check_result.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/health_check_result.rb @@ -112,7 +112,9 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end end self diff --git a/samples/client/petstore/ruby/lib/petstore/models/inline_object.rb b/samples/client/petstore/ruby/lib/petstore/models/inline_object.rb index 7d2ce0e05f39..c21518bef1bd 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/inline_object.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/inline_object.rb @@ -121,7 +121,9 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end end self diff --git a/samples/client/petstore/ruby/lib/petstore/models/inline_object1.rb b/samples/client/petstore/ruby/lib/petstore/models/inline_object1.rb index 45a9d5bfcd72..d1260093ec45 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/inline_object1.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/inline_object1.rb @@ -121,7 +121,9 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end end self diff --git a/samples/client/petstore/ruby/lib/petstore/models/inline_object2.rb b/samples/client/petstore/ruby/lib/petstore/models/inline_object2.rb index 51784af066b6..ef0b9d20eb6d 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/inline_object2.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/inline_object2.rb @@ -159,7 +159,9 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end end self diff --git a/samples/client/petstore/ruby/lib/petstore/models/inline_object3.rb b/samples/client/petstore/ruby/lib/petstore/models/inline_object3.rb index 71fe8bd38a82..5a3cbb638852 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/inline_object3.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/inline_object3.rb @@ -442,7 +442,9 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end end self diff --git a/samples/client/petstore/ruby/lib/petstore/models/inline_object4.rb b/samples/client/petstore/ruby/lib/petstore/models/inline_object4.rb index 560e747ce79c..9dac16c49c82 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/inline_object4.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/inline_object4.rb @@ -131,7 +131,9 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end end self diff --git a/samples/client/petstore/ruby/lib/petstore/models/inline_object5.rb b/samples/client/petstore/ruby/lib/petstore/models/inline_object5.rb index e75bb452989a..87c6d4c7fcfe 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/inline_object5.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/inline_object5.rb @@ -126,7 +126,9 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end end self diff --git a/samples/client/petstore/ruby/lib/petstore/models/inline_response_default.rb b/samples/client/petstore/ruby/lib/petstore/models/inline_response_default.rb index a65f1ee87f46..a451606ee786 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/inline_response_default.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/inline_response_default.rb @@ -110,7 +110,9 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end end self diff --git a/samples/client/petstore/ruby/lib/petstore/models/list.rb b/samples/client/petstore/ruby/lib/petstore/models/list.rb index 94873ca4d689..77df8f391ebb 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/list.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/list.rb @@ -110,7 +110,9 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end end self diff --git a/samples/client/petstore/ruby/lib/petstore/models/map_test.rb b/samples/client/petstore/ruby/lib/petstore/models/map_test.rb index 65f0020e664c..1d5c6875cbdd 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/map_test.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/map_test.rb @@ -167,7 +167,9 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end end self diff --git a/samples/client/petstore/ruby/lib/petstore/models/mixed_properties_and_additional_properties_class.rb b/samples/client/petstore/ruby/lib/petstore/models/mixed_properties_and_additional_properties_class.rb index 3c5cd7349f5f..74e20a063462 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/mixed_properties_and_additional_properties_class.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/mixed_properties_and_additional_properties_class.rb @@ -130,7 +130,9 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end end self diff --git a/samples/client/petstore/ruby/lib/petstore/models/model200_response.rb b/samples/client/petstore/ruby/lib/petstore/models/model200_response.rb index 950b8408a093..ce843f3e5647 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/model200_response.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/model200_response.rb @@ -120,7 +120,9 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end end self diff --git a/samples/client/petstore/ruby/lib/petstore/models/model_return.rb b/samples/client/petstore/ruby/lib/petstore/models/model_return.rb index a3b89b37c4b8..b0894f91daa9 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/model_return.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/model_return.rb @@ -111,7 +111,9 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end end self diff --git a/samples/client/petstore/ruby/lib/petstore/models/name.rb b/samples/client/petstore/ruby/lib/petstore/models/name.rb index 6aaf40c05d5c..937a87d9a400 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/name.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/name.rb @@ -143,7 +143,9 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end end self diff --git a/samples/client/petstore/ruby/lib/petstore/models/nullable_class.rb b/samples/client/petstore/ruby/lib/petstore/models/nullable_class.rb index dd0d1c2047e5..2250145bba43 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/nullable_class.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/nullable_class.rb @@ -231,7 +231,9 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end end self diff --git a/samples/client/petstore/ruby/lib/petstore/models/number_only.rb b/samples/client/petstore/ruby/lib/petstore/models/number_only.rb index 2e62c4775e1b..337d7bd43bcb 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/number_only.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/number_only.rb @@ -110,7 +110,9 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end end self diff --git a/samples/client/petstore/ruby/lib/petstore/models/order.rb b/samples/client/petstore/ruby/lib/petstore/models/order.rb index 5fc1828efeef..bb9c7b4fa152 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/order.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/order.rb @@ -192,7 +192,9 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end end self diff --git a/samples/client/petstore/ruby/lib/petstore/models/outer_composite.rb b/samples/client/petstore/ruby/lib/petstore/models/outer_composite.rb index f8b23893297e..cacbd2575559 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/outer_composite.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/outer_composite.rb @@ -128,7 +128,9 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end end self diff --git a/samples/client/petstore/ruby/lib/petstore/models/pet.rb b/samples/client/petstore/ruby/lib/petstore/models/pet.rb index 6c67989e4b2e..ae61ebf6feb9 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/pet.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/pet.rb @@ -204,7 +204,9 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end end self diff --git a/samples/client/petstore/ruby/lib/petstore/models/read_only_first.rb b/samples/client/petstore/ruby/lib/petstore/models/read_only_first.rb index b8edc7ba8ea5..2e3b1e8ac522 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/read_only_first.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/read_only_first.rb @@ -119,7 +119,9 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end end self diff --git a/samples/client/petstore/ruby/lib/petstore/models/special_model_name.rb b/samples/client/petstore/ruby/lib/petstore/models/special_model_name.rb index 5c1be0fd3bea..27ff34c4be81 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/special_model_name.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/special_model_name.rb @@ -110,7 +110,9 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end end self diff --git a/samples/client/petstore/ruby/lib/petstore/models/tag.rb b/samples/client/petstore/ruby/lib/petstore/models/tag.rb index 86d8c0aa8c57..f67fcd1399b0 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/tag.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/tag.rb @@ -119,7 +119,9 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end end self diff --git a/samples/client/petstore/ruby/lib/petstore/models/user.rb b/samples/client/petstore/ruby/lib/petstore/models/user.rb index 096f5452b0d8..2a6abc392a01 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/user.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/user.rb @@ -174,7 +174,9 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + end end self From 8cd52033e44bfd74077ce8152452c927601a4ea2 Mon Sep 17 00:00:00 2001 From: bgong-mdsol Date: Fri, 17 Jul 2020 03:30:02 -0400 Subject: [PATCH 026/129] [Java][Native] added WithHttpInfo method for async-native (#6903) * [java-asyncNative] add withHttpInfo * update api template for async-native --- .../codegen/languages/JavaClientCodegen.java | 4 +- .../Java/libraries/native/README.mustache | 16 +- .../Java/libraries/native/api.mustache | 99 +- .../Java/libraries/native/api_doc.mustache | 45 +- .../codegen/java/JavaClientCodegenTest.java | 2 +- .../native-async/.openapi-generator/FILES | 1 + .../petstore/java/native-async/README.md | 39 +- .../java/native-async/docs/AnotherFakeApi.md | 80 +- .../java/native-async/docs/FakeApi.md | 1479 +++++++++++++++-- .../docs/FakeClassnameTags123Api.md | 87 +- .../petstore/java/native-async/docs/PetApi.md | 992 +++++++++-- .../java/native-async/docs/StoreApi.md | 322 +++- .../java/native-async/docs/UserApi.md | 617 ++++++- .../org/openapitools/client/ApiResponse.java | 59 + .../client/api/AnotherFakeApi.java | 71 +- .../org/openapitools/client/api/FakeApi.java | 767 +++++++-- .../client/api/FakeClassnameTags123Api.java | 71 +- .../org/openapitools/client/api/PetApi.java | 508 ++++-- .../org/openapitools/client/api/StoreApi.java | 240 ++- .../org/openapitools/client/api/UserApi.java | 399 +++-- samples/client/petstore/java/native/README.md | 37 + .../java/native/docs/AnotherFakeApi.md | 9 +- .../petstore/java/native/docs/FakeApi.md | 107 +- .../native/docs/FakeClassnameTags123Api.md | 9 +- .../petstore/java/native/docs/PetApi.md | 73 +- .../petstore/java/native/docs/StoreApi.md | 34 +- .../petstore/java/native/docs/UserApi.md | 60 +- 27 files changed, 5169 insertions(+), 1058 deletions(-) create mode 100644 samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/ApiResponse.java diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java index b733ffbe7204..47d80cf10bb5 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java @@ -392,9 +392,7 @@ public void processOpts() { } else if (NATIVE.equals(getLibrary())) { setJava8Mode(true); additionalProperties.put("java8", "true"); - if (!asyncNative) { - supportingFiles.add(new SupportingFile("ApiResponse.mustache", invokerFolder, "ApiResponse.java")); - } + supportingFiles.add(new SupportingFile("ApiResponse.mustache", invokerFolder, "ApiResponse.java")); forceSerializationLibrary(SERIALIZATION_LIBRARY_JACKSON); } else if (RESTEASY.equals(getLibrary())) { supportingFiles.add(new SupportingFile("JSON.mustache", invokerFolder, "JSON.java")); diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/native/README.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/native/README.mustache index 7257a26f95f9..669249855077 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/native/README.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/native/README.mustache @@ -99,12 +99,19 @@ public class {{{classname}}}Example { {{/allParams}} try { {{^vendorExtensions.x-group-parameters}} - {{#returnType}}{{#asyncNative}}CompletableFuture<{{{returnType}}}>{{/asyncNative}}{{^asyncNative}}{{{returnType}}}{{/asyncNative}} result = {{/returnType}}{{^returnType}}{{#asyncNative}}CompletableFuture result = {{/asyncNative}}{{/returnType}}apiInstance.{{{operationId}}}({{#allParams}}{{{paramName}}}{{#hasMore}}, {{/hasMore}}{{/allParams}});{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}{{#hasParams}} + {{#returnType}}{{#asyncNative}}CompletableFuture<{{{returnType}}}>{{/asyncNative}}{{^asyncNative}}{{{returnType}}}{{/asyncNative}} result = {{/returnType}}{{^returnType}}{{#asyncNative}}CompletableFuture result = {{/asyncNative}}{{/returnType}}apiInstance.{{{operationId}}}({{#allParams}}{{{paramName}}}{{#hasMore}}, {{/hasMore}}{{/allParams}}); + {{/vendorExtensions.x-group-parameters}} + {{#vendorExtensions.x-group-parameters}} + {{#hasParams}} API{{operationId}}Request request = API{{operationId}}Request.newBuilder(){{#allParams}} .{{paramName}}({{paramName}}){{/allParams}} - .build();{{/hasParams}} - {{#returnType}}{{#asyncNative}}CompletableFuture<{{{returnType}}}>{{/asyncNative}}{{^asyncNative}}{{{returnType}}}{{/asyncNative}} result = {{/returnType}}{{^returnType}}{{#asyncNative}}CompletableFuture result = {{/asyncNative}}{{/returnType}}apiInstance.{{operationId}}({{#hasParams}}request{{/hasParams}});{{/vendorExtensions.x-group-parameters}}{{#returnType}} - System.out.println(result);{{/returnType}} + .build(); + {{/hasParams}} + {{#returnType}}{{#asyncNative}}CompletableFuture<{{{returnType}}}>{{/asyncNative}}{{^asyncNative}}{{{returnType}}}{{/asyncNative}} result = {{/returnType}}{{^returnType}}{{#asyncNative}}CompletableFuture result = {{/asyncNative}}{{/returnType}}apiInstance.{{operationId}}({{#hasParams}}request{{/hasParams}}); + {{/vendorExtensions.x-group-parameters}} + {{#returnType}} + System.out.println(result{{#asyncNative}}.get(){{/asyncNative}}); + {{/returnType}} } catch (ApiException e) { System.err.println("Exception when calling {{{classname}}}#{{{operationId}}}"); System.err.println("Status code: " + e.getCode()); @@ -124,6 +131,7 @@ All URIs are relative to *{{basePath}}* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- {{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}} +*{{classname}}* | [**{{operationId}}WithHttpInfo**]({{apiDocPath}}{{classname}}.md#{{operationId}}WithHttpInfo) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}} {{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} ## Documentation for Models diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/native/api.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/native/api.mustache index 1fca38643964..d524d312f22f 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/native/api.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/native/api.mustache @@ -3,9 +3,7 @@ package {{package}}; import {{invokerPackage}}.ApiClient; import {{invokerPackage}}.ApiException; -{{^asyncNative}} import {{invokerPackage}}.ApiResponse; -{{/asyncNative}} import {{invokerPackage}}.Pair; {{#imports}} @@ -57,6 +55,15 @@ public class {{classname}} { memberVarReadTimeout = apiClient.getReadTimeout(); memberVarResponseInterceptor = apiClient.getResponseInterceptor(); } + {{#asyncNative}} + + private ApiException getApiException(String operationId, HttpResponselocalVarResponse) { + return new ApiException(localVarResponse.statusCode(), + operationId + " call received non-success response", + localVarResponse.headers(), + localVarResponse.body()); + } + {{/asyncNative}} {{#operation}} {{#vendorExtensions.x-group-parameters}} @@ -66,7 +73,7 @@ public class {{classname}} { * {{notes}} * @param {{operationId}}Request {@link API{{operationId}}Request} {{#returnType}} - * @return {{returnType}} + * @return {{#asyncNative}}CompletableFuture<{{/asyncNative}}{{returnType}}{{#asyncNative}}>{{/asyncNative}} {{/returnType}} * @throws ApiException if fails to make API call {{#isDeprecated}} @@ -86,13 +93,12 @@ public class {{classname}} { {{/allParams}} {{#returnType}}return {{/returnType}}{{^returnType}}{{#asyncNative}}return {{/asyncNative}}{{/returnType}}{{operationId}}({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}); } - {{^asyncNative}} /** * {{summary}} * {{notes}} * @param {{operationId}}Request {@link API{{operationId}}Request} - * @return ApiResponse<{{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}Void{{/returnType}}> + * @return {{#asyncNative}}CompletableFuture<{{/asyncNative}}ApiResponse<{{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}Void{{/returnType}}>{{#asyncNative}}>{{/asyncNative}} * @throws ApiException if fails to make API call {{#isDeprecated}} * @deprecated @@ -105,13 +111,12 @@ public class {{classname}} { {{#isDeprecated}} @Deprecated {{/isDeprecated}} - public ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> {{operationId}}WithHttpInfo(API{{operationId}}Request {{operationId}}Request) throws ApiException { + public {{#asyncNative}}CompletableFuture<{{/asyncNative}}ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}>{{#asyncNative}}>{{/asyncNative}} {{operationId}}WithHttpInfo(API{{operationId}}Request {{operationId}}Request) throws ApiException { {{#allParams}} {{{dataType}}} {{paramName}} = {{operationId}}Request.{{paramName}}(); {{/allParams}} return {{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}); } - {{/asyncNative}} {{/hasParams}} {{/vendorExtensions.x-group-parameters}} @@ -122,7 +127,7 @@ public class {{classname}} { * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{^isContainer}}{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/isContainer}}{{/required}} {{/allParams}} {{#returnType}} - * @return {{returnType}} + * @return {{#asyncNative}}CompletableFuture<{{/asyncNative}}{{returnType}}{{#asyncNative}}>{{/asyncNative}} {{/returnType}} * @throws ApiException if fails to make API call {{#isDeprecated}} @@ -147,28 +152,23 @@ public class {{classname}} { try { HttpRequest.Builder localVarRequestBuilder = {{operationId}}RequestBuilder({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}); return memberVarHttpClient.sendAsync( - localVarRequestBuilder.build(), - HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { - if (localVarResponse.statusCode()/ 100 != 2) { - return CompletableFuture.failedFuture(new ApiException(localVarResponse.statusCode(), - "{{operationId}} call received non-success response", - localVarResponse.headers(), - localVarResponse.body()) + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("{{operationId}}", localVarResponse)); + } + {{#returnType}} + try { + return CompletableFuture.completedFuture( + memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference<{{{returnType}}}>() {}) ); - } else { - {{#returnType}} - try { - return CompletableFuture.completedFuture( - memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference<{{{returnType}}}>() {}) - ); - } catch (IOException e) { - return CompletableFuture.failedFuture(new ApiException(e)); - } - {{/returnType}} - {{^returnType}} - return CompletableFuture.completedFuture(null); - {{/returnType}} - } + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + {{/returnType}} + {{^returnType}} + return CompletableFuture.completedFuture(null); + {{/returnType}} }); } catch (ApiException e) { @@ -176,7 +176,6 @@ public class {{classname}} { } {{/asyncNative}} } - {{^asyncNative}} /** * {{summary}} @@ -184,7 +183,7 @@ public class {{classname}} { {{#allParams}} * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{^isContainer}}{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/isContainer}}{{/required}} {{/allParams}} - * @return ApiResponse<{{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}Void{{/returnType}}> + * @return {{#asyncNative}}CompletableFuture<{{/asyncNative}}ApiResponse<{{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}Void{{/returnType}}>{{#asyncNative}}>{{/asyncNative}} * @throws ApiException if fails to make API call {{#isDeprecated}} * @deprecated @@ -197,7 +196,8 @@ public class {{classname}} { {{#isDeprecated}} @Deprecated {{/isDeprecated}} - public ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) throws ApiException { + public {{#asyncNative}}CompletableFuture<{{/asyncNative}}ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}>{{#asyncNative}}>{{/asyncNative}} {{operationId}}WithHttpInfo({{#allParams}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) throws ApiException { + {{^asyncNative}} HttpRequest.Builder localVarRequestBuilder = {{operationId}}RequestBuilder({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}); try { HttpResponse localVarResponse = memberVarHttpClient.send( @@ -224,8 +224,41 @@ public class {{classname}} { Thread.currentThread().interrupt(); throw new ApiException(e); } + {{/asyncNative}} + {{#asyncNative}} + try { + HttpRequest.Builder localVarRequestBuilder = {{operationId}}RequestBuilder({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}); + return memberVarHttpClient.sendAsync( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("{{operationId}}", localVarResponse)); + } + {{#returnType}} + try { + return CompletableFuture.completedFuture( + new ApiResponse<{{{returnType}}}>( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference<{{{returnType}}}>() {})) + ); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + {{/returnType}} + {{^returnType}} + return CompletableFuture.completedFuture( + new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null) + ); + {{/returnType}} + } + ); + } + catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + {{/asyncNative}} } - {{/asyncNative}} private HttpRequest.Builder {{operationId}}RequestBuilder({{#allParams}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) throws ApiException { {{#allParams}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/native/api_doc.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/native/api_doc.mustache index ff699f921e67..603f7886480b 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/native/api_doc.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/native/api_doc.mustache @@ -7,9 +7,7 @@ All URIs are relative to *{{basePath}}* Method | HTTP request | Description ------------- | ------------- | ------------- {{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}} -{{^asyncNative}} -[**{{operationId}}WithHttpInfo**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}} -{{/asyncNative}} +[**{{operationId}}WithHttpInfo**]({{classname}}.md#{{operationId}}WithHttpInfo) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}} {{/operation}}{{/operations}} {{#operations}} @@ -81,8 +79,11 @@ public class Example { .{{paramName}}({{paramName}}){{/allParams}} .build(); {{/hasParams}} - {{#returnType}}{{#asyncNative}}CompletableFuture<{{{returnType}}}>{{/asyncNative}}{{^asyncNative}}{{{returnType}}}{{/asyncNative}} result = {{/returnType}}{{^returnType}}{{#asyncNative}}CompletableFuture result = {{/asyncNative}}{{/returnType}}apiInstance.{{operationId}}({{#hasParams}}request{{/hasParams}});{{/vendorExtensions.x-group-parameters}}{{#returnType}} - System.out.println(result);{{/returnType}} + {{#returnType}}{{#asyncNative}}CompletableFuture<{{{returnType}}}>{{/asyncNative}}{{^asyncNative}}{{{returnType}}}{{/asyncNative}} result = {{/returnType}}{{^returnType}}{{#asyncNative}}CompletableFuture result = {{/asyncNative}}{{/returnType}}apiInstance.{{operationId}}({{#hasParams}}request{{/hasParams}}); + {{/vendorExtensions.x-group-parameters}} + {{#returnType}} + System.out.println(result{{#asyncNative}}.get(){{/asyncNative}}); + {{/returnType}} } catch (ApiException e) { System.err.println("Exception when calling {{{classname}}}#{{{operationId}}}"); System.err.println("Status code: " + e.getCode()); @@ -131,15 +132,14 @@ Name | Type | Description | Notes | **{{code}}** | {{message}} | {{#headers}} * {{baseName}} - {{description}}
{{/headers}}{{^headers.0}} - {{/headers.0}} | {{/responses}} {{/responses.0}} -{{^asyncNative}} ## {{operationId}}WithHttpInfo {{^vendorExtensions.x-group-parameters}} -> ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> {{operationId}} {{operationId}}WithHttpInfo({{#allParams}}{{{paramName}}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) +> {{#asyncNative}}CompletableFuture<{{/asyncNative}}ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}>{{#asyncNative}}>{{/asyncNative}} {{operationId}} {{operationId}}WithHttpInfo({{#allParams}}{{{paramName}}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) {{/vendorExtensions.x-group-parameters}} {{#vendorExtensions.x-group-parameters}} -> ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> {{operationId}} {{operationId}}WithHttpInfo({{#hasParams}}{{operationId}}Request{{/hasParams}}) +> {{#asyncNative}}CompletableFuture<{{/asyncNative}}ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}>{{#asyncNative}}>{{/asyncNative}} {{operationId}} {{operationId}}WithHttpInfo({{#hasParams}}{{operationId}}Request{{/hasParams}}) {{/vendorExtensions.x-group-parameters}} {{summary}}{{#notes}} @@ -158,6 +158,9 @@ import {{{invokerPackage}}}.auth.*;{{/hasAuthMethods}} import {{{invokerPackage}}}.models.*; import {{{package}}}.{{{classname}}};{{#vendorExtensions.x-group-parameters}} import {{{package}}}.{{{classname}}}.*;{{/vendorExtensions.x-group-parameters}} +{{#asyncNative}} +import java.util.concurrent.CompletableFuture; +{{/asyncNative}} public class Example { public static void main(String[] args) { @@ -189,7 +192,7 @@ public class Example { {{/allParams}} try { {{^vendorExtensions.x-group-parameters}} - ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> response = apiInstance.{{{operationId}}}WithHttpInfo({{#allParams}}{{{paramName}}}{{#hasMore}}, {{/hasMore}}{{/allParams}}); + {{#asyncNative}}CompletableFuture<{{/asyncNative}}ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}>{{#asyncNative}}>{{/asyncNative}} response = apiInstance.{{{operationId}}}WithHttpInfo({{#allParams}}{{{paramName}}}{{#hasMore}}, {{/hasMore}}{{/allParams}}); {{/vendorExtensions.x-group-parameters}} {{#vendorExtensions.x-group-parameters}} {{#hasParams}} @@ -197,18 +200,27 @@ public class Example { .{{paramName}}({{paramName}}){{/allParams}} .build(); {{/hasParams}} - ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> response = apiInstance.{{{operationId}}}WithHttpInfo({{#hasParams}}request{{/hasParams}}); + {{#asyncNative}}CompletableFuture<{{/asyncNative}}ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}>{{#asyncNative}}>{{/asyncNative}} response = apiInstance.{{{operationId}}}WithHttpInfo({{#hasParams}}request{{/hasParams}}); {{/vendorExtensions.x-group-parameters}} - System.out.println("Status code: " + response.getStatusCode()); - System.out.println("Response headers: " + response.getHeaders().toString()); + System.out.println("Status code: " + response{{#asyncNative}}.get(){{/asyncNative}}.getStatusCode()); + System.out.println("Response headers: " + response{{#asyncNative}}.get(){{/asyncNative}}.getHeaders()); {{#returnType}} - System.out.println("Response body: " + response.getData().toString()); + System.out.println("Response body: " + response{{#asyncNative}}.get(){{/asyncNative}}.getData()); {{/returnType}} + {{#asyncNative}} + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling {{{classname}}}#{{{operationId}}}"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + {{/asyncNative}} } catch (ApiException e) { System.err.println("Exception when calling {{{classname}}}#{{{operationId}}}"); System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); e.printStackTrace(); } } @@ -232,8 +244,8 @@ Name | Type | Description | Notes ### Return type -{{#returnType}}ApiResponse<{{#returnTypeIsPrimitive}}**{{returnType}}**{{/returnTypeIsPrimitive}}{{^returnTypeIsPrimitive}}[**{{returnType}}**]({{returnBaseType}}.md){{/returnTypeIsPrimitive}}>{{/returnType}} -{{^returnType}}ApiResponse{{/returnType}} +{{#returnType}}{{#asyncNative}}CompletableFuture<{{/asyncNative}}ApiResponse<{{#returnTypeIsPrimitive}}**{{returnType}}**{{/returnTypeIsPrimitive}}{{^returnTypeIsPrimitive}}[**{{returnType}}**]({{returnBaseType}}.md){{/returnTypeIsPrimitive}}>{{#asyncNative}}>{{/asyncNative}}{{/returnType}} +{{^returnType}}{{#asyncNative}}CompletableFuture<{{/asyncNative}}ApiResponse{{#asyncNative}}>{{/asyncNative}}{{/returnType}} ### Authorization @@ -252,7 +264,6 @@ Name | Type | Description | Notes | **{{code}}** | {{message}} | {{#headers}} * {{baseName}} - {{description}}
{{/headers}}{{^headers.0}} - {{/headers.0}} | {{/responses}} {{/responses.0}} -{{/asyncNative}} {{#vendorExtensions.x-group-parameters}}{{#hasParams}} diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaClientCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaClientCodegenTest.java index 6d61c93b3efc..69ead62d1418 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaClientCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaClientCodegenTest.java @@ -445,7 +445,7 @@ public void testJdkHttpAsyncClient() throws Exception { DefaultGenerator generator = new DefaultGenerator(); List files = generator.opts(clientOptInput).generate(); - Assert.assertEquals(files.size(), 30); + Assert.assertEquals(files.size(), 31); validateJavaSourceFiles(files); Path defaultApi = Paths.get(output + "/src/main/java/xyz/abcdef/api/PingApi.java"); diff --git a/samples/client/petstore/java/native-async/.openapi-generator/FILES b/samples/client/petstore/java/native-async/.openapi-generator/FILES index 48923dfacbed..cb10aec6dd80 100644 --- a/samples/client/petstore/java/native-async/.openapi-generator/FILES +++ b/samples/client/petstore/java/native-async/.openapi-generator/FILES @@ -67,6 +67,7 @@ settings.gradle src/main/AndroidManifest.xml src/main/java/org/openapitools/client/ApiClient.java src/main/java/org/openapitools/client/ApiException.java +src/main/java/org/openapitools/client/ApiResponse.java src/main/java/org/openapitools/client/Configuration.java src/main/java/org/openapitools/client/Pair.java src/main/java/org/openapitools/client/ServerConfiguration.java diff --git a/samples/client/petstore/java/native-async/README.md b/samples/client/petstore/java/native-async/README.md index d23c4a03f6b2..7442f818ad7b 100644 --- a/samples/client/petstore/java/native-async/README.md +++ b/samples/client/petstore/java/native-async/README.md @@ -87,7 +87,7 @@ public class AnotherFakeApiExample { Client body = new Client(); // Client | client model try { CompletableFuture result = apiInstance.call123testSpecialTags(body); - System.out.println(result); + System.out.println(result.get()); } catch (ApiException e) { System.err.println("Exception when calling AnotherFakeApi#call123testSpecialTags"); System.err.println("Status code: " + e.getCode()); @@ -107,42 +107,79 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- *AnotherFakeApi* | [**call123testSpecialTags**](docs/AnotherFakeApi.md#call123testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags +*AnotherFakeApi* | [**call123testSpecialTagsWithHttpInfo**](docs/AnotherFakeApi.md#call123testSpecialTagsWithHttpInfo) | **PATCH** /another-fake/dummy | To test special tags *FakeApi* | [**createXmlItem**](docs/FakeApi.md#createXmlItem) | **POST** /fake/create_xml_item | creates an XmlItem +*FakeApi* | [**createXmlItemWithHttpInfo**](docs/FakeApi.md#createXmlItemWithHttpInfo) | **POST** /fake/create_xml_item | creates an XmlItem *FakeApi* | [**fakeOuterBooleanSerialize**](docs/FakeApi.md#fakeOuterBooleanSerialize) | **POST** /fake/outer/boolean | +*FakeApi* | [**fakeOuterBooleanSerializeWithHttpInfo**](docs/FakeApi.md#fakeOuterBooleanSerializeWithHttpInfo) | **POST** /fake/outer/boolean | *FakeApi* | [**fakeOuterCompositeSerialize**](docs/FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite | +*FakeApi* | [**fakeOuterCompositeSerializeWithHttpInfo**](docs/FakeApi.md#fakeOuterCompositeSerializeWithHttpInfo) | **POST** /fake/outer/composite | *FakeApi* | [**fakeOuterNumberSerialize**](docs/FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number | +*FakeApi* | [**fakeOuterNumberSerializeWithHttpInfo**](docs/FakeApi.md#fakeOuterNumberSerializeWithHttpInfo) | **POST** /fake/outer/number | *FakeApi* | [**fakeOuterStringSerialize**](docs/FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string | +*FakeApi* | [**fakeOuterStringSerializeWithHttpInfo**](docs/FakeApi.md#fakeOuterStringSerializeWithHttpInfo) | **POST** /fake/outer/string | *FakeApi* | [**testBodyWithFileSchema**](docs/FakeApi.md#testBodyWithFileSchema) | **PUT** /fake/body-with-file-schema | +*FakeApi* | [**testBodyWithFileSchemaWithHttpInfo**](docs/FakeApi.md#testBodyWithFileSchemaWithHttpInfo) | **PUT** /fake/body-with-file-schema | *FakeApi* | [**testBodyWithQueryParams**](docs/FakeApi.md#testBodyWithQueryParams) | **PUT** /fake/body-with-query-params | +*FakeApi* | [**testBodyWithQueryParamsWithHttpInfo**](docs/FakeApi.md#testBodyWithQueryParamsWithHttpInfo) | **PUT** /fake/body-with-query-params | *FakeApi* | [**testClientModel**](docs/FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model +*FakeApi* | [**testClientModelWithHttpInfo**](docs/FakeApi.md#testClientModelWithHttpInfo) | **PATCH** /fake | To test \"client\" model *FakeApi* | [**testEndpointParameters**](docs/FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +*FakeApi* | [**testEndpointParametersWithHttpInfo**](docs/FakeApi.md#testEndpointParametersWithHttpInfo) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 *FakeApi* | [**testEnumParameters**](docs/FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters +*FakeApi* | [**testEnumParametersWithHttpInfo**](docs/FakeApi.md#testEnumParametersWithHttpInfo) | **GET** /fake | To test enum parameters *FakeApi* | [**testGroupParameters**](docs/FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) +*FakeApi* | [**testGroupParametersWithHttpInfo**](docs/FakeApi.md#testGroupParametersWithHttpInfo) | **DELETE** /fake | Fake endpoint to test group parameters (optional) *FakeApi* | [**testInlineAdditionalProperties**](docs/FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties +*FakeApi* | [**testInlineAdditionalPropertiesWithHttpInfo**](docs/FakeApi.md#testInlineAdditionalPropertiesWithHttpInfo) | **POST** /fake/inline-additionalProperties | test inline additionalProperties *FakeApi* | [**testJsonFormData**](docs/FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data +*FakeApi* | [**testJsonFormDataWithHttpInfo**](docs/FakeApi.md#testJsonFormDataWithHttpInfo) | **GET** /fake/jsonFormData | test json serialization of form data *FakeApi* | [**testQueryParameterCollectionFormat**](docs/FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-paramters | +*FakeApi* | [**testQueryParameterCollectionFormatWithHttpInfo**](docs/FakeApi.md#testQueryParameterCollectionFormatWithHttpInfo) | **PUT** /fake/test-query-paramters | *FakeClassnameTags123Api* | [**testClassname**](docs/FakeClassnameTags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case +*FakeClassnameTags123Api* | [**testClassnameWithHttpInfo**](docs/FakeClassnameTags123Api.md#testClassnameWithHttpInfo) | **PATCH** /fake_classname_test | To test class name in snake case *PetApi* | [**addPet**](docs/PetApi.md#addPet) | **POST** /pet | Add a new pet to the store +*PetApi* | [**addPetWithHttpInfo**](docs/PetApi.md#addPetWithHttpInfo) | **POST** /pet | Add a new pet to the store *PetApi* | [**deletePet**](docs/PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet +*PetApi* | [**deletePetWithHttpInfo**](docs/PetApi.md#deletePetWithHttpInfo) | **DELETE** /pet/{petId} | Deletes a pet *PetApi* | [**findPetsByStatus**](docs/PetApi.md#findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status +*PetApi* | [**findPetsByStatusWithHttpInfo**](docs/PetApi.md#findPetsByStatusWithHttpInfo) | **GET** /pet/findByStatus | Finds Pets by status *PetApi* | [**findPetsByTags**](docs/PetApi.md#findPetsByTags) | **GET** /pet/findByTags | Finds Pets by tags +*PetApi* | [**findPetsByTagsWithHttpInfo**](docs/PetApi.md#findPetsByTagsWithHttpInfo) | **GET** /pet/findByTags | Finds Pets by tags *PetApi* | [**getPetById**](docs/PetApi.md#getPetById) | **GET** /pet/{petId} | Find pet by ID +*PetApi* | [**getPetByIdWithHttpInfo**](docs/PetApi.md#getPetByIdWithHttpInfo) | **GET** /pet/{petId} | Find pet by ID *PetApi* | [**updatePet**](docs/PetApi.md#updatePet) | **PUT** /pet | Update an existing pet +*PetApi* | [**updatePetWithHttpInfo**](docs/PetApi.md#updatePetWithHttpInfo) | **PUT** /pet | Update an existing pet *PetApi* | [**updatePetWithForm**](docs/PetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data +*PetApi* | [**updatePetWithFormWithHttpInfo**](docs/PetApi.md#updatePetWithFormWithHttpInfo) | **POST** /pet/{petId} | Updates a pet in the store with form data *PetApi* | [**uploadFile**](docs/PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image +*PetApi* | [**uploadFileWithHttpInfo**](docs/PetApi.md#uploadFileWithHttpInfo) | **POST** /pet/{petId}/uploadImage | uploads an image *PetApi* | [**uploadFileWithRequiredFile**](docs/PetApi.md#uploadFileWithRequiredFile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) +*PetApi* | [**uploadFileWithRequiredFileWithHttpInfo**](docs/PetApi.md#uploadFileWithRequiredFileWithHttpInfo) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) *StoreApi* | [**deleteOrder**](docs/StoreApi.md#deleteOrder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID +*StoreApi* | [**deleteOrderWithHttpInfo**](docs/StoreApi.md#deleteOrderWithHttpInfo) | **DELETE** /store/order/{order_id} | Delete purchase order by ID *StoreApi* | [**getInventory**](docs/StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status +*StoreApi* | [**getInventoryWithHttpInfo**](docs/StoreApi.md#getInventoryWithHttpInfo) | **GET** /store/inventory | Returns pet inventories by status *StoreApi* | [**getOrderById**](docs/StoreApi.md#getOrderById) | **GET** /store/order/{order_id} | Find purchase order by ID +*StoreApi* | [**getOrderByIdWithHttpInfo**](docs/StoreApi.md#getOrderByIdWithHttpInfo) | **GET** /store/order/{order_id} | Find purchase order by ID *StoreApi* | [**placeOrder**](docs/StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet +*StoreApi* | [**placeOrderWithHttpInfo**](docs/StoreApi.md#placeOrderWithHttpInfo) | **POST** /store/order | Place an order for a pet *UserApi* | [**createUser**](docs/UserApi.md#createUser) | **POST** /user | Create user +*UserApi* | [**createUserWithHttpInfo**](docs/UserApi.md#createUserWithHttpInfo) | **POST** /user | Create user *UserApi* | [**createUsersWithArrayInput**](docs/UserApi.md#createUsersWithArrayInput) | **POST** /user/createWithArray | Creates list of users with given input array +*UserApi* | [**createUsersWithArrayInputWithHttpInfo**](docs/UserApi.md#createUsersWithArrayInputWithHttpInfo) | **POST** /user/createWithArray | Creates list of users with given input array *UserApi* | [**createUsersWithListInput**](docs/UserApi.md#createUsersWithListInput) | **POST** /user/createWithList | Creates list of users with given input array +*UserApi* | [**createUsersWithListInputWithHttpInfo**](docs/UserApi.md#createUsersWithListInputWithHttpInfo) | **POST** /user/createWithList | Creates list of users with given input array *UserApi* | [**deleteUser**](docs/UserApi.md#deleteUser) | **DELETE** /user/{username} | Delete user +*UserApi* | [**deleteUserWithHttpInfo**](docs/UserApi.md#deleteUserWithHttpInfo) | **DELETE** /user/{username} | Delete user *UserApi* | [**getUserByName**](docs/UserApi.md#getUserByName) | **GET** /user/{username} | Get user by user name +*UserApi* | [**getUserByNameWithHttpInfo**](docs/UserApi.md#getUserByNameWithHttpInfo) | **GET** /user/{username} | Get user by user name *UserApi* | [**loginUser**](docs/UserApi.md#loginUser) | **GET** /user/login | Logs user into the system +*UserApi* | [**loginUserWithHttpInfo**](docs/UserApi.md#loginUserWithHttpInfo) | **GET** /user/login | Logs user into the system *UserApi* | [**logoutUser**](docs/UserApi.md#logoutUser) | **GET** /user/logout | Logs out current logged in user session +*UserApi* | [**logoutUserWithHttpInfo**](docs/UserApi.md#logoutUserWithHttpInfo) | **GET** /user/logout | Logs out current logged in user session *UserApi* | [**updateUser**](docs/UserApi.md#updateUser) | **PUT** /user/{username} | Updated user +*UserApi* | [**updateUserWithHttpInfo**](docs/UserApi.md#updateUserWithHttpInfo) | **PUT** /user/{username} | Updated user ## Documentation for Models diff --git a/samples/client/petstore/java/native-async/docs/AnotherFakeApi.md b/samples/client/petstore/java/native-async/docs/AnotherFakeApi.md index a4573e40e4cd..b70558ee12fd 100644 --- a/samples/client/petstore/java/native-async/docs/AnotherFakeApi.md +++ b/samples/client/petstore/java/native-async/docs/AnotherFakeApi.md @@ -5,6 +5,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- [**call123testSpecialTags**](AnotherFakeApi.md#call123testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags +[**call123testSpecialTagsWithHttpInfo**](AnotherFakeApi.md#call123testSpecialTagsWithHttpInfo) | **PATCH** /another-fake/dummy | To test special tags @@ -36,8 +37,7 @@ public class Example { Client body = new Client(); // Client | client model try { CompletableFuture result = apiInstance.call123testSpecialTags(body); - - System.out.println(result); + System.out.println(result.get()); } catch (ApiException e) { System.err.println("Exception when calling AnotherFakeApi#call123testSpecialTags"); System.err.println("Status code: " + e.getCode()); @@ -75,3 +75,79 @@ No authorization required |-------------|-------------|------------------| | **200** | successful operation | - | +## call123testSpecialTagsWithHttpInfo + +> CompletableFuture> call123testSpecialTags call123testSpecialTagsWithHttpInfo(body) + +To test special tags + +To test special tags and operation ID starting with number + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.AnotherFakeApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + AnotherFakeApi apiInstance = new AnotherFakeApi(defaultClient); + Client body = new Client(); // Client | client model + try { + CompletableFuture> response = apiInstance.call123testSpecialTagsWithHttpInfo(body); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling AnotherFakeApi#call123testSpecialTags"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling AnotherFakeApi#call123testSpecialTags"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Client**](Client.md)| client model | + +### Return type + +CompletableFuture> + + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + diff --git a/samples/client/petstore/java/native-async/docs/FakeApi.md b/samples/client/petstore/java/native-async/docs/FakeApi.md index c3132712768b..2d1e4a875528 100644 --- a/samples/client/petstore/java/native-async/docs/FakeApi.md +++ b/samples/client/petstore/java/native-async/docs/FakeApi.md @@ -5,19 +5,33 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- [**createXmlItem**](FakeApi.md#createXmlItem) | **POST** /fake/create_xml_item | creates an XmlItem +[**createXmlItemWithHttpInfo**](FakeApi.md#createXmlItemWithHttpInfo) | **POST** /fake/create_xml_item | creates an XmlItem [**fakeOuterBooleanSerialize**](FakeApi.md#fakeOuterBooleanSerialize) | **POST** /fake/outer/boolean | +[**fakeOuterBooleanSerializeWithHttpInfo**](FakeApi.md#fakeOuterBooleanSerializeWithHttpInfo) | **POST** /fake/outer/boolean | [**fakeOuterCompositeSerialize**](FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite | +[**fakeOuterCompositeSerializeWithHttpInfo**](FakeApi.md#fakeOuterCompositeSerializeWithHttpInfo) | **POST** /fake/outer/composite | [**fakeOuterNumberSerialize**](FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number | +[**fakeOuterNumberSerializeWithHttpInfo**](FakeApi.md#fakeOuterNumberSerializeWithHttpInfo) | **POST** /fake/outer/number | [**fakeOuterStringSerialize**](FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string | +[**fakeOuterStringSerializeWithHttpInfo**](FakeApi.md#fakeOuterStringSerializeWithHttpInfo) | **POST** /fake/outer/string | [**testBodyWithFileSchema**](FakeApi.md#testBodyWithFileSchema) | **PUT** /fake/body-with-file-schema | +[**testBodyWithFileSchemaWithHttpInfo**](FakeApi.md#testBodyWithFileSchemaWithHttpInfo) | **PUT** /fake/body-with-file-schema | [**testBodyWithQueryParams**](FakeApi.md#testBodyWithQueryParams) | **PUT** /fake/body-with-query-params | +[**testBodyWithQueryParamsWithHttpInfo**](FakeApi.md#testBodyWithQueryParamsWithHttpInfo) | **PUT** /fake/body-with-query-params | [**testClientModel**](FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model +[**testClientModelWithHttpInfo**](FakeApi.md#testClientModelWithHttpInfo) | **PATCH** /fake | To test \"client\" model [**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +[**testEndpointParametersWithHttpInfo**](FakeApi.md#testEndpointParametersWithHttpInfo) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 [**testEnumParameters**](FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters +[**testEnumParametersWithHttpInfo**](FakeApi.md#testEnumParametersWithHttpInfo) | **GET** /fake | To test enum parameters [**testGroupParameters**](FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) +[**testGroupParametersWithHttpInfo**](FakeApi.md#testGroupParametersWithHttpInfo) | **DELETE** /fake | Fake endpoint to test group parameters (optional) [**testInlineAdditionalProperties**](FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties +[**testInlineAdditionalPropertiesWithHttpInfo**](FakeApi.md#testInlineAdditionalPropertiesWithHttpInfo) | **POST** /fake/inline-additionalProperties | test inline additionalProperties [**testJsonFormData**](FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data +[**testJsonFormDataWithHttpInfo**](FakeApi.md#testJsonFormDataWithHttpInfo) | **GET** /fake/jsonFormData | test json serialization of form data [**testQueryParameterCollectionFormat**](FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-paramters | +[**testQueryParameterCollectionFormatWithHttpInfo**](FakeApi.md#testQueryParameterCollectionFormatWithHttpInfo) | **PUT** /fake/test-query-paramters | @@ -49,7 +63,6 @@ public class Example { XmlItem xmlItem = new XmlItem(); // XmlItem | XmlItem Body try { CompletableFuture result = apiInstance.createXmlItem(xmlItem); - } catch (ApiException e) { System.err.println("Exception when calling FakeApi#createXmlItem"); System.err.println("Status code: " + e.getCode()); @@ -87,14 +100,13 @@ No authorization required |-------------|-------------|------------------| | **200** | successful operation | - | +## createXmlItemWithHttpInfo -## fakeOuterBooleanSerialize - -> CompletableFuture fakeOuterBooleanSerialize(body) - +> CompletableFuture> createXmlItem createXmlItemWithHttpInfo(xmlItem) +creates an XmlItem -Test serialization of outer boolean types +this route creates an XmlItem ### Example @@ -102,6 +114,7 @@ Test serialization of outer boolean types // Import classes: import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; import org.openapitools.client.Configuration; import org.openapitools.client.models.*; import org.openapitools.client.api.FakeApi; @@ -113,16 +126,23 @@ public class Example { defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); FakeApi apiInstance = new FakeApi(defaultClient); - Boolean body = true; // Boolean | Input boolean as post body + XmlItem xmlItem = new XmlItem(); // XmlItem | XmlItem Body try { - CompletableFuture result = apiInstance.fakeOuterBooleanSerialize(body); - - System.out.println(result); + CompletableFuture> response = apiInstance.createXmlItemWithHttpInfo(xmlItem); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling FakeApi#createXmlItem"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); } catch (ApiException e) { - System.err.println("Exception when calling FakeApi#fakeOuterBooleanSerialize"); + System.err.println("Exception when calling FakeApi#createXmlItem"); System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); e.printStackTrace(); } } @@ -134,12 +154,12 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | **Boolean**| Input boolean as post body | [optional] + **xmlItem** | [**XmlItem**](XmlItem.md)| XmlItem Body | ### Return type -CompletableFuture<**Boolean**> +CompletableFuture> ### Authorization @@ -147,22 +167,22 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not defined -- **Accept**: */* +- **Content-Type**: application/xml, application/xml; charset=utf-8, application/xml; charset=utf-16, text/xml, text/xml; charset=utf-8, text/xml; charset=utf-16 +- **Accept**: Not defined ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -| **200** | Output boolean | - | +| **200** | successful operation | - | -## fakeOuterCompositeSerialize +## fakeOuterBooleanSerialize -> CompletableFuture fakeOuterCompositeSerialize(body) +> CompletableFuture fakeOuterBooleanSerialize(body) -Test serialization of object with outer number type +Test serialization of outer boolean types ### Example @@ -181,13 +201,12 @@ public class Example { defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); FakeApi apiInstance = new FakeApi(defaultClient); - OuterComposite body = new OuterComposite(); // OuterComposite | Input composite as post body + Boolean body = true; // Boolean | Input boolean as post body try { - CompletableFuture result = apiInstance.fakeOuterCompositeSerialize(body); - - System.out.println(result); + CompletableFuture result = apiInstance.fakeOuterBooleanSerialize(body); + System.out.println(result.get()); } catch (ApiException e) { - System.err.println("Exception when calling FakeApi#fakeOuterCompositeSerialize"); + System.err.println("Exception when calling FakeApi#fakeOuterBooleanSerialize"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -202,11 +221,11 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] + **body** | **Boolean**| Input boolean as post body | [optional] ### Return type -CompletableFuture<[**OuterComposite**](OuterComposite.md)> +CompletableFuture<**Boolean**> ### Authorization @@ -221,16 +240,15 @@ No authorization required ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -| **200** | Output composite | - | - +| **200** | Output boolean | - | -## fakeOuterNumberSerialize +## fakeOuterBooleanSerializeWithHttpInfo -> CompletableFuture fakeOuterNumberSerialize(body) +> CompletableFuture> fakeOuterBooleanSerialize fakeOuterBooleanSerializeWithHttpInfo(body) -Test serialization of outer number types +Test serialization of outer boolean types ### Example @@ -238,6 +256,7 @@ Test serialization of outer number types // Import classes: import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; import org.openapitools.client.Configuration; import org.openapitools.client.models.*; import org.openapitools.client.api.FakeApi; @@ -249,16 +268,24 @@ public class Example { defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); FakeApi apiInstance = new FakeApi(defaultClient); - BigDecimal body = new BigDecimal(); // BigDecimal | Input number as post body + Boolean body = true; // Boolean | Input boolean as post body try { - CompletableFuture result = apiInstance.fakeOuterNumberSerialize(body); - - System.out.println(result); + CompletableFuture> response = apiInstance.fakeOuterBooleanSerializeWithHttpInfo(body); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling FakeApi#fakeOuterBooleanSerialize"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); } catch (ApiException e) { - System.err.println("Exception when calling FakeApi#fakeOuterNumberSerialize"); + System.err.println("Exception when calling FakeApi#fakeOuterBooleanSerialize"); System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); e.printStackTrace(); } } @@ -270,11 +297,11 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | **BigDecimal**| Input number as post body | [optional] + **body** | **Boolean**| Input boolean as post body | [optional] ### Return type -CompletableFuture<[**BigDecimal**](BigDecimal.md)> +CompletableFuture> ### Authorization @@ -289,16 +316,16 @@ No authorization required ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -| **200** | Output number | - | +| **200** | Output boolean | - | -## fakeOuterStringSerialize +## fakeOuterCompositeSerialize -> CompletableFuture fakeOuterStringSerialize(body) +> CompletableFuture fakeOuterCompositeSerialize(body) -Test serialization of outer string types +Test serialization of object with outer number type ### Example @@ -317,13 +344,12 @@ public class Example { defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); FakeApi apiInstance = new FakeApi(defaultClient); - String body = "body_example"; // String | Input string as post body + OuterComposite body = new OuterComposite(); // OuterComposite | Input composite as post body try { - CompletableFuture result = apiInstance.fakeOuterStringSerialize(body); - - System.out.println(result); + CompletableFuture result = apiInstance.fakeOuterCompositeSerialize(body); + System.out.println(result.get()); } catch (ApiException e) { - System.err.println("Exception when calling FakeApi#fakeOuterStringSerialize"); + System.err.println("Exception when calling FakeApi#fakeOuterCompositeSerialize"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -338,11 +364,11 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | **String**| Input string as post body | [optional] + **body** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] ### Return type -CompletableFuture<**String**> +CompletableFuture<[**OuterComposite**](OuterComposite.md)> ### Authorization @@ -357,16 +383,15 @@ No authorization required ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -| **200** | Output string | - | - +| **200** | Output composite | - | -## testBodyWithFileSchema +## fakeOuterCompositeSerializeWithHttpInfo -> CompletableFuture testBodyWithFileSchema(body) +> CompletableFuture> fakeOuterCompositeSerialize fakeOuterCompositeSerializeWithHttpInfo(body) -For this test, the body for this request much reference a schema named `File`. +Test serialization of object with outer number type ### Example @@ -374,6 +399,7 @@ For this test, the body for this request much reference a schema named `Fil // Import classes: import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; import org.openapitools.client.Configuration; import org.openapitools.client.models.*; import org.openapitools.client.api.FakeApi; @@ -385,15 +411,24 @@ public class Example { defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); FakeApi apiInstance = new FakeApi(defaultClient); - FileSchemaTestClass body = new FileSchemaTestClass(); // FileSchemaTestClass | + OuterComposite body = new OuterComposite(); // OuterComposite | Input composite as post body try { - CompletableFuture result = apiInstance.testBodyWithFileSchema(body); - + CompletableFuture> response = apiInstance.fakeOuterCompositeSerializeWithHttpInfo(body); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling FakeApi#fakeOuterCompositeSerialize"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); } catch (ApiException e) { - System.err.println("Exception when calling FakeApi#testBodyWithFileSchema"); + System.err.println("Exception when calling FakeApi#fakeOuterCompositeSerialize"); System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); e.printStackTrace(); } } @@ -405,12 +440,12 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| | + **body** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] ### Return type +CompletableFuture> -CompletableFuture (empty response body) ### Authorization @@ -418,20 +453,22 @@ No authorization required ### HTTP request headers -- **Content-Type**: application/json -- **Accept**: Not defined +- **Content-Type**: Not defined +- **Accept**: */* ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -| **200** | Success | - | +| **200** | Output composite | - | -## testBodyWithQueryParams +## fakeOuterNumberSerialize + +> CompletableFuture fakeOuterNumberSerialize(body) -> CompletableFuture testBodyWithQueryParams(query, body) +Test serialization of outer number types ### Example @@ -450,13 +487,12 @@ public class Example { defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); FakeApi apiInstance = new FakeApi(defaultClient); - String query = "query_example"; // String | - User body = new User(); // User | + BigDecimal body = new BigDecimal(); // BigDecimal | Input number as post body try { - CompletableFuture result = apiInstance.testBodyWithQueryParams(query, body); - + CompletableFuture result = apiInstance.fakeOuterNumberSerialize(body); + System.out.println(result.get()); } catch (ApiException e) { - System.err.println("Exception when calling FakeApi#testBodyWithQueryParams"); + System.err.println("Exception when calling FakeApi#fakeOuterNumberSerialize"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -471,13 +507,12 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **query** | **String**| | - **body** | [**User**](User.md)| | + **body** | **BigDecimal**| Input number as post body | [optional] ### Return type +CompletableFuture<[**BigDecimal**](BigDecimal.md)> -CompletableFuture (empty response body) ### Authorization @@ -485,22 +520,21 @@ No authorization required ### HTTP request headers -- **Content-Type**: application/json -- **Accept**: Not defined +- **Content-Type**: Not defined +- **Accept**: */* ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -| **200** | Success | - | +| **200** | Output number | - | +## fakeOuterNumberSerializeWithHttpInfo -## testClientModel +> CompletableFuture> fakeOuterNumberSerialize fakeOuterNumberSerializeWithHttpInfo(body) -> CompletableFuture testClientModel(body) -To test \"client\" model -To test \"client\" model +Test serialization of outer number types ### Example @@ -508,6 +542,7 @@ To test \"client\" model // Import classes: import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; import org.openapitools.client.Configuration; import org.openapitools.client.models.*; import org.openapitools.client.api.FakeApi; @@ -519,16 +554,24 @@ public class Example { defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); FakeApi apiInstance = new FakeApi(defaultClient); - Client body = new Client(); // Client | client model + BigDecimal body = new BigDecimal(); // BigDecimal | Input number as post body try { - CompletableFuture result = apiInstance.testClientModel(body); - - System.out.println(result); + CompletableFuture> response = apiInstance.fakeOuterNumberSerializeWithHttpInfo(body); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling FakeApi#fakeOuterNumberSerialize"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); } catch (ApiException e) { - System.err.println("Exception when calling FakeApi#testClientModel"); + System.err.println("Exception when calling FakeApi#fakeOuterNumberSerialize"); System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); e.printStackTrace(); } } @@ -540,11 +583,11 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | + **body** | **BigDecimal**| Input number as post body | [optional] ### Return type -CompletableFuture<[**Client**](Client.md)> +CompletableFuture> ### Authorization @@ -553,22 +596,22 @@ No authorization required ### HTTP request headers -- **Content-Type**: application/json -- **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: */* ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -| **200** | successful operation | - | +| **200** | Output number | - | -## testEndpointParameters +## fakeOuterStringSerialize -> CompletableFuture testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback) +> CompletableFuture fakeOuterStringSerialize(body) -Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 -Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + +Test serialization of outer string types ### Example @@ -577,7 +620,6 @@ Fake endpoint for testing various parameters 假端點 偽のエンドポイ import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; import org.openapitools.client.Configuration; -import org.openapitools.client.auth.*; import org.openapitools.client.models.*; import org.openapitools.client.api.FakeApi; import java.util.concurrent.CompletableFuture; @@ -586,32 +628,14 @@ public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); - - // Configure HTTP basic authorization: http_basic_test - HttpBasicAuth http_basic_test = (HttpBasicAuth) defaultClient.getAuthentication("http_basic_test"); - http_basic_test.setUsername("YOUR USERNAME"); - http_basic_test.setPassword("YOUR PASSWORD"); FakeApi apiInstance = new FakeApi(defaultClient); - BigDecimal number = new BigDecimal(); // BigDecimal | None - Double _double = 3.4D; // Double | None - String patternWithoutDelimiter = "patternWithoutDelimiter_example"; // String | None - byte[] _byte = null; // byte[] | None - Integer integer = 56; // Integer | None - Integer int32 = 56; // Integer | None - Long int64 = 56L; // Long | None - Float _float = 3.4F; // Float | None - String string = "string_example"; // String | None - File binary = new File("/path/to/file"); // File | None - LocalDate date = new LocalDate(); // LocalDate | None - OffsetDateTime dateTime = new OffsetDateTime(); // OffsetDateTime | None - String password = "password_example"; // String | None - String paramCallback = "paramCallback_example"; // String | None + String body = "body_example"; // String | Input string as post body try { - CompletableFuture result = apiInstance.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); - + CompletableFuture result = apiInstance.fakeOuterStringSerialize(body); + System.out.println(result.get()); } catch (ApiException e) { - System.err.println("Exception when calling FakeApi#testEndpointParameters"); + System.err.println("Exception when calling FakeApi#fakeOuterStringSerialize"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -626,49 +650,34 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **number** | **BigDecimal**| None | - **_double** | **Double**| None | - **patternWithoutDelimiter** | **String**| None | - **_byte** | **byte[]**| None | - **integer** | **Integer**| None | [optional] - **int32** | **Integer**| None | [optional] - **int64** | **Long**| None | [optional] - **_float** | **Float**| None | [optional] - **string** | **String**| None | [optional] - **binary** | **File**| None | [optional] - **date** | **LocalDate**| None | [optional] - **dateTime** | **OffsetDateTime**| None | [optional] - **password** | **String**| None | [optional] - **paramCallback** | **String**| None | [optional] + **body** | **String**| Input string as post body | [optional] ### Return type +CompletableFuture<**String**> -CompletableFuture (empty response body) ### Authorization -[http_basic_test](../README.md#http_basic_test) +No authorization required ### HTTP request headers -- **Content-Type**: application/x-www-form-urlencoded -- **Accept**: Not defined +- **Content-Type**: Not defined +- **Accept**: */* ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -| **400** | Invalid username supplied | - | -| **404** | User not found | - | +| **200** | Output string | - | +## fakeOuterStringSerializeWithHttpInfo -## testEnumParameters +> CompletableFuture> fakeOuterStringSerialize fakeOuterStringSerializeWithHttpInfo(body) -> CompletableFuture testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString) -To test enum parameters -To test enum parameters +Test serialization of outer string types ### Example @@ -676,6 +685,7 @@ To test enum parameters // Import classes: import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; import org.openapitools.client.Configuration; import org.openapitools.client.models.*; import org.openapitools.client.api.FakeApi; @@ -687,22 +697,24 @@ public class Example { defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); FakeApi apiInstance = new FakeApi(defaultClient); - List enumHeaderStringArray = Arrays.asList("$"); // List | Header parameter enum test (string array) - String enumHeaderString = "-efg"; // String | Header parameter enum test (string) - List enumQueryStringArray = Arrays.asList("$"); // List | Query parameter enum test (string array) - String enumQueryString = "-efg"; // String | Query parameter enum test (string) - Integer enumQueryInteger = 56; // Integer | Query parameter enum test (double) - Double enumQueryDouble = 3.4D; // Double | Query parameter enum test (double) - List enumFormStringArray = "$"; // List | Form parameter enum test (string array) - String enumFormString = "-efg"; // String | Form parameter enum test (string) + String body = "body_example"; // String | Input string as post body try { - CompletableFuture result = apiInstance.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); - + CompletableFuture> response = apiInstance.fakeOuterStringSerializeWithHttpInfo(body); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling FakeApi#fakeOuterStringSerialize"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); } catch (ApiException e) { - System.err.println("Exception when calling FakeApi#testEnumParameters"); + System.err.println("Exception when calling FakeApi#fakeOuterStringSerialize"); System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); e.printStackTrace(); } } @@ -714,19 +726,12 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **enumHeaderStringArray** | [**List<String>**](String.md)| Header parameter enum test (string array) | [optional] [enum: >, $] - **enumHeaderString** | **String**| Header parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)] - **enumQueryStringArray** | [**List<String>**](String.md)| Query parameter enum test (string array) | [optional] [enum: >, $] - **enumQueryString** | **String**| Query parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)] - **enumQueryInteger** | **Integer**| Query parameter enum test (double) | [optional] [enum: 1, -2] - **enumQueryDouble** | **Double**| Query parameter enum test (double) | [optional] [enum: 1.1, -1.2] - **enumFormStringArray** | [**List<String>**](String.md)| Form parameter enum test (string array) | [optional] [enum: >, $] - **enumFormString** | **String**| Form parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)] + **body** | **String**| Input string as post body | [optional] ### Return type +CompletableFuture> -CompletableFuture (empty response body) ### Authorization @@ -734,19 +739,899 @@ No authorization required ### HTTP request headers -- **Content-Type**: application/x-www-form-urlencoded -- **Accept**: Not defined +- **Content-Type**: Not defined +- **Accept**: */* ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -| **400** | Invalid request | - | -| **404** | Not found | - | +| **200** | Output string | - | + + +## testBodyWithFileSchema + +> CompletableFuture testBodyWithFileSchema(body) + + + +For this test, the body for this request much reference a schema named `File`. + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + FileSchemaTestClass body = new FileSchemaTestClass(); // FileSchemaTestClass | + try { + CompletableFuture result = apiInstance.testBodyWithFileSchema(body); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testBodyWithFileSchema"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| | + +### Return type + + +CompletableFuture (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | + +## testBodyWithFileSchemaWithHttpInfo + +> CompletableFuture> testBodyWithFileSchema testBodyWithFileSchemaWithHttpInfo(body) + + + +For this test, the body for this request much reference a schema named `File`. + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + FileSchemaTestClass body = new FileSchemaTestClass(); // FileSchemaTestClass | + try { + CompletableFuture> response = apiInstance.testBodyWithFileSchemaWithHttpInfo(body); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling FakeApi#testBodyWithFileSchema"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testBodyWithFileSchema"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| | + +### Return type + + +CompletableFuture> + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | + + +## testBodyWithQueryParams + +> CompletableFuture testBodyWithQueryParams(query, body) + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + String query = "query_example"; // String | + User body = new User(); // User | + try { + CompletableFuture result = apiInstance.testBodyWithQueryParams(query, body); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testBodyWithQueryParams"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **query** | **String**| | + **body** | [**User**](User.md)| | + +### Return type + + +CompletableFuture (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | + +## testBodyWithQueryParamsWithHttpInfo + +> CompletableFuture> testBodyWithQueryParams testBodyWithQueryParamsWithHttpInfo(query, body) + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + String query = "query_example"; // String | + User body = new User(); // User | + try { + CompletableFuture> response = apiInstance.testBodyWithQueryParamsWithHttpInfo(query, body); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling FakeApi#testBodyWithQueryParams"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testBodyWithQueryParams"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **query** | **String**| | + **body** | [**User**](User.md)| | + +### Return type + + +CompletableFuture> + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | + + +## testClientModel + +> CompletableFuture testClientModel(body) + +To test \"client\" model + +To test \"client\" model + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + Client body = new Client(); // Client | client model + try { + CompletableFuture result = apiInstance.testClientModel(body); + System.out.println(result.get()); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testClientModel"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Client**](Client.md)| client model | + +### Return type + +CompletableFuture<[**Client**](Client.md)> + + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +## testClientModelWithHttpInfo + +> CompletableFuture> testClientModel testClientModelWithHttpInfo(body) + +To test \"client\" model + +To test \"client\" model + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + Client body = new Client(); // Client | client model + try { + CompletableFuture> response = apiInstance.testClientModelWithHttpInfo(body); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling FakeApi#testClientModel"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testClientModel"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Client**](Client.md)| client model | + +### Return type + +CompletableFuture> + + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + + +## testEndpointParameters + +> CompletableFuture testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback) + +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + // Configure HTTP basic authorization: http_basic_test + HttpBasicAuth http_basic_test = (HttpBasicAuth) defaultClient.getAuthentication("http_basic_test"); + http_basic_test.setUsername("YOUR USERNAME"); + http_basic_test.setPassword("YOUR PASSWORD"); + + FakeApi apiInstance = new FakeApi(defaultClient); + BigDecimal number = new BigDecimal(); // BigDecimal | None + Double _double = 3.4D; // Double | None + String patternWithoutDelimiter = "patternWithoutDelimiter_example"; // String | None + byte[] _byte = null; // byte[] | None + Integer integer = 56; // Integer | None + Integer int32 = 56; // Integer | None + Long int64 = 56L; // Long | None + Float _float = 3.4F; // Float | None + String string = "string_example"; // String | None + File binary = new File("/path/to/file"); // File | None + LocalDate date = new LocalDate(); // LocalDate | None + OffsetDateTime dateTime = new OffsetDateTime(); // OffsetDateTime | None + String password = "password_example"; // String | None + String paramCallback = "paramCallback_example"; // String | None + try { + CompletableFuture result = apiInstance.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testEndpointParameters"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **number** | **BigDecimal**| None | + **_double** | **Double**| None | + **patternWithoutDelimiter** | **String**| None | + **_byte** | **byte[]**| None | + **integer** | **Integer**| None | [optional] + **int32** | **Integer**| None | [optional] + **int64** | **Long**| None | [optional] + **_float** | **Float**| None | [optional] + **string** | **String**| None | [optional] + **binary** | **File**| None | [optional] + **date** | **LocalDate**| None | [optional] + **dateTime** | **OffsetDateTime**| None | [optional] + **password** | **String**| None | [optional] + **paramCallback** | **String**| None | [optional] + +### Return type + + +CompletableFuture (empty response body) + +### Authorization + +[http_basic_test](../README.md#http_basic_test) + +### HTTP request headers + +- **Content-Type**: application/x-www-form-urlencoded +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid username supplied | - | +| **404** | User not found | - | + +## testEndpointParametersWithHttpInfo + +> CompletableFuture> testEndpointParameters testEndpointParametersWithHttpInfo(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback) + +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + // Configure HTTP basic authorization: http_basic_test + HttpBasicAuth http_basic_test = (HttpBasicAuth) defaultClient.getAuthentication("http_basic_test"); + http_basic_test.setUsername("YOUR USERNAME"); + http_basic_test.setPassword("YOUR PASSWORD"); + + FakeApi apiInstance = new FakeApi(defaultClient); + BigDecimal number = new BigDecimal(); // BigDecimal | None + Double _double = 3.4D; // Double | None + String patternWithoutDelimiter = "patternWithoutDelimiter_example"; // String | None + byte[] _byte = null; // byte[] | None + Integer integer = 56; // Integer | None + Integer int32 = 56; // Integer | None + Long int64 = 56L; // Long | None + Float _float = 3.4F; // Float | None + String string = "string_example"; // String | None + File binary = new File("/path/to/file"); // File | None + LocalDate date = new LocalDate(); // LocalDate | None + OffsetDateTime dateTime = new OffsetDateTime(); // OffsetDateTime | None + String password = "password_example"; // String | None + String paramCallback = "paramCallback_example"; // String | None + try { + CompletableFuture> response = apiInstance.testEndpointParametersWithHttpInfo(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling FakeApi#testEndpointParameters"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testEndpointParameters"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **number** | **BigDecimal**| None | + **_double** | **Double**| None | + **patternWithoutDelimiter** | **String**| None | + **_byte** | **byte[]**| None | + **integer** | **Integer**| None | [optional] + **int32** | **Integer**| None | [optional] + **int64** | **Long**| None | [optional] + **_float** | **Float**| None | [optional] + **string** | **String**| None | [optional] + **binary** | **File**| None | [optional] + **date** | **LocalDate**| None | [optional] + **dateTime** | **OffsetDateTime**| None | [optional] + **password** | **String**| None | [optional] + **paramCallback** | **String**| None | [optional] + +### Return type + + +CompletableFuture> + +### Authorization + +[http_basic_test](../README.md#http_basic_test) + +### HTTP request headers + +- **Content-Type**: application/x-www-form-urlencoded +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid username supplied | - | +| **404** | User not found | - | + + +## testEnumParameters + +> CompletableFuture testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString) + +To test enum parameters + +To test enum parameters + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + List enumHeaderStringArray = Arrays.asList("$"); // List | Header parameter enum test (string array) + String enumHeaderString = "-efg"; // String | Header parameter enum test (string) + List enumQueryStringArray = Arrays.asList("$"); // List | Query parameter enum test (string array) + String enumQueryString = "-efg"; // String | Query parameter enum test (string) + Integer enumQueryInteger = 56; // Integer | Query parameter enum test (double) + Double enumQueryDouble = 3.4D; // Double | Query parameter enum test (double) + List enumFormStringArray = "$"; // List | Form parameter enum test (string array) + String enumFormString = "-efg"; // String | Form parameter enum test (string) + try { + CompletableFuture result = apiInstance.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testEnumParameters"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **enumHeaderStringArray** | [**List<String>**](String.md)| Header parameter enum test (string array) | [optional] [enum: >, $] + **enumHeaderString** | **String**| Header parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)] + **enumQueryStringArray** | [**List<String>**](String.md)| Query parameter enum test (string array) | [optional] [enum: >, $] + **enumQueryString** | **String**| Query parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)] + **enumQueryInteger** | **Integer**| Query parameter enum test (double) | [optional] [enum: 1, -2] + **enumQueryDouble** | **Double**| Query parameter enum test (double) | [optional] [enum: 1.1, -1.2] + **enumFormStringArray** | [**List<String>**](String.md)| Form parameter enum test (string array) | [optional] [enum: >, $] + **enumFormString** | **String**| Form parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)] + +### Return type + + +CompletableFuture (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/x-www-form-urlencoded +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid request | - | +| **404** | Not found | - | + +## testEnumParametersWithHttpInfo + +> CompletableFuture> testEnumParameters testEnumParametersWithHttpInfo(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString) + +To test enum parameters + +To test enum parameters + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + List enumHeaderStringArray = Arrays.asList("$"); // List | Header parameter enum test (string array) + String enumHeaderString = "-efg"; // String | Header parameter enum test (string) + List enumQueryStringArray = Arrays.asList("$"); // List | Query parameter enum test (string array) + String enumQueryString = "-efg"; // String | Query parameter enum test (string) + Integer enumQueryInteger = 56; // Integer | Query parameter enum test (double) + Double enumQueryDouble = 3.4D; // Double | Query parameter enum test (double) + List enumFormStringArray = "$"; // List | Form parameter enum test (string array) + String enumFormString = "-efg"; // String | Form parameter enum test (string) + try { + CompletableFuture> response = apiInstance.testEnumParametersWithHttpInfo(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling FakeApi#testEnumParameters"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testEnumParameters"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **enumHeaderStringArray** | [**List<String>**](String.md)| Header parameter enum test (string array) | [optional] [enum: >, $] + **enumHeaderString** | **String**| Header parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)] + **enumQueryStringArray** | [**List<String>**](String.md)| Query parameter enum test (string array) | [optional] [enum: >, $] + **enumQueryString** | **String**| Query parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)] + **enumQueryInteger** | **Integer**| Query parameter enum test (double) | [optional] [enum: 1, -2] + **enumQueryDouble** | **Double**| Query parameter enum test (double) | [optional] [enum: 1.1, -1.2] + **enumFormStringArray** | [**List<String>**](String.md)| Form parameter enum test (string array) | [optional] [enum: >, $] + **enumFormString** | **String**| Form parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)] + +### Return type + + +CompletableFuture> + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/x-www-form-urlencoded +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid request | - | +| **404** | Not found | - | + + +## testGroupParameters + +> CompletableFuture testGroupParameters(testGroupParametersRequest) + +Fake endpoint to test group parameters (optional) + +Fake endpoint to test group parameters (optional) + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; +import org.openapitools.client.api.FakeApi.*; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + Integer requiredStringGroup = 56; // Integer | Required String in group parameters + Boolean requiredBooleanGroup = true; // Boolean | Required Boolean in group parameters + Long requiredInt64Group = 56L; // Long | Required Integer in group parameters + Integer stringGroup = 56; // Integer | String in group parameters + Boolean booleanGroup = true; // Boolean | Boolean in group parameters + Long int64Group = 56L; // Long | Integer in group parameters + try { + APItestGroupParametersRequest request = APItestGroupParametersRequest.newBuilder() + .requiredStringGroup(requiredStringGroup) + .requiredBooleanGroup(requiredBooleanGroup) + .requiredInt64Group(requiredInt64Group) + .stringGroup(stringGroup) + .booleanGroup(booleanGroup) + .int64Group(int64Group) + .build(); + CompletableFuture result = apiInstance.testGroupParameters(request); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testGroupParameters"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` +### Parameters -## testGroupParameters +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| testGroupParametersRequest | [**APItestGroupParametersRequest**](FakeApi.md#APItestGroupParametersRequest)|-|-| -> CompletableFuture testGroupParameters(testGroupParametersRequest) +### Return type + + +CompletableFuture (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Someting wrong | - | + +## testGroupParametersWithHttpInfo + +> CompletableFuture> testGroupParameters testGroupParametersWithHttpInfo(testGroupParametersRequest) Fake endpoint to test group parameters (optional) @@ -758,6 +1643,7 @@ Fake endpoint to test group parameters (optional) // Import classes: import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; import org.openapitools.client.Configuration; import org.openapitools.client.models.*; import org.openapitools.client.api.FakeApi; @@ -785,12 +1671,21 @@ public class Example { .booleanGroup(booleanGroup) .int64Group(int64Group) .build(); - CompletableFuture result = apiInstance.testGroupParameters(request); + CompletableFuture> response = apiInstance.testGroupParametersWithHttpInfo(request); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling FakeApi#testGroupParameters"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testGroupParameters"); System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); e.printStackTrace(); } } @@ -806,7 +1701,7 @@ public class Example { ### Return type -CompletableFuture (empty response body) +CompletableFuture> ### Authorization @@ -864,7 +1759,6 @@ public class Example { Map param = new HashMap(); // Map | request body try { CompletableFuture result = apiInstance.testInlineAdditionalProperties(param); - } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testInlineAdditionalProperties"); System.err.println("Status code: " + e.getCode()); @@ -902,6 +1796,79 @@ No authorization required |-------------|-------------|------------------| | **200** | successful operation | - | +## testInlineAdditionalPropertiesWithHttpInfo + +> CompletableFuture> testInlineAdditionalProperties testInlineAdditionalPropertiesWithHttpInfo(param) + +test inline additionalProperties + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + Map param = new HashMap(); // Map | request body + try { + CompletableFuture> response = apiInstance.testInlineAdditionalPropertiesWithHttpInfo(param); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling FakeApi#testInlineAdditionalProperties"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testInlineAdditionalProperties"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **param** | [**Map<String, String>**](String.md)| request body | + +### Return type + + +CompletableFuture> + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + ## testJsonFormData @@ -930,7 +1897,6 @@ public class Example { String param2 = "param2_example"; // String | field2 try { CompletableFuture result = apiInstance.testJsonFormData(param, param2); - } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testJsonFormData"); System.err.println("Status code: " + e.getCode()); @@ -969,6 +1935,81 @@ No authorization required |-------------|-------------|------------------| | **200** | successful operation | - | +## testJsonFormDataWithHttpInfo + +> CompletableFuture> testJsonFormData testJsonFormDataWithHttpInfo(param, param2) + +test json serialization of form data + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + String param = "param_example"; // String | field1 + String param2 = "param2_example"; // String | field2 + try { + CompletableFuture> response = apiInstance.testJsonFormDataWithHttpInfo(param, param2); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling FakeApi#testJsonFormData"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testJsonFormData"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **param** | **String**| field1 | + **param2** | **String**| field2 | + +### Return type + + +CompletableFuture> + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/x-www-form-urlencoded +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + ## testQueryParameterCollectionFormat @@ -1002,7 +2043,6 @@ public class Example { List context = Arrays.asList(); // List | try { CompletableFuture result = apiInstance.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context); - } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testQueryParameterCollectionFormat"); System.err.println("Status code: " + e.getCode()); @@ -1044,3 +2084,86 @@ No authorization required |-------------|-------------|------------------| | **200** | Success | - | +## testQueryParameterCollectionFormatWithHttpInfo + +> CompletableFuture> testQueryParameterCollectionFormat testQueryParameterCollectionFormatWithHttpInfo(pipe, ioutil, http, url, context) + + + +To test the collection format in query parameters + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + List pipe = Arrays.asList(); // List | + List ioutil = Arrays.asList(); // List | + List http = Arrays.asList(); // List | + List url = Arrays.asList(); // List | + List context = Arrays.asList(); // List | + try { + CompletableFuture> response = apiInstance.testQueryParameterCollectionFormatWithHttpInfo(pipe, ioutil, http, url, context); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling FakeApi#testQueryParameterCollectionFormat"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testQueryParameterCollectionFormat"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pipe** | [**List<String>**](String.md)| | + **ioutil** | [**List<String>**](String.md)| | + **http** | [**List<String>**](String.md)| | + **url** | [**List<String>**](String.md)| | + **context** | [**List<String>**](String.md)| | + +### Return type + + +CompletableFuture> + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | + diff --git a/samples/client/petstore/java/native-async/docs/FakeClassnameTags123Api.md b/samples/client/petstore/java/native-async/docs/FakeClassnameTags123Api.md index 783fd1eb4c7f..181506415f05 100644 --- a/samples/client/petstore/java/native-async/docs/FakeClassnameTags123Api.md +++ b/samples/client/petstore/java/native-async/docs/FakeClassnameTags123Api.md @@ -5,6 +5,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- [**testClassname**](FakeClassnameTags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case +[**testClassnameWithHttpInfo**](FakeClassnameTags123Api.md#testClassnameWithHttpInfo) | **PATCH** /fake_classname_test | To test class name in snake case @@ -43,8 +44,7 @@ public class Example { Client body = new Client(); // Client | client model try { CompletableFuture result = apiInstance.testClassname(body); - - System.out.println(result); + System.out.println(result.get()); } catch (ApiException e) { System.err.println("Exception when calling FakeClassnameTags123Api#testClassname"); System.err.println("Status code: " + e.getCode()); @@ -82,3 +82,86 @@ CompletableFuture<[**Client**](Client.md)> |-------------|-------------|------------------| | **200** | successful operation | - | +## testClassnameWithHttpInfo + +> CompletableFuture> testClassname testClassnameWithHttpInfo(body) + +To test class name in snake case + +To test class name in snake case + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeClassnameTags123Api; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + // Configure API key authorization: api_key_query + ApiKeyAuth api_key_query = (ApiKeyAuth) defaultClient.getAuthentication("api_key_query"); + api_key_query.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //api_key_query.setApiKeyPrefix("Token"); + + FakeClassnameTags123Api apiInstance = new FakeClassnameTags123Api(defaultClient); + Client body = new Client(); // Client | client model + try { + CompletableFuture> response = apiInstance.testClassnameWithHttpInfo(body); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling FakeClassnameTags123Api#testClassname"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling FakeClassnameTags123Api#testClassname"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Client**](Client.md)| client model | + +### Return type + +CompletableFuture> + + +### Authorization + +[api_key_query](../README.md#api_key_query) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + diff --git a/samples/client/petstore/java/native-async/docs/PetApi.md b/samples/client/petstore/java/native-async/docs/PetApi.md index dcb57ab1f9b3..e0c78ee52283 100644 --- a/samples/client/petstore/java/native-async/docs/PetApi.md +++ b/samples/client/petstore/java/native-async/docs/PetApi.md @@ -5,14 +5,23 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- [**addPet**](PetApi.md#addPet) | **POST** /pet | Add a new pet to the store +[**addPetWithHttpInfo**](PetApi.md#addPetWithHttpInfo) | **POST** /pet | Add a new pet to the store [**deletePet**](PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet +[**deletePetWithHttpInfo**](PetApi.md#deletePetWithHttpInfo) | **DELETE** /pet/{petId} | Deletes a pet [**findPetsByStatus**](PetApi.md#findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status +[**findPetsByStatusWithHttpInfo**](PetApi.md#findPetsByStatusWithHttpInfo) | **GET** /pet/findByStatus | Finds Pets by status [**findPetsByTags**](PetApi.md#findPetsByTags) | **GET** /pet/findByTags | Finds Pets by tags +[**findPetsByTagsWithHttpInfo**](PetApi.md#findPetsByTagsWithHttpInfo) | **GET** /pet/findByTags | Finds Pets by tags [**getPetById**](PetApi.md#getPetById) | **GET** /pet/{petId} | Find pet by ID +[**getPetByIdWithHttpInfo**](PetApi.md#getPetByIdWithHttpInfo) | **GET** /pet/{petId} | Find pet by ID [**updatePet**](PetApi.md#updatePet) | **PUT** /pet | Update an existing pet +[**updatePetWithHttpInfo**](PetApi.md#updatePetWithHttpInfo) | **PUT** /pet | Update an existing pet [**updatePetWithForm**](PetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data +[**updatePetWithFormWithHttpInfo**](PetApi.md#updatePetWithFormWithHttpInfo) | **POST** /pet/{petId} | Updates a pet in the store with form data [**uploadFile**](PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image +[**uploadFileWithHttpInfo**](PetApi.md#uploadFileWithHttpInfo) | **POST** /pet/{petId}/uploadImage | uploads an image [**uploadFileWithRequiredFile**](PetApi.md#uploadFileWithRequiredFile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) +[**uploadFileWithRequiredFileWithHttpInfo**](PetApi.md#uploadFileWithRequiredFileWithHttpInfo) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) @@ -47,12 +56,713 @@ public class Example { Pet body = new Pet(); // Pet | Pet object that needs to be added to the store try { CompletableFuture result = apiInstance.addPet(body); + } catch (ApiException e) { + System.err.println("Exception when calling PetApi#addPet"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + +### Return type + + +CompletableFuture (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + +- **Content-Type**: application/json, application/xml +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **405** | Invalid input | - | + +## addPetWithHttpInfo + +> CompletableFuture> addPet addPetWithHttpInfo(body) + +Add a new pet to the store + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.PetApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + // Configure OAuth2 access token for authorization: petstore_auth + OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); + petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); + + PetApi apiInstance = new PetApi(defaultClient); + Pet body = new Pet(); // Pet | Pet object that needs to be added to the store + try { + CompletableFuture> response = apiInstance.addPetWithHttpInfo(body); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling PetApi#addPet"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling PetApi#addPet"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + +### Return type + + +CompletableFuture> + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + +- **Content-Type**: application/json, application/xml +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **405** | Invalid input | - | + + +## deletePet + +> CompletableFuture deletePet(petId, apiKey) + +Deletes a pet + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.PetApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + // Configure OAuth2 access token for authorization: petstore_auth + OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); + petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); + + PetApi apiInstance = new PetApi(defaultClient); + Long petId = 56L; // Long | Pet id to delete + String apiKey = "apiKey_example"; // String | + try { + CompletableFuture result = apiInstance.deletePet(petId, apiKey); + } catch (ApiException e) { + System.err.println("Exception when calling PetApi#deletePet"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **Long**| Pet id to delete | + **apiKey** | **String**| | [optional] + +### Return type + + +CompletableFuture (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid pet value | - | + +## deletePetWithHttpInfo + +> CompletableFuture> deletePet deletePetWithHttpInfo(petId, apiKey) + +Deletes a pet + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.PetApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + // Configure OAuth2 access token for authorization: petstore_auth + OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); + petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); + + PetApi apiInstance = new PetApi(defaultClient); + Long petId = 56L; // Long | Pet id to delete + String apiKey = "apiKey_example"; // String | + try { + CompletableFuture> response = apiInstance.deletePetWithHttpInfo(petId, apiKey); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling PetApi#deletePet"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling PetApi#deletePet"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **Long**| Pet id to delete | + **apiKey** | **String**| | [optional] + +### Return type + + +CompletableFuture> + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid pet value | - | + + +## findPetsByStatus + +> CompletableFuture> findPetsByStatus(status) + +Finds Pets by status + +Multiple status values can be provided with comma separated strings + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.PetApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + // Configure OAuth2 access token for authorization: petstore_auth + OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); + petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); + + PetApi apiInstance = new PetApi(defaultClient); + List status = Arrays.asList("available"); // List | Status values that need to be considered for filter + try { + CompletableFuture> result = apiInstance.findPetsByStatus(status); + System.out.println(result.get()); + } catch (ApiException e) { + System.err.println("Exception when calling PetApi#findPetsByStatus"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **status** | [**List<String>**](String.md)| Status values that need to be considered for filter | [enum: available, pending, sold] + +### Return type + +CompletableFuture<[**List<Pet>**](Pet.md)> + + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid status value | - | + +## findPetsByStatusWithHttpInfo + +> CompletableFuture>> findPetsByStatus findPetsByStatusWithHttpInfo(status) + +Finds Pets by status + +Multiple status values can be provided with comma separated strings + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.PetApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + // Configure OAuth2 access token for authorization: petstore_auth + OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); + petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); + + PetApi apiInstance = new PetApi(defaultClient); + List status = Arrays.asList("available"); // List | Status values that need to be considered for filter + try { + CompletableFuture>> response = apiInstance.findPetsByStatusWithHttpInfo(status); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling PetApi#findPetsByStatus"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling PetApi#findPetsByStatus"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **status** | [**List<String>**](String.md)| Status values that need to be considered for filter | [enum: available, pending, sold] + +### Return type + +CompletableFuture> + + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid status value | - | + + +## findPetsByTags + +> CompletableFuture> findPetsByTags(tags) + +Finds Pets by tags + +Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.PetApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + // Configure OAuth2 access token for authorization: petstore_auth + OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); + petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); + + PetApi apiInstance = new PetApi(defaultClient); + Set tags = Arrays.asList(); // Set | Tags to filter by + try { + CompletableFuture> result = apiInstance.findPetsByTags(tags); + System.out.println(result.get()); + } catch (ApiException e) { + System.err.println("Exception when calling PetApi#findPetsByTags"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **tags** | [**Set<String>**](String.md)| Tags to filter by | + +### Return type + +CompletableFuture<[**Set<Pet>**](Pet.md)> + + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid tag value | - | + +## findPetsByTagsWithHttpInfo + +> CompletableFuture>> findPetsByTags findPetsByTagsWithHttpInfo(tags) + +Finds Pets by tags + +Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.PetApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + // Configure OAuth2 access token for authorization: petstore_auth + OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); + petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); + + PetApi apiInstance = new PetApi(defaultClient); + Set tags = Arrays.asList(); // Set | Tags to filter by + try { + CompletableFuture>> response = apiInstance.findPetsByTagsWithHttpInfo(tags); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling PetApi#findPetsByTags"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling PetApi#findPetsByTags"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **tags** | [**Set<String>**](String.md)| Tags to filter by | + +### Return type + +CompletableFuture> + + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid tag value | - | + + +## getPetById + +> CompletableFuture getPetById(petId) + +Find pet by ID + +Returns a single pet + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.PetApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + // Configure API key authorization: api_key + ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key"); + api_key.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //api_key.setApiKeyPrefix("Token"); + + PetApi apiInstance = new PetApi(defaultClient); + Long petId = 56L; // Long | ID of pet to return + try { + CompletableFuture result = apiInstance.getPetById(petId); + System.out.println(result.get()); + } catch (ApiException e) { + System.err.println("Exception when calling PetApi#getPetById"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **Long**| ID of pet to return | + +### Return type + +CompletableFuture<[**Pet**](Pet.md)> + + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid ID supplied | - | +| **404** | Pet not found | - | + +## getPetByIdWithHttpInfo + +> CompletableFuture> getPetById getPetByIdWithHttpInfo(petId) +Find pet by ID + +Returns a single pet + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.PetApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + // Configure API key authorization: api_key + ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key"); + api_key.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //api_key.setApiKeyPrefix("Token"); + + PetApi apiInstance = new PetApi(defaultClient); + Long petId = 56L; // Long | ID of pet to return + try { + CompletableFuture> response = apiInstance.getPetByIdWithHttpInfo(petId); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling PetApi#getPetById"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); } catch (ApiException e) { - System.err.println("Exception when calling PetApi#addPet"); + System.err.println("Exception when calling PetApi#getPetById"); System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); e.printStackTrace(); } } @@ -64,34 +774,35 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **petId** | **Long**| ID of pet to return | ### Return type +CompletableFuture> -CompletableFuture (empty response body) ### Authorization -[petstore_auth](../README.md#petstore_auth) +[api_key](../README.md#api_key) ### HTTP request headers -- **Content-Type**: application/json, application/xml -- **Accept**: Not defined +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| | **200** | successful operation | - | -| **405** | Invalid input | - | +| **400** | Invalid ID supplied | - | +| **404** | Pet not found | - | -## deletePet +## updatePet -> CompletableFuture deletePet(petId, apiKey) +> CompletableFuture updatePet(body) -Deletes a pet +Update an existing pet ### Example @@ -115,13 +826,11 @@ public class Example { petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(defaultClient); - Long petId = 56L; // Long | Pet id to delete - String apiKey = "apiKey_example"; // String | + Pet body = new Pet(); // Pet | Pet object that needs to be added to the store try { - CompletableFuture result = apiInstance.deletePet(petId, apiKey); - + CompletableFuture result = apiInstance.updatePet(body); } catch (ApiException e) { - System.err.println("Exception when calling PetApi#deletePet"); + System.err.println("Exception when calling PetApi#updatePet"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -136,8 +845,7 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **petId** | **Long**| Pet id to delete | - **apiKey** | **String**| | [optional] + **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | ### Return type @@ -150,23 +858,22 @@ CompletableFuture (empty response body) ### HTTP request headers -- **Content-Type**: Not defined +- **Content-Type**: application/json, application/xml - **Accept**: Not defined ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| | **200** | successful operation | - | -| **400** | Invalid pet value | - | - - -## findPetsByStatus +| **400** | Invalid ID supplied | - | +| **404** | Pet not found | - | +| **405** | Validation exception | - | -> CompletableFuture> findPetsByStatus(status) +## updatePetWithHttpInfo -Finds Pets by status +> CompletableFuture> updatePet updatePetWithHttpInfo(body) -Multiple status values can be provided with comma separated strings +Update an existing pet ### Example @@ -174,6 +881,7 @@ Multiple status values can be provided with comma separated strings // Import classes: import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; import org.openapitools.client.Configuration; import org.openapitools.client.auth.*; import org.openapitools.client.models.*; @@ -190,16 +898,23 @@ public class Example { petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(defaultClient); - List status = Arrays.asList("available"); // List | Status values that need to be considered for filter + Pet body = new Pet(); // Pet | Pet object that needs to be added to the store try { - CompletableFuture> result = apiInstance.findPetsByStatus(status); - - System.out.println(result); + CompletableFuture> response = apiInstance.updatePetWithHttpInfo(body); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling PetApi#updatePet"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); } catch (ApiException e) { - System.err.println("Exception when calling PetApi#findPetsByStatus"); + System.err.println("Exception when calling PetApi#updatePet"); System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); e.printStackTrace(); } } @@ -211,12 +926,12 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **status** | [**List<String>**](String.md)| Status values that need to be considered for filter | [enum: available, pending, sold] + **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | ### Return type -CompletableFuture<[**List<Pet>**](Pet.md)> +CompletableFuture> ### Authorization @@ -224,23 +939,23 @@ CompletableFuture<[**List<Pet>**](Pet.md)> ### HTTP request headers -- **Content-Type**: Not defined -- **Accept**: application/xml, application/json +- **Content-Type**: application/json, application/xml +- **Accept**: Not defined ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| | **200** | successful operation | - | -| **400** | Invalid status value | - | - +| **400** | Invalid ID supplied | - | +| **404** | Pet not found | - | +| **405** | Validation exception | - | -## findPetsByTags -> CompletableFuture> findPetsByTags(tags) +## updatePetWithForm -Finds Pets by tags +> CompletableFuture updatePetWithForm(petId, name, status) -Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. +Updates a pet in the store with form data ### Example @@ -264,13 +979,13 @@ public class Example { petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(defaultClient); - Set tags = Arrays.asList(); // Set | Tags to filter by + Long petId = 56L; // Long | ID of pet that needs to be updated + String name = "name_example"; // String | Updated name of the pet + String status = "status_example"; // String | Updated status of the pet try { - CompletableFuture> result = apiInstance.findPetsByTags(tags); - - System.out.println(result); + CompletableFuture result = apiInstance.updatePetWithForm(petId, name, status); } catch (ApiException e) { - System.err.println("Exception when calling PetApi#findPetsByTags"); + System.err.println("Exception when calling PetApi#updatePetWithForm"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -285,12 +1000,14 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **tags** | [**Set<String>**](String.md)| Tags to filter by | + **petId** | **Long**| ID of pet that needs to be updated | + **name** | **String**| Updated name of the pet | [optional] + **status** | **String**| Updated status of the pet | [optional] ### Return type -CompletableFuture<[**Set<Pet>**](Pet.md)> +CompletableFuture (empty response body) ### Authorization @@ -298,23 +1015,19 @@ CompletableFuture<[**Set<Pet>**](Pet.md)> ### HTTP request headers -- **Content-Type**: Not defined -- **Accept**: application/xml, application/json +- **Content-Type**: application/x-www-form-urlencoded +- **Accept**: Not defined ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -| **200** | successful operation | - | -| **400** | Invalid tag value | - | - - -## getPetById +| **405** | Invalid input | - | -> CompletableFuture getPetById(petId) +## updatePetWithFormWithHttpInfo -Find pet by ID +> CompletableFuture> updatePetWithForm updatePetWithFormWithHttpInfo(petId, name, status) -Returns a single pet +Updates a pet in the store with form data ### Example @@ -322,6 +1035,7 @@ Returns a single pet // Import classes: import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; import org.openapitools.client.Configuration; import org.openapitools.client.auth.*; import org.openapitools.client.models.*; @@ -333,23 +1047,30 @@ public class Example { ApiClient defaultClient = Configuration.getDefaultApiClient(); defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); - // Configure API key authorization: api_key - ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key"); - api_key.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //api_key.setApiKeyPrefix("Token"); + // Configure OAuth2 access token for authorization: petstore_auth + OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); + petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(defaultClient); - Long petId = 56L; // Long | ID of pet to return + Long petId = 56L; // Long | ID of pet that needs to be updated + String name = "name_example"; // String | Updated name of the pet + String status = "status_example"; // String | Updated status of the pet try { - CompletableFuture result = apiInstance.getPetById(petId); - - System.out.println(result); + CompletableFuture> response = apiInstance.updatePetWithFormWithHttpInfo(petId, name, status); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling PetApi#updatePetWithForm"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); } catch (ApiException e) { - System.err.println("Exception when calling PetApi#getPetById"); + System.err.println("Exception when calling PetApi#updatePetWithForm"); System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); e.printStackTrace(); } } @@ -361,35 +1082,35 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **petId** | **Long**| ID of pet to return | + **petId** | **Long**| ID of pet that needs to be updated | + **name** | **String**| Updated name of the pet | [optional] + **status** | **String**| Updated status of the pet | [optional] ### Return type -CompletableFuture<[**Pet**](Pet.md)> +CompletableFuture> ### Authorization -[api_key](../README.md#api_key) +[petstore_auth](../README.md#petstore_auth) ### HTTP request headers -- **Content-Type**: Not defined -- **Accept**: application/xml, application/json +- **Content-Type**: application/x-www-form-urlencoded +- **Accept**: Not defined ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -| **200** | successful operation | - | -| **400** | Invalid ID supplied | - | -| **404** | Pet not found | - | +| **405** | Invalid input | - | -## updatePet +## uploadFile -> CompletableFuture updatePet(body) +> CompletableFuture uploadFile(petId, additionalMetadata, file) -Update an existing pet +uploads an image ### Example @@ -413,12 +1134,14 @@ public class Example { petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(defaultClient); - Pet body = new Pet(); // Pet | Pet object that needs to be added to the store + Long petId = 56L; // Long | ID of pet to update + String additionalMetadata = "additionalMetadata_example"; // String | Additional data to pass to server + File file = new File("/path/to/file"); // File | file to upload try { - CompletableFuture result = apiInstance.updatePet(body); - + CompletableFuture result = apiInstance.uploadFile(petId, additionalMetadata, file); + System.out.println(result.get()); } catch (ApiException e) { - System.err.println("Exception when calling PetApi#updatePet"); + System.err.println("Exception when calling PetApi#uploadFile"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -433,12 +1156,14 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **petId** | **Long**| ID of pet to update | + **additionalMetadata** | **String**| Additional data to pass to server | [optional] + **file** | **File**| file to upload | [optional] ### Return type +CompletableFuture<[**ModelApiResponse**](ModelApiResponse.md)> -CompletableFuture (empty response body) ### Authorization @@ -446,23 +1171,19 @@ CompletableFuture (empty response body) ### HTTP request headers -- **Content-Type**: application/json, application/xml -- **Accept**: Not defined +- **Content-Type**: multipart/form-data +- **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| | **200** | successful operation | - | -| **400** | Invalid ID supplied | - | -| **404** | Pet not found | - | -| **405** | Validation exception | - | - -## updatePetWithForm +## uploadFileWithHttpInfo -> CompletableFuture updatePetWithForm(petId, name, status) +> CompletableFuture> uploadFile uploadFileWithHttpInfo(petId, additionalMetadata, file) -Updates a pet in the store with form data +uploads an image ### Example @@ -470,6 +1191,7 @@ Updates a pet in the store with form data // Import classes: import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; import org.openapitools.client.Configuration; import org.openapitools.client.auth.*; import org.openapitools.client.models.*; @@ -486,17 +1208,26 @@ public class Example { petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(defaultClient); - Long petId = 56L; // Long | ID of pet that needs to be updated - String name = "name_example"; // String | Updated name of the pet - String status = "status_example"; // String | Updated status of the pet + Long petId = 56L; // Long | ID of pet to update + String additionalMetadata = "additionalMetadata_example"; // String | Additional data to pass to server + File file = new File("/path/to/file"); // File | file to upload try { - CompletableFuture result = apiInstance.updatePetWithForm(petId, name, status); - + CompletableFuture> response = apiInstance.uploadFileWithHttpInfo(petId, additionalMetadata, file); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling PetApi#uploadFile"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); } catch (ApiException e) { - System.err.println("Exception when calling PetApi#updatePetWithForm"); + System.err.println("Exception when calling PetApi#uploadFile"); System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); e.printStackTrace(); } } @@ -508,14 +1239,14 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **petId** | **Long**| ID of pet that needs to be updated | - **name** | **String**| Updated name of the pet | [optional] - **status** | **String**| Updated status of the pet | [optional] + **petId** | **Long**| ID of pet to update | + **additionalMetadata** | **String**| Additional data to pass to server | [optional] + **file** | **File**| file to upload | [optional] ### Return type +CompletableFuture> -CompletableFuture (empty response body) ### Authorization @@ -523,20 +1254,20 @@ CompletableFuture (empty response body) ### HTTP request headers -- **Content-Type**: application/x-www-form-urlencoded -- **Accept**: Not defined +- **Content-Type**: multipart/form-data +- **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -| **405** | Invalid input | - | +| **200** | successful operation | - | -## uploadFile +## uploadFileWithRequiredFile -> CompletableFuture uploadFile(petId, additionalMetadata, file) +> CompletableFuture uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata) -uploads an image +uploads an image (required) ### Example @@ -561,14 +1292,13 @@ public class Example { PetApi apiInstance = new PetApi(defaultClient); Long petId = 56L; // Long | ID of pet to update + File requiredFile = new File("/path/to/file"); // File | file to upload String additionalMetadata = "additionalMetadata_example"; // String | Additional data to pass to server - File file = new File("/path/to/file"); // File | file to upload try { - CompletableFuture result = apiInstance.uploadFile(petId, additionalMetadata, file); - - System.out.println(result); + CompletableFuture result = apiInstance.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata); + System.out.println(result.get()); } catch (ApiException e) { - System.err.println("Exception when calling PetApi#uploadFile"); + System.err.println("Exception when calling PetApi#uploadFileWithRequiredFile"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -584,8 +1314,8 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **petId** | **Long**| ID of pet to update | + **requiredFile** | **File**| file to upload | **additionalMetadata** | **String**| Additional data to pass to server | [optional] - **file** | **File**| file to upload | [optional] ### Return type @@ -606,10 +1336,9 @@ CompletableFuture<[**ModelApiResponse**](ModelApiResponse.md)> |-------------|-------------|------------------| | **200** | successful operation | - | +## uploadFileWithRequiredFileWithHttpInfo -## uploadFileWithRequiredFile - -> CompletableFuture uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata) +> CompletableFuture> uploadFileWithRequiredFile uploadFileWithRequiredFileWithHttpInfo(petId, requiredFile, additionalMetadata) uploads an image (required) @@ -619,6 +1348,7 @@ uploads an image (required) // Import classes: import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; import org.openapitools.client.Configuration; import org.openapitools.client.auth.*; import org.openapitools.client.models.*; @@ -639,14 +1369,22 @@ public class Example { File requiredFile = new File("/path/to/file"); // File | file to upload String additionalMetadata = "additionalMetadata_example"; // String | Additional data to pass to server try { - CompletableFuture result = apiInstance.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata); - - System.out.println(result); + CompletableFuture> response = apiInstance.uploadFileWithRequiredFileWithHttpInfo(petId, requiredFile, additionalMetadata); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling PetApi#uploadFileWithRequiredFile"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); } catch (ApiException e) { System.err.println("Exception when calling PetApi#uploadFileWithRequiredFile"); System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); e.printStackTrace(); } } @@ -664,7 +1402,7 @@ Name | Type | Description | Notes ### Return type -CompletableFuture<[**ModelApiResponse**](ModelApiResponse.md)> +CompletableFuture> ### Authorization diff --git a/samples/client/petstore/java/native-async/docs/StoreApi.md b/samples/client/petstore/java/native-async/docs/StoreApi.md index 40705f50dcff..452c1b85789a 100644 --- a/samples/client/petstore/java/native-async/docs/StoreApi.md +++ b/samples/client/petstore/java/native-async/docs/StoreApi.md @@ -5,9 +5,13 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- [**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID +[**deleteOrderWithHttpInfo**](StoreApi.md#deleteOrderWithHttpInfo) | **DELETE** /store/order/{order_id} | Delete purchase order by ID [**getInventory**](StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status +[**getInventoryWithHttpInfo**](StoreApi.md#getInventoryWithHttpInfo) | **GET** /store/inventory | Returns pet inventories by status [**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{order_id} | Find purchase order by ID +[**getOrderByIdWithHttpInfo**](StoreApi.md#getOrderByIdWithHttpInfo) | **GET** /store/order/{order_id} | Find purchase order by ID [**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet +[**placeOrderWithHttpInfo**](StoreApi.md#placeOrderWithHttpInfo) | **POST** /store/order | Place an order for a pet @@ -39,7 +43,6 @@ public class Example { String orderId = "orderId_example"; // String | ID of the order that needs to be deleted try { CompletableFuture result = apiInstance.deleteOrder(orderId); - } catch (ApiException e) { System.err.println("Exception when calling StoreApi#deleteOrder"); System.err.println("Status code: " + e.getCode()); @@ -78,6 +81,82 @@ No authorization required | **400** | Invalid ID supplied | - | | **404** | Order not found | - | +## deleteOrderWithHttpInfo + +> CompletableFuture> deleteOrder deleteOrderWithHttpInfo(orderId) + +Delete purchase order by ID + +For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.StoreApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + StoreApi apiInstance = new StoreApi(defaultClient); + String orderId = "orderId_example"; // String | ID of the order that needs to be deleted + try { + CompletableFuture> response = apiInstance.deleteOrderWithHttpInfo(orderId); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling StoreApi#deleteOrder"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling StoreApi#deleteOrder"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **orderId** | **String**| ID of the order that needs to be deleted | + +### Return type + + +CompletableFuture> + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid ID supplied | - | +| **404** | Order not found | - | + ## getInventory @@ -113,8 +192,7 @@ public class Example { StoreApi apiInstance = new StoreApi(defaultClient); try { CompletableFuture> result = apiInstance.getInventory(); - - System.out.println(result); + System.out.println(result.get()); } catch (ApiException e) { System.err.println("Exception when calling StoreApi#getInventory"); System.err.println("Status code: " + e.getCode()); @@ -135,6 +213,85 @@ This endpoint does not need any parameter. CompletableFuture<**Map<String, Integer>**> +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +## getInventoryWithHttpInfo + +> CompletableFuture>> getInventory getInventoryWithHttpInfo() + +Returns pet inventories by status + +Returns a map of status codes to quantities + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.StoreApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + // Configure API key authorization: api_key + ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key"); + api_key.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //api_key.setApiKeyPrefix("Token"); + + StoreApi apiInstance = new StoreApi(defaultClient); + try { + CompletableFuture>> response = apiInstance.getInventoryWithHttpInfo(); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling StoreApi#getInventory"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling StoreApi#getInventory"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +CompletableFuture> + + ### Authorization [api_key](../README.md#api_key) @@ -178,8 +335,7 @@ public class Example { Long orderId = 56L; // Long | ID of pet that needs to be fetched try { CompletableFuture result = apiInstance.getOrderById(orderId); - - System.out.println(result); + System.out.println(result.get()); } catch (ApiException e) { System.err.println("Exception when calling StoreApi#getOrderById"); System.err.println("Status code: " + e.getCode()); @@ -203,6 +359,84 @@ Name | Type | Description | Notes CompletableFuture<[**Order**](Order.md)> +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid ID supplied | - | +| **404** | Order not found | - | + +## getOrderByIdWithHttpInfo + +> CompletableFuture> getOrderById getOrderByIdWithHttpInfo(orderId) + +Find purchase order by ID + +For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.StoreApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + StoreApi apiInstance = new StoreApi(defaultClient); + Long orderId = 56L; // Long | ID of pet that needs to be fetched + try { + CompletableFuture> response = apiInstance.getOrderByIdWithHttpInfo(orderId); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling StoreApi#getOrderById"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling StoreApi#getOrderById"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **orderId** | **Long**| ID of pet that needs to be fetched | + +### Return type + +CompletableFuture> + + ### Authorization No authorization required @@ -246,8 +480,7 @@ public class Example { Order body = new Order(); // Order | order placed for purchasing the pet try { CompletableFuture result = apiInstance.placeOrder(body); - - System.out.println(result); + System.out.println(result.get()); } catch (ApiException e) { System.err.println("Exception when calling StoreApi#placeOrder"); System.err.println("Status code: " + e.getCode()); @@ -286,3 +519,78 @@ No authorization required | **200** | successful operation | - | | **400** | Invalid Order | - | +## placeOrderWithHttpInfo + +> CompletableFuture> placeOrder placeOrderWithHttpInfo(body) + +Place an order for a pet + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.StoreApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + StoreApi apiInstance = new StoreApi(defaultClient); + Order body = new Order(); // Order | order placed for purchasing the pet + try { + CompletableFuture> response = apiInstance.placeOrderWithHttpInfo(body); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling StoreApi#placeOrder"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling StoreApi#placeOrder"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Order**](Order.md)| order placed for purchasing the pet | + +### Return type + +CompletableFuture> + + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid Order | - | + diff --git a/samples/client/petstore/java/native-async/docs/UserApi.md b/samples/client/petstore/java/native-async/docs/UserApi.md index c5b24efa9f82..ef3c6265600a 100644 --- a/samples/client/petstore/java/native-async/docs/UserApi.md +++ b/samples/client/petstore/java/native-async/docs/UserApi.md @@ -5,13 +5,21 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- [**createUser**](UserApi.md#createUser) | **POST** /user | Create user +[**createUserWithHttpInfo**](UserApi.md#createUserWithHttpInfo) | **POST** /user | Create user [**createUsersWithArrayInput**](UserApi.md#createUsersWithArrayInput) | **POST** /user/createWithArray | Creates list of users with given input array +[**createUsersWithArrayInputWithHttpInfo**](UserApi.md#createUsersWithArrayInputWithHttpInfo) | **POST** /user/createWithArray | Creates list of users with given input array [**createUsersWithListInput**](UserApi.md#createUsersWithListInput) | **POST** /user/createWithList | Creates list of users with given input array +[**createUsersWithListInputWithHttpInfo**](UserApi.md#createUsersWithListInputWithHttpInfo) | **POST** /user/createWithList | Creates list of users with given input array [**deleteUser**](UserApi.md#deleteUser) | **DELETE** /user/{username} | Delete user +[**deleteUserWithHttpInfo**](UserApi.md#deleteUserWithHttpInfo) | **DELETE** /user/{username} | Delete user [**getUserByName**](UserApi.md#getUserByName) | **GET** /user/{username} | Get user by user name +[**getUserByNameWithHttpInfo**](UserApi.md#getUserByNameWithHttpInfo) | **GET** /user/{username} | Get user by user name [**loginUser**](UserApi.md#loginUser) | **GET** /user/login | Logs user into the system +[**loginUserWithHttpInfo**](UserApi.md#loginUserWithHttpInfo) | **GET** /user/login | Logs user into the system [**logoutUser**](UserApi.md#logoutUser) | **GET** /user/logout | Logs out current logged in user session +[**logoutUserWithHttpInfo**](UserApi.md#logoutUserWithHttpInfo) | **GET** /user/logout | Logs out current logged in user session [**updateUser**](UserApi.md#updateUser) | **PUT** /user/{username} | Updated user +[**updateUserWithHttpInfo**](UserApi.md#updateUserWithHttpInfo) | **PUT** /user/{username} | Updated user @@ -43,7 +51,6 @@ public class Example { User body = new User(); // User | Created user object try { CompletableFuture result = apiInstance.createUser(body); - } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUser"); System.err.println("Status code: " + e.getCode()); @@ -81,6 +88,81 @@ No authorization required |-------------|-------------|------------------| | **0** | successful operation | - | +## createUserWithHttpInfo + +> CompletableFuture> createUser createUserWithHttpInfo(body) + +Create user + +This can only be done by the logged in user. + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.UserApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + UserApi apiInstance = new UserApi(defaultClient); + User body = new User(); // User | Created user object + try { + CompletableFuture> response = apiInstance.createUserWithHttpInfo(body); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling UserApi#createUser"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#createUser"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**User**](User.md)| Created user object | + +### Return type + + +CompletableFuture> + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + ## createUsersWithArrayInput @@ -108,7 +190,6 @@ public class Example { List body = Arrays.asList(); // List | List of user object try { CompletableFuture result = apiInstance.createUsersWithArrayInput(body); - } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUsersWithArrayInput"); System.err.println("Status code: " + e.getCode()); @@ -146,6 +227,79 @@ No authorization required |-------------|-------------|------------------| | **0** | successful operation | - | +## createUsersWithArrayInputWithHttpInfo + +> CompletableFuture> createUsersWithArrayInput createUsersWithArrayInputWithHttpInfo(body) + +Creates list of users with given input array + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.UserApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + UserApi apiInstance = new UserApi(defaultClient); + List body = Arrays.asList(); // List | List of user object + try { + CompletableFuture> response = apiInstance.createUsersWithArrayInputWithHttpInfo(body); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling UserApi#createUsersWithArrayInput"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#createUsersWithArrayInput"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**List<User>**](User.md)| List of user object | + +### Return type + + +CompletableFuture> + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + ## createUsersWithListInput @@ -173,7 +327,6 @@ public class Example { List body = Arrays.asList(); // List | List of user object try { CompletableFuture result = apiInstance.createUsersWithListInput(body); - } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUsersWithListInput"); System.err.println("Status code: " + e.getCode()); @@ -211,6 +364,79 @@ No authorization required |-------------|-------------|------------------| | **0** | successful operation | - | +## createUsersWithListInputWithHttpInfo + +> CompletableFuture> createUsersWithListInput createUsersWithListInputWithHttpInfo(body) + +Creates list of users with given input array + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.UserApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + UserApi apiInstance = new UserApi(defaultClient); + List body = Arrays.asList(); // List | List of user object + try { + CompletableFuture> response = apiInstance.createUsersWithListInputWithHttpInfo(body); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling UserApi#createUsersWithListInput"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#createUsersWithListInput"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**List<User>**](User.md)| List of user object | + +### Return type + + +CompletableFuture> + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + ## deleteUser @@ -240,7 +466,6 @@ public class Example { String username = "username_example"; // String | The name that needs to be deleted try { CompletableFuture result = apiInstance.deleteUser(username); - } catch (ApiException e) { System.err.println("Exception when calling UserApi#deleteUser"); System.err.println("Status code: " + e.getCode()); @@ -279,6 +504,82 @@ No authorization required | **400** | Invalid username supplied | - | | **404** | User not found | - | +## deleteUserWithHttpInfo + +> CompletableFuture> deleteUser deleteUserWithHttpInfo(username) + +Delete user + +This can only be done by the logged in user. + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.UserApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + UserApi apiInstance = new UserApi(defaultClient); + String username = "username_example"; // String | The name that needs to be deleted + try { + CompletableFuture> response = apiInstance.deleteUserWithHttpInfo(username); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling UserApi#deleteUser"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#deleteUser"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **String**| The name that needs to be deleted | + +### Return type + + +CompletableFuture> + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid username supplied | - | +| **404** | User not found | - | + ## getUserByName @@ -306,8 +607,7 @@ public class Example { String username = "username_example"; // String | The name that needs to be fetched. Use user1 for testing. try { CompletableFuture result = apiInstance.getUserByName(username); - - System.out.println(result); + System.out.println(result.get()); } catch (ApiException e) { System.err.println("Exception when calling UserApi#getUserByName"); System.err.println("Status code: " + e.getCode()); @@ -331,6 +631,82 @@ Name | Type | Description | Notes CompletableFuture<[**User**](User.md)> +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid username supplied | - | +| **404** | User not found | - | + +## getUserByNameWithHttpInfo + +> CompletableFuture> getUserByName getUserByNameWithHttpInfo(username) + +Get user by user name + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.UserApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + UserApi apiInstance = new UserApi(defaultClient); + String username = "username_example"; // String | The name that needs to be fetched. Use user1 for testing. + try { + CompletableFuture> response = apiInstance.getUserByNameWithHttpInfo(username); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling UserApi#getUserByName"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#getUserByName"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **String**| The name that needs to be fetched. Use user1 for testing. | + +### Return type + +CompletableFuture> + + ### Authorization No authorization required @@ -375,8 +751,7 @@ public class Example { String password = "password_example"; // String | The password for login in clear text try { CompletableFuture result = apiInstance.loginUser(username, password); - - System.out.println(result); + System.out.println(result.get()); } catch (ApiException e) { System.err.println("Exception when calling UserApi#loginUser"); System.err.println("Status code: " + e.getCode()); @@ -401,6 +776,83 @@ Name | Type | Description | Notes CompletableFuture<**String**> +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | * X-Rate-Limit - calls per hour allowed by the user
* X-Expires-After - date in UTC when token expires
| +| **400** | Invalid username/password supplied | - | + +## loginUserWithHttpInfo + +> CompletableFuture> loginUser loginUserWithHttpInfo(username, password) + +Logs user into the system + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.UserApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + UserApi apiInstance = new UserApi(defaultClient); + String username = "username_example"; // String | The user name for login + String password = "password_example"; // String | The password for login in clear text + try { + CompletableFuture> response = apiInstance.loginUserWithHttpInfo(username, password); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling UserApi#loginUser"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#loginUser"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **String**| The user name for login | + **password** | **String**| The password for login in clear text | + +### Return type + +CompletableFuture> + + ### Authorization No authorization required @@ -442,7 +894,6 @@ public class Example { UserApi apiInstance = new UserApi(defaultClient); try { CompletableFuture result = apiInstance.logoutUser(); - } catch (ApiException e) { System.err.println("Exception when calling UserApi#logoutUser"); System.err.println("Status code: " + e.getCode()); @@ -477,6 +928,75 @@ No authorization required |-------------|-------------|------------------| | **0** | successful operation | - | +## logoutUserWithHttpInfo + +> CompletableFuture> logoutUser logoutUserWithHttpInfo() + +Logs out current logged in user session + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.UserApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + UserApi apiInstance = new UserApi(defaultClient); + try { + CompletableFuture> response = apiInstance.logoutUserWithHttpInfo(); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling UserApi#logoutUser"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#logoutUser"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + + +CompletableFuture> + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + ## updateUser @@ -507,7 +1027,6 @@ public class Example { User body = new User(); // User | Updated user object try { CompletableFuture result = apiInstance.updateUser(username, body); - } catch (ApiException e) { System.err.println("Exception when calling UserApi#updateUser"); System.err.println("Status code: " + e.getCode()); @@ -547,3 +1066,81 @@ No authorization required | **400** | Invalid user supplied | - | | **404** | User not found | - | +## updateUserWithHttpInfo + +> CompletableFuture> updateUser updateUserWithHttpInfo(username, body) + +Updated user + +This can only be done by the logged in user. + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.UserApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + UserApi apiInstance = new UserApi(defaultClient); + String username = "username_example"; // String | name that need to be deleted + User body = new User(); // User | Updated user object + try { + CompletableFuture> response = apiInstance.updateUserWithHttpInfo(username, body); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling UserApi#updateUser"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#updateUser"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **String**| name that need to be deleted | + **body** | [**User**](User.md)| Updated user object | + +### Return type + + +CompletableFuture> + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid user supplied | - | +| **404** | User not found | - | + diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/ApiResponse.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/ApiResponse.java new file mode 100644 index 000000000000..9bb5cac17b41 --- /dev/null +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/ApiResponse.java @@ -0,0 +1,59 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import java.util.List; +import java.util.Map; + +/** + * API response returned by API call. + * + * @param The type of data that is deserialized from response body + */ +public class ApiResponse { + final private int statusCode; + final private Map> headers; + final private T data; + + /** + * @param statusCode The status code of HTTP response + * @param headers The headers of HTTP response + */ + public ApiResponse(int statusCode, Map> headers) { + this(statusCode, headers, null); + } + + /** + * @param statusCode The status code of HTTP response + * @param headers The headers of HTTP response + * @param data The object deserialized from response bod + */ + public ApiResponse(int statusCode, Map> headers, T data) { + this.statusCode = statusCode; + this.headers = headers; + this.data = data; + } + + public int getStatusCode() { + return statusCode; + } + + public Map> getHeaders() { + return headers; + } + + public T getData() { + return data; + } +} diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/api/AnotherFakeApi.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/api/AnotherFakeApi.java index 47f31d0c3b79..38c4a321f657 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/api/AnotherFakeApi.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/api/AnotherFakeApi.java @@ -14,6 +14,7 @@ import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; import org.openapitools.client.Pair; import org.openapitools.client.model.Client; @@ -59,34 +60,36 @@ public AnotherFakeApi(ApiClient apiClient) { memberVarResponseInterceptor = apiClient.getResponseInterceptor(); } + private ApiException getApiException(String operationId, HttpResponselocalVarResponse) { + return new ApiException(localVarResponse.statusCode(), + operationId + " call received non-success response", + localVarResponse.headers(), + localVarResponse.body()); + } + /** * To test special tags * To test special tags and operation ID starting with number * @param body client model (required) - * @return Client + * @return CompletableFuture<Client> * @throws ApiException if fails to make API call */ public CompletableFuture call123testSpecialTags(Client body) throws ApiException { try { HttpRequest.Builder localVarRequestBuilder = call123testSpecialTagsRequestBuilder(body); return memberVarHttpClient.sendAsync( - localVarRequestBuilder.build(), - HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { - if (localVarResponse.statusCode()/ 100 != 2) { - return CompletableFuture.failedFuture(new ApiException(localVarResponse.statusCode(), - "call123testSpecialTags call received non-success response", - localVarResponse.headers(), - localVarResponse.body()) + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("call123testSpecialTags", localVarResponse)); + } + try { + return CompletableFuture.completedFuture( + memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) ); - } else { - try { - return CompletableFuture.completedFuture( - memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) - ); - } catch (IOException e) { - return CompletableFuture.failedFuture(new ApiException(e)); - } - } + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } }); } catch (ApiException e) { @@ -94,6 +97,40 @@ public CompletableFuture call123testSpecialTags(Client body) throws ApiE } } + /** + * To test special tags + * To test special tags and operation ID starting with number + * @param body client model (required) + * @return CompletableFuture<ApiResponse<Client>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> call123testSpecialTagsWithHttpInfo(Client body) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = call123testSpecialTagsRequestBuilder(body); + return memberVarHttpClient.sendAsync( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("call123testSpecialTags", localVarResponse)); + } + try { + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {})) + ); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + } + ); + } + catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + private HttpRequest.Builder call123testSpecialTagsRequestBuilder(Client body) throws ApiException { // verify the required parameter 'body' is set if (body == null) { diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/api/FakeApi.java index 8f739343f3c9..166ca9d80406 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/api/FakeApi.java @@ -14,6 +14,7 @@ import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; import org.openapitools.client.Pair; import java.math.BigDecimal; @@ -67,6 +68,13 @@ public FakeApi(ApiClient apiClient) { memberVarResponseInterceptor = apiClient.getResponseInterceptor(); } + private ApiException getApiException(String operationId, HttpResponselocalVarResponse) { + return new ApiException(localVarResponse.statusCode(), + operationId + " call received non-success response", + localVarResponse.headers(), + localVarResponse.body()); + } + /** * creates an XmlItem * this route creates an XmlItem @@ -77,17 +85,12 @@ public CompletableFuture createXmlItem(XmlItem xmlItem) throws ApiExceptio try { HttpRequest.Builder localVarRequestBuilder = createXmlItemRequestBuilder(xmlItem); return memberVarHttpClient.sendAsync( - localVarRequestBuilder.build(), - HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { - if (localVarResponse.statusCode()/ 100 != 2) { - return CompletableFuture.failedFuture(new ApiException(localVarResponse.statusCode(), - "createXmlItem call received non-success response", - localVarResponse.headers(), - localVarResponse.body()) - ); - } else { - return CompletableFuture.completedFuture(null); - } + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("createXmlItem", localVarResponse)); + } + return CompletableFuture.completedFuture(null); }); } catch (ApiException e) { @@ -95,6 +98,33 @@ public CompletableFuture createXmlItem(XmlItem xmlItem) throws ApiExceptio } } + /** + * creates an XmlItem + * this route creates an XmlItem + * @param xmlItem XmlItem Body (required) + * @return CompletableFuture<ApiResponse<Void>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> createXmlItemWithHttpInfo(XmlItem xmlItem) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = createXmlItemRequestBuilder(xmlItem); + return memberVarHttpClient.sendAsync( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("createXmlItem", localVarResponse)); + } + return CompletableFuture.completedFuture( + new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null) + ); + } + ); + } + catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + private HttpRequest.Builder createXmlItemRequestBuilder(XmlItem xmlItem) throws ApiException { // verify the required parameter 'xmlItem' is set if (xmlItem == null) { @@ -128,30 +158,25 @@ private HttpRequest.Builder createXmlItemRequestBuilder(XmlItem xmlItem) throws * * Test serialization of outer boolean types * @param body Input boolean as post body (optional) - * @return Boolean + * @return CompletableFuture<Boolean> * @throws ApiException if fails to make API call */ public CompletableFuture fakeOuterBooleanSerialize(Boolean body) throws ApiException { try { HttpRequest.Builder localVarRequestBuilder = fakeOuterBooleanSerializeRequestBuilder(body); return memberVarHttpClient.sendAsync( - localVarRequestBuilder.build(), - HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { - if (localVarResponse.statusCode()/ 100 != 2) { - return CompletableFuture.failedFuture(new ApiException(localVarResponse.statusCode(), - "fakeOuterBooleanSerialize call received non-success response", - localVarResponse.headers(), - localVarResponse.body()) + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("fakeOuterBooleanSerialize", localVarResponse)); + } + try { + return CompletableFuture.completedFuture( + memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) ); - } else { - try { - return CompletableFuture.completedFuture( - memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) - ); - } catch (IOException e) { - return CompletableFuture.failedFuture(new ApiException(e)); - } - } + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } }); } catch (ApiException e) { @@ -159,6 +184,40 @@ public CompletableFuture fakeOuterBooleanSerialize(Boolean body) throws } } + /** + * + * Test serialization of outer boolean types + * @param body Input boolean as post body (optional) + * @return CompletableFuture<ApiResponse<Boolean>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> fakeOuterBooleanSerializeWithHttpInfo(Boolean body) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = fakeOuterBooleanSerializeRequestBuilder(body); + return memberVarHttpClient.sendAsync( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("fakeOuterBooleanSerialize", localVarResponse)); + } + try { + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {})) + ); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + } + ); + } + catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + private HttpRequest.Builder fakeOuterBooleanSerializeRequestBuilder(Boolean body) throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -188,30 +247,25 @@ private HttpRequest.Builder fakeOuterBooleanSerializeRequestBuilder(Boolean body * * Test serialization of object with outer number type * @param body Input composite as post body (optional) - * @return OuterComposite + * @return CompletableFuture<OuterComposite> * @throws ApiException if fails to make API call */ public CompletableFuture fakeOuterCompositeSerialize(OuterComposite body) throws ApiException { try { HttpRequest.Builder localVarRequestBuilder = fakeOuterCompositeSerializeRequestBuilder(body); return memberVarHttpClient.sendAsync( - localVarRequestBuilder.build(), - HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { - if (localVarResponse.statusCode()/ 100 != 2) { - return CompletableFuture.failedFuture(new ApiException(localVarResponse.statusCode(), - "fakeOuterCompositeSerialize call received non-success response", - localVarResponse.headers(), - localVarResponse.body()) + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("fakeOuterCompositeSerialize", localVarResponse)); + } + try { + return CompletableFuture.completedFuture( + memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) ); - } else { - try { - return CompletableFuture.completedFuture( - memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) - ); - } catch (IOException e) { - return CompletableFuture.failedFuture(new ApiException(e)); - } - } + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } }); } catch (ApiException e) { @@ -219,6 +273,40 @@ public CompletableFuture fakeOuterCompositeSerialize(OuterCompos } } + /** + * + * Test serialization of object with outer number type + * @param body Input composite as post body (optional) + * @return CompletableFuture<ApiResponse<OuterComposite>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> fakeOuterCompositeSerializeWithHttpInfo(OuterComposite body) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = fakeOuterCompositeSerializeRequestBuilder(body); + return memberVarHttpClient.sendAsync( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("fakeOuterCompositeSerialize", localVarResponse)); + } + try { + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {})) + ); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + } + ); + } + catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + private HttpRequest.Builder fakeOuterCompositeSerializeRequestBuilder(OuterComposite body) throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -248,30 +336,25 @@ private HttpRequest.Builder fakeOuterCompositeSerializeRequestBuilder(OuterCompo * * Test serialization of outer number types * @param body Input number as post body (optional) - * @return BigDecimal + * @return CompletableFuture<BigDecimal> * @throws ApiException if fails to make API call */ public CompletableFuture fakeOuterNumberSerialize(BigDecimal body) throws ApiException { try { HttpRequest.Builder localVarRequestBuilder = fakeOuterNumberSerializeRequestBuilder(body); return memberVarHttpClient.sendAsync( - localVarRequestBuilder.build(), - HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { - if (localVarResponse.statusCode()/ 100 != 2) { - return CompletableFuture.failedFuture(new ApiException(localVarResponse.statusCode(), - "fakeOuterNumberSerialize call received non-success response", - localVarResponse.headers(), - localVarResponse.body()) + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("fakeOuterNumberSerialize", localVarResponse)); + } + try { + return CompletableFuture.completedFuture( + memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) ); - } else { - try { - return CompletableFuture.completedFuture( - memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) - ); - } catch (IOException e) { - return CompletableFuture.failedFuture(new ApiException(e)); - } - } + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } }); } catch (ApiException e) { @@ -279,6 +362,40 @@ public CompletableFuture fakeOuterNumberSerialize(BigDecimal body) t } } + /** + * + * Test serialization of outer number types + * @param body Input number as post body (optional) + * @return CompletableFuture<ApiResponse<BigDecimal>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> fakeOuterNumberSerializeWithHttpInfo(BigDecimal body) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = fakeOuterNumberSerializeRequestBuilder(body); + return memberVarHttpClient.sendAsync( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("fakeOuterNumberSerialize", localVarResponse)); + } + try { + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {})) + ); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + } + ); + } + catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + private HttpRequest.Builder fakeOuterNumberSerializeRequestBuilder(BigDecimal body) throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -308,30 +425,25 @@ private HttpRequest.Builder fakeOuterNumberSerializeRequestBuilder(BigDecimal bo * * Test serialization of outer string types * @param body Input string as post body (optional) - * @return String + * @return CompletableFuture<String> * @throws ApiException if fails to make API call */ public CompletableFuture fakeOuterStringSerialize(String body) throws ApiException { try { HttpRequest.Builder localVarRequestBuilder = fakeOuterStringSerializeRequestBuilder(body); return memberVarHttpClient.sendAsync( - localVarRequestBuilder.build(), - HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { - if (localVarResponse.statusCode()/ 100 != 2) { - return CompletableFuture.failedFuture(new ApiException(localVarResponse.statusCode(), - "fakeOuterStringSerialize call received non-success response", - localVarResponse.headers(), - localVarResponse.body()) + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("fakeOuterStringSerialize", localVarResponse)); + } + try { + return CompletableFuture.completedFuture( + memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) ); - } else { - try { - return CompletableFuture.completedFuture( - memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) - ); - } catch (IOException e) { - return CompletableFuture.failedFuture(new ApiException(e)); - } - } + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } }); } catch (ApiException e) { @@ -339,6 +451,40 @@ public CompletableFuture fakeOuterStringSerialize(String body) throws Ap } } + /** + * + * Test serialization of outer string types + * @param body Input string as post body (optional) + * @return CompletableFuture<ApiResponse<String>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> fakeOuterStringSerializeWithHttpInfo(String body) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = fakeOuterStringSerializeRequestBuilder(body); + return memberVarHttpClient.sendAsync( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("fakeOuterStringSerialize", localVarResponse)); + } + try { + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {})) + ); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + } + ); + } + catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + private HttpRequest.Builder fakeOuterStringSerializeRequestBuilder(String body) throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -374,17 +520,12 @@ public CompletableFuture testBodyWithFileSchema(FileSchemaTestClass body) try { HttpRequest.Builder localVarRequestBuilder = testBodyWithFileSchemaRequestBuilder(body); return memberVarHttpClient.sendAsync( - localVarRequestBuilder.build(), - HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { - if (localVarResponse.statusCode()/ 100 != 2) { - return CompletableFuture.failedFuture(new ApiException(localVarResponse.statusCode(), - "testBodyWithFileSchema call received non-success response", - localVarResponse.headers(), - localVarResponse.body()) - ); - } else { - return CompletableFuture.completedFuture(null); - } + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("testBodyWithFileSchema", localVarResponse)); + } + return CompletableFuture.completedFuture(null); }); } catch (ApiException e) { @@ -392,6 +533,33 @@ public CompletableFuture testBodyWithFileSchema(FileSchemaTestClass body) } } + /** + * + * For this test, the body for this request much reference a schema named `File`. + * @param body (required) + * @return CompletableFuture<ApiResponse<Void>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> testBodyWithFileSchemaWithHttpInfo(FileSchemaTestClass body) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = testBodyWithFileSchemaRequestBuilder(body); + return memberVarHttpClient.sendAsync( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("testBodyWithFileSchema", localVarResponse)); + } + return CompletableFuture.completedFuture( + new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null) + ); + } + ); + } + catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + private HttpRequest.Builder testBodyWithFileSchemaRequestBuilder(FileSchemaTestClass body) throws ApiException { // verify the required parameter 'body' is set if (body == null) { @@ -432,17 +600,12 @@ public CompletableFuture testBodyWithQueryParams(String query, User body) try { HttpRequest.Builder localVarRequestBuilder = testBodyWithQueryParamsRequestBuilder(query, body); return memberVarHttpClient.sendAsync( - localVarRequestBuilder.build(), - HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { - if (localVarResponse.statusCode()/ 100 != 2) { - return CompletableFuture.failedFuture(new ApiException(localVarResponse.statusCode(), - "testBodyWithQueryParams call received non-success response", - localVarResponse.headers(), - localVarResponse.body()) - ); - } else { - return CompletableFuture.completedFuture(null); - } + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("testBodyWithQueryParams", localVarResponse)); + } + return CompletableFuture.completedFuture(null); }); } catch (ApiException e) { @@ -450,6 +613,34 @@ public CompletableFuture testBodyWithQueryParams(String query, User body) } } + /** + * + * + * @param query (required) + * @param body (required) + * @return CompletableFuture<ApiResponse<Void>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> testBodyWithQueryParamsWithHttpInfo(String query, User body) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = testBodyWithQueryParamsRequestBuilder(query, body); + return memberVarHttpClient.sendAsync( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("testBodyWithQueryParams", localVarResponse)); + } + return CompletableFuture.completedFuture( + new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null) + ); + } + ); + } + catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + private HttpRequest.Builder testBodyWithQueryParamsRequestBuilder(String query, User body) throws ApiException { // verify the required parameter 'query' is set if (query == null) { @@ -496,30 +687,25 @@ private HttpRequest.Builder testBodyWithQueryParamsRequestBuilder(String query, * To test \"client\" model * To test \"client\" model * @param body client model (required) - * @return Client + * @return CompletableFuture<Client> * @throws ApiException if fails to make API call */ public CompletableFuture testClientModel(Client body) throws ApiException { try { HttpRequest.Builder localVarRequestBuilder = testClientModelRequestBuilder(body); return memberVarHttpClient.sendAsync( - localVarRequestBuilder.build(), - HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { - if (localVarResponse.statusCode()/ 100 != 2) { - return CompletableFuture.failedFuture(new ApiException(localVarResponse.statusCode(), - "testClientModel call received non-success response", - localVarResponse.headers(), - localVarResponse.body()) + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("testClientModel", localVarResponse)); + } + try { + return CompletableFuture.completedFuture( + memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) ); - } else { - try { - return CompletableFuture.completedFuture( - memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) - ); - } catch (IOException e) { - return CompletableFuture.failedFuture(new ApiException(e)); - } - } + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } }); } catch (ApiException e) { @@ -527,6 +713,40 @@ public CompletableFuture testClientModel(Client body) throws ApiExceptio } } + /** + * To test \"client\" model + * To test \"client\" model + * @param body client model (required) + * @return CompletableFuture<ApiResponse<Client>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> testClientModelWithHttpInfo(Client body) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = testClientModelRequestBuilder(body); + return memberVarHttpClient.sendAsync( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("testClientModel", localVarResponse)); + } + try { + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {})) + ); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + } + ); + } + catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + private HttpRequest.Builder testClientModelRequestBuilder(Client body) throws ApiException { // verify the required parameter 'body' is set if (body == null) { @@ -579,17 +799,12 @@ public CompletableFuture testEndpointParameters(BigDecimal number, Double try { HttpRequest.Builder localVarRequestBuilder = testEndpointParametersRequestBuilder(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); return memberVarHttpClient.sendAsync( - localVarRequestBuilder.build(), - HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { - if (localVarResponse.statusCode()/ 100 != 2) { - return CompletableFuture.failedFuture(new ApiException(localVarResponse.statusCode(), - "testEndpointParameters call received non-success response", - localVarResponse.headers(), - localVarResponse.body()) - ); - } else { - return CompletableFuture.completedFuture(null); - } + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("testEndpointParameters", localVarResponse)); + } + return CompletableFuture.completedFuture(null); }); } catch (ApiException e) { @@ -597,6 +812,46 @@ public CompletableFuture testEndpointParameters(BigDecimal number, Double } } + /** + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * @param number None (required) + * @param _double None (required) + * @param patternWithoutDelimiter None (required) + * @param _byte None (required) + * @param integer None (optional) + * @param int32 None (optional) + * @param int64 None (optional) + * @param _float None (optional) + * @param string None (optional) + * @param binary None (optional) + * @param date None (optional) + * @param dateTime None (optional) + * @param password None (optional) + * @param paramCallback None (optional) + * @return CompletableFuture<ApiResponse<Void>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> testEndpointParametersWithHttpInfo(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, File binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = testEndpointParametersRequestBuilder(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); + return memberVarHttpClient.sendAsync( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("testEndpointParameters", localVarResponse)); + } + return CompletableFuture.completedFuture( + new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null) + ); + } + ); + } + catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + private HttpRequest.Builder testEndpointParametersRequestBuilder(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, File binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback) throws ApiException { // verify the required parameter 'number' is set if (number == null) { @@ -649,17 +904,12 @@ public CompletableFuture testEnumParameters(List enumHeaderStringA try { HttpRequest.Builder localVarRequestBuilder = testEnumParametersRequestBuilder(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); return memberVarHttpClient.sendAsync( - localVarRequestBuilder.build(), - HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { - if (localVarResponse.statusCode()/ 100 != 2) { - return CompletableFuture.failedFuture(new ApiException(localVarResponse.statusCode(), - "testEnumParameters call received non-success response", - localVarResponse.headers(), - localVarResponse.body()) - ); - } else { - return CompletableFuture.completedFuture(null); - } + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("testEnumParameters", localVarResponse)); + } + return CompletableFuture.completedFuture(null); }); } catch (ApiException e) { @@ -667,6 +917,40 @@ public CompletableFuture testEnumParameters(List enumHeaderStringA } } + /** + * To test enum parameters + * To test enum parameters + * @param enumHeaderStringArray Header parameter enum test (string array) (optional + * @param enumHeaderString Header parameter enum test (string) (optional, default to -efg) + * @param enumQueryStringArray Query parameter enum test (string array) (optional + * @param enumQueryString Query parameter enum test (string) (optional, default to -efg) + * @param enumQueryInteger Query parameter enum test (double) (optional) + * @param enumQueryDouble Query parameter enum test (double) (optional) + * @param enumFormStringArray Form parameter enum test (string array) (optional + * @param enumFormString Form parameter enum test (string) (optional, default to -efg) + * @return CompletableFuture<ApiResponse<Void>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> testEnumParametersWithHttpInfo(List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List enumFormStringArray, String enumFormString) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = testEnumParametersRequestBuilder(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); + return memberVarHttpClient.sendAsync( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("testEnumParameters", localVarResponse)); + } + return CompletableFuture.completedFuture( + new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null) + ); + } + ); + } + catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + private HttpRequest.Builder testEnumParametersRequestBuilder(List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List enumFormStringArray, String enumFormString) throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -720,6 +1004,23 @@ public CompletableFuture testGroupParameters(APItestGroupParametersRequest return testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); } + /** + * Fake endpoint to test group parameters (optional) + * Fake endpoint to test group parameters (optional) + * @param testGroupParametersRequest {@link APItestGroupParametersRequest} + * @return CompletableFuture<ApiResponse<Void>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> testGroupParametersWithHttpInfo(APItestGroupParametersRequest testGroupParametersRequest) throws ApiException { + Integer requiredStringGroup = testGroupParametersRequest.requiredStringGroup(); + Boolean requiredBooleanGroup = testGroupParametersRequest.requiredBooleanGroup(); + Long requiredInt64Group = testGroupParametersRequest.requiredInt64Group(); + Integer stringGroup = testGroupParametersRequest.stringGroup(); + Boolean booleanGroup = testGroupParametersRequest.booleanGroup(); + Long int64Group = testGroupParametersRequest.int64Group(); + return testGroupParametersWithHttpInfo(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); + } + /** * Fake endpoint to test group parameters (optional) * Fake endpoint to test group parameters (optional) @@ -735,17 +1036,12 @@ public CompletableFuture testGroupParameters(Integer requiredStringGroup, try { HttpRequest.Builder localVarRequestBuilder = testGroupParametersRequestBuilder(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); return memberVarHttpClient.sendAsync( - localVarRequestBuilder.build(), - HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { - if (localVarResponse.statusCode()/ 100 != 2) { - return CompletableFuture.failedFuture(new ApiException(localVarResponse.statusCode(), - "testGroupParameters call received non-success response", - localVarResponse.headers(), - localVarResponse.body()) - ); - } else { - return CompletableFuture.completedFuture(null); - } + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("testGroupParameters", localVarResponse)); + } + return CompletableFuture.completedFuture(null); }); } catch (ApiException e) { @@ -753,6 +1049,38 @@ public CompletableFuture testGroupParameters(Integer requiredStringGroup, } } + /** + * Fake endpoint to test group parameters (optional) + * Fake endpoint to test group parameters (optional) + * @param requiredStringGroup Required String in group parameters (required) + * @param requiredBooleanGroup Required Boolean in group parameters (required) + * @param requiredInt64Group Required Integer in group parameters (required) + * @param stringGroup String in group parameters (optional) + * @param booleanGroup Boolean in group parameters (optional) + * @param int64Group Integer in group parameters (optional) + * @return CompletableFuture<ApiResponse<Void>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> testGroupParametersWithHttpInfo(Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = testGroupParametersRequestBuilder(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); + return memberVarHttpClient.sendAsync( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("testGroupParameters", localVarResponse)); + } + return CompletableFuture.completedFuture( + new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null) + ); + } + ); + } + catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + private HttpRequest.Builder testGroupParametersRequestBuilder(Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group) throws ApiException { // verify the required parameter 'requiredStringGroup' is set if (requiredStringGroup == null) { @@ -889,17 +1217,12 @@ public CompletableFuture testInlineAdditionalProperties(Map { - if (localVarResponse.statusCode()/ 100 != 2) { - return CompletableFuture.failedFuture(new ApiException(localVarResponse.statusCode(), - "testInlineAdditionalProperties call received non-success response", - localVarResponse.headers(), - localVarResponse.body()) - ); - } else { - return CompletableFuture.completedFuture(null); - } + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("testInlineAdditionalProperties", localVarResponse)); + } + return CompletableFuture.completedFuture(null); }); } catch (ApiException e) { @@ -907,6 +1230,33 @@ public CompletableFuture testInlineAdditionalProperties(Map> testInlineAdditionalPropertiesWithHttpInfo(Map param) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = testInlineAdditionalPropertiesRequestBuilder(param); + return memberVarHttpClient.sendAsync( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("testInlineAdditionalProperties", localVarResponse)); + } + return CompletableFuture.completedFuture( + new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null) + ); + } + ); + } + catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + private HttpRequest.Builder testInlineAdditionalPropertiesRequestBuilder(Map param) throws ApiException { // verify the required parameter 'param' is set if (param == null) { @@ -947,17 +1297,12 @@ public CompletableFuture testJsonFormData(String param, String param2) thr try { HttpRequest.Builder localVarRequestBuilder = testJsonFormDataRequestBuilder(param, param2); return memberVarHttpClient.sendAsync( - localVarRequestBuilder.build(), - HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { - if (localVarResponse.statusCode()/ 100 != 2) { - return CompletableFuture.failedFuture(new ApiException(localVarResponse.statusCode(), - "testJsonFormData call received non-success response", - localVarResponse.headers(), - localVarResponse.body()) - ); - } else { - return CompletableFuture.completedFuture(null); - } + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("testJsonFormData", localVarResponse)); + } + return CompletableFuture.completedFuture(null); }); } catch (ApiException e) { @@ -965,6 +1310,34 @@ public CompletableFuture testJsonFormData(String param, String param2) thr } } + /** + * test json serialization of form data + * + * @param param field1 (required) + * @param param2 field2 (required) + * @return CompletableFuture<ApiResponse<Void>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> testJsonFormDataWithHttpInfo(String param, String param2) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = testJsonFormDataRequestBuilder(param, param2); + return memberVarHttpClient.sendAsync( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("testJsonFormData", localVarResponse)); + } + return CompletableFuture.completedFuture( + new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null) + ); + } + ); + } + catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + private HttpRequest.Builder testJsonFormDataRequestBuilder(String param, String param2) throws ApiException { // verify the required parameter 'param' is set if (param == null) { @@ -1006,17 +1379,12 @@ public CompletableFuture testQueryParameterCollectionFormat(List p try { HttpRequest.Builder localVarRequestBuilder = testQueryParameterCollectionFormatRequestBuilder(pipe, ioutil, http, url, context); return memberVarHttpClient.sendAsync( - localVarRequestBuilder.build(), - HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { - if (localVarResponse.statusCode()/ 100 != 2) { - return CompletableFuture.failedFuture(new ApiException(localVarResponse.statusCode(), - "testQueryParameterCollectionFormat call received non-success response", - localVarResponse.headers(), - localVarResponse.body()) - ); - } else { - return CompletableFuture.completedFuture(null); - } + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("testQueryParameterCollectionFormat", localVarResponse)); + } + return CompletableFuture.completedFuture(null); }); } catch (ApiException e) { @@ -1024,6 +1392,37 @@ public CompletableFuture testQueryParameterCollectionFormat(List p } } + /** + * + * To test the collection format in query parameters + * @param pipe (required) + * @param ioutil (required) + * @param http (required) + * @param url (required) + * @param context (required) + * @return CompletableFuture<ApiResponse<Void>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> testQueryParameterCollectionFormatWithHttpInfo(List pipe, List ioutil, List http, List url, List context) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = testQueryParameterCollectionFormatRequestBuilder(pipe, ioutil, http, url, context); + return memberVarHttpClient.sendAsync( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("testQueryParameterCollectionFormat", localVarResponse)); + } + return CompletableFuture.completedFuture( + new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null) + ); + } + ); + } + catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + private HttpRequest.Builder testQueryParameterCollectionFormatRequestBuilder(List pipe, List ioutil, List http, List url, List context) throws ApiException { // verify the required parameter 'pipe' is set if (pipe == null) { diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java index 575762fbb2b8..a04a5441414a 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java @@ -14,6 +14,7 @@ import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; import org.openapitools.client.Pair; import org.openapitools.client.model.Client; @@ -59,34 +60,36 @@ public FakeClassnameTags123Api(ApiClient apiClient) { memberVarResponseInterceptor = apiClient.getResponseInterceptor(); } + private ApiException getApiException(String operationId, HttpResponselocalVarResponse) { + return new ApiException(localVarResponse.statusCode(), + operationId + " call received non-success response", + localVarResponse.headers(), + localVarResponse.body()); + } + /** * To test class name in snake case * To test class name in snake case * @param body client model (required) - * @return Client + * @return CompletableFuture<Client> * @throws ApiException if fails to make API call */ public CompletableFuture testClassname(Client body) throws ApiException { try { HttpRequest.Builder localVarRequestBuilder = testClassnameRequestBuilder(body); return memberVarHttpClient.sendAsync( - localVarRequestBuilder.build(), - HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { - if (localVarResponse.statusCode()/ 100 != 2) { - return CompletableFuture.failedFuture(new ApiException(localVarResponse.statusCode(), - "testClassname call received non-success response", - localVarResponse.headers(), - localVarResponse.body()) + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("testClassname", localVarResponse)); + } + try { + return CompletableFuture.completedFuture( + memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) ); - } else { - try { - return CompletableFuture.completedFuture( - memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) - ); - } catch (IOException e) { - return CompletableFuture.failedFuture(new ApiException(e)); - } - } + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } }); } catch (ApiException e) { @@ -94,6 +97,40 @@ public CompletableFuture testClassname(Client body) throws ApiException } } + /** + * To test class name in snake case + * To test class name in snake case + * @param body client model (required) + * @return CompletableFuture<ApiResponse<Client>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> testClassnameWithHttpInfo(Client body) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = testClassnameRequestBuilder(body); + return memberVarHttpClient.sendAsync( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("testClassname", localVarResponse)); + } + try { + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {})) + ); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + } + ); + } + catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + private HttpRequest.Builder testClassnameRequestBuilder(Client body) throws ApiException { // verify the required parameter 'body' is set if (body == null) { diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/api/PetApi.java index 6061337d5672..4e9d6f34af79 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/api/PetApi.java @@ -14,6 +14,7 @@ import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; import org.openapitools.client.Pair; import java.io.File; @@ -62,6 +63,13 @@ public PetApi(ApiClient apiClient) { memberVarResponseInterceptor = apiClient.getResponseInterceptor(); } + private ApiException getApiException(String operationId, HttpResponselocalVarResponse) { + return new ApiException(localVarResponse.statusCode(), + operationId + " call received non-success response", + localVarResponse.headers(), + localVarResponse.body()); + } + /** * Add a new pet to the store * @@ -72,17 +80,12 @@ public CompletableFuture addPet(Pet body) throws ApiException { try { HttpRequest.Builder localVarRequestBuilder = addPetRequestBuilder(body); return memberVarHttpClient.sendAsync( - localVarRequestBuilder.build(), - HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { - if (localVarResponse.statusCode()/ 100 != 2) { - return CompletableFuture.failedFuture(new ApiException(localVarResponse.statusCode(), - "addPet call received non-success response", - localVarResponse.headers(), - localVarResponse.body()) - ); - } else { - return CompletableFuture.completedFuture(null); - } + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("addPet", localVarResponse)); + } + return CompletableFuture.completedFuture(null); }); } catch (ApiException e) { @@ -90,6 +93,33 @@ public CompletableFuture addPet(Pet body) throws ApiException { } } + /** + * Add a new pet to the store + * + * @param body Pet object that needs to be added to the store (required) + * @return CompletableFuture<ApiResponse<Void>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> addPetWithHttpInfo(Pet body) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = addPetRequestBuilder(body); + return memberVarHttpClient.sendAsync( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("addPet", localVarResponse)); + } + return CompletableFuture.completedFuture( + new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null) + ); + } + ); + } + catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + private HttpRequest.Builder addPetRequestBuilder(Pet body) throws ApiException { // verify the required parameter 'body' is set if (body == null) { @@ -130,17 +160,12 @@ public CompletableFuture deletePet(Long petId, String apiKey) throws ApiEx try { HttpRequest.Builder localVarRequestBuilder = deletePetRequestBuilder(petId, apiKey); return memberVarHttpClient.sendAsync( - localVarRequestBuilder.build(), - HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { - if (localVarResponse.statusCode()/ 100 != 2) { - return CompletableFuture.failedFuture(new ApiException(localVarResponse.statusCode(), - "deletePet call received non-success response", - localVarResponse.headers(), - localVarResponse.body()) - ); - } else { - return CompletableFuture.completedFuture(null); - } + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("deletePet", localVarResponse)); + } + return CompletableFuture.completedFuture(null); }); } catch (ApiException e) { @@ -148,6 +173,34 @@ public CompletableFuture deletePet(Long petId, String apiKey) throws ApiEx } } + /** + * Deletes a pet + * + * @param petId Pet id to delete (required) + * @param apiKey (optional) + * @return CompletableFuture<ApiResponse<Void>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> deletePetWithHttpInfo(Long petId, String apiKey) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = deletePetRequestBuilder(petId, apiKey); + return memberVarHttpClient.sendAsync( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("deletePet", localVarResponse)); + } + return CompletableFuture.completedFuture( + new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null) + ); + } + ); + } + catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + private HttpRequest.Builder deletePetRequestBuilder(Long petId, String apiKey) throws ApiException { // verify the required parameter 'petId' is set if (petId == null) { @@ -179,30 +232,25 @@ private HttpRequest.Builder deletePetRequestBuilder(Long petId, String apiKey) t * Finds Pets by status * Multiple status values can be provided with comma separated strings * @param status Status values that need to be considered for filter (required) - * @return List<Pet> + * @return CompletableFuture<List<Pet>> * @throws ApiException if fails to make API call */ public CompletableFuture> findPetsByStatus(List status) throws ApiException { try { HttpRequest.Builder localVarRequestBuilder = findPetsByStatusRequestBuilder(status); return memberVarHttpClient.sendAsync( - localVarRequestBuilder.build(), - HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { - if (localVarResponse.statusCode()/ 100 != 2) { - return CompletableFuture.failedFuture(new ApiException(localVarResponse.statusCode(), - "findPetsByStatus call received non-success response", - localVarResponse.headers(), - localVarResponse.body()) + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("findPetsByStatus", localVarResponse)); + } + try { + return CompletableFuture.completedFuture( + memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference>() {}) ); - } else { - try { - return CompletableFuture.completedFuture( - memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference>() {}) - ); - } catch (IOException e) { - return CompletableFuture.failedFuture(new ApiException(e)); - } - } + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } }); } catch (ApiException e) { @@ -210,6 +258,40 @@ public CompletableFuture> findPetsByStatus(List status) throws } } + /** + * Finds Pets by status + * Multiple status values can be provided with comma separated strings + * @param status Status values that need to be considered for filter (required) + * @return CompletableFuture<ApiResponse<List<Pet>>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture>> findPetsByStatusWithHttpInfo(List status) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = findPetsByStatusRequestBuilder(status); + return memberVarHttpClient.sendAsync( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("findPetsByStatus", localVarResponse)); + } + try { + return CompletableFuture.completedFuture( + new ApiResponse>( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference>() {})) + ); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + } + ); + } + catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + private HttpRequest.Builder findPetsByStatusRequestBuilder(List status) throws ApiException { // verify the required parameter 'status' is set if (status == null) { @@ -246,7 +328,7 @@ private HttpRequest.Builder findPetsByStatusRequestBuilder(List status) * Finds Pets by tags * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by (required) - * @return Set<Pet> + * @return CompletableFuture<Set<Pet>> * @throws ApiException if fails to make API call * @deprecated */ @@ -255,23 +337,18 @@ public CompletableFuture> findPetsByTags(Set tags) throws ApiEx try { HttpRequest.Builder localVarRequestBuilder = findPetsByTagsRequestBuilder(tags); return memberVarHttpClient.sendAsync( - localVarRequestBuilder.build(), - HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { - if (localVarResponse.statusCode()/ 100 != 2) { - return CompletableFuture.failedFuture(new ApiException(localVarResponse.statusCode(), - "findPetsByTags call received non-success response", - localVarResponse.headers(), - localVarResponse.body()) + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("findPetsByTags", localVarResponse)); + } + try { + return CompletableFuture.completedFuture( + memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference>() {}) ); - } else { - try { - return CompletableFuture.completedFuture( - memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference>() {}) - ); - } catch (IOException e) { - return CompletableFuture.failedFuture(new ApiException(e)); - } - } + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } }); } catch (ApiException e) { @@ -279,6 +356,42 @@ public CompletableFuture> findPetsByTags(Set tags) throws ApiEx } } + /** + * Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * @param tags Tags to filter by (required) + * @return CompletableFuture<ApiResponse<Set<Pet>>> + * @throws ApiException if fails to make API call + * @deprecated + */ + @Deprecated + public CompletableFuture>> findPetsByTagsWithHttpInfo(Set tags) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = findPetsByTagsRequestBuilder(tags); + return memberVarHttpClient.sendAsync( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("findPetsByTags", localVarResponse)); + } + try { + return CompletableFuture.completedFuture( + new ApiResponse>( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference>() {})) + ); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + } + ); + } + catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + private HttpRequest.Builder findPetsByTagsRequestBuilder(Set tags) throws ApiException { // verify the required parameter 'tags' is set if (tags == null) { @@ -315,30 +428,25 @@ private HttpRequest.Builder findPetsByTagsRequestBuilder(Set tags) throw * Find pet by ID * Returns a single pet * @param petId ID of pet to return (required) - * @return Pet + * @return CompletableFuture<Pet> * @throws ApiException if fails to make API call */ public CompletableFuture getPetById(Long petId) throws ApiException { try { HttpRequest.Builder localVarRequestBuilder = getPetByIdRequestBuilder(petId); return memberVarHttpClient.sendAsync( - localVarRequestBuilder.build(), - HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { - if (localVarResponse.statusCode()/ 100 != 2) { - return CompletableFuture.failedFuture(new ApiException(localVarResponse.statusCode(), - "getPetById call received non-success response", - localVarResponse.headers(), - localVarResponse.body()) + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("getPetById", localVarResponse)); + } + try { + return CompletableFuture.completedFuture( + memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) ); - } else { - try { - return CompletableFuture.completedFuture( - memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) - ); - } catch (IOException e) { - return CompletableFuture.failedFuture(new ApiException(e)); - } - } + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } }); } catch (ApiException e) { @@ -346,6 +454,40 @@ public CompletableFuture getPetById(Long petId) throws ApiException { } } + /** + * Find pet by ID + * Returns a single pet + * @param petId ID of pet to return (required) + * @return CompletableFuture<ApiResponse<Pet>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> getPetByIdWithHttpInfo(Long petId) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = getPetByIdRequestBuilder(petId); + return memberVarHttpClient.sendAsync( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("getPetById", localVarResponse)); + } + try { + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {})) + ); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + } + ); + } + catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + private HttpRequest.Builder getPetByIdRequestBuilder(Long petId) throws ApiException { // verify the required parameter 'petId' is set if (petId == null) { @@ -380,17 +522,12 @@ public CompletableFuture updatePet(Pet body) throws ApiException { try { HttpRequest.Builder localVarRequestBuilder = updatePetRequestBuilder(body); return memberVarHttpClient.sendAsync( - localVarRequestBuilder.build(), - HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { - if (localVarResponse.statusCode()/ 100 != 2) { - return CompletableFuture.failedFuture(new ApiException(localVarResponse.statusCode(), - "updatePet call received non-success response", - localVarResponse.headers(), - localVarResponse.body()) - ); - } else { - return CompletableFuture.completedFuture(null); - } + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("updatePet", localVarResponse)); + } + return CompletableFuture.completedFuture(null); }); } catch (ApiException e) { @@ -398,6 +535,33 @@ public CompletableFuture updatePet(Pet body) throws ApiException { } } + /** + * Update an existing pet + * + * @param body Pet object that needs to be added to the store (required) + * @return CompletableFuture<ApiResponse<Void>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> updatePetWithHttpInfo(Pet body) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = updatePetRequestBuilder(body); + return memberVarHttpClient.sendAsync( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("updatePet", localVarResponse)); + } + return CompletableFuture.completedFuture( + new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null) + ); + } + ); + } + catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + private HttpRequest.Builder updatePetRequestBuilder(Pet body) throws ApiException { // verify the required parameter 'body' is set if (body == null) { @@ -439,17 +603,12 @@ public CompletableFuture updatePetWithForm(Long petId, String name, String try { HttpRequest.Builder localVarRequestBuilder = updatePetWithFormRequestBuilder(petId, name, status); return memberVarHttpClient.sendAsync( - localVarRequestBuilder.build(), - HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { - if (localVarResponse.statusCode()/ 100 != 2) { - return CompletableFuture.failedFuture(new ApiException(localVarResponse.statusCode(), - "updatePetWithForm call received non-success response", - localVarResponse.headers(), - localVarResponse.body()) - ); - } else { - return CompletableFuture.completedFuture(null); - } + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("updatePetWithForm", localVarResponse)); + } + return CompletableFuture.completedFuture(null); }); } catch (ApiException e) { @@ -457,6 +616,35 @@ public CompletableFuture updatePetWithForm(Long petId, String name, String } } + /** + * Updates a pet in the store with form data + * + * @param petId ID of pet that needs to be updated (required) + * @param name Updated name of the pet (optional) + * @param status Updated status of the pet (optional) + * @return CompletableFuture<ApiResponse<Void>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> updatePetWithFormWithHttpInfo(Long petId, String name, String status) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = updatePetWithFormRequestBuilder(petId, name, status); + return memberVarHttpClient.sendAsync( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("updatePetWithForm", localVarResponse)); + } + return CompletableFuture.completedFuture( + new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null) + ); + } + ); + } + catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + private HttpRequest.Builder updatePetWithFormRequestBuilder(Long petId, String name, String status) throws ApiException { // verify the required parameter 'petId' is set if (petId == null) { @@ -487,30 +675,25 @@ private HttpRequest.Builder updatePetWithFormRequestBuilder(Long petId, String n * @param petId ID of pet to update (required) * @param additionalMetadata Additional data to pass to server (optional) * @param file file to upload (optional) - * @return ModelApiResponse + * @return CompletableFuture<ModelApiResponse> * @throws ApiException if fails to make API call */ public CompletableFuture uploadFile(Long petId, String additionalMetadata, File file) throws ApiException { try { HttpRequest.Builder localVarRequestBuilder = uploadFileRequestBuilder(petId, additionalMetadata, file); return memberVarHttpClient.sendAsync( - localVarRequestBuilder.build(), - HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { - if (localVarResponse.statusCode()/ 100 != 2) { - return CompletableFuture.failedFuture(new ApiException(localVarResponse.statusCode(), - "uploadFile call received non-success response", - localVarResponse.headers(), - localVarResponse.body()) + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("uploadFile", localVarResponse)); + } + try { + return CompletableFuture.completedFuture( + memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) ); - } else { - try { - return CompletableFuture.completedFuture( - memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) - ); - } catch (IOException e) { - return CompletableFuture.failedFuture(new ApiException(e)); - } - } + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } }); } catch (ApiException e) { @@ -518,6 +701,42 @@ public CompletableFuture uploadFile(Long petId, String additio } } + /** + * uploads an image + * + * @param petId ID of pet to update (required) + * @param additionalMetadata Additional data to pass to server (optional) + * @param file file to upload (optional) + * @return CompletableFuture<ApiResponse<ModelApiResponse>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> uploadFileWithHttpInfo(Long petId, String additionalMetadata, File file) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = uploadFileRequestBuilder(petId, additionalMetadata, file); + return memberVarHttpClient.sendAsync( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("uploadFile", localVarResponse)); + } + try { + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {})) + ); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + } + ); + } + catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + private HttpRequest.Builder uploadFileRequestBuilder(Long petId, String additionalMetadata, File file) throws ApiException { // verify the required parameter 'petId' is set if (petId == null) { @@ -548,30 +767,25 @@ private HttpRequest.Builder uploadFileRequestBuilder(Long petId, String addition * @param petId ID of pet to update (required) * @param requiredFile file to upload (required) * @param additionalMetadata Additional data to pass to server (optional) - * @return ModelApiResponse + * @return CompletableFuture<ModelApiResponse> * @throws ApiException if fails to make API call */ public CompletableFuture uploadFileWithRequiredFile(Long petId, File requiredFile, String additionalMetadata) throws ApiException { try { HttpRequest.Builder localVarRequestBuilder = uploadFileWithRequiredFileRequestBuilder(petId, requiredFile, additionalMetadata); return memberVarHttpClient.sendAsync( - localVarRequestBuilder.build(), - HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { - if (localVarResponse.statusCode()/ 100 != 2) { - return CompletableFuture.failedFuture(new ApiException(localVarResponse.statusCode(), - "uploadFileWithRequiredFile call received non-success response", - localVarResponse.headers(), - localVarResponse.body()) + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("uploadFileWithRequiredFile", localVarResponse)); + } + try { + return CompletableFuture.completedFuture( + memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) ); - } else { - try { - return CompletableFuture.completedFuture( - memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) - ); - } catch (IOException e) { - return CompletableFuture.failedFuture(new ApiException(e)); - } - } + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } }); } catch (ApiException e) { @@ -579,6 +793,42 @@ public CompletableFuture uploadFileWithRequiredFile(Long petId } } + /** + * uploads an image (required) + * + * @param petId ID of pet to update (required) + * @param requiredFile file to upload (required) + * @param additionalMetadata Additional data to pass to server (optional) + * @return CompletableFuture<ApiResponse<ModelApiResponse>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> uploadFileWithRequiredFileWithHttpInfo(Long petId, File requiredFile, String additionalMetadata) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = uploadFileWithRequiredFileRequestBuilder(petId, requiredFile, additionalMetadata); + return memberVarHttpClient.sendAsync( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("uploadFileWithRequiredFile", localVarResponse)); + } + try { + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {})) + ); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + } + ); + } + catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + private HttpRequest.Builder uploadFileWithRequiredFileRequestBuilder(Long petId, File requiredFile, String additionalMetadata) throws ApiException { // verify the required parameter 'petId' is set if (petId == null) { diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/api/StoreApi.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/api/StoreApi.java index 69097494bae3..41de754a4d95 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/api/StoreApi.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/api/StoreApi.java @@ -14,6 +14,7 @@ import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; import org.openapitools.client.Pair; import org.openapitools.client.model.Order; @@ -59,6 +60,13 @@ public StoreApi(ApiClient apiClient) { memberVarResponseInterceptor = apiClient.getResponseInterceptor(); } + private ApiException getApiException(String operationId, HttpResponselocalVarResponse) { + return new ApiException(localVarResponse.statusCode(), + operationId + " call received non-success response", + localVarResponse.headers(), + localVarResponse.body()); + } + /** * Delete purchase order by ID * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors @@ -69,17 +77,12 @@ public CompletableFuture deleteOrder(String orderId) throws ApiException { try { HttpRequest.Builder localVarRequestBuilder = deleteOrderRequestBuilder(orderId); return memberVarHttpClient.sendAsync( - localVarRequestBuilder.build(), - HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { - if (localVarResponse.statusCode()/ 100 != 2) { - return CompletableFuture.failedFuture(new ApiException(localVarResponse.statusCode(), - "deleteOrder call received non-success response", - localVarResponse.headers(), - localVarResponse.body()) - ); - } else { - return CompletableFuture.completedFuture(null); - } + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("deleteOrder", localVarResponse)); + } + return CompletableFuture.completedFuture(null); }); } catch (ApiException e) { @@ -87,6 +90,33 @@ public CompletableFuture deleteOrder(String orderId) throws ApiException { } } + /** + * Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * @param orderId ID of the order that needs to be deleted (required) + * @return CompletableFuture<ApiResponse<Void>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> deleteOrderWithHttpInfo(String orderId) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = deleteOrderRequestBuilder(orderId); + return memberVarHttpClient.sendAsync( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("deleteOrder", localVarResponse)); + } + return CompletableFuture.completedFuture( + new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null) + ); + } + ); + } + catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + private HttpRequest.Builder deleteOrderRequestBuilder(String orderId) throws ApiException { // verify the required parameter 'orderId' is set if (orderId == null) { @@ -114,30 +144,25 @@ private HttpRequest.Builder deleteOrderRequestBuilder(String orderId) throws Api /** * Returns pet inventories by status * Returns a map of status codes to quantities - * @return Map<String, Integer> + * @return CompletableFuture<Map<String, Integer>> * @throws ApiException if fails to make API call */ public CompletableFuture> getInventory() throws ApiException { try { HttpRequest.Builder localVarRequestBuilder = getInventoryRequestBuilder(); return memberVarHttpClient.sendAsync( - localVarRequestBuilder.build(), - HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { - if (localVarResponse.statusCode()/ 100 != 2) { - return CompletableFuture.failedFuture(new ApiException(localVarResponse.statusCode(), - "getInventory call received non-success response", - localVarResponse.headers(), - localVarResponse.body()) + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("getInventory", localVarResponse)); + } + try { + return CompletableFuture.completedFuture( + memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference>() {}) ); - } else { - try { - return CompletableFuture.completedFuture( - memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference>() {}) - ); - } catch (IOException e) { - return CompletableFuture.failedFuture(new ApiException(e)); - } - } + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } }); } catch (ApiException e) { @@ -145,6 +170,39 @@ public CompletableFuture> getInventory() throws ApiExceptio } } + /** + * Returns pet inventories by status + * Returns a map of status codes to quantities + * @return CompletableFuture<ApiResponse<Map<String, Integer>>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture>> getInventoryWithHttpInfo() throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = getInventoryRequestBuilder(); + return memberVarHttpClient.sendAsync( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("getInventory", localVarResponse)); + } + try { + return CompletableFuture.completedFuture( + new ApiResponse>( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference>() {})) + ); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + } + ); + } + catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + private HttpRequest.Builder getInventoryRequestBuilder() throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -168,30 +226,25 @@ private HttpRequest.Builder getInventoryRequestBuilder() throws ApiException { * Find purchase order by ID * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @param orderId ID of pet that needs to be fetched (required) - * @return Order + * @return CompletableFuture<Order> * @throws ApiException if fails to make API call */ public CompletableFuture getOrderById(Long orderId) throws ApiException { try { HttpRequest.Builder localVarRequestBuilder = getOrderByIdRequestBuilder(orderId); return memberVarHttpClient.sendAsync( - localVarRequestBuilder.build(), - HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { - if (localVarResponse.statusCode()/ 100 != 2) { - return CompletableFuture.failedFuture(new ApiException(localVarResponse.statusCode(), - "getOrderById call received non-success response", - localVarResponse.headers(), - localVarResponse.body()) + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("getOrderById", localVarResponse)); + } + try { + return CompletableFuture.completedFuture( + memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) ); - } else { - try { - return CompletableFuture.completedFuture( - memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) - ); - } catch (IOException e) { - return CompletableFuture.failedFuture(new ApiException(e)); - } - } + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } }); } catch (ApiException e) { @@ -199,6 +252,40 @@ public CompletableFuture getOrderById(Long orderId) throws ApiException { } } + /** + * Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * @param orderId ID of pet that needs to be fetched (required) + * @return CompletableFuture<ApiResponse<Order>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> getOrderByIdWithHttpInfo(Long orderId) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = getOrderByIdRequestBuilder(orderId); + return memberVarHttpClient.sendAsync( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("getOrderById", localVarResponse)); + } + try { + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {})) + ); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + } + ); + } + catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + private HttpRequest.Builder getOrderByIdRequestBuilder(Long orderId) throws ApiException { // verify the required parameter 'orderId' is set if (orderId == null) { @@ -227,30 +314,25 @@ private HttpRequest.Builder getOrderByIdRequestBuilder(Long orderId) throws ApiE * Place an order for a pet * * @param body order placed for purchasing the pet (required) - * @return Order + * @return CompletableFuture<Order> * @throws ApiException if fails to make API call */ public CompletableFuture placeOrder(Order body) throws ApiException { try { HttpRequest.Builder localVarRequestBuilder = placeOrderRequestBuilder(body); return memberVarHttpClient.sendAsync( - localVarRequestBuilder.build(), - HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { - if (localVarResponse.statusCode()/ 100 != 2) { - return CompletableFuture.failedFuture(new ApiException(localVarResponse.statusCode(), - "placeOrder call received non-success response", - localVarResponse.headers(), - localVarResponse.body()) + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("placeOrder", localVarResponse)); + } + try { + return CompletableFuture.completedFuture( + memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) ); - } else { - try { - return CompletableFuture.completedFuture( - memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) - ); - } catch (IOException e) { - return CompletableFuture.failedFuture(new ApiException(e)); - } - } + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } }); } catch (ApiException e) { @@ -258,6 +340,40 @@ public CompletableFuture placeOrder(Order body) throws ApiException { } } + /** + * Place an order for a pet + * + * @param body order placed for purchasing the pet (required) + * @return CompletableFuture<ApiResponse<Order>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> placeOrderWithHttpInfo(Order body) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = placeOrderRequestBuilder(body); + return memberVarHttpClient.sendAsync( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("placeOrder", localVarResponse)); + } + try { + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {})) + ); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + } + ); + } + catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + private HttpRequest.Builder placeOrderRequestBuilder(Order body) throws ApiException { // verify the required parameter 'body' is set if (body == null) { diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/api/UserApi.java index 9c933cfd406a..bb13d02a2030 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/api/UserApi.java @@ -14,6 +14,7 @@ import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; import org.openapitools.client.Pair; import org.openapitools.client.model.User; @@ -59,6 +60,13 @@ public UserApi(ApiClient apiClient) { memberVarResponseInterceptor = apiClient.getResponseInterceptor(); } + private ApiException getApiException(String operationId, HttpResponselocalVarResponse) { + return new ApiException(localVarResponse.statusCode(), + operationId + " call received non-success response", + localVarResponse.headers(), + localVarResponse.body()); + } + /** * Create user * This can only be done by the logged in user. @@ -69,17 +77,12 @@ public CompletableFuture createUser(User body) throws ApiException { try { HttpRequest.Builder localVarRequestBuilder = createUserRequestBuilder(body); return memberVarHttpClient.sendAsync( - localVarRequestBuilder.build(), - HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { - if (localVarResponse.statusCode()/ 100 != 2) { - return CompletableFuture.failedFuture(new ApiException(localVarResponse.statusCode(), - "createUser call received non-success response", - localVarResponse.headers(), - localVarResponse.body()) - ); - } else { - return CompletableFuture.completedFuture(null); - } + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("createUser", localVarResponse)); + } + return CompletableFuture.completedFuture(null); }); } catch (ApiException e) { @@ -87,6 +90,33 @@ public CompletableFuture createUser(User body) throws ApiException { } } + /** + * Create user + * This can only be done by the logged in user. + * @param body Created user object (required) + * @return CompletableFuture<ApiResponse<Void>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> createUserWithHttpInfo(User body) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = createUserRequestBuilder(body); + return memberVarHttpClient.sendAsync( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("createUser", localVarResponse)); + } + return CompletableFuture.completedFuture( + new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null) + ); + } + ); + } + catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + private HttpRequest.Builder createUserRequestBuilder(User body) throws ApiException { // verify the required parameter 'body' is set if (body == null) { @@ -126,17 +156,12 @@ public CompletableFuture createUsersWithArrayInput(List body) throws try { HttpRequest.Builder localVarRequestBuilder = createUsersWithArrayInputRequestBuilder(body); return memberVarHttpClient.sendAsync( - localVarRequestBuilder.build(), - HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { - if (localVarResponse.statusCode()/ 100 != 2) { - return CompletableFuture.failedFuture(new ApiException(localVarResponse.statusCode(), - "createUsersWithArrayInput call received non-success response", - localVarResponse.headers(), - localVarResponse.body()) - ); - } else { - return CompletableFuture.completedFuture(null); - } + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("createUsersWithArrayInput", localVarResponse)); + } + return CompletableFuture.completedFuture(null); }); } catch (ApiException e) { @@ -144,6 +169,33 @@ public CompletableFuture createUsersWithArrayInput(List body) throws } } + /** + * Creates list of users with given input array + * + * @param body List of user object (required) + * @return CompletableFuture<ApiResponse<Void>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> createUsersWithArrayInputWithHttpInfo(List body) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = createUsersWithArrayInputRequestBuilder(body); + return memberVarHttpClient.sendAsync( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("createUsersWithArrayInput", localVarResponse)); + } + return CompletableFuture.completedFuture( + new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null) + ); + } + ); + } + catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + private HttpRequest.Builder createUsersWithArrayInputRequestBuilder(List body) throws ApiException { // verify the required parameter 'body' is set if (body == null) { @@ -183,17 +235,12 @@ public CompletableFuture createUsersWithListInput(List body) throws try { HttpRequest.Builder localVarRequestBuilder = createUsersWithListInputRequestBuilder(body); return memberVarHttpClient.sendAsync( - localVarRequestBuilder.build(), - HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { - if (localVarResponse.statusCode()/ 100 != 2) { - return CompletableFuture.failedFuture(new ApiException(localVarResponse.statusCode(), - "createUsersWithListInput call received non-success response", - localVarResponse.headers(), - localVarResponse.body()) - ); - } else { - return CompletableFuture.completedFuture(null); - } + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("createUsersWithListInput", localVarResponse)); + } + return CompletableFuture.completedFuture(null); }); } catch (ApiException e) { @@ -201,6 +248,33 @@ public CompletableFuture createUsersWithListInput(List body) throws } } + /** + * Creates list of users with given input array + * + * @param body List of user object (required) + * @return CompletableFuture<ApiResponse<Void>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> createUsersWithListInputWithHttpInfo(List body) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = createUsersWithListInputRequestBuilder(body); + return memberVarHttpClient.sendAsync( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("createUsersWithListInput", localVarResponse)); + } + return CompletableFuture.completedFuture( + new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null) + ); + } + ); + } + catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + private HttpRequest.Builder createUsersWithListInputRequestBuilder(List body) throws ApiException { // verify the required parameter 'body' is set if (body == null) { @@ -240,17 +314,12 @@ public CompletableFuture deleteUser(String username) throws ApiException { try { HttpRequest.Builder localVarRequestBuilder = deleteUserRequestBuilder(username); return memberVarHttpClient.sendAsync( - localVarRequestBuilder.build(), - HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { - if (localVarResponse.statusCode()/ 100 != 2) { - return CompletableFuture.failedFuture(new ApiException(localVarResponse.statusCode(), - "deleteUser call received non-success response", - localVarResponse.headers(), - localVarResponse.body()) - ); - } else { - return CompletableFuture.completedFuture(null); - } + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("deleteUser", localVarResponse)); + } + return CompletableFuture.completedFuture(null); }); } catch (ApiException e) { @@ -258,6 +327,33 @@ public CompletableFuture deleteUser(String username) throws ApiException { } } + /** + * Delete user + * This can only be done by the logged in user. + * @param username The name that needs to be deleted (required) + * @return CompletableFuture<ApiResponse<Void>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> deleteUserWithHttpInfo(String username) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = deleteUserRequestBuilder(username); + return memberVarHttpClient.sendAsync( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("deleteUser", localVarResponse)); + } + return CompletableFuture.completedFuture( + new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null) + ); + } + ); + } + catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + private HttpRequest.Builder deleteUserRequestBuilder(String username) throws ApiException { // verify the required parameter 'username' is set if (username == null) { @@ -286,30 +382,25 @@ private HttpRequest.Builder deleteUserRequestBuilder(String username) throws Api * Get user by user name * * @param username The name that needs to be fetched. Use user1 for testing. (required) - * @return User + * @return CompletableFuture<User> * @throws ApiException if fails to make API call */ public CompletableFuture getUserByName(String username) throws ApiException { try { HttpRequest.Builder localVarRequestBuilder = getUserByNameRequestBuilder(username); return memberVarHttpClient.sendAsync( - localVarRequestBuilder.build(), - HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { - if (localVarResponse.statusCode()/ 100 != 2) { - return CompletableFuture.failedFuture(new ApiException(localVarResponse.statusCode(), - "getUserByName call received non-success response", - localVarResponse.headers(), - localVarResponse.body()) + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("getUserByName", localVarResponse)); + } + try { + return CompletableFuture.completedFuture( + memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) ); - } else { - try { - return CompletableFuture.completedFuture( - memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) - ); - } catch (IOException e) { - return CompletableFuture.failedFuture(new ApiException(e)); - } - } + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } }); } catch (ApiException e) { @@ -317,6 +408,40 @@ public CompletableFuture getUserByName(String username) throws ApiExceptio } } + /** + * Get user by user name + * + * @param username The name that needs to be fetched. Use user1 for testing. (required) + * @return CompletableFuture<ApiResponse<User>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> getUserByNameWithHttpInfo(String username) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = getUserByNameRequestBuilder(username); + return memberVarHttpClient.sendAsync( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("getUserByName", localVarResponse)); + } + try { + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {})) + ); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + } + ); + } + catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + private HttpRequest.Builder getUserByNameRequestBuilder(String username) throws ApiException { // verify the required parameter 'username' is set if (username == null) { @@ -346,30 +471,25 @@ private HttpRequest.Builder getUserByNameRequestBuilder(String username) throws * * @param username The user name for login (required) * @param password The password for login in clear text (required) - * @return String + * @return CompletableFuture<String> * @throws ApiException if fails to make API call */ public CompletableFuture loginUser(String username, String password) throws ApiException { try { HttpRequest.Builder localVarRequestBuilder = loginUserRequestBuilder(username, password); return memberVarHttpClient.sendAsync( - localVarRequestBuilder.build(), - HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { - if (localVarResponse.statusCode()/ 100 != 2) { - return CompletableFuture.failedFuture(new ApiException(localVarResponse.statusCode(), - "loginUser call received non-success response", - localVarResponse.headers(), - localVarResponse.body()) + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("loginUser", localVarResponse)); + } + try { + return CompletableFuture.completedFuture( + memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) ); - } else { - try { - return CompletableFuture.completedFuture( - memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) - ); - } catch (IOException e) { - return CompletableFuture.failedFuture(new ApiException(e)); - } - } + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } }); } catch (ApiException e) { @@ -377,6 +497,41 @@ public CompletableFuture loginUser(String username, String password) thr } } + /** + * Logs user into the system + * + * @param username The user name for login (required) + * @param password The password for login in clear text (required) + * @return CompletableFuture<ApiResponse<String>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> loginUserWithHttpInfo(String username, String password) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = loginUserRequestBuilder(username, password); + return memberVarHttpClient.sendAsync( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("loginUser", localVarResponse)); + } + try { + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {})) + ); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + } + ); + } + catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + private HttpRequest.Builder loginUserRequestBuilder(String username, String password) throws ApiException { // verify the required parameter 'username' is set if (username == null) { @@ -423,17 +578,12 @@ public CompletableFuture logoutUser() throws ApiException { try { HttpRequest.Builder localVarRequestBuilder = logoutUserRequestBuilder(); return memberVarHttpClient.sendAsync( - localVarRequestBuilder.build(), - HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { - if (localVarResponse.statusCode()/ 100 != 2) { - return CompletableFuture.failedFuture(new ApiException(localVarResponse.statusCode(), - "logoutUser call received non-success response", - localVarResponse.headers(), - localVarResponse.body()) - ); - } else { - return CompletableFuture.completedFuture(null); - } + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("logoutUser", localVarResponse)); + } + return CompletableFuture.completedFuture(null); }); } catch (ApiException e) { @@ -441,6 +591,32 @@ public CompletableFuture logoutUser() throws ApiException { } } + /** + * Logs out current logged in user session + * + * @return CompletableFuture<ApiResponse<Void>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> logoutUserWithHttpInfo() throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = logoutUserRequestBuilder(); + return memberVarHttpClient.sendAsync( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("logoutUser", localVarResponse)); + } + return CompletableFuture.completedFuture( + new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null) + ); + } + ); + } + catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + private HttpRequest.Builder logoutUserRequestBuilder() throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -471,17 +647,12 @@ public CompletableFuture updateUser(String username, User body) throws Api try { HttpRequest.Builder localVarRequestBuilder = updateUserRequestBuilder(username, body); return memberVarHttpClient.sendAsync( - localVarRequestBuilder.build(), - HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { - if (localVarResponse.statusCode()/ 100 != 2) { - return CompletableFuture.failedFuture(new ApiException(localVarResponse.statusCode(), - "updateUser call received non-success response", - localVarResponse.headers(), - localVarResponse.body()) - ); - } else { - return CompletableFuture.completedFuture(null); - } + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("updateUser", localVarResponse)); + } + return CompletableFuture.completedFuture(null); }); } catch (ApiException e) { @@ -489,6 +660,34 @@ public CompletableFuture updateUser(String username, User body) throws Api } } + /** + * Updated user + * This can only be done by the logged in user. + * @param username name that need to be deleted (required) + * @param body Updated user object (required) + * @return CompletableFuture<ApiResponse<Void>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> updateUserWithHttpInfo(String username, User body) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = updateUserRequestBuilder(username, body); + return memberVarHttpClient.sendAsync( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("updateUser", localVarResponse)); + } + return CompletableFuture.completedFuture( + new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null) + ); + } + ); + } + catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + private HttpRequest.Builder updateUserRequestBuilder(String username, User body) throws ApiException { // verify the required parameter 'username' is set if (username == null) { diff --git a/samples/client/petstore/java/native/README.md b/samples/client/petstore/java/native/README.md index 95bf0640c902..5d8677f378ed 100644 --- a/samples/client/petstore/java/native/README.md +++ b/samples/client/petstore/java/native/README.md @@ -106,42 +106,79 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- *AnotherFakeApi* | [**call123testSpecialTags**](docs/AnotherFakeApi.md#call123testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags +*AnotherFakeApi* | [**call123testSpecialTagsWithHttpInfo**](docs/AnotherFakeApi.md#call123testSpecialTagsWithHttpInfo) | **PATCH** /another-fake/dummy | To test special tags *FakeApi* | [**createXmlItem**](docs/FakeApi.md#createXmlItem) | **POST** /fake/create_xml_item | creates an XmlItem +*FakeApi* | [**createXmlItemWithHttpInfo**](docs/FakeApi.md#createXmlItemWithHttpInfo) | **POST** /fake/create_xml_item | creates an XmlItem *FakeApi* | [**fakeOuterBooleanSerialize**](docs/FakeApi.md#fakeOuterBooleanSerialize) | **POST** /fake/outer/boolean | +*FakeApi* | [**fakeOuterBooleanSerializeWithHttpInfo**](docs/FakeApi.md#fakeOuterBooleanSerializeWithHttpInfo) | **POST** /fake/outer/boolean | *FakeApi* | [**fakeOuterCompositeSerialize**](docs/FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite | +*FakeApi* | [**fakeOuterCompositeSerializeWithHttpInfo**](docs/FakeApi.md#fakeOuterCompositeSerializeWithHttpInfo) | **POST** /fake/outer/composite | *FakeApi* | [**fakeOuterNumberSerialize**](docs/FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number | +*FakeApi* | [**fakeOuterNumberSerializeWithHttpInfo**](docs/FakeApi.md#fakeOuterNumberSerializeWithHttpInfo) | **POST** /fake/outer/number | *FakeApi* | [**fakeOuterStringSerialize**](docs/FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string | +*FakeApi* | [**fakeOuterStringSerializeWithHttpInfo**](docs/FakeApi.md#fakeOuterStringSerializeWithHttpInfo) | **POST** /fake/outer/string | *FakeApi* | [**testBodyWithFileSchema**](docs/FakeApi.md#testBodyWithFileSchema) | **PUT** /fake/body-with-file-schema | +*FakeApi* | [**testBodyWithFileSchemaWithHttpInfo**](docs/FakeApi.md#testBodyWithFileSchemaWithHttpInfo) | **PUT** /fake/body-with-file-schema | *FakeApi* | [**testBodyWithQueryParams**](docs/FakeApi.md#testBodyWithQueryParams) | **PUT** /fake/body-with-query-params | +*FakeApi* | [**testBodyWithQueryParamsWithHttpInfo**](docs/FakeApi.md#testBodyWithQueryParamsWithHttpInfo) | **PUT** /fake/body-with-query-params | *FakeApi* | [**testClientModel**](docs/FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model +*FakeApi* | [**testClientModelWithHttpInfo**](docs/FakeApi.md#testClientModelWithHttpInfo) | **PATCH** /fake | To test \"client\" model *FakeApi* | [**testEndpointParameters**](docs/FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +*FakeApi* | [**testEndpointParametersWithHttpInfo**](docs/FakeApi.md#testEndpointParametersWithHttpInfo) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 *FakeApi* | [**testEnumParameters**](docs/FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters +*FakeApi* | [**testEnumParametersWithHttpInfo**](docs/FakeApi.md#testEnumParametersWithHttpInfo) | **GET** /fake | To test enum parameters *FakeApi* | [**testGroupParameters**](docs/FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) +*FakeApi* | [**testGroupParametersWithHttpInfo**](docs/FakeApi.md#testGroupParametersWithHttpInfo) | **DELETE** /fake | Fake endpoint to test group parameters (optional) *FakeApi* | [**testInlineAdditionalProperties**](docs/FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties +*FakeApi* | [**testInlineAdditionalPropertiesWithHttpInfo**](docs/FakeApi.md#testInlineAdditionalPropertiesWithHttpInfo) | **POST** /fake/inline-additionalProperties | test inline additionalProperties *FakeApi* | [**testJsonFormData**](docs/FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data +*FakeApi* | [**testJsonFormDataWithHttpInfo**](docs/FakeApi.md#testJsonFormDataWithHttpInfo) | **GET** /fake/jsonFormData | test json serialization of form data *FakeApi* | [**testQueryParameterCollectionFormat**](docs/FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-paramters | +*FakeApi* | [**testQueryParameterCollectionFormatWithHttpInfo**](docs/FakeApi.md#testQueryParameterCollectionFormatWithHttpInfo) | **PUT** /fake/test-query-paramters | *FakeClassnameTags123Api* | [**testClassname**](docs/FakeClassnameTags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case +*FakeClassnameTags123Api* | [**testClassnameWithHttpInfo**](docs/FakeClassnameTags123Api.md#testClassnameWithHttpInfo) | **PATCH** /fake_classname_test | To test class name in snake case *PetApi* | [**addPet**](docs/PetApi.md#addPet) | **POST** /pet | Add a new pet to the store +*PetApi* | [**addPetWithHttpInfo**](docs/PetApi.md#addPetWithHttpInfo) | **POST** /pet | Add a new pet to the store *PetApi* | [**deletePet**](docs/PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet +*PetApi* | [**deletePetWithHttpInfo**](docs/PetApi.md#deletePetWithHttpInfo) | **DELETE** /pet/{petId} | Deletes a pet *PetApi* | [**findPetsByStatus**](docs/PetApi.md#findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status +*PetApi* | [**findPetsByStatusWithHttpInfo**](docs/PetApi.md#findPetsByStatusWithHttpInfo) | **GET** /pet/findByStatus | Finds Pets by status *PetApi* | [**findPetsByTags**](docs/PetApi.md#findPetsByTags) | **GET** /pet/findByTags | Finds Pets by tags +*PetApi* | [**findPetsByTagsWithHttpInfo**](docs/PetApi.md#findPetsByTagsWithHttpInfo) | **GET** /pet/findByTags | Finds Pets by tags *PetApi* | [**getPetById**](docs/PetApi.md#getPetById) | **GET** /pet/{petId} | Find pet by ID +*PetApi* | [**getPetByIdWithHttpInfo**](docs/PetApi.md#getPetByIdWithHttpInfo) | **GET** /pet/{petId} | Find pet by ID *PetApi* | [**updatePet**](docs/PetApi.md#updatePet) | **PUT** /pet | Update an existing pet +*PetApi* | [**updatePetWithHttpInfo**](docs/PetApi.md#updatePetWithHttpInfo) | **PUT** /pet | Update an existing pet *PetApi* | [**updatePetWithForm**](docs/PetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data +*PetApi* | [**updatePetWithFormWithHttpInfo**](docs/PetApi.md#updatePetWithFormWithHttpInfo) | **POST** /pet/{petId} | Updates a pet in the store with form data *PetApi* | [**uploadFile**](docs/PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image +*PetApi* | [**uploadFileWithHttpInfo**](docs/PetApi.md#uploadFileWithHttpInfo) | **POST** /pet/{petId}/uploadImage | uploads an image *PetApi* | [**uploadFileWithRequiredFile**](docs/PetApi.md#uploadFileWithRequiredFile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) +*PetApi* | [**uploadFileWithRequiredFileWithHttpInfo**](docs/PetApi.md#uploadFileWithRequiredFileWithHttpInfo) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) *StoreApi* | [**deleteOrder**](docs/StoreApi.md#deleteOrder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID +*StoreApi* | [**deleteOrderWithHttpInfo**](docs/StoreApi.md#deleteOrderWithHttpInfo) | **DELETE** /store/order/{order_id} | Delete purchase order by ID *StoreApi* | [**getInventory**](docs/StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status +*StoreApi* | [**getInventoryWithHttpInfo**](docs/StoreApi.md#getInventoryWithHttpInfo) | **GET** /store/inventory | Returns pet inventories by status *StoreApi* | [**getOrderById**](docs/StoreApi.md#getOrderById) | **GET** /store/order/{order_id} | Find purchase order by ID +*StoreApi* | [**getOrderByIdWithHttpInfo**](docs/StoreApi.md#getOrderByIdWithHttpInfo) | **GET** /store/order/{order_id} | Find purchase order by ID *StoreApi* | [**placeOrder**](docs/StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet +*StoreApi* | [**placeOrderWithHttpInfo**](docs/StoreApi.md#placeOrderWithHttpInfo) | **POST** /store/order | Place an order for a pet *UserApi* | [**createUser**](docs/UserApi.md#createUser) | **POST** /user | Create user +*UserApi* | [**createUserWithHttpInfo**](docs/UserApi.md#createUserWithHttpInfo) | **POST** /user | Create user *UserApi* | [**createUsersWithArrayInput**](docs/UserApi.md#createUsersWithArrayInput) | **POST** /user/createWithArray | Creates list of users with given input array +*UserApi* | [**createUsersWithArrayInputWithHttpInfo**](docs/UserApi.md#createUsersWithArrayInputWithHttpInfo) | **POST** /user/createWithArray | Creates list of users with given input array *UserApi* | [**createUsersWithListInput**](docs/UserApi.md#createUsersWithListInput) | **POST** /user/createWithList | Creates list of users with given input array +*UserApi* | [**createUsersWithListInputWithHttpInfo**](docs/UserApi.md#createUsersWithListInputWithHttpInfo) | **POST** /user/createWithList | Creates list of users with given input array *UserApi* | [**deleteUser**](docs/UserApi.md#deleteUser) | **DELETE** /user/{username} | Delete user +*UserApi* | [**deleteUserWithHttpInfo**](docs/UserApi.md#deleteUserWithHttpInfo) | **DELETE** /user/{username} | Delete user *UserApi* | [**getUserByName**](docs/UserApi.md#getUserByName) | **GET** /user/{username} | Get user by user name +*UserApi* | [**getUserByNameWithHttpInfo**](docs/UserApi.md#getUserByNameWithHttpInfo) | **GET** /user/{username} | Get user by user name *UserApi* | [**loginUser**](docs/UserApi.md#loginUser) | **GET** /user/login | Logs user into the system +*UserApi* | [**loginUserWithHttpInfo**](docs/UserApi.md#loginUserWithHttpInfo) | **GET** /user/login | Logs user into the system *UserApi* | [**logoutUser**](docs/UserApi.md#logoutUser) | **GET** /user/logout | Logs out current logged in user session +*UserApi* | [**logoutUserWithHttpInfo**](docs/UserApi.md#logoutUserWithHttpInfo) | **GET** /user/logout | Logs out current logged in user session *UserApi* | [**updateUser**](docs/UserApi.md#updateUser) | **PUT** /user/{username} | Updated user +*UserApi* | [**updateUserWithHttpInfo**](docs/UserApi.md#updateUserWithHttpInfo) | **PUT** /user/{username} | Updated user ## Documentation for Models diff --git a/samples/client/petstore/java/native/docs/AnotherFakeApi.md b/samples/client/petstore/java/native/docs/AnotherFakeApi.md index be710a2b7d39..cb613c7dde43 100644 --- a/samples/client/petstore/java/native/docs/AnotherFakeApi.md +++ b/samples/client/petstore/java/native/docs/AnotherFakeApi.md @@ -5,7 +5,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- [**call123testSpecialTags**](AnotherFakeApi.md#call123testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags -[**call123testSpecialTagsWithHttpInfo**](AnotherFakeApi.md#call123testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags +[**call123testSpecialTagsWithHttpInfo**](AnotherFakeApi.md#call123testSpecialTagsWithHttpInfo) | **PATCH** /another-fake/dummy | To test special tags @@ -36,7 +36,6 @@ public class Example { Client body = new Client(); // Client | client model try { Client result = apiInstance.call123testSpecialTags(body); - System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling AnotherFakeApi#call123testSpecialTags"); @@ -104,13 +103,13 @@ public class Example { try { ApiResponse response = apiInstance.call123testSpecialTagsWithHttpInfo(body); System.out.println("Status code: " + response.getStatusCode()); - System.out.println("Response headers: " + response.getHeaders().toString()); - System.out.println("Response body: " + response.getData().toString()); + System.out.println("Response headers: " + response.getHeaders()); + System.out.println("Response body: " + response.getData()); } catch (ApiException e) { System.err.println("Exception when calling AnotherFakeApi#call123testSpecialTags"); System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); e.printStackTrace(); } } diff --git a/samples/client/petstore/java/native/docs/FakeApi.md b/samples/client/petstore/java/native/docs/FakeApi.md index 4f3e6b4608b0..16ce98293759 100644 --- a/samples/client/petstore/java/native/docs/FakeApi.md +++ b/samples/client/petstore/java/native/docs/FakeApi.md @@ -5,33 +5,33 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- [**createXmlItem**](FakeApi.md#createXmlItem) | **POST** /fake/create_xml_item | creates an XmlItem -[**createXmlItemWithHttpInfo**](FakeApi.md#createXmlItem) | **POST** /fake/create_xml_item | creates an XmlItem +[**createXmlItemWithHttpInfo**](FakeApi.md#createXmlItemWithHttpInfo) | **POST** /fake/create_xml_item | creates an XmlItem [**fakeOuterBooleanSerialize**](FakeApi.md#fakeOuterBooleanSerialize) | **POST** /fake/outer/boolean | -[**fakeOuterBooleanSerializeWithHttpInfo**](FakeApi.md#fakeOuterBooleanSerialize) | **POST** /fake/outer/boolean | +[**fakeOuterBooleanSerializeWithHttpInfo**](FakeApi.md#fakeOuterBooleanSerializeWithHttpInfo) | **POST** /fake/outer/boolean | [**fakeOuterCompositeSerialize**](FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite | -[**fakeOuterCompositeSerializeWithHttpInfo**](FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite | +[**fakeOuterCompositeSerializeWithHttpInfo**](FakeApi.md#fakeOuterCompositeSerializeWithHttpInfo) | **POST** /fake/outer/composite | [**fakeOuterNumberSerialize**](FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number | -[**fakeOuterNumberSerializeWithHttpInfo**](FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number | +[**fakeOuterNumberSerializeWithHttpInfo**](FakeApi.md#fakeOuterNumberSerializeWithHttpInfo) | **POST** /fake/outer/number | [**fakeOuterStringSerialize**](FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string | -[**fakeOuterStringSerializeWithHttpInfo**](FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string | +[**fakeOuterStringSerializeWithHttpInfo**](FakeApi.md#fakeOuterStringSerializeWithHttpInfo) | **POST** /fake/outer/string | [**testBodyWithFileSchema**](FakeApi.md#testBodyWithFileSchema) | **PUT** /fake/body-with-file-schema | -[**testBodyWithFileSchemaWithHttpInfo**](FakeApi.md#testBodyWithFileSchema) | **PUT** /fake/body-with-file-schema | +[**testBodyWithFileSchemaWithHttpInfo**](FakeApi.md#testBodyWithFileSchemaWithHttpInfo) | **PUT** /fake/body-with-file-schema | [**testBodyWithQueryParams**](FakeApi.md#testBodyWithQueryParams) | **PUT** /fake/body-with-query-params | -[**testBodyWithQueryParamsWithHttpInfo**](FakeApi.md#testBodyWithQueryParams) | **PUT** /fake/body-with-query-params | +[**testBodyWithQueryParamsWithHttpInfo**](FakeApi.md#testBodyWithQueryParamsWithHttpInfo) | **PUT** /fake/body-with-query-params | [**testClientModel**](FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model -[**testClientModelWithHttpInfo**](FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model +[**testClientModelWithHttpInfo**](FakeApi.md#testClientModelWithHttpInfo) | **PATCH** /fake | To test \"client\" model [**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 -[**testEndpointParametersWithHttpInfo**](FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +[**testEndpointParametersWithHttpInfo**](FakeApi.md#testEndpointParametersWithHttpInfo) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 [**testEnumParameters**](FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters -[**testEnumParametersWithHttpInfo**](FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters +[**testEnumParametersWithHttpInfo**](FakeApi.md#testEnumParametersWithHttpInfo) | **GET** /fake | To test enum parameters [**testGroupParameters**](FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) -[**testGroupParametersWithHttpInfo**](FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) +[**testGroupParametersWithHttpInfo**](FakeApi.md#testGroupParametersWithHttpInfo) | **DELETE** /fake | Fake endpoint to test group parameters (optional) [**testInlineAdditionalProperties**](FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties -[**testInlineAdditionalPropertiesWithHttpInfo**](FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties +[**testInlineAdditionalPropertiesWithHttpInfo**](FakeApi.md#testInlineAdditionalPropertiesWithHttpInfo) | **POST** /fake/inline-additionalProperties | test inline additionalProperties [**testJsonFormData**](FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data -[**testJsonFormDataWithHttpInfo**](FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data +[**testJsonFormDataWithHttpInfo**](FakeApi.md#testJsonFormDataWithHttpInfo) | **GET** /fake/jsonFormData | test json serialization of form data [**testQueryParameterCollectionFormat**](FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-paramters | -[**testQueryParameterCollectionFormatWithHttpInfo**](FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-paramters | +[**testQueryParameterCollectionFormatWithHttpInfo**](FakeApi.md#testQueryParameterCollectionFormatWithHttpInfo) | **PUT** /fake/test-query-paramters | @@ -62,7 +62,6 @@ public class Example { XmlItem xmlItem = new XmlItem(); // XmlItem | XmlItem Body try { apiInstance.createXmlItem(xmlItem); - } catch (ApiException e) { System.err.println("Exception when calling FakeApi#createXmlItem"); System.err.println("Status code: " + e.getCode()); @@ -129,12 +128,12 @@ public class Example { try { ApiResponse response = apiInstance.createXmlItemWithHttpInfo(xmlItem); System.out.println("Status code: " + response.getStatusCode()); - System.out.println("Response headers: " + response.getHeaders().toString()); + System.out.println("Response headers: " + response.getHeaders()); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#createXmlItem"); System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); e.printStackTrace(); } } @@ -195,7 +194,6 @@ public class Example { Boolean body = true; // Boolean | Input boolean as post body try { Boolean result = apiInstance.fakeOuterBooleanSerialize(body); - System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#fakeOuterBooleanSerialize"); @@ -263,13 +261,13 @@ public class Example { try { ApiResponse response = apiInstance.fakeOuterBooleanSerializeWithHttpInfo(body); System.out.println("Status code: " + response.getStatusCode()); - System.out.println("Response headers: " + response.getHeaders().toString()); - System.out.println("Response body: " + response.getData().toString()); + System.out.println("Response headers: " + response.getHeaders()); + System.out.println("Response body: " + response.getData()); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#fakeOuterBooleanSerialize"); System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); e.printStackTrace(); } } @@ -330,7 +328,6 @@ public class Example { OuterComposite body = new OuterComposite(); // OuterComposite | Input composite as post body try { OuterComposite result = apiInstance.fakeOuterCompositeSerialize(body); - System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#fakeOuterCompositeSerialize"); @@ -398,13 +395,13 @@ public class Example { try { ApiResponse response = apiInstance.fakeOuterCompositeSerializeWithHttpInfo(body); System.out.println("Status code: " + response.getStatusCode()); - System.out.println("Response headers: " + response.getHeaders().toString()); - System.out.println("Response body: " + response.getData().toString()); + System.out.println("Response headers: " + response.getHeaders()); + System.out.println("Response body: " + response.getData()); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#fakeOuterCompositeSerialize"); System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); e.printStackTrace(); } } @@ -465,7 +462,6 @@ public class Example { BigDecimal body = new BigDecimal(); // BigDecimal | Input number as post body try { BigDecimal result = apiInstance.fakeOuterNumberSerialize(body); - System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#fakeOuterNumberSerialize"); @@ -533,13 +529,13 @@ public class Example { try { ApiResponse response = apiInstance.fakeOuterNumberSerializeWithHttpInfo(body); System.out.println("Status code: " + response.getStatusCode()); - System.out.println("Response headers: " + response.getHeaders().toString()); - System.out.println("Response body: " + response.getData().toString()); + System.out.println("Response headers: " + response.getHeaders()); + System.out.println("Response body: " + response.getData()); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#fakeOuterNumberSerialize"); System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); e.printStackTrace(); } } @@ -600,7 +596,6 @@ public class Example { String body = "body_example"; // String | Input string as post body try { String result = apiInstance.fakeOuterStringSerialize(body); - System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#fakeOuterStringSerialize"); @@ -668,13 +663,13 @@ public class Example { try { ApiResponse response = apiInstance.fakeOuterStringSerializeWithHttpInfo(body); System.out.println("Status code: " + response.getStatusCode()); - System.out.println("Response headers: " + response.getHeaders().toString()); - System.out.println("Response body: " + response.getData().toString()); + System.out.println("Response headers: " + response.getHeaders()); + System.out.println("Response body: " + response.getData()); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#fakeOuterStringSerialize"); System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); e.printStackTrace(); } } @@ -735,7 +730,6 @@ public class Example { FileSchemaTestClass body = new FileSchemaTestClass(); // FileSchemaTestClass | try { apiInstance.testBodyWithFileSchema(body); - } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testBodyWithFileSchema"); System.err.println("Status code: " + e.getCode()); @@ -802,12 +796,12 @@ public class Example { try { ApiResponse response = apiInstance.testBodyWithFileSchemaWithHttpInfo(body); System.out.println("Status code: " + response.getStatusCode()); - System.out.println("Response headers: " + response.getHeaders().toString()); + System.out.println("Response headers: " + response.getHeaders()); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testBodyWithFileSchema"); System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); e.printStackTrace(); } } @@ -867,7 +861,6 @@ public class Example { User body = new User(); // User | try { apiInstance.testBodyWithQueryParams(query, body); - } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testBodyWithQueryParams"); System.err.println("Status code: " + e.getCode()); @@ -934,12 +927,12 @@ public class Example { try { ApiResponse response = apiInstance.testBodyWithQueryParamsWithHttpInfo(query, body); System.out.println("Status code: " + response.getStatusCode()); - System.out.println("Response headers: " + response.getHeaders().toString()); + System.out.println("Response headers: " + response.getHeaders()); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testBodyWithQueryParams"); System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); e.printStackTrace(); } } @@ -1001,7 +994,6 @@ public class Example { Client body = new Client(); // Client | client model try { Client result = apiInstance.testClientModel(body); - System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testClientModel"); @@ -1069,13 +1061,13 @@ public class Example { try { ApiResponse response = apiInstance.testClientModelWithHttpInfo(body); System.out.println("Status code: " + response.getStatusCode()); - System.out.println("Response headers: " + response.getHeaders().toString()); - System.out.println("Response body: " + response.getData().toString()); + System.out.println("Response headers: " + response.getHeaders()); + System.out.println("Response body: " + response.getData()); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testClientModel"); System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); e.printStackTrace(); } } @@ -1155,7 +1147,6 @@ public class Example { String paramCallback = "paramCallback_example"; // String | None try { apiInstance.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); - } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testEndpointParameters"); System.err.println("Status code: " + e.getCode()); @@ -1255,12 +1246,12 @@ public class Example { try { ApiResponse response = apiInstance.testEndpointParametersWithHttpInfo(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); System.out.println("Status code: " + response.getStatusCode()); - System.out.println("Response headers: " + response.getHeaders().toString()); + System.out.println("Response headers: " + response.getHeaders()); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testEndpointParameters"); System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); e.printStackTrace(); } } @@ -1342,7 +1333,6 @@ public class Example { String enumFormString = "-efg"; // String | Form parameter enum test (string) try { apiInstance.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); - } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testEnumParameters"); System.err.println("Status code: " + e.getCode()); @@ -1424,12 +1414,12 @@ public class Example { try { ApiResponse response = apiInstance.testEnumParametersWithHttpInfo(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); System.out.println("Status code: " + response.getStatusCode()); - System.out.println("Response headers: " + response.getHeaders().toString()); + System.out.println("Response headers: " + response.getHeaders()); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testEnumParameters"); System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); e.printStackTrace(); } } @@ -1591,12 +1581,12 @@ public class Example { .build(); ApiResponse response = apiInstance.testGroupParametersWithHttpInfo(request); System.out.println("Status code: " + response.getStatusCode()); - System.out.println("Response headers: " + response.getHeaders().toString()); + System.out.println("Response headers: " + response.getHeaders()); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testGroupParameters"); System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); e.printStackTrace(); } } @@ -1669,7 +1659,6 @@ public class Example { Map param = new HashMap(); // Map | request body try { apiInstance.testInlineAdditionalProperties(param); - } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testInlineAdditionalProperties"); System.err.println("Status code: " + e.getCode()); @@ -1734,12 +1723,12 @@ public class Example { try { ApiResponse response = apiInstance.testInlineAdditionalPropertiesWithHttpInfo(param); System.out.println("Status code: " + response.getStatusCode()); - System.out.println("Response headers: " + response.getHeaders().toString()); + System.out.println("Response headers: " + response.getHeaders()); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testInlineAdditionalProperties"); System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); e.printStackTrace(); } } @@ -1799,7 +1788,6 @@ public class Example { String param2 = "param2_example"; // String | field2 try { apiInstance.testJsonFormData(param, param2); - } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testJsonFormData"); System.err.println("Status code: " + e.getCode()); @@ -1866,12 +1854,12 @@ public class Example { try { ApiResponse response = apiInstance.testJsonFormDataWithHttpInfo(param, param2); System.out.println("Status code: " + response.getStatusCode()); - System.out.println("Response headers: " + response.getHeaders().toString()); + System.out.println("Response headers: " + response.getHeaders()); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testJsonFormData"); System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); e.printStackTrace(); } } @@ -1937,7 +1925,6 @@ public class Example { List context = Arrays.asList(); // List | try { apiInstance.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context); - } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testQueryParameterCollectionFormat"); System.err.println("Status code: " + e.getCode()); @@ -2012,12 +1999,12 @@ public class Example { try { ApiResponse response = apiInstance.testQueryParameterCollectionFormatWithHttpInfo(pipe, ioutil, http, url, context); System.out.println("Status code: " + response.getStatusCode()); - System.out.println("Response headers: " + response.getHeaders().toString()); + System.out.println("Response headers: " + response.getHeaders()); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testQueryParameterCollectionFormat"); System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); e.printStackTrace(); } } diff --git a/samples/client/petstore/java/native/docs/FakeClassnameTags123Api.md b/samples/client/petstore/java/native/docs/FakeClassnameTags123Api.md index c7c841060f4d..0c55bf93505c 100644 --- a/samples/client/petstore/java/native/docs/FakeClassnameTags123Api.md +++ b/samples/client/petstore/java/native/docs/FakeClassnameTags123Api.md @@ -5,7 +5,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- [**testClassname**](FakeClassnameTags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case -[**testClassnameWithHttpInfo**](FakeClassnameTags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case +[**testClassnameWithHttpInfo**](FakeClassnameTags123Api.md#testClassnameWithHttpInfo) | **PATCH** /fake_classname_test | To test class name in snake case @@ -43,7 +43,6 @@ public class Example { Client body = new Client(); // Client | client model try { Client result = apiInstance.testClassname(body); - System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling FakeClassnameTags123Api#testClassname"); @@ -118,13 +117,13 @@ public class Example { try { ApiResponse response = apiInstance.testClassnameWithHttpInfo(body); System.out.println("Status code: " + response.getStatusCode()); - System.out.println("Response headers: " + response.getHeaders().toString()); - System.out.println("Response body: " + response.getData().toString()); + System.out.println("Response headers: " + response.getHeaders()); + System.out.println("Response body: " + response.getData()); } catch (ApiException e) { System.err.println("Exception when calling FakeClassnameTags123Api#testClassname"); System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); e.printStackTrace(); } } diff --git a/samples/client/petstore/java/native/docs/PetApi.md b/samples/client/petstore/java/native/docs/PetApi.md index d4f8bca1caa5..dd368877fc73 100644 --- a/samples/client/petstore/java/native/docs/PetApi.md +++ b/samples/client/petstore/java/native/docs/PetApi.md @@ -5,23 +5,23 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- [**addPet**](PetApi.md#addPet) | **POST** /pet | Add a new pet to the store -[**addPetWithHttpInfo**](PetApi.md#addPet) | **POST** /pet | Add a new pet to the store +[**addPetWithHttpInfo**](PetApi.md#addPetWithHttpInfo) | **POST** /pet | Add a new pet to the store [**deletePet**](PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet -[**deletePetWithHttpInfo**](PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet +[**deletePetWithHttpInfo**](PetApi.md#deletePetWithHttpInfo) | **DELETE** /pet/{petId} | Deletes a pet [**findPetsByStatus**](PetApi.md#findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status -[**findPetsByStatusWithHttpInfo**](PetApi.md#findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status +[**findPetsByStatusWithHttpInfo**](PetApi.md#findPetsByStatusWithHttpInfo) | **GET** /pet/findByStatus | Finds Pets by status [**findPetsByTags**](PetApi.md#findPetsByTags) | **GET** /pet/findByTags | Finds Pets by tags -[**findPetsByTagsWithHttpInfo**](PetApi.md#findPetsByTags) | **GET** /pet/findByTags | Finds Pets by tags +[**findPetsByTagsWithHttpInfo**](PetApi.md#findPetsByTagsWithHttpInfo) | **GET** /pet/findByTags | Finds Pets by tags [**getPetById**](PetApi.md#getPetById) | **GET** /pet/{petId} | Find pet by ID -[**getPetByIdWithHttpInfo**](PetApi.md#getPetById) | **GET** /pet/{petId} | Find pet by ID +[**getPetByIdWithHttpInfo**](PetApi.md#getPetByIdWithHttpInfo) | **GET** /pet/{petId} | Find pet by ID [**updatePet**](PetApi.md#updatePet) | **PUT** /pet | Update an existing pet -[**updatePetWithHttpInfo**](PetApi.md#updatePet) | **PUT** /pet | Update an existing pet +[**updatePetWithHttpInfo**](PetApi.md#updatePetWithHttpInfo) | **PUT** /pet | Update an existing pet [**updatePetWithForm**](PetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data -[**updatePetWithFormWithHttpInfo**](PetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data +[**updatePetWithFormWithHttpInfo**](PetApi.md#updatePetWithFormWithHttpInfo) | **POST** /pet/{petId} | Updates a pet in the store with form data [**uploadFile**](PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image -[**uploadFileWithHttpInfo**](PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image +[**uploadFileWithHttpInfo**](PetApi.md#uploadFileWithHttpInfo) | **POST** /pet/{petId}/uploadImage | uploads an image [**uploadFileWithRequiredFile**](PetApi.md#uploadFileWithRequiredFile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) -[**uploadFileWithRequiredFileWithHttpInfo**](PetApi.md#uploadFileWithRequiredFile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) +[**uploadFileWithRequiredFileWithHttpInfo**](PetApi.md#uploadFileWithRequiredFileWithHttpInfo) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) @@ -55,7 +55,6 @@ public class Example { Pet body = new Pet(); // Pet | Pet object that needs to be added to the store try { apiInstance.addPet(body); - } catch (ApiException e) { System.err.println("Exception when calling PetApi#addPet"); System.err.println("Status code: " + e.getCode()); @@ -126,12 +125,12 @@ public class Example { try { ApiResponse response = apiInstance.addPetWithHttpInfo(body); System.out.println("Status code: " + response.getStatusCode()); - System.out.println("Response headers: " + response.getHeaders().toString()); + System.out.println("Response headers: " + response.getHeaders()); } catch (ApiException e) { System.err.println("Exception when calling PetApi#addPet"); System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); e.printStackTrace(); } } @@ -197,7 +196,6 @@ public class Example { String apiKey = "apiKey_example"; // String | try { apiInstance.deletePet(petId, apiKey); - } catch (ApiException e) { System.err.println("Exception when calling PetApi#deletePet"); System.err.println("Status code: " + e.getCode()); @@ -270,12 +268,12 @@ public class Example { try { ApiResponse response = apiInstance.deletePetWithHttpInfo(petId, apiKey); System.out.println("Status code: " + response.getStatusCode()); - System.out.println("Response headers: " + response.getHeaders().toString()); + System.out.println("Response headers: " + response.getHeaders()); } catch (ApiException e) { System.err.println("Exception when calling PetApi#deletePet"); System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); e.printStackTrace(); } } @@ -343,7 +341,6 @@ public class Example { List status = Arrays.asList("available"); // List | Status values that need to be considered for filter try { List result = apiInstance.findPetsByStatus(status); - System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling PetApi#findPetsByStatus"); @@ -417,13 +414,13 @@ public class Example { try { ApiResponse> response = apiInstance.findPetsByStatusWithHttpInfo(status); System.out.println("Status code: " + response.getStatusCode()); - System.out.println("Response headers: " + response.getHeaders().toString()); - System.out.println("Response body: " + response.getData().toString()); + System.out.println("Response headers: " + response.getHeaders()); + System.out.println("Response body: " + response.getData()); } catch (ApiException e) { System.err.println("Exception when calling PetApi#findPetsByStatus"); System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); e.printStackTrace(); } } @@ -490,7 +487,6 @@ public class Example { Set tags = Arrays.asList(); // Set | Tags to filter by try { Set result = apiInstance.findPetsByTags(tags); - System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling PetApi#findPetsByTags"); @@ -564,13 +560,13 @@ public class Example { try { ApiResponse> response = apiInstance.findPetsByTagsWithHttpInfo(tags); System.out.println("Status code: " + response.getStatusCode()); - System.out.println("Response headers: " + response.getHeaders().toString()); - System.out.println("Response body: " + response.getData().toString()); + System.out.println("Response headers: " + response.getHeaders()); + System.out.println("Response body: " + response.getData()); } catch (ApiException e) { System.err.println("Exception when calling PetApi#findPetsByTags"); System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); e.printStackTrace(); } } @@ -639,7 +635,6 @@ public class Example { Long petId = 56L; // Long | ID of pet to return try { Pet result = apiInstance.getPetById(petId); - System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling PetApi#getPetById"); @@ -716,13 +711,13 @@ public class Example { try { ApiResponse response = apiInstance.getPetByIdWithHttpInfo(petId); System.out.println("Status code: " + response.getStatusCode()); - System.out.println("Response headers: " + response.getHeaders().toString()); - System.out.println("Response body: " + response.getData().toString()); + System.out.println("Response headers: " + response.getHeaders()); + System.out.println("Response body: " + response.getData()); } catch (ApiException e) { System.err.println("Exception when calling PetApi#getPetById"); System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); e.printStackTrace(); } } @@ -788,7 +783,6 @@ public class Example { Pet body = new Pet(); // Pet | Pet object that needs to be added to the store try { apiInstance.updatePet(body); - } catch (ApiException e) { System.err.println("Exception when calling PetApi#updatePet"); System.err.println("Status code: " + e.getCode()); @@ -861,12 +855,12 @@ public class Example { try { ApiResponse response = apiInstance.updatePetWithHttpInfo(body); System.out.println("Status code: " + response.getStatusCode()); - System.out.println("Response headers: " + response.getHeaders().toString()); + System.out.println("Response headers: " + response.getHeaders()); } catch (ApiException e) { System.err.println("Exception when calling PetApi#updatePet"); System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); e.printStackTrace(); } } @@ -935,7 +929,6 @@ public class Example { String status = "status_example"; // String | Updated status of the pet try { apiInstance.updatePetWithForm(petId, name, status); - } catch (ApiException e) { System.err.println("Exception when calling PetApi#updatePetWithForm"); System.err.println("Status code: " + e.getCode()); @@ -1009,12 +1002,12 @@ public class Example { try { ApiResponse response = apiInstance.updatePetWithFormWithHttpInfo(petId, name, status); System.out.println("Status code: " + response.getStatusCode()); - System.out.println("Response headers: " + response.getHeaders().toString()); + System.out.println("Response headers: " + response.getHeaders()); } catch (ApiException e) { System.err.println("Exception when calling PetApi#updatePetWithForm"); System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); e.printStackTrace(); } } @@ -1082,7 +1075,6 @@ public class Example { File file = new File("/path/to/file"); // File | file to upload try { ModelApiResponse result = apiInstance.uploadFile(petId, additionalMetadata, file); - System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling PetApi#uploadFile"); @@ -1157,13 +1149,13 @@ public class Example { try { ApiResponse response = apiInstance.uploadFileWithHttpInfo(petId, additionalMetadata, file); System.out.println("Status code: " + response.getStatusCode()); - System.out.println("Response headers: " + response.getHeaders().toString()); - System.out.println("Response body: " + response.getData().toString()); + System.out.println("Response headers: " + response.getHeaders()); + System.out.println("Response body: " + response.getData()); } catch (ApiException e) { System.err.println("Exception when calling PetApi#uploadFile"); System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); e.printStackTrace(); } } @@ -1231,7 +1223,6 @@ public class Example { String additionalMetadata = "additionalMetadata_example"; // String | Additional data to pass to server try { ModelApiResponse result = apiInstance.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata); - System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling PetApi#uploadFileWithRequiredFile"); @@ -1306,13 +1297,13 @@ public class Example { try { ApiResponse response = apiInstance.uploadFileWithRequiredFileWithHttpInfo(petId, requiredFile, additionalMetadata); System.out.println("Status code: " + response.getStatusCode()); - System.out.println("Response headers: " + response.getHeaders().toString()); - System.out.println("Response body: " + response.getData().toString()); + System.out.println("Response headers: " + response.getHeaders()); + System.out.println("Response body: " + response.getData()); } catch (ApiException e) { System.err.println("Exception when calling PetApi#uploadFileWithRequiredFile"); System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); e.printStackTrace(); } } diff --git a/samples/client/petstore/java/native/docs/StoreApi.md b/samples/client/petstore/java/native/docs/StoreApi.md index b009b9132082..0c6b58fc81e2 100644 --- a/samples/client/petstore/java/native/docs/StoreApi.md +++ b/samples/client/petstore/java/native/docs/StoreApi.md @@ -5,13 +5,13 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- [**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID -[**deleteOrderWithHttpInfo**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID +[**deleteOrderWithHttpInfo**](StoreApi.md#deleteOrderWithHttpInfo) | **DELETE** /store/order/{order_id} | Delete purchase order by ID [**getInventory**](StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status -[**getInventoryWithHttpInfo**](StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status +[**getInventoryWithHttpInfo**](StoreApi.md#getInventoryWithHttpInfo) | **GET** /store/inventory | Returns pet inventories by status [**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{order_id} | Find purchase order by ID -[**getOrderByIdWithHttpInfo**](StoreApi.md#getOrderById) | **GET** /store/order/{order_id} | Find purchase order by ID +[**getOrderByIdWithHttpInfo**](StoreApi.md#getOrderByIdWithHttpInfo) | **GET** /store/order/{order_id} | Find purchase order by ID [**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet -[**placeOrderWithHttpInfo**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet +[**placeOrderWithHttpInfo**](StoreApi.md#placeOrderWithHttpInfo) | **POST** /store/order | Place an order for a pet @@ -42,7 +42,6 @@ public class Example { String orderId = "orderId_example"; // String | ID of the order that needs to be deleted try { apiInstance.deleteOrder(orderId); - } catch (ApiException e) { System.err.println("Exception when calling StoreApi#deleteOrder"); System.err.println("Status code: " + e.getCode()); @@ -110,12 +109,12 @@ public class Example { try { ApiResponse response = apiInstance.deleteOrderWithHttpInfo(orderId); System.out.println("Status code: " + response.getStatusCode()); - System.out.println("Response headers: " + response.getHeaders().toString()); + System.out.println("Response headers: " + response.getHeaders()); } catch (ApiException e) { System.err.println("Exception when calling StoreApi#deleteOrder"); System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); e.printStackTrace(); } } @@ -183,7 +182,6 @@ public class Example { StoreApi apiInstance = new StoreApi(defaultClient); try { Map result = apiInstance.getInventory(); - System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling StoreApi#getInventory"); @@ -254,13 +252,13 @@ public class Example { try { ApiResponse> response = apiInstance.getInventoryWithHttpInfo(); System.out.println("Status code: " + response.getStatusCode()); - System.out.println("Response headers: " + response.getHeaders().toString()); - System.out.println("Response body: " + response.getData().toString()); + System.out.println("Response headers: " + response.getHeaders()); + System.out.println("Response body: " + response.getData()); } catch (ApiException e) { System.err.println("Exception when calling StoreApi#getInventory"); System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); e.printStackTrace(); } } @@ -318,7 +316,6 @@ public class Example { Long orderId = 56L; // Long | ID of pet that needs to be fetched try { Order result = apiInstance.getOrderById(orderId); - System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling StoreApi#getOrderById"); @@ -388,13 +385,13 @@ public class Example { try { ApiResponse response = apiInstance.getOrderByIdWithHttpInfo(orderId); System.out.println("Status code: " + response.getStatusCode()); - System.out.println("Response headers: " + response.getHeaders().toString()); - System.out.println("Response body: " + response.getData().toString()); + System.out.println("Response headers: " + response.getHeaders()); + System.out.println("Response body: " + response.getData()); } catch (ApiException e) { System.err.println("Exception when calling StoreApi#getOrderById"); System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); e.printStackTrace(); } } @@ -455,7 +452,6 @@ public class Example { Order body = new Order(); // Order | order placed for purchasing the pet try { Order result = apiInstance.placeOrder(body); - System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling StoreApi#placeOrder"); @@ -522,13 +518,13 @@ public class Example { try { ApiResponse response = apiInstance.placeOrderWithHttpInfo(body); System.out.println("Status code: " + response.getStatusCode()); - System.out.println("Response headers: " + response.getHeaders().toString()); - System.out.println("Response body: " + response.getData().toString()); + System.out.println("Response headers: " + response.getHeaders()); + System.out.println("Response body: " + response.getData()); } catch (ApiException e) { System.err.println("Exception when calling StoreApi#placeOrder"); System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); e.printStackTrace(); } } diff --git a/samples/client/petstore/java/native/docs/UserApi.md b/samples/client/petstore/java/native/docs/UserApi.md index a43b140ab6cb..7188e70cb95b 100644 --- a/samples/client/petstore/java/native/docs/UserApi.md +++ b/samples/client/petstore/java/native/docs/UserApi.md @@ -5,21 +5,21 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- [**createUser**](UserApi.md#createUser) | **POST** /user | Create user -[**createUserWithHttpInfo**](UserApi.md#createUser) | **POST** /user | Create user +[**createUserWithHttpInfo**](UserApi.md#createUserWithHttpInfo) | **POST** /user | Create user [**createUsersWithArrayInput**](UserApi.md#createUsersWithArrayInput) | **POST** /user/createWithArray | Creates list of users with given input array -[**createUsersWithArrayInputWithHttpInfo**](UserApi.md#createUsersWithArrayInput) | **POST** /user/createWithArray | Creates list of users with given input array +[**createUsersWithArrayInputWithHttpInfo**](UserApi.md#createUsersWithArrayInputWithHttpInfo) | **POST** /user/createWithArray | Creates list of users with given input array [**createUsersWithListInput**](UserApi.md#createUsersWithListInput) | **POST** /user/createWithList | Creates list of users with given input array -[**createUsersWithListInputWithHttpInfo**](UserApi.md#createUsersWithListInput) | **POST** /user/createWithList | Creates list of users with given input array +[**createUsersWithListInputWithHttpInfo**](UserApi.md#createUsersWithListInputWithHttpInfo) | **POST** /user/createWithList | Creates list of users with given input array [**deleteUser**](UserApi.md#deleteUser) | **DELETE** /user/{username} | Delete user -[**deleteUserWithHttpInfo**](UserApi.md#deleteUser) | **DELETE** /user/{username} | Delete user +[**deleteUserWithHttpInfo**](UserApi.md#deleteUserWithHttpInfo) | **DELETE** /user/{username} | Delete user [**getUserByName**](UserApi.md#getUserByName) | **GET** /user/{username} | Get user by user name -[**getUserByNameWithHttpInfo**](UserApi.md#getUserByName) | **GET** /user/{username} | Get user by user name +[**getUserByNameWithHttpInfo**](UserApi.md#getUserByNameWithHttpInfo) | **GET** /user/{username} | Get user by user name [**loginUser**](UserApi.md#loginUser) | **GET** /user/login | Logs user into the system -[**loginUserWithHttpInfo**](UserApi.md#loginUser) | **GET** /user/login | Logs user into the system +[**loginUserWithHttpInfo**](UserApi.md#loginUserWithHttpInfo) | **GET** /user/login | Logs user into the system [**logoutUser**](UserApi.md#logoutUser) | **GET** /user/logout | Logs out current logged in user session -[**logoutUserWithHttpInfo**](UserApi.md#logoutUser) | **GET** /user/logout | Logs out current logged in user session +[**logoutUserWithHttpInfo**](UserApi.md#logoutUserWithHttpInfo) | **GET** /user/logout | Logs out current logged in user session [**updateUser**](UserApi.md#updateUser) | **PUT** /user/{username} | Updated user -[**updateUserWithHttpInfo**](UserApi.md#updateUser) | **PUT** /user/{username} | Updated user +[**updateUserWithHttpInfo**](UserApi.md#updateUserWithHttpInfo) | **PUT** /user/{username} | Updated user @@ -50,7 +50,6 @@ public class Example { User body = new User(); // User | Created user object try { apiInstance.createUser(body); - } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUser"); System.err.println("Status code: " + e.getCode()); @@ -117,12 +116,12 @@ public class Example { try { ApiResponse response = apiInstance.createUserWithHttpInfo(body); System.out.println("Status code: " + response.getStatusCode()); - System.out.println("Response headers: " + response.getHeaders().toString()); + System.out.println("Response headers: " + response.getHeaders()); } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUser"); System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); e.printStackTrace(); } } @@ -181,7 +180,6 @@ public class Example { List body = Arrays.asList(); // List | List of user object try { apiInstance.createUsersWithArrayInput(body); - } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUsersWithArrayInput"); System.err.println("Status code: " + e.getCode()); @@ -246,12 +244,12 @@ public class Example { try { ApiResponse response = apiInstance.createUsersWithArrayInputWithHttpInfo(body); System.out.println("Status code: " + response.getStatusCode()); - System.out.println("Response headers: " + response.getHeaders().toString()); + System.out.println("Response headers: " + response.getHeaders()); } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUsersWithArrayInput"); System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); e.printStackTrace(); } } @@ -310,7 +308,6 @@ public class Example { List body = Arrays.asList(); // List | List of user object try { apiInstance.createUsersWithListInput(body); - } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUsersWithListInput"); System.err.println("Status code: " + e.getCode()); @@ -375,12 +372,12 @@ public class Example { try { ApiResponse response = apiInstance.createUsersWithListInputWithHttpInfo(body); System.out.println("Status code: " + response.getStatusCode()); - System.out.println("Response headers: " + response.getHeaders().toString()); + System.out.println("Response headers: " + response.getHeaders()); } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUsersWithListInput"); System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); e.printStackTrace(); } } @@ -441,7 +438,6 @@ public class Example { String username = "username_example"; // String | The name that needs to be deleted try { apiInstance.deleteUser(username); - } catch (ApiException e) { System.err.println("Exception when calling UserApi#deleteUser"); System.err.println("Status code: " + e.getCode()); @@ -509,12 +505,12 @@ public class Example { try { ApiResponse response = apiInstance.deleteUserWithHttpInfo(username); System.out.println("Status code: " + response.getStatusCode()); - System.out.println("Response headers: " + response.getHeaders().toString()); + System.out.println("Response headers: " + response.getHeaders()); } catch (ApiException e) { System.err.println("Exception when calling UserApi#deleteUser"); System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); e.printStackTrace(); } } @@ -574,7 +570,6 @@ public class Example { String username = "username_example"; // String | The name that needs to be fetched. Use user1 for testing. try { User result = apiInstance.getUserByName(username); - System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling UserApi#getUserByName"); @@ -642,13 +637,13 @@ public class Example { try { ApiResponse response = apiInstance.getUserByNameWithHttpInfo(username); System.out.println("Status code: " + response.getStatusCode()); - System.out.println("Response headers: " + response.getHeaders().toString()); - System.out.println("Response body: " + response.getData().toString()); + System.out.println("Response headers: " + response.getHeaders()); + System.out.println("Response body: " + response.getData()); } catch (ApiException e) { System.err.println("Exception when calling UserApi#getUserByName"); System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); e.printStackTrace(); } } @@ -710,7 +705,6 @@ public class Example { String password = "password_example"; // String | The password for login in clear text try { String result = apiInstance.loginUser(username, password); - System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling UserApi#loginUser"); @@ -779,13 +773,13 @@ public class Example { try { ApiResponse response = apiInstance.loginUserWithHttpInfo(username, password); System.out.println("Status code: " + response.getStatusCode()); - System.out.println("Response headers: " + response.getHeaders().toString()); - System.out.println("Response body: " + response.getData().toString()); + System.out.println("Response headers: " + response.getHeaders()); + System.out.println("Response body: " + response.getData()); } catch (ApiException e) { System.err.println("Exception when calling UserApi#loginUser"); System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); e.printStackTrace(); } } @@ -845,7 +839,6 @@ public class Example { UserApi apiInstance = new UserApi(defaultClient); try { apiInstance.logoutUser(); - } catch (ApiException e) { System.err.println("Exception when calling UserApi#logoutUser"); System.err.println("Status code: " + e.getCode()); @@ -906,12 +899,12 @@ public class Example { try { ApiResponse response = apiInstance.logoutUserWithHttpInfo(); System.out.println("Status code: " + response.getStatusCode()); - System.out.println("Response headers: " + response.getHeaders().toString()); + System.out.println("Response headers: " + response.getHeaders()); } catch (ApiException e) { System.err.println("Exception when calling UserApi#logoutUser"); System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); e.printStackTrace(); } } @@ -970,7 +963,6 @@ public class Example { User body = new User(); // User | Updated user object try { apiInstance.updateUser(username, body); - } catch (ApiException e) { System.err.println("Exception when calling UserApi#updateUser"); System.err.println("Status code: " + e.getCode()); @@ -1040,12 +1032,12 @@ public class Example { try { ApiResponse response = apiInstance.updateUserWithHttpInfo(username, body); System.out.println("Status code: " + response.getStatusCode()); - System.out.println("Response headers: " + response.getHeaders().toString()); + System.out.println("Response headers: " + response.getHeaders()); } catch (ApiException e) { System.err.println("Exception when calling UserApi#updateUser"); System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); e.printStackTrace(); } } From ffdd7000a409902be367b4fea809fbaa7b91848b Mon Sep 17 00:00:00 2001 From: mh03r932 Date: Fri, 17 Jul 2020 12:08:51 +0200 Subject: [PATCH 027/129] fix: make accept header consistent with sync vers. (#6922) * fix: make accept header of async apis consistent with sync version * make sync and async version use same logic * generate samples for csharp-netcore using generate-samples.sh * fix: make accept header of async apis consistent with sync version * change tabs to spaces to match existing code --- .../resources/csharp-netcore/api.mustache | 13 +- .../Org.OpenAPITools/Api/AnotherFakeApi.cs | 13 +- .../src/Org.OpenAPITools/Api/FakeApi.cs | 182 ++++++++++-------- .../Api/FakeClassnameTags123Api.cs | 13 +- .../src/Org.OpenAPITools/Api/PetApi.cs | 117 +++++------ .../src/Org.OpenAPITools/Api/StoreApi.cs | 52 ++--- .../src/Org.OpenAPITools/Api/UserApi.cs | 104 +++++----- 7 files changed, 266 insertions(+), 228 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/api.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/api.mustache index 4f968e5a79aa..644c038885a3 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/api.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/api.mustache @@ -418,12 +418,13 @@ namespace {{packageName}}.{{apiPackage}} "{{{mediaType}}}"{{#hasMore}},{{/hasMore}} {{/produces}} }; - - foreach (var _contentType in _contentTypes) - localVarRequestOptions.HeaderParameters.Add("Content-Type", _contentType); - - foreach (var _accept in _accepts) - localVarRequestOptions.HeaderParameters.Add("Accept", _accept); + + + var localVarContentType = {{packageName}}.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = {{packageName}}.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); {{#pathParams}} {{#required}} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/AnotherFakeApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/AnotherFakeApi.cs index e7895f13c626..99156f92d281 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/AnotherFakeApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/AnotherFakeApi.cs @@ -290,12 +290,13 @@ public async System.Threading.Tasks.Task Call123TestSpecialTagsAsyn String[] _accepts = new String[] { "application/json" }; - - foreach (var _contentType in _contentTypes) - localVarRequestOptions.HeaderParameters.Add("Content-Type", _contentType); - - foreach (var _accept in _accepts) - localVarRequestOptions.HeaderParameters.Add("Accept", _accept); + + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); localVarRequestOptions.Data = body; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/FakeApi.cs index 10fd8f0804c1..55ac584e8a77 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/FakeApi.cs @@ -966,12 +966,13 @@ public async System.Threading.Tasks.Task CreateXmlItemAsync (XmlItem xmlItem) // to determine the Accept header String[] _accepts = new String[] { }; - - foreach (var _contentType in _contentTypes) - localVarRequestOptions.HeaderParameters.Add("Content-Type", _contentType); - - foreach (var _accept in _accepts) - localVarRequestOptions.HeaderParameters.Add("Accept", _accept); + + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); localVarRequestOptions.Data = xmlItem; @@ -1071,12 +1072,13 @@ public async System.Threading.Tasks.Task CreateXmlItemAsync (XmlItem xmlItem) String[] _accepts = new String[] { "*/*" }; - - foreach (var _contentType in _contentTypes) - localVarRequestOptions.HeaderParameters.Add("Content-Type", _contentType); - - foreach (var _accept in _accepts) - localVarRequestOptions.HeaderParameters.Add("Accept", _accept); + + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); localVarRequestOptions.Data = body; @@ -1176,12 +1178,13 @@ public async System.Threading.Tasks.Task CreateXmlItemAsync (XmlItem xmlItem) String[] _accepts = new String[] { "*/*" }; - - foreach (var _contentType in _contentTypes) - localVarRequestOptions.HeaderParameters.Add("Content-Type", _contentType); - - foreach (var _accept in _accepts) - localVarRequestOptions.HeaderParameters.Add("Accept", _accept); + + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); localVarRequestOptions.Data = body; @@ -1281,12 +1284,13 @@ public async System.Threading.Tasks.Task CreateXmlItemAsync (XmlItem xmlItem) String[] _accepts = new String[] { "*/*" }; - - foreach (var _contentType in _contentTypes) - localVarRequestOptions.HeaderParameters.Add("Content-Type", _contentType); - - foreach (var _accept in _accepts) - localVarRequestOptions.HeaderParameters.Add("Accept", _accept); + + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); localVarRequestOptions.Data = body; @@ -1386,12 +1390,13 @@ public async System.Threading.Tasks.Task CreateXmlItemAsync (XmlItem xmlItem) String[] _accepts = new String[] { "*/*" }; - - foreach (var _contentType in _contentTypes) - localVarRequestOptions.HeaderParameters.Add("Content-Type", _contentType); - - foreach (var _accept in _accepts) - localVarRequestOptions.HeaderParameters.Add("Accept", _accept); + + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); localVarRequestOptions.Data = body; @@ -1497,12 +1502,13 @@ public async System.Threading.Tasks.Task TestBodyWithFileSchemaAsync (FileSchema // to determine the Accept header String[] _accepts = new String[] { }; - - foreach (var _contentType in _contentTypes) - localVarRequestOptions.HeaderParameters.Add("Content-Type", _contentType); - - foreach (var _accept in _accepts) - localVarRequestOptions.HeaderParameters.Add("Accept", _accept); + + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); localVarRequestOptions.Data = body; @@ -1621,12 +1627,13 @@ public async System.Threading.Tasks.Task TestBodyWithQueryParamsAsync (string qu // to determine the Accept header String[] _accepts = new String[] { }; - - foreach (var _contentType in _contentTypes) - localVarRequestOptions.HeaderParameters.Add("Content-Type", _contentType); - - foreach (var _accept in _accepts) - localVarRequestOptions.HeaderParameters.Add("Accept", _accept); + + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "query", query)); localVarRequestOptions.Data = body; @@ -1737,12 +1744,13 @@ public async System.Threading.Tasks.Task TestClientModelAsync (Mode String[] _accepts = new String[] { "application/json" }; - - foreach (var _contentType in _contentTypes) - localVarRequestOptions.HeaderParameters.Add("Content-Type", _contentType); - - foreach (var _accept in _accepts) - localVarRequestOptions.HeaderParameters.Add("Accept", _accept); + + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); localVarRequestOptions.Data = body; @@ -1957,12 +1965,13 @@ public async System.Threading.Tasks.Task TestClientModelAsync (Mode // to determine the Accept header String[] _accepts = new String[] { }; - - foreach (var _contentType in _contentTypes) - localVarRequestOptions.HeaderParameters.Add("Content-Type", _contentType); - - foreach (var _accept in _accepts) - localVarRequestOptions.HeaderParameters.Add("Accept", _accept); + + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); if (integer != null) { @@ -2168,12 +2177,13 @@ public async System.Threading.Tasks.Task TestClientModelAsync (Mode // to determine the Accept header String[] _accepts = new String[] { }; - - foreach (var _contentType in _contentTypes) - localVarRequestOptions.HeaderParameters.Add("Content-Type", _contentType); - - foreach (var _accept in _accepts) - localVarRequestOptions.HeaderParameters.Add("Accept", _accept); + + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); if (enumQueryStringArray != null) { @@ -2334,12 +2344,13 @@ public async System.Threading.Tasks.Task TestClientModelAsync (Mode // to determine the Accept header String[] _accepts = new String[] { }; - - foreach (var _contentType in _contentTypes) - localVarRequestOptions.HeaderParameters.Add("Content-Type", _contentType); - - foreach (var _accept in _accepts) - localVarRequestOptions.HeaderParameters.Add("Accept", _accept); + + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "required_string_group", requiredStringGroup)); localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "required_int64_group", requiredInt64Group)); @@ -2459,12 +2470,13 @@ public async System.Threading.Tasks.Task TestInlineAdditionalPropertiesAsync (Di // to determine the Accept header String[] _accepts = new String[] { }; - - foreach (var _contentType in _contentTypes) - localVarRequestOptions.HeaderParameters.Add("Content-Type", _contentType); - - foreach (var _accept in _accepts) - localVarRequestOptions.HeaderParameters.Add("Accept", _accept); + + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); localVarRequestOptions.Data = param; @@ -2583,12 +2595,13 @@ public async System.Threading.Tasks.Task TestJsonFormDataAsync (string param, st // to determine the Accept header String[] _accepts = new String[] { }; - - foreach (var _contentType in _contentTypes) - localVarRequestOptions.HeaderParameters.Add("Content-Type", _contentType); - - foreach (var _accept in _accepts) - localVarRequestOptions.HeaderParameters.Add("Accept", _accept); + + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); localVarRequestOptions.FormParameters.Add("param", Org.OpenAPITools.Client.ClientUtils.ParameterToString(param)); // form parameter localVarRequestOptions.FormParameters.Add("param2", Org.OpenAPITools.Client.ClientUtils.ParameterToString(param2)); // form parameter @@ -2745,12 +2758,13 @@ public async System.Threading.Tasks.Task TestQueryParameterCollectionFormatAsync // to determine the Accept header String[] _accepts = new String[] { }; - - foreach (var _contentType in _contentTypes) - localVarRequestOptions.HeaderParameters.Add("Content-Type", _contentType); - - foreach (var _accept in _accepts) - localVarRequestOptions.HeaderParameters.Add("Accept", _accept); + + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "pipe", pipe)); localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "ioutil", ioutil)); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs index 492bae795c49..b663807131fd 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs @@ -295,12 +295,13 @@ public async System.Threading.Tasks.Task TestClassnameAsync (ModelC String[] _accepts = new String[] { "application/json" }; - - foreach (var _contentType in _contentTypes) - localVarRequestOptions.HeaderParameters.Add("Content-Type", _contentType); - - foreach (var _accept in _accepts) - localVarRequestOptions.HeaderParameters.Add("Accept", _accept); + + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); localVarRequestOptions.Data = body; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/PetApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/PetApi.cs index 502c7f252689..6c50956c4ad5 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/PetApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/PetApi.cs @@ -658,12 +658,13 @@ public async System.Threading.Tasks.Task AddPetAsync (Pet body) // to determine the Accept header String[] _accepts = new String[] { }; - - foreach (var _contentType in _contentTypes) - localVarRequestOptions.HeaderParameters.Add("Content-Type", _contentType); - - foreach (var _accept in _accepts) - localVarRequestOptions.HeaderParameters.Add("Accept", _accept); + + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); localVarRequestOptions.Data = body; @@ -779,12 +780,13 @@ public async System.Threading.Tasks.Task AddPetAsync (Pet body) // to determine the Accept header String[] _accepts = new String[] { }; - - foreach (var _contentType in _contentTypes) - localVarRequestOptions.HeaderParameters.Add("Content-Type", _contentType); - - foreach (var _accept in _accepts) - localVarRequestOptions.HeaderParameters.Add("Accept", _accept); + + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter if (apiKey != null) @@ -910,12 +912,13 @@ public async System.Threading.Tasks.Task> FindPetsByStatusAsync (List< "application/xml", "application/json" }; - - foreach (var _contentType in _contentTypes) - localVarRequestOptions.HeaderParameters.Add("Content-Type", _contentType); - - foreach (var _accept in _accepts) - localVarRequestOptions.HeaderParameters.Add("Accept", _accept); + + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "status", status)); @@ -1037,12 +1040,13 @@ public async System.Threading.Tasks.Task> FindPetsByTagsAsync (List GetPetByIdAsync (long petId) "application/xml", "application/json" }; - - foreach (var _contentType in _contentTypes) - localVarRequestOptions.HeaderParameters.Add("Content-Type", _contentType); - - foreach (var _accept in _accepts) - localVarRequestOptions.HeaderParameters.Add("Accept", _accept); + + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter @@ -1279,12 +1284,13 @@ public async System.Threading.Tasks.Task UpdatePetAsync (Pet body) // to determine the Accept header String[] _accepts = new String[] { }; - - foreach (var _contentType in _contentTypes) - localVarRequestOptions.HeaderParameters.Add("Content-Type", _contentType); - - foreach (var _accept in _accepts) - localVarRequestOptions.HeaderParameters.Add("Accept", _accept); + + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); localVarRequestOptions.Data = body; @@ -1410,12 +1416,13 @@ public async System.Threading.Tasks.Task UpdatePetAsync (Pet body) // to determine the Accept header String[] _accepts = new String[] { }; - - foreach (var _contentType in _contentTypes) - localVarRequestOptions.HeaderParameters.Add("Content-Type", _contentType); - - foreach (var _accept in _accepts) - localVarRequestOptions.HeaderParameters.Add("Accept", _accept); + + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter if (name != null) @@ -1553,12 +1560,13 @@ public async System.Threading.Tasks.Task UpdatePetAsync (Pet body) String[] _accepts = new String[] { "application/json" }; - - foreach (var _contentType in _contentTypes) - localVarRequestOptions.HeaderParameters.Add("Content-Type", _contentType); - - foreach (var _accept in _accepts) - localVarRequestOptions.HeaderParameters.Add("Accept", _accept); + + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter if (additionalMetadata != null) @@ -1701,12 +1709,13 @@ public async System.Threading.Tasks.Task UpdatePetAsync (Pet body) String[] _accepts = new String[] { "application/json" }; - - foreach (var _contentType in _contentTypes) - localVarRequestOptions.HeaderParameters.Add("Content-Type", _contentType); - - foreach (var _accept in _accepts) - localVarRequestOptions.HeaderParameters.Add("Accept", _accept); + + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter if (additionalMetadata != null) diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/StoreApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/StoreApi.cs index 40f9fb0fab30..a7379d4eac15 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/StoreApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/StoreApi.cs @@ -406,12 +406,13 @@ public async System.Threading.Tasks.Task DeleteOrderAsync (string orderId) // to determine the Accept header String[] _accepts = new String[] { }; - - foreach (var _contentType in _contentTypes) - localVarRequestOptions.HeaderParameters.Add("Content-Type", _contentType); - - foreach (var _accept in _accepts) - localVarRequestOptions.HeaderParameters.Add("Accept", _accept); + + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); localVarRequestOptions.PathParameters.Add("order_id", Org.OpenAPITools.Client.ClientUtils.ParameterToString(orderId)); // path parameter @@ -511,12 +512,13 @@ public async System.Threading.Tasks.Task> GetInventoryAs String[] _accepts = new String[] { "application/json" }; - - foreach (var _contentType in _contentTypes) - localVarRequestOptions.HeaderParameters.Add("Content-Type", _contentType); - - foreach (var _accept in _accepts) - localVarRequestOptions.HeaderParameters.Add("Accept", _accept); + + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); // authentication (api_key) required @@ -622,12 +624,13 @@ public async System.Threading.Tasks.Task GetOrderByIdAsync (long orderId) "application/xml", "application/json" }; - - foreach (var _contentType in _contentTypes) - localVarRequestOptions.HeaderParameters.Add("Content-Type", _contentType); - - foreach (var _accept in _accepts) - localVarRequestOptions.HeaderParameters.Add("Accept", _accept); + + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); localVarRequestOptions.PathParameters.Add("order_id", Org.OpenAPITools.Client.ClientUtils.ParameterToString(orderId)); // path parameter @@ -737,12 +740,13 @@ public async System.Threading.Tasks.Task PlaceOrderAsync (Order body) "application/xml", "application/json" }; - - foreach (var _contentType in _contentTypes) - localVarRequestOptions.HeaderParameters.Add("Content-Type", _contentType); - - foreach (var _accept in _accepts) - localVarRequestOptions.HeaderParameters.Add("Accept", _accept); + + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); localVarRequestOptions.Data = body; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/UserApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/UserApi.cs index e20098ed6547..f233973eb0cb 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/UserApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/UserApi.cs @@ -582,12 +582,13 @@ public async System.Threading.Tasks.Task CreateUserAsync (User body) // to determine the Accept header String[] _accepts = new String[] { }; - - foreach (var _contentType in _contentTypes) - localVarRequestOptions.HeaderParameters.Add("Content-Type", _contentType); - - foreach (var _accept in _accepts) - localVarRequestOptions.HeaderParameters.Add("Accept", _accept); + + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); localVarRequestOptions.Data = body; @@ -691,12 +692,13 @@ public async System.Threading.Tasks.Task CreateUsersWithArrayInputAsync (List GetUserByNameAsync (string userna "application/xml", "application/json" }; - - foreach (var _contentType in _contentTypes) - localVarRequestOptions.HeaderParameters.Add("Content-Type", _contentType); - - foreach (var _accept in _accepts) - localVarRequestOptions.HeaderParameters.Add("Accept", _accept); + + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); localVarRequestOptions.PathParameters.Add("username", Org.OpenAPITools.Client.ClientUtils.ParameterToString(username)); // path parameter @@ -1152,12 +1157,13 @@ public async System.Threading.Tasks.Task LoginUserAsync (string username "application/xml", "application/json" }; - - foreach (var _contentType in _contentTypes) - localVarRequestOptions.HeaderParameters.Add("Content-Type", _contentType); - - foreach (var _accept in _accepts) - localVarRequestOptions.HeaderParameters.Add("Accept", _accept); + + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "username", username)); localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "password", password)); @@ -1249,12 +1255,13 @@ public async System.Threading.Tasks.Task LogoutUserAsync () // to determine the Accept header String[] _accepts = new String[] { }; - - foreach (var _contentType in _contentTypes) - localVarRequestOptions.HeaderParameters.Add("Content-Type", _contentType); - - foreach (var _accept in _accepts) - localVarRequestOptions.HeaderParameters.Add("Accept", _accept); + + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); @@ -1370,12 +1377,13 @@ public async System.Threading.Tasks.Task UpdateUserAsync (string username, User // to determine the Accept header String[] _accepts = new String[] { }; - - foreach (var _contentType in _contentTypes) - localVarRequestOptions.HeaderParameters.Add("Content-Type", _contentType); - - foreach (var _accept in _accepts) - localVarRequestOptions.HeaderParameters.Add("Accept", _accept); + + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); localVarRequestOptions.PathParameters.Add("username", Org.OpenAPITools.Client.ClientUtils.ParameterToString(username)); // path parameter localVarRequestOptions.Data = body; From d2161c8ad1c4ec0e95f40dde5324a73db5b1a387 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Sat, 18 Jul 2020 11:18:21 +0800 Subject: [PATCH 028/129] update c# samples --- .../Org.OpenAPITools/Api/AnotherFakeApi.cs | 13 +- .../src/Org.OpenAPITools/Api/FakeApi.cs | 182 ++++++++++-------- .../Api/FakeClassnameTags123Api.cs | 13 +- .../src/Org.OpenAPITools/Api/PetApi.cs | 117 +++++------ .../src/Org.OpenAPITools/Api/StoreApi.cs | 52 ++--- .../src/Org.OpenAPITools/Api/UserApi.cs | 104 +++++----- 6 files changed, 259 insertions(+), 222 deletions(-) diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/AnotherFakeApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/AnotherFakeApi.cs index e7895f13c626..99156f92d281 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/AnotherFakeApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/AnotherFakeApi.cs @@ -290,12 +290,13 @@ public async System.Threading.Tasks.Task Call123TestSpecialTagsAsyn String[] _accepts = new String[] { "application/json" }; - - foreach (var _contentType in _contentTypes) - localVarRequestOptions.HeaderParameters.Add("Content-Type", _contentType); - - foreach (var _accept in _accepts) - localVarRequestOptions.HeaderParameters.Add("Accept", _accept); + + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); localVarRequestOptions.Data = body; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/FakeApi.cs index 10fd8f0804c1..55ac584e8a77 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/FakeApi.cs @@ -966,12 +966,13 @@ public async System.Threading.Tasks.Task CreateXmlItemAsync (XmlItem xmlItem) // to determine the Accept header String[] _accepts = new String[] { }; - - foreach (var _contentType in _contentTypes) - localVarRequestOptions.HeaderParameters.Add("Content-Type", _contentType); - - foreach (var _accept in _accepts) - localVarRequestOptions.HeaderParameters.Add("Accept", _accept); + + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); localVarRequestOptions.Data = xmlItem; @@ -1071,12 +1072,13 @@ public async System.Threading.Tasks.Task CreateXmlItemAsync (XmlItem xmlItem) String[] _accepts = new String[] { "*/*" }; - - foreach (var _contentType in _contentTypes) - localVarRequestOptions.HeaderParameters.Add("Content-Type", _contentType); - - foreach (var _accept in _accepts) - localVarRequestOptions.HeaderParameters.Add("Accept", _accept); + + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); localVarRequestOptions.Data = body; @@ -1176,12 +1178,13 @@ public async System.Threading.Tasks.Task CreateXmlItemAsync (XmlItem xmlItem) String[] _accepts = new String[] { "*/*" }; - - foreach (var _contentType in _contentTypes) - localVarRequestOptions.HeaderParameters.Add("Content-Type", _contentType); - - foreach (var _accept in _accepts) - localVarRequestOptions.HeaderParameters.Add("Accept", _accept); + + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); localVarRequestOptions.Data = body; @@ -1281,12 +1284,13 @@ public async System.Threading.Tasks.Task CreateXmlItemAsync (XmlItem xmlItem) String[] _accepts = new String[] { "*/*" }; - - foreach (var _contentType in _contentTypes) - localVarRequestOptions.HeaderParameters.Add("Content-Type", _contentType); - - foreach (var _accept in _accepts) - localVarRequestOptions.HeaderParameters.Add("Accept", _accept); + + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); localVarRequestOptions.Data = body; @@ -1386,12 +1390,13 @@ public async System.Threading.Tasks.Task CreateXmlItemAsync (XmlItem xmlItem) String[] _accepts = new String[] { "*/*" }; - - foreach (var _contentType in _contentTypes) - localVarRequestOptions.HeaderParameters.Add("Content-Type", _contentType); - - foreach (var _accept in _accepts) - localVarRequestOptions.HeaderParameters.Add("Accept", _accept); + + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); localVarRequestOptions.Data = body; @@ -1497,12 +1502,13 @@ public async System.Threading.Tasks.Task TestBodyWithFileSchemaAsync (FileSchema // to determine the Accept header String[] _accepts = new String[] { }; - - foreach (var _contentType in _contentTypes) - localVarRequestOptions.HeaderParameters.Add("Content-Type", _contentType); - - foreach (var _accept in _accepts) - localVarRequestOptions.HeaderParameters.Add("Accept", _accept); + + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); localVarRequestOptions.Data = body; @@ -1621,12 +1627,13 @@ public async System.Threading.Tasks.Task TestBodyWithQueryParamsAsync (string qu // to determine the Accept header String[] _accepts = new String[] { }; - - foreach (var _contentType in _contentTypes) - localVarRequestOptions.HeaderParameters.Add("Content-Type", _contentType); - - foreach (var _accept in _accepts) - localVarRequestOptions.HeaderParameters.Add("Accept", _accept); + + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "query", query)); localVarRequestOptions.Data = body; @@ -1737,12 +1744,13 @@ public async System.Threading.Tasks.Task TestClientModelAsync (Mode String[] _accepts = new String[] { "application/json" }; - - foreach (var _contentType in _contentTypes) - localVarRequestOptions.HeaderParameters.Add("Content-Type", _contentType); - - foreach (var _accept in _accepts) - localVarRequestOptions.HeaderParameters.Add("Accept", _accept); + + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); localVarRequestOptions.Data = body; @@ -1957,12 +1965,13 @@ public async System.Threading.Tasks.Task TestClientModelAsync (Mode // to determine the Accept header String[] _accepts = new String[] { }; - - foreach (var _contentType in _contentTypes) - localVarRequestOptions.HeaderParameters.Add("Content-Type", _contentType); - - foreach (var _accept in _accepts) - localVarRequestOptions.HeaderParameters.Add("Accept", _accept); + + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); if (integer != null) { @@ -2168,12 +2177,13 @@ public async System.Threading.Tasks.Task TestClientModelAsync (Mode // to determine the Accept header String[] _accepts = new String[] { }; - - foreach (var _contentType in _contentTypes) - localVarRequestOptions.HeaderParameters.Add("Content-Type", _contentType); - - foreach (var _accept in _accepts) - localVarRequestOptions.HeaderParameters.Add("Accept", _accept); + + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); if (enumQueryStringArray != null) { @@ -2334,12 +2344,13 @@ public async System.Threading.Tasks.Task TestClientModelAsync (Mode // to determine the Accept header String[] _accepts = new String[] { }; - - foreach (var _contentType in _contentTypes) - localVarRequestOptions.HeaderParameters.Add("Content-Type", _contentType); - - foreach (var _accept in _accepts) - localVarRequestOptions.HeaderParameters.Add("Accept", _accept); + + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "required_string_group", requiredStringGroup)); localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "required_int64_group", requiredInt64Group)); @@ -2459,12 +2470,13 @@ public async System.Threading.Tasks.Task TestInlineAdditionalPropertiesAsync (Di // to determine the Accept header String[] _accepts = new String[] { }; - - foreach (var _contentType in _contentTypes) - localVarRequestOptions.HeaderParameters.Add("Content-Type", _contentType); - - foreach (var _accept in _accepts) - localVarRequestOptions.HeaderParameters.Add("Accept", _accept); + + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); localVarRequestOptions.Data = param; @@ -2583,12 +2595,13 @@ public async System.Threading.Tasks.Task TestJsonFormDataAsync (string param, st // to determine the Accept header String[] _accepts = new String[] { }; - - foreach (var _contentType in _contentTypes) - localVarRequestOptions.HeaderParameters.Add("Content-Type", _contentType); - - foreach (var _accept in _accepts) - localVarRequestOptions.HeaderParameters.Add("Accept", _accept); + + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); localVarRequestOptions.FormParameters.Add("param", Org.OpenAPITools.Client.ClientUtils.ParameterToString(param)); // form parameter localVarRequestOptions.FormParameters.Add("param2", Org.OpenAPITools.Client.ClientUtils.ParameterToString(param2)); // form parameter @@ -2745,12 +2758,13 @@ public async System.Threading.Tasks.Task TestQueryParameterCollectionFormatAsync // to determine the Accept header String[] _accepts = new String[] { }; - - foreach (var _contentType in _contentTypes) - localVarRequestOptions.HeaderParameters.Add("Content-Type", _contentType); - - foreach (var _accept in _accepts) - localVarRequestOptions.HeaderParameters.Add("Accept", _accept); + + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "pipe", pipe)); localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "ioutil", ioutil)); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs index 492bae795c49..b663807131fd 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs @@ -295,12 +295,13 @@ public async System.Threading.Tasks.Task TestClassnameAsync (ModelC String[] _accepts = new String[] { "application/json" }; - - foreach (var _contentType in _contentTypes) - localVarRequestOptions.HeaderParameters.Add("Content-Type", _contentType); - - foreach (var _accept in _accepts) - localVarRequestOptions.HeaderParameters.Add("Accept", _accept); + + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); localVarRequestOptions.Data = body; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/PetApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/PetApi.cs index 502c7f252689..6c50956c4ad5 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/PetApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/PetApi.cs @@ -658,12 +658,13 @@ public async System.Threading.Tasks.Task AddPetAsync (Pet body) // to determine the Accept header String[] _accepts = new String[] { }; - - foreach (var _contentType in _contentTypes) - localVarRequestOptions.HeaderParameters.Add("Content-Type", _contentType); - - foreach (var _accept in _accepts) - localVarRequestOptions.HeaderParameters.Add("Accept", _accept); + + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); localVarRequestOptions.Data = body; @@ -779,12 +780,13 @@ public async System.Threading.Tasks.Task AddPetAsync (Pet body) // to determine the Accept header String[] _accepts = new String[] { }; - - foreach (var _contentType in _contentTypes) - localVarRequestOptions.HeaderParameters.Add("Content-Type", _contentType); - - foreach (var _accept in _accepts) - localVarRequestOptions.HeaderParameters.Add("Accept", _accept); + + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter if (apiKey != null) @@ -910,12 +912,13 @@ public async System.Threading.Tasks.Task> FindPetsByStatusAsync (List< "application/xml", "application/json" }; - - foreach (var _contentType in _contentTypes) - localVarRequestOptions.HeaderParameters.Add("Content-Type", _contentType); - - foreach (var _accept in _accepts) - localVarRequestOptions.HeaderParameters.Add("Accept", _accept); + + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "status", status)); @@ -1037,12 +1040,13 @@ public async System.Threading.Tasks.Task> FindPetsByTagsAsync (List GetPetByIdAsync (long petId) "application/xml", "application/json" }; - - foreach (var _contentType in _contentTypes) - localVarRequestOptions.HeaderParameters.Add("Content-Type", _contentType); - - foreach (var _accept in _accepts) - localVarRequestOptions.HeaderParameters.Add("Accept", _accept); + + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter @@ -1279,12 +1284,13 @@ public async System.Threading.Tasks.Task UpdatePetAsync (Pet body) // to determine the Accept header String[] _accepts = new String[] { }; - - foreach (var _contentType in _contentTypes) - localVarRequestOptions.HeaderParameters.Add("Content-Type", _contentType); - - foreach (var _accept in _accepts) - localVarRequestOptions.HeaderParameters.Add("Accept", _accept); + + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); localVarRequestOptions.Data = body; @@ -1410,12 +1416,13 @@ public async System.Threading.Tasks.Task UpdatePetAsync (Pet body) // to determine the Accept header String[] _accepts = new String[] { }; - - foreach (var _contentType in _contentTypes) - localVarRequestOptions.HeaderParameters.Add("Content-Type", _contentType); - - foreach (var _accept in _accepts) - localVarRequestOptions.HeaderParameters.Add("Accept", _accept); + + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter if (name != null) @@ -1553,12 +1560,13 @@ public async System.Threading.Tasks.Task UpdatePetAsync (Pet body) String[] _accepts = new String[] { "application/json" }; - - foreach (var _contentType in _contentTypes) - localVarRequestOptions.HeaderParameters.Add("Content-Type", _contentType); - - foreach (var _accept in _accepts) - localVarRequestOptions.HeaderParameters.Add("Accept", _accept); + + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter if (additionalMetadata != null) @@ -1701,12 +1709,13 @@ public async System.Threading.Tasks.Task UpdatePetAsync (Pet body) String[] _accepts = new String[] { "application/json" }; - - foreach (var _contentType in _contentTypes) - localVarRequestOptions.HeaderParameters.Add("Content-Type", _contentType); - - foreach (var _accept in _accepts) - localVarRequestOptions.HeaderParameters.Add("Accept", _accept); + + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter if (additionalMetadata != null) diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/StoreApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/StoreApi.cs index 40f9fb0fab30..a7379d4eac15 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/StoreApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/StoreApi.cs @@ -406,12 +406,13 @@ public async System.Threading.Tasks.Task DeleteOrderAsync (string orderId) // to determine the Accept header String[] _accepts = new String[] { }; - - foreach (var _contentType in _contentTypes) - localVarRequestOptions.HeaderParameters.Add("Content-Type", _contentType); - - foreach (var _accept in _accepts) - localVarRequestOptions.HeaderParameters.Add("Accept", _accept); + + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); localVarRequestOptions.PathParameters.Add("order_id", Org.OpenAPITools.Client.ClientUtils.ParameterToString(orderId)); // path parameter @@ -511,12 +512,13 @@ public async System.Threading.Tasks.Task> GetInventoryAs String[] _accepts = new String[] { "application/json" }; - - foreach (var _contentType in _contentTypes) - localVarRequestOptions.HeaderParameters.Add("Content-Type", _contentType); - - foreach (var _accept in _accepts) - localVarRequestOptions.HeaderParameters.Add("Accept", _accept); + + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); // authentication (api_key) required @@ -622,12 +624,13 @@ public async System.Threading.Tasks.Task GetOrderByIdAsync (long orderId) "application/xml", "application/json" }; - - foreach (var _contentType in _contentTypes) - localVarRequestOptions.HeaderParameters.Add("Content-Type", _contentType); - - foreach (var _accept in _accepts) - localVarRequestOptions.HeaderParameters.Add("Accept", _accept); + + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); localVarRequestOptions.PathParameters.Add("order_id", Org.OpenAPITools.Client.ClientUtils.ParameterToString(orderId)); // path parameter @@ -737,12 +740,13 @@ public async System.Threading.Tasks.Task PlaceOrderAsync (Order body) "application/xml", "application/json" }; - - foreach (var _contentType in _contentTypes) - localVarRequestOptions.HeaderParameters.Add("Content-Type", _contentType); - - foreach (var _accept in _accepts) - localVarRequestOptions.HeaderParameters.Add("Accept", _accept); + + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); localVarRequestOptions.Data = body; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/UserApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/UserApi.cs index e20098ed6547..f233973eb0cb 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/UserApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/UserApi.cs @@ -582,12 +582,13 @@ public async System.Threading.Tasks.Task CreateUserAsync (User body) // to determine the Accept header String[] _accepts = new String[] { }; - - foreach (var _contentType in _contentTypes) - localVarRequestOptions.HeaderParameters.Add("Content-Type", _contentType); - - foreach (var _accept in _accepts) - localVarRequestOptions.HeaderParameters.Add("Accept", _accept); + + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); localVarRequestOptions.Data = body; @@ -691,12 +692,13 @@ public async System.Threading.Tasks.Task CreateUsersWithArrayInputAsync (List GetUserByNameAsync (string userna "application/xml", "application/json" }; - - foreach (var _contentType in _contentTypes) - localVarRequestOptions.HeaderParameters.Add("Content-Type", _contentType); - - foreach (var _accept in _accepts) - localVarRequestOptions.HeaderParameters.Add("Accept", _accept); + + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); localVarRequestOptions.PathParameters.Add("username", Org.OpenAPITools.Client.ClientUtils.ParameterToString(username)); // path parameter @@ -1152,12 +1157,13 @@ public async System.Threading.Tasks.Task LoginUserAsync (string username "application/xml", "application/json" }; - - foreach (var _contentType in _contentTypes) - localVarRequestOptions.HeaderParameters.Add("Content-Type", _contentType); - - foreach (var _accept in _accepts) - localVarRequestOptions.HeaderParameters.Add("Accept", _accept); + + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "username", username)); localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "password", password)); @@ -1249,12 +1255,13 @@ public async System.Threading.Tasks.Task LogoutUserAsync () // to determine the Accept header String[] _accepts = new String[] { }; - - foreach (var _contentType in _contentTypes) - localVarRequestOptions.HeaderParameters.Add("Content-Type", _contentType); - - foreach (var _accept in _accepts) - localVarRequestOptions.HeaderParameters.Add("Accept", _accept); + + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); @@ -1370,12 +1377,13 @@ public async System.Threading.Tasks.Task UpdateUserAsync (string username, User // to determine the Accept header String[] _accepts = new String[] { }; - - foreach (var _contentType in _contentTypes) - localVarRequestOptions.HeaderParameters.Add("Content-Type", _contentType); - - foreach (var _accept in _accepts) - localVarRequestOptions.HeaderParameters.Add("Accept", _accept); + + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); localVarRequestOptions.PathParameters.Add("username", Org.OpenAPITools.Client.ClientUtils.ParameterToString(username)); // path parameter localVarRequestOptions.Data = body; From da50523f3b5c68fb6921e1d8c48de97f9c39ae59 Mon Sep 17 00:00:00 2001 From: Artur Pietrzyk Date: Sat, 18 Jul 2020 08:00:30 +0200 Subject: [PATCH 029/129] Update README.md (#6974) --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 0a94dd195a9d..eced71a4d832 100644 --- a/README.md +++ b/README.md @@ -578,6 +578,7 @@ Here are some companies/projects (alphabetical order) using OpenAPI Generator in - [Camptocamp](https://www.camptocamp.com/en) - [Cisco](https://www.cisco.com/) - [codecentric AG](https://www.codecentric.de/) +- [CoinAPI](https://www.coinapi.io/) - [Commencis](https://www.commencis.com/) - [Crossover Health](https://crossoverhealth.com/) - [Cupix](https://www.cupix.com/) From 49f088ec8e613591915c8a023a06af74717f4942 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Sat, 18 Jul 2020 15:47:46 +0800 Subject: [PATCH 030/129] [CircleCI] rebalance tests (#6981) * rearrange tests * move java tests to others --- CI/circle_parallel.sh | 16 +++++------ pom.xml | 64 +++++++++++++++++++++---------------------- 2 files changed, 40 insertions(+), 40 deletions(-) diff --git a/CI/circle_parallel.sh b/CI/circle_parallel.sh index 7f6efdbf94b9..789b342ab5d2 100755 --- a/CI/circle_parallel.sh +++ b/CI/circle_parallel.sh @@ -17,15 +17,8 @@ trap cleanup EXIT if [ "$NODE_INDEX" = "1" ]; then echo "Running node $NODE_INDEX to test 'samples.circleci' defined in pom.xml ..." java -version - # Install golang version 1.14 - go version - sudo mkdir /usr/local/go1.14 - wget -c https://dl.google.com/go/go1.14.linux-amd64.tar.gz -O - | sudo tar -xz -C /usr/local/go1.14 - export PATH="/usr/local/go1.14/go/bin:$PATH" - go version mvn --no-snapshot-updates --quiet verify -Psamples.circleci -Dorg.slf4j.simpleLogger.defaultLogLevel=error - mvn --no-snapshot-updates --quiet javadoc:javadoc -Psamples.circleci -Dorg.slf4j.simpleLogger.defaultLogLevel=error elif [ "$NODE_INDEX" = "2" ]; then # run ensure-up-to-date sample script on SNAPSHOT version only @@ -40,7 +33,6 @@ elif [ "$NODE_INDEX" = "2" ]; then # look for outdated samples ./bin/utils/ensure-up-to-date fi -#elif [ "$NODE_INDEX" = "3" ]; then echo "Running node $NODE_INDEX to test haskell" # install haskell curl -sSL https://get.haskellstack.org/ | sh @@ -64,6 +56,13 @@ else #sudo update-java-alternatives -s java-1.7.0-openjdk-amd64 java -version + # Install golang version 1.14 + go version + sudo mkdir /usr/local/go1.14 + wget -c https://dl.google.com/go/go1.14.linux-amd64.tar.gz -O - | sudo tar -xz -C /usr/local/go1.14 + export PATH="/usr/local/go1.14/go/bin:$PATH" + go version + # install dart2 sudo apt-get update sudo apt-get install apt-transport-https @@ -74,6 +73,7 @@ else export PATH="$PATH:/usr/lib/dart/bin" mvn --no-snapshot-updates --quiet verify -Psamples.circleci.others -Dorg.slf4j.simpleLogger.defaultLogLevel=error + mvn --no-snapshot-updates --quiet javadoc:javadoc -Psamples.circleci -Dorg.slf4j.simpleLogger.defaultLogLevel=error fi diff --git a/pom.xml b/pom.xml index dc7ebf7a3ba1..0ae557cecbe0 100644 --- a/pom.xml +++ b/pom.xml @@ -1237,38 +1237,6 @@ - - - samples/client/petstore/go - samples/client/petstore/go-experimental - samples/openapi3/client/petstore/go-experimental - samples/openapi3/client/petstore/go - - samples/client/petstore/scala-akka - samples/client/petstore/scala-sttp - samples/client/petstore/scala-httpclient - samples/client/petstore/scalaz - samples/client/petstore/clojure - samples/client/petstore/java/feign - samples/client/petstore/java/jersey1 - samples/client/petstore/java/jersey2-java8 - samples/openapi3/client/petstore/java/jersey2-java8 - samples/client/petstore/java/okhttp-gson - samples/client/petstore/java/retrofit2 - samples/client/petstore/java/retrofit2rx2 - samples/client/petstore/java/retrofit2rx3 - samples/client/petstore/java/retrofit2-play26 - samples/client/petstore/jaxrs-cxf-client - samples/client/petstore/java/resttemplate - samples/client/petstore/java/resttemplate-withXml - samples/client/petstore/java/webclient - samples/client/petstore/java/vertx - samples/client/petstore/java/resteasy - samples/client/petstore/java/google-api-client - samples/client/petstore/java/rest-assured - samples/client/petstore/java/rest-assured-jackson - samples/client/petstore/java/microprofile-rest-client - samples/client/petstore/groovy samples/server/petstore/jaxrs-jersey samples/server/petstore/jaxrs-spec @@ -1333,6 +1301,38 @@ + + + samples/client/petstore/scala-akka + samples/client/petstore/scala-sttp + samples/client/petstore/scala-httpclient + samples/client/petstore/scalaz + samples/client/petstore/clojure + samples/client/petstore/java/feign + samples/client/petstore/java/jersey1 + samples/client/petstore/java/jersey2-java8 + samples/openapi3/client/petstore/java/jersey2-java8 + samples/client/petstore/java/okhttp-gson + samples/client/petstore/java/retrofit2 + samples/client/petstore/java/retrofit2rx2 + samples/client/petstore/java/retrofit2rx3 + samples/client/petstore/java/retrofit2-play26 + samples/client/petstore/jaxrs-cxf-client + samples/client/petstore/java/resttemplate + samples/client/petstore/java/resttemplate-withXml + samples/client/petstore/java/webclient + samples/client/petstore/java/vertx + samples/client/petstore/java/resteasy + samples/client/petstore/java/google-api-client + samples/client/petstore/java/rest-assured + samples/client/petstore/java/rest-assured-jackson + samples/client/petstore/java/microprofile-rest-client + samples/client/petstore/groovy + + samples/client/petstore/go + samples/client/petstore/go-experimental + samples/openapi3/client/petstore/go-experimental + samples/openapi3/client/petstore/go samples/client/petstore/javascript-es6 samples/client/petstore/javascript-promise-es6 samples/server/petstore/go-api-server From 0707b4bb20bb264d5b434b508a5f200cc4af18e0 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Sat, 18 Jul 2020 15:48:47 +0800 Subject: [PATCH 031/129] [Scala] setup Ivy cache directory (#6978) * use ivy2 cache * use ~/.ivy2 cache dir * add pom.xml to openapi-generator-ignore * update scala-akka sample * use ~ for home directory --- CI/circle_parallel.sh | 3 +++ .../scala-akka/.openapi-generator-ignore | 1 + .../scala-akka/.openapi-generator/FILES | 1 - samples/client/petstore/scala-akka/pom.xml | 22 +++++++++++++++++++ .../client/petstore/scala-httpclient/pom.xml | 22 +++++++++++++++++++ samples/client/petstore/scala-sttp/pom.xml | 2 ++ samples/client/petstore/scalaz/pom.xml | 2 ++ .../petstore/scala-akka-http-server/pom.xml | 2 ++ samples/server/petstore/scala-finch/pom.xml | 2 ++ .../petstore/scala-lagom-server/pom.xml | 2 ++ .../server/petstore/scala-play-server/pom.xml | 2 ++ samples/server/petstore/scalatra/pom.xml | 2 ++ 12 files changed, 62 insertions(+), 1 deletion(-) diff --git a/CI/circle_parallel.sh b/CI/circle_parallel.sh index 789b342ab5d2..70b541743d8b 100755 --- a/CI/circle_parallel.sh +++ b/CI/circle_parallel.sh @@ -20,6 +20,9 @@ if [ "$NODE_INDEX" = "1" ]; then mvn --no-snapshot-updates --quiet verify -Psamples.circleci -Dorg.slf4j.simpleLogger.defaultLogLevel=error + echo "show ivy2 cache" + ls -l /home/circleci/.ivy2/cache + elif [ "$NODE_INDEX" = "2" ]; then # run ensure-up-to-date sample script on SNAPSHOT version only project_version=`mvn org.apache.maven.plugins:maven-help-plugin:3.1.0:evaluate -Dexpression=project.version -q -DforceStdout` diff --git a/samples/client/petstore/scala-akka/.openapi-generator-ignore b/samples/client/petstore/scala-akka/.openapi-generator-ignore index 7484ee590a38..69a08439a3b8 100644 --- a/samples/client/petstore/scala-akka/.openapi-generator-ignore +++ b/samples/client/petstore/scala-akka/.openapi-generator-ignore @@ -21,3 +21,4 @@ #docs/*.md # Then explicitly reverse the ignore rule for a single file: #!docs/README.md +pom.xml diff --git a/samples/client/petstore/scala-akka/.openapi-generator/FILES b/samples/client/petstore/scala-akka/.openapi-generator/FILES index 13da3010a5a3..301241de2bd3 100644 --- a/samples/client/petstore/scala-akka/.openapi-generator/FILES +++ b/samples/client/petstore/scala-akka/.openapi-generator/FILES @@ -1,6 +1,5 @@ README.md build.sbt -pom.xml src/main/resources/reference.conf src/main/scala/org/openapitools/client/api/EnumsSerializers.scala src/main/scala/org/openapitools/client/api/PetApi.scala diff --git a/samples/client/petstore/scala-akka/pom.xml b/samples/client/petstore/scala-akka/pom.xml index a88eaa5a41ef..6c36a7c93f7c 100644 --- a/samples/client/petstore/scala-akka/pom.xml +++ b/samples/client/petstore/scala-akka/pom.xml @@ -249,6 +249,28 @@ + + org.codehaus.mojo + exec-maven-plugin + 1.5.0 + + + sbt-test + integration-test + + exec + + + sbt + + -ivy + ~/.ivy2 + test + + + + + diff --git a/samples/client/petstore/scala-httpclient/pom.xml b/samples/client/petstore/scala-httpclient/pom.xml index 8ed860ddd65e..aa1351f81066 100644 --- a/samples/client/petstore/scala-httpclient/pom.xml +++ b/samples/client/petstore/scala-httpclient/pom.xml @@ -157,6 +157,28 @@ + + org.codehaus.mojo + exec-maven-plugin + 1.5.0 + + + sbt-test + integration-test + + exec + + + sbt + + -ivy + ~/.ivy2 + test + + + + + diff --git a/samples/client/petstore/scala-sttp/pom.xml b/samples/client/petstore/scala-sttp/pom.xml index 6b6a83b21e2d..66d6351c208b 100644 --- a/samples/client/petstore/scala-sttp/pom.xml +++ b/samples/client/petstore/scala-sttp/pom.xml @@ -21,6 +21,8 @@ sbt + -ivy + ~/.ivy2 test diff --git a/samples/client/petstore/scalaz/pom.xml b/samples/client/petstore/scalaz/pom.xml index 166ba81bda7d..2413cce0e693 100644 --- a/samples/client/petstore/scalaz/pom.xml +++ b/samples/client/petstore/scalaz/pom.xml @@ -21,6 +21,8 @@ sbt + -ivy + ~/.ivy2 test diff --git a/samples/server/petstore/scala-akka-http-server/pom.xml b/samples/server/petstore/scala-akka-http-server/pom.xml index 92061e708b4e..0eebfe90c992 100644 --- a/samples/server/petstore/scala-akka-http-server/pom.xml +++ b/samples/server/petstore/scala-akka-http-server/pom.xml @@ -21,6 +21,8 @@ sbt + -ivy + ~/.ivy2 test diff --git a/samples/server/petstore/scala-finch/pom.xml b/samples/server/petstore/scala-finch/pom.xml index 92384f2a55a3..9424407696b4 100644 --- a/samples/server/petstore/scala-finch/pom.xml +++ b/samples/server/petstore/scala-finch/pom.xml @@ -21,6 +21,8 @@ sbt + -ivy + ~/.ivy2 test diff --git a/samples/server/petstore/scala-lagom-server/pom.xml b/samples/server/petstore/scala-lagom-server/pom.xml index 7b7cbe76b938..7805ecac188d 100644 --- a/samples/server/petstore/scala-lagom-server/pom.xml +++ b/samples/server/petstore/scala-lagom-server/pom.xml @@ -21,6 +21,8 @@ sbt + -ivy + ~/.ivy2 test diff --git a/samples/server/petstore/scala-play-server/pom.xml b/samples/server/petstore/scala-play-server/pom.xml index 9147d619bd9f..dc679b82faf0 100644 --- a/samples/server/petstore/scala-play-server/pom.xml +++ b/samples/server/petstore/scala-play-server/pom.xml @@ -21,6 +21,8 @@ sbt + -ivy + ~/.ivy2 test diff --git a/samples/server/petstore/scalatra/pom.xml b/samples/server/petstore/scalatra/pom.xml index d3b3420e90ad..78aa6a5c3cc0 100644 --- a/samples/server/petstore/scalatra/pom.xml +++ b/samples/server/petstore/scalatra/pom.xml @@ -21,6 +21,8 @@ sbt + -ivy + ~/.ivy2 test From dd6e8ccc3db6cb98ff221994c02113173879438d Mon Sep 17 00:00:00 2001 From: William Cheng Date: Sat, 18 Jul 2020 17:07:03 +0800 Subject: [PATCH 032/129] replace ~ with $user.home (#6985) --- samples/client/petstore/scala-akka/pom.xml | 2 +- samples/client/petstore/scala-httpclient/pom.xml | 2 +- samples/client/petstore/scala-sttp/pom.xml | 2 +- samples/client/petstore/scalaz/pom.xml | 2 +- samples/server/petstore/scala-akka-http-server/pom.xml | 2 +- samples/server/petstore/scala-finch/pom.xml | 2 +- samples/server/petstore/scala-lagom-server/pom.xml | 2 +- samples/server/petstore/scala-play-server/pom.xml | 2 +- samples/server/petstore/scalatra/pom.xml | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/samples/client/petstore/scala-akka/pom.xml b/samples/client/petstore/scala-akka/pom.xml index 6c36a7c93f7c..42e08693b641 100644 --- a/samples/client/petstore/scala-akka/pom.xml +++ b/samples/client/petstore/scala-akka/pom.xml @@ -264,7 +264,7 @@ sbt -ivy - ~/.ivy2 + ${user.home}/.ivy2 test diff --git a/samples/client/petstore/scala-httpclient/pom.xml b/samples/client/petstore/scala-httpclient/pom.xml index aa1351f81066..be684146382a 100644 --- a/samples/client/petstore/scala-httpclient/pom.xml +++ b/samples/client/petstore/scala-httpclient/pom.xml @@ -172,7 +172,7 @@ sbt -ivy - ~/.ivy2 + ${user.home}/.ivy2 test diff --git a/samples/client/petstore/scala-sttp/pom.xml b/samples/client/petstore/scala-sttp/pom.xml index 66d6351c208b..c56a5ac9427b 100644 --- a/samples/client/petstore/scala-sttp/pom.xml +++ b/samples/client/petstore/scala-sttp/pom.xml @@ -22,7 +22,7 @@ sbt -ivy - ~/.ivy2 + ${user.home}/.ivy2 test diff --git a/samples/client/petstore/scalaz/pom.xml b/samples/client/petstore/scalaz/pom.xml index 2413cce0e693..459ff4aee45c 100644 --- a/samples/client/petstore/scalaz/pom.xml +++ b/samples/client/petstore/scalaz/pom.xml @@ -22,7 +22,7 @@ sbt -ivy - ~/.ivy2 + ${user.home}/.ivy2 test diff --git a/samples/server/petstore/scala-akka-http-server/pom.xml b/samples/server/petstore/scala-akka-http-server/pom.xml index 0eebfe90c992..671d0d389e0a 100644 --- a/samples/server/petstore/scala-akka-http-server/pom.xml +++ b/samples/server/petstore/scala-akka-http-server/pom.xml @@ -22,7 +22,7 @@ sbt -ivy - ~/.ivy2 + ${user.home}/.ivy2 test diff --git a/samples/server/petstore/scala-finch/pom.xml b/samples/server/petstore/scala-finch/pom.xml index 9424407696b4..5e1cad23c528 100644 --- a/samples/server/petstore/scala-finch/pom.xml +++ b/samples/server/petstore/scala-finch/pom.xml @@ -22,7 +22,7 @@ sbt -ivy - ~/.ivy2 + ${user.home}/.ivy2 test diff --git a/samples/server/petstore/scala-lagom-server/pom.xml b/samples/server/petstore/scala-lagom-server/pom.xml index 7805ecac188d..aede90503672 100644 --- a/samples/server/petstore/scala-lagom-server/pom.xml +++ b/samples/server/petstore/scala-lagom-server/pom.xml @@ -22,7 +22,7 @@ sbt -ivy - ~/.ivy2 + ${user.home}/.ivy2 test diff --git a/samples/server/petstore/scala-play-server/pom.xml b/samples/server/petstore/scala-play-server/pom.xml index dc679b82faf0..5670d64fdb16 100644 --- a/samples/server/petstore/scala-play-server/pom.xml +++ b/samples/server/petstore/scala-play-server/pom.xml @@ -22,7 +22,7 @@ sbt -ivy - ~/.ivy2 + ${user.home}/.ivy2 test diff --git a/samples/server/petstore/scalatra/pom.xml b/samples/server/petstore/scalatra/pom.xml index 78aa6a5c3cc0..7782efe031d6 100644 --- a/samples/server/petstore/scalatra/pom.xml +++ b/samples/server/petstore/scalatra/pom.xml @@ -22,7 +22,7 @@ sbt -ivy - ~/.ivy2 + ${user.home}/.ivy2 test From 8a774f636b18bedd929eda7197f08e769bb02e50 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Sat, 18 Jul 2020 18:04:03 +0800 Subject: [PATCH 033/129] add coinapi logo (#6984) --- website/src/dynamic/users.yml | 5 +++++ website/static/img/companies/coinapi.png | Bin 0 -> 1576 bytes 2 files changed, 5 insertions(+) create mode 100644 website/static/img/companies/coinapi.png diff --git a/website/src/dynamic/users.yml b/website/src/dynamic/users.yml index 96283d568631..c9750fe2a6c1 100644 --- a/website/src/dynamic/users.yml +++ b/website/src/dynamic/users.yml @@ -88,6 +88,11 @@ image: "img/companies/codecentric.png" infoLink: "https://www.codecentric.de/" pinned: false +- + caption: "CoinAPI" + image: "img/companies/coinapi.png" + infoLink: "https://www.coinapi.io/" + pinned: false - caption: Commencis image: "img/companies/commencis.png" diff --git a/website/static/img/companies/coinapi.png b/website/static/img/companies/coinapi.png new file mode 100644 index 0000000000000000000000000000000000000000..b7cc1f82f395e0dc75f2980b5838f32b613902ff GIT binary patch literal 1576 zcmah}`#aMM9Nxa0Tn@`EN-jCM-xVXm#>8xljmTYDQYk_=n(<_{%B8tY9CDi&4!MNF zc9>N{xwYgHsa%SUR!ibI|3K$`-sgGW=Xu}H^L&1Ksh%D#GEyp1AP`6f?TW&KK;Uf) z20?h_!s&hF3?AjtMNh_8v(}_V9Ue6`lEi+vtHR_*Ex#RsBx3t9vVIZ+$`gD?52vO z(Ad+WH&=`pUbhuq@6*^=+Z6O9z1F>Dxcdj?=EvE84rt`jbn@+Mr-KZX7`Hjo za}P=!&ANNC=0r{=lf_hhx)w5!NASnewQzG)kIEJcEH_IW?bw+|k8hy!)U6jDq?q`6 zI2F7S_>8;JwJ|z0d4z3|tl2IVTK4I|n`1l-3fcbr^VU+W18=rQ)eVt)>ZQcxC=#h? zlC|e;vH}&@Wc2Fq8Nx@W&Kqvti;Z0I#JqHAIs@g?UspGsu+40OE`&S~l#n!zdRF9O zOKkidQ;*ZB}1ElCbCorvmRo8&c$jEp`O{36k`GIA{b+~#(_G*78ur=HorcV z4Gfu#rt7fIXJ5F=Jp%pw9-$F+_3rF2o%Un+PI|}KW0F5?V1h3yrX6euHY$KlpRC@i zjbX*ML6ad?-o)bhpbo>z<88q$@29iy#k z4}2-$$qT+gJT4;4m0fNk>2axPY%V-#0uHoCItAJ=`!ZccxNg8^1YUScqE&Bc4v%GL zQU{N&q#B3js)XRS^u9CXqiIUK9JL_$;snJ```wI4B&sDgWI4jhQ^|KQ{j)CimUfK_ zOYPeE#tzlXoZX0xq$>NcWLehY`k{-Qyt>K>HS=ns5Lh2WN52CEL%D05q$?}lG8vpo zUks!EEiiytiyh$u;P@!JO95xqec>qM(8laJgwK)AeU*waZGhmkB1&!kU~?^3;?%RV zU-F2j%q*~ybVFN7Sa^>+KSwsf;vT>{=gDs(=O7Td_tt>? z{GT>2t8faAXe|5Qwv85GJ!t^HGUzH4tUe@gW8Z zKjav8tTRLE>5X)p+7kz^+S5$ET1U{*{j||w-$G*IBsrEzyoMTjQ~c_Uei3fARVP`bg!nc-~7KW+SvnD=NOvuFId~daR2}S literal 0 HcmV?d00001 From 968f32b55e2c9d71a0f7cd25b40f7054e2ade90f Mon Sep 17 00:00:00 2001 From: Sebastien Rosset Date: Sat, 18 Jul 2020 06:56:41 -0700 Subject: [PATCH 034/129] [Java][Jersey2] Add JsonTypeName annotation (#6551) * Mustache template should use invokerPackage tag to generate import * add JsonSubTypes annotation to handle scenario when OAS name has special characters * add JsonSubTypes annotation to handle scenario when OAS name has special characters. Add unit test * run sample scripts * fix unit test * run sample scripts * add minimal openapi document to show issue with special characters and discriminators * Add 'isClassnameSanitized' tag * Add 'isClassnameSanitized' tag * Add 'isClassnameSanitized' tag * Add 'isClassnameSanitized' tag * Add 'isClassnameSanitized' tag * Add 'isClassnameSanitized' tag * Add unit tests for unmarshaling of discriminators with special characters * Add unit tests for unmarshaling of discriminators with special characters * use JsonTypeName Co-authored-by: Vikrant Balyan (vvb) Co-authored-by: William Cheng --- .../java-jersey2-special-characters.yaml | 15 + .../openapitools/codegen/CodegenModel.java | 13 + .../languages/AbstractJavaCodegen.java | 1 + .../codegen/languages/JavaClientCodegen.java | 1 + .../Java/typeInfoAnnotation.mustache | 14 +- .../3_0/schema-with-special-characters.yaml | 71 ++ .../model/AdditionalPropertiesAnyType.java | 1 + .../model/AdditionalPropertiesArray.java | 1 + .../model/AdditionalPropertiesBoolean.java | 1 + .../model/AdditionalPropertiesClass.java | 1 + .../model/AdditionalPropertiesInteger.java | 1 + .../model/AdditionalPropertiesNumber.java | 1 + .../model/AdditionalPropertiesObject.java | 1 + .../model/AdditionalPropertiesString.java | 1 + .../org/openapitools/client/model/Animal.java | 1 + .../model/ArrayOfArrayOfNumberOnly.java | 1 + .../client/model/ArrayOfNumberOnly.java | 1 + .../openapitools/client/model/ArrayTest.java | 1 + .../org/openapitools/client/model/BigCat.java | 3 +- .../client/model/BigCatAllOf.java | 1 + .../client/model/Capitalization.java | 1 + .../org/openapitools/client/model/Cat.java | 1 + .../openapitools/client/model/CatAllOf.java | 1 + .../openapitools/client/model/Category.java | 1 + .../openapitools/client/model/ClassModel.java | 1 + .../org/openapitools/client/model/Client.java | 1 + .../org/openapitools/client/model/Dog.java | 3 +- .../openapitools/client/model/DogAllOf.java | 1 + .../openapitools/client/model/EnumArrays.java | 1 + .../openapitools/client/model/EnumTest.java | 1 + .../client/model/FileSchemaTestClass.java | 1 + .../openapitools/client/model/FormatTest.java | 1 + .../client/model/HasOnlyReadOnly.java | 1 + .../openapitools/client/model/MapTest.java | 1 + ...ropertiesAndAdditionalPropertiesClass.java | 1 + .../client/model/Model200Response.java | 1 + .../client/model/ModelApiResponse.java | 1 + .../client/model/ModelReturn.java | 1 + .../org/openapitools/client/model/Name.java | 1 + .../openapitools/client/model/NumberOnly.java | 1 + .../org/openapitools/client/model/Order.java | 1 + .../client/model/OuterComposite.java | 1 + .../org/openapitools/client/model/Pet.java | 1 + .../client/model/ReadOnlyFirst.java | 1 + .../client/model/SpecialModelName.java | 1 + .../org/openapitools/client/model/Tag.java | 1 + .../client/model/TypeHolderDefault.java | 1 + .../client/model/TypeHolderExample.java | 1 + .../org/openapitools/client/model/User.java | 1 + .../openapitools/client/model/XmlItem.java | 1 + .../org/openapitools/client/JSONTest.java | 16 + .../.gitignore | 21 + .../.openapi-generator-ignore | 23 + .../.openapi-generator/FILES | 42 + .../.openapi-generator/VERSION | 1 + .../.travis.yml | 22 + .../README.md | 133 ++ .../api/openapi.yaml | 53 + .../build.gradle | 122 ++ .../build.sbt | 24 + .../docs/ChildSchema.md | 13 + .../docs/ChildSchemaAllOf.md | 12 + .../docs/DefaultApi.md | 72 ++ .../docs/MySchemaNameCharacters.md | 13 + .../docs/MySchemaNameCharactersAllOf.md | 12 + .../docs/Parent.md | 12 + .../git_push.sh | 58 + .../gradle.properties | 2 + .../gradle/wrapper/gradle-wrapper.jar | Bin 0 -> 99814 bytes .../gradle/wrapper/gradle-wrapper.properties | 5 + .../jersey2-java8-special-characters/gradlew | 183 +++ .../gradlew.bat | 100 ++ .../jersey2-java8-special-characters/pom.xml | 302 +++++ .../settings.gradle | 1 + .../src/main/AndroidManifest.xml | 3 + .../org/openapitools/client/ApiClient.java | 1086 +++++++++++++++++ .../org/openapitools/client/ApiException.java | 94 ++ .../org/openapitools/client/ApiResponse.java | 74 ++ .../openapitools/client/Configuration.java | 39 + .../java/org/openapitools/client/JSON.java | 247 ++++ .../java/org/openapitools/client/Pair.java | 61 + .../client/RFC3339DateFormat.java | 32 + .../client/ServerConfiguration.java | 58 + .../openapitools/client/ServerVariable.java | 23 + .../org/openapitools/client/StringUtil.java | 83 ++ .../openapitools/client/api/DefaultApi.java | 110 ++ .../openapitools/client/auth/ApiKeyAuth.java | 79 ++ .../client/auth/Authentication.java | 33 + .../client/auth/HttpBasicAuth.java | 56 + .../client/auth/HttpBearerAuth.java | 62 + .../client/model/AbstractOpenApiSchema.java | 149 +++ .../client/model/ChildSchema.java | 167 +++ .../client/model/ChildSchemaAllOf.java | 109 ++ .../client/model/MySchemaNameCharacters.java | 168 +++ .../model/MySchemaNameCharactersAllOf.java | 109 ++ .../org/openapitools/client/model/Parent.java | 127 ++ .../client/api/DefaultApiTest.java | 51 + .../client/model/ChildSchemaAllOfTest.java | 49 + .../client/model/ChildSchemaTest.java | 70 ++ .../MySchemaNameCharactersAllOfTest.java | 49 + .../model/MySchemaNameCharactersTest.java | 70 ++ .../openapitools/client/model/ParentTest.java | 51 + .../model/AdditionalPropertiesClass.java | 1 + .../org/openapitools/client/model/Animal.java | 1 + .../org/openapitools/client/model/Apple.java | 1 + .../openapitools/client/model/AppleReq.java | 1 + .../model/ArrayOfArrayOfNumberOnly.java | 1 + .../client/model/ArrayOfNumberOnly.java | 1 + .../openapitools/client/model/ArrayTest.java | 1 + .../org/openapitools/client/model/Banana.java | 1 + .../openapitools/client/model/BananaReq.java | 1 + .../openapitools/client/model/BasquePig.java | 1 + .../client/model/Capitalization.java | 1 + .../org/openapitools/client/model/Cat.java | 3 +- .../openapitools/client/model/CatAllOf.java | 1 + .../openapitools/client/model/Category.java | 1 + .../openapitools/client/model/ChildCat.java | 3 +- .../client/model/ChildCatAllOf.java | 1 + .../openapitools/client/model/ClassModel.java | 1 + .../org/openapitools/client/model/Client.java | 1 + .../client/model/ComplexQuadrilateral.java | 1 + .../openapitools/client/model/DanishPig.java | 1 + .../org/openapitools/client/model/Dog.java | 3 +- .../openapitools/client/model/DogAllOf.java | 1 + .../openapitools/client/model/Drawing.java | 1 + .../openapitools/client/model/EnumArrays.java | 1 + .../openapitools/client/model/EnumTest.java | 1 + .../client/model/EquilateralTriangle.java | 1 + .../client/model/FileSchemaTestClass.java | 1 + .../org/openapitools/client/model/Foo.java | 1 + .../openapitools/client/model/FormatTest.java | 1 + .../org/openapitools/client/model/Fruit.java | 1 + .../openapitools/client/model/FruitReq.java | 1 + .../openapitools/client/model/GmFruit.java | 1 + .../client/model/GrandparentAnimal.java | 1 + .../client/model/HasOnlyReadOnly.java | 1 + .../client/model/HealthCheckResult.java | 1 + .../client/model/InlineObject.java | 1 + .../client/model/InlineObject1.java | 1 + .../client/model/InlineObject2.java | 1 + .../client/model/InlineObject3.java | 1 + .../client/model/InlineObject4.java | 1 + .../client/model/InlineObject5.java | 1 + .../client/model/InlineResponseDefault.java | 1 + .../client/model/IsoscelesTriangle.java | 1 + .../org/openapitools/client/model/Mammal.java | 1 + .../openapitools/client/model/MapTest.java | 1 + ...ropertiesAndAdditionalPropertiesClass.java | 1 + .../client/model/Model200Response.java | 1 + .../client/model/ModelApiResponse.java | 1 + .../client/model/ModelReturn.java | 1 + .../org/openapitools/client/model/Name.java | 1 + .../client/model/NullableClass.java | 1 + .../client/model/NullableShape.java | 1 + .../openapitools/client/model/NumberOnly.java | 1 + .../org/openapitools/client/model/Order.java | 1 + .../client/model/OuterComposite.java | 1 + .../openapitools/client/model/ParentPet.java | 1 + .../org/openapitools/client/model/Pet.java | 1 + .../org/openapitools/client/model/Pig.java | 1 + .../client/model/Quadrilateral.java | 1 + .../client/model/QuadrilateralInterface.java | 1 + .../client/model/ReadOnlyFirst.java | 1 + .../client/model/ScaleneTriangle.java | 1 + .../org/openapitools/client/model/Shape.java | 1 + .../client/model/ShapeInterface.java | 1 + .../client/model/ShapeOrNull.java | 1 + .../client/model/SimpleQuadrilateral.java | 1 + .../client/model/SpecialModelName.java | 1 + .../org/openapitools/client/model/Tag.java | 1 + .../openapitools/client/model/Triangle.java | 1 + .../client/model/TriangleInterface.java | 1 + .../org/openapitools/client/model/User.java | 1 + .../org/openapitools/client/model/Whale.java | 1 + .../org/openapitools/client/model/Zebra.java | 1 + .../org/openapitools/client/JSONTest.java | 16 + 176 files changed, 4796 insertions(+), 13 deletions(-) create mode 100644 bin/configs/java-jersey2-special-characters.yaml create mode 100644 modules/openapi-generator/src/test/resources/3_0/schema-with-special-characters.yaml create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8-special-characters/.gitignore create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8-special-characters/.openapi-generator-ignore create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8-special-characters/.openapi-generator/FILES create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8-special-characters/.openapi-generator/VERSION create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8-special-characters/.travis.yml create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8-special-characters/README.md create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8-special-characters/api/openapi.yaml create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8-special-characters/build.gradle create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8-special-characters/build.sbt create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8-special-characters/docs/ChildSchema.md create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8-special-characters/docs/ChildSchemaAllOf.md create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8-special-characters/docs/DefaultApi.md create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8-special-characters/docs/MySchemaNameCharacters.md create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8-special-characters/docs/MySchemaNameCharactersAllOf.md create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8-special-characters/docs/Parent.md create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8-special-characters/git_push.sh create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8-special-characters/gradle.properties create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8-special-characters/gradle/wrapper/gradle-wrapper.jar create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8-special-characters/gradle/wrapper/gradle-wrapper.properties create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8-special-characters/gradlew create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8-special-characters/gradlew.bat create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8-special-characters/pom.xml create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8-special-characters/settings.gradle create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/AndroidManifest.xml create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/ApiClient.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/ApiException.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/ApiResponse.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/Configuration.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/JSON.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/Pair.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/RFC3339DateFormat.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/ServerConfiguration.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/ServerVariable.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/StringUtil.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/api/DefaultApi.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/auth/Authentication.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/model/ChildSchema.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/model/ChildSchemaAllOf.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/model/MySchemaNameCharacters.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/model/MySchemaNameCharactersAllOf.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/model/Parent.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/test/java/org/openapitools/client/api/DefaultApiTest.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/test/java/org/openapitools/client/model/ChildSchemaAllOfTest.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/test/java/org/openapitools/client/model/ChildSchemaTest.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/test/java/org/openapitools/client/model/MySchemaNameCharactersAllOfTest.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/test/java/org/openapitools/client/model/MySchemaNameCharactersTest.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/test/java/org/openapitools/client/model/ParentTest.java diff --git a/bin/configs/java-jersey2-special-characters.yaml b/bin/configs/java-jersey2-special-characters.yaml new file mode 100644 index 000000000000..c73b70cc36ca --- /dev/null +++ b/bin/configs/java-jersey2-special-characters.yaml @@ -0,0 +1,15 @@ +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 +additionalProperties: + artifactId: petstore-openapi3-jersey2-java8-special-characters + hideGenerationTimestamp: true + serverPort: "8082" + dateLibrary: java8 + useOneOfDiscriminatorLookup: true + disallowAdditionalPropertiesIfNotPresent: false +systemProperties: + skipValidateSpec: "false" + diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenModel.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenModel.java index 1617a10e13d2..2d34b0c581d7 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenModel.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenModel.java @@ -49,9 +49,11 @@ public class CodegenModel implements IJsonSchemaValidationProperties { 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; @@ -220,6 +222,17 @@ 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 !classname.equals(name); + } + public String getClassname() { return classname; } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java index 9430b4e7f4b8..49823e19f8fd 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java @@ -469,6 +469,7 @@ public void processOpts() { 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"); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java index 47d80cf10bb5..fa8185672845 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java @@ -680,6 +680,7 @@ public void postProcessModelProperty(CodegenModel model, CodegenProperty propert model.imports.add("JsonProperty"); model.imports.add("JsonValue"); model.imports.add("JsonInclude"); + model.imports.add("JsonTypeName"); } if (additionalProperties.containsKey(SERIALIZATION_LIBRARY_GSON)) { model.imports.add("SerializedName"); diff --git a/modules/openapi-generator/src/main/resources/Java/typeInfoAnnotation.mustache b/modules/openapi-generator/src/main/resources/Java/typeInfoAnnotation.mustache index 81c2ba05f903..63eb42ea5001 100644 --- a/modules/openapi-generator/src/main/resources/Java/typeInfoAnnotation.mustache +++ b/modules/openapi-generator/src/main/resources/Java/typeInfoAnnotation.mustache @@ -1,8 +1,16 @@ {{#jackson}} @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "{{{discriminator.propertyBaseName}}}", visible = true) +{{#discriminator.mappedModels}} +{{#-first}} @JsonSubTypes({ - {{#discriminator.mappedModels}} +{{/-first}} @JsonSubTypes.Type(value = {{modelName}}.class, name = "{{^vendorExtensions.x-discriminator-value}}{{mappingName}}{{/vendorExtensions.x-discriminator-value}}{{#vendorExtensions.x-discriminator-value}}{{{vendorExtensions.x-discriminator-value}}}{{/vendorExtensions.x-discriminator-value}}"), - {{/discriminator.mappedModels}} -}){{/jackson}} +{{#-last}} +}) +{{/-last}} +{{/discriminator.mappedModels}} +{{#isClassnameSanitized}} +@JsonTypeName("{{name}}") +{{/isClassnameSanitized}} +{{/jackson}} diff --git a/modules/openapi-generator/src/test/resources/3_0/schema-with-special-characters.yaml b/modules/openapi-generator/src/test/resources/3_0/schema-with-special-characters.yaml new file mode 100644 index 000000000000..19edd9a510de --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/schema-with-special-characters.yaml @@ -0,0 +1,71 @@ +openapi: 3.0.3 +info: + description: test + version: 1.0.0 + title: test +paths: + /test: + post: + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/MySchemaName._-Characters' + responses: + '200': + description: the response + content: + application/json: + schema: + $ref: '#/components/schemas/MySchemaName._-Characters' +components: + schemas: + Parent: + properties: + objectType: + type: string + discriminator: + propertyName: objectType + ChildSchema: + description: A schema that does not have any special character. + allOf: + - $ref: '#/components/schemas/Parent' + - type: object + properties: + prop1: + type: string + # Note: the name below with non-ASCII characters is a valid JSON schema name, + # however currently OpenAPI generator does not allow special characters beyond [.-_] + # + # The set of allowed characters for OpenAPI schema names is specified in RFC 8259 + # at https://tools.ietf.org/html/rfc8259. + # The OpenAPI schema uses the JSON schema specification, which references RFC 8259. + # A string is a sequence of zero or more Unicode characters [UNICODE]. + # Note that this citation references the latest version of Unicode + # rather than a specific release. Any character may be escaped. + # MySchemaNameWithUnusual#$12.3!@#%🍇🍅😀🏄🏾‍♂️Characters: + MySchemaName._-Characters: + description: + A schema name that has letters, numbers, punctuation and non-ASCII characters. + The sanitization rules should make it possible to generate a language-specific + classname with allowed characters in that programming language. + allOf: + - $ref: '#/components/schemas/Parent' + - type: object + properties: + prop2: + type: string + # Below is a schema with the same name, except special characters have been removed. + # This causes a codegen issue because the generated code will have exactly the same class name + # as the above 'MySchemaName._-Characters'. + # Hence the schema is commented out for now. + # + #MySchemaNameCharacters: + # description: + # A schema with same name as above, without the special characters. + # allOf: + # - $ref: '#/components/schemas/Parent' + # - type: object + # properties: + # prop2: + # type: string diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index da926c598b00..6f666f892fc8 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -24,6 +24,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index a154f367ec50..f0af84741d7e 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -24,6 +24,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index c2669176254a..cc3b5e8ed99e 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -24,6 +24,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index a057a169cfd8..028ba7f486de 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index caf7134fcf84..06faf0d59df4 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -24,6 +24,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index a213d51e4139..a5c1d503a3a4 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -24,6 +24,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index 83a6c2cd55f8..498a38d7423e 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -24,6 +24,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index 5a52da796a5d..e3b1b38dcc6e 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -24,6 +24,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Animal.java index a53105de3265..e48f24f96ee9 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Animal.java @@ -22,6 +22,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index ae6c3866e081..df98f6d9a00e 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 5197dda9bc4f..f84a1042728c 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayTest.java index 0d125019fe68..a6160fc1d7d9 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/BigCat.java index ebe7aa71ecb1..421d3e43dde1 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/BigCat.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/BigCat.java @@ -22,6 +22,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @@ -39,8 +40,6 @@ }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) -@JsonSubTypes({ -}) public class BigCat extends Cat { /** diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/BigCatAllOf.java index 704cc5dd5884..b9a0fceee820 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/BigCatAllOf.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Capitalization.java index c87ca1ea948b..3c578c6c08f7 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Capitalization.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Cat.java index 23331093f203..702684c7f0fd 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Cat.java @@ -22,6 +22,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/CatAllOf.java index f3060f5d0e36..05cf8311696c 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Category.java index de082b6e900f..6dc51b7de425 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Category.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ClassModel.java index ebaa83367832..b826f450f358 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ClassModel.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Client.java index 1bc59615daea..5b04df578940 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Client.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Dog.java index 8815d87acaac..2622e9d17e3d 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Dog.java @@ -22,6 +22,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @@ -39,8 +40,6 @@ }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) -@JsonSubTypes({ -}) public class Dog extends Animal { public static final String JSON_PROPERTY_BREED = "breed"; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/DogAllOf.java index c8e362e0e9d7..80f35628c1dd 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumArrays.java index 7916b8a9cd7e..a3b60565d4a7 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumTest.java index 9449a2c904fc..ac4bc88f9087 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumTest.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index 4680680d6d78..a27fe8ae92fa 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FormatTest.java index 30eb6a65fdef..652992853573 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FormatTest.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index b802d5acf615..66a488b96cd9 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MapTest.java index d2f49b5bb632..37b6718ed9df 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MapTest.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 3d3037cfb68d..06a59d6d57d6 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Model200Response.java index 7775d5835ca3..555aafad6102 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Model200Response.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelApiResponse.java index da4182452b58..cb1b831fb064 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelReturn.java index ba4143056b7e..48c6d79d1610 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Name.java index 0dd87332e679..57e7c94cfbac 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Name.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NumberOnly.java index 751777ec56f4..fe4cc261f6de 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Order.java index 5c780beef5d0..0d35a85b6055 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Order.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterComposite.java index 93630fda594e..a41bcf1bd49d 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Pet.java index 8df16028a8ee..78d30890ed34 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Pet.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index ba58c8cb29fe..1f2bbfaaa69b 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/SpecialModelName.java index a69740babcd3..53be31cf69bb 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Tag.java index 78b29486f2e7..0c61cd71e549 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Tag.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index 7376f1752493..d6da81b399e2 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/TypeHolderExample.java index 2c90730bca23..60868e16177a 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/User.java index 0e4ed3e56624..856a992460a9 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/User.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/XmlItem.java index ce110f1144ce..796901ae52cd 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/XmlItem.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/JSONTest.java b/samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/JSONTest.java index dda1ef9c1efd..2ce38ae2f69a 100644 --- a/samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/JSONTest.java +++ b/samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/JSONTest.java @@ -1,6 +1,7 @@ package org.openapitools.client; import org.openapitools.client.model.Order; +import org.openapitools.client.model.SpecialModelName; import java.lang.Exception; import java.util.Date; @@ -71,4 +72,19 @@ public void testCustomDate() throws Exception { Order o = json.getContext(null).readValue(str, Order.class); assertEquals(dateStr, dateFormat.format(o.getShipDate())); } + + /** + * Validate a schema with special characters can be deserialized. + */ + @Test + public void testSchemaWithSpecialCharacters() throws Exception { + String str = "{ \"$special[property.name]\": 12345 }"; + // The name of the OpenAPI schema is '_special_model.name_'. + // After sanitization rules are applied the name of the class is 'SpecialModelName'. + // The class deserialization should be successful because + // of the @JsonSubTypes annotation. + SpecialModelName o = json.getContext(null).readValue(str, SpecialModelName.class); + assertNotNull(o); + assertEquals((long)12345, (long)o.get$SpecialPropertyName()); + } } \ No newline at end of file diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/.gitignore b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/.gitignore new file mode 100644 index 000000000000..a530464afa1b --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/.gitignore @@ -0,0 +1,21 @@ +*.class + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.ear + +# exclude jar for gradle wrapper +!gradle/wrapper/*.jar + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* + +# build files +**/target +target +.gradle +build diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/.openapi-generator-ignore b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/.openapi-generator-ignore new file mode 100644 index 000000000000..7484ee590a38 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/.openapi-generator/FILES b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/.openapi-generator/FILES new file mode 100644 index 000000000000..e1fd40df0ca6 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/.openapi-generator/FILES @@ -0,0 +1,42 @@ +.gitignore +.travis.yml +README.md +api/openapi.yaml +build.gradle +build.sbt +docs/ChildSchema.md +docs/ChildSchemaAllOf.md +docs/DefaultApi.md +docs/MySchemaNameCharacters.md +docs/MySchemaNameCharactersAllOf.md +docs/Parent.md +git_push.sh +gradle.properties +gradle/wrapper/gradle-wrapper.jar +gradle/wrapper/gradle-wrapper.properties +gradlew +gradlew.bat +pom.xml +settings.gradle +src/main/AndroidManifest.xml +src/main/java/org/openapitools/client/ApiClient.java +src/main/java/org/openapitools/client/ApiException.java +src/main/java/org/openapitools/client/ApiResponse.java +src/main/java/org/openapitools/client/Configuration.java +src/main/java/org/openapitools/client/JSON.java +src/main/java/org/openapitools/client/Pair.java +src/main/java/org/openapitools/client/RFC3339DateFormat.java +src/main/java/org/openapitools/client/ServerConfiguration.java +src/main/java/org/openapitools/client/ServerVariable.java +src/main/java/org/openapitools/client/StringUtil.java +src/main/java/org/openapitools/client/api/DefaultApi.java +src/main/java/org/openapitools/client/auth/ApiKeyAuth.java +src/main/java/org/openapitools/client/auth/Authentication.java +src/main/java/org/openapitools/client/auth/HttpBasicAuth.java +src/main/java/org/openapitools/client/auth/HttpBearerAuth.java +src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java +src/main/java/org/openapitools/client/model/ChildSchema.java +src/main/java/org/openapitools/client/model/ChildSchemaAllOf.java +src/main/java/org/openapitools/client/model/MySchemaNameCharacters.java +src/main/java/org/openapitools/client/model/MySchemaNameCharactersAllOf.java +src/main/java/org/openapitools/client/model/Parent.java diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/.openapi-generator/VERSION b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/.openapi-generator/VERSION new file mode 100644 index 000000000000..d99e7162d01f --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/.openapi-generator/VERSION @@ -0,0 +1 @@ +5.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/.travis.yml b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/.travis.yml new file mode 100644 index 000000000000..e3bdf2af1bea --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/.travis.yml @@ -0,0 +1,22 @@ +# +# Generated by OpenAPI Generator: https://openapi-generator.tech +# +# Ref: https://docs.travis-ci.com/user/languages/java/ +# +language: java +jdk: + - openjdk12 + - openjdk11 + - openjdk10 + - openjdk9 + - openjdk8 +before_install: + # ensure gradlew has proper permission + - chmod a+x ./gradlew +script: + # test using maven + #- mvn test + # test using gradle + - gradle test + # test using sbt + # - sbt test diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/README.md b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/README.md new file mode 100644 index 000000000000..d0c389012541 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/README.md @@ -0,0 +1,133 @@ +# petstore-openapi3-jersey2-java8-special-characters + +test + +- API version: 1.0.0 + +test + + +*Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech)* + +## Requirements + +Building the API client library requires: + +1. Java 1.8+ +2. Maven/Gradle + +## Installation + +To install the API client library to your local Maven repository, simply execute: + +```shell +mvn clean install +``` + +To deploy it to a remote Maven repository instead, configure the settings of the repository and execute: + +```shell +mvn clean deploy +``` + +Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information. + +### Maven users + +Add this dependency to your project's POM: + +```xml + + org.openapitools + petstore-openapi3-jersey2-java8-special-characters + 1.0.0 + compile + +``` + +### Gradle users + +Add this dependency to your project's build file: + +```groovy +compile "org.openapitools:petstore-openapi3-jersey2-java8-special-characters:1.0.0" +``` + +### Others + +At first generate the JAR by executing: + +```shell +mvn clean package +``` + +Then manually install the following JARs: + +- `target/petstore-openapi3-jersey2-java8-special-characters-1.0.0.jar` +- `target/lib/*.jar` + +## Getting Started + +Please follow the [installation](#installation) instruction and execute the following Java code: + +```java + +import org.openapitools.client.*; +import org.openapitools.client.auth.*; +import org.openapitools.client.model.*; +import org.openapitools.client.api.DefaultApi; + +public class DefaultApiExample { + + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + DefaultApi apiInstance = new DefaultApi(defaultClient); + MySchemaNameCharacters mySchemaNameCharacters = new MySchemaNameCharacters(); // MySchemaNameCharacters | + try { + MySchemaNameCharacters result = apiInstance.testPost(mySchemaNameCharacters); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#testPost"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} + +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DefaultApi* | [**testPost**](docs/DefaultApi.md#testPost) | **POST** /test | + + +## Documentation for Models + + - [ChildSchema](docs/ChildSchema.md) + - [ChildSchemaAllOf](docs/ChildSchemaAllOf.md) + - [MySchemaNameCharacters](docs/MySchemaNameCharacters.md) + - [MySchemaNameCharactersAllOf](docs/MySchemaNameCharactersAllOf.md) + - [Parent](docs/Parent.md) + + +## Documentation for Authorization + +All endpoints do not require authorization. +Authentication schemes defined for the API: + +## Recommendation + +It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues. + +## Author + + + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/api/openapi.yaml b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/api/openapi.yaml new file mode 100644 index 000000000000..44c6a2aa3c4a --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/api/openapi.yaml @@ -0,0 +1,53 @@ +openapi: 3.0.3 +info: + description: test + title: test + version: 1.0.0 +servers: +- url: / +paths: + /test: + post: + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/MySchemaName._-Characters' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/MySchemaName._-Characters' + description: the response + x-contentType: application/json + x-accepts: application/json +components: + schemas: + Parent: + discriminator: + propertyName: objectType + properties: + objectType: + type: string + ChildSchema: + allOf: + - $ref: '#/components/schemas/Parent' + - $ref: '#/components/schemas/ChildSchema_allOf' + description: A schema that does not have any special character. + MySchemaName._-Characters: + allOf: + - $ref: '#/components/schemas/Parent' + - $ref: '#/components/schemas/MySchemaName___Characters_allOf' + description: A schema name that has letters, numbers, punctuation and non-ASCII + characters. The sanitization rules should make it possible to generate a language-specific + classname with allowed characters in that programming language. + ChildSchema_allOf: + properties: + prop1: + type: string + MySchemaName___Characters_allOf: + properties: + prop2: + type: string + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/build.gradle b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/build.gradle new file mode 100644 index 000000000000..5fddd46d9bef --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/build.gradle @@ -0,0 +1,122 @@ +apply plugin: 'idea' +apply plugin: 'eclipse' + +group = 'org.openapitools' +version = '1.0.0' + +buildscript { + repositories { + maven { url "https://repo1.maven.org/maven2" } + jcenter() + } + dependencies { + classpath 'com.android.tools.build:gradle:2.3.+' + classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5' + } +} + +repositories { + jcenter() +} + + +if(hasProperty('target') && target == 'android') { + + apply plugin: 'com.android.library' + apply plugin: 'com.github.dcendents.android-maven' + + android { + compileSdkVersion 25 + buildToolsVersion '25.0.2' + defaultConfig { + minSdkVersion 14 + targetSdkVersion 25 + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + + // Rename the aar correctly + libraryVariants.all { variant -> + variant.outputs.each { output -> + def outputFile = output.outputFile + if (outputFile != null && outputFile.name.endsWith('.aar')) { + def fileName = "${project.name}-${variant.baseName}-${version}.aar" + output.outputFile = new File(outputFile.parent, fileName) + } + } + } + + dependencies { + provided 'javax.annotation:jsr250-api:1.0' + } + } + + afterEvaluate { + android.libraryVariants.all { variant -> + def task = project.tasks.create "jar${variant.name.capitalize()}", Jar + task.description = "Create jar artifact for ${variant.name}" + task.dependsOn variant.javaCompile + task.from variant.javaCompile.destinationDir + task.destinationDir = project.file("${project.buildDir}/outputs/jar") + task.archiveName = "${project.name}-${variant.baseName}-${version}.jar" + artifacts.add('archives', task); + } + } + + task sourcesJar(type: Jar) { + from android.sourceSets.main.java.srcDirs + classifier = 'sources' + } + + artifacts { + archives sourcesJar + } + +} else { + + apply plugin: 'java' + apply plugin: 'maven' + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + + install { + repositories.mavenInstaller { + pom.artifactId = 'petstore-openapi3-jersey2-java8-special-characters' + } + } + + task execute(type:JavaExec) { + main = System.getProperty('mainClass') + classpath = sourceSets.main.runtimeClasspath + } +} + +ext { + swagger_annotations_version = "1.5.22" + jackson_version = "2.10.3" + jackson_databind_version = "2.10.4" + jackson_databind_nullable_version = "0.2.1" + jersey_version = "2.27" + junit_version = "4.13" +} + +dependencies { + compile "io.swagger:swagger-annotations:$swagger_annotations_version" + compile "com.google.code.findbugs:jsr305:3.0.2" + compile "org.glassfish.jersey.core:jersey-client:$jersey_version" + compile "org.glassfish.jersey.media:jersey-media-multipart:$jersey_version" + compile "org.glassfish.jersey.media:jersey-media-json-jackson:$jersey_version" + compile "com.fasterxml.jackson.core:jackson-core:$jackson_version" + compile "com.fasterxml.jackson.core:jackson-annotations:$jackson_version" + compile "com.fasterxml.jackson.core:jackson-databind:$jackson_databind_version" + compile "org.openapitools:jackson-databind-nullable:$jackson_databind_nullable_version" + compile "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" + compile 'javax.annotation:javax.annotation-api:1.3.2' + testCompile "junit:junit:$junit_version" +} + +javadoc { + options.tags = [ "http.response.details:a:Http Response Details" ] +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/build.sbt b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/build.sbt new file mode 100644 index 000000000000..c0c6806cf3ac --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/build.sbt @@ -0,0 +1,24 @@ +lazy val root = (project in file(".")). + settings( + organization := "org.openapitools", + name := "petstore-openapi3-jersey2-java8-special-characters", + version := "1.0.0", + scalaVersion := "2.11.4", + scalacOptions ++= Seq("-feature"), + javacOptions in compile ++= Seq("-Xlint:deprecation"), + publishArtifact in (Compile, packageDoc) := false, + resolvers += Resolver.mavenLocal, + libraryDependencies ++= Seq( + "io.swagger" % "swagger-annotations" % "1.5.22", + "org.glassfish.jersey.core" % "jersey-client" % "2.25.1", + "org.glassfish.jersey.media" % "jersey-media-multipart" % "2.25.1", + "org.glassfish.jersey.media" % "jersey-media-json-jackson" % "2.25.1", + "com.fasterxml.jackson.core" % "jackson-core" % "2.10.4" % "compile", + "com.fasterxml.jackson.core" % "jackson-annotations" % "2.10.4" % "compile", + "com.fasterxml.jackson.core" % "jackson-databind" % "2.10.4" % "compile", + "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.9.10" % "compile", + "javax.annotation" % "javax.annotation-api" % "1.3.2" % "compile", + "junit" % "junit" % "4.13" % "test", + "com.novocode" % "junit-interface" % "0.10" % "test" + ) + ) diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/docs/ChildSchema.md b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/docs/ChildSchema.md new file mode 100644 index 000000000000..94bc205bd0e6 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/docs/ChildSchema.md @@ -0,0 +1,13 @@ + + +# ChildSchema + +A schema that does not have any special character. +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**prop1** | **String** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/docs/ChildSchemaAllOf.md b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/docs/ChildSchemaAllOf.md new file mode 100644 index 000000000000..8cbdc808bd8a --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/docs/ChildSchemaAllOf.md @@ -0,0 +1,12 @@ + + +# ChildSchemaAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**prop1** | **String** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/docs/DefaultApi.md b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/docs/DefaultApi.md new file mode 100644 index 000000000000..1e954678bbda --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/docs/DefaultApi.md @@ -0,0 +1,72 @@ +# DefaultApi + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**testPost**](DefaultApi.md#testPost) | **POST** /test | + + + +## testPost + +> MySchemaNameCharacters testPost(mySchemaNameCharacters) + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.model.*; +import org.openapitools.client.api.DefaultApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + DefaultApi apiInstance = new DefaultApi(defaultClient); + MySchemaNameCharacters mySchemaNameCharacters = new MySchemaNameCharacters(); // MySchemaNameCharacters | + try { + MySchemaNameCharacters result = apiInstance.testPost(mySchemaNameCharacters); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#testPost"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **mySchemaNameCharacters** | [**MySchemaNameCharacters**](MySchemaNameCharacters.md)| | [optional] + +### Return type + +[**MySchemaNameCharacters**](MySchemaNameCharacters.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | the response | - | + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/docs/MySchemaNameCharacters.md b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/docs/MySchemaNameCharacters.md new file mode 100644 index 000000000000..c62cafef27dd --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/docs/MySchemaNameCharacters.md @@ -0,0 +1,13 @@ + + +# MySchemaNameCharacters + +A schema name that has letters, numbers, punctuation and non-ASCII characters. The sanitization rules should make it possible to generate a language-specific classname with allowed characters in that programming language. +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**prop2** | **String** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/docs/MySchemaNameCharactersAllOf.md b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/docs/MySchemaNameCharactersAllOf.md new file mode 100644 index 000000000000..a5d3c39b435a --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/docs/MySchemaNameCharactersAllOf.md @@ -0,0 +1,12 @@ + + +# MySchemaNameCharactersAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**prop2** | **String** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/docs/Parent.md b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/docs/Parent.md new file mode 100644 index 000000000000..2a71a187a1cb --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/docs/Parent.md @@ -0,0 +1,12 @@ + + +# Parent + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**objectType** | **String** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/git_push.sh b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/git_push.sh new file mode 100644 index 000000000000..ced3be2b0c7b --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/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/petstore/java/jersey2-java8-special-characters/gradle.properties b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/gradle.properties new file mode 100644 index 000000000000..05644f0754af --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/gradle.properties @@ -0,0 +1,2 @@ +# Uncomment to build for Android +#target = android \ No newline at end of file diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/gradle/wrapper/gradle-wrapper.jar b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000000000000000000000000000000000000..e35d600ab118c93d7e23084511e366fb638b1225 GIT binary patch literal 99814 zcma&PhnHnlwJv@t=bUrSIp>^n&UGs1oO3`_5J6C)fQV#4P=at(crZqH6Psi=P3S<2 z-s{!tz1}y*@BIPq`}SPDPc`WMy)nKS)?E9nz1B?oRMn}f)&>hpdxOE&)?hG{feZ$7 zjT;PhkWE#cWl43-)hQN+*6S`@{O>pZS8-7(E-3+dp1icFthuhbs-rWxsTvnGfq=$_ zq+|%EhNO5geDqR#Dzpq42~UEk1MxKpb%|#7kP{%FKMu?%N(NlQC(7Fs!W*l;|3X>@j}V`Fq}V{$DrEqQ!lbbTE!ZU-%aNs7SxPYry+Aj=Js?_wL zx?A??)6By{5Wv)qSP-3S71LKV(hZKFB3^jh0wxF=vw>m`O2|oW)y*uk@+f@>g|*=X za!&%=e)D&{N%m}^7es$LSRM~?5)s@VaP9>I&w2583r;g)IToSwo!pRW8B~ebI)V&1 zb00W;(HiBl0{X**h8!ghDbE7r2qG-(rc<4ukY~a@r4Ll|KfQrmlh8uD6cbk zq(J3WB*xDw$&8@@cy5-}(iYeh2$=it=dJ}_46HRqjR84-AFnj|x&WiPx-oFU7cc3m zF$Zd~3{90@S8eb}rz@=Nd@5uzHEP^nH1IM|YQ$)FHS=nMzTD@1z21He+|^sNbge=U zDQ{MpwPM83#=Si~95QS?FemEZ^IL`vBFh{`S#s~)3Kr^|JX!~NWTsjM^hs;hStbbJ z4w>?RpNNf)?PjKgJ1Bv>0lGj`DgX7Qd%$^5fH@XBDmt5mm#E7Ig z!^o;#hyV-SPmY0b=K+?wRUVvwpb0}AJhIb(49#Oy#MuM@#&#soZZ5+gRKoFHcIW3K1y-8}Ay0nEM` zEC>X2=dP=0^S-=|qX!Q><_RWndhcdkPlqSV=tX+l>Ak1H1qJqy<2(Rg;duboqV|3WJsHH9 z0G&be;1+Re<%|O!IG)+sPU^CvQyVnS3->^*m99TO`a16cj0Eu{{>;WsM>B9O{$G9T zMyLYbc|jkAKw~Zf3Gs9^TgNd&)awKWP_OQfqz{ZBmPAW5*f-I=e9~6kqmRaupfbn+ zGj)}Vy!9Yheiv9L$RuP?5Wy2SZ^;Op!@b(bftZc?A~8;ih<=j`U3Y6PpX(3CY+YCf zbH98KxPWP>miY8Bx{V9*In4Mmc1+BCM)_2)aObDo3jw9#it!rK1DddP>=qo9RWtQ7&Wz$dRXI9_6gM zMnM4Voj`<>+vUf7N|SO|3o03meP(;A6;p^C6>uK{7YJ^?iK_(UG6{63G?#G~*8vLZ z!1%0V_5)0Ss53wP<4xa@F?i*cTE_3oCppw7piJw7-2=u1SlI!y7CnNw1aM2HTnG@O za9-KP%wdZRFp5!lDNh-62&P`^#fo?HZKc~-nz5icP$`HTPcx5KZo`1#TeY5!D_nzO z%>-aaF}Qg6niX0?BiVALiOa9&wm@1;fC1Z#6!5h#xn}s@ft$fwGT{;b_{~}6^7hig z^6131FLU^sCf+~Q6%3fk0*l{b!Z?7GuS%en57K#`-vs6k0y_6|e0X}MQ=FLSC?^IQ z7!pC(`&V$G)X>Q3{dKYW^m7qbp6?honjsaqttFDSczC#5KiWdwLvgPnf@tWPD_Y%K<%8(>SlmOc+6lP>l>3xlWY20 zVWwY4K$j;3u#l~}yS;0AI5Wo z-uRE(9s;K)Gt{e@d2io#4F0Fz-Ukjam>Z4JGAI&plK1HY1A8pcD5AWme}y|Pi%VCp z-pplvB@Qi=nnV8iwObrCFQ-;JPB_6Z!Bz-FfTlpj(QAz2A0Pcz8c*T~%BW-o4tf_? zm|6)8Km(|jCp#Eb-7I~IujUTiCWCDufPx^t9vBpH_I0*P=A0k_VnrWW4Kou}>h98G zywch+QQe#oV3SNA)n@DaxUDR|| z6HuRSs1S{Tm;tTFk^3y=iTSY}DM!p=R~{N5#~~l=B9S$XMs~lUKgQb@5imhhp2`sn!xpt?E*;XA!Irw{%Y~=%(m2S{UX>LI72u6rKn#u` zvtdt^ojI$-3$H?N1ugsa*AG<7gm5lkFDk~-+b6)U6I>G3Ji_N^e( z&fm|&cz}WeBh*Z=a~;NZhhEXYzdZ<=fKlnN(}zrR?xlrJ;(6#tbyxF{Pz<`6S~0Ek z@^m~{$|pY_UNr@zh1)Dh2eXI(WA{=K$a06CNp}HnJ`ScLHo-bL`;1J0zxz0Y)v5OA z!0lMScPm?B{}7L)qrP8P2ZjQhxJ=)huXkmtrmIhik_=JYr*fE??j5dQvC9Mkc14sy zq;nHi*MAf2qnGWAeej+7M!X}){Qr5Eg@^ynZrSF>%;eI>?D*)$vgz^Pft8os%RGx9 zTiJBzr7jT9Gdcjq&;v*87HPAo(a}tkPBH47IlHh8mRh@;0Ac6abYKX9vNPR~Fl&lw z2J@B&E}(}_!Vvt&r@z~m*eAA$F<#`QdZpO<{UP`EWxz=E*MhN-m>j|MChrJDQD<(X zMJBWvQwPNg&g{u6WS$k3*fL*v4u5t89lM?^Rp9EAmv0ws4)x^2#j@daEK!{WHW;RRruVfc@dbe!3KP`$yAUS3i5RgN=;1OncE=OKw+T6L4R-> z*oj##?O!nhyv_*mk5_&%FxP3u0Q2fw+}7pKvl|3&txIry2Z` z>zjf)49mdTVDJbw7{dPN)}VhG&}X+Z*rOW!)UH|w%ZxKcKEEY{Dx>dT02Xxi77qv= zJWVh23&?FbcNbG-hLPSKALxT91$oafGJ;ZDSC#O&tf@xN)Qz+xBeZg#dhm1qYeTLB zXZ(O|MqFSEF~?m2Ouy+8(bb+^SYRwk!Hhv|XqT96{5N5nicf!V9N$IwxQ=~9^0 zz85W^n~rS?u;I&_F~h||V!=u}sab(p4d;LZyn!2thpRKNKLUnguoAXfraN_B?Zc;D zh_XPXSDD_M2A*$#v%GV+({WGJ;_))n5FS<)CbZ*hFu*`Le9(H#v?TGiNgy53(0Cr+ ztVFlQL)$hT4x{}!uw^z3KqWaeZ9e{0hM1lj1SLJ?lB?P?yRPBNBJjHYxP~g6` z2EmpMy!(O?{36wfw_XPS`wb6)=Ys${h6r#86uBMk&AkqXy177DmKm3aWkTnl-!E$H zrN`WPi^`L6y4)ZiNZ?-|ze|))Z|xk1Ry5a=3t^bHXwLU&iLx@K z4BM7ECeO?>8I^=!3eNSPy7A3lGBFl{UFk8PdS>Eqn-3xS#G`_b9iRxb!i1u$x5mKK z#6DDjt`>a!g9a##9vuz+x(!PImEVkVpUN=|_DPIlkQoPd@yGLYRl!^f6FIHMey(r5 zX%}i8NQX+^jvyPD>}uwjPHvOT%CTZ*%{1uU-+)b&sq%oH2m+KJP3t*T$prY{9=~f# z29xJ+vEo?;eC)9o?Z5StatP*F1qf*CO6wABrX`(e3dDluFW)^MBSY{4^=`wDM+8zm z2Gwr#OP~yJh>HP(n$WW>kB;D_oDR%I8e+SkFYU69{l6&6#?cwBX7Ia{M*IoIc zbH!2y;~qAk(!!daX#zZ7a*h{OgBiL}8@beZ%WhnmmlkbA(#(e&=C8U5^8B{O2ck&+|(@{{*+~1DpMuRq?xkLSSozK+h?x)o z+VKE$QLo&M3Bm}-Ob2rW*?~qG-zJcNuL8={rMA$cgF?XLWnzVH4ZHaBMTp#ex++O| z0IDjm&V1;tW?>k z2R2viBqMO1d&UdQzO)CNZV~uGH0}omywm@2LCib%q`A zaw*d7P|p4wjGp2RJ^%V^wNTa25|as_BPLu$7tZYib`$IhD~@1SUmV{J7HgXbaP3>) zGqJR<=PS$C6Wj+h1Zs-ni+e(ucGi6P#utx+CzX^JwX-<@U)}rzQNV*hnXCiA zO2p}#As4QGmmA>>ld3EdECcj46kxm$@;GT%`+{jzIaQzKP6d0W0u#gH+7^!(JJAik z8p@W$qU33Sc@bmk2pDk^V6A;|%lkL3&;b{pF}X9+q^hdz=rzh~!1F+XpWYzjT@m|q zGlL!0K9e>eHU@OV8;tu2tM*dq?TJzH-=BLP;*&>UV4p=2b@KKvs%A=Vok;?5Zqh|sGbQ1nES+6isoRY z4x3*YwlWeb#$1S9^HMLq$*`^iqZbdjDo`W>oH6E>0p(^o18{LDwh*l%Fa*j#iJDLa z!Irsr{)apiP?I@MFENZWrym2SJN!U6c(YAc%<$?6L-R%=-3>$Y8G-GC$vCqZN{Y1FSYb|30@R_~Is!6_H`&r&Q5&YNhtrrr1rd`(kK9?WqPv{#8|b=sFfIZ zpaAsVZ$gnzyVPq&H(?P(LGb8d z!(g*w6CM@;8NjDO;F4I9=)Z<38GzFqETcA+7<9e^C=X-<>gg$Rg5Z7u*1^8084#`@ z-XGvFlV{uXr+574ySureZJI&A^df^`zaS&JF0Oabevm;|ZpxglVSuJbOc6O#6+d=8$7P-2>+X9k11_E|O+R#I4D>O}eH#MkUEEnW9 zREQ#+{@q|=+j|-v516LFh38coKz9t}Y;zUZ1{rUN)Fi;zxcHaNuwsnk8-K-AGGenU6?S=1yJ9&TsDw|{g?#>&lb7rApV$!CeeOeUH6+RJd1o74!Sc$L7HW9Z^A|aP1^e zEvRz|EZP9}(c>}TI-(dlW*L`cq$oE*Y)u0LV03ltzJLCD?uC1y0%xBU$qb4IwJ~c# zCd^AJFFiaOa43`D3w>m94r^QB6ToH&@UCGW-UeQht$b=7AX9-Nz*z>s z<|vp$aWn7oHT?Om*R;*@3xt`AEc^#)8nYdQ$wJWeKM!L9(H(&Pk;JtB`6puk z_=9rH5P%K6)RVzY0L^(ZX#g5ZFWpOFTg6(eV}<|`8ROssAeM%JZxgndWI&z>;g%-{ z(3t>do=IMd5_>(D0h+w+-u@0`q7029z*SS4zxwd7ErzXKe715rgOL=}K)8#lZpYjk z0!8zpjd1O^ig=Jorm;6jRpZ$Qq2~^&{A&o^`1tm~a-U`xf%(tB1#Wh|^TYBExDRXX z6N`=pL&iULeAUkQ!shzy)@1eU!erU_I6kD|yHxJ$?{D+}6ckY#uO` zxfUk#wQZdYF0U}pdVKuoncFBx}0ln=zp0K9c%2i(Px=VazY za;PH}T7aY0xelTF`O*L+FpyD=MKW3!apet>!cFBIVoG93+NNtCrt%%U_9;EwwCtQgACq$S4*STh&V0PHa@>+d)qU z9ms{HTq23pw+LDT&CNFNK>!SX5r{5gWZ9Y+C0~$F;@rEpLjni9FXsixyL{HDyFoL8 zdSz--M0r_vya!ZPInzz>!409z3-0govtn{->ALzNR4Y(iXHiT3(bhY^UR0~>8$Y>= zyO{tn)&KP#UYf*>urtyOFyufOhzh@k|WryDO)(px%0n_TRbFNV@p>$Ovn9L%Q+1$;vSFm34_ z76hMK44;lwW?YIRn0pUfN`Z11)WZyO76IU~CQ^7ugh+fOpvx z3%J@Dy(UoISWU4ls6GUZDRL6-rgdNrtJCL-pp~gGL-p1te*aSk)+eL0+sF-VGOU0z z)2M4u2H@IvjzU+UaSM!j^M@}7Ze>9^iG$@lp5V(@*FJknWj%(bhSas7V)g#d_CG01`hh{QB~$P^8%9;l|YouZS0V){H<^s*ewJ^Gxf)|^!; z#!gjrsz-@&PXztV-10dDQ};E7gr0i|Lkn%fwuJs;kK0%s2>gdq5DysfljFAc& zG;fv;a1>-r_{)!bd`6ZWf=*l$8MZ#Ip>K0rH$QI!baa~ea=PkvQ3FRtA4d9ZMZIzYVE5-Unt`Bhs)MNpseMexe;yaJiO`9MT(_F6tb`{t1F2*y>kq;Jpd*h(70yQB^Vaj= ztIQYyuX1uc{~!b#Ht_j(+rWKz4g;tJWVe?U$D0AG&Z=XrSGF>=%pp56pc<5S?t9?e zr(lz};@Op7xLd${w&|VkZSAqVYn#L*+~j8mF+`S(L5W)eW51#EBIB3-ZnM>To=cu9Llhps@j|tRhe-or@eR8dKd2zCFd3kOOyte#O0>|P_K;e)&wR9F?=r=}v_eguZ$3%Ak< zwTEC8AOTO-5Xwe1I;9(-g?5>Kdo zn+P(iNVU@uxoWw~*PRc-1W*)+i|~3ux~}o^0nnEZTszW!FTEpZXM($eV&=S)dWNAa zn2xaQ?M%n5rLyW1targjKKpJwdjjAkBK^z*P*}G|*M6@yb+u(yB};v`9rG6maUTL_ z@#U%3!K?we89oLC+Yt1-!QYfK7_uWV;k0kMU;M?6OFGXj7*RXXG7TpBHAtT|T=-p9 zx%PRTkTl&W3KOPe)EE4!)=H;%bASh2QhCN^V!t{=r?BvcxLXb~uBy8;Q75v&fYaXt z3z(~F3=HT>+vtcc#xRMEdwo2~4Fceo1OT1FW!jvZ#Bk^ktF~tlLj;8C!)A`{7>wA0 z{q4awEI+tmRxSx#6bas%!XUQExTlF#2JjU?fvSoG>o~hMrr~s9rOYsaMri2)MK!ud zA2``SW4=(F`ko3E69ZtL0XZvXQFPT-Q&gTb2SN#LJlh+_(JYE_@x5V)zQ(<;> zE1{+4;VT#bwKhD)n99D~qUNYKAHR4DOdbV6?F^4sC>WogCsCnVIC~Xv{vOr#PF|D4 zHR)8pV3rM#U|@x7jS6xsL#*X*z9h;*-sR_@<;BOda?C+ppljbJw|UGT{VOCCR#eQi(6d$VDt8y^yxS+Xh2eQ63ECGofyF7XkN{@Q zKf~v@W5(`lv);2R31B}wIah-LPrkJY=5AZbWIBn!ng4j&_4pM7z9xMzPEs;c;Yxo&JckxeYeL52({Rn8vOi|x#vZ~c-FA5)ED z(0T4QnH8=QgO3*NYm0XC2D&HlZy*Ugm6C;|hvKRSo{`xB zOlJnq&t-Yo6+u_glnLG`eJ;AiqjsrR^)*;nCfTgxbr4|afBO};iZmJciU>RRqw^1o zD!iQ;N1x3PU%XxWTOVR?_L*17mgymu@Fi!*+DYhpRorOe+A#MG9DT}1ggT&@z+F7o z>hu8=_Rc(&tS9Zzmw2AIL2mKX{rX%zOMOV?Nh|B?;6{LMFd3E{G9oD)3{;$25O@cmdp_>KXXyF3R`!uF6fdjlb!1Pg09^oSrh!p|Ory7r)1L7eC zt@J|lI+!1Q+Pwb7y$~#A=42n}o8VS?`W8@!xy&;=yqRvtfdx*idlzoqwuHy?Z~_Cg zUwf|jW#s zx>LH+7@gA(fjKahO1r=Sbq&KhPS*?AGI~IvEDi1FPqR>%AYN@?cJvO=l9O8|+736; z#0%(sAjy5WbB+$}mvP5#Q>R_i2ty1sg0?_ce+Fg;O7#Q-R3_O6F+b?c816v8P4R`m zHE%+70}YFHn0wRF?Atcr(ZQX1@+bh$0C<_vI6Ibq?%B+oVzCLQV|4V5WoNWodZpEP ztVi+IfJ-?8v2V&|Ra4B~LAj(rMPvsU_~bY3;}a>d+gx)(CKn)fFa1OYPlut#i*5-S~IyY5LFFU0Akz#X7);&_9K-@DvP;U zRfeh&`Z1vxcjaGb+aSSOJ3YD+c;&~u0%#Ngo(zggnE2ueNS=1euVU2*$pdi7&u)(K z(!Q$=9pK%1=H7amQQvG5TQ)={s7i(g9wrVn#@GReBEY9Xi~(;7@B~9lwW@>v(Efx3 zRCl&+0j~tO3uDx}5AU{9lkLgnZ5_ZCwGUoH=@=^D%G^HBtdfY24Iqe}LC4^wA9TzX zHQVS0zTk_SWT;Yz4c1XC++m5R32Pb5@A@X~x0cnVG8ISA24Kk4Msg6?Yqg4J0QD| zh0pJRR4s(HOVxI(e8gwEgWYA9$7RVKY=8M01W?5MQ>mN7`wAFPuD|Nrk(`$ZCAT{l zoQcj<9JCGuXJHP2iUT8kavLDJ1 zR}|(qZg+=6QMWJW#()i9dLIbg2;@|7q+3;q@d(Mr`Marn1C`s=VcF~s zoe>7O%t~ZXo_Vy4g;(dX$;N@w^RInCj_<5f{cGfc;`i?q1w5#|>CGG1TPoBI4;Yw6 zAA1(NfT@|rB~x@0lrMe_Hg?jI>>c&l?P6GiFfRwAmjR}+_6L4cE-qKWpzRP+1rZv3 zUf{CSt)hid;^oISAU=7Oai0P)U|A-Q1i6gNO)&Zb(+g<}{G727qz<@SKs(S4x-xCa z4KQW2kCi}%EqHA&pr_sK}-E70ijub#cVK#Z(!plcc|lKC+%25_!BoOH0y{q572_N2`?<$)T$1SpPi z0k@I?IIp~NE7%fBgBMFtz1)M@u%GeUQMk&4pn6ArIzt=TvAUJBp6YV}q#^goWyMQ3}Hvb<1!bea0SV z^gLohFM#UYKD-@bgoRVpHpO=UMIib^aOP1+57s*{odxD%H@?^o=?|&}#h<>loUWO% zJ$(lRE$kj03|Fccz*~aM!L{F0bMIeCf}V8Y*o&pgM0?NzN7TvY?^DG8|Gej6D zLxz0)UMt&9jTrVIdR1T-%Ebm=IuEuC>IT&mfrWrNst%W@*bsokIOeC0ZC%rqCei-= zk(;?=fDevQi^L^}%dde2fB;XmA{$>6YtZe~_hcrW@!e%PsNF&f2Qg<7cyNKLTW3Ez zj2o+Sn1vra1h(QsRlq2^gT_ETAnk9eXfMD3a2@*SMF{4c_KS;RRZAx|Vn|mgYnzhS zxxiJQr!#hZz>-u4VP+LwevS79%6E=!Lu{dh9n@BP6hjFJ8J&%ZJm`eVKFg!om8fTn zdoxP~;G=|9);rqE`}=-;R}O^f3ACr$g4$<*)qD4wCbMy=_GL4qU_=Cy7vMb5_`xmU zTObe6WTQ7YP_b9YoN0_vrJgZ~2`4xL}oCW>c6Tb!r;%c%SAuc^GL-49U{PF<^?VWHduV>$m3ZZu4 zW$iCRLF)$TsGx^{jWKRq$F+oEai|R0g=&-w;;bO)f=E#PY$iBwA((-v0M)sxq7ieh zh`;~nW#?I_qde=zWDEFUOfVeo}w=VhQ5NyJ?@x00@gtr+zu6QmKnf!3-Z-v%pa~bZJ4ad zT)f0UR`$Ppi(CX=w5F@NGRX4_nEY36^Htz1>B&(jyus23$6I5v>L*| zV*`C47e$dKM#WT+|oz=cd){S#alexDaZO-IcKvov>BS|Hb$&+-&smJ9S z?rIa%RMRrkQ4XbtiF^`K39~70-FDJKUjYp~?%>BS=~G*y`K`ade`sbqGk#Dv&YKQ1 zG#CeS_8gyf{}2;mz4xsL+$Xm&Z1)BO zeAg0}>mV;a&`w_f4A$SCekBlMkTtZV@`iWe`Dx>V>Dn)wH_$gg+FYh6;Qe(yU36v- zyIdNG5|{(^vG5k=9N2_1$(Y6i`CtGyJ}xS?xEj$f^K48CwG$?bATtY+8=L#|wcQUN za0t_9oXgueWev8wO0TLtq$O+rePc2TCicS~cQEb&;JT|#U@R{IcU$o31Jj#qw7%Oc zKnIZd%CzZu9|QxCDq{4_r`eI;h^LjcRP)Tc+1D%a}J&iG>HMuJYTy;ox`F+p_ z-%&OuMbzhaf&&e4yLnatYG-2d`>*dmYOx7DF{|0GyVxjJ@G4LQC;`;Kjvv)|{=Q~9 zuh>%irO7x;hJZO2C5(6>_KGT|?RH&U7n zq$|kbn!?=x232@d%0(_>PJ-wL`PY^51%_?yvkZJTwy?iM6oC!6jTF%{eIP+_Wgl}5 zU|d3Kz;Zg$!TIJ;;OGr`{#CHD&Zi2Etk!KQZV03 zM<1*6m}<&+=|0$Z%oFMDvIz_^wJcs9Ne=mn<*>8;u`5Alk|bJ$lG< zFuXwEJ3mW?U^dq95Ud+Ue0MIO(Rs!h;L(9UzVOON4?*UGn9g+DSYS>gqX~p7FR+_!r)@GRS7nAt zbb-}ks%Z>(m&42e)uHV$VlC*<9%eCiSD&)Gat9kw2xp7xz>fUE#_Y6TOywOuzsVUq z$Osm?1!f5nER90eT)v|SB9IQ_8ZjR}Hq5P?ffx?p_>VXI24cY27y{8K#!;StMbV;t zqyfrS$-BRV81lE$wgDAbG^^fZ4)Sc=&3Rs;V{M)x3ic6$K^4RKN8Q;Q%Rpf-~uu19i6AU9DBw)^6n~$6F<0mK$~5SNRx~iIG;zkhX1Q5!oen`JK=O z$q+%|OLXH}u5PWL64h;@C6z4)U_^&NbR#_@h+6OzOGJvHLYaD%;fmI{(%*|9H3WPecyT*VlyEj2%@qIOhsIIvVw)~tCERR zW7@xK;MJoh7h?p3?4JH^G}9}3i1`sR$+DgWz4c?TNzgv%(oeyF;$<+->fo{LgZW_90SmuIHzYV$Aaq9UYrq?J-0B8vWvjef`Z(OV^DVAG3WKtCvbwp06!elE5k<|I~~j>$1L)<)1f52U8fjJbE@LpSY}gC#J4 zMWf^Ik33(Y55}QIccoPe;1g$d!sTI%6V5^@vamfQZT^chQ7bsD?BeU((voSatUovY;ANlW`y6{eZ~y1^bGH z{;=tAZY_;_6=Y0j8F)GuCeHVE8q(gr(^gZrPau+TjTs zbbB2$4G02xUi+!ZcG`AXBfS#RySy3O^p%ZpnwGIGN@#@r&9 z$Uv3r#h-uk!*-Zp1p@dVho$IWq5tIDuhPQwuGMF!eTN9ID^c%6WEF7pFrL=3-22q+ z>`~>m?v7@5t`=Rpkt}#1Q3SJCN7d@AvGvl8n__V2YGZQ7g8Dyu=E5^#9bgZj|GHH* zL(Rzmi*zwN9zJ?kt+o#f-#`KDAHBK@VdKKwXcQaU#tJC&^y7ZXO;lKvg1U_MA&aAU z4B8mvEjN8eltN}8P|v#x^0-OM64i`!bBw9DCQ8`8l zYJbj<@dtP#p0)X$)LQ^iB! zyhk{wJxu01f>T7{8I)SjYQ~?ofA0>NvS;GX7OR|#pY3i~mx+Ohz&So@y6LJo5MS6I z0w&03nE}jMQ(whkvzWmEyoxJ=b3`>gZ7|N!9uF*{Lo3er$~D!qkh~GFdHGp}7GMH+ zbLL3KI?sj{tGz{sQm5jW#2o_+6x|9$$5e_^th!#4ucR*+h?PUgUyk^+;}Qgi~{ z80#_*9z3o6qc0kF)E0Td?oXdJc0iikNiWhx49-?wNArdIp|G^LW%kMX`Njy(MLs!b zDO8yUbuS4FI6UCVasubsUg$TV%hd41;199KD4c{AFgj63?|fz;2D}=`bL-aX5^6GU z_Qh+y;nfVAfMKx$WpLdYv2}+uL#Y@5n-q)Ac|xFPuI+<6AwRi=PpeTMv2KsX`ltJF z*Ssuh?+`q?#+w1zi{54s%BKAXy&!=Lw}7$S=-$!xLe)1h0J0(?MJW@(^9XVw7C`EB z(434a?c@S*`j}Cqzk!N?iYB{?4DR$VH$JUw5UO8@p?DpVKHv+1Y83?AMfw8BXJ6yW zQ>N<2&LMxxzD{r$Z!+&9%2e-MYUz?oCUqQ^kcw*Y;y%e&S(TzCv( zZV`<6&ju2uitn8lF#xW9cObP7()RRge&#Kz?K40fGA}$k+8K&Fh;9O=t6bg3xh{i} zT0X^a)Q`B84*E0K{`BOt+Rw0{o`m*i0x!I5JLSg^Ej4Fm+kf&>b}~=9s46(CV;rNm zo&>XOq;u*(K!21-mAy$UWp9UR`{Nd|dy3$xSt7Q~T^7%BQ=&C<0jLq7{rT`HI}Fs) zRDsFxQSe|;PB~Lr;H3S6t&0rCiwCcL>>7r?6tF6G2RE4(9_7V77CSI~wJbGJ9Q0@NwbQ<=5Y7l9-Rv*@gc*A7c`(a# zeF6%PX*_9w&I=fL2w>MsO zs)K9?1=$ZwGE<6ph}h{=;OrG4WI zDidyzh0d(xzOCNA4gCG@v4c-!jf1Cwbolc~083m4?^7?Mb(IVHoJwppt-k2XEs}Yw z4ZiZ~Ba89cXGPRS`fEk$?$fSfSfb(==>Y-L#|BgZ+6M6iI`|Yg2pX2L(?QW3w3IS1 zN9~6$P;z9hHLQaRr~p8Viq+oir(I=R`G}#l9i#JsgM_Q>r|hssPywh}`{zjZl~7f} zl(a$TB{iV^U9e0LaKOVeGG=>VvmoY`j`FbFsFLC+j9qmbTbLuLm(gwII#r-DHhpeM zD^hPLOcJ0h!+W7Jm}R%9YDMgRycs}|#+whwxRGlM3e@f~il^^bT-u)ta=rGIMmTSD zkY(3-1POQ^sk?@r|9-@LA|GFlDl3Yh+k-;XnEMr!{M*A%L-TFaEl})0+)d`+PN;U@9OyUW~gplWgCZS1 zetOx^a=6Z}>JQ3V1`7lYm+ycJxa6rfy1{urz!t<*j{|9c^Z#03IA;GiViC`SfO^m# zU;p8&+CRF~{tFC-D!EwHokwc_hr1V^#CU+0pF~KMx}YVY&cjn?+##$JdRrmFLEMab z7DEG^vakP1W(l`?5*Zk*>xS6+LR~**g#%yThAA-WY%00rY8IG}sOF!%0EMd*i2*zW zq^79?mwr{tV@1?$f_o_=ROMo50>7MfI`JetFenDKn5vq=IX<}dv+o$@dt4236lia5 zYT%m?F2jb!d(j2#@4>;JiS!L5M_g=m|5C?Y}$89hw7r-3>7ec`xm0t3=tdc!bA>?!Ykw~sdn0U`mr$u85pZghD`~0X_gopXr{r$$LxfiC|Hn#%g@sTDd zf*@VjJ^uJAm*s&{wg1!&1=!vw+dURl`>k=PYfO6`f%UONZnJ4JR)t`Wkpsw-T6_l> z%Z)G|VIaT`G!_K54JruEr;7uE!KOigy6s_I;uIHT7pdiFB6Mw|o zn{O$2S8q@ims*^x@yunq_JWF-66{kMbiw*ZkAu&Jd006$2Pe=9`X=_6hCq-A?rl1L zcQ_idxX!xk(%JF$_w`b%$UqgF8KD9k1LFlXB&I7^(EKV-*!G zg9*mozXOWH8q-FQ?BB(5QL!^J>I|0>>2xu>k+pw^JH*DvKL!V`t4ALjI%qI9Z);m- z!Gkiv9Q*aL@|!+pirJ`*@rJy~*KmX}AFV;4zyItO@POIUQa_a+7y?eQ>AaEZEZf^9 zA+7nb!!q~&iz2}nMQh@<0A1=jxTCTqNm)}nWft5UboystvCZ@EJkE}50Cm&P7k?f! z4xyqlpd8@FvIHjCY*hzQ<>Iv+YDwP=;F7%7&tz&>3Hg! zZakY!%Mds~p?ylxM*BhwBPK8-xb6wo0ixT2mAjerC!w0!O9tnRezuAMkwNRsYILo+s16)hZ?|yC*C^CoK8RpTn|f2WGthb`m@@U=C{9 z01F10(S?_Om-@FSZ|2hdQ(%I$nCgH=s1=^vA(c!!&Q5~ZDFMcfTLCN^cm|KopFFm|bS2n^$v7?I6L2KY+~3Qjc`#`ONhsd$8TVKlWP)Y9fTsLU^fqG3WD1 zW!P8Wd)_d%kghr$>^q?K@X9`WgHii#pwBo%B51VWjzl`%_K@vyrXE7OV=Fg%p|M%K-|^z*@6NM&TrOLu8cS1IZm0gLn`d-VIYf-`SG@;2Ig#n52; zaOep}FgJEBV7;F=Ngkm`%ceIzep1ZQKBL+n7n70jY&%G&O!Gy)0^l$R#MTrV8*J`K zpQMAd56eI@?RXKOcFb1}8X}CAl(eZP3~d$!_<_6`6}vyb%HZ)8Y|%9XbZmcMGC06w zx-Kz4e@-UO{mRfBvejRqvaPg%3pRp2{uNk5DHzMjnook0SWd!-Ss)niUV#!@#dZWR zaRw(u2Oj~2%82z2v@`z8pz;RKJtL%-J(ztE*s8Awugw6}fa!quPUK+7uQ zL?oyh#I&U&4%yzyoVu#=_H44IpqFza!JqwfgAV|x8$0<}W>f(7 zdj?%c4Kz#D7od)^IQKxQAOSZpFX|Y?mWO>(DMJa^RkDl*m{CU1Do9YyW$2~8qVOi& zn#G-(Iw=ONiA)k7u1ospak@MrHAMSI6D8bpSuDK-tc`+AaBE+_;3+2Ig(B#2pmgn! z+u;?=6RHe1FwCQ}E~*w()`(rW3q);k$A|YPt$p|%=&p2gA~)5z5d+Q!1-OIufNie}2Pe>gp3=7^y^uMt`|5H3h6ZUT_j|JBQUONlLHYjv3Zp zpjsa)*sXxta(W|629fz9oguVbY=L6AZMr*KRE4{?D75VnI$xj;T6!FX@j`xy zIfMm+%$p1HoZ6r;ZGo`(uGn)w5S=wQIHhuvOZI>D#>4Gf-7FoT4%8bK-ytLLdiK72 zUa0OWGkI%4P*^j-_5YT)zE!N?o5KyFD{;6jLq;!kEtAs^x=zaKv(aTnR->AT!@?Cg*;SPu_+C`dg;$@_8ImnV9$P1 z6z~~!&!+O>$SNL@>81S@7VWnN7`?D!Zn55aC5}Y~)E;fAOCA{63hC~Voc<6e}as>AY!={3)VRB^&Z;;8`H@9Fg2sNVQ@bv4}%cKFf%437lPZT z4~-zeKwaS7W9AjJJ(ahtTZ&IV1YP^P(U1(x$n=*tr&)6iSCF8|0Wul14pO}u8q-RU zTPf0T{Rd8AV4J?8Y5JUXlU0^!c71-2UK-JS=4s4Y4D-)pI4=l@+RVt6Rc~GFF9&8 zySRjTOCOKVg8{2=|B(G56%_0j0nSZrZFFt(G(0PlpY8(M3Pdt;fUDLl!M%ymy zGCz3a^8MW69_Rq%dChBsjYk*)>pg68fa|sY)y-04;i>l9%vM3~Z0*xe79j1j>vK>5 z+e0v;ZNr3*TlBt{n;7eZ{phbdlB!C2izNZH zUYF1-+7EMNri(7wZ=*j4K&F(T%k09^!c^V!U4+SNbzuWcj`!~d0|M*SeV{WO+V``9 zpe(aF*4AmCu<~T0+VlAZbc5)oy3f@Tar8UjlmeD0I@9Ev_>b>D#nZ&EZgT-Q>d{MJ z!&mOjx%A-i*ZwQU@{;yh3^Rja#KK_6{m1>Ob#!Bi|9NPyP0?Jg1n;u);e|m=7WSgOv1XUv18R1qkK?OwgyFY9kWWKZV1)h%O z>{(0&pdQp%p4P2pf+|9p`5I^1A1=KA7=%yMPA@NQ80RyGRaOoHm{rF;hswZLsI5V( zjRF&FKxBf>zRDMT4cZ&M85o-BT}K8mS>Y8$0ef-Us3XV_ZVS(v*mvrLmR)q$A9AKVQl za6KCM{6|o)+-+ zKaeX37+M!8e00x~cTEF%f@*n|Muu_>I5Y(0S$Y*WMlkF_i&t8-roM*IeQbNI_I^IlB#Xx%N5}4 zExp>G7=?1`rkR~7$a2tV22V~ul!4Mg4r&_>_F4>?S{I*cI{V`|UdRg3kz+}Jr-0(- zk2C)8?1QYK5+m4poJ;&B1WwM0oRw#Z(bGC?c&$3xu{I2u>~qr8=E|t z_MC%M0UOMKesoYC#lq&9wsIAk8DvnKITi`Jgck%&I zxAKm@>7hnwE^npV>IbXBVXAzEe)@#z4b+JUgBa-i+aFk!l$V&dz}HVkixMXSJhPsM zE5Ar@yXuILCU|Q^;D9vfEPz?WVlyU9@Ks|*BX2G|jRxKQx>Ikv?+$~cTU{IKP&Fgi z(_yc_vq--BBT1 zxP>54a>^*Uz*NMcO1%dP>m6|Jp?STxxi70*8b*4bx3{h`+$!`I>tVNAE7U>|^MkRj zgQ>A*pf|gc`$cD9x6@#QOkSGSXEWf-dmuM*x$MQbdT=&DtPzQ4?orc}hOxdlaGQ+Y z0j?kw6qj6_8er-GEtBTyOfR4hSDV3-7E(_3Q`IyWkAjHBL^W&Vg*mzK`zfFQHSpa;ckZ*8h{rpMb`DKs|`bvhJs{)Oo3SUL|Ph4hFcAZJxImVJrfB9jsD+J^b;vPe2w~ zgYn=6uJItK^bnYiGSRxPJ?>9e0!)mJmAQpYBnwhb9$29aYTsxURX7839h3ypzB+#6L1>pB<^pLU&dpVFZE0!+ zPz61s35;4D8@(lQ(%`*X$FzM-{iWZQN}GWZ|w%+kzGuI&pIU=7e&o*3N%S6vH+ zraf*eD?DYBQveBSV^A%(jahXVBbHfQFTl7E@c4LoAc;#>?v^2)dqDGH5po_dKKnE2 zW))Zym8(7Ziph!3?K!*U?yYO72QBT{WkU%WZJb$KC?qhR>8`A1gO=yn!{A)Xz>vyR z?RU)=w20Y8zu?q!bbl^yg`r$C^OZ4M3<9n{o-7KuLvf6rX+akf;zkEh?n}k6q zDg~~-FP$OQydeO#=^_`^42#_9jpw8jJQu{;!q-@qAjf(W#{-ali~%~RF3ugi)?@HM z*ji)FjmNHXN#iDo79&PudFLNa=lsz}|G*s^G)2)#yvMeI8uZWQEuf`?3-JVPuJwYe z*E{r&FG%~nO-N^uU}4KYV|#jLhj+Yy40~|C#ykJ)igpK0*1o&MEB1#38e0GPsb`jx z&}at%>D?m1`#rvX8Y1-kZ^IzGK`rCiS;LS()yyCxYA?fB+uF_PE8xoAYOE)8c*sQh zqB7kXl)yxX?JPtGcc6m>8At`O0QmPL=8OK1wa^d1_HB^}a5bJDW3 zr@%_rpiG0V-pzVu<(Zhs1A%}lk-~FRXk-BcjzI;ii-=as9h%V|Ek_59s1PbVf0z@| z1p8t99}nCc-4b%;jVNZ-m5*d>8^U`p@6NrAw)Uy1~Ob0!Z0Tw_IoGvT@XHBiApFwQ}P^4@9@&6NRLJYmne(y4s~ zO;q99`$WUgzkE5Nqj`Q6o63*Tv0BPRucrBR1F$wFueSGx7cl( z1c*MykRE7ed<5|dqaZ=Uu+K^x)GcSQ#9-+(gXp#XKc5`t_6A)?lgA)yK`M=`qW9d6 zUcg7hEs2$EN_#a~8ps&CECB$EqyrbVADd_}4suo4?tcsT0iGW4GXkB#I z%Xeo$s{m~tVx8b1(`XgMvZ7->DWSNLD>nkofp!l0l=7&6IGzL0le`qyQ%#q0K44x% zwuryK_<53OI#&_ms7hWA22=^~mSg(pUx1m?&FCpj)t-Lr_w}cPc4)fgbMnAcmWSJ5 z&ewD0yyDbKJh-}cklz=tt9Vn(vu|+pPp@>tA&d!TtST+6J?Wr=^Y6N`JPPRCaF89t z%Y&uG52SJk8j!xhbYxWYW^;=+Ab~#w`)R2-5cdG2fm+MKSnQ*BpS@^;#wG}`tF|cd z1{0o?X1BJ^+~TM+&_oQrpW|Cgr` zsb9@1oShjNA6>?$nfL$61!qs!I_7g*d&z@F1z#{4Zy7p|^8ywY0p?}RRnCPb4mTg6 z!2#}EN61b@b&$G0G3o?~t9*H)!a0Por{YgPLKNo90T4?dV_Zi+d;0Q3?}aszMv@(P+LRg>O<1f`S?m!O_a3urj+*R?puiCy)zy$-RShc_J%`InoDA$F{CPx$rqyM>klr-hJV1sF$AOq^3hEU!ZfXf&(1l#DIFy0L^r$ z|MDG-AqJLznJRm`KQ-FS!TvrdbfDrB5 zXV%cP16FdPVvJqUq9dl=s5ygx8TRmsmQLB=yetJvncFg$xzky80FIz}XDy$rcAp=S z?Oax6x|a|K3Tz8KYa{ZL+=oic7kYVlz>k*@7(g(f!-J2%XhjDY^W=Q(b1}?kMg@;C z2LTR2%&#m47{G7?tV9U+@moKj%~OuHpZ3HpqvWy%Q?&9p``;l~bchCVmwBQ^fVU->PFdL>y94T!m9ZI1 z!sVxBw2*xu?kT;Jg_XXe0XP$VAYeX3PVY6(JOkZj$|DtmM{*qC1Omo|imfzOn|#oQ z4Cy>u*IavP9TUA>TDVq~&uEAMP18GcK9{Crp4((jCfs-h-0H^L;4Zbi7OD5#&^bGdR@KeDZh=~B!2spb^|ieWLvMY^As(a6<(NesP-l33qjD!P zA%}4fw1HIhT{l_XYq-)p!9CmQ5c`qHLl`^jtV}@d@sGj#lqI2tmw|CdJuO^(yNL=! zI~MLUtkIe2v=tDaBoaJT`|1d1cLUWfSzFmu(sry9HH=~R=*$~0Kt>1hQk@{6h9~IQ z=9Qh6m^}fpvClKQw@Gl0qv0w^)eDul-Tg(u-3uaI@#nzYGDy$7p|Q9hVk(r}qA=-h{&K zYM-z<^-Jm2UIg|t7aOiWy?3Sx)Y&##@ZuA4Eck+G{wpFI8L%aNU^R)=;L#x7DK>ih z7n&d$)AgWa&>%>_s7zP`qwTK0!zvjL0t`bUZYd<^@9W`|H{Jvr9J1b&qri8+JTU{^ z-`t^F27*|v{{4v;7PIZ3gjy|ZomAUQ(o8HzfqSl3h|YV9RlDds*;-U^&TMPFw8)gB zd3ZuWGgw$LH?5pg#Cs#ad1%{&C4cSDbD_}%C1^Tu>JX5!7c_tyW(U(@KZek#0x>_Q zL3DyA2r%g>$P$eQ0hUZ!?Lo|?voSHbXw1ZbRUP{UIHO1O=t#1C?=bsLZ{UF~JV54qyze4@6&iGpN{wbLa@*R?W=y zHce|W3r3gm!aO?V7GpOt%7U)G3oeLeC^l_*-aHK14O*9e;pGr*6As$z8tn_^XuE|w z(z(2L4&^u)m$(B0Mrqz^E{Y}cmi2B%p~r*AvfIZQOwh~-nr!weg0KKBXG?#C2=E|! zA{=C+yae??4>JrXcg`IuANDdo{Q?cD+#ByGgWx5xJTOk$p*E1?&bh~BB6 z3r%J)Fl@{s-Uw=#2b%^Z8-baEnnBvL zLw!o2aV;mG9Rqg`VZa01f$i6RPFn-1t6AF+%*lKZj|kO%(y)s4yWU-UssSs%iVjZB z3+edgL8!DOppw;m`^0@~be15#u$BuEgr};~#@yk&fC|u>P3R4vbB}{>wCjX9 z3z!ZTKY`hH<`5lhzA8OOpY$DpHntEfZAO4Cea3`OP#57M zM?q6n_TbSuQ_6*C2&%cj@)9h-$nq6@LTdLMZ&^UbeET=Zl6c^@#A=A!wm-I?FJg&Cr`?{mLaTt6MLn_sju&BrWL>MgGc zqoP`3(9e~&!+wQ)*IbGl-fwF>AdN!wd^ z+W4YREjl|veau&f`jPrvNMOL7rUtA)-~77YR9fJ)x=QXPs4eNEt1=dl*apQbB@=wo zm-m*Jh^T?qSO~zLx5iPsW$!aTDNdRRn3P_fYY%8gi#D?z zroqEN-`%%h3$c9=45+CZaP@(lktVpEXq+3cq}hNumHd_Sj9Ngw0Du(Tv0Snr1Cy3rq z1{shb4RBUTa}Y~5D>idy0YuZs@JcKP^iQ?fw{J271niBW&jUf*(g$t?vIOO^* zO)!HX2^0+i=n|lfRy+EkG{A!y{B@%26cWG?TCn-<9td7e&^an{ zCo@(BcePr@5C&ZT`p&Oqyh%h|lwUc$(ps$ft=EJMRa@4fgls64ZoH6FgSPDO)J^$(!ZF{04aBz^y3*FQ6y zM%(nngW0Z-Wi@#YJn;~^sJ5D#0nFm@n4pq6OXO*ow^X?GapQL%X36(<3a)*tMh~W7|x+~79s$Tmt#};2HL@B$hK^L(8 ztD-Vk$$N!Bd+sQg3~0eQNT*kg9snO=#Pt@p9ebuPnv+IvB<7Ew`UqMP4`Q6BfB*v# z!kH03w$Dt&{%)F7#kq7Fe(wuE!x*sSH+{T8fuPZae*D2YdUc_H4u8Uq9-Qi5T%5y4 z>hWuRyMNP;q|Jef>X>kd>evdJkX3_`D~RAiB1KodhPVAy9Tzjeo5|Y0aPZr%JlBth zM+`4v4Kt97`>t>F4<@q3M6(N{u`*fg;M92R?T5>v=$I^Az7gMaivRve`2+aMK>y%U z;q3G@{)AsOJ~NE>v{&#){e6GTZ|a_P$al&%vXm*oX>nkuQ2D(fg0~qv2Hsc_6P7U{ z=w}j6_kmdzg0Z69{B>*+1mG(o0m2(pCrxn19gw~WwwLv}hj_Ya9bXLO8D?gzSQkMX zRJ8}{ru|yGce?kwH#1B{Xjl6n8Y7&=>guC6-*<2EggWYLyE)A)2}Py0{T_h0^af0yW6j*t@|zLeqA zGfF~C{rSOPK{S9id1abM)mC??+ap{nU`eA=iU3y&Q|0{XQ|QW$I{uK1yIuZi|D;MI z^xS;Y4ZLSb2Ca7AKk!03y267O0(zssV!Od;7=ZQ!mb}4E9tMldY?ChV1<|;yWw(}k z%feP@=F4DXph7x!_S%c!`@uMf=TM5;4%CGDFa8MOV516GB^rQr2$;XB$o-q<^=Kv} z*7E{ZG(H`tG7*~D&Vu)aN1zB2?Y73_lM}7babm+-!$UL%jn6F<&4XS1*sxKV!|Pz5_OOH1Sbv5IkO3-LKLE}e$6^ok zg0?`6|HUo(fbHJxzM&0(& zy8JxYARRlVuKF*(qFs2j(>G6mCuI-vWm+^#C2-q2zL)Nl?lycb2%3d~LFWHnP4+$) z^bhMwOJ}QmM5u-Z0Eh!Qn3sX`b;^8AT#wCJwFXnUWW#75dafbaOQ!L0Y)3( z#pG)71{+EP;{q6%H(nS42UvLlrXdjIZfa4|4TX{TmuEf%k8=YXSpnOQu0Q`)0q-R= zeY4-$M_tZ-22D^L2uVw;iM^HDDZ|kabt^P}6DSG9YTA+v7Tg8Kzy{h986R!Z5MDpJ z`->6MZrxoUm(B|+=Rsq-3ch%(rJ{t9VA_(iksXITM`*cdm#Wg|O-Y+W-NT9!GvInsGm59!m!>oF#JP^iQFz z(~dX)2yKAM!6v%>*isDS;(+H<+Oo=Xhq0iBlq%ya7VB9 zt5c8+b``t9jJ#(0l@`4A$%b+d{+_kSt zqhjds-Snrx3xbAI%MXFN!I^zn=Q>hslv^7k+tD7|0rObq@hzY0Iu{STi!K9x6sntOf6qV^}zM4$$@H_p9+g@HOoY zL}wqpV+1_p!Y^7_Pk$IXSc0S zcK%(cp`d^yi;^s^z^}O8EG%eEd)#}l9H;$KGt?}Q5r~1nLmjFty4zNuoaT0P+A7RIH+jdCHD5GBc6}5ez`kqX&7xWnP9QC4x01D~3TePR|22AhQ|9$w0`Z z=jU2Ov%>migvF}Q4UG8!RIdH~XWA1bp!06HkXtSTIR72zsj*kRRTA(L!E@W-1NMyaOa>=Y8i+Pa{q8>74rqzeG155A zEEO>O%@_(?{9YiTF~=TYr+$7i!n>2DyPt6m1bVrOa@%JH8%J1M4Dri_qu>9wINzAr z7d5rF*07e&RmWzx>yOL4Nf0V0xj-gwz<9we#z0pGx2g_vfy#n2RHf<`(_@b7rKMFL zG=U$_+fd*J>1dgOT-0=GZ%Mw<4!;!cG< z*Zvq{T3NywqVpN?Gaw6xy{dsG&;+{p(D~;X^%Y}a=YC5^#xNWJ?ZJVpVS<1C;5Qrv z)OP>$2Whs5*v~uHmF3Z?eW0iS3X84|#-H|6A(Gk0{IF-xwj8N;UJz-4_Fh_8 zXg`mOu5R8y02^lfKY#dBa4sJ(+6of|+$tf5n~cxt2S4#*Bd;t-_S4n1e5gS=3=|dj zbu1+@5h`Z60>DN@ux-wt?h^I;JX7zY>25=$@=@{R%?B}59csaYQW%vv8745MV0HNJl#L2 zpS>Qtzy8%?(Ql6S?q52o1Ib|rq9Bxcji54=0PW}IzxzZQM%f}&+2vt^Ac%6td70kT z?_>{M#Sk>sO&1SCuklP3JB&gVP0-9hI_%a?Jc7oMbfj^1vqPMYdD!G}^l4AtHzMc3 z=*9h5Ktp>anW0?LjSgD#(#NZAr8Hq`+QBsK+staM;|t2YE4i_ubjaTyd)5`=zn*%7 zEgf_abI+|*E4`Top)$k(1dO*3mkh)lfngcyC1FHC`JIU9-MCX~$z`X2cvLOJLzkt51e25Y=&)_oK@F1(u z3O{;9dqQgg6gt)rv~=t+I1l~yCu4~ay_CqjF?IoC9W(32{ z>x-Aae52pBzQ))$po3}Y0AdUQv=DINp1-~E6G#>4%l^TyN{Ih_thPw1jFX;+{k{+o|P z1Fzd*n$&fXl|L?H>egC^S0{^oTe%t59Z+o>|*T1lcXPd?A-zvsQ`7~^t zT`{+yav2=lVtr^(Tx4;sJmDX08I#&m$6}b&4t7Ay} z<6#RFRnSy`9;M&6Ko{Td1_xry&pq_@lQeD&C+?}X4+uH+P;~J)-O&be;H!_L_cPkZ zK`D%%^c66HV+CY`S8OswG`-y_{VH*K*IfJ1aY#Ca)1%D1Akb}pFqQ+3yMm?KM!}HZ3LVlLR3c+t{~JUs!`g!3jr~!V4Mm# z2$}*FgVb5jXziTzW*0SUCYnHIMnIluI``DIwIlDX#5AMnGkM}28t%K7+ZqPS6Zdk| zFPeMN!Gf^W5wWzPj$mCVu=7uv&$1ry(q0G}_0W+9}G0^a*9L z;kp@Bj6R^-y2{rGk~az+hT0=^)PBOQJ?l)D2&%GMs(B^g)KjztFqpw|nX?U62WmZg z9}N^%5BAmlU@CW@1vQV)IztNn{nb~Td6%Fe0GmB0Nk@H7{KCmMp{oKOJvuJ~;2BO= zKZD>d(m@P~Grs}b+xF%KR__cDz+-^g2By(%80Vr(q_bp$aaC7lrD~#ns428*kcy|C zt9Qy!=$d|r4K!bAX-`VGELLHuimD#m(+~PMUWuJeAR?0QJcyuDPP2~#{gu@mCVx6K$eJX5#PU; zyQ|c~d!-@xrflLre7|)6y+z&yTh#9ax3q~Kmv#_6BfRG%!pxh8%9P}l`SuQlc16Bj9bkr%Zt^ys{0>um-$K z)4;o>0j}JVP`L2bn+|k?RiunncjiEeX=ii-7A&=085P`J`600JxFK+WnI~9dQUMeT zpuawJH%+%3w-BU4iV^tt*WO|$h@nms=_t`PC~6&@F|Nsz7k(ilbk%HJ(Eh`qySQ&; z+2=!HG){s}zYYd8T6=m!cn^T_b_cYG03TIBmkV8Or4MSO+RswgU>hyK2?j^O*jNDp zdEKd75Ybl0-k{)03z-E#9!UF)OB@vD6@3I0r&@WZxHC}qO zPlEHzIMzy2E{pC0cr)|?B}+568S?Chp4ku<^E+0)85}q?1~$fI=M|>s!S=(u7p(+3 z5-6nQ6D+{Gq{AAbl*@N2?*?a>?FaWao;1oRJP3-~$){DDcou^-AYa{Ep$qyvk3Xtx znN?$`cSG5chW1D6v6dcI4V57Qo|hjmE1cZ@j-Cw-mgbtkjoZjc;HyEG9)K7P;u5)3 z8-vIL5Wv#(fkpqia%iM7>8$kMQ08U52UG~?Vy;5YwRn3)}!-p8P+(w-#%1yH7( zWfo><9Fk6OOM}HVzd_#eLjU&Yqb#!l+S@=-g5BG@7!8cwg{>g2+AC5S(TXl%${b`F z|MRO4c0v?^3_$E>S#AS`alHR;AAO$a0flD)Ti4$JXF3DSFo4mi0%=kuAA0z5afcDX zvjLh7=x5Uz#Bm*5J%fn3BA_W5cbyqv;r(s15GOueZjENdIe>t@i*X5D^M2U1qs2^* zmfn6IPU8x`dJ!_A8jL6FU@W63)GYp{+LFy=2O0o+Wlf5Kg9 z&(TkZLSOBGbhMYd^7uH~ujb?vsStZfi$;gDe>X%fXl40eZ2+X>Dwx0sVo7g#Y4@3C z*0Zz-FxDtLP}`*TJtSIQ5SB2d>rirzyam1q3T4HNkMvpOju@DOp#7--`d&1>q^rsj zl8)1%Zuci2p^J2ETBJbd_FXM1z*(U;KmhZb%{3N}(HStoh={Dk%TGaDbaRw;f0>t0 z-<3C#Cea-4<%)qUhUkJj&B&PJ6?B|seG()Uj^(yn{`H^?xWLk%9s!ggY#lPDZm~%W#(1U=D2)we0%*X0zVcWzLt!tnt-57|$E$&H zjwU%9)w^k>8;xe=)2+X|{aPFH2 z1I!Z#GQ-|1@M}K-3svdllg)u_215=A@Dm|CrHTs!xE6r1I8n)?ZRe#2Jk}UYMKYHI z(COZyf^&y}yWRn18>Eg%Vg>>2Ai9}Tt@?wpfY7uw09Ov=g>SLaTZ3pq-Z|Y1GTl^k z%$1`Jcz}910}bQF1G6n_mJ*9tTa=01I_a2h#&|afnAd(_9E!ttFM$slf)#b1dUXu4 zkU0wkmgki68tO)~T)q1r3iNr&A@*(-P#DM4-e7qwc)ZGOa7Fvd^N!3DF2rzg0=$+X zkPhOi-W>)S&(CoI%h$mhZ9_FC*aEn*iq@*4t2MQeZ^{16&1{bi|72qk(+g zr6JrDqL?+RQ17K>fX$lGTs4V3njtBS;rj4C@F*U_pvm^E41t&eji_1^!T18UoTnXm zGX}cpN&BVXera+Mq??a#Fr?Q(;UFE{L<@*B1CiSM6rQw0buQQrC}270yGL87acQ<7 z7y944223!s7GM?Znl;XV*$);QU=1`p)eGJ&9pGmUpMR3mErYJ#SDPgR3lMo;Of^Sd zk0nx2C4y$)#tfCM+zrv_o|QqJhcZ!|zIzmWC&Z=^;@>{yJgT-qQ)MP)`WhV@2%0(n z5ctLCmTA7;GkdWb;NgazPF`@t?iSN&Z@EvSpOLCVdt56^k2{lT1mxv3C!-!+2cgVy zdpCdMRW$&~h!Ch9Euy6|hc6<`^zq%NBMybK765sb=YAEpEqZ+H5EQHGHaDK6N-nf{ z=R=F_O#aZE^sR+-*0L^8HfUe$Co2QeeGHHw1Dg93?FWp5MwtJD>%-v2ARXS&w)K{- zOwj?(>ls{(4&V4m=6Y2-*o=qvdR>LA9OCZ9r7<3=_q_$nKtDtW=}7R>)!O54i_S&; z`SW|j7{wKRv~q(CsACVHb@?Y?#&ao?Hjr^L>>ec&oK^z7xdoz##j_6sgLY+0_|&FGb#6XmJqt{kG8T*-ol2@1 zUF-BEFmUy0cBfdTxUm!qGG|Ov66Z&>ABRLw2ZI!-pWrfGKojF8lMXadGf0ODL21|O z-MYfK>Xw$T-U)@N3ea`md?q?LXY&NrsNB6JaQrdA^tZG1=bGX{0)`mxIDk>rp}GQw zNWXcB$^)x>G|dXZ4)%ln>29zhke!EeXgrgvK#O=NYs^fSEN}3{H8AeUvOjg_#9g`S zH3Gw3dwHy`$?V)iS9>z31;}+oVfv5yq zQ36ykYpa+lT~5N++|fN+kQ+#QTYxg;uxfAmngwi_X{mald1Zt7fK-$~+Yjyc6qWB( z0sZgC-@p-E?SA-Qe@Aa-)4UrXuDeF>))iNGs7GEOM{a|2D8^e1raRhA%tAzs#?eLo9Y zI5VM7d)opE5Sz`*T949FKp!U&6dZZZ;l^Wn6N+tnJGeR$8lC730{-ol$HA>ZQ__(V z1IeJHYT=s2XK-Bf8z!@0=zJ3_Kc3-tRgV!)(mq(W8 z5HIY_0Xt_E7u9G0+S^T#R?=ivu}F7;lx^!~Q^V$YlXeCzIhAHZ(A)w?T^pd)S&wt2 z>-YyEy;ElC8T;K2%S?w!KlozU?(f~8k-+;cu)%B776J!d)5_(L-b`2tV5T!15^4fi zNmdQPT$kvxneU!x?twh>Bp6T+VhQ0I1tlWXMH|zi(av@U`}2bj=Ki18A7u9CE-=P{ zhH@HrByt=klr93&ZRoCDAl=t_4F4{K=Ho${vnGc zdPxu${mq?|-A!oNjkQ;4pBw0G>(qxu>ESw>zWm)-1$Q%{k1|vM|MSm}b0ckB{rNXj z!80}k!I|%-G(vv^*sR*M_JK$fbzwt#Cpb0g|zqc zacML%D-A_wIpQ*bg=80SMj?#@*oersy!a%IzMjRXZ%B79u+3iR$f(_mYIHYh-`wh* zg!=7EU>ASIi#UO3P@o-jnKs=IMnu;L7(Fz)0JdSX$e1n%C4qFXtO@jqxLRP1RuJ&4 zZBae0yu|86L({gsgJ8jntn0fUcT_os9<_gHrXcMHmDQ~m0pcY_M1*1;KXzya-7 ziz|kcc|jO6ShZhEV7A_T4h+cJ?gHPenq$aW zwK(j#4Fp)fq7MP%)H_MhJ)zx^_q<3Uom2r(~m>8wg>D zx-t$|K)_O+NZQb<+ig2KQQF`w_6#!}j3Pj-d+#vE##{!c;QAww%v~U#QL`qxog1V& zb;f4iJQB@e8LABz3C^0utpHqS6X;;b7r#j3)__V8;00S?hd`W1@R!Fw3b$P448S}n zYgKgc)-7Ldw;9BB?5Ko4^(h+O4lBLIkibC^SKox}23e@IvDr>(?a0PQ%XcP zg5Y}7c8Z*+157M#@sJ@HCrInD1P5;W_E?biOaS!D`#Jd1#gF=vOZE8TBHqD~|19A< zWw-uM3DZq8e(O{rS>?S1aCT>H2C5hiT&gvQJ2C(I9=A})zBsT}I{ehLU@o(~l>oCM zzzbAWbKNn>mCkD)LLR6zJ^7flwO^$8?_Yh6)()?6l>NpF88RAL9ucM^&CWqE`j87}idnUGfLn7ZfM<$GaFr%}*#k6etf?sC z;Q}smnR_z>o&3OFtxFjfeNDUz0J&T>P#z0bsxoMG3k}!l7!QbM`W0y4f%M#PAs81Q z@~0OAZTv2N#zLhE?G99Xm6o>9Gw5CJjhprc^?`uE4DHL&85dqS{WhBMp#SI9ckh!y zmV{1wu(}4Y1nHdb;vQ+8U^?>4r>;H*5tu?dxtoFkYLli*&=Yv&cq8X1WtvJJ)0YLN z@*SF>AA%{#ij=)>ZS5Wy{n{Z@CfNDXOYhVY0EWj(a3|Rbu>g$h1ytLPj zJS+LsPtU$*!L`kS1YDN`Yscoe-bV-8sLM&`@W~IMWLoWoswx>4g+mv9!|RvJfn&)c z*N(l(D7FH5fl?#7+GGIS9u&h%e)Zw*=bLO?(d+;LK1YAg&7^=--a%8-LyKY&6?8Y! zB><13i?(^aI*@?H?qrZbT!Cbp(p;FL)z4j2e zfMKjX>#U}dC5TsCk`ZM)PAxe1G~}6w8$D(Q_BP(xrq-r?nZ#;uBXUj^#E3bVD%Cqs z`(>z8#0W$Ny~7~^jTWBHv;*i`W+QM&gm5d~!_?)bp)$6$hYv!Udu)NLYRb6*#xhVM z0(_`hSI_@O)Hp78KcaoIkFmp1I@L{ko>lI~E86!prnKj3p#9A&C5$^eI%vxXOt1#Q z;PCe_0CxvffXvQ43m(eyL~A?yZ!a)fxYu??5K&DG7&?$9+foj3r+L%`%s90PBjnTr zLzPWUPz1;CVK9d2ZSO3oT2~Ad2atPApp5?4i|;~-0NFEuayWfz5g0vxaJaD}fdyBf zPLT#fhg+VFOx`o4-5`3r<$%KLzlOrt11!`mP7ytIA_r<93}}19iU615sPeMKOf*6RTGF=I+h{)-0O7uoqT)K0@nKw+@Npt)q}T!v>HwR z>Qow#shkR;_ZSHcpmC7eYi91%N9kf!*#`2UvvTNQ7BcIBz4T*AH2L~htVUfR7ZB$Z z^hc%)GYoam*`v}r`^;v5ssEr=tQ%7tm)-I-K7EPqiOD-) zp0hAyEo0zAL5+!{Wm`c^Z-4q^E>y;pX_$a47XBbsT7hj5BqKjTEihdl;+|{&_Q@R( zH2oZi9@3sxx;j(EO0&d51NfG63V@SqKSGsw{8O)lQrdWhF|!{z<5}F;LA@`_n+c#j zUy(7P{p2N+sRgumGOz6nI>dSc1df0WDKGN!$z6iP>p3Y@?W1{%Hj%}aJ= z^iFvVGbJI60mtnCCtn5Q30WW&Fia}zTVH~rXGBep$7-O3uOg-W_(J+auRt*gP~n;H zbnJ5|YGcqmKuH%qy!iS7C{Cb?*$VJFBQPChyjKB?rVPFJ%6(8Rw!OfOW5EozWhhaE zaE6-e&1dv3@2{WNbq;}8Obd8v1`tpp!l0P}+%`U(>!_S!gZ3mg3 zpPQq@1PnTRHHk7jW16#n{SFxSXWO4Z`?s`#HGu?NY|#)H322!B3rms4@z+HPw=w1F zxah0@{`LSuU5R0zyP^f~LetwM2&+G$ZF}3~nH8f>SJAdm0?D z;|{91EUxy{17P;8Jt_wcc0b*tmW@H4yt-KiejCmmM#oq0f=%lqi=stpkFz$&)cc|2 zh2{1@FkWc3HISgozJC*1n6!c*)J@{jJ?s}$`5A9Pqmh^CA0LqSL7$ODN3NWteLByI z_Avylk7|dyM?x3y7RkJfRjYE-M?7^+S6Che+E2K%GFt|2dH zWEC{CkT6q-P7ts_(@%n!1Oi8h*dW?1gf$76U+L7oWXs6f4?5uoK^JI$0x!A9U#2 zYxG6ya)A*9z&gM>?dF!QvQql3AhsuZlxiX)z_KlCWrH20ZWYOxOvAx$U@c>U>h_t z?>kis$?L^AbK5F`Ses}aKzl*8mT1M$vpW9EGU=@eY8d00bd$g)3i9TQGyyN8!xvf# zFW@ji>$*oDJoEX0J}OEKL@3wAfCrc=04HDT5?%XQu@c{q5HywLDCQWp2ji5TCj;D> zc|f%Y;U&92VqtjY`4}H2ai+J7BtT4oytMxh7D4m(m^pDbWH*;wHq-zvNEu-^&6I)# zjyO7Wh1%{rX=&@5%M>6Q2+x zE8qQW*pdZ3qC@$uVJO@WZNRR~5j>>1YJ$#70adqm-5!}=J%|2%Za@3xA#|`RU3n+W z1wx?JdA+6Ge6}{xwg&~YEP)S}fW^34uUkWAaE-uUAH91Wf?hfQo^*Zj2o2WF1naA# zW-9&QomPd(-~C>1LSbwP7Q+&G9xV=V$I+lPX&&6$Rl3deH*ZTXcnZ_#?E7FUcC5Hc z?OlCH+Q|&m0@{zGe`HzVK2pp#8J^qvs458E%=1$(ChPs8FwFtR6EFuFImlZ*KyNJ_ zdq5hTld&%dfUxsg+bL7K(Y|Wcl+81==j_a9$#L2Ta#{kTR!1$Gxj5SX-`;yg28H+Z ziL}%^XHvU)9KgUn#0<2UmX2@;mG_?7-!il>J@#{S0aV4xvc7)&4hTVT)a2T!_pUrX zSZqv_Sx2RU7wW_Ij@fo-{Q2dd)DO97PeB@KlR--cNL%TiH__ay1*|8*^Bi>dDf;H_ z87M;_?RP#_p#ZGP3{vgcU68C0G+Pv_lfd9mDR;;fluM6=2v2W=8Jb01{fm3FKey7R z&C0NH+{R2V=zAiaLtH(Qdc(8~GC zCqH*!iFBw{k(pUNSn%y#`NkA2w;@*qRi2Pj$@C{Lo$-HnC{)Nw5YZj|c?pP*!YBNg|A_t2f5GUIS&;Sz)0%K6%SHWq>CX14Zk`vk z|3!p2XdikX(FdW#oOw^#5{(s>gwWnCIe_;t15g- z!klJkXH|kRut=U5eh<~A1&lumE$@O2Mh3sMDfF`1WA`H?yjH=SK=Pdn1~Km-%M z)1`xHF|}tkwz95%4&h}D2J{!DwW&0cjwD_m7!@(LCQ^8SDddUITUeL?uEiNN2MPqK z5P_z{+bAV>F{3<~riu+=AnK@4UWu4;M4wHovN0X4Vi%eRsDlLt(EN4zGib?nJO!w! z+G3;vq1QfZx^zFi2SkD@Zpm0SYAt0n8G;9LO%2L~6l$yU?K~hCR1MNGEn159ekrpc z+B#OcZu_4ht!{@m_rXV!WO#b5!p3^K1ctlJ#W4#;{muJQ}3M)4Q2W*w= zr4_-OMM1kXf*R+S5(=vsr(ANZsufIrOYRf!?6pjt5jD1Lh2hW0uk+`jjI{4Q0{izr zzBbEA4uQ50_VE(QUpxYS=5DZ*4lv-W_eFwpoeg@+16uL{X_kL;FO)nG14sKBpOGOn zBM^-ntirIQUHhgEOS&LZIT5YS5w2Ldxw}pKx+Xf9(E@W3ola#@+-B_1*NrBRNjG8bySb4c+)%^=v*`W!}S6HIQn5j1E8@mo^NYdsL?{KxOuq)bw;r zLME^KD#!4IBG91$Wpn5P#u<$aWaV3a`4dsWi~sal?8yhX%ZA-Af2x?|t}j0Uwh?*k zDF|SJUix$+!TpmwT76gsj;RP9LzqH?|EDUB>4CZJmS zgK)&9sPeen>T^=H%)(D0|ln1iY+ z_(7d69s&naTr2vt`rU7pvT3Y+n!8R$z!$1JoTZVx0m)73@Z08^fl7Bq@If-=0BA|U zVD@2IId#rgpB!@yx%mrwbkxydfEj&B$>O&HnmI>b1d*EZSd=1i@*N=nP6V{FH=NsU zGC%WhqI3%HooD#>&L{dy`{*Z-baU1yy?5#N8N4qyF{nhEtDG<|y(>VPoN2`lOwCLS0(6gH<$vCM=M_~8 zL%zKeopioa(6;@_2S?-(&SASOy6~pOiEe0fj0sYtbgNmpY`%g_qD=A~@hm zhp&8)-N(3R^6XipF~`7N`%0@^&=#VNW-Ia0s+c|0G{zY~oyP5Rqzn5%D)@#hp##cC z4$`7H{XzegJF}r!`%f82H}A+d_A*78rEax$wRyRD&+bfk?@cgXkrr$6p`|B4t*la) z-gf~X0|7R%3^Rbi2P}fL2lPpka{<;lmkvW%dar{wfcm`y!GSF=B}LFWUYG82YL#X% zZzgV{fAP{F6cs^@P`MVsnL!D3iwN$8P3*vPL~);@mVfrmYGp-1~6PZn3eVxySx&0ylLfS5$>;bpvk0#?cdUp>!y0eFZI z-lazO_o?G(jHo6s*Kx46(nJ#o2fBhASTjEH)(A}i&{ZuIH~ zEr}7PQ9sdLCb0|1HP;=fDs1l8Q9|3PthK$ z0#hzK`BQo-$03!GR2Q%W4paw)iK27YsOZ4s~&C;s1X6q z83fG`v^=1^2(7-p^U5pP<+RDSuX}=bgMdlygNY|_i|*2OQQU1xuD&^a0FBmSZbHyE zdHJmwbJ4vac%cAk3NMC8&v3ITT}^?uvVTaW7#GY4U7x25lAOKwc2LI{ik|xRJ_v@2 z_MbThYbPU=E{p;RDh`Rfti2w0r!mcVjv!js`gqC?odFc>?U+mWJ}S{=JPJ1DF*VDy zQHxHlwh2bd3IwEUpV%*tyk&dnrzN zpo?}gvzU}NSJIXY#+o@Hec-$s07lv;G3N}!dR*PlO#Dq~7tAh>PFfb&-igTvr`f%gxT)4_x89gwqJ-6-1 zy(4+j!Nj}pVDRFx7ie~6B1RvRCedX4#M>4}pMmzt_~7ga&+Ve%DAU;621 zTbLGqzw7?uR%C8zfOj26!kFJGXSbzWRm&;Xq!LgRs3wnV0<3t+RZya| z!H>KK#;Y3B5j^AX58mxIXIa6ny;vSW)7fB#31isM0}jwnOU8^kf%ez#cG1s2qb$02 zrG`I!q#s)C{qo}9h~v@#9$%^$!H8pnh+LUI;X?G7)n`d;P`yMcq9bkW+@)#o9! z`wA0>>(-W)4rRoK)}lv785oOooXsg-xiXfKz6}CsKA_EVQY8Z#rsZG_3s%?e@3gvh zho|+mw>Y_=NCeky4pONd!nS~Uy9uhT%VKcbNG~`ISAF#p@Fl&k>+~a+9-359lS%W> zl(nt6ImiM2-3#&d3>1Ld;00N`fo~rHTe6IhmMUURp4|nP-oLUBz1TkZzaK9~i0?w)oR>#R^{tT%P1e+do*ud<6KQn5L;Y=}mCI+O6q!`c(H zc?1Kv!4=G8(vi$fgFn69L+i0M#;pLUpo5@mzdHJY;bfstopdw% zeZIOk!}EZesB7x@o#?ZZ;Ti9<4{HxwKyv`pC*8d8u}=oULpGhkb6SkYgVib7ZX@Pb zc*Rwo01S`wz@DtZjjfXTupTc)4$wDQJ0A&o^Q>MVOG44zexgExC4Mw{p+Iv@DUYjU4QGdZIy zxhBrM_pI+eP~w(#V1U=M;Q7D?h?~m^0IL~d8Z$vgK<##^jOID*c^(F1@r&DN2~x5l zE0}gVj{Xj+%8+!uw`iG@8#DI=Uw*~~3bx&bMX?p(D}pX}wz>Gz;hHe%n5SR4=mK6g zLpn-4K+)mLksX#R#>@)A9Gy-xFm!czLfbp0FAdFNP?os^xGiI{SCxV9 zK0B-vJFnfRJ(`vmbyxwj03|u5fD5uZyP+`Qmr@#Qq;D3&3zW$XaH)(d9p~?a zs^S9Ly!P;PC^QD+1K10+t?TN+S(#cG#&-5E}uY?kEVrE=qXz2U;c2Xbo)RU zsT^lA&@Dckg^@$EZ`+20>u{d#X-6Ypxe98nIaqsDWE7n;6;KM!XaP7kaPobTI#12o zOZC*TfgB9%trHEk9B3-y{CnrPcwS)dx@cH%pY9CkdACZCo_Xd;BmM5Z<0MT3VSYjpOe?Mpc|vV`%sWJ2iE*U3_4nxa-CPtedrRjtV1A-UKs2lcX0yDj2on(zfeb1YuHlTv|F5(w@rvub?!zVo5<(LD4nhbR zfdEPD8erIWkU)SIkcMFx5X+2a03nIRX)3$1>o~USG;WmR)aNv568pr7Y#+5wlXE0* zYGT>)7N>UXle(_clXUwJ`un~6&10AuFmZ?9z2E)5_uhBE?|%2*_h#X}(YaRbgYr&} zkNLpueH&f1TnUws79MJ_@%O$!urUOMtQHNXl| zKE0xER6Sbre*Fz;yP)i^V!7m%8+L4B4Y}h?W9I4y~hhVon8aKTk&!MCelA zF15KnQg7R-EKOx^J*$>S`z>hd5i}hH?HiN5tC@Ma6ZQ<2lu5&yUrwRn!)K(`FwS|G z576gyC`aNE;nGM^83EFm@^y$cvRybk)^QRN)13~_|GUf;qp3Nouc=5jsnwUtkQ99? zEOJp*ZaQ}E_RR`ZKmXZRKL7cnw19w{xf?)l)X}jMVxCERkbP2kAx(UQ%MTP3stK5+ zo-~iL55x|7L6abFs1;zerKzBfwlW}hf!LY@0-V*io)amXKw{jqEP(-4IpcKgq22A|pjZ%4Kd^i6(KGEMnQuOd8bdpE z8Y~Xfe|6m=D-U)u^KXQ0vcb;4s{H7h5e0p$DEpJgP=qru+q)NoF9$(TLC$>y+vjgT zb3*$K-I6hxQ)3#^!P(PA29|e6m5#jn!003=`t}o}%FW(-K)a8PzCULGT-F;PoR!Lc zm2j$(kD_6pT0F{t+UA5f16mjJt!PLB3Fusce(llakWWZ`F@i4Jk)&2RL;1NGjr7C+ zc;WFRS2-7a1q5VC;Yd0sf^ZrMcO4t%(bPLZ?bR#!%*!9$ z4+d};N`>}pm&LUR%Fe&a-nj?et_37G9DYen2K5AKi!P2Ta+N~9Ds^zGWs86-a*=Ca zPfG#H;8Fo+T#Sv-wjI*ed-rj6UcLx+YPYn3b0)wj=%a_qhpN_AQQPtJ7k=9O*|(p) z^JB&!P*@_R@Cp^{JyN}TrOyT_D)BOh*S#RE7AcsIEp$uvt8z$Kl$sIOAJ`thw}H+& z#sEIvDUI4=5H40}KWL3ir2=bC!I3q?qG5PB(XFBkwHOeGy9^Sn*lHmp9ZpF(CJk!! zouB>ir!~`zQ=s^_KLEcV6>#%N7&u)vaz4RvT-uwY@a9g#?H|U{Lp_&O4l2L2UFFb1 zRC->%!SO0_eQS8$UOwhC>q{*w2OLyORqdE!lcT*49R38XUm~h z9q_2-MF7ysiCrC_`%Ed9Z8D*vf{zz$2N)i`AQLx4Oo8>>yPuBW0u6&|>C81;l~psC z;PTaq`ABM^d5l~J9Sk)iNQEnPsnM#HE#y#CTBB7sjB!wR4H!VTyBgaxaP$asNxU=) zk4C{=NxQni=u!8c0n?#Yds-TJF~J1@cDQ)}aO*o#4%6E>ejmiB1RNY1>A4FabAmmC zVbNo`z(X<@j)iei&VT^=V-Dvsv`-qqDQ!Q#W2$9O504lE*|m4@PWI*v&Rfl0nhymS z)#4nsF=>bT$%n0iNVQBDfYOPX6Xg|<%hs>INts)tFlreY6j3+B1eTQ$aoUu7k270 z11wK!F;X1ro%qe)PIGz6Ln6SL63)A5S%F&nSD(^bL|C@(?|A=a30KJ*%ifhkM^JlB zy97>x6a?aeat8F~Js>9MED*q^?V!6)YtIveG#WY&PRC5=XgPR6!J&iPdk|C~+EtuQ z&(D=j`=|lvH>q`5x9;qJxe6?PiFTdZLl4*q(osA@S1Q-*A{3$c^r4#!o^yK*=LS&n z^q*|z&a4T#s4VKDUe|>)k;!lT47CzBSoT5M1-SEfQVOSzkS5wY&AT}gm2qav*@VId zeFMFdje?L}QgRu?wI?(~NDkQ{tvWwhtlZ@7$I#Z%HSR)@ud*23A_a83n5}@ZKcmKq zQu_{q=TFWn6a?gO9<3tN&9xhZpgbi_dr@#rbi}ITy3oSx+`#dl1*J2+rh|$rEY!Yo zXi6=Ik!uCyH!OFIT1!xNC4ps@_f<$6=YHbu zgG*PXO3P$__@Y$6XSJKcNVRli3POhiES}-Ex2M{qa?VTv>L)GYXwceBI%Ny^ER#5=p`((AwUpC0sNssy-hK(C3uIXM{SW@C z5yE>nnyhqZ&IGW5E~kOfptT_Fe_c_k>U-BOo@ST>K}+=wN? zYb_6$YK~&V?pj({`4Mv+9fecw0UZeo2L~#6tZ_egE6Ql00|PX(5!44#X^+#n^?33M z3idM#0umyZ?tBZSI-jK`n7C%eAPXak!-yO_$#`TNpml(fzBky(F|?k3^P4EDuF#rJ zGJ%>ChXHWS(mH6{q-EvJacXL4`@_v2f^P!}XzlkOqnT({U_s5|@bU?!GC>9kYh~X6 z3Qmc(CAHoC&ZO%g1VKoplnhVytHTb71_C1WMhGf;PD4yr)A{fL*&(?nx*k&3R9o(= z-)(_ZBkh^YP_ZVka!yn*Xu9N>cciwC5aY!Bw##`8jYb|_~oQ<{2B|8w)H z8|{qNb`afJ84{ANApY^1R9OaI-Q2nx(JpR(@1#_UC_z2nQO>r14V$x zumgZALu&w8pl%V3D2xaCr2=l61DjZ@ugaEl49s4d!vxBe#vv)dgF!_g<{_m6QbaSD z;O>)Bayb)YwOdH7)vzL|a+Ty}5R0YNyx0d-( z>8{$Za^A0=Koxl92G}C=qyl|@oNr;;+9KJvTk-+%-#@_`zr7LJXn zDT;19#RQlJVxr1r6qH>717d0TT`g?SmliV$T5`Cc`i!*ng;Y~NK&OcZxe`p%6*Z@n zkw3W)O)*^45fD)Mn+L%oq|)8VXayFm)cMA<2kH|0K6(IR3h3>>v4^wsR?xu0pjBCN zC)XLMEC-{L4T0ic`4;%6&;2!RuB@DyPt(5sC|Cigt%AdFgMj0p*0!C+GzYL>dkUf2 z#%KfB_4#x35aY;k?fFxyQ4!oq@cGn%AbIOo1<0K4`0QSdxzZOukG8kr_F@Xzk2qp+K!N*%<)&YX*9Q2zJd-&8?D zg988h^9REt_j1#;bCC7~?z|{vK%Pgh0xTs`I>WLV$ablL7c>-c=sGHmoML3hqW0iq zX+9Z-l1tnUO7lE;sOl0Id>*9I)vyJ!k>17N(UAp-eU4Rw%~pV2;A}?e0delLBf}`C zO2<#;prnEr5S4Kq20(_e-(Euz3j$07bPyfsB1K+6S#6w*H(fcfC`~(23?!t2AOG~5 z-FQ^N+_nef;b~4le zCOx203VMKwI8Ncs7md=Mh$2~ggCq466r8Z2Yb1;A%oq_ITnL6Rsn?Gel%LZp-ooi^ zaVy^SVN~AxrL}Qd)M-5dQ(!U`e+8o3Cc?~)g3^&Hp#=N z@v=mz8c}v+SklJ5q&_e~rm3WnegtIw+t+>|QrkF69{=%Aq#+}9Rs?V^W9eWX-3bWi z6izhKFQ@^aW%ki=FMtvcb9vuXKD+4R31F%w3LMCiV&D)bG7O@_0xeR!qm(x?inuO7 z1?PS_;)K+M``o?zEJs$qggb%lzsNu z+zO&?RCrZF1UPnjLJ^1|2ArvjPq{q(?>~8>MY(1+%*C33}?Gxz@Q*ROp&l^(q2-?gZ{{})x- z?^upO{+B-=U2T8wVMq}P>=yXoL8do4@rY676v%0jpS*w~YKXZJNahsP5s)T}(@R!S zPATtP-Gz#?0t~pMeUl2IqQBUVqBc2+fn)*Q{WchvT8BxO8Y07Jq!@SF4ixbqx&T|2 zBEUPUNJ5TF7K^Sig<0-_@L?2-PsURA8P-Uc`b}q@p+Sx4QXeDiXfk_y+ z_gs_+obZH*QTBJAgfzQb`FE)_52HBL3>N$DW8gd>Tn(I7;Rx<>aLFKJ3>fz)qQOtv zBib3KR?se6+(B*t4l>QrD?>s1onYQ5(MHFng`cRQ3Clq(GD#@ zEhr9-9s|k%*#0$^rM%;l$%QXKXlS6wab_dua+mCqconA&~~d_U$;xtR3#@CPJ%`?Pj!U8@rnN z&4q2<%|*Tka)oP5b=aA=PlyG1UNT<%zpp_*xXaw#*4)(Bf2gb3w;vwm831n1qFyop z^n|*@W%tw0-8@I(0p#lCdz9E@(}TH0^4j3wOD>BOXJx-mFt(g`z6XxfmW0!Kk*6P& zVu3Vl;n>wEJRQ|L9CPkD^x9>aoW&D4cy8ZcB4>AB<4gw8|1$7KZ9kT*&`(7+6mL;Q zU|_>X@;0Ivi8;&cJp<$JR1lSHh>F;td9)XC^2`|3Nebu$ibBlqhFN zZrDG%Nd!rU;QRbkB*WnXsA%(eaNw>hwabVB#29+Vj{yAp4J{4a@2q>yGCjRf`0@0` zi@YV+JqfGqZ*^=mZQ3&)22BkO6E^Eq;K8E{fEP~y&H{DNlIdp{OWkH_Hte|yeL67u zqey@}k9uCBt>I+APCFg;4L#8@o3sZ92N?|KkvVxsX3tBy1Ro68X)n&$X1CimGdhiI z-RZDerW=ulT$7{obCZq@d?u}3dW}c+JA*XAUw3$3y1r9itZzg6sH;-+g`ir3=NEgr zM=2UkS_1a(d(GWynZ*@~dXMRw?9h`5#7kZ*MlELJ?@G4ufO=G1;Z5xLqN+(#4%0}5Bjx!`<^1GkDw-B;)_MIQ|i_$;=&vGvPDoUNJ175B9cFl3Z zEZQqyl`NnRNOAjhy7A@NW?e_?UCV{a7&`XKHMq76bcuoy@M82B2H1xn@;{Scqkl){ zQC^@}=QjQr!gr*<{wg{GhU9dQigPIML&LW^-=rnW9H{5|r7Y%zvS6OPi_k`4q=@E`8&CQxS|LZQm$Q zEN|Am_eb=;eWT<5eDKHM;*;S1p~ch0X8mj532b zxE^kvbh+pH=10|HZI}R))F(DrkpoCeNBn&5Pg5&qbZ@9mdIJv?Dp|&xPl9O%U@p?+6E22 z&uRDQ*Of!qg8t2(-tMb5@KX=Jq~cAUh3Km{&;!K2q*n1LbHK-n`KpBhb3i`N-uZti zM*Q$>v)O4e;BzY0E9HrQ3rj0=l~m#Nq{#r&M1MdNNc(y>`ih);+ zALs%6It!WI^W*3(Y0ymO|C4Fo8St&P?|0!}uK&$Wzy4qTtk=P}PJX_J>!GcFA>=zN zUP$Dj$Yz_))0uY}g5Mg!al&B@0o>uO9Tv gYks=QWEc38&)$wOTwNIqW%$EUc$?j=9c(cCA8JKBL;wH) literal 0 HcmV?d00001 diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/gradle/wrapper/gradle-wrapper.properties b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 000000000000..94920145f34e --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,5 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-6.0.1-bin.zip +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/gradlew b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/gradlew new file mode 100644 index 000000000000..2fe81a7d95e4 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/gradlew @@ -0,0 +1,183 @@ +#!/usr/bin/env sh + +# +# Copyright 2015 the original author or authors. +# +# 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. +# + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn () { + echo "$*" +} + +die () { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; + NONSTOP* ) + nonstop=true + ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin or MSYS, switch paths to Windows format before running java +if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + JAVACMD=`cygpath --unix "$JAVACMD"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=`expr $i + 1` + done + case $i in + 0) set -- ;; + 1) set -- "$args0" ;; + 2) set -- "$args0" "$args1" ;; + 3) set -- "$args0" "$args1" "$args2" ;; + 4) set -- "$args0" "$args1" "$args2" "$args3" ;; + 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Escape application args +save () { + for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done + echo " " +} +APP_ARGS=`save "$@"` + +# Collect all arguments for the java command, following the shell quoting and substitution rules +eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" + +exec "$JAVACMD" "$@" diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/gradlew.bat b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/gradlew.bat new file mode 100644 index 000000000000..9618d8d9607c --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/gradlew.bat @@ -0,0 +1,100 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windows variants + +if not "%OS%" == "Windows_NT" goto win9xME_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/pom.xml b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/pom.xml new file mode 100644 index 000000000000..cf079d9b9cc1 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/pom.xml @@ -0,0 +1,302 @@ + + 4.0.0 + org.openapitools + petstore-openapi3-jersey2-java8-special-characters + jar + petstore-openapi3-jersey2-java8-special-characters + 1.0.0 + https://github.com/openapitools/openapi-generator + OpenAPI Java + + scm:git:git@github.com:openapitools/openapi-generator.git + scm:git:git@github.com:openapitools/openapi-generator.git + https://github.com/openapitools/openapi-generator + + + + + Unlicense + http://unlicense.org + repo + + + + + + OpenAPI-Generator Contributors + team@openapitools.org + OpenAPITools.org + http://openapitools.org + + + + + + + org.apache.maven.plugins + maven-enforcer-plugin + 3.0.0-M1 + + + enforce-maven + + enforce + + + + + 2.2.0 + + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + 3.0.0-M4 + + + + loggerPath + conf/log4j.properties + + + -Xms512m -Xmx1500m + methods + 10 + false + + + + maven-dependency-plugin + + + package + + copy-dependencies + + + ${project.build.directory}/lib + + + + + + + + org.apache.maven.plugins + maven-jar-plugin + 2.6 + + + + jar + test-jar + + + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 1.10 + + + add_sources + generate-sources + + add-source + + + + src/main/java + + + + + add_test_sources + generate-test-sources + + add-test-source + + + + src/test/java + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + 1.8 + 1.8 + true + 128m + 512m + + -Xlint:all + -J-Xss4m + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.1.1 + + + attach-javadocs + + jar + + + + + none + 1.8 + + + http.response.details + a + Http Response Details: + + + + + + org.apache.maven.plugins + maven-source-plugin + 2.2.1 + + + attach-sources + + jar-no-fork + + + + + + + + + + sign-artifacts + + + + org.apache.maven.plugins + maven-gpg-plugin + 1.5 + + + sign-artifacts + verify + + sign + + + + + + + + + + + + io.swagger + swagger-annotations + ${swagger-annotations-version} + + + + + com.google.code.findbugs + jsr305 + 3.0.2 + + + + + org.glassfish.jersey.core + jersey-client + ${jersey-version} + + + org.glassfish.jersey.inject + jersey-hk2 + ${jersey-version} + + + org.glassfish.jersey.media + jersey-media-multipart + ${jersey-version} + + + org.glassfish.jersey.media + jersey-media-json-jackson + ${jersey-version} + + + + + com.fasterxml.jackson.core + jackson-core + ${jackson-version} + + + com.fasterxml.jackson.core + jackson-annotations + ${jackson-version} + + + com.fasterxml.jackson.core + jackson-databind + ${jackson-databind-version} + + + org.openapitools + jackson-databind-nullable + ${jackson-databind-nullable-version} + + + com.fasterxml.jackson.datatype + jackson-datatype-jsr310 + ${jackson-version} + + + javax.annotation + javax.annotation-api + ${javax-annotation-version} + provided + + + + junit + junit + ${junit-version} + test + + + + UTF-8 + 1.6.1 + 2.30.1 + 2.10.4 + 2.10.4 + 0.2.1 + 1.3.2 + 4.13 + + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/settings.gradle b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/settings.gradle new file mode 100644 index 000000000000..322be050f70e --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/settings.gradle @@ -0,0 +1 @@ +rootProject.name = "petstore-openapi3-jersey2-java8-special-characters" \ No newline at end of file diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/AndroidManifest.xml b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/AndroidManifest.xml new file mode 100644 index 000000000000..54fbcb3da1e8 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/AndroidManifest.xml @@ -0,0 +1,3 @@ + + + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/ApiClient.java b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/ApiClient.java new file mode 100644 index 000000000000..ed31d4f37de2 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/ApiClient.java @@ -0,0 +1,1086 @@ +package org.openapitools.client; + +import javax.ws.rs.client.Client; +import javax.ws.rs.client.ClientBuilder; +import javax.ws.rs.client.Entity; +import javax.ws.rs.client.Invocation; +import javax.ws.rs.client.WebTarget; +import javax.ws.rs.core.Form; +import javax.ws.rs.core.GenericType; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.Response.Status; + +import org.glassfish.jersey.client.ClientConfig; +import org.glassfish.jersey.client.ClientProperties; +import org.glassfish.jersey.client.HttpUrlConnectorProvider; +import org.glassfish.jersey.jackson.JacksonFeature; +import org.glassfish.jersey.media.multipart.FormDataBodyPart; +import org.glassfish.jersey.media.multipart.FormDataContentDisposition; +import org.glassfish.jersey.media.multipart.MultiPart; +import org.glassfish.jersey.media.multipart.MultiPartFeature; + +import java.io.IOException; +import java.io.InputStream; + +import java.net.URI; +import javax.net.ssl.SSLContext; +import javax.net.ssl.TrustManager; +import javax.net.ssl.X509TrustManager; +import java.security.cert.X509Certificate; +import java.security.KeyManagementException; +import java.security.NoSuchAlgorithmException; +import java.security.SecureRandom; +import java.nio.file.Files; +import java.nio.file.StandardCopyOption; +import org.glassfish.jersey.logging.LoggingFeature; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.Collection; +import java.util.Collections; +import java.util.Map; +import java.util.Map.Entry; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Arrays; +import java.util.ArrayList; +import java.util.Date; + +import java.net.URLEncoder; + +import java.io.File; +import java.io.UnsupportedEncodingException; + +import java.text.DateFormat; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import org.openapitools.client.auth.Authentication; +import org.openapitools.client.auth.HttpBasicAuth; +import org.openapitools.client.auth.HttpBearerAuth; +import org.openapitools.client.auth.ApiKeyAuth; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ApiClient { + protected Map defaultHeaderMap = new HashMap(); + protected Map defaultCookieMap = new HashMap(); + protected String basePath = "http://localhost"; + protected String userAgent; + private static final Logger log = Logger.getLogger(ApiClient.class.getName()); + + protected List servers = new ArrayList(Arrays.asList( + new ServerConfiguration( + "/", + "No description provided", + new HashMap() + ) + )); + protected Integer serverIndex = 0; + protected Map serverVariables = null; + protected Map> operationServers = new HashMap>() {{ + }}; + protected Map operationServerIndex = new HashMap(); + protected Map> operationServerVariables = new HashMap>(); + protected boolean debugging = false; + protected int connectionTimeout = 0; + private int readTimeout = 0; + + protected Client httpClient; + protected JSON json; + protected String tempFolderPath = null; + + protected Map authentications; + protected Map authenticationLookup; + + protected DateFormat dateFormat; + + /** + * Constructs a new ApiClient with default parameters. + */ + public ApiClient() { + this(null); + } + + /** + * Constructs a new ApiClient with the specified authentication parameters. + * + * @param authMap A hash map containing authentication parameters. + */ + public ApiClient(Map authMap) { + json = new JSON(); + httpClient = buildHttpClient(debugging); + + this.dateFormat = new RFC3339DateFormat(); + + // Set default User-Agent. + setUserAgent("OpenAPI-Generator/1.0.0/java"); + + // Setup authentications (key: authentication name, value: authentication). + authentications = new HashMap(); + Authentication auth = null; + // Prevent the authentications from being modified. + authentications = Collections.unmodifiableMap(authentications); + + // Setup authentication lookup (key: authentication alias, value: authentication name) + authenticationLookup = new HashMap(); + } + + /** + * Gets the JSON instance to do JSON serialization and deserialization. + * + * @return JSON + */ + public JSON getJSON() { + return json; + } + + public Client getHttpClient() { + return httpClient; + } + + public ApiClient setHttpClient(Client httpClient) { + this.httpClient = httpClient; + return this; + } + + /** + * Returns the base URL to the location where the OpenAPI document is being served. + * + * @return The base URL to the target host. + */ + public String getBasePath() { + return basePath; + } + + /** + * Sets the base URL to the location where the OpenAPI document is being served. + * + * @param basePath The base URL to the target host. + */ + public ApiClient setBasePath(String basePath) { + this.basePath = basePath; + return this; + } + + public List getServers() { + return servers; + } + + public ApiClient setServers(List servers) { + this.servers = servers; + updateBasePath(); + return this; + } + + public Integer getServerIndex() { + return serverIndex; + } + + public ApiClient setServerIndex(Integer serverIndex) { + this.serverIndex = serverIndex; + updateBasePath(); + return this; + } + + public Map getServerVariables() { + return serverVariables; + } + + public ApiClient setServerVariables(Map serverVariables) { + this.serverVariables = serverVariables; + updateBasePath(); + return this; + } + + private void updateBasePath() { + if (serverIndex != null) { + setBasePath(servers.get(serverIndex).URL(serverVariables)); + } + } + + /** + * Get authentications (key: authentication name, value: authentication). + * + * @return Map of authentication object + */ + public Map getAuthentications() { + return authentications; + } + + /** + * Get authentication for the given name. + * + * @param authName The authentication name + * @return The authentication, null if not found + */ + public Authentication getAuthentication(String authName) { + return authentications.get(authName); + } + + /** + * Helper method to set username for the first HTTP basic authentication. + * + * @param username Username + */ + public ApiClient setUsername(String username) { + for (Authentication auth : authentications.values()) { + if (auth instanceof HttpBasicAuth) { + ((HttpBasicAuth) auth).setUsername(username); + return this; + } + } + throw new RuntimeException("No HTTP basic authentication configured!"); + } + + /** + * Helper method to set password for the first HTTP basic authentication. + * + * @param password Password + */ + public ApiClient setPassword(String password) { + for (Authentication auth : authentications.values()) { + if (auth instanceof HttpBasicAuth) { + ((HttpBasicAuth) auth).setPassword(password); + return this; + } + } + throw new RuntimeException("No HTTP basic authentication configured!"); + } + + /** + * Helper method to set API key value for the first API key authentication. + * + * @param apiKey API key + */ + public ApiClient setApiKey(String apiKey) { + for (Authentication auth : authentications.values()) { + if (auth instanceof ApiKeyAuth) { + ((ApiKeyAuth) auth).setApiKey(apiKey); + return this; + } + } + throw new RuntimeException("No API key authentication configured!"); + } + + /** + * Helper method to configure authentications which respects aliases of API keys. + * + * @param secrets Hash map from authentication name to its secret. + */ + public ApiClient configureApiKeys(HashMap secrets) { + for (Map.Entry authEntry : authentications.entrySet()) { + Authentication auth = authEntry.getValue(); + if (auth instanceof ApiKeyAuth) { + String name = authEntry.getKey(); + // respect x-auth-id-alias property + name = authenticationLookup.containsKey(name) ? authenticationLookup.get(name) : name; + if (secrets.containsKey(name)) { + ((ApiKeyAuth) auth).setApiKey(secrets.get(name)); + } + } + } + return this; + } + + /** + * Helper method to set API key prefix for the first API key authentication. + * + * @param apiKeyPrefix API key prefix + */ + public ApiClient setApiKeyPrefix(String apiKeyPrefix) { + for (Authentication auth : authentications.values()) { + if (auth instanceof ApiKeyAuth) { + ((ApiKeyAuth) auth).setApiKeyPrefix(apiKeyPrefix); + return this; + } + } + throw new RuntimeException("No API key authentication configured!"); + } + + /** + * Helper method to set bearer token for the first Bearer authentication. + * + * @param bearerToken Bearer token + */ + public ApiClient setBearerToken(String bearerToken) { + for (Authentication auth : authentications.values()) { + if (auth instanceof HttpBearerAuth) { + ((HttpBearerAuth) auth).setBearerToken(bearerToken); + return this; + } + } + throw new RuntimeException("No Bearer authentication configured!"); + } + + + /** + * Set the User-Agent header's value (by adding to the default header map). + * @param userAgent Http user agent + * @return API client + */ + public ApiClient setUserAgent(String userAgent) { + userAgent = userAgent; + addDefaultHeader("User-Agent", userAgent); + return this; + } + + /** + * Get the User-Agent header's value. + * @return User-Agent string + */ + public String getUserAgent(){ + return userAgent; + } + + /** + * Add a default header. + * + * @param key The header's key + * @param value The header's value + * @return API client + */ + public ApiClient addDefaultHeader(String key, String value) { + defaultHeaderMap.put(key, value); + return this; + } + + /** + * Add a default cookie. + * + * @param key The cookie's key + * @param value The cookie's value + * @return API client + */ + public ApiClient addDefaultCookie(String key, String value) { + defaultCookieMap.put(key, value); + return this; + } + + /** + * Check that whether debugging is enabled for this API client. + * @return True if debugging is switched on + */ + public boolean isDebugging() { + return debugging; + } + + /** + * Enable/disable debugging for this API client. + * + * @param debugging To enable (true) or disable (false) debugging + * @return API client + */ + public ApiClient setDebugging(boolean debugging) { + this.debugging = debugging; + // Rebuild HTTP Client according to the new "debugging" value. + this.httpClient = buildHttpClient(debugging); + return this; + } + + /** + * The path of temporary folder used to store downloaded files from endpoints + * with file response. The default value is null, i.e. using + * the system's default tempopary folder. + * + * @return Temp folder path + */ + public String getTempFolderPath() { + return tempFolderPath; + } + + /** + * Set temp folder path + * @param tempFolderPath Temp folder path + * @return API client + */ + public ApiClient setTempFolderPath(String tempFolderPath) { + this.tempFolderPath = tempFolderPath; + return this; + } + + /** + * Connect timeout (in milliseconds). + * @return Connection timeout + */ + public int getConnectTimeout() { + return connectionTimeout; + } + + /** + * Set the connect timeout (in milliseconds). + * A value of 0 means no timeout, otherwise values must be between 1 and + * {@link Integer#MAX_VALUE}. + * @param connectionTimeout Connection timeout in milliseconds + * @return API client + */ + public ApiClient setConnectTimeout(int connectionTimeout) { + this.connectionTimeout = connectionTimeout; + httpClient.property(ClientProperties.CONNECT_TIMEOUT, connectionTimeout); + return this; + } + + /** + * read timeout (in milliseconds). + * @return Read timeout + */ + public int getReadTimeout() { + return readTimeout; + } + + /** + * Set the read timeout (in milliseconds). + * A value of 0 means no timeout, otherwise values must be between 1 and + * {@link Integer#MAX_VALUE}. + * @param readTimeout Read timeout in milliseconds + * @return API client + */ + public ApiClient setReadTimeout(int readTimeout) { + this.readTimeout = readTimeout; + httpClient.property(ClientProperties.READ_TIMEOUT, readTimeout); + return this; + } + + /** + * Get the date format used to parse/format date parameters. + * @return Date format + */ + public DateFormat getDateFormat() { + return dateFormat; + } + + /** + * Set the date format used to parse/format date parameters. + * @param dateFormat Date format + * @return API client + */ + public ApiClient setDateFormat(DateFormat dateFormat) { + this.dateFormat = dateFormat; + // also set the date format for model (de)serialization with Date properties + this.json.setDateFormat((DateFormat) dateFormat.clone()); + return this; + } + + /** + * Parse the given string into Date object. + * @param str String + * @return Date + */ + public Date parseDate(String str) { + try { + return dateFormat.parse(str); + } catch (java.text.ParseException e) { + throw new RuntimeException(e); + } + } + + /** + * Format the given Date object into string. + * @param date Date + * @return Date in string format + */ + public String formatDate(Date date) { + return dateFormat.format(date); + } + + /** + * Format the given parameter object into string. + * @param param Object + * @return Object in string format + */ + public String parameterToString(Object param) { + if (param == null) { + return ""; + } else if (param instanceof Date) { + return formatDate((Date) param); + } else if (param instanceof Collection) { + StringBuilder b = new StringBuilder(); + for(Object o : (Collection)param) { + if(b.length() > 0) { + b.append(','); + } + b.append(String.valueOf(o)); + } + return b.toString(); + } else { + return String.valueOf(param); + } + } + + /* + * Format to {@code Pair} objects. + * @param collectionFormat Collection format + * @param name Name + * @param value Value + * @return List of pairs + */ + public List parameterToPairs(String collectionFormat, String name, Object value){ + List params = new ArrayList(); + + // preconditions + if (name == null || name.isEmpty() || value == null) return params; + + Collection valueCollection; + if (value instanceof Collection) { + valueCollection = (Collection) value; + } else { + params.add(new Pair(name, parameterToString(value))); + return params; + } + + if (valueCollection.isEmpty()){ + return params; + } + + // get the collection format (default: csv) + String format = (collectionFormat == null || collectionFormat.isEmpty() ? "csv" : collectionFormat); + + // create the params based on the collection format + if ("multi".equals(format)) { + for (Object item : valueCollection) { + params.add(new Pair(name, parameterToString(item))); + } + + return params; + } + + String delimiter = ","; + + if ("csv".equals(format)) { + delimiter = ","; + } else if ("ssv".equals(format)) { + delimiter = " "; + } else if ("tsv".equals(format)) { + delimiter = "\t"; + } else if ("pipes".equals(format)) { + delimiter = "|"; + } + + StringBuilder sb = new StringBuilder() ; + for (Object item : valueCollection) { + sb.append(delimiter); + sb.append(parameterToString(item)); + } + + params.add(new Pair(name, sb.substring(1))); + + return params; + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * application/vnd.company+json + * "* / *" is also default to JSON + * @param mime MIME + * @return True if the MIME type is JSON + */ + public boolean isJsonMime(String mime) { + String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"; + return mime != null && (mime.matches(jsonMime) || mime.equals("*/*")); + } + + /** + * Select the Accept header's value from the given accepts array: + * if JSON exists in the given array, use it; + * otherwise use all of them (joining into a string) + * + * @param accepts The accepts array to select from + * @return The Accept header to use. If the given array is empty, + * null will be returned (not to set the Accept header explicitly). + */ + public String selectHeaderAccept(String[] accepts) { + if (accepts.length == 0) { + return null; + } + for (String accept : accepts) { + if (isJsonMime(accept)) { + return accept; + } + } + return StringUtil.join(accepts, ","); + } + + /** + * Select the Content-Type header's value from the given array: + * if JSON exists in the given array, use it; + * otherwise use the first one of the array. + * + * @param contentTypes The Content-Type array to select from + * @return The Content-Type header to use. If the given array is empty, + * JSON will be used. + */ + public String selectHeaderContentType(String[] contentTypes) { + if (contentTypes.length == 0) { + return "application/json"; + } + for (String contentType : contentTypes) { + if (isJsonMime(contentType)) { + return contentType; + } + } + return contentTypes[0]; + } + + /** + * Escape the given string to be used as URL query value. + * @param str String + * @return Escaped string + */ + public String escapeString(String str) { + try { + return URLEncoder.encode(str, "utf8").replaceAll("\\+", "%20"); + } catch (UnsupportedEncodingException e) { + return str; + } + } + + /** + * Serialize the given Java object into string entity according the given + * Content-Type (only JSON is supported for now). + * @param obj Object + * @param formParams Form parameters + * @param contentType Context type + * @return Entity + * @throws ApiException API exception + */ + public Entity serialize(Object obj, Map formParams, String contentType, boolean isBodyNullable) throws ApiException { + Entity entity; + if (contentType.startsWith("multipart/form-data")) { + MultiPart multiPart = new MultiPart(); + for (Entry param: formParams.entrySet()) { + if (param.getValue() instanceof File) { + File file = (File) param.getValue(); + FormDataContentDisposition contentDisp = FormDataContentDisposition.name(param.getKey()) + .fileName(file.getName()).size(file.length()).build(); + multiPart.bodyPart(new FormDataBodyPart(contentDisp, file, MediaType.APPLICATION_OCTET_STREAM_TYPE)); + } else { + FormDataContentDisposition contentDisp = FormDataContentDisposition.name(param.getKey()).build(); + multiPart.bodyPart(new FormDataBodyPart(contentDisp, parameterToString(param.getValue()))); + } + } + entity = Entity.entity(multiPart, MediaType.MULTIPART_FORM_DATA_TYPE); + } else if (contentType.startsWith("application/x-www-form-urlencoded")) { + Form form = new Form(); + for (Entry param: formParams.entrySet()) { + form.param(param.getKey(), parameterToString(param.getValue())); + } + entity = Entity.entity(form, MediaType.APPLICATION_FORM_URLENCODED_TYPE); + } else { + // We let jersey handle the serialization + if (isBodyNullable) { // payload is nullable + entity = Entity.entity(obj == null ? "null" : obj, contentType); + } else { + entity = Entity.entity(obj == null ? "" : obj, contentType); + } + } + return entity; + } + + /** + * Serialize the given Java object into string according the given + * Content-Type (only JSON, HTTP form is supported for now). + * @param obj Object + * @param formParams Form parameters + * @param contentType Context type + * @param isBodyNullable True if the body is nullable + * @return String + * @throws ApiException API exception + */ + public String serializeToString(Object obj, Map formParams, String contentType, boolean isBodyNullable) throws ApiException { + try { + if (contentType.startsWith("multipart/form-data")) { + throw new ApiException("multipart/form-data not yet supported for serializeToString (http signature authentication)"); + } else if (contentType.startsWith("application/x-www-form-urlencoded")) { + String formString = ""; + for (Entry param : formParams.entrySet()) { + formString = param.getKey() + "=" + URLEncoder.encode(parameterToString(param.getValue()), "UTF-8") + "&"; + } + + if (formString.length() == 0) { // empty string + return formString; + } else { + return formString.substring(0, formString.length() - 1); + } + } else { + if (isBodyNullable) { + return obj == null ? "null" : json.getMapper().writeValueAsString(obj); + } else { + return json.getMapper().writeValueAsString(obj); + } + } + } catch (Exception ex) { + throw new ApiException("Failed to perform serializeToString: " + ex.toString()); + } + } + + /** + * Deserialize response body to Java object according to the Content-Type. + * @param Type + * @param response Response + * @param returnType Return type + * @return Deserialize object + * @throws ApiException API exception + */ + @SuppressWarnings("unchecked") + public T deserialize(Response response, GenericType returnType) throws ApiException { + if (response == null || returnType == null) { + return null; + } + + if ("byte[]".equals(returnType.toString())) { + // Handle binary response (byte array). + return (T) response.readEntity(byte[].class); + } else if (returnType.getRawType() == File.class) { + // Handle file downloading. + T file = (T) downloadFileFromResponse(response); + return file; + } + + String contentType = null; + List contentTypes = response.getHeaders().get("Content-Type"); + if (contentTypes != null && !contentTypes.isEmpty()) + contentType = String.valueOf(contentTypes.get(0)); + + // read the entity stream multiple times + response.bufferEntity(); + + return response.readEntity(returnType); + } + + /** + * Download file from the given response. + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(Response response) throws ApiException { + try { + File file = prepareDownloadFile(response); + Files.copy(response.readEntity(InputStream.class), file.toPath(), StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + public File prepareDownloadFile(Response response) throws IOException { + String filename = null; + String contentDisposition = (String) response.getHeaders().getFirst("Content-Disposition"); + if (contentDisposition != null && !"".equals(contentDisposition)) { + // Get filename from the Content-Disposition header. + Pattern pattern = Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + Matcher matcher = pattern.matcher(contentDisposition); + if (matcher.find()) + filename = matcher.group(1); + } + + String prefix; + String suffix = null; + if (filename == null) { + prefix = "download-"; + suffix = ""; + } else { + int pos = filename.lastIndexOf('.'); + if (pos == -1) { + prefix = filename + "-"; + } else { + prefix = filename.substring(0, pos) + "-"; + suffix = filename.substring(pos); + } + // File.createTempFile requires the prefix to be at least three characters long + if (prefix.length() < 3) + prefix = "download-"; + } + + if (tempFolderPath == null) + return File.createTempFile(prefix, suffix); + else + return File.createTempFile(prefix, suffix, new File(tempFolderPath)); + } + + /** + * Invoke API by sending HTTP request with the given options. + * + * @param Type + * @param operation The qualified name of the operation + * @param path The sub-path of the HTTP URL + * @param method The request method, one of "GET", "POST", "PUT", "HEAD" and "DELETE" + * @param queryParams The query parameters + * @param body The request body object + * @param headerParams The header parameters + * @param cookieParams The cookie parameters + * @param formParams The form parameters + * @param accept The request's Accept header + * @param contentType The request's Content-Type header + * @param authNames The authentications to apply + * @param returnType The return type into which to deserialize the response + * @param isBodyNullable True if the body is nullable + * @return The response body in type of string + * @throws ApiException API exception + */ + public ApiResponse invokeAPI( + String operation, + String path, + String method, + List queryParams, + Object body, + Map headerParams, + Map cookieParams, + Map formParams, + String accept, + String contentType, + String[] authNames, + GenericType returnType, + boolean isBodyNullable) + throws ApiException { + + // Not using `.target(targetURL).path(path)` below, + // to support (constant) query string in `path`, e.g. "/posts?draft=1" + String targetURL; + if (serverIndex != null && operationServers.containsKey(operation)) { + Integer index = operationServerIndex.containsKey(operation) ? operationServerIndex.get(operation) : serverIndex; + Map variables = operationServerVariables.containsKey(operation) ? + operationServerVariables.get(operation) : serverVariables; + List serverConfigurations = operationServers.get(operation); + if (index < 0 || index >= serverConfigurations.size()) { + throw new ArrayIndexOutOfBoundsException( + String.format( + "Invalid index %d when selecting the host settings. Must be less than %d", + index, serverConfigurations.size())); + } + targetURL = serverConfigurations.get(index).URL(variables) + path; + } else { + targetURL = this.basePath + path; + } + WebTarget target = httpClient.target(targetURL); + + if (queryParams != null) { + for (Pair queryParam : queryParams) { + if (queryParam.getValue() != null) { + target = target.queryParam(queryParam.getName(), escapeString(queryParam.getValue())); + } + } + } + + Invocation.Builder invocationBuilder = target.request().accept(accept); + + for (Entry entry : cookieParams.entrySet()) { + String value = entry.getValue(); + if (value != null) { + invocationBuilder = invocationBuilder.cookie(entry.getKey(), value); + } + } + + for (Entry entry : defaultCookieMap.entrySet()) { + String value = entry.getValue(); + if (value != null) { + invocationBuilder = invocationBuilder.cookie(entry.getKey(), value); + } + } + + Entity entity = serialize(body, formParams, contentType, isBodyNullable); + + // put all headers in one place + Map allHeaderParams = new HashMap<>(defaultHeaderMap); + allHeaderParams.putAll(headerParams); + + // update different parameters (e.g. headers) for authentication + updateParamsForAuth( + authNames, + queryParams, + allHeaderParams, + cookieParams, + serializeToString(body, formParams, contentType, isBodyNullable), + method, + target.getUri()); + + for (Entry entry : allHeaderParams.entrySet()) { + String value = entry.getValue(); + if (value != null) { + invocationBuilder = invocationBuilder.header(entry.getKey(), value); + } + } + + Response response = null; + + try { + response = sendRequest(method, invocationBuilder, entity); + + int statusCode = response.getStatusInfo().getStatusCode(); + Map> responseHeaders = buildResponseHeaders(response); + + if (response.getStatusInfo() == Status.NO_CONTENT) { + return new ApiResponse(statusCode, responseHeaders); + } else if (response.getStatusInfo().getFamily() == Status.Family.SUCCESSFUL) { + if (returnType == null) { + return new ApiResponse(statusCode, responseHeaders); + } else { + return new ApiResponse(statusCode, responseHeaders, deserialize(response, returnType)); + } + } else { + String message = "error"; + String respBody = null; + if (response.hasEntity()) { + try { + respBody = String.valueOf(response.readEntity(String.class)); + message = respBody; + } catch (RuntimeException e) { + // e.printStackTrace(); + } + } + throw new ApiException( + response.getStatus(), message, buildResponseHeaders(response), respBody); + } + } finally { + try { + response.close(); + } catch (Exception e) { + // it's not critical, since the response object is local in method invokeAPI; that's fine, + // just continue + } + } + } + + private Response sendRequest(String method, Invocation.Builder invocationBuilder, Entity entity) { + Response response; + if ("POST".equals(method)) { + response = invocationBuilder.post(entity); + } else if ("PUT".equals(method)) { + response = invocationBuilder.put(entity); + } else if ("DELETE".equals(method)) { + response = invocationBuilder.method("DELETE", entity); + } else if ("PATCH".equals(method)) { + response = invocationBuilder.method("PATCH", entity); + } else { + response = invocationBuilder.method(method); + } + return response; + } + + /** + * @deprecated Add qualified name of the operation as a first parameter. + */ + @Deprecated + public ApiResponse invokeAPI(String path, String method, List queryParams, Object body, Map headerParams, Map cookieParams, Map formParams, String accept, String contentType, String[] authNames, GenericType returnType, boolean isBodyNullable) throws ApiException { + return invokeAPI(null, path, method, queryParams, body, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType, isBodyNullable); + } + + /** + * Build the Client used to make HTTP requests. + * @param debugging Debug setting + * @return Client + */ + protected Client buildHttpClient(boolean debugging) { + final ClientConfig clientConfig = new ClientConfig(); + clientConfig.register(MultiPartFeature.class); + clientConfig.register(json); + clientConfig.register(JacksonFeature.class); + clientConfig.property(HttpUrlConnectorProvider.SET_METHOD_WORKAROUND, true); + // turn off compliance validation to be able to send payloads with DELETE calls + clientConfig.property(ClientProperties.SUPPRESS_HTTP_COMPLIANCE_VALIDATION, true); + if (debugging) { + clientConfig.register(new LoggingFeature(java.util.logging.Logger.getLogger(LoggingFeature.DEFAULT_LOGGER_NAME), java.util.logging.Level.INFO, LoggingFeature.Verbosity.PAYLOAD_ANY, 1024*50 /* Log payloads up to 50K */)); + clientConfig.property(LoggingFeature.LOGGING_FEATURE_VERBOSITY, LoggingFeature.Verbosity.PAYLOAD_ANY); + // Set logger to ALL + java.util.logging.Logger.getLogger(LoggingFeature.DEFAULT_LOGGER_NAME).setLevel(java.util.logging.Level.ALL); + } else { + // suppress warnings for payloads with DELETE calls: + java.util.logging.Logger.getLogger("org.glassfish.jersey.client").setLevel(java.util.logging.Level.SEVERE); + } + performAdditionalClientConfiguration(clientConfig); + ClientBuilder clientBuilder = ClientBuilder.newBuilder(); + customizeClientBuilder(clientBuilder); + clientBuilder = clientBuilder.withConfig(clientConfig); + return clientBuilder.build(); + } + + /** + * Perform additional configuration of the API client. + * This method can be overriden to customize the API client. + */ + protected void performAdditionalClientConfiguration(ClientConfig clientConfig) { + // No-op extension point + } + + /** + * Customize the client builder. + * + * This method can be overriden to customize the API client. For example, this can be used to: + * 1. Set the hostname verifier to be used by the client to verify the endpoint's hostname + * against its identification information. + * 2. Set the client-side key store. + * 3. Set the SSL context that will be used when creating secured transport connections to + * server endpoints from web targets created by the client instance that is using this SSL context. + * 4. Set the client-side trust store. + * + * To completely disable certificate validation (at your own risk), you can + * override this method and invoke disableCertificateValidation(clientBuilder). + */ + protected void customizeClientBuilder(ClientBuilder clientBuilder) { + // No-op extension point + } + + /** + * Disable X.509 certificate validation in TLS connections. + * + * Please note that trusting all certificates is extremely risky. + * This may be useful in a development environment with self-signed certificates. + */ + protected void disableCertificateValidation(ClientBuilder clientBuilder) throws KeyManagementException, NoSuchAlgorithmException { + TrustManager[] trustAllCerts = new X509TrustManager[] { + new X509TrustManager() { + @Override + public X509Certificate[] getAcceptedIssuers() { + return null; + } + @Override + public void checkClientTrusted(X509Certificate[] certs, String authType) { + } + @Override + public void checkServerTrusted(X509Certificate[] certs, String authType) { + } + } + }; + SSLContext sslContext = SSLContext.getInstance("TLS"); + sslContext.init(null, trustAllCerts, new SecureRandom()); + clientBuilder.sslContext(sslContext); + } + + protected Map> buildResponseHeaders(Response response) { + Map> responseHeaders = new HashMap>(); + for (Entry> entry: response.getHeaders().entrySet()) { + List values = entry.getValue(); + List headers = new ArrayList(); + for (Object o : values) { + headers.add(String.valueOf(o)); + } + responseHeaders.put(entry.getKey(), headers); + } + return responseHeaders; + } + + /** + * Update query and header parameters based on authentication settings. + * + * @param authNames The authentications to apply + * @param queryParams List of query parameters + * @param headerParams Map of header parameters + * @param cookieParams Map of cookie parameters + * @param method HTTP method (e.g. POST) + * @param uri HTTP URI + */ + protected void updateParamsForAuth(String[] authNames, List queryParams, Map headerParams, + Map cookieParams, String payload, String method, URI uri) throws ApiException { + for (String authName : authNames) { + Authentication auth = authentications.get(authName); + if (auth == null) { + continue; + } + auth.applyToParams(queryParams, headerParams, cookieParams, payload, method, uri); + } + } +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/ApiException.java b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/ApiException.java new file mode 100644 index 000000000000..b7060042a5d8 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/ApiException.java @@ -0,0 +1,94 @@ +/* + * test + * test + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import java.util.Map; +import java.util.List; + +/** + * API Exception + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ApiException extends Exception { + private int code = 0; + private Map> responseHeaders = null; + private String responseBody = null; + + public ApiException() {} + + public ApiException(Throwable throwable) { + super(throwable); + } + + public ApiException(String message) { + super(message); + } + + public ApiException(String message, Throwable throwable, int code, Map> responseHeaders, String responseBody) { + super(message, throwable); + this.code = code; + this.responseHeaders = responseHeaders; + this.responseBody = responseBody; + } + + public ApiException(String message, int code, Map> responseHeaders, String responseBody) { + this(message, (Throwable) null, code, responseHeaders, responseBody); + } + + public ApiException(String message, Throwable throwable, int code, Map> responseHeaders) { + this(message, throwable, code, responseHeaders, null); + } + + public ApiException(int code, Map> responseHeaders, String responseBody) { + this((String) null, (Throwable) null, code, responseHeaders, responseBody); + } + + public ApiException(int code, String message) { + super(message); + this.code = code; + } + + public ApiException(int code, String message, Map> responseHeaders, String responseBody) { + this(code, message); + this.responseHeaders = responseHeaders; + this.responseBody = responseBody; + } + + /** + * Get the HTTP status code. + * + * @return HTTP status code + */ + public int getCode() { + return code; + } + + /** + * Get the HTTP response headers. + * + * @return A map of list of string + */ + public Map> getResponseHeaders() { + return responseHeaders; + } + + /** + * Get the HTTP response body. + * + * @return Response body in the form of string + */ + public String getResponseBody() { + return responseBody; + } +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/ApiResponse.java b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/ApiResponse.java new file mode 100644 index 000000000000..8f2168bf3a16 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/ApiResponse.java @@ -0,0 +1,74 @@ +/* + * test + * test + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import java.util.List; +import java.util.Map; + +/** + * API response returned by API call. + * + * @param The type of data that is deserialized from response body + */ +public class ApiResponse { + private final int statusCode; + private final Map> headers; + private final T data; + + /** + * @param statusCode The status code of HTTP response + * @param headers The headers of HTTP response + */ + public ApiResponse(int statusCode, Map> headers) { + this(statusCode, headers, null); + } + + /** + * @param statusCode The status code of HTTP response + * @param headers The headers of HTTP response + * @param data The object deserialized from response bod + */ + public ApiResponse(int statusCode, Map> headers, T data) { + this.statusCode = statusCode; + this.headers = headers; + this.data = data; + } + + /** + * Get the status code + * + * @return status code + */ + public int getStatusCode() { + return statusCode; + } + + /** + * Get the headers + * + * @return map of headers + */ + public Map> getHeaders() { + return headers; + } + + /** + * Get the data + * + * @return data + */ + public T getData() { + return data; + } +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/Configuration.java b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/Configuration.java new file mode 100644 index 000000000000..cae6f51594d8 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/Configuration.java @@ -0,0 +1,39 @@ +/* + * test + * test + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Configuration { + private static ApiClient defaultApiClient = new ApiClient(); + + /** + * Get the default API client, which would be used when creating API + * instances without providing an API client. + * + * @return Default API client + */ + public static ApiClient getDefaultApiClient() { + return defaultApiClient; + } + + /** + * Set the default API client, which would be used when creating API + * instances without providing an API client. + * + * @param apiClient API client + */ + public static void setDefaultApiClient(ApiClient apiClient) { + defaultApiClient = apiClient; + } +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/JSON.java b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/JSON.java new file mode 100644 index 000000000000..9d748f6e7c22 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/JSON.java @@ -0,0 +1,247 @@ +package org.openapitools.client; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.*; +import org.openapitools.jackson.nullable.JsonNullableModule; +import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; +import org.openapitools.client.model.*; + +import java.text.DateFormat; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; +import javax.ws.rs.core.GenericType; +import javax.ws.rs.ext.ContextResolver; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class JSON implements ContextResolver { + private ObjectMapper mapper; + + public JSON() { + mapper = new ObjectMapper(); + mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); + mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, true); + mapper.configure(DeserializationFeature.FAIL_ON_INVALID_SUBTYPE, true); + mapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS); + mapper.enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING); + mapper.enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING); + mapper.setDateFormat(new RFC3339DateFormat()); + mapper.registerModule(new JavaTimeModule()); + JsonNullableModule jnm = new JsonNullableModule(); + mapper.registerModule(jnm); + } + + /** + * Set the date format for JSON (de)serialization with Date properties. + * @param dateFormat Date format + */ + public void setDateFormat(DateFormat dateFormat) { + mapper.setDateFormat(dateFormat); + } + + @Override + public ObjectMapper getContext(Class type) { + return mapper; + } + + /** + * Get the object mapper + * + * @return object mapper + */ + public ObjectMapper getMapper() { return mapper; } + + /** + * Returns the target model class that should be used to deserialize the input data. + * The discriminator mappings are used to determine the target model class. + * + * @param node The input data. + * @param modelClass The class that contains the discriminator mappings. + */ + public static Class getClassForElement(JsonNode node, Class modelClass) { + ClassDiscriminatorMapping cdm = modelDiscriminators.get(modelClass); + if (cdm != null) { + return cdm.getClassForElement(node, new HashSet>()); + } + return null; + } + + /** + * Helper class to register the discriminator mappings. + */ + private static class ClassDiscriminatorMapping { + // The model class name. + Class modelClass; + // The name of the discriminator property. + String discriminatorName; + // The discriminator mappings for a model class. + Map> discriminatorMappings; + + // Constructs a new class discriminator. + ClassDiscriminatorMapping(Class cls, String propertyName, Map> mappings) { + modelClass = cls; + discriminatorName = propertyName; + discriminatorMappings = new HashMap>(); + if (mappings != null) { + discriminatorMappings.putAll(mappings); + } + } + + // Return the name of the discriminator property for this model class. + String getDiscriminatorPropertyName() { + return discriminatorName; + } + + // Return the discriminator value or null if the discriminator is not + // present in the payload. + String getDiscriminatorValue(JsonNode node) { + // Determine the value of the discriminator property in the input data. + if (discriminatorName != null) { + // Get the value of the discriminator property, if present in the input payload. + node = node.get(discriminatorName); + if (node != null && node.isValueNode()) { + String discrValue = node.asText(); + if (discrValue != null) { + return discrValue; + } + } + } + return null; + } + + /** + * Returns the target model class that should be used to deserialize the input data. + * This function can be invoked for anyOf/oneOf composed models with discriminator mappings. + * The discriminator mappings are used to determine the target model class. + * + * @param node The input data. + * @param visitedClasses The set of classes that have already been visited. + */ + Class getClassForElement(JsonNode node, Set> visitedClasses) { + if (visitedClasses.contains(modelClass)) { + // Class has already been visited. + return null; + } + // Determine the value of the discriminator property in the input data. + String discrValue = getDiscriminatorValue(node); + if (discrValue == null) { + return null; + } + Class cls = discriminatorMappings.get(discrValue); + // It may not be sufficient to return this cls directly because that target class + // may itself be a composed schema, possibly with its own discriminator. + visitedClasses.add(modelClass); + for (Class childClass : discriminatorMappings.values()) { + ClassDiscriminatorMapping childCdm = modelDiscriminators.get(childClass); + if (childCdm == null) { + continue; + } + if (!discriminatorName.equals(childCdm.discriminatorName)) { + discrValue = getDiscriminatorValue(node); + if (discrValue == null) { + continue; + } + } + if (childCdm != null) { + // Recursively traverse the discriminator mappings. + Class childDiscr = childCdm.getClassForElement(node, visitedClasses); + if (childDiscr != null) { + return childDiscr; + } + } + } + return cls; + } + } + + /** + * Returns true if inst is an instance of modelClass in the OpenAPI model hierarchy. + * + * The Java class hierarchy is not implemented the same way as the OpenAPI model hierarchy, + * so it's not possible to use the instanceof keyword. + * + * @param modelClass A OpenAPI model class. + * @param inst The instance object. + */ + public static boolean isInstanceOf(Class modelClass, Object inst, Set> visitedClasses) { + if (modelClass.isInstance(inst)) { + // This handles the 'allOf' use case with single parent inheritance. + return true; + } + if (visitedClasses.contains(modelClass)) { + // This is to prevent infinite recursion when the composed schemas have + // a circular dependency. + return false; + } + visitedClasses.add(modelClass); + + // Traverse the oneOf/anyOf composed schemas. + Map descendants = modelDescendants.get(modelClass); + if (descendants != null) { + for (GenericType childType : descendants.values()) { + if (isInstanceOf(childType.getRawType(), inst, visitedClasses)) { + return true; + } + } + } + return false; + } + + /** + * A map of discriminators for all model classes. + */ + private static Map, ClassDiscriminatorMapping> modelDiscriminators = new HashMap, ClassDiscriminatorMapping>(); + + /** + * A map of oneOf/anyOf descendants for each model class. + */ + private static Map, Map> modelDescendants = new HashMap, Map>(); + + /** + * Register a model class discriminator. + * + * @param modelClass the model class + * @param discriminatorPropertyName the name of the discriminator property + * @param mappings a map with the discriminator mappings. + */ + public static void registerDiscriminator(Class modelClass, String discriminatorPropertyName, Map> mappings) { + ClassDiscriminatorMapping m = new ClassDiscriminatorMapping(modelClass, discriminatorPropertyName, mappings); + modelDiscriminators.put(modelClass, m); + } + + /** + * Register the oneOf/anyOf descendants of the modelClass. + * + * @param modelClass the model class + * @param descendants a map of oneOf/anyOf descendants. + */ + public static void registerDescendants(Class modelClass, Map descendants) { + modelDescendants.put(modelClass, descendants); + } + + private static JSON json; + + static + { + json = new JSON(); + } + + /** + * Get the default JSON instance. + * + * @return the default JSON instance + */ + public static JSON getDefault() { + return json; + } + + /** + * Set the default JSON instance. + * + * @param json JSON instance to be used + */ + public static void setDefault(JSON json) { + JSON.json = json; + } +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/Pair.java b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/Pair.java new file mode 100644 index 000000000000..6ee3b9c95a87 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/Pair.java @@ -0,0 +1,61 @@ +/* + * test + * test + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Pair { + private String name = ""; + private String value = ""; + + public Pair (String name, String value) { + setName(name); + setValue(value); + } + + private void setName(String name) { + if (!isValidString(name)) { + return; + } + + this.name = name; + } + + private void setValue(String value) { + if (!isValidString(value)) { + return; + } + + this.value = value; + } + + public String getName() { + return this.name; + } + + public String getValue() { + return this.value; + } + + private boolean isValidString(String arg) { + if (arg == null) { + return false; + } + + if (arg.trim().isEmpty()) { + return false; + } + + return true; + } +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/RFC3339DateFormat.java b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/RFC3339DateFormat.java new file mode 100644 index 000000000000..82a86b83afc1 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/RFC3339DateFormat.java @@ -0,0 +1,32 @@ +/* + * test + * test + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client; + +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 { + + // 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/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/ServerConfiguration.java b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/ServerConfiguration.java new file mode 100644 index 000000000000..a1107a8690e4 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/ServerConfiguration.java @@ -0,0 +1,58 @@ +package org.openapitools.client; + +import java.util.Map; + +/** + * Representing a Server configuration. + */ +public class ServerConfiguration { + public String URL; + public String description; + public Map variables; + + /** + * @param URL A URL to the target host. + * @param description A describtion of the host designated by the URL. + * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. + */ + public ServerConfiguration(String URL, String description, Map variables) { + this.URL = URL; + this.description = description; + this.variables = variables; + } + + /** + * Format URL template using given variables. + * + * @param variables A map between a variable name and its value. + * @return Formatted URL. + */ + public String URL(Map variables) { + String url = this.URL; + + // go through variables and replace placeholders + for (Map.Entry variable: this.variables.entrySet()) { + String name = variable.getKey(); + ServerVariable serverVariable = variable.getValue(); + String value = serverVariable.defaultValue; + + if (variables != null && variables.containsKey(name)) { + value = variables.get(name); + if (serverVariable.enumValues.size() > 0 && !serverVariable.enumValues.contains(value)) { + throw new RuntimeException("The variable " + name + " in the server URL has invalid value " + value + "."); + } + } + url = url.replaceAll("\\{" + name + "\\}", value); + } + return url; + } + + /** + * Format URL template using default server variables. + * + * @return Formatted URL. + */ + public String URL() { + return URL(null); + } +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/ServerVariable.java b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/ServerVariable.java new file mode 100644 index 000000000000..c2f13e216662 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/ServerVariable.java @@ -0,0 +1,23 @@ +package org.openapitools.client; + +import java.util.HashSet; + +/** + * Representing a Server Variable for server URL template substitution. + */ +public class ServerVariable { + public String description; + public String defaultValue; + public HashSet enumValues = null; + + /** + * @param description A description for the server variable. + * @param defaultValue The default value to use for substitution. + * @param enumValues An enumeration of string values to be used if the substitution options are from a limited set. + */ + public ServerVariable(String description, String defaultValue, HashSet enumValues) { + this.description = description; + this.defaultValue = defaultValue; + this.enumValues = enumValues; + } +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/StringUtil.java b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/StringUtil.java new file mode 100644 index 000000000000..2349496800f8 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/StringUtil.java @@ -0,0 +1,83 @@ +/* + * test + * test + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import java.util.Collection; +import java.util.Iterator; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class StringUtil { + /** + * Check if the given array contains the given value (with case-insensitive comparison). + * + * @param array The array + * @param value The value to search + * @return true if the array contains the value + */ + public static boolean containsIgnoreCase(String[] array, String value) { + for (String str : array) { + if (value == null && str == null) { + return true; + } + if (value != null && value.equalsIgnoreCase(str)) { + return true; + } + } + return false; + } + + /** + * Join an array of strings with the given separator. + *

+ * Note: This might be replaced by utility method from commons-lang or guava someday + * if one of those libraries is added as dependency. + *

+ * + * @param array The array of strings + * @param separator The separator + * @return the resulting string + */ + public static String join(String[] array, String separator) { + int len = array.length; + if (len == 0) { + return ""; + } + + StringBuilder out = new StringBuilder(); + out.append(array[0]); + for (int i = 1; i < len; i++) { + out.append(separator).append(array[i]); + } + return out.toString(); + } + + /** + * Join a list of strings with the given separator. + * + * @param list The list of strings + * @param separator The separator + * @return the resulting string + */ + public static String join(Collection list, String separator) { + Iterator iterator = list.iterator(); + StringBuilder out = new StringBuilder(); + if (iterator.hasNext()) { + out.append(iterator.next()); + } + while (iterator.hasNext()) { + out.append(separator).append(iterator.next()); + } + return out.toString(); + } +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/api/DefaultApi.java b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/api/DefaultApi.java new file mode 100644 index 000000000000..0aa6d3c871dd --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/api/DefaultApi.java @@ -0,0 +1,110 @@ +package org.openapitools.client.api; + +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.Pair; + +import javax.ws.rs.core.GenericType; + +import org.openapitools.client.model.MySchemaNameCharacters; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class DefaultApi { + private ApiClient apiClient; + + public DefaultApi() { + this(Configuration.getDefaultApiClient()); + } + + public DefaultApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Get the API cilent + * + * @return API client + */ + public ApiClient getApiClient() { + return apiClient; + } + + /** + * Set the API cilent + * + * @param apiClient an instance of API client + */ + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * + * + * @param mySchemaNameCharacters (optional) + * @return MySchemaNameCharacters + * @throws ApiException if fails to make API call + * @http.response.details + + + +
Status Code Description Response Headers
200 the response -
+ */ + public MySchemaNameCharacters testPost(MySchemaNameCharacters mySchemaNameCharacters) throws ApiException { + return testPostWithHttpInfo(mySchemaNameCharacters).getData(); + } + + /** + * + * + * @param mySchemaNameCharacters (optional) + * @return ApiResponse<MySchemaNameCharacters> + * @throws ApiException if fails to make API call + * @http.response.details + + + +
Status Code Description Response Headers
200 the response -
+ */ + public ApiResponse testPostWithHttpInfo(MySchemaNameCharacters mySchemaNameCharacters) throws ApiException { + Object localVarPostBody = mySchemaNameCharacters; + + // create path and map variables + String localVarPath = "/test"; + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + GenericType localVarReturnType = new GenericType() {}; + + return apiClient.invokeAPI("DefaultApi.testPost", localVarPath, "POST", localVarQueryParams, localVarPostBody, + localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + localVarAuthNames, localVarReturnType, false); + } +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java new file mode 100644 index 000000000000..36e6b69cf442 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java @@ -0,0 +1,79 @@ +/* + * test + * test + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.Pair; +import org.openapitools.client.ApiException; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ApiKeyAuth implements Authentication { + private final String location; + private final String paramName; + + private String apiKey; + private String apiKeyPrefix; + + public ApiKeyAuth(String location, String paramName) { + this.location = location; + this.paramName = paramName; + } + + public String getLocation() { + return location; + } + + public String getParamName() { + return paramName; + } + + public String getApiKey() { + return apiKey; + } + + public void setApiKey(String apiKey) { + this.apiKey = apiKey; + } + + public String getApiKeyPrefix() { + return apiKeyPrefix; + } + + public void setApiKeyPrefix(String apiKeyPrefix) { + this.apiKeyPrefix = apiKeyPrefix; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, String payload, String method, URI uri) throws ApiException { + if (apiKey == null) { + return; + } + String value; + if (apiKeyPrefix != null) { + value = apiKeyPrefix + " " + apiKey; + } else { + value = apiKey; + } + if ("query".equals(location)) { + queryParams.add(new Pair(paramName, value)); + } else if ("header".equals(location)) { + headerParams.put(paramName, value); + } else if ("cookie".equals(location)) { + cookieParams.put(paramName, value); + } + } +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/auth/Authentication.java b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/auth/Authentication.java new file mode 100644 index 000000000000..accc79798b70 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/auth/Authentication.java @@ -0,0 +1,33 @@ +/* + * test + * test + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.Pair; +import org.openapitools.client.ApiException; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +public interface Authentication { + /** + * Apply authentication settings to header and query params. + * + * @param queryParams List of query parameters + * @param headerParams Map of header parameters + * @param cookieParams Map of cookie parameters + */ + void applyToParams(List queryParams, Map headerParams, Map cookieParams, String payload, String method, URI uri) throws ApiException; + +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java new file mode 100644 index 000000000000..7baabf8242a1 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java @@ -0,0 +1,56 @@ +/* + * test + * test + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.Pair; +import org.openapitools.client.ApiException; + +import java.util.Base64; +import java.nio.charset.StandardCharsets; + +import java.net.URI; +import java.util.Map; +import java.util.List; + + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class HttpBasicAuth implements Authentication { + private String username; + private String password; + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, String payload, String method, URI uri) throws ApiException { + if (username == null && password == null) { + return; + } + String str = (username == null ? "" : username) + ":" + (password == null ? "" : password); + headerParams.put("Authorization", "Basic " + Base64.getEncoder().encodeToString(str.getBytes(StandardCharsets.UTF_8))); + } +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java new file mode 100644 index 000000000000..0b8953a74bd3 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java @@ -0,0 +1,62 @@ +/* + * test + * test + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.Pair; +import org.openapitools.client.ApiException; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class HttpBearerAuth implements Authentication { + private final String scheme; + private String bearerToken; + + public HttpBearerAuth(String scheme) { + this.scheme = scheme; + } + + /** + * Gets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @return The bearer token + */ + public String getBearerToken() { + return bearerToken; + } + + /** + * Sets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @param bearerToken The bearer token to send in the Authorization header + */ + public void setBearerToken(String bearerToken) { + this.bearerToken = bearerToken; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, String payload, String method, URI uri) throws ApiException { + if(bearerToken == null) { + return; + } + + headerParams.put("Authorization", (scheme != null ? upperCaseBearer(scheme) + " " : "") + bearerToken); + } + + private static String upperCaseBearer(String scheme) { + return ("bearer".equalsIgnoreCase(scheme)) ? "Bearer" : scheme; + } +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java new file mode 100644 index 000000000000..c8a0f21b8c9e --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java @@ -0,0 +1,149 @@ +/* + * test + * test + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.openapitools.client.ApiException; +import java.util.Objects; +import java.lang.reflect.Type; +import java.util.Map; +import javax.ws.rs.core.GenericType; + +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public abstract class AbstractOpenApiSchema { + + // store the actual instance of the schema/object + private Object instance; + + // is nullable + private Boolean isNullable; + + // schema type (e.g. oneOf, anyOf) + private final String schemaType; + + public AbstractOpenApiSchema(String schemaType, Boolean isNullable) { + this.schemaType = schemaType; + this.isNullable = isNullable; + } + + /** + * Get the list of oneOf/anyOf composed schemas allowed to be stored in this object + * + * @return an instance of the actual schema/object + */ + public abstract Map getSchemas(); + + /** + * Get the actual instance + * + * @return an instance of the actual schema/object + */ + @JsonValue + public Object getActualInstance() {return instance;} + + /** + * Set the actual instance + * + * @param instance the actual instance of the schema/object + */ + public void setActualInstance(Object instance) {this.instance = instance;} + + /** + * Get the instant recursively when the schemas defined in oneOf/anyof happen to be oneOf/anyOf schema as well + * + * @return an instance of the actual schema/object + */ + public Object getActualInstanceRecursively() { + return getActualInstanceRecursively(this); + } + + private Object getActualInstanceRecursively(AbstractOpenApiSchema object) { + if (object.getActualInstance() == null) { + return null; + } else if (object.getActualInstance() instanceof AbstractOpenApiSchema) { + return getActualInstanceRecursively((AbstractOpenApiSchema)object.getActualInstance()); + } else { + return object.getActualInstance(); + } + } + + /** + * Get the schema type (e.g. anyOf, oneOf) + * + * @return the schema type + */ + public String getSchemaType() { + return schemaType; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ").append(getClass()).append(" {\n"); + sb.append(" instance: ").append(toIndentedString(instance)).append("\n"); + sb.append(" isNullable: ").append(toIndentedString(isNullable)).append("\n"); + sb.append(" schemaType: ").append(toIndentedString(schemaType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AbstractOpenApiSchema a = (AbstractOpenApiSchema) o; + return Objects.equals(this.instance, a.instance) && + Objects.equals(this.isNullable, a.isNullable) && + Objects.equals(this.schemaType, a.schemaType); + } + + @Override + public int hashCode() { + return Objects.hash(instance, isNullable, schemaType); + } + + /** + * Is nullalble + * + * @return true if it's nullable + */ + public Boolean isNullable() { + if (Boolean.TRUE.equals(isNullable)) { + return Boolean.TRUE; + } else { + return Boolean.FALSE; + } + } + + + +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/model/ChildSchema.java b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/model/ChildSchema.java new file mode 100644 index 000000000000..1eb1795db4e2 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/model/ChildSchema.java @@ -0,0 +1,167 @@ +/* + * test + * test + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import java.util.Objects; +import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.client.model.ChildSchemaAllOf; +import org.openapitools.client.model.Parent; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.JSON; + + +/** + * A schema that does not have any special character. + */ +@ApiModel(description = "A schema that does not have any special character.") +@JsonPropertyOrder({ + ChildSchema.JSON_PROPERTY_PROP1 +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "objectType", visible = true) + +public class ChildSchema extends Parent { + public static final String JSON_PROPERTY_PROP1 = "prop1"; + private String prop1; + + + public ChildSchema prop1(String prop1) { + this.prop1 = prop1; + return this; + } + + /** + * Get prop1 + * @return prop1 + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PROP1) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getProp1() { + return prop1; + } + + + public void setProp1(String prop1) { + this.prop1 = prop1; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + */ + @JsonAnySetter + public ChildSchema putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** + * Return true if this ChildSchema object is equal to o. + */ + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ChildSchema childSchema = (ChildSchema) o; + return Objects.equals(this.prop1, childSchema.prop1)&& + Objects.equals(this.additionalProperties, childSchema.additionalProperties) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(prop1, super.hashCode(), additionalProperties); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ChildSchema {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" prop1: ").append(toIndentedString(prop1)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap>(); + mappings.put("ChildSchema", ChildSchema.class); + JSON.registerDiscriminator(ChildSchema.class, "objectType", mappings); +} +} + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/model/ChildSchemaAllOf.java b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/model/ChildSchemaAllOf.java new file mode 100644 index 000000000000..253125110495 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/model/ChildSchemaAllOf.java @@ -0,0 +1,109 @@ +/* + * test + * test + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.JSON; + + +/** + * ChildSchemaAllOf + */ +@JsonPropertyOrder({ + ChildSchemaAllOf.JSON_PROPERTY_PROP1 +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ChildSchemaAllOf { + public static final String JSON_PROPERTY_PROP1 = "prop1"; + private String prop1; + + + public ChildSchemaAllOf prop1(String prop1) { + this.prop1 = prop1; + return this; + } + + /** + * Get prop1 + * @return prop1 + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PROP1) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getProp1() { + return prop1; + } + + + public void setProp1(String prop1) { + this.prop1 = prop1; + } + + + /** + * Return true if this ChildSchema_allOf object is equal to o. + */ + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ChildSchemaAllOf childSchemaAllOf = (ChildSchemaAllOf) o; + return Objects.equals(this.prop1, childSchemaAllOf.prop1); + } + + @Override + public int hashCode() { + return Objects.hash(prop1); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ChildSchemaAllOf {\n"); + sb.append(" prop1: ").append(toIndentedString(prop1)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/model/MySchemaNameCharacters.java b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/model/MySchemaNameCharacters.java new file mode 100644 index 000000000000..cb4da0ad0ab5 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/model/MySchemaNameCharacters.java @@ -0,0 +1,168 @@ +/* + * test + * test + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import java.util.Objects; +import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.client.model.MySchemaNameCharactersAllOf; +import org.openapitools.client.model.Parent; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.JSON; + + +/** + * A schema name that has letters, numbers, punctuation and non-ASCII characters. The sanitization rules should make it possible to generate a language-specific classname with allowed characters in that programming language. + */ +@ApiModel(description = "A schema name that has letters, numbers, punctuation and non-ASCII characters. The sanitization rules should make it possible to generate a language-specific classname with allowed characters in that programming language.") +@JsonPropertyOrder({ + MySchemaNameCharacters.JSON_PROPERTY_PROP2 +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "objectType", visible = true) +@JsonTypeName("MySchemaName._-Characters") + +public class MySchemaNameCharacters extends Parent { + public static final String JSON_PROPERTY_PROP2 = "prop2"; + private String prop2; + + + public MySchemaNameCharacters prop2(String prop2) { + this.prop2 = prop2; + return this; + } + + /** + * Get prop2 + * @return prop2 + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PROP2) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getProp2() { + return prop2; + } + + + public void setProp2(String prop2) { + this.prop2 = prop2; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + */ + @JsonAnySetter + public MySchemaNameCharacters putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** + * Return true if this MySchemaName._-Characters object is equal to o. + */ + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MySchemaNameCharacters mySchemaNameCharacters = (MySchemaNameCharacters) o; + return Objects.equals(this.prop2, mySchemaNameCharacters.prop2)&& + Objects.equals(this.additionalProperties, mySchemaNameCharacters.additionalProperties) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(prop2, super.hashCode(), additionalProperties); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MySchemaNameCharacters {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" prop2: ").append(toIndentedString(prop2)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap>(); + mappings.put("MySchemaName._-Characters", MySchemaNameCharacters.class); + JSON.registerDiscriminator(MySchemaNameCharacters.class, "objectType", mappings); +} +} + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/model/MySchemaNameCharactersAllOf.java b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/model/MySchemaNameCharactersAllOf.java new file mode 100644 index 000000000000..8a45f540ef0b --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/model/MySchemaNameCharactersAllOf.java @@ -0,0 +1,109 @@ +/* + * test + * test + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.JSON; + + +/** + * MySchemaNameCharactersAllOf + */ +@JsonPropertyOrder({ + MySchemaNameCharactersAllOf.JSON_PROPERTY_PROP2 +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class MySchemaNameCharactersAllOf { + public static final String JSON_PROPERTY_PROP2 = "prop2"; + private String prop2; + + + public MySchemaNameCharactersAllOf prop2(String prop2) { + this.prop2 = prop2; + return this; + } + + /** + * Get prop2 + * @return prop2 + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PROP2) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getProp2() { + return prop2; + } + + + public void setProp2(String prop2) { + this.prop2 = prop2; + } + + + /** + * Return true if this MySchemaName___Characters_allOf object is equal to o. + */ + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MySchemaNameCharactersAllOf mySchemaNameCharactersAllOf = (MySchemaNameCharactersAllOf) o; + return Objects.equals(this.prop2, mySchemaNameCharactersAllOf.prop2); + } + + @Override + public int hashCode() { + return Objects.hash(prop2); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MySchemaNameCharactersAllOf {\n"); + sb.append(" prop2: ").append(toIndentedString(prop2)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/model/Parent.java b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/model/Parent.java new file mode 100644 index 000000000000..c7de7f7065ba --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/model/Parent.java @@ -0,0 +1,127 @@ +/* + * test + * test + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.client.model.ChildSchema; +import org.openapitools.client.model.MySchemaNameCharacters; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.JSON; + + +/** + * Parent + */ +@JsonPropertyOrder({ + Parent.JSON_PROPERTY_OBJECT_TYPE +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "objectType", visible = true) +@JsonSubTypes({ + @JsonSubTypes.Type(value = ChildSchema.class, name = "ChildSchema"), + @JsonSubTypes.Type(value = MySchemaNameCharacters.class, name = "MySchemaName._-Characters"), +}) + +public class Parent { + public static final String JSON_PROPERTY_OBJECT_TYPE = "objectType"; + private String objectType; + + + public Parent objectType(String objectType) { + this.objectType = objectType; + return this; + } + + /** + * Get objectType + * @return objectType + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_OBJECT_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getObjectType() { + return objectType; + } + + + public void setObjectType(String objectType) { + this.objectType = objectType; + } + + + /** + * Return true if this Parent object is equal to o. + */ + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Parent parent = (Parent) o; + return Objects.equals(this.objectType, parent.objectType); + } + + @Override + public int hashCode() { + return Objects.hash(objectType); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Parent {\n"); + sb.append(" objectType: ").append(toIndentedString(objectType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap>(); + mappings.put("ChildSchema", ChildSchema.class); + mappings.put("MySchemaName._-Characters", MySchemaNameCharacters.class); + mappings.put("Parent", Parent.class); + JSON.registerDiscriminator(Parent.class, "objectType", mappings); +} +} + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/test/java/org/openapitools/client/api/DefaultApiTest.java b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/test/java/org/openapitools/client/api/DefaultApiTest.java new file mode 100644 index 000000000000..51a3dbedfb37 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/test/java/org/openapitools/client/api/DefaultApiTest.java @@ -0,0 +1,51 @@ +/* + * test + * test + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.*; +import org.openapitools.client.auth.*; +import org.openapitools.client.model.MySchemaNameCharacters; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for DefaultApi + */ +public class DefaultApiTest { + + private final DefaultApi api = new DefaultApi(); + + /** + * + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testPostTest() throws ApiException { + //MySchemaNameCharacters mySchemaNameCharacters = null; + //MySchemaNameCharacters response = api.testPost(mySchemaNameCharacters); + // TODO: test validations + } + +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/test/java/org/openapitools/client/model/ChildSchemaAllOfTest.java b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/test/java/org/openapitools/client/model/ChildSchemaAllOfTest.java new file mode 100644 index 000000000000..2e21267fd936 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/test/java/org/openapitools/client/model/ChildSchemaAllOfTest.java @@ -0,0 +1,49 @@ +/* + * test + * test + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ChildSchemaAllOf + */ +public class ChildSchemaAllOfTest { + private final ChildSchemaAllOf model = new ChildSchemaAllOf(); + + /** + * Model tests for ChildSchemaAllOf + */ + @Test + public void testChildSchemaAllOf() { + // TODO: test ChildSchemaAllOf + } + + /** + * Test the property 'prop1' + */ + @Test + public void prop1Test() { + // TODO: test prop1 + } + +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/test/java/org/openapitools/client/model/ChildSchemaTest.java b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/test/java/org/openapitools/client/model/ChildSchemaTest.java new file mode 100644 index 000000000000..ed8952c9c5ce --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/test/java/org/openapitools/client/model/ChildSchemaTest.java @@ -0,0 +1,70 @@ +/* + * test + * test + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.client.JSON; +import org.openapitools.client.model.ChildSchemaAllOf; +import org.openapitools.client.model.Parent; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ChildSchema + */ +public class ChildSchemaTest { + private final ChildSchema model = new ChildSchema(); + + /** + * Model tests for ChildSchema + */ + @Test + public void testChildSchema() { + String objJson = "{ \"objectType\": \"ChildSchema\", \"prop1\":\"some_value\" }"; + try { + JSON j = new JSON(); + ChildSchema obj = j.getMapper().readValue(objJson, ChildSchema.class); + Assert.assertEquals(obj.getObjectType(), "ChildSchema"); + Assert.assertEquals(obj.getProp1(), "some_value"); + } catch (Exception ex) { + Assert.fail("Exception '" + ex.getMessage() + "' should not have been raised"); + } + } + + /** + * Test the property 'objectType' + */ + @Test + public void objectTypeTest() { + // TODO: test objectType + } + + /** + * Test the property 'prop1' + */ + @Test + public void prop1Test() { + // TODO: test prop1 + } + +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/test/java/org/openapitools/client/model/MySchemaNameCharactersAllOfTest.java b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/test/java/org/openapitools/client/model/MySchemaNameCharactersAllOfTest.java new file mode 100644 index 000000000000..47b20942db18 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/test/java/org/openapitools/client/model/MySchemaNameCharactersAllOfTest.java @@ -0,0 +1,49 @@ +/* + * test + * test + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for MySchemaNameCharactersAllOf + */ +public class MySchemaNameCharactersAllOfTest { + private final MySchemaNameCharactersAllOf model = new MySchemaNameCharactersAllOf(); + + /** + * Model tests for MySchemaNameCharactersAllOf + */ + @Test + public void testMySchemaNameCharactersAllOf() { + // TODO: test MySchemaNameCharactersAllOf + } + + /** + * Test the property 'prop2' + */ + @Test + public void prop2Test() { + // TODO: test prop2 + } + +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/test/java/org/openapitools/client/model/MySchemaNameCharactersTest.java b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/test/java/org/openapitools/client/model/MySchemaNameCharactersTest.java new file mode 100644 index 000000000000..481778dbfc56 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/test/java/org/openapitools/client/model/MySchemaNameCharactersTest.java @@ -0,0 +1,70 @@ +/* + * test + * test + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.client.JSON; +import org.openapitools.client.model.MySchemaNameCharactersAllOf; +import org.openapitools.client.model.Parent; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for MySchemaNameCharacters + */ +public class MySchemaNameCharactersTest { + private final MySchemaNameCharacters model = new MySchemaNameCharacters(); + + /** + * Model tests for MySchemaNameCharacters + */ + @Test + public void testMySchemaNameCharacters() { + String objJson = "{ \"objectType\": \"MySchemaName._-Characters\", \"prop2\":\"some_value\" }"; + try { + JSON j = new JSON(); + MySchemaNameCharacters obj = j.getMapper().readValue(objJson, MySchemaNameCharacters.class); + Assert.assertEquals(obj.getObjectType(), "MySchemaName._-Characters"); + Assert.assertEquals(obj.getProp2(), "some_value"); + } catch (Exception ex) { + Assert.fail("Exception '" + ex.getMessage() + "' should not have been raised"); + } + } + + /** + * Test the property 'prop1' + */ + @Test + public void prop1Test() { + // TODO: test prop1 + } + + /** + * Test the property 'prop2' + */ + @Test + public void prop2Test() { + // TODO: test prop2 + } + +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/test/java/org/openapitools/client/model/ParentTest.java b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/test/java/org/openapitools/client/model/ParentTest.java new file mode 100644 index 000000000000..0b4ac9856147 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/test/java/org/openapitools/client/model/ParentTest.java @@ -0,0 +1,51 @@ +/* + * test + * test + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.client.model.MySchemaNameCharacters; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for Parent + */ +public class ParentTest { + private final Parent model = new Parent(); + + /** + * Model tests for Parent + */ + @Test + public void testParent() { + // TODO: test Parent + } + + /** + * Test the property 'prop1' + */ + @Test + public void prop1Test() { + } + +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index 84a9d6915ba0..5708159756ae 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Animal.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Animal.java index 3ba4db8445f1..2ead58d1a5de 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Animal.java @@ -22,6 +22,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Apple.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Apple.java index f3d482ee19ea..9523850019f4 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Apple.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Apple.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AppleReq.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AppleReq.java index 19b48f42441b..8984095a9f61 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AppleReq.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AppleReq.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index ae6c3866e081..df98f6d9a00e 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 5197dda9bc4f..f84a1042728c 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayTest.java index 0d125019fe68..a6160fc1d7d9 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Banana.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Banana.java index a0327d574d9f..076c4351db6c 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Banana.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Banana.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/BananaReq.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/BananaReq.java index 90ec98636024..880ca14507fd 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/BananaReq.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/BananaReq.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/BasquePig.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/BasquePig.java index af7505951619..fce8a214e815 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/BasquePig.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/BasquePig.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Capitalization.java index c87ca1ea948b..3c578c6c08f7 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Capitalization.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Cat.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Cat.java index 226af44187b2..20c698bf2ffe 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Cat.java @@ -26,6 +26,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @@ -43,8 +44,6 @@ }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) -@JsonSubTypes({ -}) public class Cat extends Animal { public static final String JSON_PROPERTY_DECLAWED = "declawed"; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/CatAllOf.java index f3060f5d0e36..05cf8311696c 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Category.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Category.java index de082b6e900f..6dc51b7de425 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Category.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ChildCat.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ChildCat.java index 3331e50125fb..e96b56a28479 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ChildCat.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ChildCat.java @@ -26,6 +26,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @@ -43,8 +44,6 @@ }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "pet_type", visible = true) -@JsonSubTypes({ -}) public class ChildCat extends ParentPet { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ChildCatAllOf.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ChildCatAllOf.java index 14279b43796d..8ad157bf8d82 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ChildCatAllOf.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ChildCatAllOf.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ClassModel.java index ebaa83367832..b826f450f358 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ClassModel.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Client.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Client.java index 1bc59615daea..5b04df578940 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Client.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ComplexQuadrilateral.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ComplexQuadrilateral.java index 01cb6c6a837c..d542235afa39 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ComplexQuadrilateral.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ComplexQuadrilateral.java @@ -24,6 +24,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/DanishPig.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/DanishPig.java index 289134c8f174..de057076db5e 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/DanishPig.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/DanishPig.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Dog.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Dog.java index b41fe77d7d5a..057afa6cec79 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Dog.java @@ -26,6 +26,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @@ -43,8 +44,6 @@ }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) -@JsonSubTypes({ -}) public class Dog extends Animal { public static final String JSON_PROPERTY_BREED = "breed"; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/DogAllOf.java index c8e362e0e9d7..80f35628c1dd 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Drawing.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Drawing.java index e4b5708cb179..eea935b4bc4d 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Drawing.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Drawing.java @@ -24,6 +24,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumArrays.java index 7916b8a9cd7e..a3b60565d4a7 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumTest.java index 631def3aa1a8..4d9cdc15014d 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumTest.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EquilateralTriangle.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EquilateralTriangle.java index a396d5cfd704..ab5a0191e0db 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EquilateralTriangle.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EquilateralTriangle.java @@ -24,6 +24,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index 4680680d6d78..a27fe8ae92fa 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Foo.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Foo.java index 5bf7d18a1f64..c48206afc53f 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Foo.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Foo.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FormatTest.java index 4c9736ee758e..50e5171211ff 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FormatTest.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Fruit.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Fruit.java index 913931949a44..0d482282095d 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Fruit.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Fruit.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FruitReq.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FruitReq.java index 183f0035f9e0..ba0fc1a2bf76 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FruitReq.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FruitReq.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/GmFruit.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/GmFruit.java index dfb38363a244..0710c3deeeaa 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/GmFruit.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/GmFruit.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/GrandparentAnimal.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/GrandparentAnimal.java index ded3b825b138..87dc9d15ec5e 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/GrandparentAnimal.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/GrandparentAnimal.java @@ -22,6 +22,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index b802d5acf615..66a488b96cd9 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/HealthCheckResult.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/HealthCheckResult.java index 274da7a611a8..4b92de2f2a02 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/HealthCheckResult.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/HealthCheckResult.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/InlineObject.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/InlineObject.java index d654560f8d94..d83bc3be2594 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/InlineObject.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/InlineObject.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/InlineObject1.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/InlineObject1.java index ca065161d459..bc8faad9b00d 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/InlineObject1.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/InlineObject1.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/InlineObject2.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/InlineObject2.java index eb33026ba175..07666318a2d0 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/InlineObject2.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/InlineObject2.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/InlineObject3.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/InlineObject3.java index 384e2ffeb7bb..9b6db13b3b58 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/InlineObject3.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/InlineObject3.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/InlineObject4.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/InlineObject4.java index a48edb4f787e..5d6af67b76b2 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/InlineObject4.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/InlineObject4.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/InlineObject5.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/InlineObject5.java index 8e4286c430fa..b2485fd03a25 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/InlineObject5.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/InlineObject5.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/InlineResponseDefault.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/InlineResponseDefault.java index d3ad145c119a..ef9e16e67802 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/InlineResponseDefault.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/InlineResponseDefault.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/IsoscelesTriangle.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/IsoscelesTriangle.java index 82de9e88f44c..7c99885fb949 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/IsoscelesTriangle.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/IsoscelesTriangle.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Mammal.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Mammal.java index 68016799e068..db1f6b9b5e13 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Mammal.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Mammal.java @@ -26,6 +26,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MapTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MapTest.java index d2f49b5bb632..37b6718ed9df 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MapTest.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 3d3037cfb68d..06a59d6d57d6 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Model200Response.java index 7775d5835ca3..555aafad6102 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Model200Response.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelApiResponse.java index da4182452b58..cb1b831fb064 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelReturn.java index ba4143056b7e..48c6d79d1610 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Name.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Name.java index 0dd87332e679..57e7c94cfbac 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Name.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NullableClass.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NullableClass.java index 982e0d5df7e7..2d89741880c9 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NullableClass.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NullableClass.java @@ -24,6 +24,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NullableShape.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NullableShape.java index e34b9618312d..bcc0fc2b1c67 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NullableShape.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NullableShape.java @@ -26,6 +26,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NumberOnly.java index 751777ec56f4..fe4cc261f6de 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Order.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Order.java index 46263dec990d..280b1cf3af74 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Order.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterComposite.java index 93630fda594e..a41bcf1bd49d 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ParentPet.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ParentPet.java index f7df618a065a..4a28d4c01e6a 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ParentPet.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ParentPet.java @@ -26,6 +26,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Pet.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Pet.java index 8e78e031ea37..915359bf6a14 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Pet.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Pig.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Pig.java index 2e22a0cfa6af..a43bf499aac7 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Pig.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Pig.java @@ -26,6 +26,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Quadrilateral.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Quadrilateral.java index 4f6331b8f9d5..16f693339480 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Quadrilateral.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Quadrilateral.java @@ -26,6 +26,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/QuadrilateralInterface.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/QuadrilateralInterface.java index de4eeadca38c..85347af6779e 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/QuadrilateralInterface.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/QuadrilateralInterface.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index ba58c8cb29fe..1f2bbfaaa69b 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ScaleneTriangle.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ScaleneTriangle.java index 7efe8c1e967e..ecb22d4d6ebf 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ScaleneTriangle.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ScaleneTriangle.java @@ -24,6 +24,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Shape.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Shape.java index 7e25253a1228..53fb100975d6 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Shape.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Shape.java @@ -26,6 +26,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ShapeInterface.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ShapeInterface.java index e4463b62545a..e06322956d9f 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ShapeInterface.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ShapeInterface.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ShapeOrNull.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ShapeOrNull.java index cde595039ac8..1a8d3c0a0764 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ShapeOrNull.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ShapeOrNull.java @@ -26,6 +26,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/SimpleQuadrilateral.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/SimpleQuadrilateral.java index dd378b6cf9bc..6963fd1f1720 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/SimpleQuadrilateral.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/SimpleQuadrilateral.java @@ -24,6 +24,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/SpecialModelName.java index 744d18f94ef6..524ef8afcd36 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Tag.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Tag.java index 78b29486f2e7..0c61cd71e549 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Tag.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Triangle.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Triangle.java index 9135fa670e49..ab7f93d1a737 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Triangle.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Triangle.java @@ -26,6 +26,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/TriangleInterface.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/TriangleInterface.java index b2e6b74311cc..ae1376e16036 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/TriangleInterface.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/TriangleInterface.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/User.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/User.java index bdd939b38c21..2b74f3860580 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/User.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/User.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Whale.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Whale.java index e0979080f0b0..e143ed6700ed 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Whale.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Whale.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Zebra.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Zebra.java index 9a062c4c7297..4257aa5faa50 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Zebra.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Zebra.java @@ -24,6 +24,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/JSONTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/JSONTest.java index dda1ef9c1efd..2ce38ae2f69a 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/JSONTest.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/JSONTest.java @@ -1,6 +1,7 @@ package org.openapitools.client; import org.openapitools.client.model.Order; +import org.openapitools.client.model.SpecialModelName; import java.lang.Exception; import java.util.Date; @@ -71,4 +72,19 @@ public void testCustomDate() throws Exception { Order o = json.getContext(null).readValue(str, Order.class); assertEquals(dateStr, dateFormat.format(o.getShipDate())); } + + /** + * Validate a schema with special characters can be deserialized. + */ + @Test + public void testSchemaWithSpecialCharacters() throws Exception { + String str = "{ \"$special[property.name]\": 12345 }"; + // The name of the OpenAPI schema is '_special_model.name_'. + // After sanitization rules are applied the name of the class is 'SpecialModelName'. + // The class deserialization should be successful because + // of the @JsonSubTypes annotation. + SpecialModelName o = json.getContext(null).readValue(str, SpecialModelName.class); + assertNotNull(o); + assertEquals((long)12345, (long)o.get$SpecialPropertyName()); + } } \ No newline at end of file From 44d3f717f81678de809c625fe326cd2d5572a051 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Sat, 18 Jul 2020 22:02:16 +0800 Subject: [PATCH 035/129] update java samples --- .../openapitools/client/model/AdditionalPropertiesAnyType.java | 1 + .../openapitools/client/model/AdditionalPropertiesArray.java | 1 + .../openapitools/client/model/AdditionalPropertiesBoolean.java | 1 + .../openapitools/client/model/AdditionalPropertiesClass.java | 1 + .../openapitools/client/model/AdditionalPropertiesInteger.java | 1 + .../openapitools/client/model/AdditionalPropertiesNumber.java | 1 + .../openapitools/client/model/AdditionalPropertiesObject.java | 1 + .../openapitools/client/model/AdditionalPropertiesString.java | 1 + .../src/main/java/org/openapitools/client/model/Animal.java | 1 + .../openapitools/client/model/ArrayOfArrayOfNumberOnly.java | 1 + .../java/org/openapitools/client/model/ArrayOfNumberOnly.java | 1 + .../src/main/java/org/openapitools/client/model/ArrayTest.java | 1 + .../src/main/java/org/openapitools/client/model/BigCat.java | 3 +-- .../main/java/org/openapitools/client/model/BigCatAllOf.java | 1 + .../java/org/openapitools/client/model/Capitalization.java | 1 + .../feign/src/main/java/org/openapitools/client/model/Cat.java | 1 + .../src/main/java/org/openapitools/client/model/CatAllOf.java | 1 + .../src/main/java/org/openapitools/client/model/Category.java | 1 + .../main/java/org/openapitools/client/model/ClassModel.java | 1 + .../src/main/java/org/openapitools/client/model/Client.java | 1 + .../feign/src/main/java/org/openapitools/client/model/Dog.java | 3 +-- .../src/main/java/org/openapitools/client/model/DogAllOf.java | 1 + .../main/java/org/openapitools/client/model/EnumArrays.java | 1 + .../src/main/java/org/openapitools/client/model/EnumTest.java | 1 + .../org/openapitools/client/model/FileSchemaTestClass.java | 1 + .../main/java/org/openapitools/client/model/FormatTest.java | 1 + .../java/org/openapitools/client/model/HasOnlyReadOnly.java | 1 + .../src/main/java/org/openapitools/client/model/MapTest.java | 1 + .../model/MixedPropertiesAndAdditionalPropertiesClass.java | 1 + .../java/org/openapitools/client/model/Model200Response.java | 1 + .../java/org/openapitools/client/model/ModelApiResponse.java | 1 + .../main/java/org/openapitools/client/model/ModelReturn.java | 1 + .../src/main/java/org/openapitools/client/model/Name.java | 1 + .../main/java/org/openapitools/client/model/NumberOnly.java | 1 + .../src/main/java/org/openapitools/client/model/Order.java | 1 + .../java/org/openapitools/client/model/OuterComposite.java | 1 + .../feign/src/main/java/org/openapitools/client/model/Pet.java | 1 + .../main/java/org/openapitools/client/model/ReadOnlyFirst.java | 1 + .../java/org/openapitools/client/model/SpecialModelName.java | 1 + .../feign/src/main/java/org/openapitools/client/model/Tag.java | 1 + .../java/org/openapitools/client/model/TypeHolderDefault.java | 1 + .../java/org/openapitools/client/model/TypeHolderExample.java | 1 + .../src/main/java/org/openapitools/client/model/User.java | 1 + .../src/main/java/org/openapitools/client/model/XmlItem.java | 1 + .../openapitools/client/model/AdditionalPropertiesAnyType.java | 1 + .../openapitools/client/model/AdditionalPropertiesArray.java | 1 + .../openapitools/client/model/AdditionalPropertiesBoolean.java | 1 + .../openapitools/client/model/AdditionalPropertiesClass.java | 1 + .../openapitools/client/model/AdditionalPropertiesInteger.java | 1 + .../openapitools/client/model/AdditionalPropertiesNumber.java | 1 + .../openapitools/client/model/AdditionalPropertiesObject.java | 1 + .../openapitools/client/model/AdditionalPropertiesString.java | 1 + .../src/main/java/org/openapitools/client/model/Animal.java | 1 + .../openapitools/client/model/ArrayOfArrayOfNumberOnly.java | 1 + .../java/org/openapitools/client/model/ArrayOfNumberOnly.java | 1 + .../src/main/java/org/openapitools/client/model/ArrayTest.java | 1 + .../src/main/java/org/openapitools/client/model/BigCat.java | 3 +-- .../main/java/org/openapitools/client/model/BigCatAllOf.java | 1 + .../java/org/openapitools/client/model/Capitalization.java | 1 + .../src/main/java/org/openapitools/client/model/Cat.java | 1 + .../src/main/java/org/openapitools/client/model/CatAllOf.java | 1 + .../src/main/java/org/openapitools/client/model/Category.java | 1 + .../main/java/org/openapitools/client/model/ClassModel.java | 1 + .../src/main/java/org/openapitools/client/model/Client.java | 1 + .../src/main/java/org/openapitools/client/model/Dog.java | 3 +-- .../src/main/java/org/openapitools/client/model/DogAllOf.java | 1 + .../main/java/org/openapitools/client/model/EnumArrays.java | 1 + .../src/main/java/org/openapitools/client/model/EnumTest.java | 1 + .../org/openapitools/client/model/FileSchemaTestClass.java | 1 + .../main/java/org/openapitools/client/model/FormatTest.java | 1 + .../java/org/openapitools/client/model/HasOnlyReadOnly.java | 1 + .../src/main/java/org/openapitools/client/model/MapTest.java | 1 + .../model/MixedPropertiesAndAdditionalPropertiesClass.java | 1 + .../java/org/openapitools/client/model/Model200Response.java | 1 + .../java/org/openapitools/client/model/ModelApiResponse.java | 1 + .../main/java/org/openapitools/client/model/ModelReturn.java | 1 + .../src/main/java/org/openapitools/client/model/Name.java | 1 + .../main/java/org/openapitools/client/model/NumberOnly.java | 1 + .../src/main/java/org/openapitools/client/model/Order.java | 1 + .../java/org/openapitools/client/model/OuterComposite.java | 1 + .../src/main/java/org/openapitools/client/model/Pet.java | 1 + .../main/java/org/openapitools/client/model/ReadOnlyFirst.java | 1 + .../java/org/openapitools/client/model/SpecialModelName.java | 1 + .../src/main/java/org/openapitools/client/model/Tag.java | 1 + .../java/org/openapitools/client/model/TypeHolderDefault.java | 1 + .../java/org/openapitools/client/model/TypeHolderExample.java | 1 + .../src/main/java/org/openapitools/client/model/User.java | 1 + .../src/main/java/org/openapitools/client/model/XmlItem.java | 1 + .../openapitools/client/model/AdditionalPropertiesAnyType.java | 1 + .../openapitools/client/model/AdditionalPropertiesArray.java | 1 + .../openapitools/client/model/AdditionalPropertiesBoolean.java | 1 + .../openapitools/client/model/AdditionalPropertiesClass.java | 1 + .../openapitools/client/model/AdditionalPropertiesInteger.java | 1 + .../openapitools/client/model/AdditionalPropertiesNumber.java | 1 + .../openapitools/client/model/AdditionalPropertiesObject.java | 1 + .../openapitools/client/model/AdditionalPropertiesString.java | 1 + .../src/main/java/org/openapitools/client/model/Animal.java | 1 + .../openapitools/client/model/ArrayOfArrayOfNumberOnly.java | 1 + .../java/org/openapitools/client/model/ArrayOfNumberOnly.java | 1 + .../src/main/java/org/openapitools/client/model/ArrayTest.java | 1 + .../src/main/java/org/openapitools/client/model/BigCat.java | 3 +-- .../main/java/org/openapitools/client/model/BigCatAllOf.java | 1 + .../java/org/openapitools/client/model/Capitalization.java | 1 + .../src/main/java/org/openapitools/client/model/Cat.java | 1 + .../src/main/java/org/openapitools/client/model/CatAllOf.java | 1 + .../src/main/java/org/openapitools/client/model/Category.java | 1 + .../main/java/org/openapitools/client/model/ClassModel.java | 1 + .../src/main/java/org/openapitools/client/model/Client.java | 1 + .../src/main/java/org/openapitools/client/model/Dog.java | 3 +-- .../src/main/java/org/openapitools/client/model/DogAllOf.java | 1 + .../main/java/org/openapitools/client/model/EnumArrays.java | 1 + .../src/main/java/org/openapitools/client/model/EnumTest.java | 1 + .../org/openapitools/client/model/FileSchemaTestClass.java | 1 + .../main/java/org/openapitools/client/model/FormatTest.java | 1 + .../java/org/openapitools/client/model/HasOnlyReadOnly.java | 1 + .../src/main/java/org/openapitools/client/model/MapTest.java | 1 + .../model/MixedPropertiesAndAdditionalPropertiesClass.java | 1 + .../java/org/openapitools/client/model/Model200Response.java | 1 + .../java/org/openapitools/client/model/ModelApiResponse.java | 1 + .../main/java/org/openapitools/client/model/ModelReturn.java | 1 + .../src/main/java/org/openapitools/client/model/Name.java | 1 + .../main/java/org/openapitools/client/model/NumberOnly.java | 1 + .../src/main/java/org/openapitools/client/model/Order.java | 1 + .../java/org/openapitools/client/model/OuterComposite.java | 1 + .../src/main/java/org/openapitools/client/model/Pet.java | 1 + .../main/java/org/openapitools/client/model/ReadOnlyFirst.java | 1 + .../java/org/openapitools/client/model/SpecialModelName.java | 1 + .../src/main/java/org/openapitools/client/model/Tag.java | 1 + .../java/org/openapitools/client/model/TypeHolderDefault.java | 1 + .../java/org/openapitools/client/model/TypeHolderExample.java | 1 + .../src/main/java/org/openapitools/client/model/User.java | 1 + .../src/main/java/org/openapitools/client/model/XmlItem.java | 1 + .../openapitools/client/model/AdditionalPropertiesAnyType.java | 1 + .../openapitools/client/model/AdditionalPropertiesArray.java | 1 + .../openapitools/client/model/AdditionalPropertiesBoolean.java | 1 + .../openapitools/client/model/AdditionalPropertiesClass.java | 1 + .../openapitools/client/model/AdditionalPropertiesInteger.java | 1 + .../openapitools/client/model/AdditionalPropertiesNumber.java | 1 + .../openapitools/client/model/AdditionalPropertiesObject.java | 1 + .../openapitools/client/model/AdditionalPropertiesString.java | 1 + .../src/main/java/org/openapitools/client/model/Animal.java | 1 + .../openapitools/client/model/ArrayOfArrayOfNumberOnly.java | 1 + .../java/org/openapitools/client/model/ArrayOfNumberOnly.java | 1 + .../src/main/java/org/openapitools/client/model/ArrayTest.java | 1 + .../src/main/java/org/openapitools/client/model/BigCat.java | 3 +-- .../main/java/org/openapitools/client/model/BigCatAllOf.java | 1 + .../java/org/openapitools/client/model/Capitalization.java | 1 + .../src/main/java/org/openapitools/client/model/Cat.java | 1 + .../src/main/java/org/openapitools/client/model/CatAllOf.java | 1 + .../src/main/java/org/openapitools/client/model/Category.java | 1 + .../main/java/org/openapitools/client/model/ClassModel.java | 1 + .../src/main/java/org/openapitools/client/model/Client.java | 1 + .../src/main/java/org/openapitools/client/model/Dog.java | 3 +-- .../src/main/java/org/openapitools/client/model/DogAllOf.java | 1 + .../main/java/org/openapitools/client/model/EnumArrays.java | 1 + .../src/main/java/org/openapitools/client/model/EnumTest.java | 1 + .../org/openapitools/client/model/FileSchemaTestClass.java | 1 + .../main/java/org/openapitools/client/model/FormatTest.java | 1 + .../java/org/openapitools/client/model/HasOnlyReadOnly.java | 1 + .../src/main/java/org/openapitools/client/model/MapTest.java | 1 + .../model/MixedPropertiesAndAdditionalPropertiesClass.java | 1 + .../java/org/openapitools/client/model/Model200Response.java | 1 + .../java/org/openapitools/client/model/ModelApiResponse.java | 1 + .../main/java/org/openapitools/client/model/ModelReturn.java | 1 + .../src/main/java/org/openapitools/client/model/Name.java | 1 + .../main/java/org/openapitools/client/model/NumberOnly.java | 1 + .../src/main/java/org/openapitools/client/model/Order.java | 1 + .../java/org/openapitools/client/model/OuterComposite.java | 1 + .../src/main/java/org/openapitools/client/model/Pet.java | 1 + .../main/java/org/openapitools/client/model/ReadOnlyFirst.java | 1 + .../java/org/openapitools/client/model/SpecialModelName.java | 1 + .../src/main/java/org/openapitools/client/model/Tag.java | 1 + .../java/org/openapitools/client/model/TypeHolderDefault.java | 1 + .../java/org/openapitools/client/model/TypeHolderExample.java | 1 + .../src/main/java/org/openapitools/client/model/User.java | 1 + .../src/main/java/org/openapitools/client/model/XmlItem.java | 1 + .../openapitools/client/model/AdditionalPropertiesAnyType.java | 1 + .../openapitools/client/model/AdditionalPropertiesArray.java | 1 + .../openapitools/client/model/AdditionalPropertiesBoolean.java | 1 + .../openapitools/client/model/AdditionalPropertiesClass.java | 1 + .../openapitools/client/model/AdditionalPropertiesInteger.java | 1 + .../openapitools/client/model/AdditionalPropertiesNumber.java | 1 + .../openapitools/client/model/AdditionalPropertiesObject.java | 1 + .../openapitools/client/model/AdditionalPropertiesString.java | 1 + .../src/main/java/org/openapitools/client/model/Animal.java | 1 + .../openapitools/client/model/ArrayOfArrayOfNumberOnly.java | 1 + .../java/org/openapitools/client/model/ArrayOfNumberOnly.java | 1 + .../src/main/java/org/openapitools/client/model/ArrayTest.java | 1 + .../src/main/java/org/openapitools/client/model/BigCat.java | 3 +-- .../main/java/org/openapitools/client/model/BigCatAllOf.java | 1 + .../java/org/openapitools/client/model/Capitalization.java | 1 + .../src/main/java/org/openapitools/client/model/Cat.java | 1 + .../src/main/java/org/openapitools/client/model/CatAllOf.java | 1 + .../src/main/java/org/openapitools/client/model/Category.java | 1 + .../main/java/org/openapitools/client/model/ClassModel.java | 1 + .../src/main/java/org/openapitools/client/model/Client.java | 1 + .../src/main/java/org/openapitools/client/model/Dog.java | 3 +-- .../src/main/java/org/openapitools/client/model/DogAllOf.java | 1 + .../main/java/org/openapitools/client/model/EnumArrays.java | 1 + .../src/main/java/org/openapitools/client/model/EnumTest.java | 1 + .../org/openapitools/client/model/FileSchemaTestClass.java | 1 + .../main/java/org/openapitools/client/model/FormatTest.java | 1 + .../java/org/openapitools/client/model/HasOnlyReadOnly.java | 1 + .../src/main/java/org/openapitools/client/model/MapTest.java | 1 + .../model/MixedPropertiesAndAdditionalPropertiesClass.java | 1 + .../java/org/openapitools/client/model/Model200Response.java | 1 + .../java/org/openapitools/client/model/ModelApiResponse.java | 1 + .../main/java/org/openapitools/client/model/ModelReturn.java | 1 + .../src/main/java/org/openapitools/client/model/Name.java | 1 + .../main/java/org/openapitools/client/model/NumberOnly.java | 1 + .../src/main/java/org/openapitools/client/model/Order.java | 1 + .../java/org/openapitools/client/model/OuterComposite.java | 1 + .../src/main/java/org/openapitools/client/model/Pet.java | 1 + .../main/java/org/openapitools/client/model/ReadOnlyFirst.java | 1 + .../java/org/openapitools/client/model/SpecialModelName.java | 1 + .../src/main/java/org/openapitools/client/model/Tag.java | 1 + .../java/org/openapitools/client/model/TypeHolderDefault.java | 1 + .../java/org/openapitools/client/model/TypeHolderExample.java | 1 + .../src/main/java/org/openapitools/client/model/User.java | 1 + .../src/main/java/org/openapitools/client/model/XmlItem.java | 1 + .../src/main/java/org/openapitools/client/model/Animal.java | 1 - .../src/main/java/org/openapitools/client/model/BigCat.java | 1 - .../src/main/java/org/openapitools/client/model/Cat.java | 1 - .../src/main/java/org/openapitools/client/model/Dog.java | 1 - .../src/main/java/org/openapitools/client/model/Animal.java | 1 - .../src/main/java/org/openapitools/client/model/BigCat.java | 1 - .../src/main/java/org/openapitools/client/model/Cat.java | 1 - .../src/main/java/org/openapitools/client/model/Dog.java | 1 - .../openapitools/client/model/AdditionalPropertiesAnyType.java | 1 + .../openapitools/client/model/AdditionalPropertiesArray.java | 1 + .../openapitools/client/model/AdditionalPropertiesBoolean.java | 1 + .../openapitools/client/model/AdditionalPropertiesClass.java | 1 + .../openapitools/client/model/AdditionalPropertiesInteger.java | 1 + .../openapitools/client/model/AdditionalPropertiesNumber.java | 1 + .../openapitools/client/model/AdditionalPropertiesObject.java | 1 + .../openapitools/client/model/AdditionalPropertiesString.java | 1 + .../src/main/java/org/openapitools/client/model/Animal.java | 1 + .../openapitools/client/model/ArrayOfArrayOfNumberOnly.java | 1 + .../java/org/openapitools/client/model/ArrayOfNumberOnly.java | 1 + .../src/main/java/org/openapitools/client/model/ArrayTest.java | 1 + .../src/main/java/org/openapitools/client/model/BigCat.java | 3 +-- .../main/java/org/openapitools/client/model/BigCatAllOf.java | 1 + .../java/org/openapitools/client/model/Capitalization.java | 1 + .../src/main/java/org/openapitools/client/model/Cat.java | 1 + .../src/main/java/org/openapitools/client/model/CatAllOf.java | 1 + .../src/main/java/org/openapitools/client/model/Category.java | 1 + .../main/java/org/openapitools/client/model/ClassModel.java | 1 + .../src/main/java/org/openapitools/client/model/Client.java | 1 + .../src/main/java/org/openapitools/client/model/Dog.java | 3 +-- .../src/main/java/org/openapitools/client/model/DogAllOf.java | 1 + .../main/java/org/openapitools/client/model/EnumArrays.java | 1 + .../src/main/java/org/openapitools/client/model/EnumTest.java | 1 + .../org/openapitools/client/model/FileSchemaTestClass.java | 1 + .../main/java/org/openapitools/client/model/FormatTest.java | 1 + .../java/org/openapitools/client/model/HasOnlyReadOnly.java | 1 + .../src/main/java/org/openapitools/client/model/MapTest.java | 1 + .../model/MixedPropertiesAndAdditionalPropertiesClass.java | 1 + .../java/org/openapitools/client/model/Model200Response.java | 1 + .../java/org/openapitools/client/model/ModelApiResponse.java | 1 + .../main/java/org/openapitools/client/model/ModelReturn.java | 1 + .../src/main/java/org/openapitools/client/model/Name.java | 1 + .../main/java/org/openapitools/client/model/NumberOnly.java | 1 + .../src/main/java/org/openapitools/client/model/Order.java | 1 + .../java/org/openapitools/client/model/OuterComposite.java | 1 + .../src/main/java/org/openapitools/client/model/Pet.java | 1 + .../main/java/org/openapitools/client/model/ReadOnlyFirst.java | 1 + .../java/org/openapitools/client/model/SpecialModelName.java | 1 + .../src/main/java/org/openapitools/client/model/Tag.java | 1 + .../java/org/openapitools/client/model/TypeHolderDefault.java | 1 + .../java/org/openapitools/client/model/TypeHolderExample.java | 1 + .../src/main/java/org/openapitools/client/model/User.java | 1 + .../src/main/java/org/openapitools/client/model/XmlItem.java | 1 + .../src/main/java/org/openapitools/client/model/Animal.java | 1 - .../src/main/java/org/openapitools/client/model/BigCat.java | 1 - .../src/main/java/org/openapitools/client/model/Cat.java | 1 - .../src/main/java/org/openapitools/client/model/Dog.java | 1 - .../openapitools/client/model/AdditionalPropertiesAnyType.java | 1 + .../openapitools/client/model/AdditionalPropertiesArray.java | 1 + .../openapitools/client/model/AdditionalPropertiesBoolean.java | 1 + .../openapitools/client/model/AdditionalPropertiesClass.java | 1 + .../openapitools/client/model/AdditionalPropertiesInteger.java | 1 + .../openapitools/client/model/AdditionalPropertiesNumber.java | 1 + .../openapitools/client/model/AdditionalPropertiesObject.java | 1 + .../openapitools/client/model/AdditionalPropertiesString.java | 1 + .../src/main/java/org/openapitools/client/model/Animal.java | 1 + .../openapitools/client/model/ArrayOfArrayOfNumberOnly.java | 1 + .../java/org/openapitools/client/model/ArrayOfNumberOnly.java | 1 + .../src/main/java/org/openapitools/client/model/ArrayTest.java | 1 + .../src/main/java/org/openapitools/client/model/BigCat.java | 3 +-- .../main/java/org/openapitools/client/model/BigCatAllOf.java | 1 + .../java/org/openapitools/client/model/Capitalization.java | 1 + .../src/main/java/org/openapitools/client/model/Cat.java | 1 + .../src/main/java/org/openapitools/client/model/CatAllOf.java | 1 + .../src/main/java/org/openapitools/client/model/Category.java | 1 + .../main/java/org/openapitools/client/model/ClassModel.java | 1 + .../src/main/java/org/openapitools/client/model/Client.java | 1 + .../src/main/java/org/openapitools/client/model/Dog.java | 3 +-- .../src/main/java/org/openapitools/client/model/DogAllOf.java | 1 + .../main/java/org/openapitools/client/model/EnumArrays.java | 1 + .../src/main/java/org/openapitools/client/model/EnumTest.java | 1 + .../org/openapitools/client/model/FileSchemaTestClass.java | 1 + .../main/java/org/openapitools/client/model/FormatTest.java | 1 + .../java/org/openapitools/client/model/HasOnlyReadOnly.java | 1 + .../src/main/java/org/openapitools/client/model/MapTest.java | 1 + .../model/MixedPropertiesAndAdditionalPropertiesClass.java | 1 + .../java/org/openapitools/client/model/Model200Response.java | 1 + .../java/org/openapitools/client/model/ModelApiResponse.java | 1 + .../main/java/org/openapitools/client/model/ModelReturn.java | 1 + .../src/main/java/org/openapitools/client/model/Name.java | 1 + .../main/java/org/openapitools/client/model/NumberOnly.java | 1 + .../src/main/java/org/openapitools/client/model/Order.java | 1 + .../java/org/openapitools/client/model/OuterComposite.java | 1 + .../src/main/java/org/openapitools/client/model/Pet.java | 1 + .../main/java/org/openapitools/client/model/ReadOnlyFirst.java | 1 + .../java/org/openapitools/client/model/SpecialModelName.java | 1 + .../src/main/java/org/openapitools/client/model/Tag.java | 1 + .../java/org/openapitools/client/model/TypeHolderDefault.java | 1 + .../java/org/openapitools/client/model/TypeHolderExample.java | 1 + .../src/main/java/org/openapitools/client/model/User.java | 1 + .../src/main/java/org/openapitools/client/model/XmlItem.java | 1 + .../openapitools/client/model/AdditionalPropertiesAnyType.java | 1 + .../openapitools/client/model/AdditionalPropertiesArray.java | 1 + .../openapitools/client/model/AdditionalPropertiesBoolean.java | 1 + .../openapitools/client/model/AdditionalPropertiesClass.java | 1 + .../openapitools/client/model/AdditionalPropertiesInteger.java | 1 + .../openapitools/client/model/AdditionalPropertiesNumber.java | 1 + .../openapitools/client/model/AdditionalPropertiesObject.java | 1 + .../openapitools/client/model/AdditionalPropertiesString.java | 1 + .../src/main/java/org/openapitools/client/model/Animal.java | 1 + .../openapitools/client/model/ArrayOfArrayOfNumberOnly.java | 1 + .../java/org/openapitools/client/model/ArrayOfNumberOnly.java | 1 + .../src/main/java/org/openapitools/client/model/ArrayTest.java | 1 + .../src/main/java/org/openapitools/client/model/BigCat.java | 3 +-- .../main/java/org/openapitools/client/model/BigCatAllOf.java | 1 + .../java/org/openapitools/client/model/Capitalization.java | 1 + .../src/main/java/org/openapitools/client/model/Cat.java | 1 + .../src/main/java/org/openapitools/client/model/CatAllOf.java | 1 + .../src/main/java/org/openapitools/client/model/Category.java | 1 + .../main/java/org/openapitools/client/model/ClassModel.java | 1 + .../src/main/java/org/openapitools/client/model/Client.java | 1 + .../src/main/java/org/openapitools/client/model/Dog.java | 3 +-- .../src/main/java/org/openapitools/client/model/DogAllOf.java | 1 + .../main/java/org/openapitools/client/model/EnumArrays.java | 1 + .../src/main/java/org/openapitools/client/model/EnumTest.java | 1 + .../org/openapitools/client/model/FileSchemaTestClass.java | 1 + .../main/java/org/openapitools/client/model/FormatTest.java | 1 + .../java/org/openapitools/client/model/HasOnlyReadOnly.java | 1 + .../src/main/java/org/openapitools/client/model/MapTest.java | 1 + .../model/MixedPropertiesAndAdditionalPropertiesClass.java | 1 + .../java/org/openapitools/client/model/Model200Response.java | 1 + .../java/org/openapitools/client/model/ModelApiResponse.java | 1 + .../main/java/org/openapitools/client/model/ModelReturn.java | 1 + .../src/main/java/org/openapitools/client/model/Name.java | 1 + .../main/java/org/openapitools/client/model/NumberOnly.java | 1 + .../src/main/java/org/openapitools/client/model/Order.java | 1 + .../java/org/openapitools/client/model/OuterComposite.java | 1 + .../src/main/java/org/openapitools/client/model/Pet.java | 1 + .../main/java/org/openapitools/client/model/ReadOnlyFirst.java | 1 + .../java/org/openapitools/client/model/SpecialModelName.java | 1 + .../src/main/java/org/openapitools/client/model/Tag.java | 1 + .../java/org/openapitools/client/model/TypeHolderDefault.java | 1 + .../java/org/openapitools/client/model/TypeHolderExample.java | 1 + .../src/main/java/org/openapitools/client/model/User.java | 1 + .../src/main/java/org/openapitools/client/model/XmlItem.java | 1 + .../openapitools/client/model/AdditionalPropertiesAnyType.java | 1 + .../openapitools/client/model/AdditionalPropertiesArray.java | 1 + .../openapitools/client/model/AdditionalPropertiesBoolean.java | 1 + .../openapitools/client/model/AdditionalPropertiesClass.java | 1 + .../openapitools/client/model/AdditionalPropertiesInteger.java | 1 + .../openapitools/client/model/AdditionalPropertiesNumber.java | 1 + .../openapitools/client/model/AdditionalPropertiesObject.java | 1 + .../openapitools/client/model/AdditionalPropertiesString.java | 1 + .../src/main/java/org/openapitools/client/model/Animal.java | 1 + .../openapitools/client/model/ArrayOfArrayOfNumberOnly.java | 1 + .../java/org/openapitools/client/model/ArrayOfNumberOnly.java | 1 + .../src/main/java/org/openapitools/client/model/ArrayTest.java | 1 + .../src/main/java/org/openapitools/client/model/BigCat.java | 3 +-- .../main/java/org/openapitools/client/model/BigCatAllOf.java | 1 + .../java/org/openapitools/client/model/Capitalization.java | 1 + .../src/main/java/org/openapitools/client/model/Cat.java | 1 + .../src/main/java/org/openapitools/client/model/CatAllOf.java | 1 + .../src/main/java/org/openapitools/client/model/Category.java | 1 + .../main/java/org/openapitools/client/model/ClassModel.java | 1 + .../src/main/java/org/openapitools/client/model/Client.java | 1 + .../src/main/java/org/openapitools/client/model/Dog.java | 3 +-- .../src/main/java/org/openapitools/client/model/DogAllOf.java | 1 + .../main/java/org/openapitools/client/model/EnumArrays.java | 1 + .../src/main/java/org/openapitools/client/model/EnumTest.java | 1 + .../org/openapitools/client/model/FileSchemaTestClass.java | 1 + .../main/java/org/openapitools/client/model/FormatTest.java | 1 + .../java/org/openapitools/client/model/HasOnlyReadOnly.java | 1 + .../src/main/java/org/openapitools/client/model/MapTest.java | 1 + .../model/MixedPropertiesAndAdditionalPropertiesClass.java | 1 + .../java/org/openapitools/client/model/Model200Response.java | 1 + .../java/org/openapitools/client/model/ModelApiResponse.java | 1 + .../main/java/org/openapitools/client/model/ModelReturn.java | 1 + .../src/main/java/org/openapitools/client/model/Name.java | 1 + .../main/java/org/openapitools/client/model/NumberOnly.java | 1 + .../src/main/java/org/openapitools/client/model/Order.java | 1 + .../java/org/openapitools/client/model/OuterComposite.java | 1 + .../src/main/java/org/openapitools/client/model/Pet.java | 1 + .../main/java/org/openapitools/client/model/ReadOnlyFirst.java | 1 + .../java/org/openapitools/client/model/SpecialModelName.java | 1 + .../src/main/java/org/openapitools/client/model/Tag.java | 1 + .../java/org/openapitools/client/model/TypeHolderDefault.java | 1 + .../java/org/openapitools/client/model/TypeHolderExample.java | 1 + .../src/main/java/org/openapitools/client/model/User.java | 1 + .../src/main/java/org/openapitools/client/model/XmlItem.java | 1 + .../openapitools/client/model/AdditionalPropertiesAnyType.java | 1 + .../openapitools/client/model/AdditionalPropertiesArray.java | 1 + .../openapitools/client/model/AdditionalPropertiesBoolean.java | 1 + .../openapitools/client/model/AdditionalPropertiesClass.java | 1 + .../openapitools/client/model/AdditionalPropertiesInteger.java | 1 + .../openapitools/client/model/AdditionalPropertiesNumber.java | 1 + .../openapitools/client/model/AdditionalPropertiesObject.java | 1 + .../openapitools/client/model/AdditionalPropertiesString.java | 1 + .../src/main/java/org/openapitools/client/model/Animal.java | 1 + .../openapitools/client/model/ArrayOfArrayOfNumberOnly.java | 1 + .../java/org/openapitools/client/model/ArrayOfNumberOnly.java | 1 + .../src/main/java/org/openapitools/client/model/ArrayTest.java | 1 + .../src/main/java/org/openapitools/client/model/BigCat.java | 3 +-- .../main/java/org/openapitools/client/model/BigCatAllOf.java | 1 + .../java/org/openapitools/client/model/Capitalization.java | 1 + .../src/main/java/org/openapitools/client/model/Cat.java | 1 + .../src/main/java/org/openapitools/client/model/CatAllOf.java | 1 + .../src/main/java/org/openapitools/client/model/Category.java | 1 + .../main/java/org/openapitools/client/model/ClassModel.java | 1 + .../src/main/java/org/openapitools/client/model/Client.java | 1 + .../src/main/java/org/openapitools/client/model/Dog.java | 3 +-- .../src/main/java/org/openapitools/client/model/DogAllOf.java | 1 + .../main/java/org/openapitools/client/model/EnumArrays.java | 1 + .../src/main/java/org/openapitools/client/model/EnumTest.java | 1 + .../org/openapitools/client/model/FileSchemaTestClass.java | 1 + .../main/java/org/openapitools/client/model/FormatTest.java | 1 + .../java/org/openapitools/client/model/HasOnlyReadOnly.java | 1 + .../src/main/java/org/openapitools/client/model/MapTest.java | 1 + .../model/MixedPropertiesAndAdditionalPropertiesClass.java | 1 + .../java/org/openapitools/client/model/Model200Response.java | 1 + .../java/org/openapitools/client/model/ModelApiResponse.java | 1 + .../main/java/org/openapitools/client/model/ModelReturn.java | 1 + .../src/main/java/org/openapitools/client/model/Name.java | 1 + .../main/java/org/openapitools/client/model/NumberOnly.java | 1 + .../src/main/java/org/openapitools/client/model/Order.java | 1 + .../java/org/openapitools/client/model/OuterComposite.java | 1 + .../src/main/java/org/openapitools/client/model/Pet.java | 1 + .../main/java/org/openapitools/client/model/ReadOnlyFirst.java | 1 + .../java/org/openapitools/client/model/SpecialModelName.java | 1 + .../src/main/java/org/openapitools/client/model/Tag.java | 1 + .../java/org/openapitools/client/model/TypeHolderDefault.java | 1 + .../java/org/openapitools/client/model/TypeHolderExample.java | 1 + .../src/main/java/org/openapitools/client/model/User.java | 1 + .../src/main/java/org/openapitools/client/model/XmlItem.java | 1 + .../src/main/java/org/openapitools/client/model/Animal.java | 1 - .../src/main/java/org/openapitools/client/model/BigCat.java | 1 - .../src/main/java/org/openapitools/client/model/Cat.java | 1 - .../src/main/java/org/openapitools/client/model/Dog.java | 1 - .../src/main/java/org/openapitools/client/model/Animal.java | 1 - .../src/main/java/org/openapitools/client/model/BigCat.java | 1 - .../src/main/java/org/openapitools/client/model/Cat.java | 1 - .../src/main/java/org/openapitools/client/model/Dog.java | 1 - .../src/main/java/org/openapitools/client/model/Animal.java | 1 - .../src/main/java/org/openapitools/client/model/BigCat.java | 1 - .../src/main/java/org/openapitools/client/model/Cat.java | 1 - .../src/main/java/org/openapitools/client/model/Dog.java | 1 - .../openapitools/client/model/AdditionalPropertiesAnyType.java | 1 + .../openapitools/client/model/AdditionalPropertiesArray.java | 1 + .../openapitools/client/model/AdditionalPropertiesBoolean.java | 1 + .../openapitools/client/model/AdditionalPropertiesClass.java | 1 + .../openapitools/client/model/AdditionalPropertiesInteger.java | 1 + .../openapitools/client/model/AdditionalPropertiesNumber.java | 1 + .../openapitools/client/model/AdditionalPropertiesObject.java | 1 + .../openapitools/client/model/AdditionalPropertiesString.java | 1 + .../src/main/java/org/openapitools/client/model/Animal.java | 1 + .../openapitools/client/model/ArrayOfArrayOfNumberOnly.java | 1 + .../java/org/openapitools/client/model/ArrayOfNumberOnly.java | 1 + .../src/main/java/org/openapitools/client/model/ArrayTest.java | 1 + .../src/main/java/org/openapitools/client/model/BigCat.java | 3 +-- .../main/java/org/openapitools/client/model/BigCatAllOf.java | 1 + .../java/org/openapitools/client/model/Capitalization.java | 1 + .../vertx/src/main/java/org/openapitools/client/model/Cat.java | 1 + .../src/main/java/org/openapitools/client/model/CatAllOf.java | 1 + .../src/main/java/org/openapitools/client/model/Category.java | 1 + .../main/java/org/openapitools/client/model/ClassModel.java | 1 + .../src/main/java/org/openapitools/client/model/Client.java | 1 + .../vertx/src/main/java/org/openapitools/client/model/Dog.java | 3 +-- .../src/main/java/org/openapitools/client/model/DogAllOf.java | 1 + .../main/java/org/openapitools/client/model/EnumArrays.java | 1 + .../src/main/java/org/openapitools/client/model/EnumTest.java | 1 + .../org/openapitools/client/model/FileSchemaTestClass.java | 1 + .../main/java/org/openapitools/client/model/FormatTest.java | 1 + .../java/org/openapitools/client/model/HasOnlyReadOnly.java | 1 + .../src/main/java/org/openapitools/client/model/MapTest.java | 1 + .../model/MixedPropertiesAndAdditionalPropertiesClass.java | 1 + .../java/org/openapitools/client/model/Model200Response.java | 1 + .../java/org/openapitools/client/model/ModelApiResponse.java | 1 + .../main/java/org/openapitools/client/model/ModelReturn.java | 1 + .../src/main/java/org/openapitools/client/model/Name.java | 1 + .../main/java/org/openapitools/client/model/NumberOnly.java | 1 + .../src/main/java/org/openapitools/client/model/Order.java | 1 + .../java/org/openapitools/client/model/OuterComposite.java | 1 + .../vertx/src/main/java/org/openapitools/client/model/Pet.java | 1 + .../main/java/org/openapitools/client/model/ReadOnlyFirst.java | 1 + .../java/org/openapitools/client/model/SpecialModelName.java | 1 + .../vertx/src/main/java/org/openapitools/client/model/Tag.java | 1 + .../java/org/openapitools/client/model/TypeHolderDefault.java | 1 + .../java/org/openapitools/client/model/TypeHolderExample.java | 1 + .../src/main/java/org/openapitools/client/model/User.java | 1 + .../src/main/java/org/openapitools/client/model/XmlItem.java | 1 + .../openapitools/client/model/AdditionalPropertiesAnyType.java | 1 + .../openapitools/client/model/AdditionalPropertiesArray.java | 1 + .../openapitools/client/model/AdditionalPropertiesBoolean.java | 1 + .../openapitools/client/model/AdditionalPropertiesClass.java | 1 + .../openapitools/client/model/AdditionalPropertiesInteger.java | 1 + .../openapitools/client/model/AdditionalPropertiesNumber.java | 1 + .../openapitools/client/model/AdditionalPropertiesObject.java | 1 + .../openapitools/client/model/AdditionalPropertiesString.java | 1 + .../src/main/java/org/openapitools/client/model/Animal.java | 1 + .../openapitools/client/model/ArrayOfArrayOfNumberOnly.java | 1 + .../java/org/openapitools/client/model/ArrayOfNumberOnly.java | 1 + .../src/main/java/org/openapitools/client/model/ArrayTest.java | 1 + .../src/main/java/org/openapitools/client/model/BigCat.java | 3 +-- .../main/java/org/openapitools/client/model/BigCatAllOf.java | 1 + .../java/org/openapitools/client/model/Capitalization.java | 1 + .../src/main/java/org/openapitools/client/model/Cat.java | 1 + .../src/main/java/org/openapitools/client/model/CatAllOf.java | 1 + .../src/main/java/org/openapitools/client/model/Category.java | 1 + .../main/java/org/openapitools/client/model/ClassModel.java | 1 + .../src/main/java/org/openapitools/client/model/Client.java | 1 + .../src/main/java/org/openapitools/client/model/Dog.java | 3 +-- .../src/main/java/org/openapitools/client/model/DogAllOf.java | 1 + .../main/java/org/openapitools/client/model/EnumArrays.java | 1 + .../src/main/java/org/openapitools/client/model/EnumTest.java | 1 + .../org/openapitools/client/model/FileSchemaTestClass.java | 1 + .../main/java/org/openapitools/client/model/FormatTest.java | 1 + .../java/org/openapitools/client/model/HasOnlyReadOnly.java | 1 + .../src/main/java/org/openapitools/client/model/MapTest.java | 1 + .../model/MixedPropertiesAndAdditionalPropertiesClass.java | 1 + .../java/org/openapitools/client/model/Model200Response.java | 1 + .../java/org/openapitools/client/model/ModelApiResponse.java | 1 + .../main/java/org/openapitools/client/model/ModelReturn.java | 1 + .../src/main/java/org/openapitools/client/model/Name.java | 1 + .../main/java/org/openapitools/client/model/NumberOnly.java | 1 + .../src/main/java/org/openapitools/client/model/Order.java | 1 + .../java/org/openapitools/client/model/OuterComposite.java | 1 + .../src/main/java/org/openapitools/client/model/Pet.java | 1 + .../main/java/org/openapitools/client/model/ReadOnlyFirst.java | 1 + .../java/org/openapitools/client/model/SpecialModelName.java | 1 + .../src/main/java/org/openapitools/client/model/Tag.java | 1 + .../java/org/openapitools/client/model/TypeHolderDefault.java | 1 + .../java/org/openapitools/client/model/TypeHolderExample.java | 1 + .../src/main/java/org/openapitools/client/model/User.java | 1 + .../src/main/java/org/openapitools/client/model/XmlItem.java | 1 + 552 files changed, 528 insertions(+), 72 deletions(-) diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index f84a72518f68..8d2c7147bdb6 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index 3104ead59eed..79e87782bd2c 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index b485c4825c27..8c5bc6271da0 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index 8dffb4999596..ed7e62088290 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index d09eacadf3e9..41d50c58ceae 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index 93480b7f4966..5b656c5825a4 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index 4afc16a07bb9..2326f099b488 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index 8533c0b77ae3..cde27cbad9fb 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Animal.java index 83270058d077..9dc580215d1f 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Animal.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index 5dc5abf29846..e8ab9ce9565c 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index c237ea37a6e2..48afb5b470bd 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ArrayTest.java index 8ca28d3862b8..55935f343f5c 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/BigCat.java index f038a3a46ad7..864ec623e435 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/BigCat.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/BigCat.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @@ -35,8 +36,6 @@ }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) -@JsonSubTypes({ -}) public class BigCat extends Cat { /** diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/BigCatAllOf.java index e3b6b0fdd04e..a22af0b67c02 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/BigCatAllOf.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Capitalization.java index d253e541dede..c7ea7879dbef 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Capitalization.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Cat.java index e07f10082d0e..11c2fd9d6624 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Cat.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/CatAllOf.java index 26285427f96c..35c447ac0e9e 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Category.java index de74329bc521..5823854c4c9f 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Category.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ClassModel.java index bac4aec70b57..93445a9610c1 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ClassModel.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Client.java index 6bb0d3fab73e..2820a5517c90 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Client.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Dog.java index edf33abb2b57..d81430849bb3 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Dog.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @@ -35,8 +36,6 @@ }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) -@JsonSubTypes({ -}) public class Dog extends Animal { public static final String JSON_PROPERTY_BREED = "breed"; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/DogAllOf.java index 147bb4d9b761..21babf245444 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/EnumArrays.java index 42c75cb2727d..0ac0036a1264 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/EnumTest.java index 75f53d11450c..e58cb6c26273 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/EnumTest.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index aae40c4a5a6e..bd7a3dc18ece 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/FormatTest.java index d24c2298054f..80b36862ad7b 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/FormatTest.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index 741ab2441d34..09ce9ea3cba6 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/MapTest.java index 9621c8220b71..bf8f3e694574 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/MapTest.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 3ccd9310b55c..1535857a4de2 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Model200Response.java index 3b952b2730bf..f4cfa618708f 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Model200Response.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ModelApiResponse.java index dd401709d75d..fadebd3adae6 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ModelReturn.java index 733ec3718a15..fd011c26d08f 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Name.java index 8c03d816bff7..2856bb62713f 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Name.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/NumberOnly.java index 45f21901673f..6f75ce84869a 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Order.java index 3d5229525795..504b92303ec4 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Order.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/OuterComposite.java index b644cc6817dc..31b0d1358fa6 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Pet.java index 26446f5b488e..6a5bf52230d4 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Pet.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index e5f23ef5dcfe..938b1ab5306d 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/SpecialModelName.java index e60f8a8104d6..0e689d7d2dc2 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Tag.java index b15dc0d14fc6..09eb968690dd 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Tag.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index 27199d76de1f..576744af258e 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/TypeHolderExample.java index f87fb944b9b4..14952abd0779 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/User.java index eafdd902c04d..68d6a47d486d 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/User.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/XmlItem.java index 59b3ac5879a6..44bbe30a93ad 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/XmlItem.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index f84a72518f68..8d2c7147bdb6 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index 3104ead59eed..79e87782bd2c 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index b485c4825c27..8c5bc6271da0 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index 8dffb4999596..ed7e62088290 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index d09eacadf3e9..41d50c58ceae 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index 93480b7f4966..5b656c5825a4 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index 4afc16a07bb9..2326f099b488 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index 8533c0b77ae3..cde27cbad9fb 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Animal.java index 83270058d077..9dc580215d1f 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Animal.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index 5dc5abf29846..e8ab9ce9565c 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index c237ea37a6e2..48afb5b470bd 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ArrayTest.java index 8ca28d3862b8..55935f343f5c 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/BigCat.java index f038a3a46ad7..864ec623e435 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/BigCat.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/BigCat.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @@ -35,8 +36,6 @@ }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) -@JsonSubTypes({ -}) public class BigCat extends Cat { /** diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/BigCatAllOf.java index e3b6b0fdd04e..a22af0b67c02 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/BigCatAllOf.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Capitalization.java index d253e541dede..c7ea7879dbef 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Capitalization.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Cat.java index e397ea7aa176..664eb00008be 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Cat.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/CatAllOf.java index e31a9ae81150..bbbb99689bdf 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Category.java index de74329bc521..5823854c4c9f 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Category.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ClassModel.java index bac4aec70b57..93445a9610c1 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ClassModel.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Client.java index 6bb0d3fab73e..2820a5517c90 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Client.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Dog.java index edf33abb2b57..d81430849bb3 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Dog.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @@ -35,8 +36,6 @@ }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) -@JsonSubTypes({ -}) public class Dog extends Animal { public static final String JSON_PROPERTY_BREED = "breed"; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/DogAllOf.java index 147bb4d9b761..21babf245444 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/EnumArrays.java index 42c75cb2727d..0ac0036a1264 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/EnumTest.java index 75f53d11450c..e58cb6c26273 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/EnumTest.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index aae40c4a5a6e..bd7a3dc18ece 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/FormatTest.java index d24c2298054f..80b36862ad7b 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/FormatTest.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index 741ab2441d34..09ce9ea3cba6 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/MapTest.java index 9621c8220b71..bf8f3e694574 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/MapTest.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 3ccd9310b55c..1535857a4de2 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Model200Response.java index 3b952b2730bf..f4cfa618708f 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Model200Response.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ModelApiResponse.java index dd401709d75d..fadebd3adae6 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ModelReturn.java index 733ec3718a15..fd011c26d08f 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Name.java index 8c03d816bff7..2856bb62713f 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Name.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/NumberOnly.java index 45f21901673f..6f75ce84869a 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Order.java index e894257f323c..b3c44d7f5da9 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Order.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/OuterComposite.java index 863237336880..01d6299649fd 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Pet.java index 26446f5b488e..6a5bf52230d4 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Pet.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index e5f23ef5dcfe..938b1ab5306d 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/SpecialModelName.java index e60f8a8104d6..0e689d7d2dc2 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Tag.java index b15dc0d14fc6..09eb968690dd 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Tag.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index 6ede0d94c081..7591858f5a42 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/TypeHolderExample.java index 2c30b9bbed2d..7d40ec56e6f1 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/User.java index eafdd902c04d..68d6a47d486d 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/User.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/XmlItem.java index 84bfde5ed4ff..cac71c7221b0 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/XmlItem.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index f84a72518f68..8d2c7147bdb6 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index 3104ead59eed..79e87782bd2c 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index b485c4825c27..8c5bc6271da0 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index 8dffb4999596..ed7e62088290 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index d09eacadf3e9..41d50c58ceae 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index 93480b7f4966..5b656c5825a4 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index 4afc16a07bb9..2326f099b488 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index 8533c0b77ae3..cde27cbad9fb 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Animal.java index 83270058d077..9dc580215d1f 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Animal.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index 5dc5abf29846..e8ab9ce9565c 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index c237ea37a6e2..48afb5b470bd 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ArrayTest.java index 8ca28d3862b8..55935f343f5c 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/BigCat.java index f038a3a46ad7..864ec623e435 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/BigCat.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/BigCat.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @@ -35,8 +36,6 @@ }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) -@JsonSubTypes({ -}) public class BigCat extends Cat { /** diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/BigCatAllOf.java index e3b6b0fdd04e..a22af0b67c02 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/BigCatAllOf.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Capitalization.java index d253e541dede..c7ea7879dbef 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Capitalization.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Cat.java index e397ea7aa176..664eb00008be 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Cat.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/CatAllOf.java index e31a9ae81150..bbbb99689bdf 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Category.java index de74329bc521..5823854c4c9f 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Category.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ClassModel.java index bac4aec70b57..93445a9610c1 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ClassModel.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Client.java index 6bb0d3fab73e..2820a5517c90 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Client.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Dog.java index edf33abb2b57..d81430849bb3 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Dog.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @@ -35,8 +36,6 @@ }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) -@JsonSubTypes({ -}) public class Dog extends Animal { public static final String JSON_PROPERTY_BREED = "breed"; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/DogAllOf.java index 147bb4d9b761..21babf245444 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/EnumArrays.java index 42c75cb2727d..0ac0036a1264 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/EnumTest.java index 75f53d11450c..e58cb6c26273 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/EnumTest.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index aae40c4a5a6e..bd7a3dc18ece 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/FormatTest.java index d24c2298054f..80b36862ad7b 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/FormatTest.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index 741ab2441d34..09ce9ea3cba6 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/MapTest.java index 9621c8220b71..bf8f3e694574 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/MapTest.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 3ccd9310b55c..1535857a4de2 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Model200Response.java index 3b952b2730bf..f4cfa618708f 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Model200Response.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ModelApiResponse.java index dd401709d75d..fadebd3adae6 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ModelReturn.java index 733ec3718a15..fd011c26d08f 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Name.java index 8c03d816bff7..2856bb62713f 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Name.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/NumberOnly.java index 45f21901673f..6f75ce84869a 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Order.java index e894257f323c..b3c44d7f5da9 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Order.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/OuterComposite.java index 863237336880..01d6299649fd 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Pet.java index 26446f5b488e..6a5bf52230d4 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Pet.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index e5f23ef5dcfe..938b1ab5306d 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/SpecialModelName.java index e60f8a8104d6..0e689d7d2dc2 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Tag.java index b15dc0d14fc6..09eb968690dd 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Tag.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index 6ede0d94c081..7591858f5a42 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/TypeHolderExample.java index 2c30b9bbed2d..7d40ec56e6f1 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/User.java index eafdd902c04d..68d6a47d486d 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/User.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/XmlItem.java index 84bfde5ed4ff..cac71c7221b0 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/XmlItem.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index f743e501e3b3..5ebe1c8ee184 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index 4a63a4759873..f914c4e3fcb3 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index ad55a0a8e220..487cf1fc561b 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index 0ea407ac8b43..9cb9ec3b910c 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index e23d5c0d564e..02af190b86fe 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index 184d3c9f6b9e..a16182f31fe4 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index 6777cc390e49..0e95700279e0 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index ac062c802998..f271d047b66c 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Animal.java index 05a333ff89ed..b1696a153132 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Animal.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index 33aed0c39863..d5ec3bd25a50 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 6e9c30a19c8a..35faf6703996 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ArrayTest.java index 7d27ffc4964f..e2072043de95 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/BigCat.java index bcb573925b55..977dfe8c7a07 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/BigCat.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/BigCat.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @@ -35,8 +36,6 @@ }) @javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) -@JsonSubTypes({ -}) public class BigCat extends Cat { /** diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/BigCatAllOf.java index c07d3650409f..06ea3367a308 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/BigCatAllOf.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Capitalization.java index bff34dccde4b..e2f6f53c30e0 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Capitalization.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Cat.java index 56ed830a2174..e2a016871bda 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Cat.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/CatAllOf.java index 97abe188ea60..599d25f19a98 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Category.java index aeee848682aa..59fd6769b8f2 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Category.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ClassModel.java index c4950f02893a..66097484b812 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ClassModel.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Client.java index 1276ee5e36fc..722ebd547150 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Client.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Dog.java index b1042faa3b82..7a35b22a2193 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Dog.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @@ -35,8 +36,6 @@ }) @javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) -@JsonSubTypes({ -}) public class Dog extends Animal { public static final String JSON_PROPERTY_BREED = "breed"; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/DogAllOf.java index 3518ba28ec22..84ccb965aa83 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/EnumArrays.java index 653c53874e62..c7d655942e59 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/EnumTest.java index c0d90a44a474..228f40c25a5f 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/EnumTest.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index 2668a5216d28..b63dd70b9fcb 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/FormatTest.java index 9c33da1c2d08..b1ff8f62848d 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/FormatTest.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index 80ef1122ee87..d97638b9718c 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/MapTest.java index 0f9e586f10fb..6526c3b9e0e4 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/MapTest.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 8380b7d9511c..c0b5421506ab 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Model200Response.java index d648bf27c437..580ba9ec0825 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Model200Response.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ModelApiResponse.java index 02df7eca78ef..b04a200f7065 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ModelReturn.java index fe4401430d6d..d305142f664b 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Name.java index e1b4db38dfc1..f0ec7081f203 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Name.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/NumberOnly.java index c1f1f3b0ffc5..c824c8f32fc1 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Order.java index ac6b97e17e61..11fa861b7ed0 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Order.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/OuterComposite.java index b1b6239245be..c9cf98b070ad 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Pet.java index 5fd7d1d2b8a6..8497783b5080 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Pet.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index fe71d78a87e3..eadfaa844491 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/SpecialModelName.java index 1edaa88d2eb9..fd40afb48470 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Tag.java index 36dc2ef6ca37..83ef3325718a 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Tag.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index 0fb13c190a44..1b4ced9e2b3a 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/TypeHolderExample.java index a9b4ef6a1e20..05b715a11110 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/User.java index 15599afa8bca..278b837b1afe 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/User.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/XmlItem.java index 1dd697308a4e..98c0531d95ed 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/XmlItem.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index f743e501e3b3..5ebe1c8ee184 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index 4a63a4759873..f914c4e3fcb3 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index ad55a0a8e220..487cf1fc561b 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index 0ea407ac8b43..9cb9ec3b910c 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index e23d5c0d564e..02af190b86fe 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index 184d3c9f6b9e..a16182f31fe4 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index 6777cc390e49..0e95700279e0 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index ac062c802998..f271d047b66c 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Animal.java index 05a333ff89ed..b1696a153132 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Animal.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index 33aed0c39863..d5ec3bd25a50 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 6e9c30a19c8a..35faf6703996 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ArrayTest.java index 7d27ffc4964f..e2072043de95 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/BigCat.java index bcb573925b55..977dfe8c7a07 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/BigCat.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/BigCat.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @@ -35,8 +36,6 @@ }) @javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) -@JsonSubTypes({ -}) public class BigCat extends Cat { /** diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/BigCatAllOf.java index c07d3650409f..06ea3367a308 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/BigCatAllOf.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Capitalization.java index bff34dccde4b..e2f6f53c30e0 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Capitalization.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Cat.java index 56ed830a2174..e2a016871bda 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Cat.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/CatAllOf.java index 97abe188ea60..599d25f19a98 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Category.java index aeee848682aa..59fd6769b8f2 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Category.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ClassModel.java index c4950f02893a..66097484b812 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ClassModel.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Client.java index 1276ee5e36fc..722ebd547150 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Client.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Dog.java index b1042faa3b82..7a35b22a2193 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Dog.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @@ -35,8 +36,6 @@ }) @javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) -@JsonSubTypes({ -}) public class Dog extends Animal { public static final String JSON_PROPERTY_BREED = "breed"; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/DogAllOf.java index 3518ba28ec22..84ccb965aa83 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/EnumArrays.java index 653c53874e62..c7d655942e59 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/EnumTest.java index c0d90a44a474..228f40c25a5f 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/EnumTest.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index 2668a5216d28..b63dd70b9fcb 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/FormatTest.java index 9c33da1c2d08..b1ff8f62848d 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/FormatTest.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index 80ef1122ee87..d97638b9718c 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/MapTest.java index 0f9e586f10fb..6526c3b9e0e4 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/MapTest.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 8380b7d9511c..c0b5421506ab 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Model200Response.java index d648bf27c437..580ba9ec0825 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Model200Response.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ModelApiResponse.java index 02df7eca78ef..b04a200f7065 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ModelReturn.java index fe4401430d6d..d305142f664b 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Name.java index e1b4db38dfc1..f0ec7081f203 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Name.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/NumberOnly.java index c1f1f3b0ffc5..c824c8f32fc1 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Order.java index ac6b97e17e61..11fa861b7ed0 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Order.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/OuterComposite.java index b1b6239245be..c9cf98b070ad 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Pet.java index 5fd7d1d2b8a6..8497783b5080 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Pet.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index fe71d78a87e3..eadfaa844491 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/SpecialModelName.java index 1edaa88d2eb9..fd40afb48470 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Tag.java index 36dc2ef6ca37..83ef3325718a 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Tag.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index 0fb13c190a44..1b4ced9e2b3a 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/TypeHolderExample.java index a9b4ef6a1e20..05b715a11110 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/User.java index 15599afa8bca..278b837b1afe 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/User.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/XmlItem.java index 1dd697308a4e..98c0531d95ed 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/XmlItem.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Animal.java index 3b22feec80ab..11ac8da94611 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Animal.java @@ -33,7 +33,6 @@ * Animal */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") - public class Animal implements Parcelable { public static final String SERIALIZED_NAME_CLASS_NAME = "className"; @SerializedName(SERIALIZED_NAME_CLASS_NAME) diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/BigCat.java index 0c66b503caf4..03f49cc47594 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/BigCat.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/BigCat.java @@ -32,7 +32,6 @@ * BigCat */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") - public class BigCat extends Cat implements Parcelable { /** * Gets or Sets kind diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Cat.java index aa2fe6568c4f..ce9d9423a890 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Cat.java @@ -33,7 +33,6 @@ * Cat */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") - public class Cat extends Animal implements Parcelable { public static final String SERIALIZED_NAME_DECLAWED = "declawed"; @SerializedName(SERIALIZED_NAME_DECLAWED) diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Dog.java index c8322b246b8b..2b31871075b5 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Dog.java @@ -32,7 +32,6 @@ * Dog */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") - public class Dog extends Animal implements Parcelable { public static final String SERIALIZED_NAME_BREED = "breed"; @SerializedName(SERIALIZED_NAME_BREED) diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Animal.java index 00548e65fa3b..1f432eb87047 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Animal.java @@ -31,7 +31,6 @@ * Animal */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") - public class Animal { public static final String SERIALIZED_NAME_CLASS_NAME = "className"; @SerializedName(SERIALIZED_NAME_CLASS_NAME) diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/BigCat.java index 186ea74bbac1..1d2164152187 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/BigCat.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/BigCat.java @@ -30,7 +30,6 @@ * BigCat */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") - public class BigCat extends Cat { /** * Gets or Sets kind diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Cat.java index 560bebcb7bb6..be96ea08f334 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Cat.java @@ -31,7 +31,6 @@ * Cat */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") - public class Cat extends Animal { public static final String SERIALIZED_NAME_DECLAWED = "declawed"; @SerializedName(SERIALIZED_NAME_DECLAWED) diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Dog.java index 49df272d86ed..d3f96c74a627 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Dog.java @@ -30,7 +30,6 @@ * Dog */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") - public class Dog extends Animal { public static final String SERIALIZED_NAME_BREED = "breed"; @SerializedName(SERIALIZED_NAME_BREED) diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index 8cf0a4e0413e..8a8cbcb21369 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index 0c6f5077a312..8351a9f6bd94 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index d02d6f8c23c4..6d4ba919e2ad 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index 5bac1897d347..ea6367b321bf 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index 5e5580a12e6b..097ad92a8ea7 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index 2cfed6ac8bbb..58e6beefb673 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index 7238c48b8fbf..bdd98a66c5f1 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index f65278c1a311..dcedade3e056 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Animal.java index 41e012a41129..6000099c10a8 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Animal.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index 203c75204621..496074f932e7 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 336304cead20..b708449a3f43 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ArrayTest.java index 99eada4081e3..62ea923ecd82 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/BigCat.java index 973d491c3bea..55b712b372b9 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/BigCat.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/BigCat.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @@ -38,8 +39,6 @@ }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) -@JsonSubTypes({ -}) public class BigCat extends Cat { /** diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/BigCatAllOf.java index e68e97722a7d..e16b2adb83fb 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/BigCatAllOf.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Capitalization.java index 14d9ce97c200..39a7a2222286 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Capitalization.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Cat.java index b116b5e974f8..ad57bdd07c45 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Cat.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/CatAllOf.java index 5650a931312e..5e7b5db80f80 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Category.java index 8ae56f05c48e..27fbb540578b 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Category.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ClassModel.java index 0eb3e1f23bdf..f8de7e1af7cb 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ClassModel.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Client.java index e462014e13e7..fdabdf1a4a60 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Client.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Dog.java index 80bdd178d51a..5adb5c7fd329 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Dog.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @@ -38,8 +39,6 @@ }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) -@JsonSubTypes({ -}) public class Dog extends Animal { public static final String JSON_PROPERTY_BREED = "breed"; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/DogAllOf.java index de709714cbdf..e0111656a3ab 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/EnumArrays.java index 517660f43993..86cf02f315c2 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/EnumTest.java index 63d5d87e8680..7db84922f2e4 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/EnumTest.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index f5c01e0219f3..8d4bbba1cca4 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/FormatTest.java index 09509ff968dc..46bbbee3d449 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/FormatTest.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index edac175cf958..e1eef91976bd 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/MapTest.java index 47dc047540c3..a62998d7dc90 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/MapTest.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 46139bf7b765..7f05131c8a26 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Model200Response.java index 068a2bd58331..e9cded1a198d 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Model200Response.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ModelApiResponse.java index 2a37a359031e..10b29e5ccd02 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ModelReturn.java index 2cc1987d61cb..51543a59aa27 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Name.java index becd9effdaed..cbaf054096e6 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Name.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/NumberOnly.java index 6fc7af18563c..808c98571fad 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Order.java index 380b84fb362d..b3d94578008a 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Order.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/OuterComposite.java index 8982b96fe054..d817fe339de1 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Pet.java index 0e73f80db074..96e32de0d7bf 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Pet.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index 8ba3f38db051..ac3322d67042 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/SpecialModelName.java index 651ec0840fb7..65632ef87f1f 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Tag.java index 0a3bbc2c4c43..e35043410b46 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Tag.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index 7bd1b0395ce1..eeff89514d4c 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/TypeHolderExample.java index dcb7af07b8cd..70e592bafc24 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/User.java index b31896ad197a..73fcd3b05e5f 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/User.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/XmlItem.java index 6eb813fea4b2..b33587769a7a 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/XmlItem.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Animal.java index 877a6e299087..6111226d27ba 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Animal.java @@ -34,7 +34,6 @@ * Animal */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") - public class Animal { public static final String SERIALIZED_NAME_CLASS_NAME = "className"; @SerializedName(SERIALIZED_NAME_CLASS_NAME) diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/BigCat.java index 242bf10e9b0e..6044ba3c0ed2 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/BigCat.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/BigCat.java @@ -33,7 +33,6 @@ * BigCat */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") - public class BigCat extends Cat { /** * Gets or Sets kind diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Cat.java index b4f9a9774174..c50efed3c609 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Cat.java @@ -34,7 +34,6 @@ * Cat */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") - public class Cat extends Animal { public static final String SERIALIZED_NAME_DECLAWED = "declawed"; @SerializedName(SERIALIZED_NAME_DECLAWED) diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Dog.java index 8d26c6210f37..e734c6f981f2 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Dog.java @@ -33,7 +33,6 @@ * Dog */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") - public class Dog extends Animal { public static final String SERIALIZED_NAME_BREED = "breed"; @SerializedName(SERIALIZED_NAME_BREED) diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index f84a72518f68..8d2c7147bdb6 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index 3104ead59eed..79e87782bd2c 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index b485c4825c27..8c5bc6271da0 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index 8dffb4999596..ed7e62088290 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index d09eacadf3e9..41d50c58ceae 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index 93480b7f4966..5b656c5825a4 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index 4afc16a07bb9..2326f099b488 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index 8533c0b77ae3..cde27cbad9fb 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Animal.java index 83270058d077..9dc580215d1f 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Animal.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index 5dc5abf29846..e8ab9ce9565c 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index c237ea37a6e2..48afb5b470bd 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ArrayTest.java index 8ca28d3862b8..55935f343f5c 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/BigCat.java index f038a3a46ad7..864ec623e435 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/BigCat.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/BigCat.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @@ -35,8 +36,6 @@ }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) -@JsonSubTypes({ -}) public class BigCat extends Cat { /** diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/BigCatAllOf.java index e3b6b0fdd04e..a22af0b67c02 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/BigCatAllOf.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Capitalization.java index d253e541dede..c7ea7879dbef 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Capitalization.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Cat.java index e397ea7aa176..664eb00008be 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Cat.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/CatAllOf.java index e31a9ae81150..bbbb99689bdf 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Category.java index de74329bc521..5823854c4c9f 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Category.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ClassModel.java index bac4aec70b57..93445a9610c1 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ClassModel.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Client.java index 6bb0d3fab73e..2820a5517c90 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Client.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Dog.java index edf33abb2b57..d81430849bb3 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Dog.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @@ -35,8 +36,6 @@ }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) -@JsonSubTypes({ -}) public class Dog extends Animal { public static final String JSON_PROPERTY_BREED = "breed"; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/DogAllOf.java index 147bb4d9b761..21babf245444 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/EnumArrays.java index 42c75cb2727d..0ac0036a1264 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/EnumTest.java index 75f53d11450c..e58cb6c26273 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/EnumTest.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index aae40c4a5a6e..bd7a3dc18ece 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/FormatTest.java index d24c2298054f..80b36862ad7b 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/FormatTest.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index 741ab2441d34..09ce9ea3cba6 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/MapTest.java index 9621c8220b71..bf8f3e694574 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/MapTest.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 3ccd9310b55c..1535857a4de2 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Model200Response.java index 3b952b2730bf..f4cfa618708f 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Model200Response.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ModelApiResponse.java index dd401709d75d..fadebd3adae6 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ModelReturn.java index 733ec3718a15..fd011c26d08f 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Name.java index 8c03d816bff7..2856bb62713f 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Name.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/NumberOnly.java index 45f21901673f..6f75ce84869a 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Order.java index e894257f323c..b3c44d7f5da9 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Order.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/OuterComposite.java index 863237336880..01d6299649fd 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Pet.java index 26446f5b488e..6a5bf52230d4 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Pet.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index e5f23ef5dcfe..938b1ab5306d 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/SpecialModelName.java index e60f8a8104d6..0e689d7d2dc2 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Tag.java index b15dc0d14fc6..09eb968690dd 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Tag.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index 6ede0d94c081..7591858f5a42 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/TypeHolderExample.java index 2c30b9bbed2d..7d40ec56e6f1 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/User.java index eafdd902c04d..68d6a47d486d 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/User.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/XmlItem.java index 84bfde5ed4ff..cac71c7221b0 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/XmlItem.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index 619d69ca703e..efc3b84bf2a7 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index fea82ea0670c..31a4337b6d25 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index 5af36e0b74f2..ee23b1af5115 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index 529a2ac4ea47..3d5e6fcace6c 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index 8ecb7eaf2bc5..8e7d92f3c05f 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index 9db93d341bc4..78cb61213eaf 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index f99c59f9d89b..4500d7c75e97 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index f2e41d3d966a..ecb1ee65991d 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Animal.java index 7bbe43a1508e..a1c686e40437 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Animal.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index e92537956af3..5b7a37e2c6c8 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 48ed30dd5623..4229fe879228 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ArrayTest.java index c442858ea0cb..a9d28beed59b 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/BigCat.java index 6923e03a94af..6620a9b97f8c 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/BigCat.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/BigCat.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @@ -37,8 +38,6 @@ }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) -@JsonSubTypes({ -}) @XmlRootElement(name = "BigCat") @XmlAccessorType(XmlAccessType.FIELD) diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/BigCatAllOf.java index 105c2f9fcb46..2e18b155835f 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/BigCatAllOf.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Capitalization.java index 9481c40492df..99bd1d44c160 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Capitalization.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Cat.java index abba4224859e..819f471d4d23 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Cat.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/CatAllOf.java index fb5498de2d48..08013a05f179 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Category.java index 486d3a640c58..0fac149c3f19 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Category.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ClassModel.java index 6b4a4156a584..ddf9c5ff4d0f 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ClassModel.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Client.java index c7d3068beb9f..ea032cc67a2f 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Client.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Dog.java index 85f6ac20f89e..7b29a6925fba 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Dog.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @@ -37,8 +38,6 @@ }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) -@JsonSubTypes({ -}) @XmlRootElement(name = "Dog") @XmlAccessorType(XmlAccessType.FIELD) diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/DogAllOf.java index 93bdd6f1fe16..245acff75f01 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/EnumArrays.java index c8351de6b301..3e0a30d5db42 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/EnumTest.java index 87d2cf3265d5..2e7c564e1de4 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/EnumTest.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index fcccd9e80212..d10064f99179 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/FormatTest.java index e465e6751914..91704f198c45 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/FormatTest.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index a6d596729448..e74c99362cae 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/MapTest.java index 7cbb7bab0f48..8b884e9219a8 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/MapTest.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index dae63b5f2864..6f861da33cad 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Model200Response.java index 6c5307c12cd8..c3464184ebed 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Model200Response.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ModelApiResponse.java index 8b28904dddd5..614c174f1e97 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ModelReturn.java index bbe14c63ab56..656b594449db 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Name.java index 5251c3371e52..79927485b640 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Name.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/NumberOnly.java index 918300bea552..272c4dd85eeb 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Order.java index fdd915ad2242..ee3ecc82c41b 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Order.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/OuterComposite.java index 6f2c1605ed08..35ee47ce134f 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Pet.java index 78e2f89fae81..37909c018d6d 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Pet.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index 6c92adb0b2d8..0be00a22367e 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/SpecialModelName.java index 5ccb098de6fa..58163dd6d17d 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Tag.java index cbbd97bd682b..974ad471b0c7 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Tag.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index c34074712b40..0dc0b2bba1d3 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/TypeHolderExample.java index 2c4c7e79db54..c9f2384befdc 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/User.java index a8e6be32dd26..422d7752bd66 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/User.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/XmlItem.java index fc328e1f5891..203718e6be8c 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/XmlItem.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index f84a72518f68..8d2c7147bdb6 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index 3104ead59eed..79e87782bd2c 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index b485c4825c27..8c5bc6271da0 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index 8dffb4999596..ed7e62088290 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index d09eacadf3e9..41d50c58ceae 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index 93480b7f4966..5b656c5825a4 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index 4afc16a07bb9..2326f099b488 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index 8533c0b77ae3..cde27cbad9fb 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Animal.java index 83270058d077..9dc580215d1f 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Animal.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index 5dc5abf29846..e8ab9ce9565c 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index c237ea37a6e2..48afb5b470bd 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ArrayTest.java index 8ca28d3862b8..55935f343f5c 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/BigCat.java index f038a3a46ad7..864ec623e435 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/BigCat.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/BigCat.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @@ -35,8 +36,6 @@ }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) -@JsonSubTypes({ -}) public class BigCat extends Cat { /** diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/BigCatAllOf.java index e3b6b0fdd04e..a22af0b67c02 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/BigCatAllOf.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Capitalization.java index d253e541dede..c7ea7879dbef 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Capitalization.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Cat.java index e397ea7aa176..664eb00008be 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Cat.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/CatAllOf.java index e31a9ae81150..bbbb99689bdf 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Category.java index de74329bc521..5823854c4c9f 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Category.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ClassModel.java index bac4aec70b57..93445a9610c1 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ClassModel.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Client.java index 6bb0d3fab73e..2820a5517c90 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Client.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Dog.java index edf33abb2b57..d81430849bb3 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Dog.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @@ -35,8 +36,6 @@ }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) -@JsonSubTypes({ -}) public class Dog extends Animal { public static final String JSON_PROPERTY_BREED = "breed"; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/DogAllOf.java index 147bb4d9b761..21babf245444 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/EnumArrays.java index 42c75cb2727d..0ac0036a1264 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/EnumTest.java index 75f53d11450c..e58cb6c26273 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/EnumTest.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index aae40c4a5a6e..bd7a3dc18ece 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/FormatTest.java index d24c2298054f..80b36862ad7b 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/FormatTest.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index 741ab2441d34..09ce9ea3cba6 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/MapTest.java index 9621c8220b71..bf8f3e694574 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/MapTest.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 3ccd9310b55c..1535857a4de2 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Model200Response.java index 3b952b2730bf..f4cfa618708f 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Model200Response.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelApiResponse.java index dd401709d75d..fadebd3adae6 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelReturn.java index 733ec3718a15..fd011c26d08f 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Name.java index 8c03d816bff7..2856bb62713f 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Name.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/NumberOnly.java index 45f21901673f..6f75ce84869a 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Order.java index e894257f323c..b3c44d7f5da9 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Order.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/OuterComposite.java index 863237336880..01d6299649fd 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Pet.java index 26446f5b488e..6a5bf52230d4 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Pet.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index e5f23ef5dcfe..938b1ab5306d 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/SpecialModelName.java index e60f8a8104d6..0e689d7d2dc2 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Tag.java index b15dc0d14fc6..09eb968690dd 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Tag.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index 6ede0d94c081..7591858f5a42 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/TypeHolderExample.java index 2c30b9bbed2d..7d40ec56e6f1 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/User.java index eafdd902c04d..68d6a47d486d 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/User.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/XmlItem.java index 84bfde5ed4ff..cac71c7221b0 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/XmlItem.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index 87958d5c7408..fa6626c94e0e 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index 6e61778611f2..354b09030009 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index 9841ffc5b2bf..d7288e217bb5 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index cc669ca9bcd9..88c288464364 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index 5d125ad27ecf..124f23b81184 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index 8352d3806a99..4e85c9bc75dd 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index 3054e6755a10..0c207b1ae4e1 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index 1d8f0433034c..38a2d64184de 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Animal.java index 4f7094331d42..8c60f38980a7 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Animal.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index b764e0257bf9..dd4eab207286 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 62bf7ba06a7d..e53d9fa43be0 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ArrayTest.java index d9c4e3ae3c92..7c63ae77edf1 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/BigCat.java index 4389c167cabc..2b715b520bf8 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/BigCat.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/BigCat.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @@ -37,8 +38,6 @@ }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) -@JsonSubTypes({ -}) public class BigCat extends Cat { /** diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/BigCatAllOf.java index 19ee4311e786..753ab4858bdc 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/BigCatAllOf.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Capitalization.java index 6e1b0dd242e5..b35babfce005 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Capitalization.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Cat.java index ca170cfaf239..f3f16caeb0ea 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Cat.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/CatAllOf.java index 2acdba3ff844..eb7bffd97695 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Category.java index b70ad8fe5c2c..6254fd1572c9 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Category.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ClassModel.java index b653cc28f081..9daccdea9873 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ClassModel.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Client.java index c61e5359d859..00211f41e450 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Client.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Dog.java index 67219179a765..24a79dd6a8b2 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Dog.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @@ -37,8 +38,6 @@ }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) -@JsonSubTypes({ -}) public class Dog extends Animal { public static final String JSON_PROPERTY_BREED = "breed"; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/DogAllOf.java index 9b55cbc4f186..524e0959dbe4 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/EnumArrays.java index 85be0585c891..ffb811dcd62a 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/EnumTest.java index ac65d1c25e43..5d1e7704064e 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/EnumTest.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index 138738068cde..6aa90e5fe21a 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/FormatTest.java index e9a19d8618e2..3c77f93588fb 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/FormatTest.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index 643812937c33..fd12294525fb 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/MapTest.java index 3eb2a9c0a5a8..1af6a8647a36 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/MapTest.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 064c23b726b1..b89403e74c31 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Model200Response.java index 91ea72cb5738..f81da2c68d4d 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Model200Response.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ModelApiResponse.java index 275db9f083ac..d2d83b7c8c85 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ModelReturn.java index 3f049658cc0f..615643b0c205 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Name.java index 6e58bb4cb2ff..bb632537c295 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Name.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/NumberOnly.java index f3d643e39d3b..e28055d3e0e4 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Order.java index dc9866d702a8..958cde521c73 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Order.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/OuterComposite.java index eb8210070a01..d43f68b95b7b 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Pet.java index b522cd724213..5c9aaa274f6f 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Pet.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index 25f676fa51f1..94ff8172c382 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/SpecialModelName.java index 03eb5335fcb3..244b9b5fe4d8 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Tag.java index 95e4f19548a4..16654daed44d 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Tag.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index ceb3cacacf63..c8a59d7a5d83 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/TypeHolderExample.java index c9beeee10f30..cf507a49fdd6 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/User.java index 6f4cd0153513..f666b56bdd2f 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/User.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/XmlItem.java index b03a19af5217..5fb882c6e856 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/XmlItem.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Animal.java index 00548e65fa3b..1f432eb87047 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Animal.java @@ -31,7 +31,6 @@ * Animal */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") - public class Animal { public static final String SERIALIZED_NAME_CLASS_NAME = "className"; @SerializedName(SERIALIZED_NAME_CLASS_NAME) diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/BigCat.java index 186ea74bbac1..1d2164152187 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/BigCat.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/BigCat.java @@ -30,7 +30,6 @@ * BigCat */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") - public class BigCat extends Cat { /** * Gets or Sets kind diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Cat.java index 560bebcb7bb6..be96ea08f334 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Cat.java @@ -31,7 +31,6 @@ * Cat */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") - public class Cat extends Animal { public static final String SERIALIZED_NAME_DECLAWED = "declawed"; @SerializedName(SERIALIZED_NAME_DECLAWED) diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Dog.java index 49df272d86ed..d3f96c74a627 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Dog.java @@ -30,7 +30,6 @@ * Dog */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") - public class Dog extends Animal { public static final String SERIALIZED_NAME_BREED = "breed"; @SerializedName(SERIALIZED_NAME_BREED) diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Animal.java index 00548e65fa3b..1f432eb87047 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Animal.java @@ -31,7 +31,6 @@ * Animal */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") - public class Animal { public static final String SERIALIZED_NAME_CLASS_NAME = "className"; @SerializedName(SERIALIZED_NAME_CLASS_NAME) diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/BigCat.java index 186ea74bbac1..1d2164152187 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/BigCat.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/BigCat.java @@ -30,7 +30,6 @@ * BigCat */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") - public class BigCat extends Cat { /** * Gets or Sets kind diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Cat.java index 560bebcb7bb6..be96ea08f334 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Cat.java @@ -31,7 +31,6 @@ * Cat */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") - public class Cat extends Animal { public static final String SERIALIZED_NAME_DECLAWED = "declawed"; @SerializedName(SERIALIZED_NAME_DECLAWED) diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Dog.java index 49df272d86ed..d3f96c74a627 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Dog.java @@ -30,7 +30,6 @@ * Dog */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") - public class Dog extends Animal { public static final String SERIALIZED_NAME_BREED = "breed"; @SerializedName(SERIALIZED_NAME_BREED) diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Animal.java index 00548e65fa3b..1f432eb87047 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Animal.java @@ -31,7 +31,6 @@ * Animal */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") - public class Animal { public static final String SERIALIZED_NAME_CLASS_NAME = "className"; @SerializedName(SERIALIZED_NAME_CLASS_NAME) diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/BigCat.java index 186ea74bbac1..1d2164152187 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/BigCat.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/BigCat.java @@ -30,7 +30,6 @@ * BigCat */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") - public class BigCat extends Cat { /** * Gets or Sets kind diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Cat.java index 560bebcb7bb6..be96ea08f334 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Cat.java @@ -31,7 +31,6 @@ * Cat */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") - public class Cat extends Animal { public static final String SERIALIZED_NAME_DECLAWED = "declawed"; @SerializedName(SERIALIZED_NAME_DECLAWED) diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Dog.java index 49df272d86ed..d3f96c74a627 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Dog.java @@ -30,7 +30,6 @@ * Dog */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") - public class Dog extends Animal { public static final String SERIALIZED_NAME_BREED = "breed"; @SerializedName(SERIALIZED_NAME_BREED) diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index f84a72518f68..8d2c7147bdb6 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index 3104ead59eed..79e87782bd2c 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index b485c4825c27..8c5bc6271da0 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index 4b3082c2a9d5..72b63a9ecefb 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index d09eacadf3e9..41d50c58ceae 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index 93480b7f4966..5b656c5825a4 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index 4afc16a07bb9..2326f099b488 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index 8533c0b77ae3..cde27cbad9fb 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Animal.java index 83270058d077..9dc580215d1f 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Animal.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index 04028d28af4e..13daa9824158 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index a1e543104384..de2bc5fd8e07 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ArrayTest.java index 10ee0b2ca102..3c88533eaa52 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/BigCat.java index f038a3a46ad7..864ec623e435 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/BigCat.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/BigCat.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @@ -35,8 +36,6 @@ }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) -@JsonSubTypes({ -}) public class BigCat extends Cat { /** diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/BigCatAllOf.java index e3b6b0fdd04e..a22af0b67c02 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/BigCatAllOf.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Capitalization.java index d253e541dede..c7ea7879dbef 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Capitalization.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Cat.java index e397ea7aa176..664eb00008be 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Cat.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/CatAllOf.java index e31a9ae81150..bbbb99689bdf 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Category.java index de74329bc521..5823854c4c9f 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Category.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ClassModel.java index bac4aec70b57..93445a9610c1 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ClassModel.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Client.java index 6bb0d3fab73e..2820a5517c90 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Client.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Dog.java index edf33abb2b57..d81430849bb3 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Dog.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @@ -35,8 +36,6 @@ }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) -@JsonSubTypes({ -}) public class Dog extends Animal { public static final String JSON_PROPERTY_BREED = "breed"; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/DogAllOf.java index 147bb4d9b761..21babf245444 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/EnumArrays.java index bf547f81f668..e670cf4b3914 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/EnumTest.java index 75f53d11450c..e58cb6c26273 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/EnumTest.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index 7f12fa9001f2..e22a96e86da9 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/FormatTest.java index cd6ccf98dc6a..054cf24c9ce7 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/FormatTest.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index 741ab2441d34..09ce9ea3cba6 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/MapTest.java index 65e595487b45..4662120ae29d 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/MapTest.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index d6b9118636db..15fd74975dfd 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Model200Response.java index 3b952b2730bf..f4cfa618708f 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Model200Response.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ModelApiResponse.java index dd401709d75d..fadebd3adae6 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ModelReturn.java index 733ec3718a15..fd011c26d08f 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Name.java index 8c03d816bff7..2856bb62713f 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Name.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/NumberOnly.java index 45f21901673f..6f75ce84869a 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Order.java index bfbd68687977..7aa3053c0ae3 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Order.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/OuterComposite.java index 863237336880..01d6299649fd 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Pet.java index 37e6e7df60e9..4eec05079924 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Pet.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index e5f23ef5dcfe..938b1ab5306d 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/SpecialModelName.java index e60f8a8104d6..0e689d7d2dc2 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Tag.java index b15dc0d14fc6..09eb968690dd 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Tag.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index 9f17e81859e9..0c86ba446826 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/TypeHolderExample.java index b02cf19f1d82..127acb1c0dfd 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/User.java index eafdd902c04d..68d6a47d486d 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/User.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/XmlItem.java index d6fa59c54a81..e7f4fb912d62 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/XmlItem.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index f84a72518f68..8d2c7147bdb6 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index 3104ead59eed..79e87782bd2c 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index b485c4825c27..8c5bc6271da0 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index 4b3082c2a9d5..72b63a9ecefb 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index d09eacadf3e9..41d50c58ceae 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index 93480b7f4966..5b656c5825a4 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index 4afc16a07bb9..2326f099b488 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index 8533c0b77ae3..cde27cbad9fb 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Animal.java index 83270058d077..9dc580215d1f 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Animal.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index 04028d28af4e..13daa9824158 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index a1e543104384..de2bc5fd8e07 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ArrayTest.java index 10ee0b2ca102..3c88533eaa52 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/BigCat.java index f038a3a46ad7..864ec623e435 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/BigCat.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/BigCat.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @@ -35,8 +36,6 @@ }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) -@JsonSubTypes({ -}) public class BigCat extends Cat { /** diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/BigCatAllOf.java index e3b6b0fdd04e..a22af0b67c02 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/BigCatAllOf.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Capitalization.java index d253e541dede..c7ea7879dbef 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Capitalization.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Cat.java index e397ea7aa176..664eb00008be 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Cat.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/CatAllOf.java index e31a9ae81150..bbbb99689bdf 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Category.java index de74329bc521..5823854c4c9f 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Category.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ClassModel.java index bac4aec70b57..93445a9610c1 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ClassModel.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Client.java index 6bb0d3fab73e..2820a5517c90 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Client.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Dog.java index edf33abb2b57..d81430849bb3 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Dog.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @@ -35,8 +36,6 @@ }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) -@JsonSubTypes({ -}) public class Dog extends Animal { public static final String JSON_PROPERTY_BREED = "breed"; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/DogAllOf.java index 147bb4d9b761..21babf245444 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/EnumArrays.java index bf547f81f668..e670cf4b3914 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/EnumTest.java index 75f53d11450c..e58cb6c26273 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/EnumTest.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index 7f12fa9001f2..e22a96e86da9 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/FormatTest.java index ec6dc028b41a..16a5c6b6a672 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/FormatTest.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index 741ab2441d34..09ce9ea3cba6 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/MapTest.java index 65e595487b45..4662120ae29d 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/MapTest.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index d6b9118636db..15fd74975dfd 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Model200Response.java index 3b952b2730bf..f4cfa618708f 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Model200Response.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ModelApiResponse.java index dd401709d75d..fadebd3adae6 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ModelReturn.java index 733ec3718a15..fd011c26d08f 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Name.java index 8c03d816bff7..2856bb62713f 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Name.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/NumberOnly.java index 45f21901673f..6f75ce84869a 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Order.java index bfbd68687977..7aa3053c0ae3 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Order.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/OuterComposite.java index 863237336880..01d6299649fd 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Pet.java index 37e6e7df60e9..4eec05079924 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Pet.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index e5f23ef5dcfe..938b1ab5306d 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/SpecialModelName.java index e60f8a8104d6..0e689d7d2dc2 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Tag.java index b15dc0d14fc6..09eb968690dd 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Tag.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index 9f17e81859e9..0c86ba446826 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/TypeHolderExample.java index b02cf19f1d82..127acb1c0dfd 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/User.java index eafdd902c04d..68d6a47d486d 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/User.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/XmlItem.java index d6fa59c54a81..e7f4fb912d62 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/XmlItem.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; From ed84280108f0a5b6eef873672f39b4feb567a935 Mon Sep 17 00:00:00 2001 From: Justin Black Date: Sat, 18 Jul 2020 10:13:22 -0700 Subject: [PATCH 036/129] Python-exp remove codegemodel mutation, allow mixed OneOf types (#6797) * Stops converting primitive models into object models, adds ComposedSchemas with mixed type * Samples update for python-exp --- .../openapitools/codegen/DefaultCodegen.java | 4 +- .../PythonClientExperimentalCodegen.java | 182 +++++++++++-- .../python/python-experimental/model.mustache | 15 +- .../python-experimental/model_doc.mustache | 9 + .../model_templates/classvars.mustache | 87 +++---- .../docstring_init_required_kwargs.mustache | 30 +++ .../method_init_normal.mustache | 3 + .../method_init_shared.mustache | 31 +-- .../method_init_simple.mustache | 66 +++++ .../model_templates/model_simple.mustache | 2 +- .../model_templates/validations.mustache | 28 ++ .../python-experimental/model_utils.mustache | 206 ++++++++++++--- .../python/PythonClientExperimentalTest.java | 4 +- ...odels-for-testing-with-http-signature.yaml | 30 ++- .../python-experimental/docs/EnumClass.md | 2 +- .../python-experimental/docs/StringEnum.md | 2 +- .../petstore_api/model/animal_farm.py | 24 +- .../petstore_api/model/enum_class.py | 25 +- .../model/number_with_validations.py | 24 +- .../petstore_api/model/string_enum.py | 24 +- .../petstore_api/model_utils.py | 206 ++++++++++++--- .../x_auth_id_alias/model_utils.py | 206 ++++++++++++--- .../dynamic_servers/model_utils.py | 206 ++++++++++++--- .../.openapi-generator/FILES | 2 + .../petstore/python-experimental/README.md | 2 + .../ComposedOneOfNumberWithValidations.md | 13 + .../python-experimental/docs/EnumClass.md | 2 +- .../python-experimental/docs/EnumTest.md | 2 +- .../python-experimental/docs/FakeApi.md | 65 +++++ .../python-experimental/docs/IntegerEnum.md | 2 +- .../docs/IntegerEnumOneValue.md | 2 +- .../docs/IntegerEnumWithDefaultValue.md | 2 +- .../python-experimental/docs/StringEnum.md | 2 +- .../docs/StringEnumWithDefaultValue.md | 2 +- .../petstore_api/api/fake_api.py | 113 +++++++++ .../petstore_api/model/animal_farm.py | 24 +- .../petstore_api/model/array_of_enums.py | 24 +- ...composed_one_of_number_with_validations.py | 239 ++++++++++++++++++ .../petstore_api/model/enum_class.py | 25 +- .../petstore_api/model/enum_test.py | 4 +- .../petstore_api/model/integer_enum.py | 24 +- .../model/integer_enum_one_value.py | 32 ++- .../model/integer_enum_with_default_value.py | 25 +- .../model/number_with_validations.py | 24 +- .../petstore_api/model/string_enum.py | 24 +- .../model/string_enum_with_default_value.py | 25 +- .../petstore_api/model_utils.py | 206 ++++++++++++--- .../petstore_api/models/__init__.py | 1 + ...composed_one_of_number_with_validations.py | 47 ++++ .../python-experimental/test/test_drawing.py | 2 +- .../python-experimental/test/test_fake_api.py | 39 ++- .../test/test_integer_enum_one_value.py | 3 + 52 files changed, 1886 insertions(+), 507 deletions(-) create mode 100644 modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/docstring_init_required_kwargs.mustache create mode 100644 modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/method_init_simple.mustache create mode 100644 modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/validations.mustache create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/ComposedOneOfNumberWithValidations.md create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_one_of_number_with_validations.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_composed_one_of_number_with_validations.py diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java index fd949a0e9a9d..d5222c0f8bd9 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java @@ -1960,10 +1960,10 @@ public String toOneOfName(List names, ComposedSchema composedSchema) { /** * Return a string representation of the schema type, resolving aliasing and references if necessary. * - * @param schema + * @param schema input * @return the string representation of the schema type. */ - private String getSingleSchemaType(Schema schema) { + protected String getSingleSchemaType(Schema schema) { Schema unaliasSchema = ModelUtils.unaliasSchema(this.openAPI, schema, importMapping); if (StringUtils.isNotBlank(unaliasSchema.get$ref())) { // reference to another definition/schema diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientExperimentalCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientExperimentalCodegen.java index 50d0e67970fc..d9ab10d57173 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientExperimentalCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientExperimentalCodegen.java @@ -423,6 +423,7 @@ public Map postProcessAllModels(Map objs) { CodegenProperty modelProperty = fromProperty("value", modelSchema); // import complex type from additional properties + // TODO can I remove this? DOes it exist in defaultcodegen? if (cm.additionalPropertiesType != null && modelProperty.items != null && modelProperty.items.complexType != null) { cm.imports.add(modelProperty.items.complexType); } @@ -800,9 +801,11 @@ private void addNullDefaultToOneOfAnyOfReqProps(Schema schema, CodegenModel resu public CodegenModel fromModel(String name, Schema schema) { // we have a custom version of this function so we can produce // models for components whose type != object and which have validations and enums - // this ensures that endpoint (operation) responses with validations and enums - // will generate models, and when those endpoint responses are received in python - // the response is cast as a model, and the model will validate the response using the enums and validations + // this ensures that: + // - endpoint (operation) responses with validations and type!=(object or array) + // - oneOf $ref components with validations and type!=(object or array) + // when endpoints receive payloads of these models + // that they will be converted into instances of these models Map propertyToModelName = new HashMap(); Map propertiesMap = schema.getProperties(); if (propertiesMap != null) { @@ -820,7 +823,7 @@ public CodegenModel fromModel(String name, Schema schema) { continue; } CodegenProperty modelProperty = fromProperty("_fake_name", refSchema); - if (modelProperty.isEnum == false && modelProperty.hasValidation == false) { + if (modelProperty.isEnum == true || modelProperty.hasValidation == false) { continue; } String modelName = ModelUtils.getSimpleRef(ref); @@ -828,37 +831,111 @@ public CodegenModel fromModel(String name, Schema schema) { } } CodegenModel result = super.fromModel(name, schema); + + // have oneOf point to the correct model + if (ModelUtils.isComposedSchema(schema)) { + ComposedSchema cs = (ComposedSchema) schema; + Map importCounts = new HashMap(); + List oneOfSchemas = cs.getOneOf(); + if (oneOfSchemas != null) { + for (int i = 0; i < oneOfSchemas.size(); i++) { + Schema oneOfSchema = oneOfSchemas.get(i); + String languageType = getTypeDeclaration(oneOfSchema); + String ref = oneOfSchema.get$ref(); + if (ref == null) { + Integer currVal = importCounts.getOrDefault(languageType, 0); + importCounts.put(languageType, currVal+1); + continue; + } + Schema refSchema = ModelUtils.getReferencedSchema(this.openAPI, oneOfSchema); + String refType = refSchema.getType(); + if (refType == null || refType.equals("object")) { + Integer currVal = importCounts.getOrDefault(languageType, 0); + importCounts.put(languageType, currVal+1); + continue; + } + + CodegenProperty modelProperty = fromProperty("_oneOfSchema", refSchema); + if (modelProperty.isEnum == true) { + Integer currVal = importCounts.getOrDefault(languageType, 0); + importCounts.put(languageType, currVal+1); + continue; + } + + languageType = getTypeDeclaration(refSchema); + if (modelProperty.hasValidation == false) { + Integer currVal = importCounts.getOrDefault(languageType, 0); + importCounts.put(languageType, currVal+1); + continue; + } + Integer currVal = importCounts.getOrDefault(languageType, 0); + importCounts.put(languageType, currVal); + String modelName = toModelName(ModelUtils.getSimpleRef(ref)); + result.imports.add(modelName); + result.oneOf.add(modelName); + currVal = importCounts.getOrDefault(modelName, 0); + importCounts.put(modelName, currVal+1); + } + } + for (Map.Entry entry : importCounts.entrySet()) { + String importName = entry.getKey(); + Integer importCount = entry.getValue(); + if (importCount == 0) { + result.oneOf.remove(importName); + } + } + } + // use this to store the model name like Cat // we can't use result.name because that is used to lookup models in the spec // we can't use result.classname because that stores cat.Cat // we can't use result.classVarName because that stores the variable for making example instances result.unescapedDescription = simpleModelName(name); - // make non-object type models have one property so we can use it to store enums and validations - if (result.isAlias || result.isEnum || result.isArrayModel) { - Schema modelSchema = ModelUtils.getSchema(this.openAPI, result.name); - CodegenProperty modelProperty = fromProperty("value", modelSchema); - if (modelProperty.isEnum == true || modelProperty.hasValidation == true || result.isArrayModel) { - // these models are non-object models with enums and/or validations - // add a single property to the model so we can have a way to access validations - result.isAlias = true; - modelProperty.required = true; - List theProperties = Arrays.asList(modelProperty); - result.setAllVars(theProperties); - result.setVars(theProperties); - result.setRequiredVars(theProperties); - // post process model properties - if (result.vars != null) { - for (CodegenProperty prop : result.vars) { - postProcessModelProperty(result, prop); - } + // this block handles models which have the python base class ModelSimple + // which are responsible for storing validations, enums, and an unnamed value + Schema modelSchema = ModelUtils.getSchema(this.openAPI, result.name); + CodegenProperty modelProperty = fromProperty("_value", modelSchema); + + // import complex type from additional properties + if (result.additionalPropertiesType != null && modelProperty.items != null && modelProperty.items.complexType != null) { + result.imports.add(modelProperty.items.complexType); + } + + Boolean isPythonModelSimpleModel = (result.isEnum || result.isArrayModel || result.isAlias && modelProperty.hasValidation); + if (isPythonModelSimpleModel) { + // In python, classes which inherit from our ModelSimple class store one value, + // like a str, int, list and extra data about that value like validations and enums + + if (result.isEnum) { + // if there is only one allowed value then we know that it should be set, so value is optional + // -> hasRequired = false + // if there are more than one allowed value then value is positional and required so + // -> hasRequired = true + ArrayList values = (ArrayList) result.allowableValues.get("values"); + if (values != null && values.size() > 1) { + result.hasRequired = true; + } + + if (modelProperty.defaultValue != null && result.defaultValue == null) { + result.defaultValue = modelProperty.defaultValue; + } + } else { + if (result.isArrayModel && modelProperty.dataType != null && result.dataType == null) { + // needed for array models with complex types + result.dataType = modelProperty.dataType; + result.arrayModelType = getPythonClassName(result.arrayModelType); + } + + if (result.defaultValue == null) { + result.hasRequired = true; } } } - - // set regex values, before it was only done on model.vars - // fix all property references to non-object models, make those properties non-primitive and + // fix all property references to ModelSimple models, make those properties non-primitive and // set their dataType and complexType to the model name, so documentation will refer to the correct model + // set regex values, before it was only done on model.vars + // NOTE: this is done for models of type != object which are not enums and have validations ArrayList> listOfLists = new ArrayList>(); listOfLists.add(result.vars); listOfLists.add(result.allVars); @@ -883,6 +960,7 @@ public CodegenModel fromModel(String name, Schema schema) { result.imports.add(modelName); } } + // if a class has a property of type self, remove the self import from imports if (result.imports.contains(result.classname)) { result.imports.remove(result.classname); @@ -895,6 +973,60 @@ public CodegenModel fromModel(String name, Schema schema) { return result; } + /** + * returns the OpenAPI type for the property. Use getAlias to handle $ref of primitive type + * We have a custom version of this function because for composed schemas we also want to return the model name + * In DefaultCodegen.java it returns a name built off of individual allOf/anyOf/oneOf which is not what + * python-experimental needs. Python-experimental needs the name of the composed schema + * + * @param schema property schema + * @return string presentation of the type + **/ + @SuppressWarnings("static-method") + @Override + public String getSchemaType(Schema schema) { + if (schema instanceof ComposedSchema) { // composed schema + Schema unaliasSchema = ModelUtils.unaliasSchema(this.openAPI, schema, importMapping); + String ref = unaliasSchema.get$ref(); + if (ref != null) { + String schemaName = ModelUtils.getSimpleRef(unaliasSchema.get$ref()); + if (StringUtils.isNotEmpty(schemaName) && importMapping.containsKey(schemaName)) { + return schemaName; + } + return getAlias(schemaName); + } else { + // we may have be processing the component schema rather than a schema with a $ref + // to a component schema + // so loop through component schemas and use the found one's name if we match + Map schemas = ModelUtils.getSchemas(openAPI); + for (String thisSchemaName : schemas.keySet()) { + Schema thisSchema = schemas.get(thisSchemaName); + if (!ModelUtils.isComposedSchema(thisSchema)) { + continue; + } + if (thisSchema == unaliasSchema) { + if (importMapping.containsKey(thisSchemaName)) { + return thisSchemaName; + } + return getAlias(thisSchemaName); + } + } + LOGGER.warn("Error obtaining the datatype from ref:" + unaliasSchema.get$ref() + ". Default to 'object'"); + return "object"; + } + } + String openAPIType = getSingleSchemaType(schema); + if (typeMapping.containsKey(openAPIType)) { + String type = typeMapping.get(openAPIType); + if (languageSpecificPrimitives.contains(type)) { + return type; + } + } else { + return toModelName(openAPIType); + } + return openAPIType; + } + /** * Output the type declaration of the property * diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/model.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/model.mustache index 490629c5a386..e89b3d563393 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/model.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/model.mustache @@ -33,17 +33,22 @@ from {{packageName}}.model_utils import ( # noqa: F401 {{^interfaces}} -{{#isAlias}} -{{> python-experimental/model_templates/model_simple }} -{{/isAlias}} -{{^isAlias}} {{#isArrayModel}} {{> python-experimental/model_templates/model_simple }} {{/isArrayModel}} +{{#isEnum}} +{{> python-experimental/model_templates/model_simple }} +{{/isEnum}} +{{#isAlias}} +{{> python-experimental/model_templates/model_simple }} +{{/isAlias}} {{^isArrayModel}} +{{^isEnum}} +{{^isAlias}} {{> python-experimental/model_templates/model_normal }} -{{/isArrayModel}} {{/isAlias}} +{{/isEnum}} +{{/isArrayModel}} {{/interfaces}} {{#interfaces}} {{#-last}} diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/model_doc.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/model_doc.mustache index a1e57131bc49..b5aa50c43237 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/model_doc.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/model_doc.mustache @@ -5,6 +5,15 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +{{#isEnum}} +**value** | {{^arrayModelType}}**{{dataType}}**{{/arrayModelType}} | {{description}} | {{#defaultValue}}{{#hasRequired}} if omitted the server will use the default value of {{/hasRequired}}{{^hasRequired}}defaults to {{/hasRequired}}{{{.}}}{{/defaultValue}}{{#allowableValues}}{{#defaultValue}}, {{/defaultValue}} must be one of [{{#enumVars}}{{{value}}}, {{/enumVars}}]{{/allowableValues}} +{{/isEnum}} +{{#isAlias}} +**value** | {{^arrayModelType}}**{{dataType}}**{{/arrayModelType}} | {{description}} | {{#defaultValue}}{{#hasRequired}} if omitted the server will use the default value of {{/hasRequired}}{{^hasRequired}}defaults to {{/hasRequired}}{{{.}}}{{/defaultValue}} +{{/isAlias}} +{{#isArrayModel}} +**value** | {{^arrayModelType}}**{{dataType}}**{{/arrayModelType}}{{#arrayModelType}}[**{{dataType}}**]({{arrayModelType}}.md){{/arrayModelType}} | {{description}} | {{#defaultValue}}{{#hasRequired}} if omitted the server will use the default value of {{/hasRequired}}{{^hasRequired}}defaults to {{/hasRequired}}{{{.}}}{{/defaultValue}} +{{/isArrayModel}} {{#requiredVars}} {{^defaultValue}} **{{name}}** | {{^complexType}}**{{dataType}}**{{/complexType}}{{#complexType}}[**{{dataType}}**]({{complexType}}.md){{/complexType}} | {{description}} | {{#isReadOnly}}[readonly] {{/isReadOnly}} diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/classvars.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/classvars.mustache index 9fc3f83433a8..5186e6621fb3 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/classvars.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/classvars.mustache @@ -1,4 +1,16 @@ allowed_values = { +{{#isEnum}} + ('value',): { +{{#isNullable}} + 'None': None, +{{/isNullable}} +{{#allowableValues}} +{{#enumVars}} + '{{name}}': {{{value}}}, +{{/enumVars}} +{{/allowableValues}} + }, +{{/isEnum}} {{#requiredVars}} {{#isEnum}} ('{{name}}',): { @@ -30,70 +42,24 @@ } validations = { +{{#isAlias}} +{{^isEnum}} +{{^isArrayModel}} + ('value',): { +{{> python-experimental/model_templates/validations }} +{{/isArrayModel}} +{{/isEnum}} +{{/isAlias}} {{#requiredVars}} {{#hasValidation}} ('{{name}}',): { -{{#maxLength}} - 'max_length': {{maxLength}}, -{{/maxLength}} -{{#minLength}} - 'min_length': {{minLength}}, -{{/minLength}} -{{#maxItems}} - 'max_items': {{maxItems}}, -{{/maxItems}} -{{#minItems}} - 'min_items': {{minItems}}, -{{/minItems}} -{{#maximum}} - {{#exclusiveMaximum}}'exclusive_maximum'{{/exclusiveMaximum}}'inclusive_maximum'{{^exclusiveMaximum}}{{/exclusiveMaximum}}: {{maximum}}, -{{/maximum}} -{{#minimum}} - {{#exclusiveMinimum}}'exclusive_minimum'{{/exclusiveMinimum}}'inclusive_minimum'{{^exclusiveMinimum}}{{/exclusiveMinimum}}: {{minimum}}, -{{/minimum}} -{{#pattern}} - 'regex': { - 'pattern': r'{{{vendorExtensions.x-regex}}}', # noqa: E501{{#vendorExtensions.x-modifiers}} - {{#-first}}'flags': (re.{{.}}{{/-first}}{{^-first}} re.{{.}}{{/-first}}{{^-last}} | {{/-last}}{{#-last}}){{/-last}}{{/vendorExtensions.x-modifiers}} - }, -{{/pattern}} -{{#multipleOf}} - 'multiple_of': {{multipleOf}}, -{{/multipleOf}} - }, +{{> python-experimental/model_templates/validations }} {{/hasValidation}} {{/requiredVars}} {{#optionalVars}} {{#hasValidation}} ('{{name}}',): { -{{#maxLength}} - 'max_length': {{maxLength}}, -{{/maxLength}} -{{#minLength}} - 'min_length': {{minLength}}, -{{/minLength}} -{{#maxItems}} - 'max_items': {{maxItems}}, -{{/maxItems}} -{{#minItems}} - 'min_items': {{minItems}}, -{{/minItems}} -{{#maximum}} - {{#exclusiveMaximum}}'exclusive_maximum'{{/exclusiveMaximum}}'inclusive_maximum'{{^exclusiveMaximum}}{{/exclusiveMaximum}}: {{maximum}}, -{{/maximum}} -{{#minimum}} - {{#exclusiveMinimum}}'exclusive_minimum'{{/exclusiveMinimum}}'inclusive_minimum'{{^exclusiveMinimum}}{{/exclusiveMinimum}}: {{minimum}}, -{{/minimum}} -{{#pattern}} - 'regex': { - 'pattern': r'{{{vendorExtensions.x-regex}}}', # noqa: E501{{#vendorExtensions.x-modifiers}} - {{#-first}}'flags': (re.{{.}}{{/-first}}{{^-first}} re.{{.}}{{/-first}}{{^-last}} | {{/-last}}{{#-last}}){{/-last}}{{/vendorExtensions.x-modifiers}} - }, -{{/pattern}} -{{#multipleOf}} - 'multiple_of': {{multipleOf}}, -{{/multipleOf}} - }, +{{> python-experimental/model_templates/validations }} {{/hasValidation}} {{/optionalVars}} } @@ -113,6 +79,15 @@ and the value is attribute type. """ return { +{{#isAlias}} + 'value': ({{{dataType}}},), +{{/isAlias}} +{{#isEnum}} + 'value': ({{{dataType}}},), +{{/isEnum}} +{{#isArrayModel}} + 'value': ({{{dataType}}},), +{{/isArrayModel}} {{#requiredVars}} '{{name}}': ({{{dataType}}},), # noqa: E501 {{/requiredVars}} diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/docstring_init_required_kwargs.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/docstring_init_required_kwargs.mustache new file mode 100644 index 000000000000..b09f3950b900 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/docstring_init_required_kwargs.mustache @@ -0,0 +1,30 @@ + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/method_init_normal.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/method_init_normal.mustache index 9a3aeaefeaf8..7faf7a30ee0e 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/method_init_normal.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/method_init_normal.mustache @@ -9,6 +9,9 @@ {{> python-experimental/model_templates/method_init_shared }} +{{#isEnum}} + self.value = value +{{/isEnum}} {{#requiredVars}} self.{{name}} = {{name}} {{/requiredVars}} diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/method_init_shared.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/method_init_shared.mustache index 78059150f20f..e500b11e70f3 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/method_init_shared.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/method_init_shared.mustache @@ -19,36 +19,7 @@ {{name}} ({{{dataType}}}):{{#description}} {{description}}.{{/description}} defaults to {{{defaultValue}}}{{#allowableValues}}, must be one of [{{#enumVars}}{{{value}}}, {{/enumVars}}]{{/allowableValues}} # noqa: E501 {{/defaultValue}} {{/requiredVars}} - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) +{{> python-experimental/model_templates/docstring_init_required_kwargs }} {{#optionalVars}} {{name}} ({{{dataType}}}):{{#description}} {{description}}.{{/description}} [optional]{{#defaultValue}} if omitted the server will use the default value of {{{defaultValue}}}{{/defaultValue}} # noqa: E501 {{/optionalVars}} diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/method_init_simple.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/method_init_simple.mustache new file mode 100644 index 000000000000..9d59b7ba0914 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/method_init_simple.mustache @@ -0,0 +1,66 @@ + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self{{#hasRequired}}, value{{/hasRequired}}, *args, **kwargs): + """{{classname}} - a model defined in OpenAPI + +{{#hasRequired}} + Args: + value ({{{dataType}}}):{{#description}} {{description}}.{{/description}}{{#defaultValue}} if omitted the server will use the default value of {{{defaultValue}}}{{/defaultValue}}{{#allowableValues}}, must be one of [{{#enumVars}}{{{value}}}, {{/enumVars}}]{{/allowableValues}} # noqa: E501 + +{{/hasRequired}} + Keyword Args: +{{^hasRequired}} + value ({{{dataType}}}):{{#description}} {{description}}.{{/description}}{{#defaultValue}} defaults to {{{defaultValue}}}{{/defaultValue}}{{#allowableValues}}, must be one of [{{#enumVars}}{{{value}}}, {{/enumVars}}]{{/allowableValues}} # noqa: E501 +{{/hasRequired}} +{{> python-experimental/model_templates/docstring_init_required_kwargs }} + """ + +{{^hasRequired}} + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + value = {{{defaultValue}}} +{{/hasRequired}} + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/model_simple.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/model_simple.mustache index bc582ff796d3..1623ca5f6e06 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/model_simple.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/model_simple.mustache @@ -15,4 +15,4 @@ class {{unescapedDescription}}(ModelSimple): _composed_schemas = None -{{> python-experimental/model_templates/method_init_normal}} \ No newline at end of file +{{> python-experimental/model_templates/method_init_simple}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/validations.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/validations.mustache new file mode 100644 index 000000000000..6b91bffe22bd --- /dev/null +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/validations.mustache @@ -0,0 +1,28 @@ +{{#maxLength}} + 'max_length': {{maxLength}}, +{{/maxLength}} +{{#minLength}} + 'min_length': {{minLength}}, +{{/minLength}} +{{#maxItems}} + 'max_items': {{maxItems}}, +{{/maxItems}} +{{#minItems}} + 'min_items': {{minItems}}, +{{/minItems}} +{{#maximum}} + {{#exclusiveMaximum}}'exclusive_maximum'{{/exclusiveMaximum}}'inclusive_maximum'{{^exclusiveMaximum}}{{/exclusiveMaximum}}: {{maximum}}, +{{/maximum}} +{{#minimum}} + {{#exclusiveMinimum}}'exclusive_minimum'{{/exclusiveMinimum}}'inclusive_minimum'{{^exclusiveMinimum}}{{/exclusiveMinimum}}: {{minimum}}, +{{/minimum}} +{{#pattern}} + 'regex': { + 'pattern': r'{{{vendorExtensions.x-regex}}}', # noqa: E501{{#vendorExtensions.x-modifiers}} + {{#-first}}'flags': (re.{{.}}{{/-first}}{{^-first}} re.{{.}}{{/-first}}{{^-last}} | {{/-last}}{{#-last}}){{/-last}}{{/vendorExtensions.x-modifiers}} + }, +{{/pattern}} +{{#multipleOf}} + 'multiple_of': {{multipleOf}}, +{{/multipleOf}} + }, \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/model_utils.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/model_utils.mustache index 58859114bdc1..1323b724991d 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/model_utils.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/model_utils.mustache @@ -54,6 +54,58 @@ class cached_property(object): return result +PRIMITIVE_TYPES = (list, float, int, bool, datetime, date, str, file_type) + +def allows_single_value_input(cls): + """ + This function returns True if the input composed schema model or any + descendant model allows a value only input + This is true for cases where oneOf contains items like: + oneOf: + - float + - NumberWithValidation + - StringEnum + - ArrayModel + - null + TODO: lru_cache this + """ + if ( + issubclass(cls, ModelSimple) or + cls in PRIMITIVE_TYPES + ): + return True + elif issubclass(cls, ModelComposed): + if not cls._composed_schemas['oneOf']: + return False + return any(allows_single_value_input(c) for c in cls._composed_schemas['oneOf']) + return False + +def composed_model_input_classes(cls): + """ + This function returns a list of the possible models that can be accepted as + inputs. + TODO: lru_cache this + """ + if issubclass(cls, ModelSimple) or cls in PRIMITIVE_TYPES: + return [cls] + elif issubclass(cls, ModelNormal): + if cls.discriminator is None: + return [cls] + else: + return get_discriminated_classes(cls) + elif issubclass(cls, ModelComposed): + if not cls._composed_schemas['oneOf']: + return [] + if cls.discriminator is None: + input_classes = [] + for c in cls._composed_schemas['oneOf']: + input_classes.extend(composed_model_input_classes(c)) + return input_classes + else: + return get_discriminated_classes(cls) + return [] + + class OpenApiModel(object): """The base class for all OpenAPIModels""" @@ -66,9 +118,17 @@ class OpenApiModel(object): # pick a new schema/class to instantiate because a discriminator # propertyName value was passed in - if len(args) == 1 and args[0] is None and is_type_nullable(cls): - # The input data is the 'null' value and the type is nullable. - return None + if len(args) == 1: + arg = args[0] + if arg is None and is_type_nullable(cls): + # The input data is the 'null' value and the type is nullable. + return None + + if issubclass(cls, ModelComposed) and allows_single_value_input(cls): + model_kwargs = {} + oneof_instance = get_oneof_instance(cls, model_kwargs, kwargs, model_arg=arg) + return oneof_instance + visited_composed_classes = kwargs.get('_visited_composed_classes', ()) if ( @@ -241,6 +301,10 @@ UPCONVERSION_TYPE_PAIRS = ( (int, float), # A float may be serialized as an integer, e.g. '3' is a valid serialized float. (list, ModelComposed), (dict, ModelComposed), + (str, ModelComposed), + (int, ModelComposed), + (float, ModelComposed), + (list, ModelComposed), (list, ModelNormal), (dict, ModelNormal), (str, ModelSimple), @@ -619,20 +683,53 @@ def remove_uncoercible(required_types_classes, current_item, spec_property_namin results_classes.append(required_type_class) return results_classes +def get_discriminated_classes(cls): + """ + Returns all the classes that a discriminator converts to + TODO: lru_cache this + """ + possible_classes = [] + key = list(cls.discriminator.keys())[0] + if is_type_nullable(cls): + possible_classes.append(cls) + for discr_cls in cls.discriminator[key].values(): + if hasattr(discr_cls, 'discriminator') and discr_cls.discriminator is not None: + possible_classes.extend(get_discriminated_classes(discr_cls)) + else: + possible_classes.append(discr_cls) + return possible_classes + + +def get_possible_classes(cls, from_server_context): + # TODO: lru_cache this + possible_classes = [cls] + if from_server_context: + return possible_classes + if hasattr(cls, 'discriminator') and cls.discriminator is not None: + possible_classes = [] + possible_classes.extend(get_discriminated_classes(cls)) + elif issubclass(cls, ModelComposed): + possible_classes.extend(composed_model_input_classes(cls)) + return possible_classes -def get_required_type_classes(required_types_mixed): + +def get_required_type_classes(required_types_mixed, spec_property_naming): """Converts the tuple required_types into a tuple and a dict described below Args: required_types_mixed (tuple/list): will contain either classes or instance of list or dict + spec_property_naming (bool): if True these values came from the + server, and we use the data types in our endpoints. + If False, we are client side and we need to include + oneOf and discriminator classes inside the data types in our endpoints Returns: (valid_classes, dict_valid_class_to_child_types_mixed): valid_classes (tuple): the valid classes that the current item should be - dict_valid_class_to_child_types_mixed (doct): + dict_valid_class_to_child_types_mixed (dict): valid_class (class): this is the key child_types_mixed (list/dict/tuple): describes the valid child types @@ -650,7 +747,7 @@ def get_required_type_classes(required_types_mixed): valid_classes.append(dict) child_req_types_by_current_type[dict] = required_type[str] else: - valid_classes.append(required_type) + valid_classes.extend(get_possible_classes(required_type, spec_property_naming)) return tuple(valid_classes), child_req_types_by_current_type @@ -803,7 +900,7 @@ def deserialize_model(model_data, model_class, path_to_item, check_type, """Deserializes model_data to model instance. Args: - model_data (list/dict): data to instantiate the model + model_data (int/str/float/bool/none_type/list/dict): data to instantiate the model model_class (OpenApiModel): the model class path_to_item (list): path to the model in the received data check_type (bool): whether to check the data tupe for the values in @@ -829,14 +926,14 @@ def deserialize_model(model_data, model_class, path_to_item, check_type, _spec_property_naming=spec_property_naming) if issubclass(model_class, ModelSimple): - instance = model_class(value=model_data, **kw_args) - return instance - if isinstance(model_data, list): - instance = model_class(*model_data, **kw_args) + return model_class(model_data, **kw_args) + elif isinstance(model_data, list): + return model_class(*model_data, **kw_args) if isinstance(model_data, dict): kw_args.update(model_data) - instance = model_class(**kw_args) - return instance + return model_class(**kw_args) + elif isinstance(model_data, PRIMITIVE_TYPES): + return model_class(model_data, **kw_args) def deserialize_file(response_data, configuration, content_disposition=None): @@ -1019,7 +1116,7 @@ def validate_and_convert_types(input_value, required_types_mixed, path_to_item, Raises: ApiTypeError """ - results = get_required_type_classes(required_types_mixed) + results = get_required_type_classes(required_types_mixed, spec_property_naming) valid_classes, child_req_types_by_current_type = results input_class_simple = get_simple_class(input_value) @@ -1256,7 +1353,7 @@ def get_allof_instances(self, model_args, constant_args): return composed_instances -def get_oneof_instance(self, model_args, constant_args): +def get_oneof_instance(cls, model_kwargs, constant_kwargs, model_arg=None): """ Find the oneOf schema that matches the input data (e.g. payload). If exactly one schema matches the input data, an instance of that schema @@ -1264,25 +1361,33 @@ def get_oneof_instance(self, model_args, constant_args): If zero or more than one schema match the input data, an exception is raised. In OAS 3.x, the payload MUST, by validation, match exactly one of the schemas described by oneOf. + Args: - self: the class we are handling - model_args (dict): var_name to var_value + cls: the class we are handling + model_kwargs (dict): var_name to var_value The input data, e.g. the payload that must match a oneOf schema in the OpenAPI document. - constant_args (dict): var_name to var_value + constant_kwargs (dict): var_name to var_value args that every model requires, including configuration, server and path to item. + Kwargs: + model_arg: (int, float, bool, str, date, datetime, ModelSimple, None): + the value to assign to a primitive class or ModelSimple class + Notes: + - this is only passed in when oneOf includes types which are not object + - None is used to suppress handling of model_arg, nullable models are handled in __new__ + Returns oneof_instance (instance) """ - if len(self._composed_schemas['oneOf']) == 0: + if len(cls._composed_schemas['oneOf']) == 0: return None oneof_instances = [] # Iterate over each oneOf schema and determine if the input data # matches the oneOf schemas. - for oneof_class in self._composed_schemas['oneOf']: + for oneof_class in cls._composed_schemas['oneOf']: # The composed oneOf schema allows the 'null' type and the input data # is the null value. This is a OAS >= 3.1 feature. if oneof_class is none_type: @@ -1290,28 +1395,45 @@ def get_oneof_instance(self, model_args, constant_args): # none_type deserialization is handled in the __new__ method continue - # transform js keys from input data to python keys in fixed_model_args - fixed_model_args = change_keys_js_to_python( - model_args, oneof_class) - - # Extract a dict with the properties that are declared in the oneOf schema. - # Undeclared properties (e.g. properties that are allowed because of the - # additionalProperties attribute in the OAS document) are not added to - # the dict. - kwargs = {} - var_names = set(oneof_class.openapi_types.keys()) - for var_name in var_names: - if var_name in fixed_model_args: - kwargs[var_name] = fixed_model_args[var_name] + single_value_input = allows_single_value_input(oneof_class) + + if not single_value_input: + # transform js keys from input data to python keys in fixed_model_args + fixed_model_args = change_keys_js_to_python( + model_kwargs, oneof_class) + + # Extract a dict with the properties that are declared in the oneOf schema. + # Undeclared properties (e.g. properties that are allowed because of the + # additionalProperties attribute in the OAS document) are not added to + # the dict. + kwargs = {} + var_names = set(oneof_class.openapi_types.keys()) + for var_name in var_names: + if var_name in fixed_model_args: + kwargs[var_name] = fixed_model_args[var_name] + + # do not try to make a model with no input args + if len(kwargs) == 0: + continue - # do not try to make a model with no input args - if len(kwargs) == 0: - continue + # and use it to make the instance + kwargs.update(constant_kwargs) - # and use it to make the instance - kwargs.update(constant_args) try: - oneof_instance = oneof_class(**kwargs) + if not single_value_input: + oneof_instance = oneof_class(**kwargs) + else: + if issubclass(oneof_class, ModelSimple): + oneof_instance = oneof_class(model_arg, **constant_kwargs) + elif oneof_class in PRIMITIVE_TYPES: + oneof_instance = validate_and_convert_types( + model_arg, + (oneof_class,), + constant_kwargs['_path_to_item'], + constant_kwargs['_spec_property_naming'], + constant_kwargs['_check_type'], + configuration=constant_kwargs['_configuration'] + ) oneof_instances.append(oneof_instance) except Exception: pass @@ -1319,13 +1441,13 @@ def get_oneof_instance(self, model_args, constant_args): raise ApiValueError( "Invalid inputs given to generate an instance of %s. None " "of the oneOf schemas matched the input data." % - self.__class__.__name__ + cls.__name__ ) elif len(oneof_instances) > 1: raise ApiValueError( "Invalid inputs given to generate an instance of %s. Multiple " "oneOf schemas matched the inputs, but a max of one is allowed." % - self.__class__.__name__ + cls.__name__ ) return oneof_instances[0] @@ -1465,7 +1587,7 @@ def validate_get_composed_info(constant_args, model_args, self): composed_instances = [] allof_instances = get_allof_instances(self, model_args, constant_args) composed_instances.extend(allof_instances) - oneof_instance = get_oneof_instance(self, model_args, constant_args) + oneof_instance = get_oneof_instance(self.__class__, model_args, constant_args) if oneof_instance is not None: composed_instances.append(oneof_instance) anyof_instances = get_anyof_instances(self, model_args, constant_args) diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonClientExperimentalTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonClientExperimentalTest.java index 143429cb2acb..c627add94243 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonClientExperimentalTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonClientExperimentalTest.java @@ -270,7 +270,7 @@ public void arrayModelTest() { Assert.assertEquals(cm.classname, "sample.Sample"); Assert.assertEquals(cm.classVarName, "sample"); Assert.assertEquals(cm.description, "an array model"); - Assert.assertEquals(cm.vars.size(), 1); // there is one value for Childer definition + Assert.assertEquals(cm.vars.size(), 0); // the array model has no vars Assert.assertEquals(cm.parent, "list"); Assert.assertEquals(cm.imports.size(), 1); Assert.assertEquals(Sets.intersection(cm.imports, Sets.newHashSet("children.Children")).size(), 1); @@ -292,7 +292,7 @@ public void mapModelTest() { Assert.assertEquals(cm.description, "a map model"); Assert.assertEquals(cm.vars.size(), 0); Assert.assertEquals(cm.parent, null); - Assert.assertEquals(cm.imports.size(), 0); + Assert.assertEquals(cm.imports.size(), 1); } @Test(description = "parse date and date-time example value") diff --git a/modules/openapi-generator/src/test/resources/3_0/python-experimental/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml b/modules/openapi-generator/src/test/resources/3_0/python-experimental/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml index fa89ac56e604..470f26a611bd 100644 --- a/modules/openapi-generator/src/test/resources/3_0/python-experimental/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/python-experimental/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml @@ -905,6 +905,26 @@ paths: 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: ComposedOneOfNumberWithValidations + requestBody: + description: Input model + content: + application/json: + schema: + $ref: '#/components/schemas/ComposedOneOfNumberWithValidations' + required: false + responses: + '200': + description: Output model + content: + application/json: + schema: + $ref: '#/components/schemas/ComposedOneOfNumberWithValidations' /fake/refs/object_model_with_ref_props: post: tags: @@ -1837,6 +1857,14 @@ components: type: number minimum: 10 maximum: 20 + ComposedOneOfNumberWithValidations: + 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 Number: type: number String: @@ -2188,4 +2216,4 @@ components: type: string default: '2010-01-01T10:10:10.000111+01:00' example: '2010-01-01T10:10:10.000111+01:00' - format: date-time + format: date-time \ No newline at end of file diff --git a/samples/client/petstore/python-experimental/docs/EnumClass.md b/samples/client/petstore/python-experimental/docs/EnumClass.md index 333307fde46c..4a29732d861c 100644 --- a/samples/client/petstore/python-experimental/docs/EnumClass.md +++ b/samples/client/petstore/python-experimental/docs/EnumClass.md @@ -3,7 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**value** | **str** | | defaults to '-efg' +**value** | **str** | | if omitted the server will use the default value of '-efg', must be one of ["_abc", "-efg", "(xyz)", ] [[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/client/petstore/python-experimental/docs/StringEnum.md b/samples/client/petstore/python-experimental/docs/StringEnum.md index 614a64b88aab..7b720683b6e4 100644 --- a/samples/client/petstore/python-experimental/docs/StringEnum.md +++ b/samples/client/petstore/python-experimental/docs/StringEnum.md @@ -3,7 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**value** | **str** | | +**value** | **str** | | must be one of ["placed", "approved", "delivered", ] [[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/client/petstore/python-experimental/petstore_api/model/animal_farm.py b/samples/client/petstore/python-experimental/petstore_api/model/animal_farm.py index 6f6ea3351a74..4030d038edb3 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/animal_farm.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/animal_farm.py @@ -81,7 +81,7 @@ def openapi_types(): and the value is attribute type. """ return { - 'value': ([animal.Animal],), # noqa: E501 + 'value': ([animal.Animal],), } @cached_property @@ -102,11 +102,11 @@ def discriminator(): ]) @convert_js_args_to_python_args - def __init__(self, value, *args, **kwargs): # noqa: E501 + def __init__(self, value, *args, **kwargs): """animal_farm.AnimalFarm - a model defined in OpenAPI Args: - value ([animal.Animal]): + value ([animal.Animal]): # noqa: E501 Keyword Args: _check_type (bool): if True, values for parameters in openapi_types @@ -163,13 +163,13 @@ def __init__(self, value, *args, **kwargs): # noqa: E501 self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - for var_name, var_value in six.iteritems(kwargs): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) diff --git a/samples/client/petstore/python-experimental/petstore_api/model/enum_class.py b/samples/client/petstore/python-experimental/petstore_api/model/enum_class.py index 896984fc77c2..7c5014fd532b 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/enum_class.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/enum_class.py @@ -81,7 +81,7 @@ def openapi_types(): and the value is attribute type. """ return { - 'value': (str,), # noqa: E501 + 'value': (str,), } @cached_property @@ -102,13 +102,13 @@ def discriminator(): ]) @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 + def __init__(self, value, *args, **kwargs): """enum_class.EnumClass - a model defined in OpenAPI Args: + value (str): if omitted the server will use the default value of '-efg', must be one of ["_abc", "-efg", "(xyz)", ] # noqa: E501 Keyword Args: - value (str): defaults to '-efg', must be one of ["_abc", "-efg", "(xyz)", ] # noqa: E501 _check_type (bool): if True, values for parameters in openapi_types will be type checked and a TypeError will be raised if the wrong type is input. @@ -141,7 +141,6 @@ def __init__(self, *args, **kwargs): # noqa: E501 _visited_composed_classes = (Animal,) """ - value = kwargs.get('value', '-efg') _check_type = kwargs.pop('_check_type', True) _spec_property_naming = kwargs.pop('_spec_property_naming', False) _path_to_item = kwargs.pop('_path_to_item', ()) @@ -164,13 +163,13 @@ def __init__(self, *args, **kwargs): # noqa: E501 self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - for var_name, var_value in six.iteritems(kwargs): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) diff --git a/samples/client/petstore/python-experimental/petstore_api/model/number_with_validations.py b/samples/client/petstore/python-experimental/petstore_api/model/number_with_validations.py index 68e0e7e30e80..ed81cdce6968 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/number_with_validations.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/number_with_validations.py @@ -80,7 +80,7 @@ def openapi_types(): and the value is attribute type. """ return { - 'value': (float,), # noqa: E501 + 'value': (float,), } @cached_property @@ -101,11 +101,11 @@ def discriminator(): ]) @convert_js_args_to_python_args - def __init__(self, value, *args, **kwargs): # noqa: E501 + def __init__(self, value, *args, **kwargs): """number_with_validations.NumberWithValidations - a model defined in OpenAPI Args: - value (float): + value (float): # noqa: E501 Keyword Args: _check_type (bool): if True, values for parameters in openapi_types @@ -162,13 +162,13 @@ def __init__(self, value, *args, **kwargs): # noqa: E501 self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - for var_name, var_value in six.iteritems(kwargs): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) diff --git a/samples/client/petstore/python-experimental/petstore_api/model/string_enum.py b/samples/client/petstore/python-experimental/petstore_api/model/string_enum.py index 9afa80bdc0b3..e8f184f4aeed 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/string_enum.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/string_enum.py @@ -81,7 +81,7 @@ def openapi_types(): and the value is attribute type. """ return { - 'value': (str,), # noqa: E501 + 'value': (str,), } @cached_property @@ -102,11 +102,11 @@ def discriminator(): ]) @convert_js_args_to_python_args - def __init__(self, value, *args, **kwargs): # noqa: E501 + def __init__(self, value, *args, **kwargs): """string_enum.StringEnum - a model defined in OpenAPI Args: - value (str): + value (str):, must be one of ["placed", "approved", "delivered", ] # noqa: E501 Keyword Args: _check_type (bool): if True, values for parameters in openapi_types @@ -163,13 +163,13 @@ def __init__(self, value, *args, **kwargs): # noqa: E501 self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - for var_name, var_value in six.iteritems(kwargs): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) diff --git a/samples/client/petstore/python-experimental/petstore_api/model_utils.py b/samples/client/petstore/python-experimental/petstore_api/model_utils.py index 299a61dc1cc0..f15303a09483 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model_utils.py +++ b/samples/client/petstore/python-experimental/petstore_api/model_utils.py @@ -62,6 +62,58 @@ def __get__(self, instance, cls=None): return result +PRIMITIVE_TYPES = (list, float, int, bool, datetime, date, str, file_type) + +def allows_single_value_input(cls): + """ + This function returns True if the input composed schema model or any + descendant model allows a value only input + This is true for cases where oneOf contains items like: + oneOf: + - float + - NumberWithValidation + - StringEnum + - ArrayModel + - null + TODO: lru_cache this + """ + if ( + issubclass(cls, ModelSimple) or + cls in PRIMITIVE_TYPES + ): + return True + elif issubclass(cls, ModelComposed): + if not cls._composed_schemas['oneOf']: + return False + return any(allows_single_value_input(c) for c in cls._composed_schemas['oneOf']) + return False + +def composed_model_input_classes(cls): + """ + This function returns a list of the possible models that can be accepted as + inputs. + TODO: lru_cache this + """ + if issubclass(cls, ModelSimple) or cls in PRIMITIVE_TYPES: + return [cls] + elif issubclass(cls, ModelNormal): + if cls.discriminator is None: + return [cls] + else: + return get_discriminated_classes(cls) + elif issubclass(cls, ModelComposed): + if not cls._composed_schemas['oneOf']: + return [] + if cls.discriminator is None: + input_classes = [] + for c in cls._composed_schemas['oneOf']: + input_classes.extend(composed_model_input_classes(c)) + return input_classes + else: + return get_discriminated_classes(cls) + return [] + + class OpenApiModel(object): """The base class for all OpenAPIModels""" @@ -138,9 +190,17 @@ def __new__(cls, *args, **kwargs): # pick a new schema/class to instantiate because a discriminator # propertyName value was passed in - if len(args) == 1 and args[0] is None and is_type_nullable(cls): - # The input data is the 'null' value and the type is nullable. - return None + if len(args) == 1: + arg = args[0] + if arg is None and is_type_nullable(cls): + # The input data is the 'null' value and the type is nullable. + return None + + if issubclass(cls, ModelComposed) and allows_single_value_input(cls): + model_kwargs = {} + oneof_instance = get_oneof_instance(cls, model_kwargs, kwargs, model_arg=arg) + return oneof_instance + visited_composed_classes = kwargs.get('_visited_composed_classes', ()) if ( @@ -508,6 +568,10 @@ def __eq__(self, other): (int, float), # A float may be serialized as an integer, e.g. '3' is a valid serialized float. (list, ModelComposed), (dict, ModelComposed), + (str, ModelComposed), + (int, ModelComposed), + (float, ModelComposed), + (list, ModelComposed), (list, ModelNormal), (dict, ModelNormal), (str, ModelSimple), @@ -886,20 +950,53 @@ def remove_uncoercible(required_types_classes, current_item, spec_property_namin results_classes.append(required_type_class) return results_classes +def get_discriminated_classes(cls): + """ + Returns all the classes that a discriminator converts to + TODO: lru_cache this + """ + possible_classes = [] + key = list(cls.discriminator.keys())[0] + if is_type_nullable(cls): + possible_classes.append(cls) + for discr_cls in cls.discriminator[key].values(): + if hasattr(discr_cls, 'discriminator') and discr_cls.discriminator is not None: + possible_classes.extend(get_discriminated_classes(discr_cls)) + else: + possible_classes.append(discr_cls) + return possible_classes + + +def get_possible_classes(cls, from_server_context): + # TODO: lru_cache this + possible_classes = [cls] + if from_server_context: + return possible_classes + if hasattr(cls, 'discriminator') and cls.discriminator is not None: + possible_classes = [] + possible_classes.extend(get_discriminated_classes(cls)) + elif issubclass(cls, ModelComposed): + possible_classes.extend(composed_model_input_classes(cls)) + return possible_classes -def get_required_type_classes(required_types_mixed): + +def get_required_type_classes(required_types_mixed, spec_property_naming): """Converts the tuple required_types into a tuple and a dict described below Args: required_types_mixed (tuple/list): will contain either classes or instance of list or dict + spec_property_naming (bool): if True these values came from the + server, and we use the data types in our endpoints. + If False, we are client side and we need to include + oneOf and discriminator classes inside the data types in our endpoints Returns: (valid_classes, dict_valid_class_to_child_types_mixed): valid_classes (tuple): the valid classes that the current item should be - dict_valid_class_to_child_types_mixed (doct): + dict_valid_class_to_child_types_mixed (dict): valid_class (class): this is the key child_types_mixed (list/dict/tuple): describes the valid child types @@ -917,7 +1014,7 @@ def get_required_type_classes(required_types_mixed): valid_classes.append(dict) child_req_types_by_current_type[dict] = required_type[str] else: - valid_classes.append(required_type) + valid_classes.extend(get_possible_classes(required_type, spec_property_naming)) return tuple(valid_classes), child_req_types_by_current_type @@ -1070,7 +1167,7 @@ def deserialize_model(model_data, model_class, path_to_item, check_type, """Deserializes model_data to model instance. Args: - model_data (list/dict): data to instantiate the model + model_data (int/str/float/bool/none_type/list/dict): data to instantiate the model model_class (OpenApiModel): the model class path_to_item (list): path to the model in the received data check_type (bool): whether to check the data tupe for the values in @@ -1096,14 +1193,14 @@ def deserialize_model(model_data, model_class, path_to_item, check_type, _spec_property_naming=spec_property_naming) if issubclass(model_class, ModelSimple): - instance = model_class(value=model_data, **kw_args) - return instance - if isinstance(model_data, list): - instance = model_class(*model_data, **kw_args) + return model_class(model_data, **kw_args) + elif isinstance(model_data, list): + return model_class(*model_data, **kw_args) if isinstance(model_data, dict): kw_args.update(model_data) - instance = model_class(**kw_args) - return instance + return model_class(**kw_args) + elif isinstance(model_data, PRIMITIVE_TYPES): + return model_class(model_data, **kw_args) def deserialize_file(response_data, configuration, content_disposition=None): @@ -1286,7 +1383,7 @@ def validate_and_convert_types(input_value, required_types_mixed, path_to_item, Raises: ApiTypeError """ - results = get_required_type_classes(required_types_mixed) + results = get_required_type_classes(required_types_mixed, spec_property_naming) valid_classes, child_req_types_by_current_type = results input_class_simple = get_simple_class(input_value) @@ -1523,7 +1620,7 @@ def get_allof_instances(self, model_args, constant_args): return composed_instances -def get_oneof_instance(self, model_args, constant_args): +def get_oneof_instance(cls, model_kwargs, constant_kwargs, model_arg=None): """ Find the oneOf schema that matches the input data (e.g. payload). If exactly one schema matches the input data, an instance of that schema @@ -1531,25 +1628,33 @@ def get_oneof_instance(self, model_args, constant_args): If zero or more than one schema match the input data, an exception is raised. In OAS 3.x, the payload MUST, by validation, match exactly one of the schemas described by oneOf. + Args: - self: the class we are handling - model_args (dict): var_name to var_value + cls: the class we are handling + model_kwargs (dict): var_name to var_value The input data, e.g. the payload that must match a oneOf schema in the OpenAPI document. - constant_args (dict): var_name to var_value + constant_kwargs (dict): var_name to var_value args that every model requires, including configuration, server and path to item. + Kwargs: + model_arg: (int, float, bool, str, date, datetime, ModelSimple, None): + the value to assign to a primitive class or ModelSimple class + Notes: + - this is only passed in when oneOf includes types which are not object + - None is used to suppress handling of model_arg, nullable models are handled in __new__ + Returns oneof_instance (instance) """ - if len(self._composed_schemas['oneOf']) == 0: + if len(cls._composed_schemas['oneOf']) == 0: return None oneof_instances = [] # Iterate over each oneOf schema and determine if the input data # matches the oneOf schemas. - for oneof_class in self._composed_schemas['oneOf']: + for oneof_class in cls._composed_schemas['oneOf']: # The composed oneOf schema allows the 'null' type and the input data # is the null value. This is a OAS >= 3.1 feature. if oneof_class is none_type: @@ -1557,28 +1662,45 @@ def get_oneof_instance(self, model_args, constant_args): # none_type deserialization is handled in the __new__ method continue - # transform js keys from input data to python keys in fixed_model_args - fixed_model_args = change_keys_js_to_python( - model_args, oneof_class) - - # Extract a dict with the properties that are declared in the oneOf schema. - # Undeclared properties (e.g. properties that are allowed because of the - # additionalProperties attribute in the OAS document) are not added to - # the dict. - kwargs = {} - var_names = set(oneof_class.openapi_types.keys()) - for var_name in var_names: - if var_name in fixed_model_args: - kwargs[var_name] = fixed_model_args[var_name] + single_value_input = allows_single_value_input(oneof_class) + + if not single_value_input: + # transform js keys from input data to python keys in fixed_model_args + fixed_model_args = change_keys_js_to_python( + model_kwargs, oneof_class) + + # Extract a dict with the properties that are declared in the oneOf schema. + # Undeclared properties (e.g. properties that are allowed because of the + # additionalProperties attribute in the OAS document) are not added to + # the dict. + kwargs = {} + var_names = set(oneof_class.openapi_types.keys()) + for var_name in var_names: + if var_name in fixed_model_args: + kwargs[var_name] = fixed_model_args[var_name] + + # do not try to make a model with no input args + if len(kwargs) == 0: + continue - # do not try to make a model with no input args - if len(kwargs) == 0: - continue + # and use it to make the instance + kwargs.update(constant_kwargs) - # and use it to make the instance - kwargs.update(constant_args) try: - oneof_instance = oneof_class(**kwargs) + if not single_value_input: + oneof_instance = oneof_class(**kwargs) + else: + if issubclass(oneof_class, ModelSimple): + oneof_instance = oneof_class(model_arg, **constant_kwargs) + elif oneof_class in PRIMITIVE_TYPES: + oneof_instance = validate_and_convert_types( + model_arg, + (oneof_class,), + constant_kwargs['_path_to_item'], + constant_kwargs['_spec_property_naming'], + constant_kwargs['_check_type'], + configuration=constant_kwargs['_configuration'] + ) oneof_instances.append(oneof_instance) except Exception: pass @@ -1586,13 +1708,13 @@ def get_oneof_instance(self, model_args, constant_args): raise ApiValueError( "Invalid inputs given to generate an instance of %s. None " "of the oneOf schemas matched the input data." % - self.__class__.__name__ + cls.__name__ ) elif len(oneof_instances) > 1: raise ApiValueError( "Invalid inputs given to generate an instance of %s. Multiple " "oneOf schemas matched the inputs, but a max of one is allowed." % - self.__class__.__name__ + cls.__name__ ) return oneof_instances[0] @@ -1732,7 +1854,7 @@ def validate_get_composed_info(constant_args, model_args, self): composed_instances = [] allof_instances = get_allof_instances(self, model_args, constant_args) composed_instances.extend(allof_instances) - oneof_instance = get_oneof_instance(self, model_args, constant_args) + oneof_instance = get_oneof_instance(self.__class__, model_args, constant_args) if oneof_instance is not None: composed_instances.append(oneof_instance) anyof_instances = get_anyof_instances(self, model_args, constant_args) diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/x_auth_id_alias/model_utils.py b/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/x_auth_id_alias/model_utils.py index 3606170c6f5f..fb4fc073bd2a 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/x_auth_id_alias/model_utils.py +++ b/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/x_auth_id_alias/model_utils.py @@ -62,6 +62,58 @@ def __get__(self, instance, cls=None): return result +PRIMITIVE_TYPES = (list, float, int, bool, datetime, date, str, file_type) + +def allows_single_value_input(cls): + """ + This function returns True if the input composed schema model or any + descendant model allows a value only input + This is true for cases where oneOf contains items like: + oneOf: + - float + - NumberWithValidation + - StringEnum + - ArrayModel + - null + TODO: lru_cache this + """ + if ( + issubclass(cls, ModelSimple) or + cls in PRIMITIVE_TYPES + ): + return True + elif issubclass(cls, ModelComposed): + if not cls._composed_schemas['oneOf']: + return False + return any(allows_single_value_input(c) for c in cls._composed_schemas['oneOf']) + return False + +def composed_model_input_classes(cls): + """ + This function returns a list of the possible models that can be accepted as + inputs. + TODO: lru_cache this + """ + if issubclass(cls, ModelSimple) or cls in PRIMITIVE_TYPES: + return [cls] + elif issubclass(cls, ModelNormal): + if cls.discriminator is None: + return [cls] + else: + return get_discriminated_classes(cls) + elif issubclass(cls, ModelComposed): + if not cls._composed_schemas['oneOf']: + return [] + if cls.discriminator is None: + input_classes = [] + for c in cls._composed_schemas['oneOf']: + input_classes.extend(composed_model_input_classes(c)) + return input_classes + else: + return get_discriminated_classes(cls) + return [] + + class OpenApiModel(object): """The base class for all OpenAPIModels""" @@ -138,9 +190,17 @@ def __new__(cls, *args, **kwargs): # pick a new schema/class to instantiate because a discriminator # propertyName value was passed in - if len(args) == 1 and args[0] is None and is_type_nullable(cls): - # The input data is the 'null' value and the type is nullable. - return None + if len(args) == 1: + arg = args[0] + if arg is None and is_type_nullable(cls): + # The input data is the 'null' value and the type is nullable. + return None + + if issubclass(cls, ModelComposed) and allows_single_value_input(cls): + model_kwargs = {} + oneof_instance = get_oneof_instance(cls, model_kwargs, kwargs, model_arg=arg) + return oneof_instance + visited_composed_classes = kwargs.get('_visited_composed_classes', ()) if ( @@ -508,6 +568,10 @@ def __eq__(self, other): (int, float), # A float may be serialized as an integer, e.g. '3' is a valid serialized float. (list, ModelComposed), (dict, ModelComposed), + (str, ModelComposed), + (int, ModelComposed), + (float, ModelComposed), + (list, ModelComposed), (list, ModelNormal), (dict, ModelNormal), (str, ModelSimple), @@ -886,20 +950,53 @@ def remove_uncoercible(required_types_classes, current_item, spec_property_namin results_classes.append(required_type_class) return results_classes +def get_discriminated_classes(cls): + """ + Returns all the classes that a discriminator converts to + TODO: lru_cache this + """ + possible_classes = [] + key = list(cls.discriminator.keys())[0] + if is_type_nullable(cls): + possible_classes.append(cls) + for discr_cls in cls.discriminator[key].values(): + if hasattr(discr_cls, 'discriminator') and discr_cls.discriminator is not None: + possible_classes.extend(get_discriminated_classes(discr_cls)) + else: + possible_classes.append(discr_cls) + return possible_classes + + +def get_possible_classes(cls, from_server_context): + # TODO: lru_cache this + possible_classes = [cls] + if from_server_context: + return possible_classes + if hasattr(cls, 'discriminator') and cls.discriminator is not None: + possible_classes = [] + possible_classes.extend(get_discriminated_classes(cls)) + elif issubclass(cls, ModelComposed): + possible_classes.extend(composed_model_input_classes(cls)) + return possible_classes -def get_required_type_classes(required_types_mixed): + +def get_required_type_classes(required_types_mixed, spec_property_naming): """Converts the tuple required_types into a tuple and a dict described below Args: required_types_mixed (tuple/list): will contain either classes or instance of list or dict + spec_property_naming (bool): if True these values came from the + server, and we use the data types in our endpoints. + If False, we are client side and we need to include + oneOf and discriminator classes inside the data types in our endpoints Returns: (valid_classes, dict_valid_class_to_child_types_mixed): valid_classes (tuple): the valid classes that the current item should be - dict_valid_class_to_child_types_mixed (doct): + dict_valid_class_to_child_types_mixed (dict): valid_class (class): this is the key child_types_mixed (list/dict/tuple): describes the valid child types @@ -917,7 +1014,7 @@ def get_required_type_classes(required_types_mixed): valid_classes.append(dict) child_req_types_by_current_type[dict] = required_type[str] else: - valid_classes.append(required_type) + valid_classes.extend(get_possible_classes(required_type, spec_property_naming)) return tuple(valid_classes), child_req_types_by_current_type @@ -1070,7 +1167,7 @@ def deserialize_model(model_data, model_class, path_to_item, check_type, """Deserializes model_data to model instance. Args: - model_data (list/dict): data to instantiate the model + model_data (int/str/float/bool/none_type/list/dict): data to instantiate the model model_class (OpenApiModel): the model class path_to_item (list): path to the model in the received data check_type (bool): whether to check the data tupe for the values in @@ -1096,14 +1193,14 @@ def deserialize_model(model_data, model_class, path_to_item, check_type, _spec_property_naming=spec_property_naming) if issubclass(model_class, ModelSimple): - instance = model_class(value=model_data, **kw_args) - return instance - if isinstance(model_data, list): - instance = model_class(*model_data, **kw_args) + return model_class(model_data, **kw_args) + elif isinstance(model_data, list): + return model_class(*model_data, **kw_args) if isinstance(model_data, dict): kw_args.update(model_data) - instance = model_class(**kw_args) - return instance + return model_class(**kw_args) + elif isinstance(model_data, PRIMITIVE_TYPES): + return model_class(model_data, **kw_args) def deserialize_file(response_data, configuration, content_disposition=None): @@ -1286,7 +1383,7 @@ def validate_and_convert_types(input_value, required_types_mixed, path_to_item, Raises: ApiTypeError """ - results = get_required_type_classes(required_types_mixed) + results = get_required_type_classes(required_types_mixed, spec_property_naming) valid_classes, child_req_types_by_current_type = results input_class_simple = get_simple_class(input_value) @@ -1523,7 +1620,7 @@ def get_allof_instances(self, model_args, constant_args): return composed_instances -def get_oneof_instance(self, model_args, constant_args): +def get_oneof_instance(cls, model_kwargs, constant_kwargs, model_arg=None): """ Find the oneOf schema that matches the input data (e.g. payload). If exactly one schema matches the input data, an instance of that schema @@ -1531,25 +1628,33 @@ def get_oneof_instance(self, model_args, constant_args): If zero or more than one schema match the input data, an exception is raised. In OAS 3.x, the payload MUST, by validation, match exactly one of the schemas described by oneOf. + Args: - self: the class we are handling - model_args (dict): var_name to var_value + cls: the class we are handling + model_kwargs (dict): var_name to var_value The input data, e.g. the payload that must match a oneOf schema in the OpenAPI document. - constant_args (dict): var_name to var_value + constant_kwargs (dict): var_name to var_value args that every model requires, including configuration, server and path to item. + Kwargs: + model_arg: (int, float, bool, str, date, datetime, ModelSimple, None): + the value to assign to a primitive class or ModelSimple class + Notes: + - this is only passed in when oneOf includes types which are not object + - None is used to suppress handling of model_arg, nullable models are handled in __new__ + Returns oneof_instance (instance) """ - if len(self._composed_schemas['oneOf']) == 0: + if len(cls._composed_schemas['oneOf']) == 0: return None oneof_instances = [] # Iterate over each oneOf schema and determine if the input data # matches the oneOf schemas. - for oneof_class in self._composed_schemas['oneOf']: + for oneof_class in cls._composed_schemas['oneOf']: # The composed oneOf schema allows the 'null' type and the input data # is the null value. This is a OAS >= 3.1 feature. if oneof_class is none_type: @@ -1557,28 +1662,45 @@ def get_oneof_instance(self, model_args, constant_args): # none_type deserialization is handled in the __new__ method continue - # transform js keys from input data to python keys in fixed_model_args - fixed_model_args = change_keys_js_to_python( - model_args, oneof_class) - - # Extract a dict with the properties that are declared in the oneOf schema. - # Undeclared properties (e.g. properties that are allowed because of the - # additionalProperties attribute in the OAS document) are not added to - # the dict. - kwargs = {} - var_names = set(oneof_class.openapi_types.keys()) - for var_name in var_names: - if var_name in fixed_model_args: - kwargs[var_name] = fixed_model_args[var_name] + single_value_input = allows_single_value_input(oneof_class) + + if not single_value_input: + # transform js keys from input data to python keys in fixed_model_args + fixed_model_args = change_keys_js_to_python( + model_kwargs, oneof_class) + + # Extract a dict with the properties that are declared in the oneOf schema. + # Undeclared properties (e.g. properties that are allowed because of the + # additionalProperties attribute in the OAS document) are not added to + # the dict. + kwargs = {} + var_names = set(oneof_class.openapi_types.keys()) + for var_name in var_names: + if var_name in fixed_model_args: + kwargs[var_name] = fixed_model_args[var_name] + + # do not try to make a model with no input args + if len(kwargs) == 0: + continue - # do not try to make a model with no input args - if len(kwargs) == 0: - continue + # and use it to make the instance + kwargs.update(constant_kwargs) - # and use it to make the instance - kwargs.update(constant_args) try: - oneof_instance = oneof_class(**kwargs) + if not single_value_input: + oneof_instance = oneof_class(**kwargs) + else: + if issubclass(oneof_class, ModelSimple): + oneof_instance = oneof_class(model_arg, **constant_kwargs) + elif oneof_class in PRIMITIVE_TYPES: + oneof_instance = validate_and_convert_types( + model_arg, + (oneof_class,), + constant_kwargs['_path_to_item'], + constant_kwargs['_spec_property_naming'], + constant_kwargs['_check_type'], + configuration=constant_kwargs['_configuration'] + ) oneof_instances.append(oneof_instance) except Exception: pass @@ -1586,13 +1708,13 @@ def get_oneof_instance(self, model_args, constant_args): raise ApiValueError( "Invalid inputs given to generate an instance of %s. None " "of the oneOf schemas matched the input data." % - self.__class__.__name__ + cls.__name__ ) elif len(oneof_instances) > 1: raise ApiValueError( "Invalid inputs given to generate an instance of %s. Multiple " "oneOf schemas matched the inputs, but a max of one is allowed." % - self.__class__.__name__ + cls.__name__ ) return oneof_instances[0] @@ -1732,7 +1854,7 @@ def validate_get_composed_info(constant_args, model_args, self): composed_instances = [] allof_instances = get_allof_instances(self, model_args, constant_args) composed_instances.extend(allof_instances) - oneof_instance = get_oneof_instance(self, model_args, constant_args) + oneof_instance = get_oneof_instance(self.__class__, model_args, constant_args) if oneof_instance is not None: composed_instances.append(oneof_instance) anyof_instances = get_anyof_instances(self, model_args, constant_args) diff --git a/samples/openapi3/client/features/dynamic-servers/python-experimental/dynamic_servers/model_utils.py b/samples/openapi3/client/features/dynamic-servers/python-experimental/dynamic_servers/model_utils.py index d1069e0651cf..17527b879bd8 100644 --- a/samples/openapi3/client/features/dynamic-servers/python-experimental/dynamic_servers/model_utils.py +++ b/samples/openapi3/client/features/dynamic-servers/python-experimental/dynamic_servers/model_utils.py @@ -62,6 +62,58 @@ def __get__(self, instance, cls=None): return result +PRIMITIVE_TYPES = (list, float, int, bool, datetime, date, str, file_type) + +def allows_single_value_input(cls): + """ + This function returns True if the input composed schema model or any + descendant model allows a value only input + This is true for cases where oneOf contains items like: + oneOf: + - float + - NumberWithValidation + - StringEnum + - ArrayModel + - null + TODO: lru_cache this + """ + if ( + issubclass(cls, ModelSimple) or + cls in PRIMITIVE_TYPES + ): + return True + elif issubclass(cls, ModelComposed): + if not cls._composed_schemas['oneOf']: + return False + return any(allows_single_value_input(c) for c in cls._composed_schemas['oneOf']) + return False + +def composed_model_input_classes(cls): + """ + This function returns a list of the possible models that can be accepted as + inputs. + TODO: lru_cache this + """ + if issubclass(cls, ModelSimple) or cls in PRIMITIVE_TYPES: + return [cls] + elif issubclass(cls, ModelNormal): + if cls.discriminator is None: + return [cls] + else: + return get_discriminated_classes(cls) + elif issubclass(cls, ModelComposed): + if not cls._composed_schemas['oneOf']: + return [] + if cls.discriminator is None: + input_classes = [] + for c in cls._composed_schemas['oneOf']: + input_classes.extend(composed_model_input_classes(c)) + return input_classes + else: + return get_discriminated_classes(cls) + return [] + + class OpenApiModel(object): """The base class for all OpenAPIModels""" @@ -138,9 +190,17 @@ def __new__(cls, *args, **kwargs): # pick a new schema/class to instantiate because a discriminator # propertyName value was passed in - if len(args) == 1 and args[0] is None and is_type_nullable(cls): - # The input data is the 'null' value and the type is nullable. - return None + if len(args) == 1: + arg = args[0] + if arg is None and is_type_nullable(cls): + # The input data is the 'null' value and the type is nullable. + return None + + if issubclass(cls, ModelComposed) and allows_single_value_input(cls): + model_kwargs = {} + oneof_instance = get_oneof_instance(cls, model_kwargs, kwargs, model_arg=arg) + return oneof_instance + visited_composed_classes = kwargs.get('_visited_composed_classes', ()) if ( @@ -508,6 +568,10 @@ def __eq__(self, other): (int, float), # A float may be serialized as an integer, e.g. '3' is a valid serialized float. (list, ModelComposed), (dict, ModelComposed), + (str, ModelComposed), + (int, ModelComposed), + (float, ModelComposed), + (list, ModelComposed), (list, ModelNormal), (dict, ModelNormal), (str, ModelSimple), @@ -886,20 +950,53 @@ def remove_uncoercible(required_types_classes, current_item, spec_property_namin results_classes.append(required_type_class) return results_classes +def get_discriminated_classes(cls): + """ + Returns all the classes that a discriminator converts to + TODO: lru_cache this + """ + possible_classes = [] + key = list(cls.discriminator.keys())[0] + if is_type_nullable(cls): + possible_classes.append(cls) + for discr_cls in cls.discriminator[key].values(): + if hasattr(discr_cls, 'discriminator') and discr_cls.discriminator is not None: + possible_classes.extend(get_discriminated_classes(discr_cls)) + else: + possible_classes.append(discr_cls) + return possible_classes + + +def get_possible_classes(cls, from_server_context): + # TODO: lru_cache this + possible_classes = [cls] + if from_server_context: + return possible_classes + if hasattr(cls, 'discriminator') and cls.discriminator is not None: + possible_classes = [] + possible_classes.extend(get_discriminated_classes(cls)) + elif issubclass(cls, ModelComposed): + possible_classes.extend(composed_model_input_classes(cls)) + return possible_classes -def get_required_type_classes(required_types_mixed): + +def get_required_type_classes(required_types_mixed, spec_property_naming): """Converts the tuple required_types into a tuple and a dict described below Args: required_types_mixed (tuple/list): will contain either classes or instance of list or dict + spec_property_naming (bool): if True these values came from the + server, and we use the data types in our endpoints. + If False, we are client side and we need to include + oneOf and discriminator classes inside the data types in our endpoints Returns: (valid_classes, dict_valid_class_to_child_types_mixed): valid_classes (tuple): the valid classes that the current item should be - dict_valid_class_to_child_types_mixed (doct): + dict_valid_class_to_child_types_mixed (dict): valid_class (class): this is the key child_types_mixed (list/dict/tuple): describes the valid child types @@ -917,7 +1014,7 @@ def get_required_type_classes(required_types_mixed): valid_classes.append(dict) child_req_types_by_current_type[dict] = required_type[str] else: - valid_classes.append(required_type) + valid_classes.extend(get_possible_classes(required_type, spec_property_naming)) return tuple(valid_classes), child_req_types_by_current_type @@ -1070,7 +1167,7 @@ def deserialize_model(model_data, model_class, path_to_item, check_type, """Deserializes model_data to model instance. Args: - model_data (list/dict): data to instantiate the model + model_data (int/str/float/bool/none_type/list/dict): data to instantiate the model model_class (OpenApiModel): the model class path_to_item (list): path to the model in the received data check_type (bool): whether to check the data tupe for the values in @@ -1096,14 +1193,14 @@ def deserialize_model(model_data, model_class, path_to_item, check_type, _spec_property_naming=spec_property_naming) if issubclass(model_class, ModelSimple): - instance = model_class(value=model_data, **kw_args) - return instance - if isinstance(model_data, list): - instance = model_class(*model_data, **kw_args) + return model_class(model_data, **kw_args) + elif isinstance(model_data, list): + return model_class(*model_data, **kw_args) if isinstance(model_data, dict): kw_args.update(model_data) - instance = model_class(**kw_args) - return instance + return model_class(**kw_args) + elif isinstance(model_data, PRIMITIVE_TYPES): + return model_class(model_data, **kw_args) def deserialize_file(response_data, configuration, content_disposition=None): @@ -1286,7 +1383,7 @@ def validate_and_convert_types(input_value, required_types_mixed, path_to_item, Raises: ApiTypeError """ - results = get_required_type_classes(required_types_mixed) + results = get_required_type_classes(required_types_mixed, spec_property_naming) valid_classes, child_req_types_by_current_type = results input_class_simple = get_simple_class(input_value) @@ -1523,7 +1620,7 @@ def get_allof_instances(self, model_args, constant_args): return composed_instances -def get_oneof_instance(self, model_args, constant_args): +def get_oneof_instance(cls, model_kwargs, constant_kwargs, model_arg=None): """ Find the oneOf schema that matches the input data (e.g. payload). If exactly one schema matches the input data, an instance of that schema @@ -1531,25 +1628,33 @@ def get_oneof_instance(self, model_args, constant_args): If zero or more than one schema match the input data, an exception is raised. In OAS 3.x, the payload MUST, by validation, match exactly one of the schemas described by oneOf. + Args: - self: the class we are handling - model_args (dict): var_name to var_value + cls: the class we are handling + model_kwargs (dict): var_name to var_value The input data, e.g. the payload that must match a oneOf schema in the OpenAPI document. - constant_args (dict): var_name to var_value + constant_kwargs (dict): var_name to var_value args that every model requires, including configuration, server and path to item. + Kwargs: + model_arg: (int, float, bool, str, date, datetime, ModelSimple, None): + the value to assign to a primitive class or ModelSimple class + Notes: + - this is only passed in when oneOf includes types which are not object + - None is used to suppress handling of model_arg, nullable models are handled in __new__ + Returns oneof_instance (instance) """ - if len(self._composed_schemas['oneOf']) == 0: + if len(cls._composed_schemas['oneOf']) == 0: return None oneof_instances = [] # Iterate over each oneOf schema and determine if the input data # matches the oneOf schemas. - for oneof_class in self._composed_schemas['oneOf']: + for oneof_class in cls._composed_schemas['oneOf']: # The composed oneOf schema allows the 'null' type and the input data # is the null value. This is a OAS >= 3.1 feature. if oneof_class is none_type: @@ -1557,28 +1662,45 @@ def get_oneof_instance(self, model_args, constant_args): # none_type deserialization is handled in the __new__ method continue - # transform js keys from input data to python keys in fixed_model_args - fixed_model_args = change_keys_js_to_python( - model_args, oneof_class) - - # Extract a dict with the properties that are declared in the oneOf schema. - # Undeclared properties (e.g. properties that are allowed because of the - # additionalProperties attribute in the OAS document) are not added to - # the dict. - kwargs = {} - var_names = set(oneof_class.openapi_types.keys()) - for var_name in var_names: - if var_name in fixed_model_args: - kwargs[var_name] = fixed_model_args[var_name] + single_value_input = allows_single_value_input(oneof_class) + + if not single_value_input: + # transform js keys from input data to python keys in fixed_model_args + fixed_model_args = change_keys_js_to_python( + model_kwargs, oneof_class) + + # Extract a dict with the properties that are declared in the oneOf schema. + # Undeclared properties (e.g. properties that are allowed because of the + # additionalProperties attribute in the OAS document) are not added to + # the dict. + kwargs = {} + var_names = set(oneof_class.openapi_types.keys()) + for var_name in var_names: + if var_name in fixed_model_args: + kwargs[var_name] = fixed_model_args[var_name] + + # do not try to make a model with no input args + if len(kwargs) == 0: + continue - # do not try to make a model with no input args - if len(kwargs) == 0: - continue + # and use it to make the instance + kwargs.update(constant_kwargs) - # and use it to make the instance - kwargs.update(constant_args) try: - oneof_instance = oneof_class(**kwargs) + if not single_value_input: + oneof_instance = oneof_class(**kwargs) + else: + if issubclass(oneof_class, ModelSimple): + oneof_instance = oneof_class(model_arg, **constant_kwargs) + elif oneof_class in PRIMITIVE_TYPES: + oneof_instance = validate_and_convert_types( + model_arg, + (oneof_class,), + constant_kwargs['_path_to_item'], + constant_kwargs['_spec_property_naming'], + constant_kwargs['_check_type'], + configuration=constant_kwargs['_configuration'] + ) oneof_instances.append(oneof_instance) except Exception: pass @@ -1586,13 +1708,13 @@ def get_oneof_instance(self, model_args, constant_args): raise ApiValueError( "Invalid inputs given to generate an instance of %s. None " "of the oneOf schemas matched the input data." % - self.__class__.__name__ + cls.__name__ ) elif len(oneof_instances) > 1: raise ApiValueError( "Invalid inputs given to generate an instance of %s. Multiple " "oneOf schemas matched the inputs, but a max of one is allowed." % - self.__class__.__name__ + cls.__name__ ) return oneof_instances[0] @@ -1732,7 +1854,7 @@ def validate_get_composed_info(constant_args, model_args, self): composed_instances = [] allof_instances = get_allof_instances(self, model_args, constant_args) composed_instances.extend(allof_instances) - oneof_instance = get_oneof_instance(self, model_args, constant_args) + oneof_instance = get_oneof_instance(self.__class__, model_args, constant_args) if oneof_instance is not None: composed_instances.append(oneof_instance) anyof_instances = get_anyof_instances(self, model_args, constant_args) diff --git a/samples/openapi3/client/petstore/python-experimental/.openapi-generator/FILES b/samples/openapi3/client/petstore/python-experimental/.openapi-generator/FILES index 6fe59537b824..88b58048a791 100644 --- a/samples/openapi3/client/petstore/python-experimental/.openapi-generator/FILES +++ b/samples/openapi3/client/petstore/python-experimental/.openapi-generator/FILES @@ -27,6 +27,7 @@ docs/ChildCatAllOf.md docs/ClassModel.md docs/Client.md docs/ComplexQuadrilateral.md +docs/ComposedOneOfNumberWithValidations.md docs/DanishPig.md docs/DefaultApi.md docs/Dog.md @@ -135,6 +136,7 @@ petstore_api/model/child_cat_all_of.py petstore_api/model/class_model.py petstore_api/model/client.py petstore_api/model/complex_quadrilateral.py +petstore_api/model/composed_one_of_number_with_validations.py petstore_api/model/danish_pig.py petstore_api/model/dog.py petstore_api/model/dog_all_of.py diff --git a/samples/openapi3/client/petstore/python-experimental/README.md b/samples/openapi3/client/petstore/python-experimental/README.md index 566caf9dd196..292874633308 100644 --- a/samples/openapi3/client/petstore/python-experimental/README.md +++ b/samples/openapi3/client/petstore/python-experimental/README.md @@ -86,6 +86,7 @@ Class | Method | HTTP request | Description *FakeApi* | [**array_model**](docs/FakeApi.md#array_model) | **POST** /fake/refs/arraymodel | *FakeApi* | [**array_of_enums**](docs/FakeApi.md#array_of_enums) | **POST** /fake/refs/array-of-enums | Array of Enums *FakeApi* | [**boolean**](docs/FakeApi.md#boolean) | **POST** /fake/refs/boolean | +*FakeApi* | [**composed_one_of_number_with_validations**](docs/FakeApi.md#composed_one_of_number_with_validations) | **POST** /fake/refs/composed_one_of_number_with_validations | *FakeApi* | [**fake_health_get**](docs/FakeApi.md#fake_health_get) | **GET** /fake/health | Health check endpoint *FakeApi* | [**number_with_validations**](docs/FakeApi.md#number_with_validations) | **POST** /fake/refs/number | *FakeApi* | [**object_model_with_ref_props**](docs/FakeApi.md#object_model_with_ref_props) | **POST** /fake/refs/object_model_with_ref_props | @@ -150,6 +151,7 @@ Class | Method | HTTP request | Description - [class_model.ClassModel](docs/ClassModel.md) - [client.Client](docs/Client.md) - [complex_quadrilateral.ComplexQuadrilateral](docs/ComplexQuadrilateral.md) + - [composed_one_of_number_with_validations.ComposedOneOfNumberWithValidations](docs/ComposedOneOfNumberWithValidations.md) - [danish_pig.DanishPig](docs/DanishPig.md) - [dog.Dog](docs/Dog.md) - [dog_all_of.DogAllOf](docs/DogAllOf.md) diff --git a/samples/openapi3/client/petstore/python-experimental/docs/ComposedOneOfNumberWithValidations.md b/samples/openapi3/client/petstore/python-experimental/docs/ComposedOneOfNumberWithValidations.md new file mode 100644 index 000000000000..1274b58a506f --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/ComposedOneOfNumberWithValidations.md @@ -0,0 +1,13 @@ +# composed_one_of_number_with_validations.ComposedOneOfNumberWithValidations + +this is a model that allows payloads of type object or number +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**class_name** | **str** | | defaults to nulltype.Null +**color** | **str** | | [optional] if omitted the server will use the default value of 'red' +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | 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-experimental/docs/EnumClass.md b/samples/openapi3/client/petstore/python-experimental/docs/EnumClass.md index 333307fde46c..4a29732d861c 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/EnumClass.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/EnumClass.md @@ -3,7 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**value** | **str** | | defaults to '-efg' +**value** | **str** | | if omitted the server will use the default value of '-efg', must be one of ["_abc", "-efg", "(xyz)", ] [[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-experimental/docs/EnumTest.md b/samples/openapi3/client/petstore/python-experimental/docs/EnumTest.md index 2cc9d528f009..da6c24407081 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/EnumTest.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/EnumTest.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes **enum_string** | **str** | | [optional] **enum_integer** | **int** | | [optional] **enum_number** | **float** | | [optional] -**string_enum** | [**string_enum.StringEnum**](StringEnum.md) | | [optional] +**string_enum** | [**string_enum.StringEnum, none_type**](StringEnum.md) | | [optional] **integer_enum** | [**integer_enum.IntegerEnum**](IntegerEnum.md) | | [optional] **string_enum_with_default_value** | [**string_enum_with_default_value.StringEnumWithDefaultValue**](StringEnumWithDefaultValue.md) | | [optional] **integer_enum_with_default_value** | [**integer_enum_with_default_value.IntegerEnumWithDefaultValue**](IntegerEnumWithDefaultValue.md) | | [optional] diff --git a/samples/openapi3/client/petstore/python-experimental/docs/FakeApi.md b/samples/openapi3/client/petstore/python-experimental/docs/FakeApi.md index ee5ce04f55f5..4ac72980731f 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/FakeApi.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/FakeApi.md @@ -8,6 +8,7 @@ Method | HTTP request | Description [**array_model**](FakeApi.md#array_model) | **POST** /fake/refs/arraymodel | [**array_of_enums**](FakeApi.md#array_of_enums) | **POST** /fake/refs/array-of-enums | Array of Enums [**boolean**](FakeApi.md#boolean) | **POST** /fake/refs/boolean | +[**composed_one_of_number_with_validations**](FakeApi.md#composed_one_of_number_with_validations) | **POST** /fake/refs/composed_one_of_number_with_validations | [**fake_health_get**](FakeApi.md#fake_health_get) | **GET** /fake/health | Health check endpoint [**number_with_validations**](FakeApi.md#number_with_validations) | **POST** /fake/refs/number | [**object_model_with_ref_props**](FakeApi.md#object_model_with_ref_props) | **POST** /fake/refs/object_model_with_ref_props | @@ -277,6 +278,70 @@ No authorization required [[Back to top]](#) [[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_number_with_validations** +> composed_one_of_number_with_validations.ComposedOneOfNumberWithValidations composed_one_of_number_with_validations() + + + +Test serialization of object with $refed properties + +### Example + +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.api import fake_api +from petstore_api.model import composed_one_of_number_with_validations +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() as api_client: + # Create an instance of the API class + api_instance = fake_api.FakeApi(api_client) + composed_one_of_number_with_validations_composed_one_of_number_with_validations = composed_one_of_number_with_validations.ComposedOneOfNumberWithValidations() # composed_one_of_number_with_validations.ComposedOneOfNumberWithValidations | Input model (optional) + + # example passing only required values which don't have defaults set + # and optional values + try: + api_response = api_instance.composed_one_of_number_with_validations(composed_one_of_number_with_validations_composed_one_of_number_with_validations=composed_one_of_number_with_validations_composed_one_of_number_with_validations) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling FakeApi->composed_one_of_number_with_validations: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **composed_one_of_number_with_validations_composed_one_of_number_with_validations** | [**composed_one_of_number_with_validations.ComposedOneOfNumberWithValidations**](ComposedOneOfNumberWithValidations.md)| Input model | [optional] + +### Return type + +[**composed_one_of_number_with_validations.ComposedOneOfNumberWithValidations**](ComposedOneOfNumberWithValidations.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Output model | - | + +[[Back to top]](#) [[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** > health_check_result.HealthCheckResult fake_health_get() diff --git a/samples/openapi3/client/petstore/python-experimental/docs/IntegerEnum.md b/samples/openapi3/client/petstore/python-experimental/docs/IntegerEnum.md index 321f3f84020f..cd3a799f2f57 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/IntegerEnum.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/IntegerEnum.md @@ -3,7 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**value** | **int** | | +**value** | **int** | | 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-experimental/docs/IntegerEnumOneValue.md b/samples/openapi3/client/petstore/python-experimental/docs/IntegerEnumOneValue.md index 5076d652c1d6..e70e4b28e15f 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/IntegerEnumOneValue.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/IntegerEnumOneValue.md @@ -3,7 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**value** | **int** | | defaults to 0 +**value** | **int** | | defaults to 0, 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-experimental/docs/IntegerEnumWithDefaultValue.md b/samples/openapi3/client/petstore/python-experimental/docs/IntegerEnumWithDefaultValue.md index e3c7a1a8cf18..b921f8217e9a 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/IntegerEnumWithDefaultValue.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/IntegerEnumWithDefaultValue.md @@ -3,7 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**value** | **int** | | defaults to 0 +**value** | **int** | | if omitted the server will use the default value of 0, 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-experimental/docs/StringEnum.md b/samples/openapi3/client/petstore/python-experimental/docs/StringEnum.md index 02c6d0a00e39..7b720683b6e4 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/StringEnum.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/StringEnum.md @@ -3,7 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**value** | **str, none_type** | | +**value** | **str** | | must be one of ["placed", "approved", "delivered", ] [[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-experimental/docs/StringEnumWithDefaultValue.md b/samples/openapi3/client/petstore/python-experimental/docs/StringEnumWithDefaultValue.md index 2c54632d5749..b0f8d1be2680 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/StringEnumWithDefaultValue.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/StringEnumWithDefaultValue.md @@ -3,7 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**value** | **str** | | defaults to 'placed' +**value** | **str** | | if omitted the server will use the default value of 'placed', must be one of ["placed", "approved", "delivered", ] [[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-experimental/petstore_api/api/fake_api.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api.py index 338cbf18ff0e..fb29276f752d 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api.py @@ -33,6 +33,7 @@ from petstore_api.model import additional_properties_with_array_of_enums from petstore_api.model import animal_farm from petstore_api.model import array_of_enums +from petstore_api.model import composed_one_of_number_with_validations from petstore_api.model import health_check_result from petstore_api.model import number_with_validations from petstore_api.model import object_model_with_ref_props @@ -500,6 +501,118 @@ def __boolean( callable=__boolean ) + def __composed_one_of_number_with_validations( + self, + **kwargs + ): + """composed_one_of_number_with_validations # noqa: E501 + + Test serialization of object with $refed properties # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.composed_one_of_number_with_validations(async_req=True) + >>> result = thread.get() + + + Keyword Args: + composed_one_of_number_with_validations_composed_one_of_number_with_validations (composed_one_of_number_with_validations.ComposedOneOfNumberWithValidations): Input model. [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): 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. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + composed_one_of_number_with_validations.ComposedOneOfNumberWithValidations + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + return self.call_with_http_info(**kwargs) + + self.composed_one_of_number_with_validations = Endpoint( + settings={ + 'response_type': (composed_one_of_number_with_validations.ComposedOneOfNumberWithValidations,), + 'auth': [], + 'endpoint_path': '/fake/refs/composed_one_of_number_with_validations', + 'operation_id': 'composed_one_of_number_with_validations', + 'http_method': 'POST', + 'servers': None, + }, + params_map={ + 'all': [ + 'composed_one_of_number_with_validations_composed_one_of_number_with_validations', + ], + 'required': [], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'composed_one_of_number_with_validations_composed_one_of_number_with_validations': + (composed_one_of_number_with_validations.ComposedOneOfNumberWithValidations,), + }, + 'attribute_map': { + }, + 'location_map': { + 'composed_one_of_number_with_validations_composed_one_of_number_with_validations': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [ + 'application/json' + ] + }, + api_client=api_client, + callable=__composed_one_of_number_with_validations + ) + def __fake_health_get( self, **kwargs diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/animal_farm.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/animal_farm.py index 6f6ea3351a74..4030d038edb3 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/animal_farm.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/animal_farm.py @@ -81,7 +81,7 @@ def openapi_types(): and the value is attribute type. """ return { - 'value': ([animal.Animal],), # noqa: E501 + 'value': ([animal.Animal],), } @cached_property @@ -102,11 +102,11 @@ def discriminator(): ]) @convert_js_args_to_python_args - def __init__(self, value, *args, **kwargs): # noqa: E501 + def __init__(self, value, *args, **kwargs): """animal_farm.AnimalFarm - a model defined in OpenAPI Args: - value ([animal.Animal]): + value ([animal.Animal]): # noqa: E501 Keyword Args: _check_type (bool): if True, values for parameters in openapi_types @@ -163,13 +163,13 @@ def __init__(self, value, *args, **kwargs): # noqa: E501 self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - for var_name, var_value in six.iteritems(kwargs): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_enums.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_enums.py index 5ce0b86cd088..7e1428454e54 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_enums.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_enums.py @@ -81,7 +81,7 @@ def openapi_types(): and the value is attribute type. """ return { - 'value': ([string_enum.StringEnum, none_type],), # noqa: E501 + 'value': ([string_enum.StringEnum, none_type],), } @cached_property @@ -102,11 +102,11 @@ def discriminator(): ]) @convert_js_args_to_python_args - def __init__(self, value, *args, **kwargs): # noqa: E501 + def __init__(self, value, *args, **kwargs): """array_of_enums.ArrayOfEnums - a model defined in OpenAPI Args: - value ([string_enum.StringEnum, none_type]): + value ([string_enum.StringEnum, none_type]): # noqa: E501 Keyword Args: _check_type (bool): if True, values for parameters in openapi_types @@ -163,13 +163,13 @@ def __init__(self, value, *args, **kwargs): # noqa: E501 self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - for var_name, var_value in six.iteritems(kwargs): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_one_of_number_with_validations.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_one_of_number_with_validations.py new file mode 100644 index 000000000000..22ca4a480ae9 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_one_of_number_with_validations.py @@ -0,0 +1,239 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use 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 __future__ import absolute_import +import re # noqa: F401 +import sys # noqa: F401 + +import six # noqa: F401 +import nulltype # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + int, + none_type, + str, + validate_get_composed_info, +) +try: + from petstore_api.model import animal +except ImportError: + animal = sys.modules[ + 'petstore_api.model.animal'] +try: + from petstore_api.model import number_with_validations +except ImportError: + number_with_validations = sys.modules[ + 'petstore_api.model.number_with_validations'] + + +class ComposedOneOfNumberWithValidations(ModelComposed): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a class method so a model may have properties that are + of type self, this ensures that we don't create a cyclic import + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'class_name': (str,), # noqa: E501 + 'color': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + attribute_map = { + 'class_name': 'className', # noqa: E501 + 'color': 'color', # noqa: E501 + } + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + '_composed_instances', + '_var_name_to_model_instances', + '_additional_properties_model_instances', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """composed_one_of_number_with_validations.ComposedOneOfNumberWithValidations - a model defined in OpenAPI + + Args: + + Keyword Args: + class_name (str): defaults to nulltype.Null # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + color (str): [optional] if omitted the server will use the default value of 'red' # noqa: E501 + """ + + class_name = kwargs.get('class_name', nulltype.Null) + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + '_check_type': _check_type, + '_path_to_item': _path_to_item, + '_spec_property_naming': _spec_property_naming, + '_configuration': _configuration, + '_visited_composed_classes': self._visited_composed_classes, + } + required_args = { + 'class_name': class_name, + } + # remove args whose value is Null because they are unset + required_arg_names = list(required_args.keys()) + for required_arg_name in required_arg_names: + if required_args[required_arg_name] is nulltype.Null: + del required_args[required_arg_name] + model_args = {} + model_args.update(required_args) + model_args.update(kwargs) + composed_info = validate_get_composed_info( + constant_args, model_args, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + unused_args = composed_info[3] + + for var_name, var_value in required_args.items(): + setattr(self, var_name, var_value) + for var_name, var_value in six.iteritems(kwargs): + if var_name in unused_args and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + not self._additional_properties_model_instances: + # discard variable. + continue + setattr(self, var_name, var_value) + + @cached_property + def _composed_schemas(): + # 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 beause 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 { + 'anyOf': [ + ], + 'allOf': [ + ], + 'oneOf': [ + animal.Animal, + date, + none_type, + number_with_validations.NumberWithValidations, + ], + } diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_class.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_class.py index 896984fc77c2..7c5014fd532b 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_class.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_class.py @@ -81,7 +81,7 @@ def openapi_types(): and the value is attribute type. """ return { - 'value': (str,), # noqa: E501 + 'value': (str,), } @cached_property @@ -102,13 +102,13 @@ def discriminator(): ]) @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 + def __init__(self, value, *args, **kwargs): """enum_class.EnumClass - a model defined in OpenAPI Args: + value (str): if omitted the server will use the default value of '-efg', must be one of ["_abc", "-efg", "(xyz)", ] # noqa: E501 Keyword Args: - value (str): defaults to '-efg', must be one of ["_abc", "-efg", "(xyz)", ] # noqa: E501 _check_type (bool): if True, values for parameters in openapi_types will be type checked and a TypeError will be raised if the wrong type is input. @@ -141,7 +141,6 @@ def __init__(self, *args, **kwargs): # noqa: E501 _visited_composed_classes = (Animal,) """ - value = kwargs.get('value', '-efg') _check_type = kwargs.pop('_check_type', True) _spec_property_naming = kwargs.pop('_spec_property_naming', False) _path_to_item = kwargs.pop('_path_to_item', ()) @@ -164,13 +163,13 @@ def __init__(self, *args, **kwargs): # noqa: E501 self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - for var_name, var_value in six.iteritems(kwargs): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_test.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_test.py index 68e839ae9228..722906fbf940 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_test.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_test.py @@ -127,7 +127,7 @@ def openapi_types(): 'enum_string': (str,), # noqa: E501 'enum_integer': (int,), # noqa: E501 'enum_number': (float,), # noqa: E501 - 'string_enum': (string_enum.StringEnum,), # noqa: E501 + 'string_enum': (string_enum.StringEnum, none_type,), # noqa: E501 'integer_enum': (integer_enum.IntegerEnum,), # noqa: E501 'string_enum_with_default_value': (string_enum_with_default_value.StringEnumWithDefaultValue,), # noqa: E501 'integer_enum_with_default_value': (integer_enum_with_default_value.IntegerEnumWithDefaultValue,), # noqa: E501 @@ -202,7 +202,7 @@ def __init__(self, enum_string_required, *args, **kwargs): # noqa: E501 enum_string (str): [optional] # noqa: E501 enum_integer (int): [optional] # noqa: E501 enum_number (float): [optional] # noqa: E501 - string_enum (string_enum.StringEnum): [optional] # noqa: E501 + string_enum (string_enum.StringEnum, none_type): [optional] # noqa: E501 integer_enum (integer_enum.IntegerEnum): [optional] # noqa: E501 string_enum_with_default_value (string_enum_with_default_value.StringEnumWithDefaultValue): [optional] # noqa: E501 integer_enum_with_default_value (integer_enum_with_default_value.IntegerEnumWithDefaultValue): [optional] # noqa: E501 diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum.py index 1f6cfe0f79a5..2a47792756b4 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum.py @@ -81,7 +81,7 @@ def openapi_types(): and the value is attribute type. """ return { - 'value': (int,), # noqa: E501 + 'value': (int,), } @cached_property @@ -102,11 +102,11 @@ def discriminator(): ]) @convert_js_args_to_python_args - def __init__(self, value, *args, **kwargs): # noqa: E501 + def __init__(self, value, *args, **kwargs): """integer_enum.IntegerEnum - a model defined in OpenAPI Args: - value (int): + value (int):, must be one of [0, 1, 2, ] # noqa: E501 Keyword Args: _check_type (bool): if True, values for parameters in openapi_types @@ -163,13 +163,13 @@ def __init__(self, value, *args, **kwargs): # noqa: E501 self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - for var_name, var_value in six.iteritems(kwargs): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_one_value.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_one_value.py index d9f11a5f8a03..0b28c34c3aff 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_one_value.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_one_value.py @@ -79,7 +79,7 @@ def openapi_types(): and the value is attribute type. """ return { - 'value': (int,), # noqa: E501 + 'value': (int,), } @cached_property @@ -100,11 +100,9 @@ def discriminator(): ]) @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 + def __init__(self, *args, **kwargs): """integer_enum_one_value.IntegerEnumOneValue - a model defined in OpenAPI - Args: - Keyword Args: value (int): defaults to 0, must be one of [0, ] # noqa: E501 _check_type (bool): if True, values for parameters in openapi_types @@ -139,7 +137,13 @@ def __init__(self, *args, **kwargs): # noqa: E501 _visited_composed_classes = (Animal,) """ - value = kwargs.get('value', 0) + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + value = 0 _check_type = kwargs.pop('_check_type', True) _spec_property_naming = kwargs.pop('_spec_property_naming', False) _path_to_item = kwargs.pop('_path_to_item', ()) @@ -162,13 +166,13 @@ def __init__(self, *args, **kwargs): # noqa: E501 self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - for var_name, var_value in six.iteritems(kwargs): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_with_default_value.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_with_default_value.py index 474241f0414f..e32d50e3f0ab 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_with_default_value.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_with_default_value.py @@ -81,7 +81,7 @@ def openapi_types(): and the value is attribute type. """ return { - 'value': (int,), # noqa: E501 + 'value': (int,), } @cached_property @@ -102,13 +102,13 @@ def discriminator(): ]) @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 + def __init__(self, value, *args, **kwargs): """integer_enum_with_default_value.IntegerEnumWithDefaultValue - a model defined in OpenAPI Args: + value (int): if omitted the server will use the default value of 0, must be one of [0, 1, 2, ] # noqa: E501 Keyword Args: - value (int): defaults to 0, must be one of [0, 1, 2, ] # noqa: E501 _check_type (bool): if True, values for parameters in openapi_types will be type checked and a TypeError will be raised if the wrong type is input. @@ -141,7 +141,6 @@ def __init__(self, *args, **kwargs): # noqa: E501 _visited_composed_classes = (Animal,) """ - value = kwargs.get('value', 0) _check_type = kwargs.pop('_check_type', True) _spec_property_naming = kwargs.pop('_spec_property_naming', False) _path_to_item = kwargs.pop('_path_to_item', ()) @@ -164,13 +163,13 @@ def __init__(self, *args, **kwargs): # noqa: E501 self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - for var_name, var_value in six.iteritems(kwargs): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/number_with_validations.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/number_with_validations.py index 787ac947db04..b860a7848d67 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/number_with_validations.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/number_with_validations.py @@ -80,7 +80,7 @@ def openapi_types(): and the value is attribute type. """ return { - 'value': (float,), # noqa: E501 + 'value': (float,), } @cached_property @@ -101,11 +101,11 @@ def discriminator(): ]) @convert_js_args_to_python_args - def __init__(self, value, *args, **kwargs): # noqa: E501 + def __init__(self, value, *args, **kwargs): """number_with_validations.NumberWithValidations - a model defined in OpenAPI Args: - value (float): + value (float): # noqa: E501 Keyword Args: _check_type (bool): if True, values for parameters in openapi_types @@ -162,13 +162,13 @@ def __init__(self, value, *args, **kwargs): # noqa: E501 self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - for var_name, var_value in six.iteritems(kwargs): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_enum.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_enum.py index e6f9cb9d6b9f..d34bccbc5965 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_enum.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_enum.py @@ -82,7 +82,7 @@ def openapi_types(): and the value is attribute type. """ return { - 'value': (str, none_type,), # noqa: E501 + 'value': (str,), } @cached_property @@ -103,11 +103,11 @@ def discriminator(): ]) @convert_js_args_to_python_args - def __init__(self, value, *args, **kwargs): # noqa: E501 + def __init__(self, value, *args, **kwargs): """string_enum.StringEnum - a model defined in OpenAPI Args: - value (str, none_type): + value (str):, must be one of ["placed", "approved", "delivered", ] # noqa: E501 Keyword Args: _check_type (bool): if True, values for parameters in openapi_types @@ -164,13 +164,13 @@ def __init__(self, value, *args, **kwargs): # noqa: E501 self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - for var_name, var_value in six.iteritems(kwargs): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_enum_with_default_value.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_enum_with_default_value.py index e2f9933eef66..f02facca01a0 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_enum_with_default_value.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_enum_with_default_value.py @@ -81,7 +81,7 @@ def openapi_types(): and the value is attribute type. """ return { - 'value': (str,), # noqa: E501 + 'value': (str,), } @cached_property @@ -102,13 +102,13 @@ def discriminator(): ]) @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 + def __init__(self, value, *args, **kwargs): """string_enum_with_default_value.StringEnumWithDefaultValue - a model defined in OpenAPI Args: + value (str): if omitted the server will use the default value of 'placed', must be one of ["placed", "approved", "delivered", ] # noqa: E501 Keyword Args: - value (str): defaults to 'placed', must be one of ["placed", "approved", "delivered", ] # noqa: E501 _check_type (bool): if True, values for parameters in openapi_types will be type checked and a TypeError will be raised if the wrong type is input. @@ -141,7 +141,6 @@ def __init__(self, *args, **kwargs): # noqa: E501 _visited_composed_classes = (Animal,) """ - value = kwargs.get('value', 'placed') _check_type = kwargs.pop('_check_type', True) _spec_property_naming = kwargs.pop('_spec_property_naming', False) _path_to_item = kwargs.pop('_path_to_item', ()) @@ -164,13 +163,13 @@ def __init__(self, *args, **kwargs): # noqa: E501 self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - for var_name, var_value in six.iteritems(kwargs): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model_utils.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model_utils.py index 299a61dc1cc0..f15303a09483 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model_utils.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model_utils.py @@ -62,6 +62,58 @@ def __get__(self, instance, cls=None): return result +PRIMITIVE_TYPES = (list, float, int, bool, datetime, date, str, file_type) + +def allows_single_value_input(cls): + """ + This function returns True if the input composed schema model or any + descendant model allows a value only input + This is true for cases where oneOf contains items like: + oneOf: + - float + - NumberWithValidation + - StringEnum + - ArrayModel + - null + TODO: lru_cache this + """ + if ( + issubclass(cls, ModelSimple) or + cls in PRIMITIVE_TYPES + ): + return True + elif issubclass(cls, ModelComposed): + if not cls._composed_schemas['oneOf']: + return False + return any(allows_single_value_input(c) for c in cls._composed_schemas['oneOf']) + return False + +def composed_model_input_classes(cls): + """ + This function returns a list of the possible models that can be accepted as + inputs. + TODO: lru_cache this + """ + if issubclass(cls, ModelSimple) or cls in PRIMITIVE_TYPES: + return [cls] + elif issubclass(cls, ModelNormal): + if cls.discriminator is None: + return [cls] + else: + return get_discriminated_classes(cls) + elif issubclass(cls, ModelComposed): + if not cls._composed_schemas['oneOf']: + return [] + if cls.discriminator is None: + input_classes = [] + for c in cls._composed_schemas['oneOf']: + input_classes.extend(composed_model_input_classes(c)) + return input_classes + else: + return get_discriminated_classes(cls) + return [] + + class OpenApiModel(object): """The base class for all OpenAPIModels""" @@ -138,9 +190,17 @@ def __new__(cls, *args, **kwargs): # pick a new schema/class to instantiate because a discriminator # propertyName value was passed in - if len(args) == 1 and args[0] is None and is_type_nullable(cls): - # The input data is the 'null' value and the type is nullable. - return None + if len(args) == 1: + arg = args[0] + if arg is None and is_type_nullable(cls): + # The input data is the 'null' value and the type is nullable. + return None + + if issubclass(cls, ModelComposed) and allows_single_value_input(cls): + model_kwargs = {} + oneof_instance = get_oneof_instance(cls, model_kwargs, kwargs, model_arg=arg) + return oneof_instance + visited_composed_classes = kwargs.get('_visited_composed_classes', ()) if ( @@ -508,6 +568,10 @@ def __eq__(self, other): (int, float), # A float may be serialized as an integer, e.g. '3' is a valid serialized float. (list, ModelComposed), (dict, ModelComposed), + (str, ModelComposed), + (int, ModelComposed), + (float, ModelComposed), + (list, ModelComposed), (list, ModelNormal), (dict, ModelNormal), (str, ModelSimple), @@ -886,20 +950,53 @@ def remove_uncoercible(required_types_classes, current_item, spec_property_namin results_classes.append(required_type_class) return results_classes +def get_discriminated_classes(cls): + """ + Returns all the classes that a discriminator converts to + TODO: lru_cache this + """ + possible_classes = [] + key = list(cls.discriminator.keys())[0] + if is_type_nullable(cls): + possible_classes.append(cls) + for discr_cls in cls.discriminator[key].values(): + if hasattr(discr_cls, 'discriminator') and discr_cls.discriminator is not None: + possible_classes.extend(get_discriminated_classes(discr_cls)) + else: + possible_classes.append(discr_cls) + return possible_classes + + +def get_possible_classes(cls, from_server_context): + # TODO: lru_cache this + possible_classes = [cls] + if from_server_context: + return possible_classes + if hasattr(cls, 'discriminator') and cls.discriminator is not None: + possible_classes = [] + possible_classes.extend(get_discriminated_classes(cls)) + elif issubclass(cls, ModelComposed): + possible_classes.extend(composed_model_input_classes(cls)) + return possible_classes -def get_required_type_classes(required_types_mixed): + +def get_required_type_classes(required_types_mixed, spec_property_naming): """Converts the tuple required_types into a tuple and a dict described below Args: required_types_mixed (tuple/list): will contain either classes or instance of list or dict + spec_property_naming (bool): if True these values came from the + server, and we use the data types in our endpoints. + If False, we are client side and we need to include + oneOf and discriminator classes inside the data types in our endpoints Returns: (valid_classes, dict_valid_class_to_child_types_mixed): valid_classes (tuple): the valid classes that the current item should be - dict_valid_class_to_child_types_mixed (doct): + dict_valid_class_to_child_types_mixed (dict): valid_class (class): this is the key child_types_mixed (list/dict/tuple): describes the valid child types @@ -917,7 +1014,7 @@ def get_required_type_classes(required_types_mixed): valid_classes.append(dict) child_req_types_by_current_type[dict] = required_type[str] else: - valid_classes.append(required_type) + valid_classes.extend(get_possible_classes(required_type, spec_property_naming)) return tuple(valid_classes), child_req_types_by_current_type @@ -1070,7 +1167,7 @@ def deserialize_model(model_data, model_class, path_to_item, check_type, """Deserializes model_data to model instance. Args: - model_data (list/dict): data to instantiate the model + model_data (int/str/float/bool/none_type/list/dict): data to instantiate the model model_class (OpenApiModel): the model class path_to_item (list): path to the model in the received data check_type (bool): whether to check the data tupe for the values in @@ -1096,14 +1193,14 @@ def deserialize_model(model_data, model_class, path_to_item, check_type, _spec_property_naming=spec_property_naming) if issubclass(model_class, ModelSimple): - instance = model_class(value=model_data, **kw_args) - return instance - if isinstance(model_data, list): - instance = model_class(*model_data, **kw_args) + return model_class(model_data, **kw_args) + elif isinstance(model_data, list): + return model_class(*model_data, **kw_args) if isinstance(model_data, dict): kw_args.update(model_data) - instance = model_class(**kw_args) - return instance + return model_class(**kw_args) + elif isinstance(model_data, PRIMITIVE_TYPES): + return model_class(model_data, **kw_args) def deserialize_file(response_data, configuration, content_disposition=None): @@ -1286,7 +1383,7 @@ def validate_and_convert_types(input_value, required_types_mixed, path_to_item, Raises: ApiTypeError """ - results = get_required_type_classes(required_types_mixed) + results = get_required_type_classes(required_types_mixed, spec_property_naming) valid_classes, child_req_types_by_current_type = results input_class_simple = get_simple_class(input_value) @@ -1523,7 +1620,7 @@ def get_allof_instances(self, model_args, constant_args): return composed_instances -def get_oneof_instance(self, model_args, constant_args): +def get_oneof_instance(cls, model_kwargs, constant_kwargs, model_arg=None): """ Find the oneOf schema that matches the input data (e.g. payload). If exactly one schema matches the input data, an instance of that schema @@ -1531,25 +1628,33 @@ def get_oneof_instance(self, model_args, constant_args): If zero or more than one schema match the input data, an exception is raised. In OAS 3.x, the payload MUST, by validation, match exactly one of the schemas described by oneOf. + Args: - self: the class we are handling - model_args (dict): var_name to var_value + cls: the class we are handling + model_kwargs (dict): var_name to var_value The input data, e.g. the payload that must match a oneOf schema in the OpenAPI document. - constant_args (dict): var_name to var_value + constant_kwargs (dict): var_name to var_value args that every model requires, including configuration, server and path to item. + Kwargs: + model_arg: (int, float, bool, str, date, datetime, ModelSimple, None): + the value to assign to a primitive class or ModelSimple class + Notes: + - this is only passed in when oneOf includes types which are not object + - None is used to suppress handling of model_arg, nullable models are handled in __new__ + Returns oneof_instance (instance) """ - if len(self._composed_schemas['oneOf']) == 0: + if len(cls._composed_schemas['oneOf']) == 0: return None oneof_instances = [] # Iterate over each oneOf schema and determine if the input data # matches the oneOf schemas. - for oneof_class in self._composed_schemas['oneOf']: + for oneof_class in cls._composed_schemas['oneOf']: # The composed oneOf schema allows the 'null' type and the input data # is the null value. This is a OAS >= 3.1 feature. if oneof_class is none_type: @@ -1557,28 +1662,45 @@ def get_oneof_instance(self, model_args, constant_args): # none_type deserialization is handled in the __new__ method continue - # transform js keys from input data to python keys in fixed_model_args - fixed_model_args = change_keys_js_to_python( - model_args, oneof_class) - - # Extract a dict with the properties that are declared in the oneOf schema. - # Undeclared properties (e.g. properties that are allowed because of the - # additionalProperties attribute in the OAS document) are not added to - # the dict. - kwargs = {} - var_names = set(oneof_class.openapi_types.keys()) - for var_name in var_names: - if var_name in fixed_model_args: - kwargs[var_name] = fixed_model_args[var_name] + single_value_input = allows_single_value_input(oneof_class) + + if not single_value_input: + # transform js keys from input data to python keys in fixed_model_args + fixed_model_args = change_keys_js_to_python( + model_kwargs, oneof_class) + + # Extract a dict with the properties that are declared in the oneOf schema. + # Undeclared properties (e.g. properties that are allowed because of the + # additionalProperties attribute in the OAS document) are not added to + # the dict. + kwargs = {} + var_names = set(oneof_class.openapi_types.keys()) + for var_name in var_names: + if var_name in fixed_model_args: + kwargs[var_name] = fixed_model_args[var_name] + + # do not try to make a model with no input args + if len(kwargs) == 0: + continue - # do not try to make a model with no input args - if len(kwargs) == 0: - continue + # and use it to make the instance + kwargs.update(constant_kwargs) - # and use it to make the instance - kwargs.update(constant_args) try: - oneof_instance = oneof_class(**kwargs) + if not single_value_input: + oneof_instance = oneof_class(**kwargs) + else: + if issubclass(oneof_class, ModelSimple): + oneof_instance = oneof_class(model_arg, **constant_kwargs) + elif oneof_class in PRIMITIVE_TYPES: + oneof_instance = validate_and_convert_types( + model_arg, + (oneof_class,), + constant_kwargs['_path_to_item'], + constant_kwargs['_spec_property_naming'], + constant_kwargs['_check_type'], + configuration=constant_kwargs['_configuration'] + ) oneof_instances.append(oneof_instance) except Exception: pass @@ -1586,13 +1708,13 @@ def get_oneof_instance(self, model_args, constant_args): raise ApiValueError( "Invalid inputs given to generate an instance of %s. None " "of the oneOf schemas matched the input data." % - self.__class__.__name__ + cls.__name__ ) elif len(oneof_instances) > 1: raise ApiValueError( "Invalid inputs given to generate an instance of %s. Multiple " "oneOf schemas matched the inputs, but a max of one is allowed." % - self.__class__.__name__ + cls.__name__ ) return oneof_instances[0] @@ -1732,7 +1854,7 @@ def validate_get_composed_info(constant_args, model_args, self): composed_instances = [] allof_instances = get_allof_instances(self, model_args, constant_args) composed_instances.extend(allof_instances) - oneof_instance = get_oneof_instance(self, model_args, constant_args) + oneof_instance = get_oneof_instance(self.__class__, model_args, constant_args) if oneof_instance is not None: composed_instances.append(oneof_instance) anyof_instances = get_anyof_instances(self, model_args, constant_args) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/__init__.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/__init__.py index 47aa61feb41a..5f23a67ada11 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/__init__.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/__init__.py @@ -35,6 +35,7 @@ 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_one_of_number_with_validations import ComposedOneOfNumberWithValidations from petstore_api.model.danish_pig import DanishPig from petstore_api.model.dog import Dog from petstore_api.model.dog_all_of import DogAllOf diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_composed_one_of_number_with_validations.py b/samples/openapi3/client/petstore/python-experimental/test/test_composed_one_of_number_with_validations.py new file mode 100644 index 000000000000..28df8eae3ebb --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_composed_one_of_number_with_validations.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://openapi-generator.tech +""" + + +from __future__ import absolute_import +import sys +import unittest + +import petstore_api +try: + from petstore_api.model import animal +except ImportError: + animal = sys.modules[ + 'petstore_api.model.animal'] +from petstore_api.model.composed_one_of_number_with_validations import ComposedOneOfNumberWithValidations + + +class TestComposedOneOfNumberWithValidations(unittest.TestCase): + """ComposedOneOfNumberWithValidations unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testComposedOneOfNumberWithValidations(self): + """Test ComposedOneOfNumberWithValidations""" + # we can make an instance that stores float data + inst = ComposedOneOfNumberWithValidations(10.0) + from petstore_api.model import number_with_validations + assert isinstance(inst, number_with_validations.NumberWithValidations) + # we can make an instance that stores object (dict) data + inst = ComposedOneOfNumberWithValidations(class_name="Cat", color="black") + assert isinstance(inst, ComposedOneOfNumberWithValidations) + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_drawing.py b/samples/openapi3/client/petstore/python-experimental/test/test_drawing.py index dbfba3ea700f..c70267b13754 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_drawing.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_drawing.py @@ -118,7 +118,7 @@ def test_deserialize_oneof_reference(self): "Required value type is {} and passed type was {} at {}") with self.assertRaisesRegexp( petstore_api.ApiTypeError, - err_msg.format("main_shape", "Shape", "NoneType", "\['main_shape'\]") + err_msg.format("main_shape", "one of \[ComplexQuadrilateral, EquilateralTriangle, IsoscelesTriangle, ScaleneTriangle, SimpleQuadrilateral\]", "NoneType", "\['main_shape'\]") ): inst = Drawing( # 'main_shape' has type 'Shape', which is a oneOf [triangle, quadrilateral] diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_fake_api.py b/samples/openapi3/client/petstore/python-experimental/test/test_fake_api.py index f79919650e73..4b165e8c8684 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_fake_api.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_fake_api.py @@ -142,7 +142,6 @@ def test_array_of_enums(self): assert isinstance(response, array_of_enums.ArrayOfEnums) assert response.value == value - def test_number_with_validations(self): """Test case for number_with_validations @@ -173,6 +172,44 @@ def test_object_model_with_ref_props(self): assert endpoint.openapi_types['body'] == (object_model_with_ref_props.ObjectModelWithRefProps,) assert endpoint.settings['response_type'] == (object_model_with_ref_props.ObjectModelWithRefProps,) + def test_composed_one_of_number_with_validations(self): + """Test case for composed_one_of_number_with_validations + + """ + from petstore_api.model import animal, composed_one_of_number_with_validations, number_with_validations + endpoint = self.api.composed_one_of_number_with_validations + assert endpoint.openapi_types['composed_one_of_number_with_validations_composed_one_of_number_with_validations'] == ( + composed_one_of_number_with_validations.ComposedOneOfNumberWithValidations,) + assert endpoint.settings['response_type'] == ( + composed_one_of_number_with_validations.ComposedOneOfNumberWithValidations,) + + # serialization + deserialization works + num_with_validations = number_with_validations.NumberWithValidations(10.0) + cat_in_composed = composed_one_of_number_with_validations.ComposedOneOfNumberWithValidations( + class_name="Cat", color="black" + ) + import datetime + date = datetime.date(1970, 1, 1) + body_value_simple = [ + (num_with_validations, 10.0), + (cat_in_composed, {"className": "Cat", "color": "black"}), + (None, None), + (date, '1970-01-01'), + ] + for (body, value_simple) in body_value_simple: + with patch.object(RESTClientObject, 'request') as mock_method: + mock_method.return_value = self.mock_response(value_simple) + + response = endpoint(composed_one_of_number_with_validations_composed_one_of_number_with_validations=body) + self.assert_request_called_with( + mock_method, + 'http://petstore.swagger.io:80/v2/fake/refs/composed_one_of_number_with_validations', + value_simple + ) + + assert isinstance(response, body.__class__) + assert response == body + def test_string(self): """Test case for string diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_integer_enum_one_value.py b/samples/openapi3/client/petstore/python-experimental/test/test_integer_enum_one_value.py index 8cf89c4de1c4..7ad6dc5f08f5 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_integer_enum_one_value.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_integer_enum_one_value.py @@ -32,6 +32,9 @@ def testIntegerEnumOneValue(self): model = IntegerEnumOneValue() assert model.value == 0, "With only one option, the value is assigned automatically" + model = IntegerEnumOneValue(0) + assert model.value == 0, "We can also pass in the value as a positional arg" + model = IntegerEnumOneValue(value=0) assert model.value == 0, "We can also pass in the value as a named argument" From 0e0f8eb74c64f4e6eccaebbc318e6acc121cd162 Mon Sep 17 00:00:00 2001 From: Justin Black Date: Sun, 19 Jul 2020 09:45:56 -0700 Subject: [PATCH 037/129] [python-experimental] Removes python2 (#6991) * Removes future from python-exp v3 sample * Removes future from python-exp v2 sample * Deletes future from remaining python-exp files * Removes six from python-exp templates * Removes six from python-exp samples * Removes mock from python-exp * Python-exp switched to py3 * Removes python 2.7 for python-exp ci testing * Requires python>=3.3 for python-exp * Reverts unnecessary changes to two templates --- .../PythonClientExperimentalCodegen.java | 32 +- .../python-experimental/README.mustache | 2 +- .../README_common.mustache | 1 - .../README_onlypackage.mustache | 1 - .../python-experimental/__init__api.mustache | 2 +- .../__init__package.mustache | 2 - .../python/python-experimental/api.mustache | 7 - .../python-experimental/api_client.mustache | 27 +- .../api_doc_example.mustache | 1 - .../python-experimental/api_test.mustache | 2 - .../configuration.mustache | 632 ++++++++++++++++++ .../python-experimental/exceptions.mustache | 129 ++++ .../python-experimental/gitlab-ci.mustache | 35 + .../python/python-experimental/model.mustache | 4 - .../method_init_composed.mustache | 2 +- .../method_init_normal.mustache | 2 +- .../methods_todict_tostr_eq_shared.mustache | 7 +- .../methods_tostr_eq_simple.mustache | 8 +- .../python-experimental/model_test.mustache | 1 - .../python-experimental/model_utils.mustache | 54 +- .../python-experimental/requirements.mustache | 2 - .../python/python-experimental/rest.mustache | 279 ++++++++ .../python/python-experimental/setup.mustache | 4 +- .../python-experimental/signing.mustache | 3 +- .../test-requirements.mustache | 7 +- .../python/python-experimental/tox.mustache | 9 + .../python-experimental/travis.mustache | 21 + .../python-experimental/.gitlab-ci.yml | 3 - .../petstore/python-experimental/.travis.yml | 1 - .../petstore/python-experimental/Makefile | 5 +- .../petstore/python-experimental/README.md | 3 +- .../docs/AnotherFakeApi.md | 1 - .../python-experimental/docs/FakeApi.md | 16 - .../docs/FakeClassnameTags123Api.md | 1 - .../python-experimental/docs/PetApi.md | 9 - .../python-experimental/docs/StoreApi.md | 4 - .../python-experimental/docs/UserApi.md | 8 - .../petstore_api/__init__.py | 2 - .../petstore_api/api/__init__.py | 14 +- .../petstore_api/api/another_fake_api.py | 7 - .../petstore_api/api/fake_api.py | 7 - .../api/fake_classname_tags_123_api.py | 7 - .../petstore_api/api/pet_api.py | 7 - .../petstore_api/api/store_api.py | 7 - .../petstore_api/api/user_api.py | 7 - .../petstore_api/api_client.py | 27 +- .../petstore_api/configuration.py | 19 +- .../petstore_api/exceptions.py | 4 +- .../model/additional_properties_any_type.py | 6 +- .../model/additional_properties_array.py | 6 +- .../model/additional_properties_boolean.py | 6 +- .../model/additional_properties_class.py | 6 +- .../model/additional_properties_integer.py | 6 +- .../model/additional_properties_number.py | 6 +- .../model/additional_properties_object.py | 6 +- .../model/additional_properties_string.py | 6 +- .../petstore_api/model/animal.py | 6 +- .../petstore_api/model/animal_farm.py | 4 - .../petstore_api/model/api_response.py | 6 +- .../model/array_of_array_of_number_only.py | 6 +- .../model/array_of_number_only.py | 6 +- .../petstore_api/model/array_test.py | 6 +- .../petstore_api/model/capitalization.py | 6 +- .../petstore_api/model/cat.py | 6 +- .../petstore_api/model/cat_all_of.py | 6 +- .../petstore_api/model/category.py | 6 +- .../petstore_api/model/child.py | 6 +- .../petstore_api/model/child_all_of.py | 6 +- .../petstore_api/model/child_cat.py | 6 +- .../petstore_api/model/child_cat_all_of.py | 6 +- .../petstore_api/model/child_dog.py | 6 +- .../petstore_api/model/child_dog_all_of.py | 6 +- .../petstore_api/model/child_lizard.py | 6 +- .../petstore_api/model/child_lizard_all_of.py | 6 +- .../petstore_api/model/class_model.py | 6 +- .../petstore_api/model/client.py | 6 +- .../petstore_api/model/dog.py | 6 +- .../petstore_api/model/dog_all_of.py | 6 +- .../petstore_api/model/enum_arrays.py | 6 +- .../petstore_api/model/enum_class.py | 4 - .../petstore_api/model/enum_test.py | 6 +- .../petstore_api/model/file.py | 6 +- .../model/file_schema_test_class.py | 6 +- .../petstore_api/model/format_test.py | 6 +- .../petstore_api/model/grandparent.py | 6 +- .../petstore_api/model/grandparent_animal.py | 6 +- .../petstore_api/model/has_only_read_only.py | 6 +- .../petstore_api/model/list.py | 6 +- .../petstore_api/model/map_test.py | 6 +- ...perties_and_additional_properties_class.py | 6 +- .../petstore_api/model/model200_response.py | 6 +- .../petstore_api/model/model_return.py | 6 +- .../petstore_api/model/name.py | 6 +- .../petstore_api/model/number_only.py | 6 +- .../model/number_with_validations.py | 4 - .../model/object_model_with_ref_props.py | 6 +- .../petstore_api/model/order.py | 6 +- .../petstore_api/model/parent.py | 6 +- .../petstore_api/model/parent_all_of.py | 6 +- .../petstore_api/model/parent_pet.py | 6 +- .../petstore_api/model/pet.py | 6 +- .../petstore_api/model/player.py | 6 +- .../petstore_api/model/read_only_first.py | 6 +- .../petstore_api/model/special_model_name.py | 6 +- .../petstore_api/model/string_boolean_map.py | 6 +- .../petstore_api/model/string_enum.py | 4 - .../petstore_api/model/tag.py | 6 +- .../petstore_api/model/type_holder_default.py | 6 +- .../petstore_api/model/type_holder_example.py | 6 +- .../petstore_api/model/user.py | 6 +- .../petstore_api/model/xml_item.py | 6 +- .../petstore_api/model_utils.py | 76 +-- .../python-experimental/petstore_api/rest.py | 8 +- .../petstore/python-experimental/pom.xml | 2 +- .../python-experimental/requirements.txt | 2 - .../petstore/python-experimental/setup.py | 4 +- .../python-experimental/test-requirements.txt | 5 +- .../test_additional_properties_any_type.py | 1 - .../test/test_additional_properties_array.py | 1 - .../test_additional_properties_boolean.py | 1 - .../test/test_additional_properties_class.py | 1 - .../test_additional_properties_integer.py | 1 - .../test/test_additional_properties_number.py | 1 - .../test/test_additional_properties_object.py | 1 - .../test/test_additional_properties_string.py | 1 - .../python-experimental/test/test_animal.py | 1 - .../test/test_animal_farm.py | 1 - .../test/test_another_fake_api.py | 2 - .../test/test_api_response.py | 1 - .../test_array_of_array_of_number_only.py | 1 - .../test/test_array_of_number_only.py | 1 - .../test/test_array_test.py | 1 - .../test/test_capitalization.py | 1 - .../python-experimental/test/test_cat.py | 1 - .../test/test_cat_all_of.py | 1 - .../python-experimental/test/test_category.py | 1 - .../python-experimental/test/test_child.py | 3 +- .../test/test_child_all_of.py | 1 - .../test/test_child_cat.py | 1 - .../test/test_child_cat_all_of.py | 1 - .../test/test_child_dog.py | 1 - .../test/test_child_dog_all_of.py | 1 - .../test/test_child_lizard.py | 1 - .../test/test_child_lizard_all_of.py | 1 - .../test/test_class_model.py | 1 - .../python-experimental/test/test_client.py | 1 - .../python-experimental/test/test_dog.py | 3 +- .../test/test_dog_all_of.py | 1 - .../test/test_enum_arrays.py | 1 - .../test/test_enum_class.py | 1 - .../test/test_enum_test.py | 1 - .../python-experimental/test/test_fake_api.py | 9 +- .../test/test_fake_classname_tags_123_api.py | 2 - .../python-experimental/test/test_file.py | 1 - .../test/test_file_schema_test_class.py | 1 - .../test/test_format_test.py | 1 - .../test/test_grandparent.py | 1 - .../test/test_grandparent_animal.py | 1 - .../test/test_has_only_read_only.py | 1 - .../python-experimental/test/test_list.py | 1 - .../python-experimental/test/test_map_test.py | 1 - ...perties_and_additional_properties_class.py | 1 - .../test/test_model200_response.py | 1 - .../test/test_model_return.py | 1 - .../python-experimental/test/test_name.py | 1 - .../test/test_number_only.py | 1 - .../test/test_number_with_validations.py | 1 - .../test/test_object_model_with_ref_props.py | 3 +- .../python-experimental/test/test_order.py | 1 - .../python-experimental/test/test_parent.py | 1 - .../test/test_parent_all_of.py | 1 - .../test/test_parent_pet.py | 1 - .../python-experimental/test/test_pet.py | 1 - .../python-experimental/test/test_pet_api.py | 2 - .../python-experimental/test/test_player.py | 1 - .../test/test_read_only_first.py | 1 - .../test/test_special_model_name.py | 1 - .../test/test_store_api.py | 2 - .../test/test_string_boolean_map.py | 1 - .../test/test_string_enum.py | 1 - .../python-experimental/test/test_tag.py | 1 - .../test/test_type_holder_default.py | 1 - .../test/test_type_holder_example.py | 1 - .../python-experimental/test/test_user.py | 1 - .../python-experimental/test/test_user_api.py | 2 - .../python-experimental/test/test_xml_item.py | 1 - .../{test_python2_and_3.sh => test_python.sh} | 0 .../python-experimental/test_python2.sh | 33 - .../tests/test_api_exception.py | 1 - .../tests/test_deserialization.py | 9 +- .../python-experimental/tests/test_pet_api.py | 7 +- .../tests/test_serialization.py | 4 - .../petstore/python-experimental/tox.ini | 2 +- .../python-experimental/.gitlab-ci.yml | 3 - .../python-experimental/.travis.yml | 1 - .../python-experimental/README.md | 3 +- .../python-experimental/docs/UsageApi.md | 4 - .../python-experimental/requirements.txt | 2 - .../python-experimental/setup.py | 4 +- .../python-experimental/test-requirements.txt | 5 +- .../test/test_usage_api.py | 2 - .../tests/test_api_keys.py | 2 - .../python-experimental/tox.ini | 2 +- .../x_auth_id_alias/__init__.py | 2 - .../x_auth_id_alias/api/__init__.py | 9 +- .../x_auth_id_alias/api/usage_api.py | 7 - .../x_auth_id_alias/api_client.py | 27 +- .../x_auth_id_alias/configuration.py | 19 +- .../x_auth_id_alias/exceptions.py | 4 +- .../x_auth_id_alias/model_utils.py | 76 +-- .../x_auth_id_alias/rest.py | 8 +- .../python-experimental/.gitlab-ci.yml | 3 - .../python-experimental/.travis.yml | 1 - .../python-experimental/README.md | 3 +- .../python-experimental/docs/UsageApi.md | 2 - .../dynamic_servers/__init__.py | 2 - .../dynamic_servers/api/__init__.py | 9 +- .../dynamic_servers/api/usage_api.py | 7 - .../dynamic_servers/api_client.py | 27 +- .../dynamic_servers/configuration.py | 19 +- .../dynamic_servers/exceptions.py | 4 +- .../dynamic_servers/model_utils.py | 76 +-- .../dynamic_servers/rest.py | 8 +- .../python-experimental/requirements.txt | 2 - .../python-experimental/setup.py | 4 +- .../python-experimental/test-requirements.txt | 5 +- .../test/test_usage_api.py | 2 - .../python-experimental/tox.ini | 2 +- .../python-experimental/.gitlab-ci.yml | 3 - .../petstore/python-experimental/.travis.yml | 1 - .../petstore/python-experimental/Makefile | 5 +- .../petstore/python-experimental/README.md | 3 +- .../docs/AnotherFakeApi.md | 1 - .../python-experimental/docs/DefaultApi.md | 1 - .../python-experimental/docs/FakeApi.md | 19 - .../docs/FakeClassnameTags123Api.md | 1 - .../python-experimental/docs/PetApi.md | 9 - .../python-experimental/docs/StoreApi.md | 4 - .../python-experimental/docs/UserApi.md | 8 - .../petstore_api/__init__.py | 2 - .../petstore_api/api/__init__.py | 15 +- .../petstore_api/api/another_fake_api.py | 7 - .../petstore_api/api/default_api.py | 7 - .../petstore_api/api/fake_api.py | 7 - .../api/fake_classname_tags_123_api.py | 7 - .../petstore_api/api/pet_api.py | 7 - .../petstore_api/api/store_api.py | 7 - .../petstore_api/api/user_api.py | 7 - .../petstore_api/api_client.py | 27 +- .../petstore_api/configuration.py | 19 +- .../petstore_api/exceptions.py | 4 +- .../model/additional_properties_class.py | 6 +- ...ditional_properties_with_array_of_enums.py | 6 +- .../petstore_api/model/address.py | 6 +- .../petstore_api/model/animal.py | 6 +- .../petstore_api/model/animal_farm.py | 4 - .../petstore_api/model/api_response.py | 6 +- .../petstore_api/model/apple.py | 6 +- .../petstore_api/model/apple_req.py | 6 +- .../model/array_of_array_of_number_only.py | 6 +- .../petstore_api/model/array_of_enums.py | 4 - .../model/array_of_number_only.py | 6 +- .../petstore_api/model/array_test.py | 6 +- .../petstore_api/model/banana.py | 6 +- .../petstore_api/model/banana_req.py | 6 +- .../petstore_api/model/basque_pig.py | 6 +- .../petstore_api/model/capitalization.py | 6 +- .../petstore_api/model/cat.py | 6 +- .../petstore_api/model/cat_all_of.py | 6 +- .../petstore_api/model/category.py | 6 +- .../petstore_api/model/child_cat.py | 6 +- .../petstore_api/model/child_cat_all_of.py | 6 +- .../petstore_api/model/class_model.py | 6 +- .../petstore_api/model/client.py | 6 +- .../model/complex_quadrilateral.py | 6 +- ...composed_one_of_number_with_validations.py | 6 +- .../petstore_api/model/danish_pig.py | 6 +- .../petstore_api/model/dog.py | 6 +- .../petstore_api/model/dog_all_of.py | 6 +- .../petstore_api/model/drawing.py | 6 +- .../petstore_api/model/enum_arrays.py | 6 +- .../petstore_api/model/enum_class.py | 4 - .../petstore_api/model/enum_test.py | 6 +- .../model/equilateral_triangle.py | 6 +- .../petstore_api/model/file.py | 6 +- .../model/file_schema_test_class.py | 6 +- .../petstore_api/model/foo.py | 6 +- .../petstore_api/model/format_test.py | 6 +- .../petstore_api/model/fruit.py | 6 +- .../petstore_api/model/fruit_req.py | 6 +- .../petstore_api/model/gm_fruit.py | 6 +- .../petstore_api/model/grandparent_animal.py | 6 +- .../petstore_api/model/has_only_read_only.py | 6 +- .../petstore_api/model/health_check_result.py | 6 +- .../petstore_api/model/inline_object.py | 6 +- .../petstore_api/model/inline_object1.py | 6 +- .../petstore_api/model/inline_object2.py | 6 +- .../petstore_api/model/inline_object3.py | 6 +- .../petstore_api/model/inline_object4.py | 6 +- .../petstore_api/model/inline_object5.py | 6 +- .../model/inline_response_default.py | 6 +- .../petstore_api/model/integer_enum.py | 4 - .../model/integer_enum_one_value.py | 4 - .../model/integer_enum_with_default_value.py | 4 - .../petstore_api/model/isosceles_triangle.py | 6 +- .../petstore_api/model/list.py | 6 +- .../petstore_api/model/mammal.py | 6 +- .../petstore_api/model/map_test.py | 6 +- ...perties_and_additional_properties_class.py | 6 +- .../petstore_api/model/model200_response.py | 6 +- .../petstore_api/model/model_return.py | 6 +- .../petstore_api/model/name.py | 6 +- .../petstore_api/model/nullable_class.py | 6 +- .../petstore_api/model/nullable_shape.py | 6 +- .../petstore_api/model/number_only.py | 6 +- .../model/number_with_validations.py | 4 - .../model/object_model_with_ref_props.py | 6 +- .../petstore_api/model/order.py | 6 +- .../petstore_api/model/parent_pet.py | 6 +- .../petstore_api/model/pet.py | 6 +- .../petstore_api/model/pig.py | 6 +- .../petstore_api/model/quadrilateral.py | 6 +- .../model/quadrilateral_interface.py | 6 +- .../petstore_api/model/read_only_first.py | 6 +- .../petstore_api/model/scalene_triangle.py | 6 +- .../petstore_api/model/shape.py | 6 +- .../petstore_api/model/shape_interface.py | 6 +- .../petstore_api/model/shape_or_null.py | 6 +- .../model/simple_quadrilateral.py | 6 +- .../petstore_api/model/special_model_name.py | 6 +- .../petstore_api/model/string_boolean_map.py | 6 +- .../petstore_api/model/string_enum.py | 4 - .../model/string_enum_with_default_value.py | 4 - .../petstore_api/model/tag.py | 6 +- .../petstore_api/model/triangle.py | 6 +- .../petstore_api/model/triangle_interface.py | 6 +- .../petstore_api/model/user.py | 6 +- .../petstore_api/model/whale.py | 6 +- .../petstore_api/model/zebra.py | 6 +- .../petstore_api/model_utils.py | 76 +-- .../python-experimental/petstore_api/rest.py | 8 +- .../petstore_api/signing.py | 3 +- .../petstore/python-experimental/pom.xml | 2 +- .../python-experimental/requirements.txt | 2 - .../petstore/python-experimental/setup.py | 4 +- .../python-experimental/test-requirements.txt | 5 +- .../test/test_additional_properties_class.py | 1 - ...ditional_properties_with_array_of_enums.py | 6 +- .../python-experimental/test/test_address.py | 1 - .../python-experimental/test/test_animal.py | 1 - .../test/test_animal_farm.py | 1 - .../test/test_another_fake_api.py | 2 - .../test/test_api_response.py | 1 - .../python-experimental/test/test_apple.py | 1 - .../test/test_apple_req.py | 1 - .../test_array_of_array_of_number_only.py | 1 - .../test/test_array_of_enums.py | 1 - .../test/test_array_of_number_only.py | 1 - .../test/test_array_test.py | 1 - .../python-experimental/test/test_banana.py | 1 - .../test/test_banana_req.py | 1 - .../test/test_basque_pig.py | 1 - .../test/test_capitalization.py | 1 - .../python-experimental/test/test_cat.py | 1 - .../test/test_cat_all_of.py | 1 - .../python-experimental/test/test_category.py | 1 - .../test/test_child_cat.py | 1 - .../test/test_child_cat_all_of.py | 1 - .../test/test_class_model.py | 1 - .../python-experimental/test/test_client.py | 1 - .../test/test_complex_quadrilateral.py | 1 - ...composed_one_of_number_with_validations.py | 1 - .../test/test_danish_pig.py | 1 - .../test/test_default_api.py | 2 - .../python-experimental/test/test_dog.py | 1 - .../test/test_dog_all_of.py | 1 - .../python-experimental/test/test_drawing.py | 9 +- .../test/test_enum_arrays.py | 1 - .../test/test_enum_class.py | 1 - .../test/test_enum_test.py | 1 - .../test/test_equilateral_triangle.py | 1 - .../python-experimental/test/test_fake_api.py | 10 +- .../test/test_fake_classname_tags_123_api.py | 2 - .../python-experimental/test/test_file.py | 1 - .../test/test_file_schema_test_class.py | 1 - .../python-experimental/test/test_foo.py | 1 - .../test/test_format_test.py | 1 - .../python-experimental/test/test_fruit.py | 1 - .../test/test_fruit_req.py | 1 - .../python-experimental/test/test_gm_fruit.py | 1 - .../test/test_grandparent_animal.py | 1 - .../test/test_has_only_read_only.py | 1 - .../test/test_health_check_result.py | 1 - .../test/test_inline_object.py | 1 - .../test/test_inline_object1.py | 1 - .../test/test_inline_object2.py | 1 - .../test/test_inline_object3.py | 1 - .../test/test_inline_object4.py | 1 - .../test/test_inline_object5.py | 1 - .../test/test_inline_response_default.py | 1 - .../test/test_integer_enum.py | 1 - .../test/test_integer_enum_one_value.py | 1 - .../test_integer_enum_with_default_value.py | 1 - .../test/test_isosceles_triangle.py | 1 - .../python-experimental/test/test_list.py | 1 - .../python-experimental/test/test_mammal.py | 1 - .../python-experimental/test/test_map_test.py | 1 - ...perties_and_additional_properties_class.py | 1 - .../test/test_model200_response.py | 1 - .../test/test_model_return.py | 1 - .../python-experimental/test/test_name.py | 1 - .../test/test_nullable_class.py | 1 - .../test/test_nullable_shape.py | 1 - .../test/test_number_only.py | 1 - .../test/test_number_with_validations.py | 1 - .../test/test_object_model_with_ref_props.py | 3 +- .../python-experimental/test/test_order.py | 1 - .../test/test_parent_pet.py | 1 - .../python-experimental/test/test_pet.py | 1 - .../python-experimental/test/test_pet_api.py | 2 - .../python-experimental/test/test_pig.py | 1 - .../test/test_quadrilateral.py | 1 - .../test/test_quadrilateral_interface.py | 1 - .../test/test_read_only_first.py | 1 - .../test/test_scalene_triangle.py | 1 - .../python-experimental/test/test_shape.py | 7 +- .../test/test_shape_interface.py | 1 - .../test/test_shape_or_null.py | 1 - .../test/test_simple_quadrilateral.py | 1 - .../test/test_special_model_name.py | 1 - .../test/test_store_api.py | 2 - .../test/test_string_boolean_map.py | 1 - .../test/test_string_enum.py | 1 - .../test_string_enum_with_default_value.py | 1 - .../python-experimental/test/test_tag.py | 3 +- .../python-experimental/test/test_triangle.py | 1 - .../test/test_triangle_interface.py | 1 - .../python-experimental/test/test_user.py | 1 - .../python-experimental/test/test_user_api.py | 2 - .../python-experimental/test/test_whale.py | 1 - .../python-experimental/test/test_zebra.py | 1 - .../{test_python2_and_3.sh => test_python.sh} | 0 .../python-experimental/test_python2.sh | 33 - .../tests/test_deserialization.py | 8 +- .../tests/test_discard_unknown_properties.py | 2 - .../tests/test_http_signature.py | 10 +- .../petstore/python-experimental/tox.ini | 2 +- 447 files changed, 1512 insertions(+), 1859 deletions(-) create mode 100644 modules/openapi-generator/src/main/resources/python/python-experimental/configuration.mustache create mode 100644 modules/openapi-generator/src/main/resources/python/python-experimental/exceptions.mustache create mode 100644 modules/openapi-generator/src/main/resources/python/python-experimental/gitlab-ci.mustache create mode 100644 modules/openapi-generator/src/main/resources/python/python-experimental/rest.mustache create mode 100644 modules/openapi-generator/src/main/resources/python/python-experimental/tox.mustache create mode 100644 modules/openapi-generator/src/main/resources/python/python-experimental/travis.mustache rename samples/client/petstore/python-experimental/{test_python2_and_3.sh => test_python.sh} (100%) delete mode 100644 samples/client/petstore/python-experimental/test_python2.sh rename samples/openapi3/client/petstore/python-experimental/{test_python2_and_3.sh => test_python.sh} (100%) delete mode 100755 samples/openapi3/client/petstore/python-experimental/test_python2.sh diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientExperimentalCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientExperimentalCodegen.java index d9ab10d57173..bf9789740337 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientExperimentalCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientExperimentalCodegen.java @@ -140,6 +140,20 @@ public void processOpts() { supportingFiles.remove(new SupportingFile("__init__model.mustache", packagePath() + File.separatorChar + "models", "__init__.py")); supportingFiles.add(new SupportingFile("python-experimental/__init__model.mustache", packagePath() + File.separatorChar + "model", "__init__.py")); + supportingFiles.remove(new SupportingFile("configuration.mustache", packagePath(), "configuration.py")); + supportingFiles.add(new SupportingFile("python-experimental/configuration.mustache", packagePath(), "configuration.py")); + + supportingFiles.remove(new SupportingFile("__init__api.mustache", packagePath() + File.separatorChar + "api", "__init__.py")); + supportingFiles.add(new SupportingFile("python-experimental/__init__api.mustache", packagePath() + File.separatorChar + "api", "__init__.py")); + + supportingFiles.remove(new SupportingFile("exceptions.mustache", packagePath(), "exceptions.py")); + supportingFiles.add(new SupportingFile("python-experimental/exceptions.mustache", packagePath(), "exceptions.py")); + + if ("urllib3".equals(getLibrary())) { + supportingFiles.remove(new SupportingFile("rest.mustache", packagePath(), "rest.py")); + supportingFiles.add(new SupportingFile("python-experimental/rest.mustache", packagePath(), "rest.py")); + } + supportingFiles.remove(new SupportingFile("__init__package.mustache", packagePath(), "__init__.py")); supportingFiles.add(new SupportingFile("python-experimental/__init__package.mustache", packagePath(), "__init__.py")); @@ -176,12 +190,18 @@ public void processOpts() { supportingFiles.add(new SupportingFile(readmeTemplate, "", readmePath)); if (!generateSourceCodeOnly) { - supportingFiles.remove(new SupportingFile("setup.mustache", "", "setup.py")); - supportingFiles.add(new SupportingFile("python-experimental/setup.mustache", "", "setup.py")); - supportingFiles.remove(new SupportingFile("requirements.mustache", "", "requirements.txt")); - supportingFiles.add(new SupportingFile("python-experimental/requirements.mustache", "", "requirements.txt")); - supportingFiles.remove(new SupportingFile("test-requirements.mustache", "", "test-requirements.txt")); - supportingFiles.add(new SupportingFile("python-experimental/test-requirements.mustache", "", "test-requirements.txt")); + supportingFiles.remove(new SupportingFile("travis.mustache", "", ".travis.yml")); + supportingFiles.add(new SupportingFile("python-experimental/travis.mustache", "", ".travis.yml")); + supportingFiles.remove(new SupportingFile("gitlab-ci.mustache", "", ".gitlab-ci.yml")); + supportingFiles.add(new SupportingFile("python-experimental/gitlab-ci.mustache", "", ".gitlab-ci.yml")); + supportingFiles.remove(new SupportingFile("tox.mustache", "", "tox.ini")); + supportingFiles.add(new SupportingFile("python-experimental/tox.mustache", "", "tox.ini")); + supportingFiles.remove(new SupportingFile("setup.mustache", "", "setup.py")); + supportingFiles.add(new SupportingFile("python-experimental/setup.mustache", "", "setup.py")); + supportingFiles.remove(new SupportingFile("requirements.mustache", "", "requirements.txt")); + supportingFiles.add(new SupportingFile("python-experimental/requirements.mustache", "", "requirements.txt")); + supportingFiles.remove(new SupportingFile("test-requirements.mustache", "", "test-requirements.txt")); + supportingFiles.add(new SupportingFile("python-experimental/test-requirements.mustache", "", "test-requirements.txt")); } // default this to true so the python ModelSimple models will be generated diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/README.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/README.mustache index 72c7f3de3f04..3fb507c5748a 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/README.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/README.mustache @@ -17,7 +17,7 @@ For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}}) ## Requirements. -Python 2.7 and 3.4+ +Python 3.4+ ## Installation & Usage ### pip install diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/README_common.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/README_common.mustache index 0f6dcb41d6f6..b996e676d115 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/README_common.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/README_common.mustache @@ -1,5 +1,4 @@ ```python -from __future__ import print_function {{#apiInfo}}{{#apis}}{{^hasMore}}{{#hasHttpSignatureMethods}}import datetime{{/hasHttpSignatureMethods}}{{/hasMore}}{{/apis}}{{/apiInfo}} import time import {{{packageName}}} diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/README_onlypackage.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/README_onlypackage.mustache index 11c002c9aa53..ee90ce7903ef 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/README_onlypackage.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/README_onlypackage.mustache @@ -26,7 +26,6 @@ This python library package is generated without supporting files like setup.py To be able to use it, you will need these dependencies in your own package that uses this library: * urllib3 >= 1.15 -* six >= 1.10 * certifi * python-dateutil {{#asyncio}} diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/__init__api.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/__init__api.mustache index d37ee6c78b29..1d37d3395142 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/__init__api.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/__init__api.mustache @@ -1,3 +1,3 @@ # do not import all apis 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 +# if you need the ability to import all apis from one package, import them with # from {{packageName}.apis import DefaultApi, PetApi \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/__init__package.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/__init__package.mustache index a949d5085067..d0746d3aa687 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/__init__package.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/__init__package.mustache @@ -4,8 +4,6 @@ {{>partial_header}} -from __future__ import absolute_import - __version__ = "{{packageVersion}}" # import ApiClient diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/api.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/api.mustache index ad5decabf012..776acbf5ecaa 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/api.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/api.mustache @@ -2,14 +2,9 @@ {{>partial_header}} -from __future__ import absolute_import - import re # noqa: F401 import sys # noqa: F401 -# python 2 and python 3 compatibility library -import six - from {{packageName}}.api_client import ApiClient, Endpoint from {{packageName}}.model_utils import ( # noqa: F401 check_allowed_values, @@ -17,9 +12,7 @@ from {{packageName}}.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_and_convert_types ) {{#imports}} diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache index d3b0b6f60e97..b7112d202b98 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache @@ -1,6 +1,5 @@ # coding: utf-8 {{>partial_header}} -from __future__ import absolute_import import json import atexit @@ -8,10 +7,8 @@ import mimetypes from multiprocessing.pool import ThreadPool import os import re +from urllib.parse import quote -# python 2 and python 3 compatibility library -import six -from six.moves.urllib.parse import quote {{#tornado}} import tornado.gen {{/tornado}} @@ -29,10 +26,8 @@ from {{packageName}}.model_utils import ( datetime, deserialize_file, file_type, - int, model_to_dict, none_type, - str, validate_and_convert_types ) @@ -59,10 +54,8 @@ class ApiClient(object): to the API. More threads means more concurrent API requests. """ - # six.binary_type python2=str, python3=bytes - # six.text_type python2=unicode, python3=str PRIMITIVE_TYPES = ( - (float, bool, six.binary_type, six.text_type) + six.integer_types + float, bool, bytes, str, int ) _pool = None @@ -189,7 +182,7 @@ class ApiClient(object): _preload_content=_preload_content, _request_timeout=_request_timeout) except ApiException as e: - e.body = e.body.decode('utf-8') if six.PY3 else e.body + e.body = e.body.decode('utf-8') raise e content_type = response_data.getheader('content-type') @@ -207,7 +200,7 @@ class ApiClient(object): {{/tornado}} return return_data - if six.PY3 and response_type not in ["file", "bytes"]: + if response_type not in ["file", "bytes"]: match = None if content_type is not None: match = re.search(r"charset=([a-zA-Z\-\d]+)[\s\;]?", content_type) @@ -277,7 +270,7 @@ class ApiClient(object): return self.sanitize_for_serialization(obj.value) return {key: self.sanitize_for_serialization(val) - for key, val in six.iteritems(obj_dict)} + for key, val in obj_dict.items()} def deserialize(self, response, response_type, _check_type): """Deserializes response into an object. @@ -477,7 +470,7 @@ class ApiClient(object): new_params = [] if collection_formats is None: collection_formats = {} - for k, v in six.iteritems(params) if isinstance(params, dict) else params: # noqa: E501 + for k, v in params.items() if isinstance(params, dict) else params: # noqa: E501 if k in collection_formats: collection_format = collection_formats[k] if collection_format == 'multi': @@ -508,7 +501,7 @@ class ApiClient(object): return [] params = [] - for param_name, file_instances in six.iteritems(files): + for param_name, file_instances in files.items(): if file_instances is None: # if the file field is nullable, skip None values continue @@ -692,7 +685,7 @@ class Endpoint(object): if kwargs['_check_input_type'] is False: return - for key, value in six.iteritems(kwargs): + for key, value in kwargs.items(): fixed_val = validate_and_convert_types( value, self.openapi_types[key], @@ -714,7 +707,7 @@ class Endpoint(object): 'query': [] } - for param_name, param_value in six.iteritems(kwargs): + for param_name, param_value in kwargs.items(): param_location = self.location_map.get(param_name) if param_location is None: continue @@ -772,7 +765,7 @@ class Endpoint(object): ) _host = None - for key, value in six.iteritems(kwargs): + for key, value in kwargs.items(): if key not in self.params_map['all']: raise ApiTypeError( "Got an unexpected parameter '%s'" diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/api_doc_example.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/api_doc_example.mustache index 23cf85e9dffa..b7bbc009f5c8 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/api_doc_example.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/api_doc_example.mustache @@ -1,5 +1,4 @@ ```python -from __future__ import print_function import time import {{{packageName}}} from {{apiPackage}} import {{classVarName}} diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/api_test.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/api_test.mustache index e04b32f96edb..f9276b443ce6 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/api_test.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/api_test.mustache @@ -2,8 +2,6 @@ {{>partial_header}} -from __future__ import absolute_import - import unittest import {{packageName}} diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/configuration.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/configuration.mustache new file mode 100644 index 000000000000..8b911bdddd9c --- /dev/null +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/configuration.mustache @@ -0,0 +1,632 @@ +# coding: utf-8 + +{{>partial_header}} + +import copy +import logging +{{^asyncio}} +import multiprocessing +{{/asyncio}} +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' +} + +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 discard_unknown_keys: Boolean value indicating whether to discard + unknown properties. A server may send a response that includes additional + properties that are not known by the client in the following scenarios: + 1. The OpenAPI document is incomplete, i.e. it does not match the server + implementation. + 2. The client was generated using an older version of the OpenAPI document + and the server has been upgraded since then. + If a schema in the OpenAPI document defines the additionalProperties attribute, + then all undeclared properties received by the server are injected into the + additional properties map. In that case, there are undeclared properties, and + nothing to discard. + :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. +{{#hasHttpSignatureMethods}} + :param signing_info: Configuration parameters for the HTTP signature security scheme. + Must be an instance of {{{packageName}}}.signing.HttpSigningConfiguration +{{/hasHttpSignatureMethods}} + :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. + +{{#hasAuthMethods}} + :Example: +{{#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 +{{/hasApiKeyMethods}} +{{#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', +) + +{{/hasHttpBasicMethods}} +{{#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) + ) +) +{{/hasHttpSignatureMethods}} +{{/hasAuthMethods}} + """ + + _default = None + + def __init__(self, host=None, + api_key=None, api_key_prefix=None, + username=None, password=None, + discard_unknown_keys=False, + disabled_client_side_validations="", +{{#hasHttpSignatureMethods}} + signing_info=None, +{{/hasHttpSignatureMethods}} + server_index=None, server_variables=None, + server_operation_index=None, server_operation_variables=None, + ): + """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 + 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.discard_unknown_keys = discard_unknown_keys + self.disabled_client_side_validations = disabled_client_side_validations +{{#hasHttpSignatureMethods}} + if signing_info is not None: + signing_info.host = host + self.signing_info = signing_info + """The HTTP signing configuration + """ +{{/hasHttpSignatureMethods}} +{{#hasOAuthMethods}} + self.access_token = None + """access token for OAuth/Bearer + """ +{{/hasOAuthMethods}} +{{^hasOAuthMethods}} +{{#hasBearerMethods}} + self.access_token = None + """access token for OAuth/Bearer + """ +{{/hasBearerMethods}} +{{/hasOAuthMethods}} + 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. + """ + + {{#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. + """ + {{/asyncio}} + {{^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. + """ + {{/asyncio}} + + 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 + + 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 +{{#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 +{{/hasHttpSignatureMethods}} + + @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 = {} +{{#authMethods}} +{{#isApiKey}} + if '{{name}}' in self.api_key{{#vendorExtensions.x-auth-id-alias}} or '{{.}}' in self.api_key{{/vendorExtensions.x-auth-id-alias}}: + auth['{{name}}'] = { + 'type': 'api_key', + 'in': {{#isKeyInCookie}}'cookie'{{/isKeyInCookie}}{{#isKeyInHeader}}'header'{{/isKeyInHeader}}{{#isKeyInQuery}}'query'{{/isKeyInQuery}}, + 'key': '{{keyParamName}}', + 'value': self.get_api_key_with_prefix( + '{{name}}',{{#vendorExtensions.x-auth-id-alias}} + alias='{{.}}',{{/vendorExtensions.x-auth-id-alias}} + ), + } +{{/isApiKey}} +{{#isBasic}} + {{#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() + } + {{/isBasicBasic}} + {{#isBasicBearer}} + if self.access_token is not None: + auth['{{name}}'] = { + 'type': 'bearer', + 'in': 'header', + {{#bearerFormat}} + 'format': '{{{.}}}', + {{/bearerFormat}} + 'key': 'Authorization', + 'value': 'Bearer ' + self.access_token + } + {{/isBasicBearer}} + {{#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 + } + {{/isHttpSignature}} +{{/isBasic}} +{{#isOAuth}} + if self.access_token is not None: + auth['{{name}}'] = { + 'type': 'oauth2', + 'in': 'header', + 'key': 'Authorization', + 'value': 'Bearer ' + self.access_token + } +{{/isOAuth}} +{{/authMethods}} + 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 [ + {{#servers}} + { + 'url': "{{{url}}}", + 'description': "{{{description}}}{{^description}}No description provided{{/description}}", + {{#variables}} + {{#-first}} + 'variables': { + {{/-first}} + '{{{name}}}': { + 'description': "{{{description}}}{{^description}}No description provided{{/description}}", + 'default_value': "{{{defaultValue}}}", + {{#enumValues}} + {{#-first}} + 'enum_values': [ + {{/-first}} + "{{{.}}}"{{^-last}},{{/-last}} + {{#-last}} + ] + {{/-last}} + {{/enumValues}} + }{{^-last}},{{/-last}} + {{#-last}} + } + {{/-last}} + {{/variables}} + }{{^-last}},{{/-last}} + {{/servers}} + ] + + 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-generator/src/main/resources/python/python-experimental/exceptions.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/exceptions.mustache new file mode 100644 index 000000000000..8d445c6e248e --- /dev/null +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/exceptions.mustache @@ -0,0 +1,129 @@ +# coding: utf-8 + +{{>partial_header}} + + +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) + + +class ApiException(OpenApiException): + + def __init__(self, status=None, reason=None, http_resp=None): + if http_resp: + self.status = http_resp.status + self.reason = http_resp.reason + self.body = http_resp.data + self.headers = http_resp.getheaders() + else: + self.status = status + self.reason = reason + self.body = None + self.headers = None + + 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-generator/src/main/resources/python/python-experimental/gitlab-ci.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/gitlab-ci.mustache new file mode 100644 index 000000000000..a626e9c08403 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/gitlab-ci.mustache @@ -0,0 +1,35 @@ +# ref: https://docs.gitlab.com/ee/ci/README.html + +stages: + - test + +.nosetest: + stage: test + script: + - pip install -r requirements.txt + - pip install -r test-requirements.txt + {{#useNose}} + - nosetests + {{/useNose}} + {{^useNose}} + - pytest --cov={{{packageName}}} + {{/useNose}} + +nosetest-3.3: + extends: .nosetest + image: python:3.3-alpine +nosetest-3.4: + extends: .nosetest + image: python:3.4-alpine +nosetest-3.5: + extends: .nosetest + image: python:3.5-alpine +nosetest-3.6: + extends: .nosetest + image: python:3.6-alpine +nosetest-3.7: + extends: .nosetest + image: python:3.7-alpine +nosetest-3.8: + extends: .nosetest + image: python:3.8-alpine diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/model.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/model.mustache index e89b3d563393..ad7d5ddb31b9 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/model.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/model.mustache @@ -2,11 +2,9 @@ {{>partial_header}} -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from {{packageName}}.model_utils import ( # noqa: F401 @@ -20,9 +18,7 @@ from {{packageName}}.model_utils import ( # noqa: F401 date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) {{#models}} diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/method_init_composed.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/method_init_composed.mustache index 67750cb17a83..7e64549acd5f 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/method_init_composed.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/method_init_composed.mustache @@ -41,7 +41,7 @@ for var_name, var_value in required_args.items(): setattr(self, var_name, var_value) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name in unused_args and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/method_init_normal.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/method_init_normal.mustache index 7faf7a30ee0e..4fee1c8449ca 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/method_init_normal.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/method_init_normal.mustache @@ -15,7 +15,7 @@ {{#requiredVars}} self.{{name}} = {{name}} {{/requiredVars}} - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/methods_todict_tostr_eq_shared.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/methods_todict_tostr_eq_shared.mustache index d01d49ad77c0..17c441196a93 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/methods_todict_tostr_eq_shared.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/methods_todict_tostr_eq_shared.mustache @@ -13,17 +13,12 @@ if not set(self._data_store.keys()) == set(other._data_store.keys()): return False - for _var_name, this_val in six.iteritems(self._data_store): + for _var_name, this_val in self._data_store.items(): that_val = other._data_store[_var_name] types = set() types.add(this_val.__class__) types.add(that_val.__class__) vals_equal = this_val == that_val - if (not six.PY3 and - len(types) == 2 and unicode in types): # noqa: F821 - vals_equal = ( - this_val.encode('utf-8') == that_val.encode('utf-8') - ) if not vals_equal: return False return True \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/methods_tostr_eq_simple.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/methods_tostr_eq_simple.mustache index 0bba565d22ce..4a7ef6ae5c38 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/methods_tostr_eq_simple.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/methods_tostr_eq_simple.mustache @@ -13,10 +13,4 @@ types.add(this_val.__class__) types.add(that_val.__class__) vals_equal = this_val == that_val - if not six.PY3 and len(types) == 2 and unicode in types: # noqa: F821 - vals_equal = ( - this_val.encode('utf-8') == that_val.encode('utf-8') - ) - if not vals_equal: - return False - return True \ No newline at end of file + return vals_equal \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/model_test.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/model_test.mustache index 5b9a91d2d073..c5ffe2c25576 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/model_test.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/model_test.mustache @@ -2,7 +2,6 @@ {{>partial_header}} -from __future__ import absolute_import import sys import unittest diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/model_utils.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/model_utils.mustache index 1323b724991d..ab30c2dcb0f3 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/model_utils.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/model_utils.mustache @@ -4,13 +4,13 @@ from datetime import date, datetime # noqa: F401 import inspect +import io import os import pprint import re import tempfile from dateutil.parser import parse -import six from {{packageName}}.exceptions import ( ApiKeyError, @@ -20,20 +20,7 @@ from {{packageName}}.exceptions import ( ) none_type = type(None) -if six.PY3: - import io - file_type = io.IOBase - # these are needed for when other modules import str and int from here - str = str - int = int -else: - file_type = file # noqa: F821 - str_py2 = str - unicode_py2 = unicode # noqa: F821 - long_py2 = long # noqa: F821 - int_py2 = int - # this requires that the future library is installed - from builtins import int, str +file_type = io.IOBase class cached_property(object): @@ -380,8 +367,6 @@ def get_simple_class(input_value): # isinstance(True, int) == True return bool elif isinstance(input_value, int): - # for python2 input_value==long_instance -> return int - # where int is the python3 int backport return int elif isinstance(input_value, datetime): # this must be higher than the date check because @@ -389,8 +374,7 @@ def get_simple_class(input_value): return datetime elif isinstance(input_value, date): return date - elif (six.PY2 and isinstance(input_value, (str_py2, unicode_py2, str)) or - isinstance(input_value, str)): + elif isinstance(input_value, str): return str return type(input_value) @@ -835,12 +819,12 @@ def deserialize_primitive(data, klass, path_to_item): return converted_value except (OverflowError, ValueError) as ex: # parse can raise OverflowError - six.raise_from(ApiValueError( + raise ApiValueError( "{0}Failed to parse {1} as {2}".format( - additional_message, repr(data), get_py3_class_name(klass) + additional_message, repr(data), klass.__name__ ), path_to_item=path_to_item - ), ex) + ) from ex def get_discriminator_class(model_class, @@ -964,8 +948,8 @@ def deserialize_file(response_data, configuration, content_disposition=None): path = os.path.join(os.path.dirname(path), filename) with open(path, "wb") as f: - if six.PY3 and isinstance(response_data, str): - # in python3 change str to bytes so we can write it + if isinstance(response_data, str): + # change str to bytes so we can write it response_data = response_data.encode('utf-8') f.write(response_data) @@ -1184,7 +1168,7 @@ def validate_and_convert_types(input_value, required_types_mixed, path_to_item, if input_value == {}: # allow an empty dict return input_value - for inner_key, inner_val in six.iteritems(input_value): + for inner_key, inner_val in input_value.items(): inner_path = list(path_to_item) inner_path.append(inner_key) if get_simple_class(inner_key) != str: @@ -1218,7 +1202,7 @@ def model_to_dict(model_instance, serialize=True): if model_instance._composed_schemas: model_instances.extend(model_instance._composed_instances) for model_instance in model_instances: - for attr, value in six.iteritems(model_instance._data_store): + for attr, value in model_instance._data_store.items(): if serialize: # we use get here because additional property key names do not # exist in attribute_map @@ -1275,13 +1259,8 @@ def type_error_message(var_value=None, var_name=None, valid_classes=None, def get_valid_classes_phrase(input_classes): """Returns a string phrase describing what types are allowed - Note: Adds the extra valid classes in python2 """ all_classes = list(input_classes) - if six.PY2 and str in input_classes: - all_classes.extend([str_py2, unicode_py2]) - if six.PY2 and int in input_classes: - all_classes.extend([int_py2, long_py2]) 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: @@ -1289,15 +1268,6 @@ def get_valid_classes_phrase(input_classes): return "is one of [{0}]".format(", ".join(all_class_names)) -def get_py3_class_name(input_class): - if six.PY2: - if input_class == str: - return 'str' - elif input_class == int: - return 'int' - return input_class.__name__ - - def convert_js_args_to_python_args(fn): from functools import wraps @wraps(fn) @@ -1340,7 +1310,7 @@ def get_allof_instances(self, model_args, constant_args): allof_instance = allof_class(**kwargs) composed_instances.append(allof_instance) except Exception as ex: - six.raise_from(ApiValueError( + raise ApiValueError( "Invalid inputs given to generate an instance of '%s'. The " "input data was invalid for the allOf schema '%s' in the composed " "schema '%s'. Error=%s" % ( @@ -1349,7 +1319,7 @@ def get_allof_instances(self, model_args, constant_args): self.__class__.__name__, str(ex) ) - ), ex) + ) from ex return composed_instances diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/requirements.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/requirements.mustache index a56bedffbf57..2c2f00fcb27b 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/requirements.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/requirements.mustache @@ -1,7 +1,5 @@ nulltype certifi >= 14.05.14 -future; python_version<="2.7" -six >= 1.10 python_dateutil >= 2.5.3 setuptools >= 21.0.0 urllib3 >= 1.15.1 diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/rest.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/rest.mustache new file mode 100644 index 000000000000..d5edf9535dcb --- /dev/null +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/rest.mustache @@ -0,0 +1,279 @@ +# coding: utf-8 + +{{>partial_header}} + +import io +import json +import logging +import re +import ssl +from urllib.parse import urlencode + +import certifi +import urllib3 + +from {{packageName}}.exceptions import ApiException, ApiValueError + + +logger = logging.getLogger(__name__) + + +class RESTResponse(io.IOBase): + + def __init__(self, resp): + self.urllib3_response = resp + self.status = resp.status + self.reason = resp.reason + self.data = resp.data + + def getheaders(self): + """Returns a dictionary of the response headers.""" + return self.urllib3_response.getheaders() + + def getheader(self, name, default=None): + """Returns a given response header.""" + return self.urllib3_response.getheader(name, default) + + +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 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, url, query_params=None, headers=None, + body=None, post_params=None, _preload_content=True, + _request_timeout=None): + """Perform requests. + + :param method: http request method + :param url: http request url + :param query_params: query parameters in the url + :param headers: http request headers + :param body: request json body, for `application/json` + :param post_params: request post parameters, + `application/x-www-form-urlencoded` + and `multipart/form-data` + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_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 post_params and body: + raise ApiValueError( + "body parameter cannot be used with post_params parameter." + ) + + post_params = post_params or {} + headers = headers or {} + + timeout = None + if _request_timeout: + if isinstance(_request_timeout, int): # noqa: E501,F821 + timeout = urllib3.Timeout(total=_request_timeout) + elif (isinstance(_request_timeout, tuple) and + len(_request_timeout) == 2): + timeout = urllib3.Timeout( + connect=_request_timeout[0], read=_request_timeout[1]) + + if 'Content-Type' not in headers: + headers['Content-Type'] = 'application/json' + + try: + # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE` + if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']: + if query_params: + url += '?' + urlencode(query_params) + if re.search('json', headers['Content-Type'], re.IGNORECASE): + request_body = None + if body is not None: + request_body = json.dumps(body) + r = self.pool_manager.request( + method, url, + body=request_body, + preload_content=_preload_content, + timeout=timeout, + headers=headers) + elif headers['Content-Type'] == 'application/x-www-form-urlencoded': # noqa: E501 + r = self.pool_manager.request( + method, url, + fields=post_params, + encode_multipart=False, + preload_content=_preload_content, + 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=post_params, + encode_multipart=True, + preload_content=_preload_content, + 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=_preload_content, + 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, + fields=query_params, + preload_content=_preload_content, + 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 _preload_content: + r = RESTResponse(r) + + # log response body + logger.debug("response body: %s", r.data) + + if not 200 <= r.status <= 299: + raise ApiException(http_resp=r) + + return r + + def GET(self, url, headers=None, query_params=None, _preload_content=True, + _request_timeout=None): + return self.request("GET", url, + headers=headers, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + query_params=query_params) + + def HEAD(self, url, headers=None, query_params=None, _preload_content=True, + _request_timeout=None): + return self.request("HEAD", url, + headers=headers, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + query_params=query_params) + + def OPTIONS(self, url, headers=None, query_params=None, post_params=None, + body=None, _preload_content=True, _request_timeout=None): + return self.request("OPTIONS", url, + headers=headers, + query_params=query_params, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + + def DELETE(self, url, headers=None, query_params=None, body=None, + _preload_content=True, _request_timeout=None): + return self.request("DELETE", url, + headers=headers, + query_params=query_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + + def POST(self, url, headers=None, query_params=None, post_params=None, + body=None, _preload_content=True, _request_timeout=None): + return self.request("POST", url, + headers=headers, + query_params=query_params, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + + def PUT(self, url, headers=None, query_params=None, post_params=None, + body=None, _preload_content=True, _request_timeout=None): + return self.request("PUT", url, + headers=headers, + query_params=query_params, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + + def PATCH(self, url, headers=None, query_params=None, post_params=None, + body=None, _preload_content=True, _request_timeout=None): + return self.request("PATCH", url, + headers=headers, + query_params=query_params, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/setup.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/setup.mustache index 796475c45642..b3c89f621e59 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/setup.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/setup.mustache @@ -18,7 +18,6 @@ VERSION = "{{packageVersion}}" REQUIRES = [ "urllib3 >= 1.15", - "six >= 1.10", "certifi", "python-dateutil", "nulltype", @@ -33,7 +32,6 @@ REQUIRES = [ "pycryptodome>=3.9.0", {{/hasHttpSignatureMethods}} ] -EXTRAS = {':python_version <= "2.7"': ['future']} setup( name=NAME, @@ -43,8 +41,8 @@ setup( author_email="{{#infoEmail}}{{infoEmail}}{{/infoEmail}}{{^infoEmail}}team@openapitools.org{{/infoEmail}}", url="{{packageUrl}}", keywords=["OpenAPI", "OpenAPI-Generator", "{{{appName}}}"], + python_requires=">=3.3", install_requires=REQUIRES, - extras_require=EXTRAS, packages=find_packages(exclude=["test", "tests"]), include_package_data=True, {{#licenseInfo}}license="{{licenseInfo}}", diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/signing.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/signing.mustache index 0be0e1c46795..26d2b8cb37c9 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/signing.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/signing.mustache @@ -1,6 +1,5 @@ # coding: utf-8 {{>partial_header}} -from __future__ import absolute_import from base64 import b64encode from Crypto.IO import PEM, PKCS8 @@ -11,8 +10,8 @@ from email.utils import formatdate import json import os import re -from six.moves.urllib.parse import urlencode, urlparse 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. diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/test-requirements.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/test-requirements.mustache index ebdee3392e40..cc68f6484f18 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/test-requirements.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/test-requirements.mustache @@ -6,11 +6,10 @@ py>=1.4.31 randomize>=0.13 {{/useNose}} {{^useNose}} -pytest~=4.6.7 # needed for python 2.7+3.4 +pytest~=4.6.7 # needed for python 3.4 pytest-cov>=2.8.1 -pytest-randomly==1.2.3 # needed for python 2.7+3.4 +pytest-randomly==1.2.3 # needed for python 3.4 {{/useNose}} {{#hasHttpSignatureMethods}} pycryptodome>=3.9.0 -{{/hasHttpSignatureMethods}} -mock; python_version<="2.7" \ No newline at end of file +{{/hasHttpSignatureMethods}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/tox.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/tox.mustache new file mode 100644 index 000000000000..4c771c472b8b --- /dev/null +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/tox.mustache @@ -0,0 +1,9 @@ +[tox] +envlist = py3 + +[testenv] +deps=-r{toxinidir}/requirements.txt + -r{toxinidir}/test-requirements.txt + +commands= + {{^useNose}}pytest --cov={{{packageName}}}{{/useNose}}{{#useNose}}nosetests{{/useNose}} diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/travis.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/travis.mustache new file mode 100644 index 000000000000..77f7289f972a --- /dev/null +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/travis.mustache @@ -0,0 +1,21 @@ +# ref: https://docs.travis-ci.com/user/languages/python +language: python +python: + - "3.2" + - "3.3" + - "3.4" + - "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 +{{#useNose}} +script: nosetests +{{/useNose}} +{{^useNose}} +script: pytest --cov={{{packageName}}} +{{/useNose}} diff --git a/samples/client/petstore/python-experimental/.gitlab-ci.yml b/samples/client/petstore/python-experimental/.gitlab-ci.yml index 142ce3712ed0..9703213bb062 100644 --- a/samples/client/petstore/python-experimental/.gitlab-ci.yml +++ b/samples/client/petstore/python-experimental/.gitlab-ci.yml @@ -10,9 +10,6 @@ stages: - pip install -r test-requirements.txt - pytest --cov=petstore_api -nosetest-2.7: - extends: .nosetest - image: python:2.7-alpine nosetest-3.3: extends: .nosetest image: python:3.3-alpine diff --git a/samples/client/petstore/python-experimental/.travis.yml b/samples/client/petstore/python-experimental/.travis.yml index fcd7e31c7ccf..3aa7c047e1e2 100644 --- a/samples/client/petstore/python-experimental/.travis.yml +++ b/samples/client/petstore/python-experimental/.travis.yml @@ -1,7 +1,6 @@ # ref: https://docs.travis-ci.com/user/languages/python language: python python: - - "2.7" - "3.2" - "3.3" - "3.4" diff --git a/samples/client/petstore/python-experimental/Makefile b/samples/client/petstore/python-experimental/Makefile index a7ff5e1e2441..a6bbba4a434f 100644 --- a/samples/client/petstore/python-experimental/Makefile +++ b/samples/client/petstore/python-experimental/Makefile @@ -15,7 +15,4 @@ clean: find . -name "__pycache__" -delete test: clean - bash ./test_python2.sh - -test-all: clean - bash ./test_python2_and_3.sh + bash ./test_python.sh diff --git a/samples/client/petstore/python-experimental/README.md b/samples/client/petstore/python-experimental/README.md index 62a22ec0ed67..c265bc3767bb 100644 --- a/samples/client/petstore/python-experimental/README.md +++ b/samples/client/petstore/python-experimental/README.md @@ -9,7 +9,7 @@ This Python package is automatically generated by the [OpenAPI Generator](https: ## Requirements. -Python 2.7 and 3.4+ +Python 3.4+ ## Installation & Usage ### pip install @@ -45,7 +45,6 @@ import petstore_api Please follow the [installation procedure](#installation--usage) and then run the following: ```python -from __future__ import print_function import time import petstore_api diff --git a/samples/client/petstore/python-experimental/docs/AnotherFakeApi.md b/samples/client/petstore/python-experimental/docs/AnotherFakeApi.md index 8b7a61109454..8b25ae168713 100644 --- a/samples/client/petstore/python-experimental/docs/AnotherFakeApi.md +++ b/samples/client/petstore/python-experimental/docs/AnotherFakeApi.md @@ -17,7 +17,6 @@ To test special tags and operation ID starting with number ### Example ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import another_fake_api diff --git a/samples/client/petstore/python-experimental/docs/FakeApi.md b/samples/client/petstore/python-experimental/docs/FakeApi.md index eeabb02c3c82..b50d11670aa1 100644 --- a/samples/client/petstore/python-experimental/docs/FakeApi.md +++ b/samples/client/petstore/python-experimental/docs/FakeApi.md @@ -32,7 +32,6 @@ Test serialization of ArrayModel ### Example ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import fake_api @@ -96,7 +95,6 @@ Test serialization of outer boolean types ### Example ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import fake_api @@ -159,7 +157,6 @@ this route creates an XmlItem ### Example ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import fake_api @@ -222,7 +219,6 @@ Test serialization of outer number types ### Example ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import fake_api @@ -286,7 +282,6 @@ Test serialization of object with $refed properties ### Example ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import fake_api @@ -350,7 +345,6 @@ Test serialization of outer string types ### Example ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import fake_api @@ -413,7 +407,6 @@ Test serialization of outer enum ### Example ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import fake_api @@ -477,7 +470,6 @@ For this test, the body for this request much reference a schema named `File`. ### Example ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import fake_api @@ -537,7 +529,6 @@ No authorization required ### Example ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import fake_api @@ -601,7 +592,6 @@ To test \"client\" model ### Example ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import fake_api @@ -665,7 +655,6 @@ This route has required values with enums of 1 ### Example ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import fake_api @@ -730,7 +719,6 @@ Fake endpoint for testing various parameters 假端點 偽のエンドポイ * Basic Authentication (http_basic_test): ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import fake_api @@ -837,7 +825,6 @@ To test enum parameters ### Example ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import fake_api @@ -915,7 +902,6 @@ Fake endpoint to test group parameters (optional) ### Example ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import fake_api @@ -993,7 +979,6 @@ test inline additionalProperties ### Example ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import fake_api @@ -1053,7 +1038,6 @@ test json serialization of form data ### Example ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import fake_api diff --git a/samples/client/petstore/python-experimental/docs/FakeClassnameTags123Api.md b/samples/client/petstore/python-experimental/docs/FakeClassnameTags123Api.md index 6cc246194992..aad73f70f5c1 100644 --- a/samples/client/petstore/python-experimental/docs/FakeClassnameTags123Api.md +++ b/samples/client/petstore/python-experimental/docs/FakeClassnameTags123Api.md @@ -18,7 +18,6 @@ To test class name in snake case * Api Key Authentication (api_key_query): ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import fake_classname_tags_123_api diff --git a/samples/client/petstore/python-experimental/docs/PetApi.md b/samples/client/petstore/python-experimental/docs/PetApi.md index 20b56372d833..287cbc2f7dc0 100644 --- a/samples/client/petstore/python-experimental/docs/PetApi.md +++ b/samples/client/petstore/python-experimental/docs/PetApi.md @@ -24,7 +24,6 @@ Add a new pet to the store * OAuth Authentication (petstore_auth): ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import pet_api @@ -97,7 +96,6 @@ Deletes a pet * OAuth Authentication (petstore_auth): ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import pet_api @@ -181,7 +179,6 @@ Multiple status values can be provided with comma separated strings * OAuth Authentication (petstore_auth): ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import pet_api @@ -257,7 +254,6 @@ Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 * OAuth Authentication (petstore_auth): ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import pet_api @@ -333,7 +329,6 @@ Returns a single pet * Api Key Authentication (api_key): ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import pet_api @@ -412,7 +407,6 @@ Update an existing pet * OAuth Authentication (petstore_auth): ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import pet_api @@ -487,7 +481,6 @@ Updates a pet in the store with form data * OAuth Authentication (petstore_auth): ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import pet_api @@ -570,7 +563,6 @@ uploads an image * OAuth Authentication (petstore_auth): ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import pet_api @@ -658,7 +650,6 @@ uploads an image (required) * OAuth Authentication (petstore_auth): ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import pet_api diff --git a/samples/client/petstore/python-experimental/docs/StoreApi.md b/samples/client/petstore/python-experimental/docs/StoreApi.md index 36e72b2ac4f1..33db4f14ee3c 100644 --- a/samples/client/petstore/python-experimental/docs/StoreApi.md +++ b/samples/client/petstore/python-experimental/docs/StoreApi.md @@ -20,7 +20,6 @@ For valid response try integer IDs with value < 1000. Anything above 1000 or non ### Example ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import store_api @@ -84,7 +83,6 @@ Returns a map of status codes to quantities * Api Key Authentication (api_key): ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import store_api @@ -157,7 +155,6 @@ For valid response try integer IDs with value <= 5 or > 10. Other values will ge ### Example ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import store_api @@ -221,7 +218,6 @@ Place an order for a pet ### Example ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import store_api diff --git a/samples/client/petstore/python-experimental/docs/UserApi.md b/samples/client/petstore/python-experimental/docs/UserApi.md index 4727961273c1..db41065fafdd 100644 --- a/samples/client/petstore/python-experimental/docs/UserApi.md +++ b/samples/client/petstore/python-experimental/docs/UserApi.md @@ -24,7 +24,6 @@ This can only be done by the logged in user. ### Example ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import user_api @@ -85,7 +84,6 @@ Creates list of users with given input array ### Example ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import user_api @@ -146,7 +144,6 @@ Creates list of users with given input array ### Example ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import user_api @@ -209,7 +206,6 @@ This can only be done by the logged in user. ### Example ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import user_api @@ -270,7 +266,6 @@ Get user by user name ### Example ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import user_api @@ -334,7 +329,6 @@ Logs user into the system ### Example ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import user_api @@ -398,7 +392,6 @@ Logs out current logged in user session ### Example ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import user_api @@ -456,7 +449,6 @@ This can only be done by the logged in user. ### Example ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import user_api diff --git a/samples/client/petstore/python-experimental/petstore_api/__init__.py b/samples/client/petstore/python-experimental/petstore_api/__init__.py index 4af4353187f6..bd7096a81818 100644 --- a/samples/client/petstore/python-experimental/petstore_api/__init__.py +++ b/samples/client/petstore/python-experimental/petstore_api/__init__.py @@ -12,8 +12,6 @@ """ -from __future__ import absolute_import - __version__ = "1.0.0" # import ApiClient diff --git a/samples/client/petstore/python-experimental/petstore_api/api/__init__.py b/samples/client/petstore/python-experimental/petstore_api/api/__init__.py index 74496adb5a2b..1d37d3395142 100644 --- a/samples/client/petstore/python-experimental/petstore_api/api/__init__.py +++ b/samples/client/petstore/python-experimental/petstore_api/api/__init__.py @@ -1,11 +1,3 @@ -from __future__ import absolute_import - -# flake8: noqa - -# import apis into api package -from petstore_api.api.another_fake_api import AnotherFakeApi -from petstore_api.api.fake_api import FakeApi -from petstore_api.api.fake_classname_tags_123_api import FakeClassnameTags123Api -from petstore_api.api.pet_api import PetApi -from petstore_api.api.store_api import StoreApi -from petstore_api.api.user_api import UserApi +# do not import all apis into this module because that uses a lot of memory and stack frames +# if you need the ability to import all apis from one package, import them with +# from {{packageName}.apis import DefaultApi, PetApi \ No newline at end of file diff --git a/samples/client/petstore/python-experimental/petstore_api/api/another_fake_api.py b/samples/client/petstore/python-experimental/petstore_api/api/another_fake_api.py index 4324e43df1d8..3afdf63dfacd 100644 --- a/samples/client/petstore/python-experimental/petstore_api/api/another_fake_api.py +++ b/samples/client/petstore/python-experimental/petstore_api/api/another_fake_api.py @@ -10,14 +10,9 @@ """ -from __future__ import absolute_import - import re # noqa: F401 import sys # noqa: F401 -# python 2 and python 3 compatibility library -import six - from petstore_api.api_client import ApiClient, Endpoint from petstore_api.model_utils import ( # noqa: F401 check_allowed_values, @@ -25,9 +20,7 @@ date, datetime, file_type, - int, none_type, - str, validate_and_convert_types ) from petstore_api.model import client diff --git a/samples/client/petstore/python-experimental/petstore_api/api/fake_api.py b/samples/client/petstore/python-experimental/petstore_api/api/fake_api.py index d7607077f590..756329652dda 100644 --- a/samples/client/petstore/python-experimental/petstore_api/api/fake_api.py +++ b/samples/client/petstore/python-experimental/petstore_api/api/fake_api.py @@ -10,14 +10,9 @@ """ -from __future__ import absolute_import - import re # noqa: F401 import sys # noqa: F401 -# python 2 and python 3 compatibility library -import six - from petstore_api.api_client import ApiClient, Endpoint from petstore_api.model_utils import ( # noqa: F401 check_allowed_values, @@ -25,9 +20,7 @@ date, datetime, file_type, - int, none_type, - str, validate_and_convert_types ) from petstore_api.model import animal_farm diff --git a/samples/client/petstore/python-experimental/petstore_api/api/fake_classname_tags_123_api.py b/samples/client/petstore/python-experimental/petstore_api/api/fake_classname_tags_123_api.py index fb8838c8fcc7..c069a60b04f3 100644 --- a/samples/client/petstore/python-experimental/petstore_api/api/fake_classname_tags_123_api.py +++ b/samples/client/petstore/python-experimental/petstore_api/api/fake_classname_tags_123_api.py @@ -10,14 +10,9 @@ """ -from __future__ import absolute_import - import re # noqa: F401 import sys # noqa: F401 -# python 2 and python 3 compatibility library -import six - from petstore_api.api_client import ApiClient, Endpoint from petstore_api.model_utils import ( # noqa: F401 check_allowed_values, @@ -25,9 +20,7 @@ date, datetime, file_type, - int, none_type, - str, validate_and_convert_types ) from petstore_api.model import client diff --git a/samples/client/petstore/python-experimental/petstore_api/api/pet_api.py b/samples/client/petstore/python-experimental/petstore_api/api/pet_api.py index 0acb59cc01d2..4ae5987ba009 100644 --- a/samples/client/petstore/python-experimental/petstore_api/api/pet_api.py +++ b/samples/client/petstore/python-experimental/petstore_api/api/pet_api.py @@ -10,14 +10,9 @@ """ -from __future__ import absolute_import - import re # noqa: F401 import sys # noqa: F401 -# python 2 and python 3 compatibility library -import six - from petstore_api.api_client import ApiClient, Endpoint from petstore_api.model_utils import ( # noqa: F401 check_allowed_values, @@ -25,9 +20,7 @@ date, datetime, file_type, - int, none_type, - str, validate_and_convert_types ) from petstore_api.model import pet diff --git a/samples/client/petstore/python-experimental/petstore_api/api/store_api.py b/samples/client/petstore/python-experimental/petstore_api/api/store_api.py index 21f171650f99..cc86ddc91c33 100644 --- a/samples/client/petstore/python-experimental/petstore_api/api/store_api.py +++ b/samples/client/petstore/python-experimental/petstore_api/api/store_api.py @@ -10,14 +10,9 @@ """ -from __future__ import absolute_import - import re # noqa: F401 import sys # noqa: F401 -# python 2 and python 3 compatibility library -import six - from petstore_api.api_client import ApiClient, Endpoint from petstore_api.model_utils import ( # noqa: F401 check_allowed_values, @@ -25,9 +20,7 @@ date, datetime, file_type, - int, none_type, - str, validate_and_convert_types ) from petstore_api.model import order diff --git a/samples/client/petstore/python-experimental/petstore_api/api/user_api.py b/samples/client/petstore/python-experimental/petstore_api/api/user_api.py index 75a3b54b584b..51d595d3f39e 100644 --- a/samples/client/petstore/python-experimental/petstore_api/api/user_api.py +++ b/samples/client/petstore/python-experimental/petstore_api/api/user_api.py @@ -10,14 +10,9 @@ """ -from __future__ import absolute_import - import re # noqa: F401 import sys # noqa: F401 -# python 2 and python 3 compatibility library -import six - from petstore_api.api_client import ApiClient, Endpoint from petstore_api.model_utils import ( # noqa: F401 check_allowed_values, @@ -25,9 +20,7 @@ date, datetime, file_type, - int, none_type, - str, validate_and_convert_types ) from petstore_api.model import user diff --git a/samples/client/petstore/python-experimental/petstore_api/api_client.py b/samples/client/petstore/python-experimental/petstore_api/api_client.py index 891d42be49f3..0f7571e183d8 100644 --- a/samples/client/petstore/python-experimental/petstore_api/api_client.py +++ b/samples/client/petstore/python-experimental/petstore_api/api_client.py @@ -8,7 +8,6 @@ Generated by: https://openapi-generator.tech """ -from __future__ import absolute_import import json import atexit @@ -16,10 +15,8 @@ from multiprocessing.pool import ThreadPool import os import re +from urllib.parse import quote -# python 2 and python 3 compatibility library -import six -from six.moves.urllib.parse import quote from petstore_api import rest from petstore_api.configuration import Configuration @@ -34,10 +31,8 @@ datetime, deserialize_file, file_type, - int, model_to_dict, none_type, - str, validate_and_convert_types ) @@ -64,10 +59,8 @@ class ApiClient(object): to the API. More threads means more concurrent API requests. """ - # six.binary_type python2=str, python3=bytes - # six.text_type python2=unicode, python3=str PRIMITIVE_TYPES = ( - (float, bool, six.binary_type, six.text_type) + six.integer_types + float, bool, bytes, str, int ) _pool = None @@ -191,7 +184,7 @@ def __call_api( _preload_content=_preload_content, _request_timeout=_request_timeout) except ApiException as e: - e.body = e.body.decode('utf-8') if six.PY3 else e.body + e.body = e.body.decode('utf-8') raise e content_type = response_data.getheader('content-type') @@ -204,7 +197,7 @@ def __call_api( return (return_data) return return_data - if six.PY3 and response_type not in ["file", "bytes"]: + if response_type not in ["file", "bytes"]: match = None if content_type is not None: match = re.search(r"charset=([a-zA-Z\-\d]+)[\s\;]?", content_type) @@ -265,7 +258,7 @@ def sanitize_for_serialization(self, obj): return self.sanitize_for_serialization(obj.value) return {key: self.sanitize_for_serialization(val) - for key, val in six.iteritems(obj_dict)} + for key, val in obj_dict.items()} def deserialize(self, response, response_type, _check_type): """Deserializes response into an object. @@ -465,7 +458,7 @@ def parameters_to_tuples(self, params, collection_formats): new_params = [] if collection_formats is None: collection_formats = {} - for k, v in six.iteritems(params) if isinstance(params, dict) else params: # noqa: E501 + for k, v in params.items() if isinstance(params, dict) else params: # noqa: E501 if k in collection_formats: collection_format = collection_formats[k] if collection_format == 'multi': @@ -496,7 +489,7 @@ def files_parameters(self, files=None): return [] params = [] - for param_name, file_instances in six.iteritems(files): + for param_name, file_instances in files.items(): if file_instances is None: # if the file field is nullable, skip None values continue @@ -671,7 +664,7 @@ def __validate_inputs(self, kwargs): if kwargs['_check_input_type'] is False: return - for key, value in six.iteritems(kwargs): + for key, value in kwargs.items(): fixed_val = validate_and_convert_types( value, self.openapi_types[key], @@ -693,7 +686,7 @@ def __gather_params(self, kwargs): 'query': [] } - for param_name, param_value in six.iteritems(kwargs): + for param_name, param_value in kwargs.items(): param_location = self.location_map.get(param_name) if param_location is None: continue @@ -751,7 +744,7 @@ def call_with_http_info(self, **kwargs): ) _host = None - for key, value in six.iteritems(kwargs): + for key, value in kwargs.items(): if key not in self.params_map['all']: raise ApiTypeError( "Got an unexpected parameter '%s'" diff --git a/samples/client/petstore/python-experimental/petstore_api/configuration.py b/samples/client/petstore/python-experimental/petstore_api/configuration.py index 81b2cd7e9d0e..b7e866546d07 100644 --- a/samples/client/petstore/python-experimental/petstore_api/configuration.py +++ b/samples/client/petstore/python-experimental/petstore_api/configuration.py @@ -10,16 +10,13 @@ """ -from __future__ import absolute_import - import copy import logging import multiprocessing import sys import urllib3 -import six -from six.moves import http_client as httplib +from http import client as http_client from petstore_api.exceptions import ApiValueError @@ -307,7 +304,7 @@ def logger_file(self, value): # 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 six.iteritems(self.logger): + for _, logger in self.logger.items(): logger.addHandler(self.logger_file_handler) @property @@ -329,17 +326,17 @@ def debug(self, value): self.__debug = value if self.__debug: # if debug status is True, turn on debug logging - for _, logger in six.iteritems(self.logger): + for _, logger in self.logger.items(): logger.setLevel(logging.DEBUG) - # turn on httplib debug - httplib.HTTPConnection.debuglevel = 1 + # 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 six.iteritems(self.logger): + for _, logger in self.logger.items(): logger.setLevel(logging.WARNING) - # turn off httplib debug - httplib.HTTPConnection.debuglevel = 0 + # turn off http_client debug + http_client.HTTPConnection.debuglevel = 0 @property def logger_format(self): diff --git a/samples/client/petstore/python-experimental/petstore_api/exceptions.py b/samples/client/petstore/python-experimental/petstore_api/exceptions.py index b55977ee5e7e..fecd2081b818 100644 --- a/samples/client/petstore/python-experimental/petstore_api/exceptions.py +++ b/samples/client/petstore/python-experimental/petstore_api/exceptions.py @@ -10,8 +10,6 @@ """ -import six - class OpenApiException(Exception): """The base exception class for all OpenAPIExceptions""" @@ -132,7 +130,7 @@ def render_path(path_to_item): """Returns a string representation of a path""" result = "" for pth in path_to_item: - if isinstance(pth, six.integer_types): + if isinstance(pth, int): result += "[{0}]".format(pth) else: result += "['{0}']".format(pth) diff --git a/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_any_type.py b/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_any_type.py index 7ea7b1f807bd..ff57e565fa8c 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_any_type.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_any_type.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -163,7 +159,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_array.py b/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_array.py index 5dc25499eaf9..c42ce98aeeb2 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_array.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_array.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -163,7 +159,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_boolean.py b/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_boolean.py index ae3b7cd9dc07..ff1f44523bd2 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_boolean.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_boolean.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -163,7 +159,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_class.py b/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_class.py index 1b98c5f06e5d..c52c9dd3b83b 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_class.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_class.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -193,7 +189,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_integer.py b/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_integer.py index 005c26263abe..31ab33a95b1f 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_integer.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_integer.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -163,7 +159,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_number.py b/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_number.py index fca97fca089d..8f8f580c7aa9 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_number.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_number.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -163,7 +159,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_object.py b/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_object.py index 03ca022e6f82..954b6b965787 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_object.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_object.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -163,7 +159,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_string.py b/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_string.py index 7144f66699bc..65a671990307 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_string.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_string.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -163,7 +159,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/client/petstore/python-experimental/petstore_api/model/animal.py b/samples/client/petstore/python-experimental/petstore_api/model/animal.py index 7ba62dad1622..7f1257e2ab4f 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/animal.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/animal.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) try: @@ -185,7 +181,7 @@ def __init__(self, class_name, *args, **kwargs): # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) self.class_name = class_name - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/client/petstore/python-experimental/petstore_api/model/animal_farm.py b/samples/client/petstore/python-experimental/petstore_api/model/animal_farm.py index 4030d038edb3..94d6d094d68d 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/animal_farm.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/animal_farm.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) try: diff --git a/samples/client/petstore/python-experimental/petstore_api/model/api_response.py b/samples/client/petstore/python-experimental/petstore_api/model/api_response.py index c921519b8783..24a2e3d897a6 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/api_response.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/api_response.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -169,7 +165,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/client/petstore/python-experimental/petstore_api/model/array_of_array_of_number_only.py b/samples/client/petstore/python-experimental/petstore_api/model/array_of_array_of_number_only.py index b9f52d6ba7bc..014740ca0a6f 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/array_of_array_of_number_only.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/array_of_array_of_number_only.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -163,7 +159,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/client/petstore/python-experimental/petstore_api/model/array_of_number_only.py b/samples/client/petstore/python-experimental/petstore_api/model/array_of_number_only.py index 45021fef4c51..00afce1fb4a1 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/array_of_number_only.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/array_of_number_only.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -163,7 +159,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/client/petstore/python-experimental/petstore_api/model/array_test.py b/samples/client/petstore/python-experimental/petstore_api/model/array_test.py index e2bc76832b27..e4478c5acdc8 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/array_test.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/array_test.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) try: @@ -174,7 +170,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/client/petstore/python-experimental/petstore_api/model/capitalization.py b/samples/client/petstore/python-experimental/petstore_api/model/capitalization.py index 06745009d8b8..18c5f54c06fe 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/capitalization.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/capitalization.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -178,7 +174,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/client/petstore/python-experimental/petstore_api/model/cat.py b/samples/client/petstore/python-experimental/petstore_api/model/cat.py index b40a97dbab9a..335b05559d1d 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/cat.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/cat.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) try: @@ -213,7 +209,7 @@ def __init__(self, class_name, *args, **kwargs): # noqa: E501 for var_name, var_value in required_args.items(): setattr(self, var_name, var_value) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name in unused_args and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/client/petstore/python-experimental/petstore_api/model/cat_all_of.py b/samples/client/petstore/python-experimental/petstore_api/model/cat_all_of.py index 49ae9462f491..c257813c1206 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/cat_all_of.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/cat_all_of.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -163,7 +159,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/client/petstore/python-experimental/petstore_api/model/category.py b/samples/client/petstore/python-experimental/petstore_api/model/category.py index 16e4a33d4f04..e2be1802b1d5 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/category.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/category.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -170,7 +166,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) self.name = name - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/client/petstore/python-experimental/petstore_api/model/child.py b/samples/client/petstore/python-experimental/petstore_api/model/child.py index 37c138d6a488..03b1839ccca7 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/child.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/child.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) try: @@ -206,7 +202,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 for var_name, var_value in required_args.items(): setattr(self, var_name, var_value) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name in unused_args and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/client/petstore/python-experimental/petstore_api/model/child_all_of.py b/samples/client/petstore/python-experimental/petstore_api/model/child_all_of.py index 26e6018acf7d..0aaf9f258b45 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/child_all_of.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/child_all_of.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -163,7 +159,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/client/petstore/python-experimental/petstore_api/model/child_cat.py b/samples/client/petstore/python-experimental/petstore_api/model/child_cat.py index 6d42f11a18ff..998f062d677d 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/child_cat.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/child_cat.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) try: @@ -210,7 +206,7 @@ def __init__(self, pet_type, *args, **kwargs): # noqa: E501 for var_name, var_value in required_args.items(): setattr(self, var_name, var_value) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name in unused_args and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/client/petstore/python-experimental/petstore_api/model/child_cat_all_of.py b/samples/client/petstore/python-experimental/petstore_api/model/child_cat_all_of.py index 1ddf92fb1227..cc67b70c8748 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/child_cat_all_of.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/child_cat_all_of.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -163,7 +159,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/client/petstore/python-experimental/petstore_api/model/child_dog.py b/samples/client/petstore/python-experimental/petstore_api/model/child_dog.py index b7a93571a6a0..4fea9fbfe0df 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/child_dog.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/child_dog.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) try: @@ -210,7 +206,7 @@ def __init__(self, pet_type, *args, **kwargs): # noqa: E501 for var_name, var_value in required_args.items(): setattr(self, var_name, var_value) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name in unused_args and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/client/petstore/python-experimental/petstore_api/model/child_dog_all_of.py b/samples/client/petstore/python-experimental/petstore_api/model/child_dog_all_of.py index 7ba37f9908fc..6e3e49d360ac 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/child_dog_all_of.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/child_dog_all_of.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -163,7 +159,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/client/petstore/python-experimental/petstore_api/model/child_lizard.py b/samples/client/petstore/python-experimental/petstore_api/model/child_lizard.py index 978fea14a183..741ef17af1a6 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/child_lizard.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/child_lizard.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) try: @@ -210,7 +206,7 @@ def __init__(self, pet_type, *args, **kwargs): # noqa: E501 for var_name, var_value in required_args.items(): setattr(self, var_name, var_value) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name in unused_args and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/client/petstore/python-experimental/petstore_api/model/child_lizard_all_of.py b/samples/client/petstore/python-experimental/petstore_api/model/child_lizard_all_of.py index 78b69edb872c..31976b59fac4 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/child_lizard_all_of.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/child_lizard_all_of.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -163,7 +159,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/client/petstore/python-experimental/petstore_api/model/class_model.py b/samples/client/petstore/python-experimental/petstore_api/model/class_model.py index fc88f68e3f5f..d80e4ef3671f 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/class_model.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/class_model.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -163,7 +159,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/client/petstore/python-experimental/petstore_api/model/client.py b/samples/client/petstore/python-experimental/petstore_api/model/client.py index fa99b07fa328..2ea3b4aadd4a 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/client.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/client.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -163,7 +159,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/client/petstore/python-experimental/petstore_api/model/dog.py b/samples/client/petstore/python-experimental/petstore_api/model/dog.py index 547eba90c2b1..02d6f0344396 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/dog.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/dog.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) try: @@ -213,7 +209,7 @@ def __init__(self, class_name, *args, **kwargs): # noqa: E501 for var_name, var_value in required_args.items(): setattr(self, var_name, var_value) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name in unused_args and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/client/petstore/python-experimental/petstore_api/model/dog_all_of.py b/samples/client/petstore/python-experimental/petstore_api/model/dog_all_of.py index 0d053aca2a63..299a4d956bc9 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/dog_all_of.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/dog_all_of.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -163,7 +159,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/client/petstore/python-experimental/petstore_api/model/enum_arrays.py b/samples/client/petstore/python-experimental/petstore_api/model/enum_arrays.py index a19990449748..161ddd5c1d1e 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/enum_arrays.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/enum_arrays.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -174,7 +170,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/client/petstore/python-experimental/petstore_api/model/enum_class.py b/samples/client/petstore/python-experimental/petstore_api/model/enum_class.py index 7c5014fd532b..dac3ee37d032 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/enum_class.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/enum_class.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) diff --git a/samples/client/petstore/python-experimental/petstore_api/model/enum_test.py b/samples/client/petstore/python-experimental/petstore_api/model/enum_test.py index 67916bf70944..c53f054242e8 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/enum_test.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/enum_test.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) try: @@ -201,7 +197,7 @@ def __init__(self, enum_string_required, *args, **kwargs): # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) self.enum_string_required = enum_string_required - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/client/petstore/python-experimental/petstore_api/model/file.py b/samples/client/petstore/python-experimental/petstore_api/model/file.py index 0152f8d8c667..f7cdcb4fdf8b 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/file.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/file.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -163,7 +159,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/client/petstore/python-experimental/petstore_api/model/file_schema_test_class.py b/samples/client/petstore/python-experimental/petstore_api/model/file_schema_test_class.py index 0a9471e9e420..3c1d880d3585 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/file_schema_test_class.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/file_schema_test_class.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) try: @@ -171,7 +167,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/client/petstore/python-experimental/petstore_api/model/format_test.py b/samples/client/petstore/python-experimental/petstore_api/model/format_test.py index 7c598ae43821..1955422e7a86 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/format_test.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/format_test.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -240,7 +236,7 @@ def __init__(self, number, byte, date, password, *args, **kwargs): # noqa: E501 self.byte = byte self.date = date self.password = password - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/client/petstore/python-experimental/petstore_api/model/grandparent.py b/samples/client/petstore/python-experimental/petstore_api/model/grandparent.py index 3097bef04b88..7d607a4f392e 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/grandparent.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/grandparent.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -163,7 +159,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/client/petstore/python-experimental/petstore_api/model/grandparent_animal.py b/samples/client/petstore/python-experimental/petstore_api/model/grandparent_animal.py index 81947e1c497d..2dc2658ef13d 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/grandparent_animal.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/grandparent_animal.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) try: @@ -194,7 +190,7 @@ def __init__(self, pet_type, *args, **kwargs): # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) self.pet_type = pet_type - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/client/petstore/python-experimental/petstore_api/model/has_only_read_only.py b/samples/client/petstore/python-experimental/petstore_api/model/has_only_read_only.py index eeb685139cb1..7a722ee9c78c 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/has_only_read_only.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/has_only_read_only.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -166,7 +162,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/client/petstore/python-experimental/petstore_api/model/list.py b/samples/client/petstore/python-experimental/petstore_api/model/list.py index 9499f26c7b18..77bd4d0565dc 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/list.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/list.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -163,7 +159,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/client/petstore/python-experimental/petstore_api/model/map_test.py b/samples/client/petstore/python-experimental/petstore_api/model/map_test.py index a22af06ce4fd..5bafea48a041 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/map_test.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/map_test.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) try: @@ -181,7 +177,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/client/petstore/python-experimental/petstore_api/model/mixed_properties_and_additional_properties_class.py b/samples/client/petstore/python-experimental/petstore_api/model/mixed_properties_and_additional_properties_class.py index a0fcac2eb019..12cda6cf9ae9 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/mixed_properties_and_additional_properties_class.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/mixed_properties_and_additional_properties_class.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) try: @@ -174,7 +170,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/client/petstore/python-experimental/petstore_api/model/model200_response.py b/samples/client/petstore/python-experimental/petstore_api/model/model200_response.py index 54cc1fa338d5..ea4df21be49e 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/model200_response.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/model200_response.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -166,7 +162,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/client/petstore/python-experimental/petstore_api/model/model_return.py b/samples/client/petstore/python-experimental/petstore_api/model/model_return.py index cf7415f0bd72..535657ebbcf0 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/model_return.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/model_return.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -163,7 +159,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/client/petstore/python-experimental/petstore_api/model/name.py b/samples/client/petstore/python-experimental/petstore_api/model/name.py index 33a95baafcf7..95f197a7a595 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/name.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/name.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -175,7 +171,7 @@ def __init__(self, name, *args, **kwargs): # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) self.name = name - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/client/petstore/python-experimental/petstore_api/model/number_only.py b/samples/client/petstore/python-experimental/petstore_api/model/number_only.py index 305da1d7538e..d16ea3765fcb 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/number_only.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/number_only.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -163,7 +159,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/client/petstore/python-experimental/petstore_api/model/number_with_validations.py b/samples/client/petstore/python-experimental/petstore_api/model/number_with_validations.py index ed81cdce6968..1cb824ca0b4b 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/number_with_validations.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/number_with_validations.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) diff --git a/samples/client/petstore/python-experimental/petstore_api/model/object_model_with_ref_props.py b/samples/client/petstore/python-experimental/petstore_api/model/object_model_with_ref_props.py index f76243bc365e..15ccc61db3f9 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/object_model_with_ref_props.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/object_model_with_ref_props.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) try: @@ -174,7 +170,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/client/petstore/python-experimental/petstore_api/model/order.py b/samples/client/petstore/python-experimental/petstore_api/model/order.py index ddc3332d66d7..b21543df95f5 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/order.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/order.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -183,7 +179,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/client/petstore/python-experimental/petstore_api/model/parent.py b/samples/client/petstore/python-experimental/petstore_api/model/parent.py index a855a3ffd014..e304790e4a6a 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/parent.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/parent.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) try: @@ -203,7 +199,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 for var_name, var_value in required_args.items(): setattr(self, var_name, var_value) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name in unused_args and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/client/petstore/python-experimental/petstore_api/model/parent_all_of.py b/samples/client/petstore/python-experimental/petstore_api/model/parent_all_of.py index 28d5f0739316..7c93bfa53044 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/parent_all_of.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/parent_all_of.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -163,7 +159,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/client/petstore/python-experimental/petstore_api/model/parent_pet.py b/samples/client/petstore/python-experimental/petstore_api/model/parent_pet.py index 0b0b30c656f5..be19773d591f 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/parent_pet.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/parent_pet.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) try: @@ -220,7 +216,7 @@ def __init__(self, pet_type, *args, **kwargs): # noqa: E501 for var_name, var_value in required_args.items(): setattr(self, var_name, var_value) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name in unused_args and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/client/petstore/python-experimental/petstore_api/model/pet.py b/samples/client/petstore/python-experimental/petstore_api/model/pet.py index 742d7cdf04a8..5837810f22e9 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/pet.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/pet.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) try: @@ -197,7 +193,7 @@ def __init__(self, name, photo_urls, *args, **kwargs): # noqa: E501 self.name = name self.photo_urls = photo_urls - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/client/petstore/python-experimental/petstore_api/model/player.py b/samples/client/petstore/python-experimental/petstore_api/model/player.py index d65e53c2e5f7..b24471bd4c82 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/player.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/player.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -169,7 +165,7 @@ def __init__(self, name, *args, **kwargs): # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) self.name = name - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/client/petstore/python-experimental/petstore_api/model/read_only_first.py b/samples/client/petstore/python-experimental/petstore_api/model/read_only_first.py index 691d789a92e6..b53aa4db398e 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/read_only_first.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/read_only_first.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -166,7 +162,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/client/petstore/python-experimental/petstore_api/model/special_model_name.py b/samples/client/petstore/python-experimental/petstore_api/model/special_model_name.py index 6e2b80cbe90c..75df4a577a3c 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/special_model_name.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/special_model_name.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -163,7 +159,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/client/petstore/python-experimental/petstore_api/model/string_boolean_map.py b/samples/client/petstore/python-experimental/petstore_api/model/string_boolean_map.py index 8351ad04e2de..b1fb64321118 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/string_boolean_map.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/string_boolean_map.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -160,7 +156,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/client/petstore/python-experimental/petstore_api/model/string_enum.py b/samples/client/petstore/python-experimental/petstore_api/model/string_enum.py index e8f184f4aeed..6f45c19a4cc7 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/string_enum.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/string_enum.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) diff --git a/samples/client/petstore/python-experimental/petstore_api/model/tag.py b/samples/client/petstore/python-experimental/petstore_api/model/tag.py index ee10817f1387..480e1e60322e 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/tag.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/tag.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -169,7 +165,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/client/petstore/python-experimental/petstore_api/model/type_holder_default.py b/samples/client/petstore/python-experimental/petstore_api/model/type_holder_default.py index da92e2cb8ad7..4eb7092ef86c 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/type_holder_default.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/type_holder_default.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -192,7 +188,7 @@ def __init__(self, array_item, *args, **kwargs): # noqa: E501 self.integer_item = integer_item self.bool_item = bool_item self.array_item = array_item - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/client/petstore/python-experimental/petstore_api/model/type_holder_example.py b/samples/client/petstore/python-experimental/petstore_api/model/type_holder_example.py index 4253a0ce7256..6e3cd4280b01 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/type_holder_example.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/type_holder_example.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -194,7 +190,7 @@ def __init__(self, bool_item, array_item, *args, **kwargs): # noqa: E501 self.integer_item = integer_item self.bool_item = bool_item self.array_item = array_item - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/client/petstore/python-experimental/petstore_api/model/user.py b/samples/client/petstore/python-experimental/petstore_api/model/user.py index 6c6dcd1d28ba..95fd0683d741 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/user.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/user.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -184,7 +180,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/client/petstore/python-experimental/petstore_api/model/xml_item.py b/samples/client/petstore/python-experimental/petstore_api/model/xml_item.py index dc48355d3ce1..961fb0f55525 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/xml_item.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/xml_item.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -247,7 +243,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/client/petstore/python-experimental/petstore_api/model_utils.py b/samples/client/petstore/python-experimental/petstore_api/model_utils.py index f15303a09483..ff378aa1e157 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model_utils.py +++ b/samples/client/petstore/python-experimental/petstore_api/model_utils.py @@ -12,13 +12,13 @@ from datetime import date, datetime # noqa: F401 import inspect +import io import os import pprint import re import tempfile from dateutil.parser import parse -import six from petstore_api.exceptions import ( ApiKeyError, @@ -28,20 +28,7 @@ ) none_type = type(None) -if six.PY3: - import io - file_type = io.IOBase - # these are needed for when other modules import str and int from here - str = str - int = int -else: - file_type = file # noqa: F821 - str_py2 = str - unicode_py2 = unicode # noqa: F821 - long_py2 = long # noqa: F821 - int_py2 = int - # this requires that the future library is installed - from builtins import int, str +file_type = io.IOBase class cached_property(object): @@ -344,13 +331,7 @@ def __eq__(self, other): types.add(this_val.__class__) types.add(that_val.__class__) vals_equal = this_val == that_val - if not six.PY3 and len(types) == 2 and unicode in types: # noqa: F821 - vals_equal = ( - this_val.encode('utf-8') == that_val.encode('utf-8') - ) - if not vals_equal: - return False - return True + return vals_equal class ModelNormal(OpenApiModel): @@ -398,17 +379,12 @@ def __eq__(self, other): if not set(self._data_store.keys()) == set(other._data_store.keys()): return False - for _var_name, this_val in six.iteritems(self._data_store): + for _var_name, this_val in self._data_store.items(): that_val = other._data_store[_var_name] types = set() types.add(this_val.__class__) types.add(that_val.__class__) vals_equal = this_val == that_val - if (not six.PY3 and - len(types) == 2 and unicode in types): # noqa: F821 - vals_equal = ( - this_val.encode('utf-8') == that_val.encode('utf-8') - ) if not vals_equal: return False return True @@ -527,17 +503,12 @@ def __eq__(self, other): if not set(self._data_store.keys()) == set(other._data_store.keys()): return False - for _var_name, this_val in six.iteritems(self._data_store): + for _var_name, this_val in self._data_store.items(): that_val = other._data_store[_var_name] types = set() types.add(this_val.__class__) types.add(that_val.__class__) vals_equal = this_val == that_val - if (not six.PY3 and - len(types) == 2 and unicode in types): # noqa: F821 - vals_equal = ( - this_val.encode('utf-8') == that_val.encode('utf-8') - ) if not vals_equal: return False return True @@ -647,8 +618,6 @@ def get_simple_class(input_value): # isinstance(True, int) == True return bool elif isinstance(input_value, int): - # for python2 input_value==long_instance -> return int - # where int is the python3 int backport return int elif isinstance(input_value, datetime): # this must be higher than the date check because @@ -656,8 +625,7 @@ def get_simple_class(input_value): return datetime elif isinstance(input_value, date): return date - elif (six.PY2 and isinstance(input_value, (str_py2, unicode_py2, str)) or - isinstance(input_value, str)): + elif isinstance(input_value, str): return str return type(input_value) @@ -1102,12 +1070,12 @@ def deserialize_primitive(data, klass, path_to_item): return converted_value except (OverflowError, ValueError) as ex: # parse can raise OverflowError - six.raise_from(ApiValueError( + raise ApiValueError( "{0}Failed to parse {1} as {2}".format( - additional_message, repr(data), get_py3_class_name(klass) + additional_message, repr(data), klass.__name__ ), path_to_item=path_to_item - ), ex) + ) from ex def get_discriminator_class(model_class, @@ -1231,8 +1199,8 @@ def deserialize_file(response_data, configuration, content_disposition=None): path = os.path.join(os.path.dirname(path), filename) with open(path, "wb") as f: - if six.PY3 and isinstance(response_data, str): - # in python3 change str to bytes so we can write it + if isinstance(response_data, str): + # change str to bytes so we can write it response_data = response_data.encode('utf-8') f.write(response_data) @@ -1451,7 +1419,7 @@ def validate_and_convert_types(input_value, required_types_mixed, path_to_item, if input_value == {}: # allow an empty dict return input_value - for inner_key, inner_val in six.iteritems(input_value): + for inner_key, inner_val in input_value.items(): inner_path = list(path_to_item) inner_path.append(inner_key) if get_simple_class(inner_key) != str: @@ -1485,7 +1453,7 @@ def model_to_dict(model_instance, serialize=True): if model_instance._composed_schemas: model_instances.extend(model_instance._composed_instances) for model_instance in model_instances: - for attr, value in six.iteritems(model_instance._data_store): + for attr, value in model_instance._data_store.items(): if serialize: # we use get here because additional property key names do not # exist in attribute_map @@ -1542,13 +1510,8 @@ def type_error_message(var_value=None, var_name=None, valid_classes=None, def get_valid_classes_phrase(input_classes): """Returns a string phrase describing what types are allowed - Note: Adds the extra valid classes in python2 """ all_classes = list(input_classes) - if six.PY2 and str in input_classes: - all_classes.extend([str_py2, unicode_py2]) - if six.PY2 and int in input_classes: - all_classes.extend([int_py2, long_py2]) 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: @@ -1556,15 +1519,6 @@ def get_valid_classes_phrase(input_classes): return "is one of [{0}]".format(", ".join(all_class_names)) -def get_py3_class_name(input_class): - if six.PY2: - if input_class == str: - return 'str' - elif input_class == int: - return 'int' - return input_class.__name__ - - def convert_js_args_to_python_args(fn): from functools import wraps @wraps(fn) @@ -1607,7 +1561,7 @@ def get_allof_instances(self, model_args, constant_args): allof_instance = allof_class(**kwargs) composed_instances.append(allof_instance) except Exception as ex: - six.raise_from(ApiValueError( + raise ApiValueError( "Invalid inputs given to generate an instance of '%s'. The " "input data was invalid for the allOf schema '%s' in the composed " "schema '%s'. Error=%s" % ( @@ -1616,7 +1570,7 @@ def get_allof_instances(self, model_args, constant_args): self.__class__.__name__, str(ex) ) - ), ex) + ) from ex return composed_instances diff --git a/samples/client/petstore/python-experimental/petstore_api/rest.py b/samples/client/petstore/python-experimental/petstore_api/rest.py index 973161ca7aef..fb424024afce 100644 --- a/samples/client/petstore/python-experimental/petstore_api/rest.py +++ b/samples/client/petstore/python-experimental/petstore_api/rest.py @@ -10,18 +10,14 @@ """ -from __future__ import absolute_import - import io import json import logging import re import ssl +from urllib.parse import urlencode import certifi -# python 2 and python 3 compatibility library -import six -from six.moves.urllib.parse import urlencode import urllib3 from petstore_api.exceptions import ApiException, ApiValueError @@ -141,7 +137,7 @@ def request(self, method, url, query_params=None, headers=None, timeout = None if _request_timeout: - if isinstance(_request_timeout, (int, ) if six.PY3 else (int, long)): # noqa: E501,F821 + if isinstance(_request_timeout, int): # noqa: E501,F821 timeout = urllib3.Timeout(total=_request_timeout) elif (isinstance(_request_timeout, tuple) and len(_request_timeout) == 2): diff --git a/samples/client/petstore/python-experimental/pom.xml b/samples/client/petstore/python-experimental/pom.xml index 742451c23b2f..9dc399cc8089 100644 --- a/samples/client/petstore/python-experimental/pom.xml +++ b/samples/client/petstore/python-experimental/pom.xml @@ -35,7 +35,7 @@ make - test-all + test diff --git a/samples/client/petstore/python-experimental/requirements.txt b/samples/client/petstore/python-experimental/requirements.txt index a56bedffbf57..2c2f00fcb27b 100644 --- a/samples/client/petstore/python-experimental/requirements.txt +++ b/samples/client/petstore/python-experimental/requirements.txt @@ -1,7 +1,5 @@ nulltype certifi >= 14.05.14 -future; python_version<="2.7" -six >= 1.10 python_dateutil >= 2.5.3 setuptools >= 21.0.0 urllib3 >= 1.15.1 diff --git a/samples/client/petstore/python-experimental/setup.py b/samples/client/petstore/python-experimental/setup.py index 09b715bbccba..eba01f249e05 100644 --- a/samples/client/petstore/python-experimental/setup.py +++ b/samples/client/petstore/python-experimental/setup.py @@ -23,12 +23,10 @@ REQUIRES = [ "urllib3 >= 1.15", - "six >= 1.10", "certifi", "python-dateutil", "nulltype", ] -EXTRAS = {':python_version <= "2.7"': ['future']} setup( name=NAME, @@ -38,8 +36,8 @@ author_email="team@openapitools.org", url="", keywords=["OpenAPI", "OpenAPI-Generator", "OpenAPI Petstore"], + python_requires=">=3.3", install_requires=REQUIRES, - extras_require=EXTRAS, packages=find_packages(exclude=["test", "tests"]), include_package_data=True, license="Apache-2.0", diff --git a/samples/client/petstore/python-experimental/test-requirements.txt b/samples/client/petstore/python-experimental/test-requirements.txt index 06f7754d2044..2d88b0341921 100644 --- a/samples/client/petstore/python-experimental/test-requirements.txt +++ b/samples/client/petstore/python-experimental/test-requirements.txt @@ -1,4 +1,3 @@ -pytest~=4.6.7 # needed for python 2.7+3.4 +pytest~=4.6.7 # needed for python 3.4 pytest-cov>=2.8.1 -pytest-randomly==1.2.3 # needed for python 2.7+3.4 -mock; python_version<="2.7" \ No newline at end of file +pytest-randomly==1.2.3 # needed for python 3.4 diff --git a/samples/client/petstore/python-experimental/test/test_additional_properties_any_type.py b/samples/client/petstore/python-experimental/test/test_additional_properties_any_type.py index ce985f76ed9e..e87caa28bc19 100644 --- a/samples/client/petstore/python-experimental/test/test_additional_properties_any_type.py +++ b/samples/client/petstore/python-experimental/test/test_additional_properties_any_type.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_additional_properties_array.py b/samples/client/petstore/python-experimental/test/test_additional_properties_array.py index f63ca82f6c22..503b4952a207 100644 --- a/samples/client/petstore/python-experimental/test/test_additional_properties_array.py +++ b/samples/client/petstore/python-experimental/test/test_additional_properties_array.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_additional_properties_boolean.py b/samples/client/petstore/python-experimental/test/test_additional_properties_boolean.py index e5a13891c098..da5dc1546917 100644 --- a/samples/client/petstore/python-experimental/test/test_additional_properties_boolean.py +++ b/samples/client/petstore/python-experimental/test/test_additional_properties_boolean.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_additional_properties_class.py b/samples/client/petstore/python-experimental/test/test_additional_properties_class.py index befc14455da2..42fdf1948736 100644 --- a/samples/client/petstore/python-experimental/test/test_additional_properties_class.py +++ b/samples/client/petstore/python-experimental/test/test_additional_properties_class.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_additional_properties_integer.py b/samples/client/petstore/python-experimental/test/test_additional_properties_integer.py index 0e08b8f87706..e594f8207df9 100644 --- a/samples/client/petstore/python-experimental/test/test_additional_properties_integer.py +++ b/samples/client/petstore/python-experimental/test/test_additional_properties_integer.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_additional_properties_number.py b/samples/client/petstore/python-experimental/test/test_additional_properties_number.py index 90f4429e989f..d678ad4d6586 100644 --- a/samples/client/petstore/python-experimental/test/test_additional_properties_number.py +++ b/samples/client/petstore/python-experimental/test/test_additional_properties_number.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_additional_properties_object.py b/samples/client/petstore/python-experimental/test/test_additional_properties_object.py index ded4a8e8a124..9088632e9f56 100644 --- a/samples/client/petstore/python-experimental/test/test_additional_properties_object.py +++ b/samples/client/petstore/python-experimental/test/test_additional_properties_object.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_additional_properties_string.py b/samples/client/petstore/python-experimental/test/test_additional_properties_string.py index cff2c31921fe..29c09806c15f 100644 --- a/samples/client/petstore/python-experimental/test/test_additional_properties_string.py +++ b/samples/client/petstore/python-experimental/test/test_additional_properties_string.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_animal.py b/samples/client/petstore/python-experimental/test/test_animal.py index 958f303f13e3..0e1f8507373c 100644 --- a/samples/client/petstore/python-experimental/test/test_animal.py +++ b/samples/client/petstore/python-experimental/test/test_animal.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_animal_farm.py b/samples/client/petstore/python-experimental/test/test_animal_farm.py index 7117d42b430e..f473c465d731 100644 --- a/samples/client/petstore/python-experimental/test/test_animal_farm.py +++ b/samples/client/petstore/python-experimental/test/test_animal_farm.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_another_fake_api.py b/samples/client/petstore/python-experimental/test/test_another_fake_api.py index f79966a26961..c58dfa6202bc 100644 --- a/samples/client/petstore/python-experimental/test/test_another_fake_api.py +++ b/samples/client/petstore/python-experimental/test/test_another_fake_api.py @@ -10,8 +10,6 @@ """ -from __future__ import absolute_import - import unittest import petstore_api diff --git a/samples/client/petstore/python-experimental/test/test_api_response.py b/samples/client/petstore/python-experimental/test/test_api_response.py index 9db92633f626..a9a900c29cfa 100644 --- a/samples/client/petstore/python-experimental/test/test_api_response.py +++ b/samples/client/petstore/python-experimental/test/test_api_response.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_array_of_array_of_number_only.py b/samples/client/petstore/python-experimental/test/test_array_of_array_of_number_only.py index 4980ad17afb5..39f8874a4e81 100644 --- a/samples/client/petstore/python-experimental/test/test_array_of_array_of_number_only.py +++ b/samples/client/petstore/python-experimental/test/test_array_of_array_of_number_only.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_array_of_number_only.py b/samples/client/petstore/python-experimental/test/test_array_of_number_only.py index 479c537cada7..c4abfd068614 100644 --- a/samples/client/petstore/python-experimental/test/test_array_of_number_only.py +++ b/samples/client/petstore/python-experimental/test/test_array_of_number_only.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_array_test.py b/samples/client/petstore/python-experimental/test/test_array_test.py index 2426b27b7e46..f966f4c0d854 100644 --- a/samples/client/petstore/python-experimental/test/test_array_test.py +++ b/samples/client/petstore/python-experimental/test/test_array_test.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_capitalization.py b/samples/client/petstore/python-experimental/test/test_capitalization.py index 20d2649c01eb..5f47ddb4db09 100644 --- a/samples/client/petstore/python-experimental/test/test_capitalization.py +++ b/samples/client/petstore/python-experimental/test/test_capitalization.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_cat.py b/samples/client/petstore/python-experimental/test/test_cat.py index 64b525aaf118..5f6eba3f8478 100644 --- a/samples/client/petstore/python-experimental/test/test_cat.py +++ b/samples/client/petstore/python-experimental/test/test_cat.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_cat_all_of.py b/samples/client/petstore/python-experimental/test/test_cat_all_of.py index a5bb91ac864e..3d5a33d9907b 100644 --- a/samples/client/petstore/python-experimental/test/test_cat_all_of.py +++ b/samples/client/petstore/python-experimental/test/test_cat_all_of.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_category.py b/samples/client/petstore/python-experimental/test/test_category.py index 59b64e5924a8..29490e0dbdb1 100644 --- a/samples/client/petstore/python-experimental/test/test_category.py +++ b/samples/client/petstore/python-experimental/test/test_category.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_child.py b/samples/client/petstore/python-experimental/test/test_child.py index 51c0bb129d24..7739901bd818 100644 --- a/samples/client/petstore/python-experimental/test/test_child.py +++ b/samples/client/petstore/python-experimental/test/test_child.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest @@ -89,7 +88,7 @@ def testChild(self): with self.assertRaises(petstore_api.ApiAttributeError): invalid_variable = child['invalid_variable'] # with getattr - self.assertEquals(getattr(child, 'invalid_variable', 'some value'), 'some value') + self.assertEqual(getattr(child, 'invalid_variable', 'some value'), 'some value') with self.assertRaises(petstore_api.ApiAttributeError): invalid_variable = getattr(child, 'invalid_variable') diff --git a/samples/client/petstore/python-experimental/test/test_child_all_of.py b/samples/client/petstore/python-experimental/test/test_child_all_of.py index 96e479cf0796..b216908b0a64 100644 --- a/samples/client/petstore/python-experimental/test/test_child_all_of.py +++ b/samples/client/petstore/python-experimental/test/test_child_all_of.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_child_cat.py b/samples/client/petstore/python-experimental/test/test_child_cat.py index 34c085515a80..ba3c16543d8e 100644 --- a/samples/client/petstore/python-experimental/test/test_child_cat.py +++ b/samples/client/petstore/python-experimental/test/test_child_cat.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_child_cat_all_of.py b/samples/client/petstore/python-experimental/test/test_child_cat_all_of.py index 2a7aab100fbf..2a0b6b8c220c 100644 --- a/samples/client/petstore/python-experimental/test/test_child_cat_all_of.py +++ b/samples/client/petstore/python-experimental/test/test_child_cat_all_of.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_child_dog.py b/samples/client/petstore/python-experimental/test/test_child_dog.py index dfb09213e40c..5a726e612444 100644 --- a/samples/client/petstore/python-experimental/test/test_child_dog.py +++ b/samples/client/petstore/python-experimental/test/test_child_dog.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_child_dog_all_of.py b/samples/client/petstore/python-experimental/test/test_child_dog_all_of.py index ca75000c650e..eec5e355674f 100644 --- a/samples/client/petstore/python-experimental/test/test_child_dog_all_of.py +++ b/samples/client/petstore/python-experimental/test/test_child_dog_all_of.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_child_lizard.py b/samples/client/petstore/python-experimental/test/test_child_lizard.py index 975dc1612a9f..0b2bc17c1433 100644 --- a/samples/client/petstore/python-experimental/test/test_child_lizard.py +++ b/samples/client/petstore/python-experimental/test/test_child_lizard.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_child_lizard_all_of.py b/samples/client/petstore/python-experimental/test/test_child_lizard_all_of.py index 1b3bf4dba943..7f1ae842e66c 100644 --- a/samples/client/petstore/python-experimental/test/test_child_lizard_all_of.py +++ b/samples/client/petstore/python-experimental/test/test_child_lizard_all_of.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_class_model.py b/samples/client/petstore/python-experimental/test/test_class_model.py index 060df39e4b5e..6dc2a6928321 100644 --- a/samples/client/petstore/python-experimental/test/test_class_model.py +++ b/samples/client/petstore/python-experimental/test/test_class_model.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_client.py b/samples/client/petstore/python-experimental/test/test_client.py index ab5e3a80d377..caf85a24aa27 100644 --- a/samples/client/petstore/python-experimental/test/test_client.py +++ b/samples/client/petstore/python-experimental/test/test_client.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_dog.py b/samples/client/petstore/python-experimental/test/test_dog.py index 26949b34ae7f..0bdb477f8648 100644 --- a/samples/client/petstore/python-experimental/test/test_dog.py +++ b/samples/client/petstore/python-experimental/test/test_dog.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest @@ -86,7 +85,7 @@ def testDog(self): with self.assertRaises(AttributeError): invalid_variable = dog['invalid_variable'] # with getattr - self.assertEquals(getattr(dog, 'invalid_variable', 'some value'), 'some value') + self.assertEqual(getattr(dog, 'invalid_variable', 'some value'), 'some value') with self.assertRaises(AttributeError): invalid_variable = getattr(dog, 'invalid_variable') diff --git a/samples/client/petstore/python-experimental/test/test_dog_all_of.py b/samples/client/petstore/python-experimental/test/test_dog_all_of.py index 7ab4e8ae79d8..9f5075b7ed71 100644 --- a/samples/client/petstore/python-experimental/test/test_dog_all_of.py +++ b/samples/client/petstore/python-experimental/test/test_dog_all_of.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_enum_arrays.py b/samples/client/petstore/python-experimental/test/test_enum_arrays.py index 64ad5fd7dc08..b1d0394df85d 100644 --- a/samples/client/petstore/python-experimental/test/test_enum_arrays.py +++ b/samples/client/petstore/python-experimental/test/test_enum_arrays.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_enum_class.py b/samples/client/petstore/python-experimental/test/test_enum_class.py index f910231c9d02..ed19c7985d4e 100644 --- a/samples/client/petstore/python-experimental/test/test_enum_class.py +++ b/samples/client/petstore/python-experimental/test/test_enum_class.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_enum_test.py b/samples/client/petstore/python-experimental/test/test_enum_test.py index 7b4c1b6b66ac..b79127a39855 100644 --- a/samples/client/petstore/python-experimental/test/test_enum_test.py +++ b/samples/client/petstore/python-experimental/test/test_enum_test.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_fake_api.py b/samples/client/petstore/python-experimental/test/test_fake_api.py index 2e11cdbc377a..6e3c87bc70ae 100644 --- a/samples/client/petstore/python-experimental/test/test_fake_api.py +++ b/samples/client/petstore/python-experimental/test/test_fake_api.py @@ -10,8 +10,6 @@ """ -from __future__ import absolute_import - import unittest import petstore_api @@ -46,7 +44,6 @@ def test_string(self): """Test case for string """ - from petstore_api.model_utils import str endpoint = self.api.string assert endpoint.openapi_types['body'] == (str,) assert endpoint.settings['response_type'] == (str,) @@ -112,11 +109,7 @@ def test_test_endpoint_enums_length_one(self): """ # when we omit the required enums of length one, they are still set endpoint = self.api.test_endpoint_enums_length_one - import six - if six.PY3: - from unittest.mock import patch - else: - from mock import patch + from unittest.mock import patch with patch.object(endpoint, 'call_with_http_info') as call_with_http_info: endpoint() call_with_http_info.assert_called_with( diff --git a/samples/client/petstore/python-experimental/test/test_fake_classname_tags_123_api.py b/samples/client/petstore/python-experimental/test/test_fake_classname_tags_123_api.py index 1ade31405a62..b7724aaed7d1 100644 --- a/samples/client/petstore/python-experimental/test/test_fake_classname_tags_123_api.py +++ b/samples/client/petstore/python-experimental/test/test_fake_classname_tags_123_api.py @@ -10,8 +10,6 @@ """ -from __future__ import absolute_import -import sys import unittest import petstore_api diff --git a/samples/client/petstore/python-experimental/test/test_file.py b/samples/client/petstore/python-experimental/test/test_file.py index 8d60f64e01cc..438482f39525 100644 --- a/samples/client/petstore/python-experimental/test/test_file.py +++ b/samples/client/petstore/python-experimental/test/test_file.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_file_schema_test_class.py b/samples/client/petstore/python-experimental/test/test_file_schema_test_class.py index 9a4f6d38dfef..ec38c523c7df 100644 --- a/samples/client/petstore/python-experimental/test/test_file_schema_test_class.py +++ b/samples/client/petstore/python-experimental/test/test_file_schema_test_class.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_format_test.py b/samples/client/petstore/python-experimental/test/test_format_test.py index ca37b005fd96..ec2c8d0cbe33 100644 --- a/samples/client/petstore/python-experimental/test/test_format_test.py +++ b/samples/client/petstore/python-experimental/test/test_format_test.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_grandparent.py b/samples/client/petstore/python-experimental/test/test_grandparent.py index 2972d01161cd..bf2455a5ca08 100644 --- a/samples/client/petstore/python-experimental/test/test_grandparent.py +++ b/samples/client/petstore/python-experimental/test/test_grandparent.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_grandparent_animal.py b/samples/client/petstore/python-experimental/test/test_grandparent_animal.py index cabe4d81f98e..42b1f0f716be 100644 --- a/samples/client/petstore/python-experimental/test/test_grandparent_animal.py +++ b/samples/client/petstore/python-experimental/test/test_grandparent_animal.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_has_only_read_only.py b/samples/client/petstore/python-experimental/test/test_has_only_read_only.py index 9ebd7683b398..c9bf4c28658a 100644 --- a/samples/client/petstore/python-experimental/test/test_has_only_read_only.py +++ b/samples/client/petstore/python-experimental/test/test_has_only_read_only.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_list.py b/samples/client/petstore/python-experimental/test/test_list.py index 52156adfed2e..77611c300dc8 100644 --- a/samples/client/petstore/python-experimental/test/test_list.py +++ b/samples/client/petstore/python-experimental/test/test_list.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_map_test.py b/samples/client/petstore/python-experimental/test/test_map_test.py index 3feda0f688df..f905d7e919c2 100644 --- a/samples/client/petstore/python-experimental/test/test_map_test.py +++ b/samples/client/petstore/python-experimental/test/test_map_test.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_mixed_properties_and_additional_properties_class.py b/samples/client/petstore/python-experimental/test/test_mixed_properties_and_additional_properties_class.py index 4dcb5ad4268c..7de400b004fc 100644 --- a/samples/client/petstore/python-experimental/test/test_mixed_properties_and_additional_properties_class.py +++ b/samples/client/petstore/python-experimental/test/test_mixed_properties_and_additional_properties_class.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_model200_response.py b/samples/client/petstore/python-experimental/test/test_model200_response.py index 4012eaae3362..8ff474d5dde3 100644 --- a/samples/client/petstore/python-experimental/test/test_model200_response.py +++ b/samples/client/petstore/python-experimental/test/test_model200_response.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_model_return.py b/samples/client/petstore/python-experimental/test/test_model_return.py index 54c98b33cd66..f856d3d76206 100644 --- a/samples/client/petstore/python-experimental/test/test_model_return.py +++ b/samples/client/petstore/python-experimental/test/test_model_return.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_name.py b/samples/client/petstore/python-experimental/test/test_name.py index 6a9be99d1a57..b3841ca0304f 100644 --- a/samples/client/petstore/python-experimental/test/test_name.py +++ b/samples/client/petstore/python-experimental/test/test_name.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_number_only.py b/samples/client/petstore/python-experimental/test/test_number_only.py index 07aab1d78af7..b7205f5fe029 100644 --- a/samples/client/petstore/python-experimental/test/test_number_only.py +++ b/samples/client/petstore/python-experimental/test/test_number_only.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_number_with_validations.py b/samples/client/petstore/python-experimental/test/test_number_with_validations.py index 3f0b78835d4b..98dc2930d3b0 100644 --- a/samples/client/petstore/python-experimental/test/test_number_with_validations.py +++ b/samples/client/petstore/python-experimental/test/test_number_with_validations.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_object_model_with_ref_props.py b/samples/client/petstore/python-experimental/test/test_object_model_with_ref_props.py index e0a8b842685b..cdf42fcd6620 100644 --- a/samples/client/petstore/python-experimental/test/test_object_model_with_ref_props.py +++ b/samples/client/petstore/python-experimental/test/test_object_model_with_ref_props.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest @@ -34,7 +33,7 @@ def tearDown(self): def testObjectModelWithRefProps(self): """Test ObjectModelWithRefProps""" - from petstore_api.model.object_model_with_ref_props import str, number_with_validations + from petstore_api.model.object_model_with_ref_props import number_with_validations self.assertEqual( ObjectModelWithRefProps.openapi_types, { diff --git a/samples/client/petstore/python-experimental/test/test_order.py b/samples/client/petstore/python-experimental/test/test_order.py index ee6988e28ccd..03f633d353f8 100644 --- a/samples/client/petstore/python-experimental/test/test_order.py +++ b/samples/client/petstore/python-experimental/test/test_order.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_parent.py b/samples/client/petstore/python-experimental/test/test_parent.py index 20282dfb41ea..385c66d2a698 100644 --- a/samples/client/petstore/python-experimental/test/test_parent.py +++ b/samples/client/petstore/python-experimental/test/test_parent.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_parent_all_of.py b/samples/client/petstore/python-experimental/test/test_parent_all_of.py index ca87189bba50..f6485ac3cc38 100644 --- a/samples/client/petstore/python-experimental/test/test_parent_all_of.py +++ b/samples/client/petstore/python-experimental/test/test_parent_all_of.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_parent_pet.py b/samples/client/petstore/python-experimental/test/test_parent_pet.py index 17a4d60e75dc..4a69d88eb787 100644 --- a/samples/client/petstore/python-experimental/test/test_parent_pet.py +++ b/samples/client/petstore/python-experimental/test/test_parent_pet.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_pet.py b/samples/client/petstore/python-experimental/test/test_pet.py index b072cff5e9ad..9edf385aa26a 100644 --- a/samples/client/petstore/python-experimental/test/test_pet.py +++ b/samples/client/petstore/python-experimental/test/test_pet.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_pet_api.py b/samples/client/petstore/python-experimental/test/test_pet_api.py index 091b30cf8ac0..d545f497297a 100644 --- a/samples/client/petstore/python-experimental/test/test_pet_api.py +++ b/samples/client/petstore/python-experimental/test/test_pet_api.py @@ -10,8 +10,6 @@ """ -from __future__ import absolute_import -import sys import unittest import petstore_api diff --git a/samples/client/petstore/python-experimental/test/test_player.py b/samples/client/petstore/python-experimental/test/test_player.py index ee7b95a677f1..6dc813787278 100644 --- a/samples/client/petstore/python-experimental/test/test_player.py +++ b/samples/client/petstore/python-experimental/test/test_player.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_read_only_first.py b/samples/client/petstore/python-experimental/test/test_read_only_first.py index c2dcde240e77..a07676e9c2de 100644 --- a/samples/client/petstore/python-experimental/test/test_read_only_first.py +++ b/samples/client/petstore/python-experimental/test/test_read_only_first.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_special_model_name.py b/samples/client/petstore/python-experimental/test/test_special_model_name.py index 6124525f5170..4c525d99be5b 100644 --- a/samples/client/petstore/python-experimental/test/test_special_model_name.py +++ b/samples/client/petstore/python-experimental/test/test_special_model_name.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_store_api.py b/samples/client/petstore/python-experimental/test/test_store_api.py index 0d9cc3dd36ea..3680a34b42a0 100644 --- a/samples/client/petstore/python-experimental/test/test_store_api.py +++ b/samples/client/petstore/python-experimental/test/test_store_api.py @@ -10,8 +10,6 @@ """ -from __future__ import absolute_import - import unittest import petstore_api diff --git a/samples/client/petstore/python-experimental/test/test_string_boolean_map.py b/samples/client/petstore/python-experimental/test/test_string_boolean_map.py index e2e9d8b420b8..e4e795cca2a9 100644 --- a/samples/client/petstore/python-experimental/test/test_string_boolean_map.py +++ b/samples/client/petstore/python-experimental/test/test_string_boolean_map.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_string_enum.py b/samples/client/petstore/python-experimental/test/test_string_enum.py index 5eed0ad6f0e9..c7f463c444a1 100644 --- a/samples/client/petstore/python-experimental/test/test_string_enum.py +++ b/samples/client/petstore/python-experimental/test/test_string_enum.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_tag.py b/samples/client/petstore/python-experimental/test/test_tag.py index 68a3b9046bf4..0ce1c0a87f1d 100644 --- a/samples/client/petstore/python-experimental/test/test_tag.py +++ b/samples/client/petstore/python-experimental/test/test_tag.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_type_holder_default.py b/samples/client/petstore/python-experimental/test/test_type_holder_default.py index f9c050b81a82..4a517b305b68 100644 --- a/samples/client/petstore/python-experimental/test/test_type_holder_default.py +++ b/samples/client/petstore/python-experimental/test/test_type_holder_default.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_type_holder_example.py b/samples/client/petstore/python-experimental/test/test_type_holder_example.py index e1ee7c368628..8d3c5c745dfe 100644 --- a/samples/client/petstore/python-experimental/test/test_type_holder_example.py +++ b/samples/client/petstore/python-experimental/test/test_type_holder_example.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_user.py b/samples/client/petstore/python-experimental/test/test_user.py index 7241bb589c52..df3d2fff6532 100644 --- a/samples/client/petstore/python-experimental/test/test_user.py +++ b/samples/client/petstore/python-experimental/test/test_user.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_user_api.py b/samples/client/petstore/python-experimental/test/test_user_api.py index df306da07761..abf57b0733da 100644 --- a/samples/client/petstore/python-experimental/test/test_user_api.py +++ b/samples/client/petstore/python-experimental/test/test_user_api.py @@ -10,8 +10,6 @@ """ -from __future__ import absolute_import - import unittest import petstore_api diff --git a/samples/client/petstore/python-experimental/test/test_xml_item.py b/samples/client/petstore/python-experimental/test/test_xml_item.py index 4354664815ff..04322addc2a7 100644 --- a/samples/client/petstore/python-experimental/test/test_xml_item.py +++ b/samples/client/petstore/python-experimental/test/test_xml_item.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test_python2_and_3.sh b/samples/client/petstore/python-experimental/test_python.sh similarity index 100% rename from samples/client/petstore/python-experimental/test_python2_and_3.sh rename to samples/client/petstore/python-experimental/test_python.sh diff --git a/samples/client/petstore/python-experimental/test_python2.sh b/samples/client/petstore/python-experimental/test_python2.sh deleted file mode 100644 index 75b9d6798d9e..000000000000 --- a/samples/client/petstore/python-experimental/test_python2.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/bash - -REQUIREMENTS_FILE=dev-requirements.txt -REQUIREMENTS_OUT=dev-requirements.txt.log -SETUP_OUT=*.egg-info -VENV=venv -DEACTIVE=false - -export LC_ALL=en_US.UTF-8 -export LANG=en_US.UTF-8 -PYTHONPATH="$(which python)" - -### set virtualenv -if [ -z "$VIRTUAL_ENV" ]; then - virtualenv $VENV --python=$PYTHONPATH --no-site-packages --always-copy - source $VENV/bin/activate - DEACTIVE=true -fi - -### install dependencies -pip install -r $REQUIREMENTS_FILE | tee -a $REQUIREMENTS_OUT - -### run tests -tox -e py27 || exit 1 - -### static analysis of code -#flake8 --show-source petstore_api/ - -### deactivate virtualenv -#if [ $DEACTIVE == true ]; then -# deactivate -#fi - diff --git a/samples/client/petstore/python-experimental/tests/test_api_exception.py b/samples/client/petstore/python-experimental/tests/test_api_exception.py index 0d0771b57850..3c415e2ad7b6 100644 --- a/samples/client/petstore/python-experimental/tests/test_api_exception.py +++ b/samples/client/petstore/python-experimental/tests/test_api_exception.py @@ -10,7 +10,6 @@ """ import os -import six import sys import unittest diff --git a/samples/client/petstore/python-experimental/tests/test_deserialization.py b/samples/client/petstore/python-experimental/tests/test_deserialization.py index a3eca81f32fc..a5b1a66e7a49 100644 --- a/samples/client/petstore/python-experimental/tests/test_deserialization.py +++ b/samples/client/petstore/python-experimental/tests/test_deserialization.py @@ -15,8 +15,6 @@ import unittest import datetime -import six - import petstore_api from petstore_api.exceptions import ( @@ -38,9 +36,7 @@ ) from petstore_api.model_utils import ( file_type, - int, model_to_dict, - str, ) from petstore_api.rest import RESTResponse @@ -381,8 +377,7 @@ def get_header(name, default=None): file_path = file_object.name self.assertFalse(file_object.closed) file_object.close() - if six.PY3: - file_data = file_data.encode('utf-8') + file_data = file_data.encode('utf-8') with open(file_path, 'rb') as other_file_object: self.assertEqual(other_file_object.read(), file_data) finally: @@ -407,7 +402,7 @@ def get_header(name, default=None): http_response = HTTPResponse( status=200, reason='OK', - data=json.dumps(data).encode("utf-8") if six.PY3 else json.dumps(data), + data=json.dumps(data).encode("utf-8"), getheaders=get_headers, getheader=get_header ) diff --git a/samples/client/petstore/python-experimental/tests/test_pet_api.py b/samples/client/petstore/python-experimental/tests/test_pet_api.py index 38d7a1cc0b82..0a66b49c1d78 100644 --- a/samples/client/petstore/python-experimental/tests/test_pet_api.py +++ b/samples/client/petstore/python-experimental/tests/test_pet_api.py @@ -23,8 +23,6 @@ RESTResponse ) -import six - from petstore_api.exceptions import ( ApiException, ApiValueError, @@ -36,10 +34,7 @@ import urllib3 -if six.PY3: - from unittest.mock import patch -else: - from mock import patch +from unittest.mock import patch HOST = 'http://localhost/v2' diff --git a/samples/client/petstore/python-experimental/tests/test_serialization.py b/samples/client/petstore/python-experimental/tests/test_serialization.py index 497c3b6dfcfb..6f7166ee563b 100644 --- a/samples/client/petstore/python-experimental/tests/test_serialization.py +++ b/samples/client/petstore/python-experimental/tests/test_serialization.py @@ -15,8 +15,6 @@ import unittest import datetime -import six - import petstore_api from petstore_api.exceptions import ( @@ -37,9 +35,7 @@ ) from petstore_api.model_utils import ( file_type, - int, model_to_dict, - str, ) from petstore_api.rest import RESTResponse diff --git a/samples/client/petstore/python-experimental/tox.ini b/samples/client/petstore/python-experimental/tox.ini index 169d895329bf..8989fc3c4d96 100644 --- a/samples/client/petstore/python-experimental/tox.ini +++ b/samples/client/petstore/python-experimental/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py27, py3 +envlist = py3 [testenv] deps=-r{toxinidir}/requirements.txt diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/.gitlab-ci.yml b/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/.gitlab-ci.yml index 475aaf9bb75b..c0bcd3bec24f 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/.gitlab-ci.yml +++ b/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/.gitlab-ci.yml @@ -10,9 +10,6 @@ stages: - pip install -r test-requirements.txt - pytest --cov=x_auth_id_alias -nosetest-2.7: - extends: .nosetest - image: python:2.7-alpine nosetest-3.3: extends: .nosetest image: python:3.3-alpine diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/.travis.yml b/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/.travis.yml index 97a849816e36..dbcba3d8b95e 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/.travis.yml +++ b/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/.travis.yml @@ -1,7 +1,6 @@ # ref: https://docs.travis-ci.com/user/languages/python language: python python: - - "2.7" - "3.2" - "3.3" - "3.4" diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/README.md b/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/README.md index 38273d89a1dc..b70a7bfcb472 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/README.md +++ b/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/README.md @@ -9,7 +9,7 @@ This Python package is automatically generated by the [OpenAPI Generator](https: ## Requirements. -Python 2.7 and 3.4+ +Python 3.4+ ## Installation & Usage ### pip install @@ -45,7 +45,6 @@ import x_auth_id_alias Please follow the [installation procedure](#installation--usage) and then run the following: ```python -from __future__ import print_function import time import x_auth_id_alias diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/docs/UsageApi.md b/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/docs/UsageApi.md index bea1ee7ce196..e68aff3cb673 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/docs/UsageApi.md +++ b/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/docs/UsageApi.md @@ -22,7 +22,6 @@ Use any API key * Api Key Authentication (api_key): * Api Key Authentication (api_key_query): ```python -from __future__ import print_function import time import x_auth_id_alias from x_auth_id_alias.api import usage_api @@ -107,7 +106,6 @@ Use both API keys * Api Key Authentication (api_key): * Api Key Authentication (api_key_query): ```python -from __future__ import print_function import time import x_auth_id_alias from x_auth_id_alias.api import usage_api @@ -191,7 +189,6 @@ Use API key in header * Api Key Authentication (api_key): ```python -from __future__ import print_function import time import x_auth_id_alias from x_auth_id_alias.api import usage_api @@ -265,7 +262,6 @@ Use API key in query * Api Key Authentication (api_key_query): ```python -from __future__ import print_function import time import x_auth_id_alias from x_auth_id_alias.api import usage_api diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/requirements.txt b/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/requirements.txt index a56bedffbf57..2c2f00fcb27b 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/requirements.txt +++ b/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/requirements.txt @@ -1,7 +1,5 @@ nulltype certifi >= 14.05.14 -future; python_version<="2.7" -six >= 1.10 python_dateutil >= 2.5.3 setuptools >= 21.0.0 urllib3 >= 1.15.1 diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/setup.py b/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/setup.py index d266f0ac09fb..6283d1ff49df 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/setup.py +++ b/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/setup.py @@ -23,12 +23,10 @@ REQUIRES = [ "urllib3 >= 1.15", - "six >= 1.10", "certifi", "python-dateutil", "nulltype", ] -EXTRAS = {':python_version <= "2.7"': ['future']} setup( name=NAME, @@ -38,8 +36,8 @@ author_email="team@openapitools.org", url="", keywords=["OpenAPI", "OpenAPI-Generator", "OpenAPI Extension x-auth-id-alias"], + python_requires=">=3.3", install_requires=REQUIRES, - extras_require=EXTRAS, packages=find_packages(exclude=["test", "tests"]), include_package_data=True, license="Apache-2.0", diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/test-requirements.txt b/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/test-requirements.txt index 06f7754d2044..2d88b0341921 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/test-requirements.txt +++ b/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/test-requirements.txt @@ -1,4 +1,3 @@ -pytest~=4.6.7 # needed for python 2.7+3.4 +pytest~=4.6.7 # needed for python 3.4 pytest-cov>=2.8.1 -pytest-randomly==1.2.3 # needed for python 2.7+3.4 -mock; python_version<="2.7" \ No newline at end of file +pytest-randomly==1.2.3 # needed for python 3.4 diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/test/test_usage_api.py b/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/test/test_usage_api.py index f7d98a751b40..db5d36ec6224 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/test/test_usage_api.py +++ b/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/test/test_usage_api.py @@ -10,8 +10,6 @@ """ -from __future__ import absolute_import - import unittest import x_auth_id_alias diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/tests/test_api_keys.py b/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/tests/test_api_keys.py index 4852fd4b9136..61b723478bc4 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/tests/test_api_keys.py +++ b/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/tests/test_api_keys.py @@ -4,8 +4,6 @@ Test usage of x-auth-id-alias. """ -from __future__ import absolute_import - import unittest import x_auth_id_alias diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/tox.ini b/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/tox.ini index 1eebd7b9dd51..64885ad1bbc9 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/tox.ini +++ b/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py27, py3 +envlist = py3 [testenv] deps=-r{toxinidir}/requirements.txt diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/x_auth_id_alias/__init__.py b/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/x_auth_id_alias/__init__.py index 7b41721baa3c..2003cfda7c10 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/x_auth_id_alias/__init__.py +++ b/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/x_auth_id_alias/__init__.py @@ -12,8 +12,6 @@ """ -from __future__ import absolute_import - __version__ = "1.0.0" # import ApiClient diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/x_auth_id_alias/api/__init__.py b/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/x_auth_id_alias/api/__init__.py index 37e0c5bbdb68..1d37d3395142 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/x_auth_id_alias/api/__init__.py +++ b/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/x_auth_id_alias/api/__init__.py @@ -1,6 +1,3 @@ -from __future__ import absolute_import - -# flake8: noqa - -# import apis into api package -from x_auth_id_alias.api.usage_api import UsageApi +# do not import all apis into this module because that uses a lot of memory and stack frames +# if you need the ability to import all apis from one package, import them with +# from {{packageName}.apis import DefaultApi, PetApi \ No newline at end of file diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/x_auth_id_alias/api/usage_api.py b/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/x_auth_id_alias/api/usage_api.py index 454eefd6b391..d7f0428a38a0 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/x_auth_id_alias/api/usage_api.py +++ b/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/x_auth_id_alias/api/usage_api.py @@ -10,14 +10,9 @@ """ -from __future__ import absolute_import - import re # noqa: F401 import sys # noqa: F401 -# python 2 and python 3 compatibility library -import six - from x_auth_id_alias.api_client import ApiClient, Endpoint from x_auth_id_alias.model_utils import ( # noqa: F401 check_allowed_values, @@ -25,9 +20,7 @@ date, datetime, file_type, - int, none_type, - str, validate_and_convert_types ) diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/x_auth_id_alias/api_client.py b/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/x_auth_id_alias/api_client.py index d2559726f6d1..be9cef4ff3cd 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/x_auth_id_alias/api_client.py +++ b/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/x_auth_id_alias/api_client.py @@ -8,7 +8,6 @@ Generated by: https://openapi-generator.tech """ -from __future__ import absolute_import import json import atexit @@ -16,10 +15,8 @@ from multiprocessing.pool import ThreadPool import os import re +from urllib.parse import quote -# python 2 and python 3 compatibility library -import six -from six.moves.urllib.parse import quote from x_auth_id_alias import rest from x_auth_id_alias.configuration import Configuration @@ -34,10 +31,8 @@ datetime, deserialize_file, file_type, - int, model_to_dict, none_type, - str, validate_and_convert_types ) @@ -64,10 +59,8 @@ class ApiClient(object): to the API. More threads means more concurrent API requests. """ - # six.binary_type python2=str, python3=bytes - # six.text_type python2=unicode, python3=str PRIMITIVE_TYPES = ( - (float, bool, six.binary_type, six.text_type) + six.integer_types + float, bool, bytes, str, int ) _pool = None @@ -191,7 +184,7 @@ def __call_api( _preload_content=_preload_content, _request_timeout=_request_timeout) except ApiException as e: - e.body = e.body.decode('utf-8') if six.PY3 else e.body + e.body = e.body.decode('utf-8') raise e content_type = response_data.getheader('content-type') @@ -204,7 +197,7 @@ def __call_api( return (return_data) return return_data - if six.PY3 and response_type not in ["file", "bytes"]: + if response_type not in ["file", "bytes"]: match = None if content_type is not None: match = re.search(r"charset=([a-zA-Z\-\d]+)[\s\;]?", content_type) @@ -265,7 +258,7 @@ def sanitize_for_serialization(self, obj): return self.sanitize_for_serialization(obj.value) return {key: self.sanitize_for_serialization(val) - for key, val in six.iteritems(obj_dict)} + for key, val in obj_dict.items()} def deserialize(self, response, response_type, _check_type): """Deserializes response into an object. @@ -465,7 +458,7 @@ def parameters_to_tuples(self, params, collection_formats): new_params = [] if collection_formats is None: collection_formats = {} - for k, v in six.iteritems(params) if isinstance(params, dict) else params: # noqa: E501 + for k, v in params.items() if isinstance(params, dict) else params: # noqa: E501 if k in collection_formats: collection_format = collection_formats[k] if collection_format == 'multi': @@ -496,7 +489,7 @@ def files_parameters(self, files=None): return [] params = [] - for param_name, file_instances in six.iteritems(files): + for param_name, file_instances in files.items(): if file_instances is None: # if the file field is nullable, skip None values continue @@ -671,7 +664,7 @@ def __validate_inputs(self, kwargs): if kwargs['_check_input_type'] is False: return - for key, value in six.iteritems(kwargs): + for key, value in kwargs.items(): fixed_val = validate_and_convert_types( value, self.openapi_types[key], @@ -693,7 +686,7 @@ def __gather_params(self, kwargs): 'query': [] } - for param_name, param_value in six.iteritems(kwargs): + for param_name, param_value in kwargs.items(): param_location = self.location_map.get(param_name) if param_location is None: continue @@ -751,7 +744,7 @@ def call_with_http_info(self, **kwargs): ) _host = None - for key, value in six.iteritems(kwargs): + for key, value in kwargs.items(): if key not in self.params_map['all']: raise ApiTypeError( "Got an unexpected parameter '%s'" diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/x_auth_id_alias/configuration.py b/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/x_auth_id_alias/configuration.py index 278f7aa13dbf..5852bbc6b552 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/x_auth_id_alias/configuration.py +++ b/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/x_auth_id_alias/configuration.py @@ -10,16 +10,13 @@ """ -from __future__ import absolute_import - import copy import logging import multiprocessing import sys import urllib3 -import six -from six.moves import http_client as httplib +from http import client as http_client from x_auth_id_alias.exceptions import ApiValueError @@ -288,7 +285,7 @@ def logger_file(self, value): # 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 six.iteritems(self.logger): + for _, logger in self.logger.items(): logger.addHandler(self.logger_file_handler) @property @@ -310,17 +307,17 @@ def debug(self, value): self.__debug = value if self.__debug: # if debug status is True, turn on debug logging - for _, logger in six.iteritems(self.logger): + for _, logger in self.logger.items(): logger.setLevel(logging.DEBUG) - # turn on httplib debug - httplib.HTTPConnection.debuglevel = 1 + # 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 six.iteritems(self.logger): + for _, logger in self.logger.items(): logger.setLevel(logging.WARNING) - # turn off httplib debug - httplib.HTTPConnection.debuglevel = 0 + # turn off http_client debug + http_client.HTTPConnection.debuglevel = 0 @property def logger_format(self): diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/x_auth_id_alias/exceptions.py b/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/x_auth_id_alias/exceptions.py index 13f8852a90fa..28e4253a0af3 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/x_auth_id_alias/exceptions.py +++ b/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/x_auth_id_alias/exceptions.py @@ -10,8 +10,6 @@ """ -import six - class OpenApiException(Exception): """The base exception class for all OpenAPIExceptions""" @@ -132,7 +130,7 @@ def render_path(path_to_item): """Returns a string representation of a path""" result = "" for pth in path_to_item: - if isinstance(pth, six.integer_types): + if isinstance(pth, int): result += "[{0}]".format(pth) else: result += "['{0}']".format(pth) diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/x_auth_id_alias/model_utils.py b/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/x_auth_id_alias/model_utils.py index fb4fc073bd2a..4bbe813f3694 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/x_auth_id_alias/model_utils.py +++ b/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/x_auth_id_alias/model_utils.py @@ -12,13 +12,13 @@ from datetime import date, datetime # noqa: F401 import inspect +import io import os import pprint import re import tempfile from dateutil.parser import parse -import six from x_auth_id_alias.exceptions import ( ApiKeyError, @@ -28,20 +28,7 @@ ) none_type = type(None) -if six.PY3: - import io - file_type = io.IOBase - # these are needed for when other modules import str and int from here - str = str - int = int -else: - file_type = file # noqa: F821 - str_py2 = str - unicode_py2 = unicode # noqa: F821 - long_py2 = long # noqa: F821 - int_py2 = int - # this requires that the future library is installed - from builtins import int, str +file_type = io.IOBase class cached_property(object): @@ -344,13 +331,7 @@ def __eq__(self, other): types.add(this_val.__class__) types.add(that_val.__class__) vals_equal = this_val == that_val - if not six.PY3 and len(types) == 2 and unicode in types: # noqa: F821 - vals_equal = ( - this_val.encode('utf-8') == that_val.encode('utf-8') - ) - if not vals_equal: - return False - return True + return vals_equal class ModelNormal(OpenApiModel): @@ -398,17 +379,12 @@ def __eq__(self, other): if not set(self._data_store.keys()) == set(other._data_store.keys()): return False - for _var_name, this_val in six.iteritems(self._data_store): + for _var_name, this_val in self._data_store.items(): that_val = other._data_store[_var_name] types = set() types.add(this_val.__class__) types.add(that_val.__class__) vals_equal = this_val == that_val - if (not six.PY3 and - len(types) == 2 and unicode in types): # noqa: F821 - vals_equal = ( - this_val.encode('utf-8') == that_val.encode('utf-8') - ) if not vals_equal: return False return True @@ -527,17 +503,12 @@ def __eq__(self, other): if not set(self._data_store.keys()) == set(other._data_store.keys()): return False - for _var_name, this_val in six.iteritems(self._data_store): + for _var_name, this_val in self._data_store.items(): that_val = other._data_store[_var_name] types = set() types.add(this_val.__class__) types.add(that_val.__class__) vals_equal = this_val == that_val - if (not six.PY3 and - len(types) == 2 and unicode in types): # noqa: F821 - vals_equal = ( - this_val.encode('utf-8') == that_val.encode('utf-8') - ) if not vals_equal: return False return True @@ -647,8 +618,6 @@ def get_simple_class(input_value): # isinstance(True, int) == True return bool elif isinstance(input_value, int): - # for python2 input_value==long_instance -> return int - # where int is the python3 int backport return int elif isinstance(input_value, datetime): # this must be higher than the date check because @@ -656,8 +625,7 @@ def get_simple_class(input_value): return datetime elif isinstance(input_value, date): return date - elif (six.PY2 and isinstance(input_value, (str_py2, unicode_py2, str)) or - isinstance(input_value, str)): + elif isinstance(input_value, str): return str return type(input_value) @@ -1102,12 +1070,12 @@ def deserialize_primitive(data, klass, path_to_item): return converted_value except (OverflowError, ValueError) as ex: # parse can raise OverflowError - six.raise_from(ApiValueError( + raise ApiValueError( "{0}Failed to parse {1} as {2}".format( - additional_message, repr(data), get_py3_class_name(klass) + additional_message, repr(data), klass.__name__ ), path_to_item=path_to_item - ), ex) + ) from ex def get_discriminator_class(model_class, @@ -1231,8 +1199,8 @@ def deserialize_file(response_data, configuration, content_disposition=None): path = os.path.join(os.path.dirname(path), filename) with open(path, "wb") as f: - if six.PY3 and isinstance(response_data, str): - # in python3 change str to bytes so we can write it + if isinstance(response_data, str): + # change str to bytes so we can write it response_data = response_data.encode('utf-8') f.write(response_data) @@ -1451,7 +1419,7 @@ def validate_and_convert_types(input_value, required_types_mixed, path_to_item, if input_value == {}: # allow an empty dict return input_value - for inner_key, inner_val in six.iteritems(input_value): + for inner_key, inner_val in input_value.items(): inner_path = list(path_to_item) inner_path.append(inner_key) if get_simple_class(inner_key) != str: @@ -1485,7 +1453,7 @@ def model_to_dict(model_instance, serialize=True): if model_instance._composed_schemas: model_instances.extend(model_instance._composed_instances) for model_instance in model_instances: - for attr, value in six.iteritems(model_instance._data_store): + for attr, value in model_instance._data_store.items(): if serialize: # we use get here because additional property key names do not # exist in attribute_map @@ -1542,13 +1510,8 @@ def type_error_message(var_value=None, var_name=None, valid_classes=None, def get_valid_classes_phrase(input_classes): """Returns a string phrase describing what types are allowed - Note: Adds the extra valid classes in python2 """ all_classes = list(input_classes) - if six.PY2 and str in input_classes: - all_classes.extend([str_py2, unicode_py2]) - if six.PY2 and int in input_classes: - all_classes.extend([int_py2, long_py2]) 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: @@ -1556,15 +1519,6 @@ def get_valid_classes_phrase(input_classes): return "is one of [{0}]".format(", ".join(all_class_names)) -def get_py3_class_name(input_class): - if six.PY2: - if input_class == str: - return 'str' - elif input_class == int: - return 'int' - return input_class.__name__ - - def convert_js_args_to_python_args(fn): from functools import wraps @wraps(fn) @@ -1607,7 +1561,7 @@ def get_allof_instances(self, model_args, constant_args): allof_instance = allof_class(**kwargs) composed_instances.append(allof_instance) except Exception as ex: - six.raise_from(ApiValueError( + raise ApiValueError( "Invalid inputs given to generate an instance of '%s'. The " "input data was invalid for the allOf schema '%s' in the composed " "schema '%s'. Error=%s" % ( @@ -1616,7 +1570,7 @@ def get_allof_instances(self, model_args, constant_args): self.__class__.__name__, str(ex) ) - ), ex) + ) from ex return composed_instances diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/x_auth_id_alias/rest.py b/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/x_auth_id_alias/rest.py index 354091c3a977..2042ee8caa1f 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/x_auth_id_alias/rest.py +++ b/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/x_auth_id_alias/rest.py @@ -10,18 +10,14 @@ """ -from __future__ import absolute_import - import io import json import logging import re import ssl +from urllib.parse import urlencode import certifi -# python 2 and python 3 compatibility library -import six -from six.moves.urllib.parse import urlencode import urllib3 from x_auth_id_alias.exceptions import ApiException, ApiValueError @@ -141,7 +137,7 @@ def request(self, method, url, query_params=None, headers=None, timeout = None if _request_timeout: - if isinstance(_request_timeout, (int, ) if six.PY3 else (int, long)): # noqa: E501,F821 + if isinstance(_request_timeout, int): # noqa: E501,F821 timeout = urllib3.Timeout(total=_request_timeout) elif (isinstance(_request_timeout, tuple) and len(_request_timeout) == 2): diff --git a/samples/openapi3/client/features/dynamic-servers/python-experimental/.gitlab-ci.yml b/samples/openapi3/client/features/dynamic-servers/python-experimental/.gitlab-ci.yml index b242dc37516c..c568a94e1d53 100644 --- a/samples/openapi3/client/features/dynamic-servers/python-experimental/.gitlab-ci.yml +++ b/samples/openapi3/client/features/dynamic-servers/python-experimental/.gitlab-ci.yml @@ -10,9 +10,6 @@ stages: - pip install -r test-requirements.txt - pytest --cov=dynamic_servers -nosetest-2.7: - extends: .nosetest - image: python:2.7-alpine nosetest-3.3: extends: .nosetest image: python:3.3-alpine diff --git a/samples/openapi3/client/features/dynamic-servers/python-experimental/.travis.yml b/samples/openapi3/client/features/dynamic-servers/python-experimental/.travis.yml index e6f2ea657f76..830b855ce62e 100644 --- a/samples/openapi3/client/features/dynamic-servers/python-experimental/.travis.yml +++ b/samples/openapi3/client/features/dynamic-servers/python-experimental/.travis.yml @@ -1,7 +1,6 @@ # ref: https://docs.travis-ci.com/user/languages/python language: python python: - - "2.7" - "3.2" - "3.3" - "3.4" diff --git a/samples/openapi3/client/features/dynamic-servers/python-experimental/README.md b/samples/openapi3/client/features/dynamic-servers/python-experimental/README.md index 81db8a329f8f..f85d06bd96c9 100644 --- a/samples/openapi3/client/features/dynamic-servers/python-experimental/README.md +++ b/samples/openapi3/client/features/dynamic-servers/python-experimental/README.md @@ -9,7 +9,7 @@ This Python package is automatically generated by the [OpenAPI Generator](https: ## Requirements. -Python 2.7 and 3.4+ +Python 3.4+ ## Installation & Usage ### pip install @@ -45,7 +45,6 @@ import dynamic_servers Please follow the [installation procedure](#installation--usage) and then run the following: ```python -from __future__ import print_function import time import dynamic_servers diff --git a/samples/openapi3/client/features/dynamic-servers/python-experimental/docs/UsageApi.md b/samples/openapi3/client/features/dynamic-servers/python-experimental/docs/UsageApi.md index 3c4ed134c538..ab21766abafd 100644 --- a/samples/openapi3/client/features/dynamic-servers/python-experimental/docs/UsageApi.md +++ b/samples/openapi3/client/features/dynamic-servers/python-experimental/docs/UsageApi.md @@ -18,7 +18,6 @@ Use custom server ### Example ```python -from __future__ import print_function import time import dynamic_servers from dynamic_servers.api import usage_api @@ -77,7 +76,6 @@ Use default server ### Example ```python -from __future__ import print_function import time import dynamic_servers from dynamic_servers.api import usage_api diff --git a/samples/openapi3/client/features/dynamic-servers/python-experimental/dynamic_servers/__init__.py b/samples/openapi3/client/features/dynamic-servers/python-experimental/dynamic_servers/__init__.py index e42afd4939e5..b7f955894f8d 100644 --- a/samples/openapi3/client/features/dynamic-servers/python-experimental/dynamic_servers/__init__.py +++ b/samples/openapi3/client/features/dynamic-servers/python-experimental/dynamic_servers/__init__.py @@ -12,8 +12,6 @@ """ -from __future__ import absolute_import - __version__ = "1.0.0" # import ApiClient diff --git a/samples/openapi3/client/features/dynamic-servers/python-experimental/dynamic_servers/api/__init__.py b/samples/openapi3/client/features/dynamic-servers/python-experimental/dynamic_servers/api/__init__.py index e4e46e3843e0..1d37d3395142 100644 --- a/samples/openapi3/client/features/dynamic-servers/python-experimental/dynamic_servers/api/__init__.py +++ b/samples/openapi3/client/features/dynamic-servers/python-experimental/dynamic_servers/api/__init__.py @@ -1,6 +1,3 @@ -from __future__ import absolute_import - -# flake8: noqa - -# import apis into api package -from dynamic_servers.api.usage_api import UsageApi +# do not import all apis into this module because that uses a lot of memory and stack frames +# if you need the ability to import all apis from one package, import them with +# from {{packageName}.apis import DefaultApi, PetApi \ No newline at end of file diff --git a/samples/openapi3/client/features/dynamic-servers/python-experimental/dynamic_servers/api/usage_api.py b/samples/openapi3/client/features/dynamic-servers/python-experimental/dynamic_servers/api/usage_api.py index d73b46b4ebba..6415fe505d20 100644 --- a/samples/openapi3/client/features/dynamic-servers/python-experimental/dynamic_servers/api/usage_api.py +++ b/samples/openapi3/client/features/dynamic-servers/python-experimental/dynamic_servers/api/usage_api.py @@ -10,14 +10,9 @@ """ -from __future__ import absolute_import - import re # noqa: F401 import sys # noqa: F401 -# python 2 and python 3 compatibility library -import six - from dynamic_servers.api_client import ApiClient, Endpoint from dynamic_servers.model_utils import ( # noqa: F401 check_allowed_values, @@ -25,9 +20,7 @@ date, datetime, file_type, - int, none_type, - str, validate_and_convert_types ) diff --git a/samples/openapi3/client/features/dynamic-servers/python-experimental/dynamic_servers/api_client.py b/samples/openapi3/client/features/dynamic-servers/python-experimental/dynamic_servers/api_client.py index ca8d70ce9a53..cbbaa8c0b2b1 100644 --- a/samples/openapi3/client/features/dynamic-servers/python-experimental/dynamic_servers/api_client.py +++ b/samples/openapi3/client/features/dynamic-servers/python-experimental/dynamic_servers/api_client.py @@ -8,7 +8,6 @@ Generated by: https://openapi-generator.tech """ -from __future__ import absolute_import import json import atexit @@ -16,10 +15,8 @@ from multiprocessing.pool import ThreadPool import os import re +from urllib.parse import quote -# python 2 and python 3 compatibility library -import six -from six.moves.urllib.parse import quote from dynamic_servers import rest from dynamic_servers.configuration import Configuration @@ -34,10 +31,8 @@ datetime, deserialize_file, file_type, - int, model_to_dict, none_type, - str, validate_and_convert_types ) @@ -64,10 +59,8 @@ class ApiClient(object): to the API. More threads means more concurrent API requests. """ - # six.binary_type python2=str, python3=bytes - # six.text_type python2=unicode, python3=str PRIMITIVE_TYPES = ( - (float, bool, six.binary_type, six.text_type) + six.integer_types + float, bool, bytes, str, int ) _pool = None @@ -191,7 +184,7 @@ def __call_api( _preload_content=_preload_content, _request_timeout=_request_timeout) except ApiException as e: - e.body = e.body.decode('utf-8') if six.PY3 else e.body + e.body = e.body.decode('utf-8') raise e content_type = response_data.getheader('content-type') @@ -204,7 +197,7 @@ def __call_api( return (return_data) return return_data - if six.PY3 and response_type not in ["file", "bytes"]: + if response_type not in ["file", "bytes"]: match = None if content_type is not None: match = re.search(r"charset=([a-zA-Z\-\d]+)[\s\;]?", content_type) @@ -265,7 +258,7 @@ def sanitize_for_serialization(self, obj): return self.sanitize_for_serialization(obj.value) return {key: self.sanitize_for_serialization(val) - for key, val in six.iteritems(obj_dict)} + for key, val in obj_dict.items()} def deserialize(self, response, response_type, _check_type): """Deserializes response into an object. @@ -465,7 +458,7 @@ def parameters_to_tuples(self, params, collection_formats): new_params = [] if collection_formats is None: collection_formats = {} - for k, v in six.iteritems(params) if isinstance(params, dict) else params: # noqa: E501 + for k, v in params.items() if isinstance(params, dict) else params: # noqa: E501 if k in collection_formats: collection_format = collection_formats[k] if collection_format == 'multi': @@ -496,7 +489,7 @@ def files_parameters(self, files=None): return [] params = [] - for param_name, file_instances in six.iteritems(files): + for param_name, file_instances in files.items(): if file_instances is None: # if the file field is nullable, skip None values continue @@ -671,7 +664,7 @@ def __validate_inputs(self, kwargs): if kwargs['_check_input_type'] is False: return - for key, value in six.iteritems(kwargs): + for key, value in kwargs.items(): fixed_val = validate_and_convert_types( value, self.openapi_types[key], @@ -693,7 +686,7 @@ def __gather_params(self, kwargs): 'query': [] } - for param_name, param_value in six.iteritems(kwargs): + for param_name, param_value in kwargs.items(): param_location = self.location_map.get(param_name) if param_location is None: continue @@ -751,7 +744,7 @@ def call_with_http_info(self, **kwargs): ) _host = None - for key, value in six.iteritems(kwargs): + for key, value in kwargs.items(): if key not in self.params_map['all']: raise ApiTypeError( "Got an unexpected parameter '%s'" diff --git a/samples/openapi3/client/features/dynamic-servers/python-experimental/dynamic_servers/configuration.py b/samples/openapi3/client/features/dynamic-servers/python-experimental/dynamic_servers/configuration.py index 8ece9e3c1350..3bdb2bf69625 100644 --- a/samples/openapi3/client/features/dynamic-servers/python-experimental/dynamic_servers/configuration.py +++ b/samples/openapi3/client/features/dynamic-servers/python-experimental/dynamic_servers/configuration.py @@ -10,16 +10,13 @@ """ -from __future__ import absolute_import - import copy import logging import multiprocessing import sys import urllib3 -import six -from six.moves import http_client as httplib +from http import client as http_client from dynamic_servers.exceptions import ApiValueError @@ -268,7 +265,7 @@ def logger_file(self, value): # 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 six.iteritems(self.logger): + for _, logger in self.logger.items(): logger.addHandler(self.logger_file_handler) @property @@ -290,17 +287,17 @@ def debug(self, value): self.__debug = value if self.__debug: # if debug status is True, turn on debug logging - for _, logger in six.iteritems(self.logger): + for _, logger in self.logger.items(): logger.setLevel(logging.DEBUG) - # turn on httplib debug - httplib.HTTPConnection.debuglevel = 1 + # 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 six.iteritems(self.logger): + for _, logger in self.logger.items(): logger.setLevel(logging.WARNING) - # turn off httplib debug - httplib.HTTPConnection.debuglevel = 0 + # turn off http_client debug + http_client.HTTPConnection.debuglevel = 0 @property def logger_format(self): diff --git a/samples/openapi3/client/features/dynamic-servers/python-experimental/dynamic_servers/exceptions.py b/samples/openapi3/client/features/dynamic-servers/python-experimental/dynamic_servers/exceptions.py index 8cafe7240c1d..a463fd101743 100644 --- a/samples/openapi3/client/features/dynamic-servers/python-experimental/dynamic_servers/exceptions.py +++ b/samples/openapi3/client/features/dynamic-servers/python-experimental/dynamic_servers/exceptions.py @@ -10,8 +10,6 @@ """ -import six - class OpenApiException(Exception): """The base exception class for all OpenAPIExceptions""" @@ -132,7 +130,7 @@ def render_path(path_to_item): """Returns a string representation of a path""" result = "" for pth in path_to_item: - if isinstance(pth, six.integer_types): + if isinstance(pth, int): result += "[{0}]".format(pth) else: result += "['{0}']".format(pth) diff --git a/samples/openapi3/client/features/dynamic-servers/python-experimental/dynamic_servers/model_utils.py b/samples/openapi3/client/features/dynamic-servers/python-experimental/dynamic_servers/model_utils.py index 17527b879bd8..c35b5a8531c8 100644 --- a/samples/openapi3/client/features/dynamic-servers/python-experimental/dynamic_servers/model_utils.py +++ b/samples/openapi3/client/features/dynamic-servers/python-experimental/dynamic_servers/model_utils.py @@ -12,13 +12,13 @@ from datetime import date, datetime # noqa: F401 import inspect +import io import os import pprint import re import tempfile from dateutil.parser import parse -import six from dynamic_servers.exceptions import ( ApiKeyError, @@ -28,20 +28,7 @@ ) none_type = type(None) -if six.PY3: - import io - file_type = io.IOBase - # these are needed for when other modules import str and int from here - str = str - int = int -else: - file_type = file # noqa: F821 - str_py2 = str - unicode_py2 = unicode # noqa: F821 - long_py2 = long # noqa: F821 - int_py2 = int - # this requires that the future library is installed - from builtins import int, str +file_type = io.IOBase class cached_property(object): @@ -344,13 +331,7 @@ def __eq__(self, other): types.add(this_val.__class__) types.add(that_val.__class__) vals_equal = this_val == that_val - if not six.PY3 and len(types) == 2 and unicode in types: # noqa: F821 - vals_equal = ( - this_val.encode('utf-8') == that_val.encode('utf-8') - ) - if not vals_equal: - return False - return True + return vals_equal class ModelNormal(OpenApiModel): @@ -398,17 +379,12 @@ def __eq__(self, other): if not set(self._data_store.keys()) == set(other._data_store.keys()): return False - for _var_name, this_val in six.iteritems(self._data_store): + for _var_name, this_val in self._data_store.items(): that_val = other._data_store[_var_name] types = set() types.add(this_val.__class__) types.add(that_val.__class__) vals_equal = this_val == that_val - if (not six.PY3 and - len(types) == 2 and unicode in types): # noqa: F821 - vals_equal = ( - this_val.encode('utf-8') == that_val.encode('utf-8') - ) if not vals_equal: return False return True @@ -527,17 +503,12 @@ def __eq__(self, other): if not set(self._data_store.keys()) == set(other._data_store.keys()): return False - for _var_name, this_val in six.iteritems(self._data_store): + for _var_name, this_val in self._data_store.items(): that_val = other._data_store[_var_name] types = set() types.add(this_val.__class__) types.add(that_val.__class__) vals_equal = this_val == that_val - if (not six.PY3 and - len(types) == 2 and unicode in types): # noqa: F821 - vals_equal = ( - this_val.encode('utf-8') == that_val.encode('utf-8') - ) if not vals_equal: return False return True @@ -647,8 +618,6 @@ def get_simple_class(input_value): # isinstance(True, int) == True return bool elif isinstance(input_value, int): - # for python2 input_value==long_instance -> return int - # where int is the python3 int backport return int elif isinstance(input_value, datetime): # this must be higher than the date check because @@ -656,8 +625,7 @@ def get_simple_class(input_value): return datetime elif isinstance(input_value, date): return date - elif (six.PY2 and isinstance(input_value, (str_py2, unicode_py2, str)) or - isinstance(input_value, str)): + elif isinstance(input_value, str): return str return type(input_value) @@ -1102,12 +1070,12 @@ def deserialize_primitive(data, klass, path_to_item): return converted_value except (OverflowError, ValueError) as ex: # parse can raise OverflowError - six.raise_from(ApiValueError( + raise ApiValueError( "{0}Failed to parse {1} as {2}".format( - additional_message, repr(data), get_py3_class_name(klass) + additional_message, repr(data), klass.__name__ ), path_to_item=path_to_item - ), ex) + ) from ex def get_discriminator_class(model_class, @@ -1231,8 +1199,8 @@ def deserialize_file(response_data, configuration, content_disposition=None): path = os.path.join(os.path.dirname(path), filename) with open(path, "wb") as f: - if six.PY3 and isinstance(response_data, str): - # in python3 change str to bytes so we can write it + if isinstance(response_data, str): + # change str to bytes so we can write it response_data = response_data.encode('utf-8') f.write(response_data) @@ -1451,7 +1419,7 @@ def validate_and_convert_types(input_value, required_types_mixed, path_to_item, if input_value == {}: # allow an empty dict return input_value - for inner_key, inner_val in six.iteritems(input_value): + for inner_key, inner_val in input_value.items(): inner_path = list(path_to_item) inner_path.append(inner_key) if get_simple_class(inner_key) != str: @@ -1485,7 +1453,7 @@ def model_to_dict(model_instance, serialize=True): if model_instance._composed_schemas: model_instances.extend(model_instance._composed_instances) for model_instance in model_instances: - for attr, value in six.iteritems(model_instance._data_store): + for attr, value in model_instance._data_store.items(): if serialize: # we use get here because additional property key names do not # exist in attribute_map @@ -1542,13 +1510,8 @@ def type_error_message(var_value=None, var_name=None, valid_classes=None, def get_valid_classes_phrase(input_classes): """Returns a string phrase describing what types are allowed - Note: Adds the extra valid classes in python2 """ all_classes = list(input_classes) - if six.PY2 and str in input_classes: - all_classes.extend([str_py2, unicode_py2]) - if six.PY2 and int in input_classes: - all_classes.extend([int_py2, long_py2]) 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: @@ -1556,15 +1519,6 @@ def get_valid_classes_phrase(input_classes): return "is one of [{0}]".format(", ".join(all_class_names)) -def get_py3_class_name(input_class): - if six.PY2: - if input_class == str: - return 'str' - elif input_class == int: - return 'int' - return input_class.__name__ - - def convert_js_args_to_python_args(fn): from functools import wraps @wraps(fn) @@ -1607,7 +1561,7 @@ def get_allof_instances(self, model_args, constant_args): allof_instance = allof_class(**kwargs) composed_instances.append(allof_instance) except Exception as ex: - six.raise_from(ApiValueError( + raise ApiValueError( "Invalid inputs given to generate an instance of '%s'. The " "input data was invalid for the allOf schema '%s' in the composed " "schema '%s'. Error=%s" % ( @@ -1616,7 +1570,7 @@ def get_allof_instances(self, model_args, constant_args): self.__class__.__name__, str(ex) ) - ), ex) + ) from ex return composed_instances diff --git a/samples/openapi3/client/features/dynamic-servers/python-experimental/dynamic_servers/rest.py b/samples/openapi3/client/features/dynamic-servers/python-experimental/dynamic_servers/rest.py index e9bd23610fe3..efe36544bf08 100644 --- a/samples/openapi3/client/features/dynamic-servers/python-experimental/dynamic_servers/rest.py +++ b/samples/openapi3/client/features/dynamic-servers/python-experimental/dynamic_servers/rest.py @@ -10,18 +10,14 @@ """ -from __future__ import absolute_import - import io import json import logging import re import ssl +from urllib.parse import urlencode import certifi -# python 2 and python 3 compatibility library -import six -from six.moves.urllib.parse import urlencode import urllib3 from dynamic_servers.exceptions import ApiException, ApiValueError @@ -141,7 +137,7 @@ def request(self, method, url, query_params=None, headers=None, timeout = None if _request_timeout: - if isinstance(_request_timeout, (int, ) if six.PY3 else (int, long)): # noqa: E501,F821 + if isinstance(_request_timeout, int): # noqa: E501,F821 timeout = urllib3.Timeout(total=_request_timeout) elif (isinstance(_request_timeout, tuple) and len(_request_timeout) == 2): diff --git a/samples/openapi3/client/features/dynamic-servers/python-experimental/requirements.txt b/samples/openapi3/client/features/dynamic-servers/python-experimental/requirements.txt index a56bedffbf57..2c2f00fcb27b 100644 --- a/samples/openapi3/client/features/dynamic-servers/python-experimental/requirements.txt +++ b/samples/openapi3/client/features/dynamic-servers/python-experimental/requirements.txt @@ -1,7 +1,5 @@ nulltype certifi >= 14.05.14 -future; python_version<="2.7" -six >= 1.10 python_dateutil >= 2.5.3 setuptools >= 21.0.0 urllib3 >= 1.15.1 diff --git a/samples/openapi3/client/features/dynamic-servers/python-experimental/setup.py b/samples/openapi3/client/features/dynamic-servers/python-experimental/setup.py index 5da7badc9768..e14ab67ede49 100644 --- a/samples/openapi3/client/features/dynamic-servers/python-experimental/setup.py +++ b/samples/openapi3/client/features/dynamic-servers/python-experimental/setup.py @@ -23,12 +23,10 @@ REQUIRES = [ "urllib3 >= 1.15", - "six >= 1.10", "certifi", "python-dateutil", "nulltype", ] -EXTRAS = {':python_version <= "2.7"': ['future']} setup( name=NAME, @@ -38,8 +36,8 @@ author_email="team@openapitools.org", url="", keywords=["OpenAPI", "OpenAPI-Generator", "OpenAPI Extension with dynamic servers"], + python_requires=">=3.3", install_requires=REQUIRES, - extras_require=EXTRAS, packages=find_packages(exclude=["test", "tests"]), include_package_data=True, license="Apache-2.0", diff --git a/samples/openapi3/client/features/dynamic-servers/python-experimental/test-requirements.txt b/samples/openapi3/client/features/dynamic-servers/python-experimental/test-requirements.txt index 06f7754d2044..2d88b0341921 100644 --- a/samples/openapi3/client/features/dynamic-servers/python-experimental/test-requirements.txt +++ b/samples/openapi3/client/features/dynamic-servers/python-experimental/test-requirements.txt @@ -1,4 +1,3 @@ -pytest~=4.6.7 # needed for python 2.7+3.4 +pytest~=4.6.7 # needed for python 3.4 pytest-cov>=2.8.1 -pytest-randomly==1.2.3 # needed for python 2.7+3.4 -mock; python_version<="2.7" \ No newline at end of file +pytest-randomly==1.2.3 # needed for python 3.4 diff --git a/samples/openapi3/client/features/dynamic-servers/python-experimental/test/test_usage_api.py b/samples/openapi3/client/features/dynamic-servers/python-experimental/test/test_usage_api.py index faffb9263dda..9bca5cafb09d 100644 --- a/samples/openapi3/client/features/dynamic-servers/python-experimental/test/test_usage_api.py +++ b/samples/openapi3/client/features/dynamic-servers/python-experimental/test/test_usage_api.py @@ -9,8 +9,6 @@ Generated by: https://openapi-generator.tech """ -from __future__ import absolute_import - import functools import unittest diff --git a/samples/openapi3/client/features/dynamic-servers/python-experimental/tox.ini b/samples/openapi3/client/features/dynamic-servers/python-experimental/tox.ini index 85712433c51c..c27e7fe3270f 100644 --- a/samples/openapi3/client/features/dynamic-servers/python-experimental/tox.ini +++ b/samples/openapi3/client/features/dynamic-servers/python-experimental/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py27, py3 +envlist = py3 [testenv] deps=-r{toxinidir}/requirements.txt diff --git a/samples/openapi3/client/petstore/python-experimental/.gitlab-ci.yml b/samples/openapi3/client/petstore/python-experimental/.gitlab-ci.yml index 142ce3712ed0..9703213bb062 100644 --- a/samples/openapi3/client/petstore/python-experimental/.gitlab-ci.yml +++ b/samples/openapi3/client/petstore/python-experimental/.gitlab-ci.yml @@ -10,9 +10,6 @@ stages: - pip install -r test-requirements.txt - pytest --cov=petstore_api -nosetest-2.7: - extends: .nosetest - image: python:2.7-alpine nosetest-3.3: extends: .nosetest image: python:3.3-alpine diff --git a/samples/openapi3/client/petstore/python-experimental/.travis.yml b/samples/openapi3/client/petstore/python-experimental/.travis.yml index fcd7e31c7ccf..3aa7c047e1e2 100644 --- a/samples/openapi3/client/petstore/python-experimental/.travis.yml +++ b/samples/openapi3/client/petstore/python-experimental/.travis.yml @@ -1,7 +1,6 @@ # ref: https://docs.travis-ci.com/user/languages/python language: python python: - - "2.7" - "3.2" - "3.3" - "3.4" diff --git a/samples/openapi3/client/petstore/python-experimental/Makefile b/samples/openapi3/client/petstore/python-experimental/Makefile index 9354f43d5096..f8957d5ed65d 100644 --- a/samples/openapi3/client/petstore/python-experimental/Makefile +++ b/samples/openapi3/client/petstore/python-experimental/Makefile @@ -13,7 +13,4 @@ clean: find . -name "__pycache__" -delete test: clean - bash ./test_python2.sh - -test-all: clean - bash ./test_python2_and_3.sh + bash ./test_python.sh diff --git a/samples/openapi3/client/petstore/python-experimental/README.md b/samples/openapi3/client/petstore/python-experimental/README.md index 292874633308..c1f2770b3cc4 100644 --- a/samples/openapi3/client/petstore/python-experimental/README.md +++ b/samples/openapi3/client/petstore/python-experimental/README.md @@ -9,7 +9,7 @@ This Python package is automatically generated by the [OpenAPI Generator](https: ## Requirements. -Python 2.7 and 3.4+ +Python 3.4+ ## Installation & Usage ### pip install @@ -45,7 +45,6 @@ import petstore_api Please follow the [installation procedure](#installation--usage) and then run the following: ```python -from __future__ import print_function import datetime import time import petstore_api diff --git a/samples/openapi3/client/petstore/python-experimental/docs/AnotherFakeApi.md b/samples/openapi3/client/petstore/python-experimental/docs/AnotherFakeApi.md index 4290afb9ab04..b4f0834b1212 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/AnotherFakeApi.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/AnotherFakeApi.md @@ -17,7 +17,6 @@ To test special tags and operation ID starting with number ### Example ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import another_fake_api diff --git a/samples/openapi3/client/petstore/python-experimental/docs/DefaultApi.md b/samples/openapi3/client/petstore/python-experimental/docs/DefaultApi.md index d5e28c8bc429..45617a26a759 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/DefaultApi.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/DefaultApi.md @@ -15,7 +15,6 @@ Method | HTTP request | Description ### Example ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import default_api diff --git a/samples/openapi3/client/petstore/python-experimental/docs/FakeApi.md b/samples/openapi3/client/petstore/python-experimental/docs/FakeApi.md index 4ac72980731f..a9a8e6ca1151 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/FakeApi.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/FakeApi.md @@ -33,7 +33,6 @@ Additional Properties with Array of Enums ### Example ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import fake_api @@ -98,7 +97,6 @@ Test serialization of ArrayModel ### Example ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import fake_api @@ -160,7 +158,6 @@ Array of Enums ### Example ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import fake_api @@ -225,7 +222,6 @@ Test serialization of outer boolean types ### Example ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import fake_api @@ -288,7 +284,6 @@ Test serialization of object with $refed properties ### Example ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import fake_api @@ -350,7 +345,6 @@ Health check endpoint ### Example ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import fake_api @@ -410,7 +404,6 @@ Test serialization of outer number types ### Example ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import fake_api @@ -474,7 +467,6 @@ Test serialization of object with $refed properties ### Example ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import fake_api @@ -538,7 +530,6 @@ Test serialization of outer string types ### Example ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import fake_api @@ -601,7 +592,6 @@ Test serialization of outer enum ### Example ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import fake_api @@ -665,7 +655,6 @@ For this test, the body for this request much reference a schema named `File`. ### Example ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import fake_api @@ -725,7 +714,6 @@ No authorization required ### Example ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import fake_api @@ -789,7 +777,6 @@ To test \"client\" model ### Example ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import fake_api @@ -854,7 +841,6 @@ Fake endpoint for testing various parameters 假端點 偽のエンドポイン * Basic Authentication (http_basic_test): ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import fake_api @@ -961,7 +947,6 @@ To test enum parameters ### Example ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import fake_api @@ -1040,7 +1025,6 @@ Fake endpoint to test group parameters (optional) * Bearer (JWT) Authentication (bearer_test): ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import fake_api @@ -1127,7 +1111,6 @@ test inline additionalProperties ### Example ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import fake_api @@ -1187,7 +1170,6 @@ test json serialization of form data ### Example ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import fake_api @@ -1251,7 +1233,6 @@ To test the collection format in query parameters ### Example ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import fake_api diff --git a/samples/openapi3/client/petstore/python-experimental/docs/FakeClassnameTags123Api.md b/samples/openapi3/client/petstore/python-experimental/docs/FakeClassnameTags123Api.md index 3568b3be2399..713737dfb51d 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/FakeClassnameTags123Api.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/FakeClassnameTags123Api.md @@ -18,7 +18,6 @@ To test class name in snake case * Api Key Authentication (api_key_query): ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import fake_classname_tags_123_api diff --git a/samples/openapi3/client/petstore/python-experimental/docs/PetApi.md b/samples/openapi3/client/petstore/python-experimental/docs/PetApi.md index a5344a30f168..a29af68a4c14 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/PetApi.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/PetApi.md @@ -24,7 +24,6 @@ Add a new pet to the store * OAuth Authentication (petstore_auth): ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import pet_api @@ -156,7 +155,6 @@ Deletes a pet * OAuth Authentication (petstore_auth): ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import pet_api @@ -239,7 +237,6 @@ Multiple status values can be provided with comma separated strings * OAuth Authentication (petstore_auth): ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import pet_api @@ -375,7 +372,6 @@ Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 * OAuth Authentication (petstore_auth): ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import pet_api @@ -511,7 +507,6 @@ Returns a single pet * Api Key Authentication (api_key): ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import pet_api @@ -590,7 +585,6 @@ Update an existing pet * OAuth Authentication (petstore_auth): ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import pet_api @@ -724,7 +718,6 @@ Updates a pet in the store with form data * OAuth Authentication (petstore_auth): ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import pet_api @@ -807,7 +800,6 @@ uploads an image * OAuth Authentication (petstore_auth): ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import pet_api @@ -893,7 +885,6 @@ uploads an image (required) * OAuth Authentication (petstore_auth): ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import pet_api diff --git a/samples/openapi3/client/petstore/python-experimental/docs/StoreApi.md b/samples/openapi3/client/petstore/python-experimental/docs/StoreApi.md index 2cebd103e1f8..cb973190ab39 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/StoreApi.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/StoreApi.md @@ -20,7 +20,6 @@ For valid response try integer IDs with value < 1000. Anything above 1000 or non ### Example ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import store_api @@ -84,7 +83,6 @@ Returns a map of status codes to quantities * Api Key Authentication (api_key): ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import store_api @@ -157,7 +155,6 @@ For valid response try integer IDs with value <= 5 or > 10. Other values will ge ### Example ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import store_api @@ -221,7 +218,6 @@ Place an order for a pet ### Example ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import store_api diff --git a/samples/openapi3/client/petstore/python-experimental/docs/UserApi.md b/samples/openapi3/client/petstore/python-experimental/docs/UserApi.md index ffcdef6d343c..435713374e5f 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/UserApi.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/UserApi.md @@ -24,7 +24,6 @@ This can only be done by the logged in user. ### Example ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import user_api @@ -85,7 +84,6 @@ Creates list of users with given input array ### Example ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import user_api @@ -146,7 +144,6 @@ Creates list of users with given input array ### Example ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import user_api @@ -209,7 +206,6 @@ This can only be done by the logged in user. ### Example ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import user_api @@ -270,7 +266,6 @@ Get user by user name ### Example ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import user_api @@ -334,7 +329,6 @@ Logs user into the system ### Example ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import user_api @@ -398,7 +392,6 @@ Logs out current logged in user session ### Example ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import user_api @@ -456,7 +449,6 @@ This can only be done by the logged in user. ### Example ```python -from __future__ import print_function import time import petstore_api from petstore_api.api import user_api diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/__init__.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/__init__.py index fb7630e30d59..db9beb2ebfb0 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/__init__.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/__init__.py @@ -12,8 +12,6 @@ """ -from __future__ import absolute_import - __version__ = "1.0.0" # import ApiClient diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/__init__.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/__init__.py index fa4e54a80091..1d37d3395142 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/__init__.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/__init__.py @@ -1,12 +1,3 @@ -from __future__ import absolute_import - -# flake8: noqa - -# import apis into api package -from petstore_api.api.another_fake_api import AnotherFakeApi -from petstore_api.api.default_api import DefaultApi -from petstore_api.api.fake_api import FakeApi -from petstore_api.api.fake_classname_tags_123_api import FakeClassnameTags123Api -from petstore_api.api.pet_api import PetApi -from petstore_api.api.store_api import StoreApi -from petstore_api.api.user_api import UserApi +# do not import all apis into this module because that uses a lot of memory and stack frames +# if you need the ability to import all apis from one package, import them with +# from {{packageName}.apis import DefaultApi, PetApi \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/another_fake_api.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/another_fake_api.py index c723d80c54f0..40ca75cb253b 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/another_fake_api.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/another_fake_api.py @@ -10,14 +10,9 @@ """ -from __future__ import absolute_import - import re # noqa: F401 import sys # noqa: F401 -# python 2 and python 3 compatibility library -import six - from petstore_api.api_client import ApiClient, Endpoint from petstore_api.model_utils import ( # noqa: F401 check_allowed_values, @@ -25,9 +20,7 @@ date, datetime, file_type, - int, none_type, - str, validate_and_convert_types ) from petstore_api.model import client diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/default_api.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/default_api.py index c3fcc91e777b..c6bf00fdc40e 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/default_api.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/default_api.py @@ -10,14 +10,9 @@ """ -from __future__ import absolute_import - import re # noqa: F401 import sys # noqa: F401 -# python 2 and python 3 compatibility library -import six - from petstore_api.api_client import ApiClient, Endpoint from petstore_api.model_utils import ( # noqa: F401 check_allowed_values, @@ -25,9 +20,7 @@ date, datetime, file_type, - int, none_type, - str, validate_and_convert_types ) from petstore_api.model import inline_response_default diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api.py index fb29276f752d..b294bfc8e79c 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api.py @@ -10,14 +10,9 @@ """ -from __future__ import absolute_import - import re # noqa: F401 import sys # noqa: F401 -# python 2 and python 3 compatibility library -import six - from petstore_api.api_client import ApiClient, Endpoint from petstore_api.model_utils import ( # noqa: F401 check_allowed_values, @@ -25,9 +20,7 @@ date, datetime, file_type, - int, none_type, - str, validate_and_convert_types ) from petstore_api.model import additional_properties_with_array_of_enums diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_classname_tags_123_api.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_classname_tags_123_api.py index 4e6e9b4f0f4d..067e5a91f50f 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_classname_tags_123_api.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_classname_tags_123_api.py @@ -10,14 +10,9 @@ """ -from __future__ import absolute_import - import re # noqa: F401 import sys # noqa: F401 -# python 2 and python 3 compatibility library -import six - from petstore_api.api_client import ApiClient, Endpoint from petstore_api.model_utils import ( # noqa: F401 check_allowed_values, @@ -25,9 +20,7 @@ date, datetime, file_type, - int, none_type, - str, validate_and_convert_types ) from petstore_api.model import client diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api.py index 1c13ec171a2d..0a018863df49 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api.py @@ -10,14 +10,9 @@ """ -from __future__ import absolute_import - import re # noqa: F401 import sys # noqa: F401 -# python 2 and python 3 compatibility library -import six - from petstore_api.api_client import ApiClient, Endpoint from petstore_api.model_utils import ( # noqa: F401 check_allowed_values, @@ -25,9 +20,7 @@ date, datetime, file_type, - int, none_type, - str, validate_and_convert_types ) from petstore_api.model import pet diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/store_api.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/store_api.py index 075a17d46411..9c608eb31370 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/store_api.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/store_api.py @@ -10,14 +10,9 @@ """ -from __future__ import absolute_import - import re # noqa: F401 import sys # noqa: F401 -# python 2 and python 3 compatibility library -import six - from petstore_api.api_client import ApiClient, Endpoint from petstore_api.model_utils import ( # noqa: F401 check_allowed_values, @@ -25,9 +20,7 @@ date, datetime, file_type, - int, none_type, - str, validate_and_convert_types ) from petstore_api.model import order diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api.py index 96540433aef9..5e3276985d08 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api.py @@ -10,14 +10,9 @@ """ -from __future__ import absolute_import - import re # noqa: F401 import sys # noqa: F401 -# python 2 and python 3 compatibility library -import six - from petstore_api.api_client import ApiClient, Endpoint from petstore_api.model_utils import ( # noqa: F401 check_allowed_values, @@ -25,9 +20,7 @@ date, datetime, file_type, - int, none_type, - str, validate_and_convert_types ) from petstore_api.model import user diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api_client.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api_client.py index 9f3a16a6691f..e31d5c5e4ac7 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api_client.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api_client.py @@ -8,7 +8,6 @@ Generated by: https://openapi-generator.tech """ -from __future__ import absolute_import import json import atexit @@ -16,10 +15,8 @@ from multiprocessing.pool import ThreadPool import os import re +from urllib.parse import quote -# python 2 and python 3 compatibility library -import six -from six.moves.urllib.parse import quote from petstore_api import rest from petstore_api.configuration import Configuration @@ -34,10 +31,8 @@ datetime, deserialize_file, file_type, - int, model_to_dict, none_type, - str, validate_and_convert_types ) @@ -64,10 +59,8 @@ class ApiClient(object): to the API. More threads means more concurrent API requests. """ - # six.binary_type python2=str, python3=bytes - # six.text_type python2=unicode, python3=str PRIMITIVE_TYPES = ( - (float, bool, six.binary_type, six.text_type) + six.integer_types + float, bool, bytes, str, int ) _pool = None @@ -191,7 +184,7 @@ def __call_api( _preload_content=_preload_content, _request_timeout=_request_timeout) except ApiException as e: - e.body = e.body.decode('utf-8') if six.PY3 else e.body + e.body = e.body.decode('utf-8') raise e content_type = response_data.getheader('content-type') @@ -204,7 +197,7 @@ def __call_api( return (return_data) return return_data - if six.PY3 and response_type not in ["file", "bytes"]: + if response_type not in ["file", "bytes"]: match = None if content_type is not None: match = re.search(r"charset=([a-zA-Z\-\d]+)[\s\;]?", content_type) @@ -265,7 +258,7 @@ def sanitize_for_serialization(self, obj): return self.sanitize_for_serialization(obj.value) return {key: self.sanitize_for_serialization(val) - for key, val in six.iteritems(obj_dict)} + for key, val in obj_dict.items()} def deserialize(self, response, response_type, _check_type): """Deserializes response into an object. @@ -465,7 +458,7 @@ def parameters_to_tuples(self, params, collection_formats): new_params = [] if collection_formats is None: collection_formats = {} - for k, v in six.iteritems(params) if isinstance(params, dict) else params: # noqa: E501 + for k, v in params.items() if isinstance(params, dict) else params: # noqa: E501 if k in collection_formats: collection_format = collection_formats[k] if collection_format == 'multi': @@ -496,7 +489,7 @@ def files_parameters(self, files=None): return [] params = [] - for param_name, file_instances in six.iteritems(files): + for param_name, file_instances in files.items(): if file_instances is None: # if the file field is nullable, skip None values continue @@ -678,7 +671,7 @@ def __validate_inputs(self, kwargs): if kwargs['_check_input_type'] is False: return - for key, value in six.iteritems(kwargs): + for key, value in kwargs.items(): fixed_val = validate_and_convert_types( value, self.openapi_types[key], @@ -700,7 +693,7 @@ def __gather_params(self, kwargs): 'query': [] } - for param_name, param_value in six.iteritems(kwargs): + for param_name, param_value in kwargs.items(): param_location = self.location_map.get(param_name) if param_location is None: continue @@ -758,7 +751,7 @@ def call_with_http_info(self, **kwargs): ) _host = None - for key, value in six.iteritems(kwargs): + for key, value in kwargs.items(): if key not in self.params_map['all']: raise ApiTypeError( "Got an unexpected parameter '%s'" diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/configuration.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/configuration.py index 4aca4242723d..14beaba90655 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/configuration.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/configuration.py @@ -10,16 +10,13 @@ """ -from __future__ import absolute_import - import copy import logging import multiprocessing import sys import urllib3 -import six -from six.moves import http_client as httplib +from http import client as http_client from petstore_api.exceptions import ApiValueError @@ -358,7 +355,7 @@ def logger_file(self, value): # 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 six.iteritems(self.logger): + for _, logger in self.logger.items(): logger.addHandler(self.logger_file_handler) @property @@ -380,17 +377,17 @@ def debug(self, value): self.__debug = value if self.__debug: # if debug status is True, turn on debug logging - for _, logger in six.iteritems(self.logger): + for _, logger in self.logger.items(): logger.setLevel(logging.DEBUG) - # turn on httplib debug - httplib.HTTPConnection.debuglevel = 1 + # 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 six.iteritems(self.logger): + for _, logger in self.logger.items(): logger.setLevel(logging.WARNING) - # turn off httplib debug - httplib.HTTPConnection.debuglevel = 0 + # turn off http_client debug + http_client.HTTPConnection.debuglevel = 0 @property def logger_format(self): diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/exceptions.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/exceptions.py index b55977ee5e7e..fecd2081b818 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/exceptions.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/exceptions.py @@ -10,8 +10,6 @@ """ -import six - class OpenApiException(Exception): """The base exception class for all OpenAPIExceptions""" @@ -132,7 +130,7 @@ def render_path(path_to_item): """Returns a string representation of a path""" result = "" for pth in path_to_item: - if isinstance(pth, six.integer_types): + if isinstance(pth, int): result += "[{0}]".format(pth) else: result += "['{0}']".format(pth) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/additional_properties_class.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/additional_properties_class.py index c48b515a7aa3..bc7591c4eb5a 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/additional_properties_class.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/additional_properties_class.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -184,7 +180,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/additional_properties_with_array_of_enums.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/additional_properties_with_array_of_enums.py index 09c35b5d0d24..006e258d72da 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/additional_properties_with_array_of_enums.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/additional_properties_with_array_of_enums.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) try: @@ -165,7 +161,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/address.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/address.py index a71502767ae1..7c16f2ba3b5a 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/address.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/address.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -160,7 +156,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/animal.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/animal.py index 7ba62dad1622..7f1257e2ab4f 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/animal.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/animal.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) try: @@ -185,7 +181,7 @@ def __init__(self, class_name, *args, **kwargs): # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) self.class_name = class_name - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/animal_farm.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/animal_farm.py index 4030d038edb3..94d6d094d68d 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/animal_farm.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/animal_farm.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) try: diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/api_response.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/api_response.py index c921519b8783..24a2e3d897a6 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/api_response.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/api_response.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -169,7 +165,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/apple.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/apple.py index 3f87c152e338..a87374c4407b 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/apple.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/apple.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -177,7 +173,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/apple_req.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/apple_req.py index 66b2899dbf67..16ef4bcac8af 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/apple_req.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/apple_req.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -169,7 +165,7 @@ def __init__(self, cultivar, *args, **kwargs): # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) self.cultivar = cultivar - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_array_of_number_only.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_array_of_number_only.py index b9f52d6ba7bc..014740ca0a6f 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_array_of_number_only.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_array_of_number_only.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -163,7 +159,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_enums.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_enums.py index 7e1428454e54..dbde502ccd9e 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_enums.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_enums.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) try: diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_number_only.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_number_only.py index 45021fef4c51..00afce1fb4a1 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_number_only.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_number_only.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -163,7 +159,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_test.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_test.py index e2bc76832b27..e4478c5acdc8 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_test.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_test.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) try: @@ -174,7 +170,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/banana.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/banana.py index 6e42bcb57251..13725068e7ee 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/banana.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/banana.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -163,7 +159,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/banana_req.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/banana_req.py index 3128a038053f..2675290a9c46 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/banana_req.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/banana_req.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -169,7 +165,7 @@ def __init__(self, length_cm, *args, **kwargs): # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) self.length_cm = length_cm - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/basque_pig.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/basque_pig.py index cf39c1833dc2..2766647c867d 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/basque_pig.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/basque_pig.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -166,7 +162,7 @@ def __init__(self, class_name, *args, **kwargs): # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) self.class_name = class_name - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/capitalization.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/capitalization.py index 06745009d8b8..18c5f54c06fe 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/capitalization.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/capitalization.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -178,7 +174,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/cat.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/cat.py index ab01b1f0a9c5..32966359277d 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/cat.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/cat.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) try: @@ -218,7 +214,7 @@ def __init__(self, class_name, *args, **kwargs): # noqa: E501 for var_name, var_value in required_args.items(): setattr(self, var_name, var_value) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name in unused_args and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/cat_all_of.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/cat_all_of.py index 49ae9462f491..c257813c1206 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/cat_all_of.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/cat_all_of.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -163,7 +159,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/category.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/category.py index 16e4a33d4f04..e2be1802b1d5 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/category.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/category.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -170,7 +166,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) self.name = name - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/child_cat.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/child_cat.py index 996f3e0098e2..0710d1523d69 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/child_cat.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/child_cat.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) try: @@ -210,7 +206,7 @@ def __init__(self, pet_type, *args, **kwargs): # noqa: E501 for var_name, var_value in required_args.items(): setattr(self, var_name, var_value) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name in unused_args and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/child_cat_all_of.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/child_cat_all_of.py index 1ddf92fb1227..cc67b70c8748 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/child_cat_all_of.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/child_cat_all_of.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -163,7 +159,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/class_model.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/class_model.py index fc88f68e3f5f..d80e4ef3671f 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/class_model.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/class_model.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -163,7 +159,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/client.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/client.py index fa99b07fa328..2ea3b4aadd4a 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/client.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/client.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -163,7 +159,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/complex_quadrilateral.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/complex_quadrilateral.py index 7cc5a70032a0..768104df4cc9 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/complex_quadrilateral.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/complex_quadrilateral.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) try: @@ -207,7 +203,7 @@ def __init__(self, shape_type, quadrilateral_type, *args, **kwargs): # noqa: E5 for var_name, var_value in required_args.items(): setattr(self, var_name, var_value) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name in unused_args and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_one_of_number_with_validations.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_one_of_number_with_validations.py index 22ca4a480ae9..b513cd1039a9 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_one_of_number_with_validations.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_one_of_number_with_validations.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) try: @@ -207,7 +203,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 for var_name, var_value in required_args.items(): setattr(self, var_name, var_value) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name in unused_args and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/danish_pig.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/danish_pig.py index 375fde3258ab..768a47bdc72a 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/danish_pig.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/danish_pig.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -166,7 +162,7 @@ def __init__(self, class_name, *args, **kwargs): # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) self.class_name = class_name - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/dog.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/dog.py index a100eb3c70ef..836d19b484ad 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/dog.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/dog.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) try: @@ -213,7 +209,7 @@ def __init__(self, class_name, *args, **kwargs): # noqa: E501 for var_name, var_value in required_args.items(): setattr(self, var_name, var_value) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name in unused_args and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/dog_all_of.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/dog_all_of.py index 0d053aca2a63..299a4d956bc9 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/dog_all_of.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/dog_all_of.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -163,7 +159,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/drawing.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/drawing.py index 8d61b20887d1..ea6422a10222 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/drawing.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/drawing.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) try: @@ -192,7 +188,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_arrays.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_arrays.py index a19990449748..161ddd5c1d1e 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_arrays.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_arrays.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -174,7 +170,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_class.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_class.py index 7c5014fd532b..dac3ee37d032 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_class.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_class.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_test.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_test.py index 722906fbf940..120cb1b3da97 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_test.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_test.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) try: @@ -233,7 +229,7 @@ def __init__(self, enum_string_required, *args, **kwargs): # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) self.enum_string_required = enum_string_required - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/equilateral_triangle.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/equilateral_triangle.py index 44f69a5dced7..e3a3507fa7f3 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/equilateral_triangle.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/equilateral_triangle.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) try: @@ -207,7 +203,7 @@ def __init__(self, shape_type, triangle_type, *args, **kwargs): # noqa: E501 for var_name, var_value in required_args.items(): setattr(self, var_name, var_value) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name in unused_args and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/file.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/file.py index 0152f8d8c667..f7cdcb4fdf8b 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/file.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/file.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -163,7 +159,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/file_schema_test_class.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/file_schema_test_class.py index 0a9471e9e420..3c1d880d3585 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/file_schema_test_class.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/file_schema_test_class.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) try: @@ -171,7 +167,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/foo.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/foo.py index 34b9eb6fba64..5bb23de0783b 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/foo.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/foo.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -163,7 +159,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/format_test.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/format_test.py index 6c5ae81e7dd2..929b5abb69ae 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/format_test.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/format_test.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -254,7 +250,7 @@ def __init__(self, number, byte, date, password, *args, **kwargs): # noqa: E501 self.byte = byte self.date = date self.password = password - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/fruit.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/fruit.py index 244497b64a10..61f95c056a9d 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/fruit.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/fruit.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) try: @@ -220,7 +216,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 for var_name, var_value in required_args.items(): setattr(self, var_name, var_value) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name in unused_args and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/fruit_req.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/fruit_req.py index 11a7615749cc..88ace981c69b 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/fruit_req.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/fruit_req.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) try: @@ -215,7 +211,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 for var_name, var_value in required_args.items(): setattr(self, var_name, var_value) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name in unused_args and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/gm_fruit.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/gm_fruit.py index e2ebe6fd9d17..9e063a029081 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/gm_fruit.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/gm_fruit.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) try: @@ -220,7 +216,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 for var_name, var_value in required_args.items(): setattr(self, var_name, var_value) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name in unused_args and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/grandparent_animal.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/grandparent_animal.py index b5af666f7530..3f847bc715dd 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/grandparent_animal.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/grandparent_animal.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) try: @@ -182,7 +178,7 @@ def __init__(self, pet_type, *args, **kwargs): # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) self.pet_type = pet_type - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/has_only_read_only.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/has_only_read_only.py index eeb685139cb1..7a722ee9c78c 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/has_only_read_only.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/has_only_read_only.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -166,7 +162,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/health_check_result.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/health_check_result.py index be6cfa1c0afa..4c56f5022423 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/health_check_result.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/health_check_result.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -163,7 +159,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_object.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_object.py index 8975f4be51ea..062e58320122 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_object.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_object.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -166,7 +162,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_object1.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_object1.py index 4991e8995301..7cfd107cc18e 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_object1.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_object1.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -166,7 +162,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_object2.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_object2.py index 5b4140270330..adde4e38e9fa 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_object2.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_object2.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -175,7 +171,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_object3.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_object3.py index 01c49c375e72..1cadbd05785c 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_object3.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_object3.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -242,7 +238,7 @@ def __init__(self, number, double, pattern_without_delimiter, byte, *args, **kwa self.double = double self.pattern_without_delimiter = pattern_without_delimiter self.byte = byte - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_object4.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_object4.py index a45a324fb517..1625fed11416 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_object4.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_object4.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -170,7 +166,7 @@ def __init__(self, param, param2, *args, **kwargs): # noqa: E501 self.param = param self.param2 = param2 - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_object5.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_object5.py index 23e081958325..57d0e6f2c86c 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_object5.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_object5.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -169,7 +165,7 @@ def __init__(self, required_file, *args, **kwargs): # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) self.required_file = required_file - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_response_default.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_response_default.py index f3abf4a7a193..a80abc389710 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_response_default.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_response_default.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) try: @@ -168,7 +164,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum.py index 2a47792756b4..9f68ce79be7c 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_one_value.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_one_value.py index 0b28c34c3aff..ee0ef6db55c4 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_one_value.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_one_value.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_with_default_value.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_with_default_value.py index e32d50e3f0ab..73211d171cec 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_with_default_value.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_with_default_value.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/isosceles_triangle.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/isosceles_triangle.py index 40c8878bb003..a608fe9b7235 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/isosceles_triangle.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/isosceles_triangle.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) try: @@ -207,7 +203,7 @@ def __init__(self, shape_type, triangle_type, *args, **kwargs): # noqa: E501 for var_name, var_value in required_args.items(): setattr(self, var_name, var_value) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name in unused_args and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/list.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/list.py index 9499f26c7b18..77bd4d0565dc 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/list.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/list.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -163,7 +159,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/mammal.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/mammal.py index e0b9f314080d..f6c274287fd8 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/mammal.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/mammal.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) try: @@ -229,7 +225,7 @@ def __init__(self, class_name, *args, **kwargs): # noqa: E501 for var_name, var_value in required_args.items(): setattr(self, var_name, var_value) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name in unused_args and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/map_test.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/map_test.py index a22af06ce4fd..5bafea48a041 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/map_test.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/map_test.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) try: @@ -181,7 +177,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/mixed_properties_and_additional_properties_class.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/mixed_properties_and_additional_properties_class.py index a0fcac2eb019..12cda6cf9ae9 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/mixed_properties_and_additional_properties_class.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/mixed_properties_and_additional_properties_class.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) try: @@ -174,7 +170,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/model200_response.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/model200_response.py index 54cc1fa338d5..ea4df21be49e 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/model200_response.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/model200_response.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -166,7 +162,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/model_return.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/model_return.py index cf7415f0bd72..535657ebbcf0 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/model_return.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/model_return.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -163,7 +159,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/name.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/name.py index 33a95baafcf7..95f197a7a595 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/name.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/name.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -175,7 +171,7 @@ def __init__(self, name, *args, **kwargs): # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) self.name = name - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_class.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_class.py index c16714bd32f9..878266d85d3a 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_class.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_class.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -196,7 +192,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_shape.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_shape.py index 77778126a6f7..a2979d1b6703 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_shape.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_shape.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) try: @@ -219,7 +215,7 @@ def __init__(self, shape_type, *args, **kwargs): # noqa: E501 for var_name, var_value in required_args.items(): setattr(self, var_name, var_value) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name in unused_args and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/number_only.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/number_only.py index 305da1d7538e..d16ea3765fcb 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/number_only.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/number_only.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -163,7 +159,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/number_with_validations.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/number_with_validations.py index b860a7848d67..dcd182e3401e 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/number_with_validations.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/number_with_validations.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_model_with_ref_props.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_model_with_ref_props.py index f76243bc365e..15ccc61db3f9 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_model_with_ref_props.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_model_with_ref_props.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) try: @@ -174,7 +170,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/order.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/order.py index ddc3332d66d7..b21543df95f5 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/order.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/order.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -183,7 +179,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/parent_pet.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/parent_pet.py index 26a44926fa3e..f8faa308d6fd 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/parent_pet.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/parent_pet.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) try: @@ -208,7 +204,7 @@ def __init__(self, pet_type, *args, **kwargs): # noqa: E501 for var_name, var_value in required_args.items(): setattr(self, var_name, var_value) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name in unused_args and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/pet.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/pet.py index 742d7cdf04a8..5837810f22e9 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/pet.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/pet.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) try: @@ -197,7 +193,7 @@ def __init__(self, name, photo_urls, *args, **kwargs): # noqa: E501 self.name = name self.photo_urls = photo_urls - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/pig.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/pig.py index 2e02e4e88c98..f64d88bfeb19 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/pig.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/pig.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) try: @@ -209,7 +205,7 @@ def __init__(self, class_name, *args, **kwargs): # noqa: E501 for var_name, var_value in required_args.items(): setattr(self, var_name, var_value) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name in unused_args and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/quadrilateral.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/quadrilateral.py index b0766c987164..ca871a544fb5 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/quadrilateral.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/quadrilateral.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) try: @@ -214,7 +210,7 @@ def __init__(self, quadrilateral_type, *args, **kwargs): # noqa: E501 for var_name, var_value in required_args.items(): setattr(self, var_name, var_value) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name in unused_args and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/quadrilateral_interface.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/quadrilateral_interface.py index 05e4d0f3b16d..e76a7e0a9c0e 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/quadrilateral_interface.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/quadrilateral_interface.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -166,7 +162,7 @@ def __init__(self, quadrilateral_type, *args, **kwargs): # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) self.quadrilateral_type = quadrilateral_type - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/read_only_first.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/read_only_first.py index 691d789a92e6..b53aa4db398e 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/read_only_first.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/read_only_first.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -166,7 +162,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/scalene_triangle.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/scalene_triangle.py index 2c58f1bb99ae..55defdec4871 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/scalene_triangle.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/scalene_triangle.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) try: @@ -207,7 +203,7 @@ def __init__(self, shape_type, triangle_type, *args, **kwargs): # noqa: E501 for var_name, var_value in required_args.items(): setattr(self, var_name, var_value) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name in unused_args and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape.py index 9eec4b7705ed..457d5743b5c9 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) try: @@ -219,7 +215,7 @@ def __init__(self, shape_type, *args, **kwargs): # noqa: E501 for var_name, var_value in required_args.items(): setattr(self, var_name, var_value) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name in unused_args and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape_interface.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape_interface.py index 1f3d518ba3ec..1db0ffe70ce5 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape_interface.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape_interface.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -166,7 +162,7 @@ def __init__(self, shape_type, *args, **kwargs): # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) self.shape_type = shape_type - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape_or_null.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape_or_null.py index 8c00f44dfaac..17027a5bc55b 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape_or_null.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape_or_null.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) try: @@ -219,7 +215,7 @@ def __init__(self, shape_type, *args, **kwargs): # noqa: E501 for var_name, var_value in required_args.items(): setattr(self, var_name, var_value) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name in unused_args and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/simple_quadrilateral.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/simple_quadrilateral.py index dd27bd66fea7..330cb8458138 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/simple_quadrilateral.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/simple_quadrilateral.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) try: @@ -207,7 +203,7 @@ def __init__(self, shape_type, quadrilateral_type, *args, **kwargs): # noqa: E5 for var_name, var_value in required_args.items(): setattr(self, var_name, var_value) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name in unused_args and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/special_model_name.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/special_model_name.py index 6e2b80cbe90c..75df4a577a3c 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/special_model_name.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/special_model_name.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -163,7 +159,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_boolean_map.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_boolean_map.py index 8351ad04e2de..b1fb64321118 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_boolean_map.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_boolean_map.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -160,7 +156,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_enum.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_enum.py index d34bccbc5965..3de705cdcc90 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_enum.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_enum.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_enum_with_default_value.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_enum_with_default_value.py index f02facca01a0..1598bc68430e 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_enum_with_default_value.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_enum_with_default_value.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/tag.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/tag.py index aa50402b7f94..cdf9c9d26335 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/tag.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/tag.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -166,7 +162,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/triangle.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/triangle.py index 52c3218db1e3..b08f0d1025fc 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/triangle.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/triangle.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) try: @@ -220,7 +216,7 @@ def __init__(self, triangle_type, *args, **kwargs): # noqa: E501 for var_name, var_value in required_args.items(): setattr(self, var_name, var_value) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name in unused_args and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/triangle_interface.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/triangle_interface.py index 56d960a13382..5b3ff330c779 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/triangle_interface.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/triangle_interface.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -166,7 +162,7 @@ def __init__(self, triangle_type, *args, **kwargs): # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) self.triangle_type = triangle_type - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/user.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/user.py index 836e7f9c0b51..6813e0eb0953 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/user.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/user.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -196,7 +192,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/whale.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/whale.py index eb066c53be50..586c6efa0251 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/whale.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/whale.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -172,7 +168,7 @@ def __init__(self, class_name, *args, **kwargs): # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) self.class_name = class_name - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/zebra.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/zebra.py index e4c2b8d422bd..c90032e7671d 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/zebra.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/zebra.py @@ -10,11 +10,9 @@ """ -from __future__ import absolute_import import re # noqa: F401 import sys # noqa: F401 -import six # noqa: F401 import nulltype # noqa: F401 from petstore_api.model_utils import ( # noqa: F401 @@ -28,9 +26,7 @@ date, datetime, file_type, - int, none_type, - str, validate_get_composed_info, ) @@ -174,7 +170,7 @@ def __init__(self, class_name, *args, **kwargs): # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) self.class_name = class_name - for var_name, var_value in six.iteritems(kwargs): + for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model_utils.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model_utils.py index f15303a09483..ff378aa1e157 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model_utils.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model_utils.py @@ -12,13 +12,13 @@ from datetime import date, datetime # noqa: F401 import inspect +import io import os import pprint import re import tempfile from dateutil.parser import parse -import six from petstore_api.exceptions import ( ApiKeyError, @@ -28,20 +28,7 @@ ) none_type = type(None) -if six.PY3: - import io - file_type = io.IOBase - # these are needed for when other modules import str and int from here - str = str - int = int -else: - file_type = file # noqa: F821 - str_py2 = str - unicode_py2 = unicode # noqa: F821 - long_py2 = long # noqa: F821 - int_py2 = int - # this requires that the future library is installed - from builtins import int, str +file_type = io.IOBase class cached_property(object): @@ -344,13 +331,7 @@ def __eq__(self, other): types.add(this_val.__class__) types.add(that_val.__class__) vals_equal = this_val == that_val - if not six.PY3 and len(types) == 2 and unicode in types: # noqa: F821 - vals_equal = ( - this_val.encode('utf-8') == that_val.encode('utf-8') - ) - if not vals_equal: - return False - return True + return vals_equal class ModelNormal(OpenApiModel): @@ -398,17 +379,12 @@ def __eq__(self, other): if not set(self._data_store.keys()) == set(other._data_store.keys()): return False - for _var_name, this_val in six.iteritems(self._data_store): + for _var_name, this_val in self._data_store.items(): that_val = other._data_store[_var_name] types = set() types.add(this_val.__class__) types.add(that_val.__class__) vals_equal = this_val == that_val - if (not six.PY3 and - len(types) == 2 and unicode in types): # noqa: F821 - vals_equal = ( - this_val.encode('utf-8') == that_val.encode('utf-8') - ) if not vals_equal: return False return True @@ -527,17 +503,12 @@ def __eq__(self, other): if not set(self._data_store.keys()) == set(other._data_store.keys()): return False - for _var_name, this_val in six.iteritems(self._data_store): + for _var_name, this_val in self._data_store.items(): that_val = other._data_store[_var_name] types = set() types.add(this_val.__class__) types.add(that_val.__class__) vals_equal = this_val == that_val - if (not six.PY3 and - len(types) == 2 and unicode in types): # noqa: F821 - vals_equal = ( - this_val.encode('utf-8') == that_val.encode('utf-8') - ) if not vals_equal: return False return True @@ -647,8 +618,6 @@ def get_simple_class(input_value): # isinstance(True, int) == True return bool elif isinstance(input_value, int): - # for python2 input_value==long_instance -> return int - # where int is the python3 int backport return int elif isinstance(input_value, datetime): # this must be higher than the date check because @@ -656,8 +625,7 @@ def get_simple_class(input_value): return datetime elif isinstance(input_value, date): return date - elif (six.PY2 and isinstance(input_value, (str_py2, unicode_py2, str)) or - isinstance(input_value, str)): + elif isinstance(input_value, str): return str return type(input_value) @@ -1102,12 +1070,12 @@ def deserialize_primitive(data, klass, path_to_item): return converted_value except (OverflowError, ValueError) as ex: # parse can raise OverflowError - six.raise_from(ApiValueError( + raise ApiValueError( "{0}Failed to parse {1} as {2}".format( - additional_message, repr(data), get_py3_class_name(klass) + additional_message, repr(data), klass.__name__ ), path_to_item=path_to_item - ), ex) + ) from ex def get_discriminator_class(model_class, @@ -1231,8 +1199,8 @@ def deserialize_file(response_data, configuration, content_disposition=None): path = os.path.join(os.path.dirname(path), filename) with open(path, "wb") as f: - if six.PY3 and isinstance(response_data, str): - # in python3 change str to bytes so we can write it + if isinstance(response_data, str): + # change str to bytes so we can write it response_data = response_data.encode('utf-8') f.write(response_data) @@ -1451,7 +1419,7 @@ def validate_and_convert_types(input_value, required_types_mixed, path_to_item, if input_value == {}: # allow an empty dict return input_value - for inner_key, inner_val in six.iteritems(input_value): + for inner_key, inner_val in input_value.items(): inner_path = list(path_to_item) inner_path.append(inner_key) if get_simple_class(inner_key) != str: @@ -1485,7 +1453,7 @@ def model_to_dict(model_instance, serialize=True): if model_instance._composed_schemas: model_instances.extend(model_instance._composed_instances) for model_instance in model_instances: - for attr, value in six.iteritems(model_instance._data_store): + for attr, value in model_instance._data_store.items(): if serialize: # we use get here because additional property key names do not # exist in attribute_map @@ -1542,13 +1510,8 @@ def type_error_message(var_value=None, var_name=None, valid_classes=None, def get_valid_classes_phrase(input_classes): """Returns a string phrase describing what types are allowed - Note: Adds the extra valid classes in python2 """ all_classes = list(input_classes) - if six.PY2 and str in input_classes: - all_classes.extend([str_py2, unicode_py2]) - if six.PY2 and int in input_classes: - all_classes.extend([int_py2, long_py2]) 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: @@ -1556,15 +1519,6 @@ def get_valid_classes_phrase(input_classes): return "is one of [{0}]".format(", ".join(all_class_names)) -def get_py3_class_name(input_class): - if six.PY2: - if input_class == str: - return 'str' - elif input_class == int: - return 'int' - return input_class.__name__ - - def convert_js_args_to_python_args(fn): from functools import wraps @wraps(fn) @@ -1607,7 +1561,7 @@ def get_allof_instances(self, model_args, constant_args): allof_instance = allof_class(**kwargs) composed_instances.append(allof_instance) except Exception as ex: - six.raise_from(ApiValueError( + raise ApiValueError( "Invalid inputs given to generate an instance of '%s'. The " "input data was invalid for the allOf schema '%s' in the composed " "schema '%s'. Error=%s" % ( @@ -1616,7 +1570,7 @@ def get_allof_instances(self, model_args, constant_args): self.__class__.__name__, str(ex) ) - ), ex) + ) from ex return composed_instances diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/rest.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/rest.py index 973161ca7aef..fb424024afce 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/rest.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/rest.py @@ -10,18 +10,14 @@ """ -from __future__ import absolute_import - import io import json import logging import re import ssl +from urllib.parse import urlencode import certifi -# python 2 and python 3 compatibility library -import six -from six.moves.urllib.parse import urlencode import urllib3 from petstore_api.exceptions import ApiException, ApiValueError @@ -141,7 +137,7 @@ def request(self, method, url, query_params=None, headers=None, timeout = None if _request_timeout: - if isinstance(_request_timeout, (int, ) if six.PY3 else (int, long)): # noqa: E501,F821 + if isinstance(_request_timeout, int): # noqa: E501,F821 timeout = urllib3.Timeout(total=_request_timeout) elif (isinstance(_request_timeout, tuple) and len(_request_timeout) == 2): diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/signing.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/signing.py index 0c361e5ed4d9..85fd1506a76f 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/signing.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/signing.py @@ -8,7 +8,6 @@ Generated by: https://openapi-generator.tech """ -from __future__ import absolute_import from base64 import b64encode from Crypto.IO import PEM, PKCS8 @@ -19,8 +18,8 @@ import json import os import re -from six.moves.urllib.parse import urlencode, urlparse 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. diff --git a/samples/openapi3/client/petstore/python-experimental/pom.xml b/samples/openapi3/client/petstore/python-experimental/pom.xml index 2016c019a958..c2364c744828 100644 --- a/samples/openapi3/client/petstore/python-experimental/pom.xml +++ b/samples/openapi3/client/petstore/python-experimental/pom.xml @@ -35,7 +35,7 @@ make - test-all + test diff --git a/samples/openapi3/client/petstore/python-experimental/requirements.txt b/samples/openapi3/client/petstore/python-experimental/requirements.txt index a56bedffbf57..2c2f00fcb27b 100644 --- a/samples/openapi3/client/petstore/python-experimental/requirements.txt +++ b/samples/openapi3/client/petstore/python-experimental/requirements.txt @@ -1,7 +1,5 @@ nulltype certifi >= 14.05.14 -future; python_version<="2.7" -six >= 1.10 python_dateutil >= 2.5.3 setuptools >= 21.0.0 urllib3 >= 1.15.1 diff --git a/samples/openapi3/client/petstore/python-experimental/setup.py b/samples/openapi3/client/petstore/python-experimental/setup.py index 261bc12d34ba..2aa2823003dd 100644 --- a/samples/openapi3/client/petstore/python-experimental/setup.py +++ b/samples/openapi3/client/petstore/python-experimental/setup.py @@ -23,14 +23,12 @@ REQUIRES = [ "urllib3 >= 1.15", - "six >= 1.10", "certifi", "python-dateutil", "nulltype", "pem>=19.3.0", "pycryptodome>=3.9.0", ] -EXTRAS = {':python_version <= "2.7"': ['future']} setup( name=NAME, @@ -40,8 +38,8 @@ author_email="team@openapitools.org", url="", keywords=["OpenAPI", "OpenAPI-Generator", "OpenAPI Petstore"], + python_requires=">=3.3", install_requires=REQUIRES, - extras_require=EXTRAS, packages=find_packages(exclude=["test", "tests"]), include_package_data=True, license="Apache-2.0", diff --git a/samples/openapi3/client/petstore/python-experimental/test-requirements.txt b/samples/openapi3/client/petstore/python-experimental/test-requirements.txt index bf6f7a19972c..36d9b4fa7a8c 100644 --- a/samples/openapi3/client/petstore/python-experimental/test-requirements.txt +++ b/samples/openapi3/client/petstore/python-experimental/test-requirements.txt @@ -1,5 +1,4 @@ -pytest~=4.6.7 # needed for python 2.7+3.4 +pytest~=4.6.7 # needed for python 3.4 pytest-cov>=2.8.1 -pytest-randomly==1.2.3 # needed for python 2.7+3.4 +pytest-randomly==1.2.3 # needed for python 3.4 pycryptodome>=3.9.0 -mock; python_version<="2.7" \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_additional_properties_class.py b/samples/openapi3/client/petstore/python-experimental/test/test_additional_properties_class.py index befc14455da2..42fdf1948736 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_additional_properties_class.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_additional_properties_class.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_additional_properties_with_array_of_enums.py b/samples/openapi3/client/petstore/python-experimental/test/test_additional_properties_with_array_of_enums.py index 549774072109..f3a248e0da0c 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_additional_properties_with_array_of_enums.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_additional_properties_with_array_of_enums.py @@ -10,11 +10,15 @@ """ -from __future__ import absolute_import import sys import unittest import petstore_api +try: + from petstore_api.model import enum_class +except ImportError: + enum_class = sys.modules[ + 'petstore_api.model.enum_class'] from petstore_api.model.additional_properties_with_array_of_enums import AdditionalPropertiesWithArrayOfEnums diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_address.py b/samples/openapi3/client/petstore/python-experimental/test/test_address.py index dcc33c22dbb3..7afbdc4cd495 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_address.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_address.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_animal.py b/samples/openapi3/client/petstore/python-experimental/test/test_animal.py index 958f303f13e3..0e1f8507373c 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_animal.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_animal.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_animal_farm.py b/samples/openapi3/client/petstore/python-experimental/test/test_animal_farm.py index 7117d42b430e..f473c465d731 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_animal_farm.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_animal_farm.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_another_fake_api.py b/samples/openapi3/client/petstore/python-experimental/test/test_another_fake_api.py index f79966a26961..c58dfa6202bc 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_another_fake_api.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_another_fake_api.py @@ -10,8 +10,6 @@ """ -from __future__ import absolute_import - import unittest import petstore_api diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_api_response.py b/samples/openapi3/client/petstore/python-experimental/test/test_api_response.py index 9db92633f626..a9a900c29cfa 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_api_response.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_api_response.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_apple.py b/samples/openapi3/client/petstore/python-experimental/test/test_apple.py index 9aedfc0b01d5..d26e07541671 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_apple.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_apple.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_apple_req.py b/samples/openapi3/client/petstore/python-experimental/test/test_apple_req.py index 79650cd1c747..e4cc66efc2f7 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_apple_req.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_apple_req.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_array_of_array_of_number_only.py b/samples/openapi3/client/petstore/python-experimental/test/test_array_of_array_of_number_only.py index 4980ad17afb5..39f8874a4e81 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_array_of_array_of_number_only.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_array_of_array_of_number_only.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_array_of_enums.py b/samples/openapi3/client/petstore/python-experimental/test/test_array_of_enums.py index 8f0fbf184483..6d28903bf7ee 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_array_of_enums.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_array_of_enums.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_array_of_number_only.py b/samples/openapi3/client/petstore/python-experimental/test/test_array_of_number_only.py index 479c537cada7..c4abfd068614 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_array_of_number_only.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_array_of_number_only.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_array_test.py b/samples/openapi3/client/petstore/python-experimental/test/test_array_test.py index 2426b27b7e46..f966f4c0d854 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_array_test.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_array_test.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_banana.py b/samples/openapi3/client/petstore/python-experimental/test/test_banana.py index a989386b018c..69b7704bc214 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_banana.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_banana.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_banana_req.py b/samples/openapi3/client/petstore/python-experimental/test/test_banana_req.py index 39d125e4a15e..2f1d5a8ae3ad 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_banana_req.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_banana_req.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_basque_pig.py b/samples/openapi3/client/petstore/python-experimental/test/test_basque_pig.py index b00c5f8a6aa5..897a69bb81dd 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_basque_pig.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_basque_pig.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_capitalization.py b/samples/openapi3/client/petstore/python-experimental/test/test_capitalization.py index 20d2649c01eb..5f47ddb4db09 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_capitalization.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_capitalization.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_cat.py b/samples/openapi3/client/petstore/python-experimental/test/test_cat.py index 1cb6b58cbd09..8990ae4457f4 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_cat.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_cat.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_cat_all_of.py b/samples/openapi3/client/petstore/python-experimental/test/test_cat_all_of.py index a5bb91ac864e..3d5a33d9907b 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_cat_all_of.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_cat_all_of.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_category.py b/samples/openapi3/client/petstore/python-experimental/test/test_category.py index 59b64e5924a8..29490e0dbdb1 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_category.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_category.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_child_cat.py b/samples/openapi3/client/petstore/python-experimental/test/test_child_cat.py index 34c085515a80..ba3c16543d8e 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_child_cat.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_child_cat.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_child_cat_all_of.py b/samples/openapi3/client/petstore/python-experimental/test/test_child_cat_all_of.py index 2a7aab100fbf..2a0b6b8c220c 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_child_cat_all_of.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_child_cat_all_of.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_class_model.py b/samples/openapi3/client/petstore/python-experimental/test/test_class_model.py index 060df39e4b5e..6dc2a6928321 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_class_model.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_class_model.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_client.py b/samples/openapi3/client/petstore/python-experimental/test/test_client.py index ab5e3a80d377..caf85a24aa27 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_client.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_client.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_complex_quadrilateral.py b/samples/openapi3/client/petstore/python-experimental/test/test_complex_quadrilateral.py index 0c0887509c8b..8fb2a290d8a9 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_complex_quadrilateral.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_complex_quadrilateral.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_composed_one_of_number_with_validations.py b/samples/openapi3/client/petstore/python-experimental/test/test_composed_one_of_number_with_validations.py index 28df8eae3ebb..dde99076977c 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_composed_one_of_number_with_validations.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_composed_one_of_number_with_validations.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_danish_pig.py b/samples/openapi3/client/petstore/python-experimental/test/test_danish_pig.py index a82c352e84c1..dadbf7f6617c 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_danish_pig.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_danish_pig.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_default_api.py b/samples/openapi3/client/petstore/python-experimental/test/test_default_api.py index 5f4fb5230ac4..caf174d6d4ba 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_default_api.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_default_api.py @@ -10,8 +10,6 @@ """ -from __future__ import absolute_import - import unittest import petstore_api diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_dog.py b/samples/openapi3/client/petstore/python-experimental/test/test_dog.py index 4a6fc61ad761..32633cce7cb8 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_dog.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_dog.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_dog_all_of.py b/samples/openapi3/client/petstore/python-experimental/test/test_dog_all_of.py index 7ab4e8ae79d8..9f5075b7ed71 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_dog_all_of.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_dog_all_of.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_drawing.py b/samples/openapi3/client/petstore/python-experimental/test/test_drawing.py index c70267b13754..327e01fb849f 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_drawing.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_drawing.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest @@ -114,11 +113,11 @@ def test_deserialize_oneof_reference(self): # Validate we cannot assign the None value to main_shape because the 'null' type # is not one of the allowed types in the 'Shape' schema. - err_msg = ("Invalid type for variable '{}'. " - "Required value type is {} and passed type was {} at {}") - with self.assertRaisesRegexp( + err_msg = (r"Invalid type for variable '{}'. " + r"Required value type is {} and passed type was {} at {}") + with self.assertRaisesRegex( petstore_api.ApiTypeError, - err_msg.format("main_shape", "one of \[ComplexQuadrilateral, EquilateralTriangle, IsoscelesTriangle, ScaleneTriangle, SimpleQuadrilateral\]", "NoneType", "\['main_shape'\]") + err_msg.format(r"main_shape", r"one of \[ComplexQuadrilateral, EquilateralTriangle, IsoscelesTriangle, ScaleneTriangle, SimpleQuadrilateral\]", r"NoneType", r"\['main_shape'\]") ): inst = Drawing( # 'main_shape' has type 'Shape', which is a oneOf [triangle, quadrilateral] diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_enum_arrays.py b/samples/openapi3/client/petstore/python-experimental/test/test_enum_arrays.py index 143a23fe0d45..9458d918a604 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_enum_arrays.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_enum_arrays.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_enum_class.py b/samples/openapi3/client/petstore/python-experimental/test/test_enum_class.py index f910231c9d02..ed19c7985d4e 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_enum_class.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_enum_class.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_enum_test.py b/samples/openapi3/client/petstore/python-experimental/test/test_enum_test.py index d442443504e0..88190693a3bc 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_enum_test.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_enum_test.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_equilateral_triangle.py b/samples/openapi3/client/petstore/python-experimental/test/test_equilateral_triangle.py index 8f286edfdcba..f611501c4435 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_equilateral_triangle.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_equilateral_triangle.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_fake_api.py b/samples/openapi3/client/petstore/python-experimental/test/test_fake_api.py index 4b165e8c8684..8b89752b364a 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_fake_api.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_fake_api.py @@ -9,17 +9,10 @@ Generated by: https://openapi-generator.tech """ -from __future__ import absolute_import - from collections import namedtuple import unittest import json - -import six -if six.PY3: - from unittest.mock import patch -else: - from mock import patch +from unittest.mock import patch import petstore_api from petstore_api.api.fake_api import FakeApi # noqa: E501 @@ -214,7 +207,6 @@ def test_string(self): """Test case for string """ - from petstore_api.model_utils import str endpoint = self.api.string assert endpoint.openapi_types['body'] == (str,) assert endpoint.settings['response_type'] == (str,) diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_fake_classname_tags_123_api.py b/samples/openapi3/client/petstore/python-experimental/test/test_fake_classname_tags_123_api.py index c12e35eb5dea..b7724aaed7d1 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_fake_classname_tags_123_api.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_fake_classname_tags_123_api.py @@ -10,8 +10,6 @@ """ -from __future__ import absolute_import - import unittest import petstore_api diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_file.py b/samples/openapi3/client/petstore/python-experimental/test/test_file.py index 8d60f64e01cc..438482f39525 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_file.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_file.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_file_schema_test_class.py b/samples/openapi3/client/petstore/python-experimental/test/test_file_schema_test_class.py index 9a4f6d38dfef..ec38c523c7df 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_file_schema_test_class.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_file_schema_test_class.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_foo.py b/samples/openapi3/client/petstore/python-experimental/test/test_foo.py index 8125de84ada3..648a84c66f7c 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_foo.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_foo.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_format_test.py b/samples/openapi3/client/petstore/python-experimental/test/test_format_test.py index 07f4f5e4c1f7..a5441cec1c97 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_format_test.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_format_test.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_fruit.py b/samples/openapi3/client/petstore/python-experimental/test/test_fruit.py index 1eb9d09d5061..fac0319663e6 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_fruit.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_fruit.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_fruit_req.py b/samples/openapi3/client/petstore/python-experimental/test/test_fruit_req.py index c161570df03c..3e637c3226a0 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_fruit_req.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_fruit_req.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_gm_fruit.py b/samples/openapi3/client/petstore/python-experimental/test/test_gm_fruit.py index 9d13e90659d0..85d0fcf9b1c7 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_gm_fruit.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_gm_fruit.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_grandparent_animal.py b/samples/openapi3/client/petstore/python-experimental/test/test_grandparent_animal.py index 286ef176575b..517ccf3114c4 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_grandparent_animal.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_grandparent_animal.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_has_only_read_only.py b/samples/openapi3/client/petstore/python-experimental/test/test_has_only_read_only.py index 9ebd7683b398..c9bf4c28658a 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_has_only_read_only.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_has_only_read_only.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_health_check_result.py b/samples/openapi3/client/petstore/python-experimental/test/test_health_check_result.py index 11ff5f5cf636..35f4d3afa989 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_health_check_result.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_health_check_result.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_inline_object.py b/samples/openapi3/client/petstore/python-experimental/test/test_inline_object.py index 3b3eee80807c..3e391022d516 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_inline_object.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_inline_object.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_inline_object1.py b/samples/openapi3/client/petstore/python-experimental/test/test_inline_object1.py index 77d4b46553dd..982e20e0c6f4 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_inline_object1.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_inline_object1.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_inline_object2.py b/samples/openapi3/client/petstore/python-experimental/test/test_inline_object2.py index b2310f152179..133e31acb200 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_inline_object2.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_inline_object2.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_inline_object3.py b/samples/openapi3/client/petstore/python-experimental/test/test_inline_object3.py index afe7ca434286..69bf17c56c2d 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_inline_object3.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_inline_object3.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_inline_object4.py b/samples/openapi3/client/petstore/python-experimental/test/test_inline_object4.py index 1b9bea4716dc..727596be5e5d 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_inline_object4.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_inline_object4.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_inline_object5.py b/samples/openapi3/client/petstore/python-experimental/test/test_inline_object5.py index ac72c53c1e3c..1ef579b8e307 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_inline_object5.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_inline_object5.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_inline_response_default.py b/samples/openapi3/client/petstore/python-experimental/test/test_inline_response_default.py index b52167aea166..74ab5c2be31b 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_inline_response_default.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_inline_response_default.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_integer_enum.py b/samples/openapi3/client/petstore/python-experimental/test/test_integer_enum.py index 25667e2a8d09..34a2dada3914 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_integer_enum.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_integer_enum.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_integer_enum_one_value.py b/samples/openapi3/client/petstore/python-experimental/test/test_integer_enum_one_value.py index 7ad6dc5f08f5..eff7298d9f3d 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_integer_enum_one_value.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_integer_enum_one_value.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_integer_enum_with_default_value.py b/samples/openapi3/client/petstore/python-experimental/test/test_integer_enum_with_default_value.py index 0a83cb2f3f74..e75255319547 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_integer_enum_with_default_value.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_integer_enum_with_default_value.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_isosceles_triangle.py b/samples/openapi3/client/petstore/python-experimental/test/test_isosceles_triangle.py index d89ae6ab78dd..e4fe2ccbd7ed 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_isosceles_triangle.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_isosceles_triangle.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_list.py b/samples/openapi3/client/petstore/python-experimental/test/test_list.py index 52156adfed2e..77611c300dc8 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_list.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_list.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_mammal.py b/samples/openapi3/client/petstore/python-experimental/test/test_mammal.py index 2a8893d02fb3..3ed00dd79817 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_mammal.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_mammal.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_map_test.py b/samples/openapi3/client/petstore/python-experimental/test/test_map_test.py index 88b28ff93dac..f588781f13fa 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_map_test.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_map_test.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_mixed_properties_and_additional_properties_class.py b/samples/openapi3/client/petstore/python-experimental/test/test_mixed_properties_and_additional_properties_class.py index 4dcb5ad4268c..7de400b004fc 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_mixed_properties_and_additional_properties_class.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_mixed_properties_and_additional_properties_class.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_model200_response.py b/samples/openapi3/client/petstore/python-experimental/test/test_model200_response.py index 4012eaae3362..8ff474d5dde3 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_model200_response.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_model200_response.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_model_return.py b/samples/openapi3/client/petstore/python-experimental/test/test_model_return.py index 54c98b33cd66..f856d3d76206 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_model_return.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_model_return.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_name.py b/samples/openapi3/client/petstore/python-experimental/test/test_name.py index 6a9be99d1a57..b3841ca0304f 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_name.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_name.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_nullable_class.py b/samples/openapi3/client/petstore/python-experimental/test/test_nullable_class.py index f73dc3d98bbb..730e9264ef9d 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_nullable_class.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_nullable_class.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_nullable_shape.py b/samples/openapi3/client/petstore/python-experimental/test/test_nullable_shape.py index d6bf001743bf..32721b00888d 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_nullable_shape.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_nullable_shape.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_number_only.py b/samples/openapi3/client/petstore/python-experimental/test/test_number_only.py index 07aab1d78af7..b7205f5fe029 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_number_only.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_number_only.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_number_with_validations.py b/samples/openapi3/client/petstore/python-experimental/test/test_number_with_validations.py index b48904c59c70..f4264ca82ea3 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_number_with_validations.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_number_with_validations.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_object_model_with_ref_props.py b/samples/openapi3/client/petstore/python-experimental/test/test_object_model_with_ref_props.py index e0a8b842685b..cdf42fcd6620 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_object_model_with_ref_props.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_object_model_with_ref_props.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest @@ -34,7 +33,7 @@ def tearDown(self): def testObjectModelWithRefProps(self): """Test ObjectModelWithRefProps""" - from petstore_api.model.object_model_with_ref_props import str, number_with_validations + from petstore_api.model.object_model_with_ref_props import number_with_validations self.assertEqual( ObjectModelWithRefProps.openapi_types, { diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_order.py b/samples/openapi3/client/petstore/python-experimental/test/test_order.py index 604c67042c34..fd420b846a74 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_order.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_order.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_parent_pet.py b/samples/openapi3/client/petstore/python-experimental/test/test_parent_pet.py index 15262872e195..a57f9b8527ae 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_parent_pet.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_parent_pet.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_pet.py b/samples/openapi3/client/petstore/python-experimental/test/test_pet.py index fb8586e4090c..6d03ce5bb33d 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_pet.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_pet.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_pet_api.py b/samples/openapi3/client/petstore/python-experimental/test/test_pet_api.py index 3f2d3a8847ca..d545f497297a 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_pet_api.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_pet_api.py @@ -10,8 +10,6 @@ """ -from __future__ import absolute_import - import unittest import petstore_api diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_pig.py b/samples/openapi3/client/petstore/python-experimental/test/test_pig.py index f98bed3f1910..bb3a6bdfa865 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_pig.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_pig.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_quadrilateral.py b/samples/openapi3/client/petstore/python-experimental/test/test_quadrilateral.py index 149b9a0070b6..63f74ae541fb 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_quadrilateral.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_quadrilateral.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_quadrilateral_interface.py b/samples/openapi3/client/petstore/python-experimental/test/test_quadrilateral_interface.py index 0b2e32dc37af..2dee368036f9 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_quadrilateral_interface.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_quadrilateral_interface.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_read_only_first.py b/samples/openapi3/client/petstore/python-experimental/test/test_read_only_first.py index c2dcde240e77..a07676e9c2de 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_read_only_first.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_read_only_first.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_scalene_triangle.py b/samples/openapi3/client/petstore/python-experimental/test/test_scalene_triangle.py index f5f1ccb3efa0..d6fb13eb6c93 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_scalene_triangle.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_scalene_triangle.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_shape.py b/samples/openapi3/client/petstore/python-experimental/test/test_shape.py index 4424679aeccb..d4240f695300 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_shape.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_shape.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest @@ -78,7 +77,7 @@ def testShape(self): err_msg = ("Cannot deserialize input data due to missing discriminator. " "The discriminator property '{}' is missing at path: ()" ) - with self.assertRaisesRegexp( + with self.assertRaisesRegex( petstore_api.ApiValueError, err_msg.format("shapeType") ): @@ -89,14 +88,14 @@ def testShape(self): "value. The OpenAPI document has no mapping for discriminator " "property '{}'='{}' at path: ()" ) - with self.assertRaisesRegexp( + with self.assertRaisesRegex( petstore_api.ApiValueError, err_msg.format("shapeType", "Circle") ): Shape(shape_type="Circle") # invalid quadrilateral_type (second discriminator) - with self.assertRaisesRegexp( + with self.assertRaisesRegex( petstore_api.ApiValueError, err_msg.format("quadrilateralType", "Triangle") ): diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_shape_interface.py b/samples/openapi3/client/petstore/python-experimental/test/test_shape_interface.py index c8b0270f9fc5..9108ad867303 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_shape_interface.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_shape_interface.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_shape_or_null.py b/samples/openapi3/client/petstore/python-experimental/test/test_shape_or_null.py index e3bfa41e7e84..7dc0988173b5 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_shape_or_null.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_shape_or_null.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_simple_quadrilateral.py b/samples/openapi3/client/petstore/python-experimental/test/test_simple_quadrilateral.py index b08ddf1c6781..4b5e8bbedfca 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_simple_quadrilateral.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_simple_quadrilateral.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_special_model_name.py b/samples/openapi3/client/petstore/python-experimental/test/test_special_model_name.py index 6124525f5170..4c525d99be5b 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_special_model_name.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_special_model_name.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_store_api.py b/samples/openapi3/client/petstore/python-experimental/test/test_store_api.py index 0d9cc3dd36ea..3680a34b42a0 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_store_api.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_store_api.py @@ -10,8 +10,6 @@ """ -from __future__ import absolute_import - import unittest import petstore_api diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_string_boolean_map.py b/samples/openapi3/client/petstore/python-experimental/test/test_string_boolean_map.py index e2e9d8b420b8..e4e795cca2a9 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_string_boolean_map.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_string_boolean_map.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_string_enum.py b/samples/openapi3/client/petstore/python-experimental/test/test_string_enum.py index 3a2c316a0797..a9f7431e24ee 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_string_enum.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_string_enum.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_string_enum_with_default_value.py b/samples/openapi3/client/petstore/python-experimental/test/test_string_enum_with_default_value.py index fbf963edfa33..2a83ea5ba97d 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_string_enum_with_default_value.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_string_enum_with_default_value.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_tag.py b/samples/openapi3/client/petstore/python-experimental/test/test_tag.py index b0a09d94a785..0ce1c0a87f1d 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_tag.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_tag.py @@ -10,8 +10,7 @@ """ -from __future__ import absolute_import - +import sys import unittest import petstore_api diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_triangle.py b/samples/openapi3/client/petstore/python-experimental/test/test_triangle.py index 65ae20743e14..7268022cad52 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_triangle.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_triangle.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_triangle_interface.py b/samples/openapi3/client/petstore/python-experimental/test/test_triangle_interface.py index e087651a7d55..6e88d29b7ca9 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_triangle_interface.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_triangle_interface.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_user.py b/samples/openapi3/client/petstore/python-experimental/test/test_user.py index 7241bb589c52..df3d2fff6532 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_user.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_user.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_user_api.py b/samples/openapi3/client/petstore/python-experimental/test/test_user_api.py index df306da07761..abf57b0733da 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_user_api.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_user_api.py @@ -10,8 +10,6 @@ """ -from __future__ import absolute_import - import unittest import petstore_api diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_whale.py b/samples/openapi3/client/petstore/python-experimental/test/test_whale.py index 3ad793af3e43..d057053203cc 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_whale.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_whale.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_zebra.py b/samples/openapi3/client/petstore/python-experimental/test/test_zebra.py index fe3245cced48..affb41e5cb45 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_zebra.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_zebra.py @@ -10,7 +10,6 @@ """ -from __future__ import absolute_import import sys import unittest diff --git a/samples/openapi3/client/petstore/python-experimental/test_python2_and_3.sh b/samples/openapi3/client/petstore/python-experimental/test_python.sh similarity index 100% rename from samples/openapi3/client/petstore/python-experimental/test_python2_and_3.sh rename to samples/openapi3/client/petstore/python-experimental/test_python.sh diff --git a/samples/openapi3/client/petstore/python-experimental/test_python2.sh b/samples/openapi3/client/petstore/python-experimental/test_python2.sh deleted file mode 100755 index 75b9d6798d9e..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/test_python2.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/bash - -REQUIREMENTS_FILE=dev-requirements.txt -REQUIREMENTS_OUT=dev-requirements.txt.log -SETUP_OUT=*.egg-info -VENV=venv -DEACTIVE=false - -export LC_ALL=en_US.UTF-8 -export LANG=en_US.UTF-8 -PYTHONPATH="$(which python)" - -### set virtualenv -if [ -z "$VIRTUAL_ENV" ]; then - virtualenv $VENV --python=$PYTHONPATH --no-site-packages --always-copy - source $VENV/bin/activate - DEACTIVE=true -fi - -### install dependencies -pip install -r $REQUIREMENTS_FILE | tee -a $REQUIREMENTS_OUT - -### run tests -tox -e py27 || 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/petstore/python-experimental/tests/test_deserialization.py b/samples/openapi3/client/petstore/python-experimental/tests/test_deserialization.py index ec30635b0794..37e0943273ad 100644 --- a/samples/openapi3/client/petstore/python-experimental/tests/test_deserialization.py +++ b/samples/openapi3/client/petstore/python-experimental/tests/test_deserialization.py @@ -78,7 +78,7 @@ def test_deserialize_shape(self): "value. The OpenAPI document has no mapping for discriminator " "property '{}'='{}' at path: ()" ) - with self.assertRaisesRegexp( + with self.assertRaisesRegex( petstore_api.ApiValueError, err_msg.format("quadrilateralType", "Triangle") ): @@ -125,7 +125,7 @@ def test_regex_constraint(self): # Test with invalid regex pattern. err_msg = ("Invalid value for `{}`, must match regular expression `{}`$") - with self.assertRaisesRegexp( + with self.assertRaisesRegex( petstore_api.ApiValueError, err_msg.format("cultivar", "[^`]*") ): @@ -134,7 +134,7 @@ def test_regex_constraint(self): ) err_msg = ("Invalid value for `{}`, must match regular expression `{}` with flags") - with self.assertRaisesRegexp( + with self.assertRaisesRegex( petstore_api.ApiValueError, err_msg.format("origin", "[^`]*") ): @@ -262,7 +262,7 @@ def test_deserialize_with_additional_properties(self): # The 'bananaReq' schema disallows additional properties by explicitly setting # additionalProperties: false err_msg = ("{} has no attribute '{}' at ") - with self.assertRaisesRegexp( + with self.assertRaisesRegex( petstore_api.exceptions.ApiAttributeError, err_msg.format("BananaReq", "unknown-group") ): diff --git a/samples/openapi3/client/petstore/python-experimental/tests/test_discard_unknown_properties.py b/samples/openapi3/client/petstore/python-experimental/tests/test_discard_unknown_properties.py index 976a3da2df4f..d8b71e44353e 100644 --- a/samples/openapi3/client/petstore/python-experimental/tests/test_discard_unknown_properties.py +++ b/samples/openapi3/client/petstore/python-experimental/tests/test_discard_unknown_properties.py @@ -21,9 +21,7 @@ from petstore_api.model_utils import ( file_type, - int, model_to_dict, - str, ) MockResponse = namedtuple('MockResponse', 'data') diff --git a/samples/openapi3/client/petstore/python-experimental/tests/test_http_signature.py b/samples/openapi3/client/petstore/python-experimental/tests/test_http_signature.py index 2e3227f70d4f..c6854d666c74 100644 --- a/samples/openapi3/client/petstore/python-experimental/tests/test_http_signature.py +++ b/samples/openapi3/client/petstore/python-experimental/tests/test_http_signature.py @@ -19,10 +19,11 @@ import re import shutil import unittest +from urllib.parse import urlencode, urlparse + from Crypto.Hash import SHA256, SHA512 from Crypto.PublicKey import ECC, RSA from Crypto.Signature import pkcs1_15, pss, DSS -from six.moves.urllib.parse import urlencode, urlparse import petstore_api from petstore_api.model import category, tag, pet @@ -33,8 +34,6 @@ RESTResponse ) -import six - from petstore_api.exceptions import ( ApiException, ApiValueError, @@ -45,10 +44,7 @@ import urllib3 -if six.PY3: - from unittest.mock import patch -else: - from mock import patch +from unittest.mock import patch HOST = 'http://localhost/v2' diff --git a/samples/openapi3/client/petstore/python-experimental/tox.ini b/samples/openapi3/client/petstore/python-experimental/tox.ini index 169d895329bf..8989fc3c4d96 100644 --- a/samples/openapi3/client/petstore/python-experimental/tox.ini +++ b/samples/openapi3/client/petstore/python-experimental/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py27, py3 +envlist = py3 [testenv] deps=-r{toxinidir}/requirements.txt From 1cfa8141a8b3a75e4622d796e09958a1b55c7d0b Mon Sep 17 00:00:00 2001 From: William Cheng Date: Mon, 20 Jul 2020 15:48:28 +0800 Subject: [PATCH 038/129] fix config path in pull request template --- .github/PULL_REQUEST_TEMPLATE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index da5bfa6ade41..27b62461d93d 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -5,6 +5,6 @@ - [ ] Read the [contribution guidelines](https://github.com/openapitools/openapi-generator/blob/master/CONTRIBUTING.md). - [ ] If contributing template-only or documentation-only changes which will change sample output, [build the project](https://github.com/OpenAPITools/openapi-generator#14---build-projects) beforehand. -- [ ] Run the shell script `./bin/generate-samples.sh`to update all Petstore samples related to your fix. This is important, as CI jobs will verify _all_ generator outputs of your HEAD commit as it would merge with master. These must match the expectations made by your contribution. You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example `./bin/generate-samples.sh bin/config/java*`. For Windows users, please run the script in [Git BASH](https://gitforwindows.org/). +- [ ] Run the shell script `./bin/generate-samples.sh`to update all Petstore samples related to your fix. This is important, as CI jobs will verify _all_ generator outputs of your HEAD commit as it would merge with master. These must match the expectations made by your contribution. You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example `./bin/generate-samples.sh bin/configs/java*`. For Windows users, please run the script in [Git BASH](https://gitforwindows.org/). - [ ] File the PR against the [correct branch](https://github.com/OpenAPITools/openapi-generator/wiki/Git-Branches): `master` - [ ] Copy the [technical committee](https://github.com/openapitools/openapi-generator/#62---openapi-generator-technical-committee) to review the pull request if your PR is targeting a particular programming language. From 383b1e9db8dbfa539a4e87532ae261bbd0b1867c Mon Sep 17 00:00:00 2001 From: Kim T Date: Mon, 20 Jul 2020 03:57:50 -0700 Subject: [PATCH 039/129] [NodeJS] nodejs-express-server fix /api-docs path (#6977) --- .../main/resources/nodejs-express-server/expressServer.mustache | 2 +- samples/server/petstore/nodejs-express-server/expressServer.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/nodejs-express-server/expressServer.mustache b/modules/openapi-generator/src/main/resources/nodejs-express-server/expressServer.mustache index 72c49fc50cb2..948a912415ae 100644 --- a/modules/openapi-generator/src/main/resources/nodejs-express-server/expressServer.mustache +++ b/modules/openapi-generator/src/main/resources/nodejs-express-server/expressServer.mustache @@ -37,7 +37,7 @@ class ExpressServer { //Send the openapi document *AS GENERATED BY THE GENERATOR* this.app.get('/openapi', (req, res) => res.sendFile((path.join(__dirname, 'api', 'openapi.yaml')))); //View the openapi document in a visual interface. Should be able to test from this page - this.app.use('/api-doc', swaggerUI.serve, swaggerUI.setup(this.schema)); + this.app.use('/api-docs', swaggerUI.serve, swaggerUI.setup(this.schema)); this.app.get('/login-redirect', (req, res) => { res.status(200); res.json(req.query); diff --git a/samples/server/petstore/nodejs-express-server/expressServer.js b/samples/server/petstore/nodejs-express-server/expressServer.js index 72c49fc50cb2..948a912415ae 100644 --- a/samples/server/petstore/nodejs-express-server/expressServer.js +++ b/samples/server/petstore/nodejs-express-server/expressServer.js @@ -37,7 +37,7 @@ class ExpressServer { //Send the openapi document *AS GENERATED BY THE GENERATOR* this.app.get('/openapi', (req, res) => res.sendFile((path.join(__dirname, 'api', 'openapi.yaml')))); //View the openapi document in a visual interface. Should be able to test from this page - this.app.use('/api-doc', swaggerUI.serve, swaggerUI.setup(this.schema)); + this.app.use('/api-docs', swaggerUI.serve, swaggerUI.setup(this.schema)); this.app.get('/login-redirect', (req, res) => { res.status(200); res.json(req.query); From 95bd845f7942ead8180bb3c273d0039a02c6607b Mon Sep 17 00:00:00 2001 From: daiscog Date: Mon, 20 Jul 2020 15:12:42 +0100 Subject: [PATCH 040/129] Typescript-angular generator: Mark deprecated operations with @deprecated JSDoc tag (#6973) --- .../main/resources/typescript-angular/api.service.mustache | 3 +++ .../main/resources/typescript-angular/apiInterface.mustache | 4 +++- .../builds/default/api/pet.service.ts | 1 + .../builds/with-npm/api/pet.service.ts | 1 + .../builds/default/api/pet.service.ts | 1 + .../builds/with-npm/api/pet.service.ts | 1 + .../builds/default/api/pet.service.ts | 1 + .../builds/with-npm/api/pet.service.ts | 1 + .../builds/default/api/pet.service.ts | 1 + .../builds/with-npm/api/pet.service.ts | 1 + .../builds/single-request-parameter/api/pet.service.ts | 1 + .../builds/with-npm/api/pet.service.ts | 1 + .../builds/with-prefixed-module-name/api/pet.service.ts | 1 + 13 files changed, 17 insertions(+), 1 deletion(-) diff --git a/modules/openapi-generator/src/main/resources/typescript-angular/api.service.mustache b/modules/openapi-generator/src/main/resources/typescript-angular/api.service.mustache index 33087c984bf8..6483f9d4f21d 100644 --- a/modules/openapi-generator/src/main/resources/typescript-angular/api.service.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-angular/api.service.mustache @@ -153,6 +153,9 @@ export class {{classname}} { {{/useSingleRequestParameter}} * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. + {{#isDeprecated}} + * @deprecated + {{/isDeprecated}} */ public {{nickname}}({{^useSingleRequestParameter}}{{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}{{/useSingleRequestParameter}}{{#useSingleRequestParameter}}{{#allParams.0}}requestParameters: {{#prefixParameterInterfaces}}{{classname}}{{/prefixParameterInterfaces}}{{operationIdCamelCase}}RequestParams, {{/allParams.0}}{{/useSingleRequestParameter}}observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: {{#produces}}'{{mediaType}}'{{#hasMore}} | {{/hasMore}}{{/produces}}{{^produces}}undefined{{/produces}}}): Observable<{{#returnType}}{{{returnType}}}{{#isResponseTypeFile}}|undefined{{/isResponseTypeFile}}{{/returnType}}{{^returnType}}any{{/returnType}}>; public {{nickname}}({{^useSingleRequestParameter}}{{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}{{/useSingleRequestParameter}}{{#useSingleRequestParameter}}{{#allParams.0}}requestParameters: {{#prefixParameterInterfaces}}{{classname}}{{/prefixParameterInterfaces}}{{operationIdCamelCase}}RequestParams, {{/allParams.0}}{{/useSingleRequestParameter}}observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: {{#produces}}'{{mediaType}}'{{#hasMore}} | {{/hasMore}}{{/produces}}{{^produces}}undefined{{/produces}}}): Observable>; diff --git a/modules/openapi-generator/src/main/resources/typescript-angular/apiInterface.mustache b/modules/openapi-generator/src/main/resources/typescript-angular/apiInterface.mustache index a9641b957850..d981d629a667 100644 --- a/modules/openapi-generator/src/main/resources/typescript-angular/apiInterface.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-angular/apiInterface.mustache @@ -41,7 +41,9 @@ export interface {{classname}}Interface { {{^useSingleRequestParameter}} {{#allParams}}* @param {{paramName}} {{description}} {{/allParams}}{{/useSingleRequestParameter}}{{#useSingleRequestParameter}}{{#allParams.0}}* @param requestParameters - {{/allParams.0}}{{/useSingleRequestParameter}}*/ + {{/allParams.0}}{{/useSingleRequestParameter}}{{#isDeprecated}} + * @deprecated + {{/isDeprecated}}*/ {{nickname}}({{^useSingleRequestParameter}}{{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}{{/useSingleRequestParameter}}{{#useSingleRequestParameter}}{{#allParams.0}}requestParameters: {{#prefixParameterInterfaces}}{{classname}}{{/prefixParameterInterfaces}}{{operationIdCamelCase}}RequestParams, {{/allParams.0}}{{/useSingleRequestParameter}}extraHttpRequestParams?: any): Observable<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}{}{{/returnType}}>; {{/operation}} diff --git a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/pet.service.ts b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/pet.service.ts index aa892db90861..9f889d3ab1c5 100644 --- a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/pet.service.ts @@ -283,6 +283,7 @@ export class PetService { * @param tags Tags to filter by * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. + * @deprecated */ public findPetsByTags(tags: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; public findPetsByTags(tags: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>>; diff --git a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/pet.service.ts index aa892db90861..9f889d3ab1c5 100644 --- a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/pet.service.ts @@ -283,6 +283,7 @@ export class PetService { * @param tags Tags to filter by * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. + * @deprecated */ public findPetsByTags(tags: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; public findPetsByTags(tags: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>>; diff --git a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/pet.service.ts b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/pet.service.ts index a12f7678638c..902dd1e814b5 100644 --- a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/pet.service.ts @@ -285,6 +285,7 @@ export class PetService { * @param tags Tags to filter by * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. + * @deprecated */ public findPetsByTags(tags: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; public findPetsByTags(tags: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>>; diff --git a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/pet.service.ts index a12f7678638c..902dd1e814b5 100644 --- a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/pet.service.ts @@ -285,6 +285,7 @@ export class PetService { * @param tags Tags to filter by * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. + * @deprecated */ public findPetsByTags(tags: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; public findPetsByTags(tags: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>>; diff --git a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/pet.service.ts b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/pet.service.ts index aa892db90861..9f889d3ab1c5 100644 --- a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/pet.service.ts @@ -283,6 +283,7 @@ export class PetService { * @param tags Tags to filter by * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. + * @deprecated */ public findPetsByTags(tags: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; public findPetsByTags(tags: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>>; diff --git a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/pet.service.ts index aa892db90861..9f889d3ab1c5 100644 --- a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/pet.service.ts @@ -283,6 +283,7 @@ export class PetService { * @param tags Tags to filter by * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. + * @deprecated */ public findPetsByTags(tags: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; public findPetsByTags(tags: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>>; diff --git a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/pet.service.ts b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/pet.service.ts index a12f7678638c..902dd1e814b5 100644 --- a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/pet.service.ts @@ -285,6 +285,7 @@ export class PetService { * @param tags Tags to filter by * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. + * @deprecated */ public findPetsByTags(tags: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; public findPetsByTags(tags: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>>; diff --git a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/pet.service.ts index a12f7678638c..902dd1e814b5 100644 --- a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/pet.service.ts @@ -285,6 +285,7 @@ export class PetService { * @param tags Tags to filter by * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. + * @deprecated */ public findPetsByTags(tags: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; public findPetsByTags(tags: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>>; diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/api/pet.service.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/api/pet.service.ts index afce140323ea..4ef2907062a4 100644 --- a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/api/pet.service.ts @@ -337,6 +337,7 @@ export class PetService { * @param requestParameters * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. + * @deprecated */ public findPetsByTags(requestParameters: FindPetsByTagsRequestParams, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; public findPetsByTags(requestParameters: FindPetsByTagsRequestParams, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>>; diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api/pet.service.ts index a12f7678638c..902dd1e814b5 100644 --- a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api/pet.service.ts @@ -285,6 +285,7 @@ export class PetService { * @param tags Tags to filter by * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. + * @deprecated */ public findPetsByTags(tags: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; public findPetsByTags(tags: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>>; diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/api/pet.service.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/api/pet.service.ts index a12f7678638c..902dd1e814b5 100644 --- a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/api/pet.service.ts @@ -285,6 +285,7 @@ export class PetService { * @param tags Tags to filter by * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. + * @deprecated */ public findPetsByTags(tags: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; public findPetsByTags(tags: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>>; From 0a394bc88338e3eeb0e47183eda81f1c6b3a2d45 Mon Sep 17 00:00:00 2001 From: Moshe Elisha Date: Mon, 20 Jul 2020 17:54:14 +0300 Subject: [PATCH 041/129] [Java][RestTemplate] Use abstraction for files (#6912) * Fix dir path in PR request template * Add "useAbstractionForFiles" config option for Java/RestTemplate to allow flexible options in generated client when a file is needed (#6715) * Add "useAbstractionForFiles" config option for Java/RestTemplate to allow flexible options in generated client when a file is needed (#6715) * Add "useAbstractionForFiles" config option for Java/RestTemplate to allow flexible options in generated client when a file is needed (#6715) * #6715 - Add "useAbstractionForFiles" config option for Java/RestTemplate to allow flexible options in generated client when a file is needed. --- docs/generators/java.md | 1 + .../codegen/languages/JavaClientCodegen.java | 11 +++++ .../Java/libraries/resttemplate/api.mustache | 6 +-- .../libraries/resttemplate/api_test.mustache | 2 +- .../org/openapitools/codegen/TestUtils.java | 2 +- .../codegen/java/JavaClientCodegenTest.java | 46 +++++++++++++++++++ 6 files changed, 63 insertions(+), 5 deletions(-) diff --git a/docs/generators/java.md b/docs/generators/java.md index 651f4160754b..fdbe518090d1 100644 --- a/docs/generators/java.md +++ b/docs/generators/java.md @@ -52,6 +52,7 @@ sidebar_label: java |sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| |sourceFolder|source folder for generated code| |src/main/java| |supportJava6|Whether to support Java6 with the Jersey1 library. This option has been deprecated and will be removed in the 5.x release| |false| +|useAbstractionForFiles|Use alternative types instead of java.io.File to allow passing bytes without a file on disk. Available on resttemplate library| |false| |useBeanValidation|Use BeanValidation API annotations| |false| |useGzipFeature|Send gzip-encoded requests| |false| |usePlayWS|Use Play! Async HTTP client (Play WS API)| |false| diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java index fa8185672845..797bec2c8783 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java @@ -60,6 +60,7 @@ public class JavaClientCodegen extends AbstractJavaCodegen public static final String USE_RUNTIME_EXCEPTION = "useRuntimeException"; public static final String USE_REFLECTION_EQUALS_HASHCODE = "useReflectionEqualsHashCode"; public static final String CASE_INSENSITIVE_RESPONSE_HEADERS = "caseInsensitiveResponseHeaders"; + public static final String USE_ABSTRACTION_FOR_FILES = "useAbstractionForFiles"; public static final String PLAY_24 = "play24"; public static final String PLAY_25 = "play25"; @@ -99,6 +100,7 @@ public class JavaClientCodegen extends AbstractJavaCodegen protected boolean useRuntimeException = false; protected boolean useReflectionEqualsHashCode = false; protected boolean caseInsensitiveResponseHeaders = false; + protected boolean useAbstractionForFiles = false; protected String authFolder; protected String serializationLibrary = null; @@ -140,6 +142,7 @@ public JavaClientCodegen() { cliOptions.add(CliOption.newBoolean(ASYNC_NATIVE, "If true, async handlers will be used, instead of the sync version")); cliOptions.add(CliOption.newBoolean(USE_REFLECTION_EQUALS_HASHCODE, "Use org.apache.commons.lang3.builder for equals and hashCode in the models. WARNING: This will fail under a security manager, unless the appropriate permissions are set up correctly and also there's potential performance impact.")); cliOptions.add(CliOption.newBoolean(CASE_INSENSITIVE_RESPONSE_HEADERS, "Make API response's headers case-insensitive. Available on " + OKHTTP_GSON + ", " + JERSEY2 + " libraries")); + cliOptions.add(CliOption.newBoolean(USE_ABSTRACTION_FOR_FILES, "Use alternative types instead of java.io.File to allow passing bytes without a file on disk. Available on " + RESTTEMPLATE + " library")); supportedLibraries.put(JERSEY1, "HTTP client: Jersey client 1.19.x. JSON processing: Jackson 2.9.x. Enable Java6 support using '-DsupportJava6=true'. Enable gzip request encoding using '-DuseGzipFeature=true'. IMPORTANT NOTE: jersey 1.x is no longer actively maintained so please upgrade to 'jersey2' or other HTTP libaries instead."); supportedLibraries.put(JERSEY2, "HTTP client: Jersey client 2.25.1. JSON processing: Jackson 2.9.x"); @@ -285,6 +288,10 @@ public void processOpts() { this.setUseReflectionEqualsHashCode(convertPropertyToBooleanAndWriteBack(CASE_INSENSITIVE_RESPONSE_HEADERS)); } + if (additionalProperties.containsKey(USE_ABSTRACTION_FOR_FILES)) { + this.setUseAbstractionForFiles(convertPropertyToBooleanAndWriteBack(USE_ABSTRACTION_FOR_FILES)); + } + final String invokerFolder = (sourceFolder + '/' + invokerPackage).replace(".", "/"); final String apiFolder = (sourceFolder + '/' + apiPackage).replace(".", "/"); authFolder = (sourceFolder + '/' + invokerPackage + ".auth").replace(".", "/"); @@ -864,6 +871,10 @@ public void setCaseInsensitiveResponseHeaders(final Boolean caseInsensitiveRespo this.caseInsensitiveResponseHeaders = caseInsensitiveResponseHeaders; } + public void setUseAbstractionForFiles(boolean useAbstractionForFiles) { + this.useAbstractionForFiles = useAbstractionForFiles; + } + /** * Serialization library. * diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/api.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/api.mustache index 2f1ed68e9963..9c7a4fc703ca 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/api.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/api.mustache @@ -73,7 +73,7 @@ public class {{classname}} { {{#isDeprecated}} @Deprecated {{/isDeprecated}} - public {{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) throws RestClientException { + public {{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#allParams}}{{#isFile}}{{#useAbstractionForFiles}}{{#collectionFormat}}java.util.Collection{{/collectionFormat}}{{^collectionFormat}}org.springframework.core.io.AbstractResource{{/collectionFormat}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{dataType}}}{{/useAbstractionForFiles}}{{/isFile}}{{^isFile}}{{{dataType}}}{{/isFile}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) throws RestClientException { {{#returnType}} return {{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}).getBody(); {{/returnType}} @@ -101,7 +101,7 @@ public class {{classname}} { {{#isDeprecated}} @Deprecated {{/isDeprecated}} - public ResponseEntity<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) throws RestClientException { + public ResponseEntity<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{#isFile}}{{#useAbstractionForFiles}}{{#collectionFormat}}java.util.Collection{{/collectionFormat}}{{^collectionFormat}}org.springframework.core.io.AbstractResource{{/collectionFormat}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{dataType}}}{{/useAbstractionForFiles}}{{/isFile}}{{^isFile}}{{{dataType}}}{{/isFile}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) throws RestClientException { Object postBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}}; {{#allParams}}{{#required}} // verify the required parameter '{{paramName}}' is set @@ -131,7 +131,7 @@ public class {{classname}} { {{/hasMore}}{{/cookieParams}}{{/hasCookieParams}}{{#hasFormParams}} {{#formParams}}if ({{paramName}} != null) - formParams.{{^collectionFormat}}add{{/collectionFormat}}{{#collectionFormat}}put{{/collectionFormat}}("{{baseName}}", {{#isFile}}{{^collectionFormat}}new FileSystemResource({{paramName}}){{/collectionFormat}}{{/isFile}}{{#isFile}}{{#collectionFormat}}{{paramName}}.stream().map(FileSystemResource::new).collect(Collectors.toList()){{/collectionFormat}}{{/isFile}}{{^isFile}}{{paramName}}{{/isFile}});{{#hasMore}} + formParams.{{^collectionFormat}}add{{/collectionFormat}}{{#collectionFormat}}put{{/collectionFormat}}("{{baseName}}", {{#isFile}}{{^collectionFormat}}{{#useAbstractionForFiles}}{{paramName}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}new FileSystemResource({{paramName}}){{/useAbstractionForFiles}}{{/collectionFormat}}{{/isFile}}{{#isFile}}{{#collectionFormat}}{{paramName}}.stream(){{^useAbstractionForFiles}}.map(FileSystemResource::new){{/useAbstractionForFiles}}.collect(Collectors.toList()){{/collectionFormat}}{{/isFile}}{{^isFile}}{{paramName}}{{/isFile}});{{#hasMore}} {{/hasMore}}{{/formParams}}{{/hasFormParams}} final String[] accepts = { {{#hasProduces}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/api_test.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/api_test.mustache index 127ac2defc5c..f69cf40ec3e1 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/api_test.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/api_test.mustache @@ -34,7 +34,7 @@ public class {{classname}}Test { @Test public void {{operationId}}Test() { {{#allParams}} - {{{dataType}}} {{paramName}} = null; + {{#isFile}}{{#useAbstractionForFiles}}{{#collectionFormat}}java.util.Collection{{/collectionFormat}}{{^collectionFormat}}org.springframework.core.io.AbstractResource{{/collectionFormat}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{dataType}}}{{/useAbstractionForFiles}}{{/isFile}}{{^isFile}}{{{dataType}}}{{/isFile}} {{paramName}} = null; {{/allParams}} {{#returnType}}{{{returnType}}} response = {{/returnType}}api.{{operationId}}({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}); diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/TestUtils.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/TestUtils.java index d554a8ee7d96..96d01ab2aad9 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/TestUtils.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/TestUtils.java @@ -166,7 +166,7 @@ public static void assertFileContains(Path path, String... lines) { String file = linearize(generatedFile); assertNotNull(file); for (String line : lines) - assertTrue(file.contains(linearize(line))); + assertTrue(file.contains(linearize(line)), "File does not contain line [" + line + "]"); } catch (IOException e) { fail("Unable to evaluate file " + path.toString()); } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaClientCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaClientCodegenTest.java index 69ead62d1418..8c2d17792f5a 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaClientCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaClientCodegenTest.java @@ -927,4 +927,50 @@ public void testWebClientFormMultipart() throws IOException { ); } + /** + * See https://github.com/OpenAPITools/openapi-generator/issues/6715 + */ + @Test + public void testRestTemplateWithUseAbstractionForFiles() throws IOException { + + Map properties = new HashMap<>(); + properties.put(JavaClientCodegen.JAVA8_MODE, true); + 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); + + + 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.put(\"files\", files.stream().collect(Collectors.toList()));", + + //mixed + "multipartMixed(org.springframework.core.io.AbstractResource file, MultipartMixedMarker marker)", + "multipartMixedWithHttpInfo(org.springframework.core.io.AbstractResource file, MultipartMixedMarker marker)", + "formParams.add(\"file\", file);", + + //single file + "multipartSingle(org.springframework.core.io.AbstractResource file)", + "multipartSingleWithHttpInfo(org.springframework.core.io.AbstractResource file)", + "formParams.add(\"file\", file);" + ); + } } From 3305ac962a97bfc6d0dd137a6110fd531b20cd32 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Tue, 21 Jul 2020 13:09:49 +0800 Subject: [PATCH 042/129] add nokia as the user (#7005) --- README.md | 1 + website/src/dynamic/users.yml | 5 +++++ website/static/img/companies/nokia.png | Bin 0 -> 1031 bytes 3 files changed, 6 insertions(+) create mode 100644 website/static/img/companies/nokia.png diff --git a/README.md b/README.md index eced71a4d832..585e59267d14 100644 --- a/README.md +++ b/README.md @@ -615,6 +615,7 @@ Here are some companies/projects (alphabetical order) using OpenAPI Generator in - [MoonVision](https://www.moonvision.io/) - [Myworkout](https://myworkout.com) - [NamSor](https://www.namsor.com/) +- [Nokia](https://www.nokia.com/) - [Openet](https://www.openet.com/) - [openVALIDATION](https://openvalidation.io/) - [Oracle](https://www.oracle.com/) diff --git a/website/src/dynamic/users.yml b/website/src/dynamic/users.yml index c9750fe2a6c1..d7fbcd0bd4b8 100644 --- a/website/src/dynamic/users.yml +++ b/website/src/dynamic/users.yml @@ -268,6 +268,11 @@ image: "img/companies/namsor.png" infoLink: "https://www.namsor.com/?utm_source=openapi_generator&utm_medium=official_website&utm_campaign=sponsor" pinned: false +- + caption: Nokia + image: "img/companies/nokia.png" + infoLink: "https://www.nokia.com/" + pinned: false - caption: Openet image: "img/companies/openet.jpg" diff --git a/website/static/img/companies/nokia.png b/website/static/img/companies/nokia.png new file mode 100644 index 0000000000000000000000000000000000000000..66e3b862f99aa5423bc8ad93159fd43555ee7ac1 GIT binary patch literal 1031 zcmeAS@N?(olHy`uVBq!ia0y~yU}OTab2ylRVDge`%|xl96bK+ujAf*dABTGtBX%hfA!sZ?yJ+^KRmVWdwVF7_rmJ`o0RUTb-AMbYp+ZEy}N6%Ys|U_>e13%cm8mm3t)&W@ocH)>PdVjuk&P2(?Zkb znOYf-SX8TB*Bm%}ew9)0+6A}w?XI<}adm9}l)7kHQ_=dx9*onNd$-ThV4Y+-hsFO| zZ(v&Y?2ozO2lLz)GU>2q?dH__&}=eo&y1~hO*fP7exCOxlQn>E%Xb&y5QWaqlG&HP zC24(Xw2z255VwHgRAZu#DI;r;sOhV#b2i#JvD*1{s*5^UUih6N9I(OlQIN2gPs$yM zs{+a`2Opf*KHyaDV=l;Q)cAD1#!SWJ+9kTlg4gGUUr2NeP@R3^(>C6ZbN{C}{hcnd zVv5Dwa0bq^H*PAiZZgalUDe_knxgb)eW}6oS52~vk5_#xo9ugVTinXlBVOBj4MQG$ z+?KRwft~}qqZf~;N2*bYv~}PV&qk~3+yCuhy8AH0G*a}(m)0vz%X$ri7SwO!7Rg|r zdNCzbAV&B|$}Woz(G?=wLcLc!Nc{3R!SbQ!#v`*<_Z^QDakiI=S-zd(T0|aN12m~K6rI) z$O^18R^v>ZkeKYF$r1dhs_1t8oGo!$Y9blU=a*=3ooeo8 Date: Tue, 21 Jul 2020 14:01:52 +0800 Subject: [PATCH 043/129] add ~/.sbt to circleci cache (#7000) --- circle.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/circle.yml b/circle.yml index 78ebec264186..b1df25a1d1ea 100644 --- a/circle.yml +++ b/circle.yml @@ -78,6 +78,7 @@ jobs: - ~/virtualenvs - ~/.m2 - ~/.ivy2 + - ~/.sbt - ~/.bundle - ~/.go_workspace - ~/.gradle From 2ab35e0386f20cab4efc8d3914fa6ef4f4b14b27 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Tue, 21 Jul 2020 14:21:10 +0800 Subject: [PATCH 044/129] add JsonTypeName (#6995) --- modules/openapi-generator/src/main/resources/Java/pojo.mustache | 1 + .../openapitools/client/model/AdditionalPropertiesAnyType.java | 1 + .../org/openapitools/client/model/AdditionalPropertiesArray.java | 1 + .../openapitools/client/model/AdditionalPropertiesBoolean.java | 1 + .../org/openapitools/client/model/AdditionalPropertiesClass.java | 1 + .../openapitools/client/model/AdditionalPropertiesInteger.java | 1 + .../openapitools/client/model/AdditionalPropertiesNumber.java | 1 + .../openapitools/client/model/AdditionalPropertiesObject.java | 1 + .../openapitools/client/model/AdditionalPropertiesString.java | 1 + .../src/main/java/org/openapitools/client/model/Animal.java | 1 + .../org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java | 1 + .../java/org/openapitools/client/model/ArrayOfNumberOnly.java | 1 + .../src/main/java/org/openapitools/client/model/ArrayTest.java | 1 + .../src/main/java/org/openapitools/client/model/BigCat.java | 1 + .../src/main/java/org/openapitools/client/model/BigCatAllOf.java | 1 + .../main/java/org/openapitools/client/model/Capitalization.java | 1 + .../feign/src/main/java/org/openapitools/client/model/Cat.java | 1 + .../src/main/java/org/openapitools/client/model/CatAllOf.java | 1 + .../src/main/java/org/openapitools/client/model/Category.java | 1 + .../src/main/java/org/openapitools/client/model/ClassModel.java | 1 + .../src/main/java/org/openapitools/client/model/Client.java | 1 + .../feign/src/main/java/org/openapitools/client/model/Dog.java | 1 + .../src/main/java/org/openapitools/client/model/DogAllOf.java | 1 + .../src/main/java/org/openapitools/client/model/EnumArrays.java | 1 + .../src/main/java/org/openapitools/client/model/EnumTest.java | 1 + .../java/org/openapitools/client/model/FileSchemaTestClass.java | 1 + .../src/main/java/org/openapitools/client/model/FormatTest.java | 1 + .../main/java/org/openapitools/client/model/HasOnlyReadOnly.java | 1 + .../src/main/java/org/openapitools/client/model/MapTest.java | 1 + .../model/MixedPropertiesAndAdditionalPropertiesClass.java | 1 + .../java/org/openapitools/client/model/Model200Response.java | 1 + .../java/org/openapitools/client/model/ModelApiResponse.java | 1 + .../src/main/java/org/openapitools/client/model/ModelReturn.java | 1 + .../feign/src/main/java/org/openapitools/client/model/Name.java | 1 + .../src/main/java/org/openapitools/client/model/NumberOnly.java | 1 + .../feign/src/main/java/org/openapitools/client/model/Order.java | 1 + .../main/java/org/openapitools/client/model/OuterComposite.java | 1 + .../feign/src/main/java/org/openapitools/client/model/Pet.java | 1 + .../main/java/org/openapitools/client/model/ReadOnlyFirst.java | 1 + .../java/org/openapitools/client/model/SpecialModelName.java | 1 + .../feign/src/main/java/org/openapitools/client/model/Tag.java | 1 + .../java/org/openapitools/client/model/TypeHolderDefault.java | 1 + .../java/org/openapitools/client/model/TypeHolderExample.java | 1 + .../feign/src/main/java/org/openapitools/client/model/User.java | 1 + .../src/main/java/org/openapitools/client/model/XmlItem.java | 1 + .../openapitools/client/model/AdditionalPropertiesAnyType.java | 1 + .../org/openapitools/client/model/AdditionalPropertiesArray.java | 1 + .../openapitools/client/model/AdditionalPropertiesBoolean.java | 1 + .../org/openapitools/client/model/AdditionalPropertiesClass.java | 1 + .../openapitools/client/model/AdditionalPropertiesInteger.java | 1 + .../openapitools/client/model/AdditionalPropertiesNumber.java | 1 + .../openapitools/client/model/AdditionalPropertiesObject.java | 1 + .../openapitools/client/model/AdditionalPropertiesString.java | 1 + .../src/main/java/org/openapitools/client/model/Animal.java | 1 + .../org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java | 1 + .../java/org/openapitools/client/model/ArrayOfNumberOnly.java | 1 + .../src/main/java/org/openapitools/client/model/ArrayTest.java | 1 + .../src/main/java/org/openapitools/client/model/BigCat.java | 1 + .../src/main/java/org/openapitools/client/model/BigCatAllOf.java | 1 + .../main/java/org/openapitools/client/model/Capitalization.java | 1 + .../src/main/java/org/openapitools/client/model/Cat.java | 1 + .../src/main/java/org/openapitools/client/model/CatAllOf.java | 1 + .../src/main/java/org/openapitools/client/model/Category.java | 1 + .../src/main/java/org/openapitools/client/model/ClassModel.java | 1 + .../src/main/java/org/openapitools/client/model/Client.java | 1 + .../src/main/java/org/openapitools/client/model/Dog.java | 1 + .../src/main/java/org/openapitools/client/model/DogAllOf.java | 1 + .../src/main/java/org/openapitools/client/model/EnumArrays.java | 1 + .../src/main/java/org/openapitools/client/model/EnumTest.java | 1 + .../java/org/openapitools/client/model/FileSchemaTestClass.java | 1 + .../src/main/java/org/openapitools/client/model/FormatTest.java | 1 + .../main/java/org/openapitools/client/model/HasOnlyReadOnly.java | 1 + .../src/main/java/org/openapitools/client/model/MapTest.java | 1 + .../model/MixedPropertiesAndAdditionalPropertiesClass.java | 1 + .../java/org/openapitools/client/model/Model200Response.java | 1 + .../java/org/openapitools/client/model/ModelApiResponse.java | 1 + .../src/main/java/org/openapitools/client/model/ModelReturn.java | 1 + .../src/main/java/org/openapitools/client/model/Name.java | 1 + .../src/main/java/org/openapitools/client/model/NumberOnly.java | 1 + .../src/main/java/org/openapitools/client/model/Order.java | 1 + .../main/java/org/openapitools/client/model/OuterComposite.java | 1 + .../src/main/java/org/openapitools/client/model/Pet.java | 1 + .../main/java/org/openapitools/client/model/ReadOnlyFirst.java | 1 + .../java/org/openapitools/client/model/SpecialModelName.java | 1 + .../src/main/java/org/openapitools/client/model/Tag.java | 1 + .../java/org/openapitools/client/model/TypeHolderDefault.java | 1 + .../java/org/openapitools/client/model/TypeHolderExample.java | 1 + .../src/main/java/org/openapitools/client/model/User.java | 1 + .../src/main/java/org/openapitools/client/model/XmlItem.java | 1 + .../openapitools/client/model/AdditionalPropertiesAnyType.java | 1 + .../org/openapitools/client/model/AdditionalPropertiesArray.java | 1 + .../openapitools/client/model/AdditionalPropertiesBoolean.java | 1 + .../org/openapitools/client/model/AdditionalPropertiesClass.java | 1 + .../openapitools/client/model/AdditionalPropertiesInteger.java | 1 + .../openapitools/client/model/AdditionalPropertiesNumber.java | 1 + .../openapitools/client/model/AdditionalPropertiesObject.java | 1 + .../openapitools/client/model/AdditionalPropertiesString.java | 1 + .../src/main/java/org/openapitools/client/model/Animal.java | 1 + .../org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java | 1 + .../java/org/openapitools/client/model/ArrayOfNumberOnly.java | 1 + .../src/main/java/org/openapitools/client/model/ArrayTest.java | 1 + .../src/main/java/org/openapitools/client/model/BigCat.java | 1 + .../src/main/java/org/openapitools/client/model/BigCatAllOf.java | 1 + .../main/java/org/openapitools/client/model/Capitalization.java | 1 + .../jersey1/src/main/java/org/openapitools/client/model/Cat.java | 1 + .../src/main/java/org/openapitools/client/model/CatAllOf.java | 1 + .../src/main/java/org/openapitools/client/model/Category.java | 1 + .../src/main/java/org/openapitools/client/model/ClassModel.java | 1 + .../src/main/java/org/openapitools/client/model/Client.java | 1 + .../jersey1/src/main/java/org/openapitools/client/model/Dog.java | 1 + .../src/main/java/org/openapitools/client/model/DogAllOf.java | 1 + .../src/main/java/org/openapitools/client/model/EnumArrays.java | 1 + .../src/main/java/org/openapitools/client/model/EnumTest.java | 1 + .../java/org/openapitools/client/model/FileSchemaTestClass.java | 1 + .../src/main/java/org/openapitools/client/model/FormatTest.java | 1 + .../main/java/org/openapitools/client/model/HasOnlyReadOnly.java | 1 + .../src/main/java/org/openapitools/client/model/MapTest.java | 1 + .../model/MixedPropertiesAndAdditionalPropertiesClass.java | 1 + .../java/org/openapitools/client/model/Model200Response.java | 1 + .../java/org/openapitools/client/model/ModelApiResponse.java | 1 + .../src/main/java/org/openapitools/client/model/ModelReturn.java | 1 + .../src/main/java/org/openapitools/client/model/Name.java | 1 + .../src/main/java/org/openapitools/client/model/NumberOnly.java | 1 + .../src/main/java/org/openapitools/client/model/Order.java | 1 + .../main/java/org/openapitools/client/model/OuterComposite.java | 1 + .../jersey1/src/main/java/org/openapitools/client/model/Pet.java | 1 + .../main/java/org/openapitools/client/model/ReadOnlyFirst.java | 1 + .../java/org/openapitools/client/model/SpecialModelName.java | 1 + .../jersey1/src/main/java/org/openapitools/client/model/Tag.java | 1 + .../java/org/openapitools/client/model/TypeHolderDefault.java | 1 + .../java/org/openapitools/client/model/TypeHolderExample.java | 1 + .../src/main/java/org/openapitools/client/model/User.java | 1 + .../src/main/java/org/openapitools/client/model/XmlItem.java | 1 + .../openapitools/client/model/AdditionalPropertiesAnyType.java | 1 + .../org/openapitools/client/model/AdditionalPropertiesArray.java | 1 + .../openapitools/client/model/AdditionalPropertiesBoolean.java | 1 + .../org/openapitools/client/model/AdditionalPropertiesClass.java | 1 + .../openapitools/client/model/AdditionalPropertiesInteger.java | 1 + .../openapitools/client/model/AdditionalPropertiesNumber.java | 1 + .../openapitools/client/model/AdditionalPropertiesObject.java | 1 + .../openapitools/client/model/AdditionalPropertiesString.java | 1 + .../src/main/java/org/openapitools/client/model/Animal.java | 1 + .../org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java | 1 + .../java/org/openapitools/client/model/ArrayOfNumberOnly.java | 1 + .../src/main/java/org/openapitools/client/model/ArrayTest.java | 1 + .../src/main/java/org/openapitools/client/model/BigCat.java | 1 + .../src/main/java/org/openapitools/client/model/BigCatAllOf.java | 1 + .../main/java/org/openapitools/client/model/Capitalization.java | 1 + .../src/main/java/org/openapitools/client/model/Cat.java | 1 + .../src/main/java/org/openapitools/client/model/CatAllOf.java | 1 + .../src/main/java/org/openapitools/client/model/Category.java | 1 + .../src/main/java/org/openapitools/client/model/ClassModel.java | 1 + .../src/main/java/org/openapitools/client/model/Client.java | 1 + .../src/main/java/org/openapitools/client/model/Dog.java | 1 + .../src/main/java/org/openapitools/client/model/DogAllOf.java | 1 + .../src/main/java/org/openapitools/client/model/EnumArrays.java | 1 + .../src/main/java/org/openapitools/client/model/EnumTest.java | 1 + .../java/org/openapitools/client/model/FileSchemaTestClass.java | 1 + .../src/main/java/org/openapitools/client/model/FormatTest.java | 1 + .../main/java/org/openapitools/client/model/HasOnlyReadOnly.java | 1 + .../src/main/java/org/openapitools/client/model/MapTest.java | 1 + .../model/MixedPropertiesAndAdditionalPropertiesClass.java | 1 + .../java/org/openapitools/client/model/Model200Response.java | 1 + .../java/org/openapitools/client/model/ModelApiResponse.java | 1 + .../src/main/java/org/openapitools/client/model/ModelReturn.java | 1 + .../src/main/java/org/openapitools/client/model/Name.java | 1 + .../src/main/java/org/openapitools/client/model/NumberOnly.java | 1 + .../src/main/java/org/openapitools/client/model/Order.java | 1 + .../main/java/org/openapitools/client/model/OuterComposite.java | 1 + .../src/main/java/org/openapitools/client/model/Pet.java | 1 + .../main/java/org/openapitools/client/model/ReadOnlyFirst.java | 1 + .../java/org/openapitools/client/model/SpecialModelName.java | 1 + .../src/main/java/org/openapitools/client/model/Tag.java | 1 + .../java/org/openapitools/client/model/TypeHolderDefault.java | 1 + .../java/org/openapitools/client/model/TypeHolderExample.java | 1 + .../src/main/java/org/openapitools/client/model/User.java | 1 + .../src/main/java/org/openapitools/client/model/XmlItem.java | 1 + .../openapitools/client/model/AdditionalPropertiesAnyType.java | 1 + .../org/openapitools/client/model/AdditionalPropertiesArray.java | 1 + .../openapitools/client/model/AdditionalPropertiesBoolean.java | 1 + .../org/openapitools/client/model/AdditionalPropertiesClass.java | 1 + .../openapitools/client/model/AdditionalPropertiesInteger.java | 1 + .../openapitools/client/model/AdditionalPropertiesNumber.java | 1 + .../openapitools/client/model/AdditionalPropertiesObject.java | 1 + .../openapitools/client/model/AdditionalPropertiesString.java | 1 + .../src/main/java/org/openapitools/client/model/Animal.java | 1 + .../org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java | 1 + .../java/org/openapitools/client/model/ArrayOfNumberOnly.java | 1 + .../src/main/java/org/openapitools/client/model/ArrayTest.java | 1 + .../src/main/java/org/openapitools/client/model/BigCat.java | 1 + .../src/main/java/org/openapitools/client/model/BigCatAllOf.java | 1 + .../main/java/org/openapitools/client/model/Capitalization.java | 1 + .../native/src/main/java/org/openapitools/client/model/Cat.java | 1 + .../src/main/java/org/openapitools/client/model/CatAllOf.java | 1 + .../src/main/java/org/openapitools/client/model/Category.java | 1 + .../src/main/java/org/openapitools/client/model/ClassModel.java | 1 + .../src/main/java/org/openapitools/client/model/Client.java | 1 + .../native/src/main/java/org/openapitools/client/model/Dog.java | 1 + .../src/main/java/org/openapitools/client/model/DogAllOf.java | 1 + .../src/main/java/org/openapitools/client/model/EnumArrays.java | 1 + .../src/main/java/org/openapitools/client/model/EnumTest.java | 1 + .../java/org/openapitools/client/model/FileSchemaTestClass.java | 1 + .../src/main/java/org/openapitools/client/model/FormatTest.java | 1 + .../main/java/org/openapitools/client/model/HasOnlyReadOnly.java | 1 + .../src/main/java/org/openapitools/client/model/MapTest.java | 1 + .../model/MixedPropertiesAndAdditionalPropertiesClass.java | 1 + .../java/org/openapitools/client/model/Model200Response.java | 1 + .../java/org/openapitools/client/model/ModelApiResponse.java | 1 + .../src/main/java/org/openapitools/client/model/ModelReturn.java | 1 + .../native/src/main/java/org/openapitools/client/model/Name.java | 1 + .../src/main/java/org/openapitools/client/model/NumberOnly.java | 1 + .../src/main/java/org/openapitools/client/model/Order.java | 1 + .../main/java/org/openapitools/client/model/OuterComposite.java | 1 + .../native/src/main/java/org/openapitools/client/model/Pet.java | 1 + .../main/java/org/openapitools/client/model/ReadOnlyFirst.java | 1 + .../java/org/openapitools/client/model/SpecialModelName.java | 1 + .../native/src/main/java/org/openapitools/client/model/Tag.java | 1 + .../java/org/openapitools/client/model/TypeHolderDefault.java | 1 + .../java/org/openapitools/client/model/TypeHolderExample.java | 1 + .../native/src/main/java/org/openapitools/client/model/User.java | 1 + .../src/main/java/org/openapitools/client/model/XmlItem.java | 1 + .../openapitools/client/model/AdditionalPropertiesAnyType.java | 1 + .../org/openapitools/client/model/AdditionalPropertiesArray.java | 1 + .../openapitools/client/model/AdditionalPropertiesBoolean.java | 1 + .../org/openapitools/client/model/AdditionalPropertiesClass.java | 1 + .../openapitools/client/model/AdditionalPropertiesInteger.java | 1 + .../openapitools/client/model/AdditionalPropertiesNumber.java | 1 + .../openapitools/client/model/AdditionalPropertiesObject.java | 1 + .../openapitools/client/model/AdditionalPropertiesString.java | 1 + .../src/main/java/org/openapitools/client/model/Animal.java | 1 + .../org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java | 1 + .../java/org/openapitools/client/model/ArrayOfNumberOnly.java | 1 + .../src/main/java/org/openapitools/client/model/ArrayTest.java | 1 + .../src/main/java/org/openapitools/client/model/BigCat.java | 1 + .../src/main/java/org/openapitools/client/model/BigCatAllOf.java | 1 + .../main/java/org/openapitools/client/model/Capitalization.java | 1 + .../src/main/java/org/openapitools/client/model/Cat.java | 1 + .../src/main/java/org/openapitools/client/model/CatAllOf.java | 1 + .../src/main/java/org/openapitools/client/model/Category.java | 1 + .../src/main/java/org/openapitools/client/model/ClassModel.java | 1 + .../src/main/java/org/openapitools/client/model/Client.java | 1 + .../src/main/java/org/openapitools/client/model/Dog.java | 1 + .../src/main/java/org/openapitools/client/model/DogAllOf.java | 1 + .../src/main/java/org/openapitools/client/model/EnumArrays.java | 1 + .../src/main/java/org/openapitools/client/model/EnumTest.java | 1 + .../java/org/openapitools/client/model/FileSchemaTestClass.java | 1 + .../src/main/java/org/openapitools/client/model/FormatTest.java | 1 + .../main/java/org/openapitools/client/model/HasOnlyReadOnly.java | 1 + .../src/main/java/org/openapitools/client/model/MapTest.java | 1 + .../model/MixedPropertiesAndAdditionalPropertiesClass.java | 1 + .../java/org/openapitools/client/model/Model200Response.java | 1 + .../java/org/openapitools/client/model/ModelApiResponse.java | 1 + .../src/main/java/org/openapitools/client/model/ModelReturn.java | 1 + .../src/main/java/org/openapitools/client/model/Name.java | 1 + .../src/main/java/org/openapitools/client/model/NumberOnly.java | 1 + .../src/main/java/org/openapitools/client/model/Order.java | 1 + .../main/java/org/openapitools/client/model/OuterComposite.java | 1 + .../src/main/java/org/openapitools/client/model/Pet.java | 1 + .../main/java/org/openapitools/client/model/ReadOnlyFirst.java | 1 + .../java/org/openapitools/client/model/SpecialModelName.java | 1 + .../src/main/java/org/openapitools/client/model/Tag.java | 1 + .../java/org/openapitools/client/model/TypeHolderDefault.java | 1 + .../java/org/openapitools/client/model/TypeHolderExample.java | 1 + .../src/main/java/org/openapitools/client/model/User.java | 1 + .../src/main/java/org/openapitools/client/model/XmlItem.java | 1 + .../openapitools/client/model/AdditionalPropertiesAnyType.java | 1 + .../org/openapitools/client/model/AdditionalPropertiesArray.java | 1 + .../openapitools/client/model/AdditionalPropertiesBoolean.java | 1 + .../org/openapitools/client/model/AdditionalPropertiesClass.java | 1 + .../openapitools/client/model/AdditionalPropertiesInteger.java | 1 + .../openapitools/client/model/AdditionalPropertiesNumber.java | 1 + .../openapitools/client/model/AdditionalPropertiesObject.java | 1 + .../openapitools/client/model/AdditionalPropertiesString.java | 1 + .../src/main/java/org/openapitools/client/model/Animal.java | 1 + .../org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java | 1 + .../java/org/openapitools/client/model/ArrayOfNumberOnly.java | 1 + .../src/main/java/org/openapitools/client/model/ArrayTest.java | 1 + .../src/main/java/org/openapitools/client/model/BigCat.java | 1 + .../src/main/java/org/openapitools/client/model/BigCatAllOf.java | 1 + .../main/java/org/openapitools/client/model/Capitalization.java | 1 + .../src/main/java/org/openapitools/client/model/Cat.java | 1 + .../src/main/java/org/openapitools/client/model/CatAllOf.java | 1 + .../src/main/java/org/openapitools/client/model/Category.java | 1 + .../src/main/java/org/openapitools/client/model/ClassModel.java | 1 + .../src/main/java/org/openapitools/client/model/Client.java | 1 + .../src/main/java/org/openapitools/client/model/Dog.java | 1 + .../src/main/java/org/openapitools/client/model/DogAllOf.java | 1 + .../src/main/java/org/openapitools/client/model/EnumArrays.java | 1 + .../src/main/java/org/openapitools/client/model/EnumTest.java | 1 + .../java/org/openapitools/client/model/FileSchemaTestClass.java | 1 + .../src/main/java/org/openapitools/client/model/FormatTest.java | 1 + .../main/java/org/openapitools/client/model/HasOnlyReadOnly.java | 1 + .../src/main/java/org/openapitools/client/model/MapTest.java | 1 + .../model/MixedPropertiesAndAdditionalPropertiesClass.java | 1 + .../java/org/openapitools/client/model/Model200Response.java | 1 + .../java/org/openapitools/client/model/ModelApiResponse.java | 1 + .../src/main/java/org/openapitools/client/model/ModelReturn.java | 1 + .../src/main/java/org/openapitools/client/model/Name.java | 1 + .../src/main/java/org/openapitools/client/model/NumberOnly.java | 1 + .../src/main/java/org/openapitools/client/model/Order.java | 1 + .../main/java/org/openapitools/client/model/OuterComposite.java | 1 + .../src/main/java/org/openapitools/client/model/Pet.java | 1 + .../main/java/org/openapitools/client/model/ReadOnlyFirst.java | 1 + .../java/org/openapitools/client/model/SpecialModelName.java | 1 + .../src/main/java/org/openapitools/client/model/Tag.java | 1 + .../java/org/openapitools/client/model/TypeHolderDefault.java | 1 + .../java/org/openapitools/client/model/TypeHolderExample.java | 1 + .../src/main/java/org/openapitools/client/model/User.java | 1 + .../src/main/java/org/openapitools/client/model/XmlItem.java | 1 + .../openapitools/client/model/AdditionalPropertiesAnyType.java | 1 + .../org/openapitools/client/model/AdditionalPropertiesArray.java | 1 + .../openapitools/client/model/AdditionalPropertiesBoolean.java | 1 + .../org/openapitools/client/model/AdditionalPropertiesClass.java | 1 + .../openapitools/client/model/AdditionalPropertiesInteger.java | 1 + .../openapitools/client/model/AdditionalPropertiesNumber.java | 1 + .../openapitools/client/model/AdditionalPropertiesObject.java | 1 + .../openapitools/client/model/AdditionalPropertiesString.java | 1 + .../src/main/java/org/openapitools/client/model/Animal.java | 1 + .../org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java | 1 + .../java/org/openapitools/client/model/ArrayOfNumberOnly.java | 1 + .../src/main/java/org/openapitools/client/model/ArrayTest.java | 1 + .../src/main/java/org/openapitools/client/model/BigCat.java | 1 + .../src/main/java/org/openapitools/client/model/BigCatAllOf.java | 1 + .../main/java/org/openapitools/client/model/Capitalization.java | 1 + .../src/main/java/org/openapitools/client/model/Cat.java | 1 + .../src/main/java/org/openapitools/client/model/CatAllOf.java | 1 + .../src/main/java/org/openapitools/client/model/Category.java | 1 + .../src/main/java/org/openapitools/client/model/ClassModel.java | 1 + .../src/main/java/org/openapitools/client/model/Client.java | 1 + .../src/main/java/org/openapitools/client/model/Dog.java | 1 + .../src/main/java/org/openapitools/client/model/DogAllOf.java | 1 + .../src/main/java/org/openapitools/client/model/EnumArrays.java | 1 + .../src/main/java/org/openapitools/client/model/EnumTest.java | 1 + .../java/org/openapitools/client/model/FileSchemaTestClass.java | 1 + .../src/main/java/org/openapitools/client/model/FormatTest.java | 1 + .../main/java/org/openapitools/client/model/HasOnlyReadOnly.java | 1 + .../src/main/java/org/openapitools/client/model/MapTest.java | 1 + .../model/MixedPropertiesAndAdditionalPropertiesClass.java | 1 + .../java/org/openapitools/client/model/Model200Response.java | 1 + .../java/org/openapitools/client/model/ModelApiResponse.java | 1 + .../src/main/java/org/openapitools/client/model/ModelReturn.java | 1 + .../src/main/java/org/openapitools/client/model/Name.java | 1 + .../src/main/java/org/openapitools/client/model/NumberOnly.java | 1 + .../src/main/java/org/openapitools/client/model/Order.java | 1 + .../main/java/org/openapitools/client/model/OuterComposite.java | 1 + .../src/main/java/org/openapitools/client/model/Pet.java | 1 + .../main/java/org/openapitools/client/model/ReadOnlyFirst.java | 1 + .../java/org/openapitools/client/model/SpecialModelName.java | 1 + .../src/main/java/org/openapitools/client/model/Tag.java | 1 + .../java/org/openapitools/client/model/TypeHolderDefault.java | 1 + .../java/org/openapitools/client/model/TypeHolderExample.java | 1 + .../src/main/java/org/openapitools/client/model/User.java | 1 + .../src/main/java/org/openapitools/client/model/XmlItem.java | 1 + .../openapitools/client/model/AdditionalPropertiesAnyType.java | 1 + .../org/openapitools/client/model/AdditionalPropertiesArray.java | 1 + .../openapitools/client/model/AdditionalPropertiesBoolean.java | 1 + .../org/openapitools/client/model/AdditionalPropertiesClass.java | 1 + .../openapitools/client/model/AdditionalPropertiesInteger.java | 1 + .../openapitools/client/model/AdditionalPropertiesNumber.java | 1 + .../openapitools/client/model/AdditionalPropertiesObject.java | 1 + .../openapitools/client/model/AdditionalPropertiesString.java | 1 + .../src/main/java/org/openapitools/client/model/Animal.java | 1 + .../org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java | 1 + .../java/org/openapitools/client/model/ArrayOfNumberOnly.java | 1 + .../src/main/java/org/openapitools/client/model/ArrayTest.java | 1 + .../src/main/java/org/openapitools/client/model/BigCat.java | 1 + .../src/main/java/org/openapitools/client/model/BigCatAllOf.java | 1 + .../main/java/org/openapitools/client/model/Capitalization.java | 1 + .../src/main/java/org/openapitools/client/model/Cat.java | 1 + .../src/main/java/org/openapitools/client/model/CatAllOf.java | 1 + .../src/main/java/org/openapitools/client/model/Category.java | 1 + .../src/main/java/org/openapitools/client/model/ClassModel.java | 1 + .../src/main/java/org/openapitools/client/model/Client.java | 1 + .../src/main/java/org/openapitools/client/model/Dog.java | 1 + .../src/main/java/org/openapitools/client/model/DogAllOf.java | 1 + .../src/main/java/org/openapitools/client/model/EnumArrays.java | 1 + .../src/main/java/org/openapitools/client/model/EnumTest.java | 1 + .../java/org/openapitools/client/model/FileSchemaTestClass.java | 1 + .../src/main/java/org/openapitools/client/model/FormatTest.java | 1 + .../main/java/org/openapitools/client/model/HasOnlyReadOnly.java | 1 + .../src/main/java/org/openapitools/client/model/MapTest.java | 1 + .../model/MixedPropertiesAndAdditionalPropertiesClass.java | 1 + .../java/org/openapitools/client/model/Model200Response.java | 1 + .../java/org/openapitools/client/model/ModelApiResponse.java | 1 + .../src/main/java/org/openapitools/client/model/ModelReturn.java | 1 + .../src/main/java/org/openapitools/client/model/Name.java | 1 + .../src/main/java/org/openapitools/client/model/NumberOnly.java | 1 + .../src/main/java/org/openapitools/client/model/Order.java | 1 + .../main/java/org/openapitools/client/model/OuterComposite.java | 1 + .../src/main/java/org/openapitools/client/model/Pet.java | 1 + .../main/java/org/openapitools/client/model/ReadOnlyFirst.java | 1 + .../java/org/openapitools/client/model/SpecialModelName.java | 1 + .../src/main/java/org/openapitools/client/model/Tag.java | 1 + .../java/org/openapitools/client/model/TypeHolderDefault.java | 1 + .../java/org/openapitools/client/model/TypeHolderExample.java | 1 + .../src/main/java/org/openapitools/client/model/User.java | 1 + .../src/main/java/org/openapitools/client/model/XmlItem.java | 1 + .../openapitools/client/model/AdditionalPropertiesAnyType.java | 1 + .../org/openapitools/client/model/AdditionalPropertiesArray.java | 1 + .../openapitools/client/model/AdditionalPropertiesBoolean.java | 1 + .../org/openapitools/client/model/AdditionalPropertiesClass.java | 1 + .../openapitools/client/model/AdditionalPropertiesInteger.java | 1 + .../openapitools/client/model/AdditionalPropertiesNumber.java | 1 + .../openapitools/client/model/AdditionalPropertiesObject.java | 1 + .../openapitools/client/model/AdditionalPropertiesString.java | 1 + .../src/main/java/org/openapitools/client/model/Animal.java | 1 + .../org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java | 1 + .../java/org/openapitools/client/model/ArrayOfNumberOnly.java | 1 + .../src/main/java/org/openapitools/client/model/ArrayTest.java | 1 + .../src/main/java/org/openapitools/client/model/BigCat.java | 1 + .../src/main/java/org/openapitools/client/model/BigCatAllOf.java | 1 + .../main/java/org/openapitools/client/model/Capitalization.java | 1 + .../src/main/java/org/openapitools/client/model/Cat.java | 1 + .../src/main/java/org/openapitools/client/model/CatAllOf.java | 1 + .../src/main/java/org/openapitools/client/model/Category.java | 1 + .../src/main/java/org/openapitools/client/model/ClassModel.java | 1 + .../src/main/java/org/openapitools/client/model/Client.java | 1 + .../src/main/java/org/openapitools/client/model/Dog.java | 1 + .../src/main/java/org/openapitools/client/model/DogAllOf.java | 1 + .../src/main/java/org/openapitools/client/model/EnumArrays.java | 1 + .../src/main/java/org/openapitools/client/model/EnumTest.java | 1 + .../java/org/openapitools/client/model/FileSchemaTestClass.java | 1 + .../src/main/java/org/openapitools/client/model/FormatTest.java | 1 + .../main/java/org/openapitools/client/model/HasOnlyReadOnly.java | 1 + .../src/main/java/org/openapitools/client/model/MapTest.java | 1 + .../model/MixedPropertiesAndAdditionalPropertiesClass.java | 1 + .../java/org/openapitools/client/model/Model200Response.java | 1 + .../java/org/openapitools/client/model/ModelApiResponse.java | 1 + .../src/main/java/org/openapitools/client/model/ModelReturn.java | 1 + .../src/main/java/org/openapitools/client/model/Name.java | 1 + .../src/main/java/org/openapitools/client/model/NumberOnly.java | 1 + .../src/main/java/org/openapitools/client/model/Order.java | 1 + .../main/java/org/openapitools/client/model/OuterComposite.java | 1 + .../src/main/java/org/openapitools/client/model/Pet.java | 1 + .../main/java/org/openapitools/client/model/ReadOnlyFirst.java | 1 + .../java/org/openapitools/client/model/SpecialModelName.java | 1 + .../src/main/java/org/openapitools/client/model/Tag.java | 1 + .../java/org/openapitools/client/model/TypeHolderDefault.java | 1 + .../java/org/openapitools/client/model/TypeHolderExample.java | 1 + .../src/main/java/org/openapitools/client/model/User.java | 1 + .../src/main/java/org/openapitools/client/model/XmlItem.java | 1 + .../openapitools/client/model/AdditionalPropertiesAnyType.java | 1 + .../org/openapitools/client/model/AdditionalPropertiesArray.java | 1 + .../openapitools/client/model/AdditionalPropertiesBoolean.java | 1 + .../org/openapitools/client/model/AdditionalPropertiesClass.java | 1 + .../openapitools/client/model/AdditionalPropertiesInteger.java | 1 + .../openapitools/client/model/AdditionalPropertiesNumber.java | 1 + .../openapitools/client/model/AdditionalPropertiesObject.java | 1 + .../openapitools/client/model/AdditionalPropertiesString.java | 1 + .../src/main/java/org/openapitools/client/model/Animal.java | 1 + .../org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java | 1 + .../java/org/openapitools/client/model/ArrayOfNumberOnly.java | 1 + .../src/main/java/org/openapitools/client/model/ArrayTest.java | 1 + .../src/main/java/org/openapitools/client/model/BigCat.java | 1 + .../src/main/java/org/openapitools/client/model/BigCatAllOf.java | 1 + .../main/java/org/openapitools/client/model/Capitalization.java | 1 + .../vertx/src/main/java/org/openapitools/client/model/Cat.java | 1 + .../src/main/java/org/openapitools/client/model/CatAllOf.java | 1 + .../src/main/java/org/openapitools/client/model/Category.java | 1 + .../src/main/java/org/openapitools/client/model/ClassModel.java | 1 + .../src/main/java/org/openapitools/client/model/Client.java | 1 + .../vertx/src/main/java/org/openapitools/client/model/Dog.java | 1 + .../src/main/java/org/openapitools/client/model/DogAllOf.java | 1 + .../src/main/java/org/openapitools/client/model/EnumArrays.java | 1 + .../src/main/java/org/openapitools/client/model/EnumTest.java | 1 + .../java/org/openapitools/client/model/FileSchemaTestClass.java | 1 + .../src/main/java/org/openapitools/client/model/FormatTest.java | 1 + .../main/java/org/openapitools/client/model/HasOnlyReadOnly.java | 1 + .../src/main/java/org/openapitools/client/model/MapTest.java | 1 + .../model/MixedPropertiesAndAdditionalPropertiesClass.java | 1 + .../java/org/openapitools/client/model/Model200Response.java | 1 + .../java/org/openapitools/client/model/ModelApiResponse.java | 1 + .../src/main/java/org/openapitools/client/model/ModelReturn.java | 1 + .../vertx/src/main/java/org/openapitools/client/model/Name.java | 1 + .../src/main/java/org/openapitools/client/model/NumberOnly.java | 1 + .../vertx/src/main/java/org/openapitools/client/model/Order.java | 1 + .../main/java/org/openapitools/client/model/OuterComposite.java | 1 + .../vertx/src/main/java/org/openapitools/client/model/Pet.java | 1 + .../main/java/org/openapitools/client/model/ReadOnlyFirst.java | 1 + .../java/org/openapitools/client/model/SpecialModelName.java | 1 + .../vertx/src/main/java/org/openapitools/client/model/Tag.java | 1 + .../java/org/openapitools/client/model/TypeHolderDefault.java | 1 + .../java/org/openapitools/client/model/TypeHolderExample.java | 1 + .../vertx/src/main/java/org/openapitools/client/model/User.java | 1 + .../src/main/java/org/openapitools/client/model/XmlItem.java | 1 + .../openapitools/client/model/AdditionalPropertiesAnyType.java | 1 + .../org/openapitools/client/model/AdditionalPropertiesArray.java | 1 + .../openapitools/client/model/AdditionalPropertiesBoolean.java | 1 + .../org/openapitools/client/model/AdditionalPropertiesClass.java | 1 + .../openapitools/client/model/AdditionalPropertiesInteger.java | 1 + .../openapitools/client/model/AdditionalPropertiesNumber.java | 1 + .../openapitools/client/model/AdditionalPropertiesObject.java | 1 + .../openapitools/client/model/AdditionalPropertiesString.java | 1 + .../src/main/java/org/openapitools/client/model/Animal.java | 1 + .../org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java | 1 + .../java/org/openapitools/client/model/ArrayOfNumberOnly.java | 1 + .../src/main/java/org/openapitools/client/model/ArrayTest.java | 1 + .../src/main/java/org/openapitools/client/model/BigCat.java | 1 + .../src/main/java/org/openapitools/client/model/BigCatAllOf.java | 1 + .../main/java/org/openapitools/client/model/Capitalization.java | 1 + .../src/main/java/org/openapitools/client/model/Cat.java | 1 + .../src/main/java/org/openapitools/client/model/CatAllOf.java | 1 + .../src/main/java/org/openapitools/client/model/Category.java | 1 + .../src/main/java/org/openapitools/client/model/ClassModel.java | 1 + .../src/main/java/org/openapitools/client/model/Client.java | 1 + .../src/main/java/org/openapitools/client/model/Dog.java | 1 + .../src/main/java/org/openapitools/client/model/DogAllOf.java | 1 + .../src/main/java/org/openapitools/client/model/EnumArrays.java | 1 + .../src/main/java/org/openapitools/client/model/EnumTest.java | 1 + .../java/org/openapitools/client/model/FileSchemaTestClass.java | 1 + .../src/main/java/org/openapitools/client/model/FormatTest.java | 1 + .../main/java/org/openapitools/client/model/HasOnlyReadOnly.java | 1 + .../src/main/java/org/openapitools/client/model/MapTest.java | 1 + .../model/MixedPropertiesAndAdditionalPropertiesClass.java | 1 + .../java/org/openapitools/client/model/Model200Response.java | 1 + .../java/org/openapitools/client/model/ModelApiResponse.java | 1 + .../src/main/java/org/openapitools/client/model/ModelReturn.java | 1 + .../src/main/java/org/openapitools/client/model/Name.java | 1 + .../src/main/java/org/openapitools/client/model/NumberOnly.java | 1 + .../src/main/java/org/openapitools/client/model/Order.java | 1 + .../main/java/org/openapitools/client/model/OuterComposite.java | 1 + .../src/main/java/org/openapitools/client/model/Pet.java | 1 + .../main/java/org/openapitools/client/model/ReadOnlyFirst.java | 1 + .../java/org/openapitools/client/model/SpecialModelName.java | 1 + .../src/main/java/org/openapitools/client/model/Tag.java | 1 + .../java/org/openapitools/client/model/TypeHolderDefault.java | 1 + .../java/org/openapitools/client/model/TypeHolderExample.java | 1 + .../src/main/java/org/openapitools/client/model/User.java | 1 + .../src/main/java/org/openapitools/client/model/XmlItem.java | 1 + 529 files changed, 529 insertions(+) diff --git a/modules/openapi-generator/src/main/resources/Java/pojo.mustache b/modules/openapi-generator/src/main/resources/Java/pojo.mustache index 653f44062d14..1754416a3962 100644 --- a/modules/openapi-generator/src/main/resources/Java/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/Java/pojo.mustache @@ -8,6 +8,7 @@ {{classname}}.JSON_PROPERTY_{{nameInSnakeCase}}{{^-last}},{{/-last}} {{/vars}} }) +@JsonTypeName("{{name}}") {{/jackson}} {{>additionalModelTypeAnnotations}}{{>generatedAnnotation}}{{#discriminator}}{{>typeInfoAnnotation}}{{/discriminator}}{{>xmlAnnotation}} public class {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}{{#vendorExtensions.x-implements}}{{#-first}}implements {{{.}}}{{/-first}}{{^-first}}, {{{.}}}{{/-first}}{{#-last}} {{/-last}}{{/vendorExtensions.x-implements}}{ diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index 8d2c7147bdb6..62b1da4c2f00 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -32,6 +32,7 @@ @JsonPropertyOrder({ AdditionalPropertiesAnyType.JSON_PROPERTY_NAME }) +@JsonTypeName("AdditionalPropertiesAnyType") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesAnyType extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index 79e87782bd2c..0115b4dd963b 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -33,6 +33,7 @@ @JsonPropertyOrder({ AdditionalPropertiesArray.JSON_PROPERTY_NAME }) +@JsonTypeName("AdditionalPropertiesArray") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesArray extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index 8c5bc6271da0..a430b6fc5729 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -32,6 +32,7 @@ @JsonPropertyOrder({ AdditionalPropertiesBoolean.JSON_PROPERTY_NAME }) +@JsonTypeName("AdditionalPropertiesBoolean") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesBoolean extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index ed7e62088290..69dabddfb145 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -44,6 +44,7 @@ AdditionalPropertiesClass.JSON_PROPERTY_ANYTYPE2, AdditionalPropertiesClass.JSON_PROPERTY_ANYTYPE3 }) +@JsonTypeName("AdditionalPropertiesClass") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesClass { public static final String JSON_PROPERTY_MAP_STRING = "map_string"; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index 41d50c58ceae..9f7587c2edf3 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -32,6 +32,7 @@ @JsonPropertyOrder({ AdditionalPropertiesInteger.JSON_PROPERTY_NAME }) +@JsonTypeName("AdditionalPropertiesInteger") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesInteger extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index 5b656c5825a4..9700dab2bd2b 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -33,6 +33,7 @@ @JsonPropertyOrder({ AdditionalPropertiesNumber.JSON_PROPERTY_NAME }) +@JsonTypeName("AdditionalPropertiesNumber") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesNumber extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index 2326f099b488..60a59e97a228 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -32,6 +32,7 @@ @JsonPropertyOrder({ AdditionalPropertiesObject.JSON_PROPERTY_NAME }) +@JsonTypeName("AdditionalPropertiesObject") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesObject extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index cde27cbad9fb..5d355241baf8 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -32,6 +32,7 @@ @JsonPropertyOrder({ AdditionalPropertiesString.JSON_PROPERTY_NAME }) +@JsonTypeName("AdditionalPropertiesString") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesString extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Animal.java index 9dc580215d1f..99d5797e86e8 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Animal.java @@ -36,6 +36,7 @@ Animal.JSON_PROPERTY_CLASS_NAME, Animal.JSON_PROPERTY_COLOR }) +@JsonTypeName("Animal") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) @JsonSubTypes({ diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index e8ab9ce9565c..dd0b5d8f55e2 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -33,6 +33,7 @@ @JsonPropertyOrder({ ArrayOfArrayOfNumberOnly.JSON_PROPERTY_ARRAY_ARRAY_NUMBER }) +@JsonTypeName("ArrayOfArrayOfNumberOnly") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ArrayOfArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 48afb5b470bd..e681cb5b8241 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -33,6 +33,7 @@ @JsonPropertyOrder({ ArrayOfNumberOnly.JSON_PROPERTY_ARRAY_NUMBER }) +@JsonTypeName("ArrayOfNumberOnly") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber"; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ArrayTest.java index 55935f343f5c..bdcc439a5ec4 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -35,6 +35,7 @@ ArrayTest.JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER, ArrayTest.JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL }) +@JsonTypeName("ArrayTest") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ArrayTest { public static final String JSON_PROPERTY_ARRAY_OF_STRING = "array_of_string"; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/BigCat.java index 864ec623e435..b3033deacc7d 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/BigCat.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/BigCat.java @@ -34,6 +34,7 @@ @JsonPropertyOrder({ BigCat.JSON_PROPERTY_KIND }) +@JsonTypeName("BigCat") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/BigCatAllOf.java index a22af0b67c02..6a3df7eafcaa 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/BigCatAllOf.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -30,6 +30,7 @@ @JsonPropertyOrder({ BigCatAllOf.JSON_PROPERTY_KIND }) +@JsonTypeName("BigCat_allOf") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class BigCatAllOf { /** diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Capitalization.java index c7ea7879dbef..6d7704bfba08 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Capitalization.java @@ -35,6 +35,7 @@ Capitalization.JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS, Capitalization.JSON_PROPERTY_A_T_T_N_A_M_E }) +@JsonTypeName("Capitalization") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Capitalization { public static final String JSON_PROPERTY_SMALL_CAMEL = "smallCamel"; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Cat.java index 11c2fd9d6624..cad2931b1baa 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Cat.java @@ -35,6 +35,7 @@ @JsonPropertyOrder({ Cat.JSON_PROPERTY_DECLAWED }) +@JsonTypeName("Cat") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) @JsonSubTypes({ diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/CatAllOf.java index 35c447ac0e9e..e4802f50ff6e 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -30,6 +30,7 @@ @JsonPropertyOrder({ CatAllOf.JSON_PROPERTY_DECLAWED }) +@JsonTypeName("Cat_allOf") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class CatAllOf { public static final String JSON_PROPERTY_DECLAWED = "declawed"; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Category.java index 5823854c4c9f..87a09fb2bae7 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Category.java @@ -31,6 +31,7 @@ Category.JSON_PROPERTY_ID, Category.JSON_PROPERTY_NAME }) +@JsonTypeName("Category") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Category { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ClassModel.java index 93445a9610c1..c4008f60e646 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ClassModel.java @@ -31,6 +31,7 @@ @JsonPropertyOrder({ ClassModel.JSON_PROPERTY_PROPERTY_CLASS }) +@JsonTypeName("ClassModel") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ClassModel { public static final String JSON_PROPERTY_PROPERTY_CLASS = "_class"; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Client.java index 2820a5517c90..013eeba9b6ec 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Client.java @@ -30,6 +30,7 @@ @JsonPropertyOrder({ Client.JSON_PROPERTY_CLIENT }) +@JsonTypeName("Client") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Client { public static final String JSON_PROPERTY_CLIENT = "client"; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Dog.java index d81430849bb3..5f29f08ac2e6 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Dog.java @@ -34,6 +34,7 @@ @JsonPropertyOrder({ Dog.JSON_PROPERTY_BREED }) +@JsonTypeName("Dog") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/DogAllOf.java index 21babf245444..c5af5ce9324b 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -30,6 +30,7 @@ @JsonPropertyOrder({ DogAllOf.JSON_PROPERTY_BREED }) +@JsonTypeName("Dog_allOf") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class DogAllOf { public static final String JSON_PROPERTY_BREED = "breed"; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/EnumArrays.java index 0ac0036a1264..f1250725f78b 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -33,6 +33,7 @@ EnumArrays.JSON_PROPERTY_JUST_SYMBOL, EnumArrays.JSON_PROPERTY_ARRAY_ENUM }) +@JsonTypeName("EnumArrays") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class EnumArrays { /** diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/EnumTest.java index e58cb6c26273..180480621bf2 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/EnumTest.java @@ -35,6 +35,7 @@ EnumTest.JSON_PROPERTY_ENUM_NUMBER, EnumTest.JSON_PROPERTY_OUTER_ENUM }) +@JsonTypeName("Enum_Test") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class EnumTest { /** diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index bd7a3dc18ece..963fe400ccb7 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -33,6 +33,7 @@ FileSchemaTestClass.JSON_PROPERTY_FILE, FileSchemaTestClass.JSON_PROPERTY_FILES }) +@JsonTypeName("FileSchemaTestClass") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class FileSchemaTestClass { public static final String JSON_PROPERTY_FILE = "file"; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/FormatTest.java index 80b36862ad7b..9ff00f4e174b 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/FormatTest.java @@ -48,6 +48,7 @@ FormatTest.JSON_PROPERTY_PASSWORD, FormatTest.JSON_PROPERTY_BIG_DECIMAL }) +@JsonTypeName("format_test") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class FormatTest { public static final String JSON_PROPERTY_INTEGER = "integer"; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index 09ce9ea3cba6..7d19aedaf059 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -31,6 +31,7 @@ HasOnlyReadOnly.JSON_PROPERTY_BAR, HasOnlyReadOnly.JSON_PROPERTY_FOO }) +@JsonTypeName("hasOnlyReadOnly") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class HasOnlyReadOnly { public static final String JSON_PROPERTY_BAR = "bar"; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/MapTest.java index bf8f3e694574..1a01d9966957 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/MapTest.java @@ -36,6 +36,7 @@ MapTest.JSON_PROPERTY_DIRECT_MAP, MapTest.JSON_PROPERTY_INDIRECT_MAP }) +@JsonTypeName("MapTest") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class MapTest { public static final String JSON_PROPERTY_MAP_MAP_OF_STRING = "map_map_of_string"; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 1535857a4de2..9d3468b0efab 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -38,6 +38,7 @@ MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_DATE_TIME, MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_MAP }) +@JsonTypeName("MixedPropertiesAndAdditionalPropertiesClass") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class MixedPropertiesAndAdditionalPropertiesClass { public static final String JSON_PROPERTY_UUID = "uuid"; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Model200Response.java index f4cfa618708f..a0128aa6fa55 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Model200Response.java @@ -32,6 +32,7 @@ Model200Response.JSON_PROPERTY_NAME, Model200Response.JSON_PROPERTY_PROPERTY_CLASS }) +@JsonTypeName("200_response") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Model200Response { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ModelApiResponse.java index fadebd3adae6..d4b95b9f2792 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -32,6 +32,7 @@ ModelApiResponse.JSON_PROPERTY_TYPE, ModelApiResponse.JSON_PROPERTY_MESSAGE }) +@JsonTypeName("ApiResponse") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ModelApiResponse { public static final String JSON_PROPERTY_CODE = "code"; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ModelReturn.java index fd011c26d08f..dff176002fd2 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -31,6 +31,7 @@ @JsonPropertyOrder({ ModelReturn.JSON_PROPERTY_RETURN }) +@JsonTypeName("Return") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ModelReturn { public static final String JSON_PROPERTY_RETURN = "return"; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Name.java index 2856bb62713f..0d2544deef1b 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Name.java @@ -34,6 +34,7 @@ Name.JSON_PROPERTY_PROPERTY, Name.JSON_PROPERTY_123NUMBER }) +@JsonTypeName("Name") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Name { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/NumberOnly.java index 6f75ce84869a..70fd4e2bd2e0 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -31,6 +31,7 @@ @JsonPropertyOrder({ NumberOnly.JSON_PROPERTY_JUST_NUMBER }) +@JsonTypeName("NumberOnly") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class NumberOnly { public static final String JSON_PROPERTY_JUST_NUMBER = "JustNumber"; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Order.java index 504b92303ec4..aa9bda546dd4 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Order.java @@ -36,6 +36,7 @@ Order.JSON_PROPERTY_STATUS, Order.JSON_PROPERTY_COMPLETE }) +@JsonTypeName("Order") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Order { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/OuterComposite.java index 31b0d1358fa6..a8c3379f3dfe 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -33,6 +33,7 @@ OuterComposite.JSON_PROPERTY_MY_STRING, OuterComposite.JSON_PROPERTY_MY_BOOLEAN }) +@JsonTypeName("OuterComposite") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class OuterComposite { public static final String JSON_PROPERTY_MY_NUMBER = "my_number"; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Pet.java index 6a5bf52230d4..676bb150cf46 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Pet.java @@ -41,6 +41,7 @@ Pet.JSON_PROPERTY_TAGS, Pet.JSON_PROPERTY_STATUS }) +@JsonTypeName("Pet") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Pet { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index 938b1ab5306d..10615e92497a 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -31,6 +31,7 @@ ReadOnlyFirst.JSON_PROPERTY_BAR, ReadOnlyFirst.JSON_PROPERTY_BAZ }) +@JsonTypeName("ReadOnlyFirst") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ReadOnlyFirst { public static final String JSON_PROPERTY_BAR = "bar"; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/SpecialModelName.java index 0e689d7d2dc2..b41f654fab88 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -30,6 +30,7 @@ @JsonPropertyOrder({ SpecialModelName.JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME }) +@JsonTypeName("$special[model.name]") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SpecialModelName { public static final String JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME = "$special[property.name]"; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Tag.java index 09eb968690dd..d551564e69cc 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Tag.java @@ -31,6 +31,7 @@ Tag.JSON_PROPERTY_ID, Tag.JSON_PROPERTY_NAME }) +@JsonTypeName("Tag") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Tag { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index 576744af258e..53c8da269582 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -37,6 +37,7 @@ TypeHolderDefault.JSON_PROPERTY_BOOL_ITEM, TypeHolderDefault.JSON_PROPERTY_ARRAY_ITEM }) +@JsonTypeName("TypeHolderDefault") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TypeHolderDefault { public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/TypeHolderExample.java index 14952abd0779..e991a1419589 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -38,6 +38,7 @@ TypeHolderExample.JSON_PROPERTY_BOOL_ITEM, TypeHolderExample.JSON_PROPERTY_ARRAY_ITEM }) +@JsonTypeName("TypeHolderExample") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TypeHolderExample { public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/User.java index 68d6a47d486d..0f0e9cbde49a 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/User.java @@ -37,6 +37,7 @@ User.JSON_PROPERTY_PHONE, User.JSON_PROPERTY_USER_STATUS }) +@JsonTypeName("User") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class User { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/XmlItem.java index 44bbe30a93ad..1a92dbfb49dc 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/XmlItem.java @@ -61,6 +61,7 @@ XmlItem.JSON_PROPERTY_PREFIX_NS_ARRAY, XmlItem.JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY }) +@JsonTypeName("XmlItem") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class XmlItem { public static final String JSON_PROPERTY_ATTRIBUTE_STRING = "attribute_string"; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index 8d2c7147bdb6..62b1da4c2f00 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -32,6 +32,7 @@ @JsonPropertyOrder({ AdditionalPropertiesAnyType.JSON_PROPERTY_NAME }) +@JsonTypeName("AdditionalPropertiesAnyType") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesAnyType extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index 79e87782bd2c..0115b4dd963b 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -33,6 +33,7 @@ @JsonPropertyOrder({ AdditionalPropertiesArray.JSON_PROPERTY_NAME }) +@JsonTypeName("AdditionalPropertiesArray") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesArray extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index 8c5bc6271da0..a430b6fc5729 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -32,6 +32,7 @@ @JsonPropertyOrder({ AdditionalPropertiesBoolean.JSON_PROPERTY_NAME }) +@JsonTypeName("AdditionalPropertiesBoolean") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesBoolean extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index ed7e62088290..69dabddfb145 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -44,6 +44,7 @@ AdditionalPropertiesClass.JSON_PROPERTY_ANYTYPE2, AdditionalPropertiesClass.JSON_PROPERTY_ANYTYPE3 }) +@JsonTypeName("AdditionalPropertiesClass") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesClass { public static final String JSON_PROPERTY_MAP_STRING = "map_string"; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index 41d50c58ceae..9f7587c2edf3 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -32,6 +32,7 @@ @JsonPropertyOrder({ AdditionalPropertiesInteger.JSON_PROPERTY_NAME }) +@JsonTypeName("AdditionalPropertiesInteger") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesInteger extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index 5b656c5825a4..9700dab2bd2b 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -33,6 +33,7 @@ @JsonPropertyOrder({ AdditionalPropertiesNumber.JSON_PROPERTY_NAME }) +@JsonTypeName("AdditionalPropertiesNumber") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesNumber extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index 2326f099b488..60a59e97a228 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -32,6 +32,7 @@ @JsonPropertyOrder({ AdditionalPropertiesObject.JSON_PROPERTY_NAME }) +@JsonTypeName("AdditionalPropertiesObject") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesObject extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index cde27cbad9fb..5d355241baf8 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -32,6 +32,7 @@ @JsonPropertyOrder({ AdditionalPropertiesString.JSON_PROPERTY_NAME }) +@JsonTypeName("AdditionalPropertiesString") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesString extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Animal.java index 9dc580215d1f..99d5797e86e8 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Animal.java @@ -36,6 +36,7 @@ Animal.JSON_PROPERTY_CLASS_NAME, Animal.JSON_PROPERTY_COLOR }) +@JsonTypeName("Animal") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) @JsonSubTypes({ diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index e8ab9ce9565c..dd0b5d8f55e2 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -33,6 +33,7 @@ @JsonPropertyOrder({ ArrayOfArrayOfNumberOnly.JSON_PROPERTY_ARRAY_ARRAY_NUMBER }) +@JsonTypeName("ArrayOfArrayOfNumberOnly") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ArrayOfArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 48afb5b470bd..e681cb5b8241 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -33,6 +33,7 @@ @JsonPropertyOrder({ ArrayOfNumberOnly.JSON_PROPERTY_ARRAY_NUMBER }) +@JsonTypeName("ArrayOfNumberOnly") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber"; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ArrayTest.java index 55935f343f5c..bdcc439a5ec4 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -35,6 +35,7 @@ ArrayTest.JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER, ArrayTest.JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL }) +@JsonTypeName("ArrayTest") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ArrayTest { public static final String JSON_PROPERTY_ARRAY_OF_STRING = "array_of_string"; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/BigCat.java index 864ec623e435..b3033deacc7d 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/BigCat.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/BigCat.java @@ -34,6 +34,7 @@ @JsonPropertyOrder({ BigCat.JSON_PROPERTY_KIND }) +@JsonTypeName("BigCat") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/BigCatAllOf.java index a22af0b67c02..6a3df7eafcaa 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/BigCatAllOf.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -30,6 +30,7 @@ @JsonPropertyOrder({ BigCatAllOf.JSON_PROPERTY_KIND }) +@JsonTypeName("BigCat_allOf") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class BigCatAllOf { /** diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Capitalization.java index c7ea7879dbef..6d7704bfba08 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Capitalization.java @@ -35,6 +35,7 @@ Capitalization.JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS, Capitalization.JSON_PROPERTY_A_T_T_N_A_M_E }) +@JsonTypeName("Capitalization") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Capitalization { public static final String JSON_PROPERTY_SMALL_CAMEL = "smallCamel"; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Cat.java index 664eb00008be..ed7d126fa5c7 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Cat.java @@ -35,6 +35,7 @@ @JsonPropertyOrder({ Cat.JSON_PROPERTY_DECLAWED }) +@JsonTypeName("Cat") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) @JsonSubTypes({ diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/CatAllOf.java index bbbb99689bdf..a90ea75ffb71 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -30,6 +30,7 @@ @JsonPropertyOrder({ CatAllOf.JSON_PROPERTY_DECLAWED }) +@JsonTypeName("Cat_allOf") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class CatAllOf { public static final String JSON_PROPERTY_DECLAWED = "declawed"; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Category.java index 5823854c4c9f..87a09fb2bae7 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Category.java @@ -31,6 +31,7 @@ Category.JSON_PROPERTY_ID, Category.JSON_PROPERTY_NAME }) +@JsonTypeName("Category") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Category { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ClassModel.java index 93445a9610c1..c4008f60e646 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ClassModel.java @@ -31,6 +31,7 @@ @JsonPropertyOrder({ ClassModel.JSON_PROPERTY_PROPERTY_CLASS }) +@JsonTypeName("ClassModel") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ClassModel { public static final String JSON_PROPERTY_PROPERTY_CLASS = "_class"; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Client.java index 2820a5517c90..013eeba9b6ec 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Client.java @@ -30,6 +30,7 @@ @JsonPropertyOrder({ Client.JSON_PROPERTY_CLIENT }) +@JsonTypeName("Client") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Client { public static final String JSON_PROPERTY_CLIENT = "client"; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Dog.java index d81430849bb3..5f29f08ac2e6 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Dog.java @@ -34,6 +34,7 @@ @JsonPropertyOrder({ Dog.JSON_PROPERTY_BREED }) +@JsonTypeName("Dog") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/DogAllOf.java index 21babf245444..c5af5ce9324b 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -30,6 +30,7 @@ @JsonPropertyOrder({ DogAllOf.JSON_PROPERTY_BREED }) +@JsonTypeName("Dog_allOf") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class DogAllOf { public static final String JSON_PROPERTY_BREED = "breed"; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/EnumArrays.java index 0ac0036a1264..f1250725f78b 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -33,6 +33,7 @@ EnumArrays.JSON_PROPERTY_JUST_SYMBOL, EnumArrays.JSON_PROPERTY_ARRAY_ENUM }) +@JsonTypeName("EnumArrays") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class EnumArrays { /** diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/EnumTest.java index e58cb6c26273..180480621bf2 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/EnumTest.java @@ -35,6 +35,7 @@ EnumTest.JSON_PROPERTY_ENUM_NUMBER, EnumTest.JSON_PROPERTY_OUTER_ENUM }) +@JsonTypeName("Enum_Test") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class EnumTest { /** diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index bd7a3dc18ece..963fe400ccb7 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -33,6 +33,7 @@ FileSchemaTestClass.JSON_PROPERTY_FILE, FileSchemaTestClass.JSON_PROPERTY_FILES }) +@JsonTypeName("FileSchemaTestClass") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class FileSchemaTestClass { public static final String JSON_PROPERTY_FILE = "file"; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/FormatTest.java index 80b36862ad7b..9ff00f4e174b 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/FormatTest.java @@ -48,6 +48,7 @@ FormatTest.JSON_PROPERTY_PASSWORD, FormatTest.JSON_PROPERTY_BIG_DECIMAL }) +@JsonTypeName("format_test") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class FormatTest { public static final String JSON_PROPERTY_INTEGER = "integer"; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index 09ce9ea3cba6..7d19aedaf059 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -31,6 +31,7 @@ HasOnlyReadOnly.JSON_PROPERTY_BAR, HasOnlyReadOnly.JSON_PROPERTY_FOO }) +@JsonTypeName("hasOnlyReadOnly") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class HasOnlyReadOnly { public static final String JSON_PROPERTY_BAR = "bar"; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/MapTest.java index bf8f3e694574..1a01d9966957 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/MapTest.java @@ -36,6 +36,7 @@ MapTest.JSON_PROPERTY_DIRECT_MAP, MapTest.JSON_PROPERTY_INDIRECT_MAP }) +@JsonTypeName("MapTest") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class MapTest { public static final String JSON_PROPERTY_MAP_MAP_OF_STRING = "map_map_of_string"; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 1535857a4de2..9d3468b0efab 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -38,6 +38,7 @@ MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_DATE_TIME, MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_MAP }) +@JsonTypeName("MixedPropertiesAndAdditionalPropertiesClass") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class MixedPropertiesAndAdditionalPropertiesClass { public static final String JSON_PROPERTY_UUID = "uuid"; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Model200Response.java index f4cfa618708f..a0128aa6fa55 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Model200Response.java @@ -32,6 +32,7 @@ Model200Response.JSON_PROPERTY_NAME, Model200Response.JSON_PROPERTY_PROPERTY_CLASS }) +@JsonTypeName("200_response") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Model200Response { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ModelApiResponse.java index fadebd3adae6..d4b95b9f2792 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -32,6 +32,7 @@ ModelApiResponse.JSON_PROPERTY_TYPE, ModelApiResponse.JSON_PROPERTY_MESSAGE }) +@JsonTypeName("ApiResponse") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ModelApiResponse { public static final String JSON_PROPERTY_CODE = "code"; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ModelReturn.java index fd011c26d08f..dff176002fd2 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -31,6 +31,7 @@ @JsonPropertyOrder({ ModelReturn.JSON_PROPERTY_RETURN }) +@JsonTypeName("Return") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ModelReturn { public static final String JSON_PROPERTY_RETURN = "return"; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Name.java index 2856bb62713f..0d2544deef1b 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Name.java @@ -34,6 +34,7 @@ Name.JSON_PROPERTY_PROPERTY, Name.JSON_PROPERTY_123NUMBER }) +@JsonTypeName("Name") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Name { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/NumberOnly.java index 6f75ce84869a..70fd4e2bd2e0 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -31,6 +31,7 @@ @JsonPropertyOrder({ NumberOnly.JSON_PROPERTY_JUST_NUMBER }) +@JsonTypeName("NumberOnly") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class NumberOnly { public static final String JSON_PROPERTY_JUST_NUMBER = "JustNumber"; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Order.java index b3c44d7f5da9..b3ff3f899c21 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Order.java @@ -36,6 +36,7 @@ Order.JSON_PROPERTY_STATUS, Order.JSON_PROPERTY_COMPLETE }) +@JsonTypeName("Order") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Order { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/OuterComposite.java index 01d6299649fd..5065b8e6326c 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -33,6 +33,7 @@ OuterComposite.JSON_PROPERTY_MY_STRING, OuterComposite.JSON_PROPERTY_MY_BOOLEAN }) +@JsonTypeName("OuterComposite") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class OuterComposite { public static final String JSON_PROPERTY_MY_NUMBER = "my_number"; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Pet.java index 6a5bf52230d4..676bb150cf46 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Pet.java @@ -41,6 +41,7 @@ Pet.JSON_PROPERTY_TAGS, Pet.JSON_PROPERTY_STATUS }) +@JsonTypeName("Pet") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Pet { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index 938b1ab5306d..10615e92497a 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -31,6 +31,7 @@ ReadOnlyFirst.JSON_PROPERTY_BAR, ReadOnlyFirst.JSON_PROPERTY_BAZ }) +@JsonTypeName("ReadOnlyFirst") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ReadOnlyFirst { public static final String JSON_PROPERTY_BAR = "bar"; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/SpecialModelName.java index 0e689d7d2dc2..b41f654fab88 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -30,6 +30,7 @@ @JsonPropertyOrder({ SpecialModelName.JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME }) +@JsonTypeName("$special[model.name]") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SpecialModelName { public static final String JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME = "$special[property.name]"; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Tag.java index 09eb968690dd..d551564e69cc 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Tag.java @@ -31,6 +31,7 @@ Tag.JSON_PROPERTY_ID, Tag.JSON_PROPERTY_NAME }) +@JsonTypeName("Tag") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Tag { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index 7591858f5a42..eea3eb5d325e 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -37,6 +37,7 @@ TypeHolderDefault.JSON_PROPERTY_BOOL_ITEM, TypeHolderDefault.JSON_PROPERTY_ARRAY_ITEM }) +@JsonTypeName("TypeHolderDefault") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TypeHolderDefault { public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/TypeHolderExample.java index 7d40ec56e6f1..744c4c540413 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -38,6 +38,7 @@ TypeHolderExample.JSON_PROPERTY_BOOL_ITEM, TypeHolderExample.JSON_PROPERTY_ARRAY_ITEM }) +@JsonTypeName("TypeHolderExample") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TypeHolderExample { public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/User.java index 68d6a47d486d..0f0e9cbde49a 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/User.java @@ -37,6 +37,7 @@ User.JSON_PROPERTY_PHONE, User.JSON_PROPERTY_USER_STATUS }) +@JsonTypeName("User") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class User { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/XmlItem.java index cac71c7221b0..b4d37be1ec11 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/XmlItem.java @@ -61,6 +61,7 @@ XmlItem.JSON_PROPERTY_PREFIX_NS_ARRAY, XmlItem.JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY }) +@JsonTypeName("XmlItem") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class XmlItem { public static final String JSON_PROPERTY_ATTRIBUTE_STRING = "attribute_string"; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index 8d2c7147bdb6..62b1da4c2f00 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -32,6 +32,7 @@ @JsonPropertyOrder({ AdditionalPropertiesAnyType.JSON_PROPERTY_NAME }) +@JsonTypeName("AdditionalPropertiesAnyType") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesAnyType extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index 79e87782bd2c..0115b4dd963b 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -33,6 +33,7 @@ @JsonPropertyOrder({ AdditionalPropertiesArray.JSON_PROPERTY_NAME }) +@JsonTypeName("AdditionalPropertiesArray") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesArray extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index 8c5bc6271da0..a430b6fc5729 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -32,6 +32,7 @@ @JsonPropertyOrder({ AdditionalPropertiesBoolean.JSON_PROPERTY_NAME }) +@JsonTypeName("AdditionalPropertiesBoolean") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesBoolean extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index ed7e62088290..69dabddfb145 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -44,6 +44,7 @@ AdditionalPropertiesClass.JSON_PROPERTY_ANYTYPE2, AdditionalPropertiesClass.JSON_PROPERTY_ANYTYPE3 }) +@JsonTypeName("AdditionalPropertiesClass") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesClass { public static final String JSON_PROPERTY_MAP_STRING = "map_string"; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index 41d50c58ceae..9f7587c2edf3 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -32,6 +32,7 @@ @JsonPropertyOrder({ AdditionalPropertiesInteger.JSON_PROPERTY_NAME }) +@JsonTypeName("AdditionalPropertiesInteger") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesInteger extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index 5b656c5825a4..9700dab2bd2b 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -33,6 +33,7 @@ @JsonPropertyOrder({ AdditionalPropertiesNumber.JSON_PROPERTY_NAME }) +@JsonTypeName("AdditionalPropertiesNumber") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesNumber extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index 2326f099b488..60a59e97a228 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -32,6 +32,7 @@ @JsonPropertyOrder({ AdditionalPropertiesObject.JSON_PROPERTY_NAME }) +@JsonTypeName("AdditionalPropertiesObject") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesObject extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index cde27cbad9fb..5d355241baf8 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -32,6 +32,7 @@ @JsonPropertyOrder({ AdditionalPropertiesString.JSON_PROPERTY_NAME }) +@JsonTypeName("AdditionalPropertiesString") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesString extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Animal.java index 9dc580215d1f..99d5797e86e8 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Animal.java @@ -36,6 +36,7 @@ Animal.JSON_PROPERTY_CLASS_NAME, Animal.JSON_PROPERTY_COLOR }) +@JsonTypeName("Animal") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) @JsonSubTypes({ diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index e8ab9ce9565c..dd0b5d8f55e2 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -33,6 +33,7 @@ @JsonPropertyOrder({ ArrayOfArrayOfNumberOnly.JSON_PROPERTY_ARRAY_ARRAY_NUMBER }) +@JsonTypeName("ArrayOfArrayOfNumberOnly") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ArrayOfArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 48afb5b470bd..e681cb5b8241 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -33,6 +33,7 @@ @JsonPropertyOrder({ ArrayOfNumberOnly.JSON_PROPERTY_ARRAY_NUMBER }) +@JsonTypeName("ArrayOfNumberOnly") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber"; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ArrayTest.java index 55935f343f5c..bdcc439a5ec4 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -35,6 +35,7 @@ ArrayTest.JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER, ArrayTest.JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL }) +@JsonTypeName("ArrayTest") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ArrayTest { public static final String JSON_PROPERTY_ARRAY_OF_STRING = "array_of_string"; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/BigCat.java index 864ec623e435..b3033deacc7d 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/BigCat.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/BigCat.java @@ -34,6 +34,7 @@ @JsonPropertyOrder({ BigCat.JSON_PROPERTY_KIND }) +@JsonTypeName("BigCat") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/BigCatAllOf.java index a22af0b67c02..6a3df7eafcaa 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/BigCatAllOf.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -30,6 +30,7 @@ @JsonPropertyOrder({ BigCatAllOf.JSON_PROPERTY_KIND }) +@JsonTypeName("BigCat_allOf") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class BigCatAllOf { /** diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Capitalization.java index c7ea7879dbef..6d7704bfba08 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Capitalization.java @@ -35,6 +35,7 @@ Capitalization.JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS, Capitalization.JSON_PROPERTY_A_T_T_N_A_M_E }) +@JsonTypeName("Capitalization") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Capitalization { public static final String JSON_PROPERTY_SMALL_CAMEL = "smallCamel"; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Cat.java index 664eb00008be..ed7d126fa5c7 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Cat.java @@ -35,6 +35,7 @@ @JsonPropertyOrder({ Cat.JSON_PROPERTY_DECLAWED }) +@JsonTypeName("Cat") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) @JsonSubTypes({ diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/CatAllOf.java index bbbb99689bdf..a90ea75ffb71 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -30,6 +30,7 @@ @JsonPropertyOrder({ CatAllOf.JSON_PROPERTY_DECLAWED }) +@JsonTypeName("Cat_allOf") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class CatAllOf { public static final String JSON_PROPERTY_DECLAWED = "declawed"; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Category.java index 5823854c4c9f..87a09fb2bae7 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Category.java @@ -31,6 +31,7 @@ Category.JSON_PROPERTY_ID, Category.JSON_PROPERTY_NAME }) +@JsonTypeName("Category") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Category { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ClassModel.java index 93445a9610c1..c4008f60e646 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ClassModel.java @@ -31,6 +31,7 @@ @JsonPropertyOrder({ ClassModel.JSON_PROPERTY_PROPERTY_CLASS }) +@JsonTypeName("ClassModel") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ClassModel { public static final String JSON_PROPERTY_PROPERTY_CLASS = "_class"; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Client.java index 2820a5517c90..013eeba9b6ec 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Client.java @@ -30,6 +30,7 @@ @JsonPropertyOrder({ Client.JSON_PROPERTY_CLIENT }) +@JsonTypeName("Client") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Client { public static final String JSON_PROPERTY_CLIENT = "client"; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Dog.java index d81430849bb3..5f29f08ac2e6 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Dog.java @@ -34,6 +34,7 @@ @JsonPropertyOrder({ Dog.JSON_PROPERTY_BREED }) +@JsonTypeName("Dog") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/DogAllOf.java index 21babf245444..c5af5ce9324b 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -30,6 +30,7 @@ @JsonPropertyOrder({ DogAllOf.JSON_PROPERTY_BREED }) +@JsonTypeName("Dog_allOf") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class DogAllOf { public static final String JSON_PROPERTY_BREED = "breed"; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/EnumArrays.java index 0ac0036a1264..f1250725f78b 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -33,6 +33,7 @@ EnumArrays.JSON_PROPERTY_JUST_SYMBOL, EnumArrays.JSON_PROPERTY_ARRAY_ENUM }) +@JsonTypeName("EnumArrays") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class EnumArrays { /** diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/EnumTest.java index e58cb6c26273..180480621bf2 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/EnumTest.java @@ -35,6 +35,7 @@ EnumTest.JSON_PROPERTY_ENUM_NUMBER, EnumTest.JSON_PROPERTY_OUTER_ENUM }) +@JsonTypeName("Enum_Test") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class EnumTest { /** diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index bd7a3dc18ece..963fe400ccb7 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -33,6 +33,7 @@ FileSchemaTestClass.JSON_PROPERTY_FILE, FileSchemaTestClass.JSON_PROPERTY_FILES }) +@JsonTypeName("FileSchemaTestClass") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class FileSchemaTestClass { public static final String JSON_PROPERTY_FILE = "file"; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/FormatTest.java index 80b36862ad7b..9ff00f4e174b 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/FormatTest.java @@ -48,6 +48,7 @@ FormatTest.JSON_PROPERTY_PASSWORD, FormatTest.JSON_PROPERTY_BIG_DECIMAL }) +@JsonTypeName("format_test") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class FormatTest { public static final String JSON_PROPERTY_INTEGER = "integer"; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index 09ce9ea3cba6..7d19aedaf059 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -31,6 +31,7 @@ HasOnlyReadOnly.JSON_PROPERTY_BAR, HasOnlyReadOnly.JSON_PROPERTY_FOO }) +@JsonTypeName("hasOnlyReadOnly") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class HasOnlyReadOnly { public static final String JSON_PROPERTY_BAR = "bar"; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/MapTest.java index bf8f3e694574..1a01d9966957 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/MapTest.java @@ -36,6 +36,7 @@ MapTest.JSON_PROPERTY_DIRECT_MAP, MapTest.JSON_PROPERTY_INDIRECT_MAP }) +@JsonTypeName("MapTest") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class MapTest { public static final String JSON_PROPERTY_MAP_MAP_OF_STRING = "map_map_of_string"; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 1535857a4de2..9d3468b0efab 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -38,6 +38,7 @@ MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_DATE_TIME, MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_MAP }) +@JsonTypeName("MixedPropertiesAndAdditionalPropertiesClass") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class MixedPropertiesAndAdditionalPropertiesClass { public static final String JSON_PROPERTY_UUID = "uuid"; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Model200Response.java index f4cfa618708f..a0128aa6fa55 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Model200Response.java @@ -32,6 +32,7 @@ Model200Response.JSON_PROPERTY_NAME, Model200Response.JSON_PROPERTY_PROPERTY_CLASS }) +@JsonTypeName("200_response") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Model200Response { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ModelApiResponse.java index fadebd3adae6..d4b95b9f2792 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -32,6 +32,7 @@ ModelApiResponse.JSON_PROPERTY_TYPE, ModelApiResponse.JSON_PROPERTY_MESSAGE }) +@JsonTypeName("ApiResponse") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ModelApiResponse { public static final String JSON_PROPERTY_CODE = "code"; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ModelReturn.java index fd011c26d08f..dff176002fd2 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -31,6 +31,7 @@ @JsonPropertyOrder({ ModelReturn.JSON_PROPERTY_RETURN }) +@JsonTypeName("Return") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ModelReturn { public static final String JSON_PROPERTY_RETURN = "return"; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Name.java index 2856bb62713f..0d2544deef1b 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Name.java @@ -34,6 +34,7 @@ Name.JSON_PROPERTY_PROPERTY, Name.JSON_PROPERTY_123NUMBER }) +@JsonTypeName("Name") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Name { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/NumberOnly.java index 6f75ce84869a..70fd4e2bd2e0 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -31,6 +31,7 @@ @JsonPropertyOrder({ NumberOnly.JSON_PROPERTY_JUST_NUMBER }) +@JsonTypeName("NumberOnly") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class NumberOnly { public static final String JSON_PROPERTY_JUST_NUMBER = "JustNumber"; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Order.java index b3c44d7f5da9..b3ff3f899c21 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Order.java @@ -36,6 +36,7 @@ Order.JSON_PROPERTY_STATUS, Order.JSON_PROPERTY_COMPLETE }) +@JsonTypeName("Order") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Order { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/OuterComposite.java index 01d6299649fd..5065b8e6326c 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -33,6 +33,7 @@ OuterComposite.JSON_PROPERTY_MY_STRING, OuterComposite.JSON_PROPERTY_MY_BOOLEAN }) +@JsonTypeName("OuterComposite") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class OuterComposite { public static final String JSON_PROPERTY_MY_NUMBER = "my_number"; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Pet.java index 6a5bf52230d4..676bb150cf46 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Pet.java @@ -41,6 +41,7 @@ Pet.JSON_PROPERTY_TAGS, Pet.JSON_PROPERTY_STATUS }) +@JsonTypeName("Pet") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Pet { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index 938b1ab5306d..10615e92497a 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -31,6 +31,7 @@ ReadOnlyFirst.JSON_PROPERTY_BAR, ReadOnlyFirst.JSON_PROPERTY_BAZ }) +@JsonTypeName("ReadOnlyFirst") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ReadOnlyFirst { public static final String JSON_PROPERTY_BAR = "bar"; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/SpecialModelName.java index 0e689d7d2dc2..b41f654fab88 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -30,6 +30,7 @@ @JsonPropertyOrder({ SpecialModelName.JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME }) +@JsonTypeName("$special[model.name]") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SpecialModelName { public static final String JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME = "$special[property.name]"; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Tag.java index 09eb968690dd..d551564e69cc 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Tag.java @@ -31,6 +31,7 @@ Tag.JSON_PROPERTY_ID, Tag.JSON_PROPERTY_NAME }) +@JsonTypeName("Tag") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Tag { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index 7591858f5a42..eea3eb5d325e 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -37,6 +37,7 @@ TypeHolderDefault.JSON_PROPERTY_BOOL_ITEM, TypeHolderDefault.JSON_PROPERTY_ARRAY_ITEM }) +@JsonTypeName("TypeHolderDefault") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TypeHolderDefault { public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/TypeHolderExample.java index 7d40ec56e6f1..744c4c540413 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -38,6 +38,7 @@ TypeHolderExample.JSON_PROPERTY_BOOL_ITEM, TypeHolderExample.JSON_PROPERTY_ARRAY_ITEM }) +@JsonTypeName("TypeHolderExample") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TypeHolderExample { public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/User.java index 68d6a47d486d..0f0e9cbde49a 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/User.java @@ -37,6 +37,7 @@ User.JSON_PROPERTY_PHONE, User.JSON_PROPERTY_USER_STATUS }) +@JsonTypeName("User") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class User { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/XmlItem.java index cac71c7221b0..b4d37be1ec11 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/XmlItem.java @@ -61,6 +61,7 @@ XmlItem.JSON_PROPERTY_PREFIX_NS_ARRAY, XmlItem.JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY }) +@JsonTypeName("XmlItem") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class XmlItem { public static final String JSON_PROPERTY_ATTRIBUTE_STRING = "attribute_string"; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index 5ebe1c8ee184..b83841542978 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -32,6 +32,7 @@ @JsonPropertyOrder({ AdditionalPropertiesAnyType.JSON_PROPERTY_NAME }) +@JsonTypeName("AdditionalPropertiesAnyType") @javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesAnyType extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index f914c4e3fcb3..451fb921ed92 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -33,6 +33,7 @@ @JsonPropertyOrder({ AdditionalPropertiesArray.JSON_PROPERTY_NAME }) +@JsonTypeName("AdditionalPropertiesArray") @javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesArray extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index 487cf1fc561b..5e0a8bf1775c 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -32,6 +32,7 @@ @JsonPropertyOrder({ AdditionalPropertiesBoolean.JSON_PROPERTY_NAME }) +@JsonTypeName("AdditionalPropertiesBoolean") @javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesBoolean extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index 9cb9ec3b910c..850655a7bf5f 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -44,6 +44,7 @@ AdditionalPropertiesClass.JSON_PROPERTY_ANYTYPE2, AdditionalPropertiesClass.JSON_PROPERTY_ANYTYPE3 }) +@JsonTypeName("AdditionalPropertiesClass") @javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesClass { public static final String JSON_PROPERTY_MAP_STRING = "map_string"; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index 02af190b86fe..6d227683f21e 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -32,6 +32,7 @@ @JsonPropertyOrder({ AdditionalPropertiesInteger.JSON_PROPERTY_NAME }) +@JsonTypeName("AdditionalPropertiesInteger") @javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesInteger extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index a16182f31fe4..7e4c01b58fe3 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -33,6 +33,7 @@ @JsonPropertyOrder({ AdditionalPropertiesNumber.JSON_PROPERTY_NAME }) +@JsonTypeName("AdditionalPropertiesNumber") @javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesNumber extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index 0e95700279e0..f36d34a0a550 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -32,6 +32,7 @@ @JsonPropertyOrder({ AdditionalPropertiesObject.JSON_PROPERTY_NAME }) +@JsonTypeName("AdditionalPropertiesObject") @javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesObject extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index f271d047b66c..404c9afac7bb 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -32,6 +32,7 @@ @JsonPropertyOrder({ AdditionalPropertiesString.JSON_PROPERTY_NAME }) +@JsonTypeName("AdditionalPropertiesString") @javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesString extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Animal.java index b1696a153132..e7fcffafcaf6 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Animal.java @@ -36,6 +36,7 @@ Animal.JSON_PROPERTY_CLASS_NAME, Animal.JSON_PROPERTY_COLOR }) +@JsonTypeName("Animal") @javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) @JsonSubTypes({ diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index d5ec3bd25a50..ff29cbd649b3 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -33,6 +33,7 @@ @JsonPropertyOrder({ ArrayOfArrayOfNumberOnly.JSON_PROPERTY_ARRAY_ARRAY_NUMBER }) +@JsonTypeName("ArrayOfArrayOfNumberOnly") @javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ArrayOfArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 35faf6703996..218df7863443 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -33,6 +33,7 @@ @JsonPropertyOrder({ ArrayOfNumberOnly.JSON_PROPERTY_ARRAY_NUMBER }) +@JsonTypeName("ArrayOfNumberOnly") @javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber"; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ArrayTest.java index e2072043de95..b02f5bc78590 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -35,6 +35,7 @@ ArrayTest.JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER, ArrayTest.JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL }) +@JsonTypeName("ArrayTest") @javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ArrayTest { public static final String JSON_PROPERTY_ARRAY_OF_STRING = "array_of_string"; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/BigCat.java index 977dfe8c7a07..cc33fb0e900f 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/BigCat.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/BigCat.java @@ -34,6 +34,7 @@ @JsonPropertyOrder({ BigCat.JSON_PROPERTY_KIND }) +@JsonTypeName("BigCat") @javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/BigCatAllOf.java index 06ea3367a308..94578707ba6e 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/BigCatAllOf.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -30,6 +30,7 @@ @JsonPropertyOrder({ BigCatAllOf.JSON_PROPERTY_KIND }) +@JsonTypeName("BigCat_allOf") @javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class BigCatAllOf { /** diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Capitalization.java index e2f6f53c30e0..8ba2c2edfe1e 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Capitalization.java @@ -35,6 +35,7 @@ Capitalization.JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS, Capitalization.JSON_PROPERTY_A_T_T_N_A_M_E }) +@JsonTypeName("Capitalization") @javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Capitalization { public static final String JSON_PROPERTY_SMALL_CAMEL = "smallCamel"; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Cat.java index e2a016871bda..1b1f719eed5f 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Cat.java @@ -35,6 +35,7 @@ @JsonPropertyOrder({ Cat.JSON_PROPERTY_DECLAWED }) +@JsonTypeName("Cat") @javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) @JsonSubTypes({ diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/CatAllOf.java index 599d25f19a98..59265384ceb9 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -30,6 +30,7 @@ @JsonPropertyOrder({ CatAllOf.JSON_PROPERTY_DECLAWED }) +@JsonTypeName("Cat_allOf") @javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class CatAllOf { public static final String JSON_PROPERTY_DECLAWED = "declawed"; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Category.java index 59fd6769b8f2..2d0635698d0d 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Category.java @@ -31,6 +31,7 @@ Category.JSON_PROPERTY_ID, Category.JSON_PROPERTY_NAME }) +@JsonTypeName("Category") @javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Category { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ClassModel.java index 66097484b812..a2f379a4fcc9 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ClassModel.java @@ -31,6 +31,7 @@ @JsonPropertyOrder({ ClassModel.JSON_PROPERTY_PROPERTY_CLASS }) +@JsonTypeName("ClassModel") @javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ClassModel { public static final String JSON_PROPERTY_PROPERTY_CLASS = "_class"; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Client.java index 722ebd547150..16c5b1878679 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Client.java @@ -30,6 +30,7 @@ @JsonPropertyOrder({ Client.JSON_PROPERTY_CLIENT }) +@JsonTypeName("Client") @javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Client { public static final String JSON_PROPERTY_CLIENT = "client"; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Dog.java index 7a35b22a2193..a7d4d0bb67da 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Dog.java @@ -34,6 +34,7 @@ @JsonPropertyOrder({ Dog.JSON_PROPERTY_BREED }) +@JsonTypeName("Dog") @javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/DogAllOf.java index 84ccb965aa83..a2da595e2408 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -30,6 +30,7 @@ @JsonPropertyOrder({ DogAllOf.JSON_PROPERTY_BREED }) +@JsonTypeName("Dog_allOf") @javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class DogAllOf { public static final String JSON_PROPERTY_BREED = "breed"; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/EnumArrays.java index c7d655942e59..a879a1a5818c 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -33,6 +33,7 @@ EnumArrays.JSON_PROPERTY_JUST_SYMBOL, EnumArrays.JSON_PROPERTY_ARRAY_ENUM }) +@JsonTypeName("EnumArrays") @javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class EnumArrays { /** diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/EnumTest.java index 228f40c25a5f..aa566c522fb6 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/EnumTest.java @@ -35,6 +35,7 @@ EnumTest.JSON_PROPERTY_ENUM_NUMBER, EnumTest.JSON_PROPERTY_OUTER_ENUM }) +@JsonTypeName("Enum_Test") @javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class EnumTest { /** diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index b63dd70b9fcb..61bc8afe5cad 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -33,6 +33,7 @@ FileSchemaTestClass.JSON_PROPERTY_FILE, FileSchemaTestClass.JSON_PROPERTY_FILES }) +@JsonTypeName("FileSchemaTestClass") @javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class FileSchemaTestClass { public static final String JSON_PROPERTY_FILE = "file"; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/FormatTest.java index b1ff8f62848d..30b5485ed4bf 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/FormatTest.java @@ -48,6 +48,7 @@ FormatTest.JSON_PROPERTY_PASSWORD, FormatTest.JSON_PROPERTY_BIG_DECIMAL }) +@JsonTypeName("format_test") @javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class FormatTest { public static final String JSON_PROPERTY_INTEGER = "integer"; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index d97638b9718c..cb3f7e2df65d 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -31,6 +31,7 @@ HasOnlyReadOnly.JSON_PROPERTY_BAR, HasOnlyReadOnly.JSON_PROPERTY_FOO }) +@JsonTypeName("hasOnlyReadOnly") @javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class HasOnlyReadOnly { public static final String JSON_PROPERTY_BAR = "bar"; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/MapTest.java index 6526c3b9e0e4..941d0948f52b 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/MapTest.java @@ -36,6 +36,7 @@ MapTest.JSON_PROPERTY_DIRECT_MAP, MapTest.JSON_PROPERTY_INDIRECT_MAP }) +@JsonTypeName("MapTest") @javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class MapTest { public static final String JSON_PROPERTY_MAP_MAP_OF_STRING = "map_map_of_string"; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index c0b5421506ab..e6a3e833e887 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -38,6 +38,7 @@ MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_DATE_TIME, MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_MAP }) +@JsonTypeName("MixedPropertiesAndAdditionalPropertiesClass") @javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class MixedPropertiesAndAdditionalPropertiesClass { public static final String JSON_PROPERTY_UUID = "uuid"; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Model200Response.java index 580ba9ec0825..407654ced87a 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Model200Response.java @@ -32,6 +32,7 @@ Model200Response.JSON_PROPERTY_NAME, Model200Response.JSON_PROPERTY_PROPERTY_CLASS }) +@JsonTypeName("200_response") @javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Model200Response { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ModelApiResponse.java index b04a200f7065..73130efae9c7 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -32,6 +32,7 @@ ModelApiResponse.JSON_PROPERTY_TYPE, ModelApiResponse.JSON_PROPERTY_MESSAGE }) +@JsonTypeName("ApiResponse") @javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ModelApiResponse { public static final String JSON_PROPERTY_CODE = "code"; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ModelReturn.java index d305142f664b..531db822e91f 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -31,6 +31,7 @@ @JsonPropertyOrder({ ModelReturn.JSON_PROPERTY_RETURN }) +@JsonTypeName("Return") @javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ModelReturn { public static final String JSON_PROPERTY_RETURN = "return"; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Name.java index f0ec7081f203..129237744f14 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Name.java @@ -34,6 +34,7 @@ Name.JSON_PROPERTY_PROPERTY, Name.JSON_PROPERTY_123NUMBER }) +@JsonTypeName("Name") @javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Name { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/NumberOnly.java index c824c8f32fc1..3a778f12b7af 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -31,6 +31,7 @@ @JsonPropertyOrder({ NumberOnly.JSON_PROPERTY_JUST_NUMBER }) +@JsonTypeName("NumberOnly") @javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class NumberOnly { public static final String JSON_PROPERTY_JUST_NUMBER = "JustNumber"; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Order.java index 11fa861b7ed0..d8c645687831 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Order.java @@ -36,6 +36,7 @@ Order.JSON_PROPERTY_STATUS, Order.JSON_PROPERTY_COMPLETE }) +@JsonTypeName("Order") @javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Order { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/OuterComposite.java index c9cf98b070ad..e9521e72e13a 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -33,6 +33,7 @@ OuterComposite.JSON_PROPERTY_MY_STRING, OuterComposite.JSON_PROPERTY_MY_BOOLEAN }) +@JsonTypeName("OuterComposite") @javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class OuterComposite { public static final String JSON_PROPERTY_MY_NUMBER = "my_number"; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Pet.java index 8497783b5080..2656090a8dc2 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Pet.java @@ -41,6 +41,7 @@ Pet.JSON_PROPERTY_TAGS, Pet.JSON_PROPERTY_STATUS }) +@JsonTypeName("Pet") @javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Pet { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index eadfaa844491..a81634890633 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -31,6 +31,7 @@ ReadOnlyFirst.JSON_PROPERTY_BAR, ReadOnlyFirst.JSON_PROPERTY_BAZ }) +@JsonTypeName("ReadOnlyFirst") @javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ReadOnlyFirst { public static final String JSON_PROPERTY_BAR = "bar"; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/SpecialModelName.java index fd40afb48470..6bb2ab837318 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -30,6 +30,7 @@ @JsonPropertyOrder({ SpecialModelName.JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME }) +@JsonTypeName("$special[model.name]") @javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SpecialModelName { public static final String JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME = "$special[property.name]"; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Tag.java index 83ef3325718a..d04c324a3531 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/Tag.java @@ -31,6 +31,7 @@ Tag.JSON_PROPERTY_ID, Tag.JSON_PROPERTY_NAME }) +@JsonTypeName("Tag") @javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Tag { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index 1b4ced9e2b3a..685a6d6cec6c 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -37,6 +37,7 @@ TypeHolderDefault.JSON_PROPERTY_BOOL_ITEM, TypeHolderDefault.JSON_PROPERTY_ARRAY_ITEM }) +@JsonTypeName("TypeHolderDefault") @javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TypeHolderDefault { public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/TypeHolderExample.java index 05b715a11110..c21bf8dde8aa 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -38,6 +38,7 @@ TypeHolderExample.JSON_PROPERTY_BOOL_ITEM, TypeHolderExample.JSON_PROPERTY_ARRAY_ITEM }) +@JsonTypeName("TypeHolderExample") @javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TypeHolderExample { public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/User.java index 278b837b1afe..73c4374a992f 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/User.java @@ -37,6 +37,7 @@ User.JSON_PROPERTY_PHONE, User.JSON_PROPERTY_USER_STATUS }) +@JsonTypeName("User") @javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class User { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/XmlItem.java index 98c0531d95ed..39be9f2a5358 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/XmlItem.java @@ -61,6 +61,7 @@ XmlItem.JSON_PROPERTY_PREFIX_NS_ARRAY, XmlItem.JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY }) +@JsonTypeName("XmlItem") @javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class XmlItem { public static final String JSON_PROPERTY_ATTRIBUTE_STRING = "attribute_string"; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index 5ebe1c8ee184..b83841542978 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -32,6 +32,7 @@ @JsonPropertyOrder({ AdditionalPropertiesAnyType.JSON_PROPERTY_NAME }) +@JsonTypeName("AdditionalPropertiesAnyType") @javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesAnyType extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index f914c4e3fcb3..451fb921ed92 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -33,6 +33,7 @@ @JsonPropertyOrder({ AdditionalPropertiesArray.JSON_PROPERTY_NAME }) +@JsonTypeName("AdditionalPropertiesArray") @javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesArray extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index 487cf1fc561b..5e0a8bf1775c 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -32,6 +32,7 @@ @JsonPropertyOrder({ AdditionalPropertiesBoolean.JSON_PROPERTY_NAME }) +@JsonTypeName("AdditionalPropertiesBoolean") @javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesBoolean extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index 9cb9ec3b910c..850655a7bf5f 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -44,6 +44,7 @@ AdditionalPropertiesClass.JSON_PROPERTY_ANYTYPE2, AdditionalPropertiesClass.JSON_PROPERTY_ANYTYPE3 }) +@JsonTypeName("AdditionalPropertiesClass") @javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesClass { public static final String JSON_PROPERTY_MAP_STRING = "map_string"; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index 02af190b86fe..6d227683f21e 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -32,6 +32,7 @@ @JsonPropertyOrder({ AdditionalPropertiesInteger.JSON_PROPERTY_NAME }) +@JsonTypeName("AdditionalPropertiesInteger") @javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesInteger extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index a16182f31fe4..7e4c01b58fe3 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -33,6 +33,7 @@ @JsonPropertyOrder({ AdditionalPropertiesNumber.JSON_PROPERTY_NAME }) +@JsonTypeName("AdditionalPropertiesNumber") @javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesNumber extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index 0e95700279e0..f36d34a0a550 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -32,6 +32,7 @@ @JsonPropertyOrder({ AdditionalPropertiesObject.JSON_PROPERTY_NAME }) +@JsonTypeName("AdditionalPropertiesObject") @javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesObject extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index f271d047b66c..404c9afac7bb 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -32,6 +32,7 @@ @JsonPropertyOrder({ AdditionalPropertiesString.JSON_PROPERTY_NAME }) +@JsonTypeName("AdditionalPropertiesString") @javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesString extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Animal.java index b1696a153132..e7fcffafcaf6 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Animal.java @@ -36,6 +36,7 @@ Animal.JSON_PROPERTY_CLASS_NAME, Animal.JSON_PROPERTY_COLOR }) +@JsonTypeName("Animal") @javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) @JsonSubTypes({ diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index d5ec3bd25a50..ff29cbd649b3 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -33,6 +33,7 @@ @JsonPropertyOrder({ ArrayOfArrayOfNumberOnly.JSON_PROPERTY_ARRAY_ARRAY_NUMBER }) +@JsonTypeName("ArrayOfArrayOfNumberOnly") @javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ArrayOfArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 35faf6703996..218df7863443 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -33,6 +33,7 @@ @JsonPropertyOrder({ ArrayOfNumberOnly.JSON_PROPERTY_ARRAY_NUMBER }) +@JsonTypeName("ArrayOfNumberOnly") @javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber"; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ArrayTest.java index e2072043de95..b02f5bc78590 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -35,6 +35,7 @@ ArrayTest.JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER, ArrayTest.JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL }) +@JsonTypeName("ArrayTest") @javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ArrayTest { public static final String JSON_PROPERTY_ARRAY_OF_STRING = "array_of_string"; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/BigCat.java index 977dfe8c7a07..cc33fb0e900f 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/BigCat.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/BigCat.java @@ -34,6 +34,7 @@ @JsonPropertyOrder({ BigCat.JSON_PROPERTY_KIND }) +@JsonTypeName("BigCat") @javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/BigCatAllOf.java index 06ea3367a308..94578707ba6e 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/BigCatAllOf.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -30,6 +30,7 @@ @JsonPropertyOrder({ BigCatAllOf.JSON_PROPERTY_KIND }) +@JsonTypeName("BigCat_allOf") @javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class BigCatAllOf { /** diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Capitalization.java index e2f6f53c30e0..8ba2c2edfe1e 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Capitalization.java @@ -35,6 +35,7 @@ Capitalization.JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS, Capitalization.JSON_PROPERTY_A_T_T_N_A_M_E }) +@JsonTypeName("Capitalization") @javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Capitalization { public static final String JSON_PROPERTY_SMALL_CAMEL = "smallCamel"; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Cat.java index e2a016871bda..1b1f719eed5f 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Cat.java @@ -35,6 +35,7 @@ @JsonPropertyOrder({ Cat.JSON_PROPERTY_DECLAWED }) +@JsonTypeName("Cat") @javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) @JsonSubTypes({ diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/CatAllOf.java index 599d25f19a98..59265384ceb9 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -30,6 +30,7 @@ @JsonPropertyOrder({ CatAllOf.JSON_PROPERTY_DECLAWED }) +@JsonTypeName("Cat_allOf") @javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class CatAllOf { public static final String JSON_PROPERTY_DECLAWED = "declawed"; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Category.java index 59fd6769b8f2..2d0635698d0d 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Category.java @@ -31,6 +31,7 @@ Category.JSON_PROPERTY_ID, Category.JSON_PROPERTY_NAME }) +@JsonTypeName("Category") @javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Category { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ClassModel.java index 66097484b812..a2f379a4fcc9 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ClassModel.java @@ -31,6 +31,7 @@ @JsonPropertyOrder({ ClassModel.JSON_PROPERTY_PROPERTY_CLASS }) +@JsonTypeName("ClassModel") @javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ClassModel { public static final String JSON_PROPERTY_PROPERTY_CLASS = "_class"; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Client.java index 722ebd547150..16c5b1878679 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Client.java @@ -30,6 +30,7 @@ @JsonPropertyOrder({ Client.JSON_PROPERTY_CLIENT }) +@JsonTypeName("Client") @javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Client { public static final String JSON_PROPERTY_CLIENT = "client"; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Dog.java index 7a35b22a2193..a7d4d0bb67da 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Dog.java @@ -34,6 +34,7 @@ @JsonPropertyOrder({ Dog.JSON_PROPERTY_BREED }) +@JsonTypeName("Dog") @javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/DogAllOf.java index 84ccb965aa83..a2da595e2408 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -30,6 +30,7 @@ @JsonPropertyOrder({ DogAllOf.JSON_PROPERTY_BREED }) +@JsonTypeName("Dog_allOf") @javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class DogAllOf { public static final String JSON_PROPERTY_BREED = "breed"; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/EnumArrays.java index c7d655942e59..a879a1a5818c 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -33,6 +33,7 @@ EnumArrays.JSON_PROPERTY_JUST_SYMBOL, EnumArrays.JSON_PROPERTY_ARRAY_ENUM }) +@JsonTypeName("EnumArrays") @javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class EnumArrays { /** diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/EnumTest.java index 228f40c25a5f..aa566c522fb6 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/EnumTest.java @@ -35,6 +35,7 @@ EnumTest.JSON_PROPERTY_ENUM_NUMBER, EnumTest.JSON_PROPERTY_OUTER_ENUM }) +@JsonTypeName("Enum_Test") @javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class EnumTest { /** diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index b63dd70b9fcb..61bc8afe5cad 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -33,6 +33,7 @@ FileSchemaTestClass.JSON_PROPERTY_FILE, FileSchemaTestClass.JSON_PROPERTY_FILES }) +@JsonTypeName("FileSchemaTestClass") @javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class FileSchemaTestClass { public static final String JSON_PROPERTY_FILE = "file"; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/FormatTest.java index b1ff8f62848d..30b5485ed4bf 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/FormatTest.java @@ -48,6 +48,7 @@ FormatTest.JSON_PROPERTY_PASSWORD, FormatTest.JSON_PROPERTY_BIG_DECIMAL }) +@JsonTypeName("format_test") @javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class FormatTest { public static final String JSON_PROPERTY_INTEGER = "integer"; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index d97638b9718c..cb3f7e2df65d 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -31,6 +31,7 @@ HasOnlyReadOnly.JSON_PROPERTY_BAR, HasOnlyReadOnly.JSON_PROPERTY_FOO }) +@JsonTypeName("hasOnlyReadOnly") @javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class HasOnlyReadOnly { public static final String JSON_PROPERTY_BAR = "bar"; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/MapTest.java index 6526c3b9e0e4..941d0948f52b 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/MapTest.java @@ -36,6 +36,7 @@ MapTest.JSON_PROPERTY_DIRECT_MAP, MapTest.JSON_PROPERTY_INDIRECT_MAP }) +@JsonTypeName("MapTest") @javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class MapTest { public static final String JSON_PROPERTY_MAP_MAP_OF_STRING = "map_map_of_string"; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index c0b5421506ab..e6a3e833e887 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -38,6 +38,7 @@ MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_DATE_TIME, MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_MAP }) +@JsonTypeName("MixedPropertiesAndAdditionalPropertiesClass") @javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class MixedPropertiesAndAdditionalPropertiesClass { public static final String JSON_PROPERTY_UUID = "uuid"; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Model200Response.java index 580ba9ec0825..407654ced87a 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Model200Response.java @@ -32,6 +32,7 @@ Model200Response.JSON_PROPERTY_NAME, Model200Response.JSON_PROPERTY_PROPERTY_CLASS }) +@JsonTypeName("200_response") @javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Model200Response { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ModelApiResponse.java index b04a200f7065..73130efae9c7 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -32,6 +32,7 @@ ModelApiResponse.JSON_PROPERTY_TYPE, ModelApiResponse.JSON_PROPERTY_MESSAGE }) +@JsonTypeName("ApiResponse") @javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ModelApiResponse { public static final String JSON_PROPERTY_CODE = "code"; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ModelReturn.java index d305142f664b..531db822e91f 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -31,6 +31,7 @@ @JsonPropertyOrder({ ModelReturn.JSON_PROPERTY_RETURN }) +@JsonTypeName("Return") @javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ModelReturn { public static final String JSON_PROPERTY_RETURN = "return"; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Name.java index f0ec7081f203..129237744f14 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Name.java @@ -34,6 +34,7 @@ Name.JSON_PROPERTY_PROPERTY, Name.JSON_PROPERTY_123NUMBER }) +@JsonTypeName("Name") @javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Name { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/NumberOnly.java index c824c8f32fc1..3a778f12b7af 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -31,6 +31,7 @@ @JsonPropertyOrder({ NumberOnly.JSON_PROPERTY_JUST_NUMBER }) +@JsonTypeName("NumberOnly") @javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class NumberOnly { public static final String JSON_PROPERTY_JUST_NUMBER = "JustNumber"; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Order.java index 11fa861b7ed0..d8c645687831 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Order.java @@ -36,6 +36,7 @@ Order.JSON_PROPERTY_STATUS, Order.JSON_PROPERTY_COMPLETE }) +@JsonTypeName("Order") @javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Order { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/OuterComposite.java index c9cf98b070ad..e9521e72e13a 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -33,6 +33,7 @@ OuterComposite.JSON_PROPERTY_MY_STRING, OuterComposite.JSON_PROPERTY_MY_BOOLEAN }) +@JsonTypeName("OuterComposite") @javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class OuterComposite { public static final String JSON_PROPERTY_MY_NUMBER = "my_number"; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Pet.java index 8497783b5080..2656090a8dc2 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Pet.java @@ -41,6 +41,7 @@ Pet.JSON_PROPERTY_TAGS, Pet.JSON_PROPERTY_STATUS }) +@JsonTypeName("Pet") @javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Pet { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index eadfaa844491..a81634890633 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -31,6 +31,7 @@ ReadOnlyFirst.JSON_PROPERTY_BAR, ReadOnlyFirst.JSON_PROPERTY_BAZ }) +@JsonTypeName("ReadOnlyFirst") @javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ReadOnlyFirst { public static final String JSON_PROPERTY_BAR = "bar"; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/SpecialModelName.java index fd40afb48470..6bb2ab837318 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -30,6 +30,7 @@ @JsonPropertyOrder({ SpecialModelName.JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME }) +@JsonTypeName("$special[model.name]") @javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SpecialModelName { public static final String JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME = "$special[property.name]"; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Tag.java index 83ef3325718a..d04c324a3531 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Tag.java @@ -31,6 +31,7 @@ Tag.JSON_PROPERTY_ID, Tag.JSON_PROPERTY_NAME }) +@JsonTypeName("Tag") @javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Tag { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index 1b4ced9e2b3a..685a6d6cec6c 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -37,6 +37,7 @@ TypeHolderDefault.JSON_PROPERTY_BOOL_ITEM, TypeHolderDefault.JSON_PROPERTY_ARRAY_ITEM }) +@JsonTypeName("TypeHolderDefault") @javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TypeHolderDefault { public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/TypeHolderExample.java index 05b715a11110..c21bf8dde8aa 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -38,6 +38,7 @@ TypeHolderExample.JSON_PROPERTY_BOOL_ITEM, TypeHolderExample.JSON_PROPERTY_ARRAY_ITEM }) +@JsonTypeName("TypeHolderExample") @javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TypeHolderExample { public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/User.java index 278b837b1afe..73c4374a992f 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/User.java @@ -37,6 +37,7 @@ User.JSON_PROPERTY_PHONE, User.JSON_PROPERTY_USER_STATUS }) +@JsonTypeName("User") @javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class User { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/XmlItem.java index 98c0531d95ed..39be9f2a5358 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/XmlItem.java @@ -61,6 +61,7 @@ XmlItem.JSON_PROPERTY_PREFIX_NS_ARRAY, XmlItem.JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY }) +@JsonTypeName("XmlItem") @javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class XmlItem { public static final String JSON_PROPERTY_ATTRIBUTE_STRING = "attribute_string"; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index 8a8cbcb21369..369c9055890a 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -35,6 +35,7 @@ @JsonPropertyOrder({ AdditionalPropertiesAnyType.JSON_PROPERTY_NAME }) +@JsonTypeName("AdditionalPropertiesAnyType") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesAnyType extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index 8351a9f6bd94..71f66209c53d 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -36,6 +36,7 @@ @JsonPropertyOrder({ AdditionalPropertiesArray.JSON_PROPERTY_NAME }) +@JsonTypeName("AdditionalPropertiesArray") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesArray extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index 6d4ba919e2ad..3ce97ede5f80 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -35,6 +35,7 @@ @JsonPropertyOrder({ AdditionalPropertiesBoolean.JSON_PROPERTY_NAME }) +@JsonTypeName("AdditionalPropertiesBoolean") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesBoolean extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index ea6367b321bf..a82fc748f3db 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -47,6 +47,7 @@ AdditionalPropertiesClass.JSON_PROPERTY_ANYTYPE2, AdditionalPropertiesClass.JSON_PROPERTY_ANYTYPE3 }) +@JsonTypeName("AdditionalPropertiesClass") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesClass { public static final String JSON_PROPERTY_MAP_STRING = "map_string"; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index 097ad92a8ea7..ea64c8e86a97 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -35,6 +35,7 @@ @JsonPropertyOrder({ AdditionalPropertiesInteger.JSON_PROPERTY_NAME }) +@JsonTypeName("AdditionalPropertiesInteger") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesInteger extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index 58e6beefb673..11a6c6dbf3ee 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -36,6 +36,7 @@ @JsonPropertyOrder({ AdditionalPropertiesNumber.JSON_PROPERTY_NAME }) +@JsonTypeName("AdditionalPropertiesNumber") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesNumber extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index bdd98a66c5f1..d229b08588d7 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -35,6 +35,7 @@ @JsonPropertyOrder({ AdditionalPropertiesObject.JSON_PROPERTY_NAME }) +@JsonTypeName("AdditionalPropertiesObject") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesObject extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index dcedade3e056..50f9a1828d01 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -35,6 +35,7 @@ @JsonPropertyOrder({ AdditionalPropertiesString.JSON_PROPERTY_NAME }) +@JsonTypeName("AdditionalPropertiesString") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesString extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Animal.java index 6000099c10a8..67c8842108a5 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Animal.java @@ -39,6 +39,7 @@ Animal.JSON_PROPERTY_CLASS_NAME, Animal.JSON_PROPERTY_COLOR }) +@JsonTypeName("Animal") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) @JsonSubTypes({ diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index 496074f932e7..542a0399ed77 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -36,6 +36,7 @@ @JsonPropertyOrder({ ArrayOfArrayOfNumberOnly.JSON_PROPERTY_ARRAY_ARRAY_NUMBER }) +@JsonTypeName("ArrayOfArrayOfNumberOnly") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ArrayOfArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index b708449a3f43..9fe646bac81c 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -36,6 +36,7 @@ @JsonPropertyOrder({ ArrayOfNumberOnly.JSON_PROPERTY_ARRAY_NUMBER }) +@JsonTypeName("ArrayOfNumberOnly") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber"; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ArrayTest.java index 62ea923ecd82..bb83a4975ed4 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -38,6 +38,7 @@ ArrayTest.JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER, ArrayTest.JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL }) +@JsonTypeName("ArrayTest") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ArrayTest { public static final String JSON_PROPERTY_ARRAY_OF_STRING = "array_of_string"; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/BigCat.java index 55b712b372b9..49c0f1fb11ed 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/BigCat.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/BigCat.java @@ -37,6 +37,7 @@ @JsonPropertyOrder({ BigCat.JSON_PROPERTY_KIND }) +@JsonTypeName("BigCat") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/BigCatAllOf.java index e16b2adb83fb..c1a12c8bf454 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/BigCatAllOf.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -33,6 +33,7 @@ @JsonPropertyOrder({ BigCatAllOf.JSON_PROPERTY_KIND }) +@JsonTypeName("BigCat_allOf") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class BigCatAllOf { /** diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Capitalization.java index 39a7a2222286..173870c2d266 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Capitalization.java @@ -38,6 +38,7 @@ Capitalization.JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS, Capitalization.JSON_PROPERTY_A_T_T_N_A_M_E }) +@JsonTypeName("Capitalization") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Capitalization { public static final String JSON_PROPERTY_SMALL_CAMEL = "smallCamel"; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Cat.java index ad57bdd07c45..bee1425ff99e 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Cat.java @@ -38,6 +38,7 @@ @JsonPropertyOrder({ Cat.JSON_PROPERTY_DECLAWED }) +@JsonTypeName("Cat") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) @JsonSubTypes({ diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/CatAllOf.java index 5e7b5db80f80..ac424799ed43 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -33,6 +33,7 @@ @JsonPropertyOrder({ CatAllOf.JSON_PROPERTY_DECLAWED }) +@JsonTypeName("Cat_allOf") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class CatAllOf { public static final String JSON_PROPERTY_DECLAWED = "declawed"; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Category.java index 27fbb540578b..ccd9f93c5849 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Category.java @@ -34,6 +34,7 @@ Category.JSON_PROPERTY_ID, Category.JSON_PROPERTY_NAME }) +@JsonTypeName("Category") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Category { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ClassModel.java index f8de7e1af7cb..a3a74f29d380 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ClassModel.java @@ -34,6 +34,7 @@ @JsonPropertyOrder({ ClassModel.JSON_PROPERTY_PROPERTY_CLASS }) +@JsonTypeName("ClassModel") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ClassModel { public static final String JSON_PROPERTY_PROPERTY_CLASS = "_class"; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Client.java index fdabdf1a4a60..4d328806bea5 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Client.java @@ -33,6 +33,7 @@ @JsonPropertyOrder({ Client.JSON_PROPERTY_CLIENT }) +@JsonTypeName("Client") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Client { public static final String JSON_PROPERTY_CLIENT = "client"; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Dog.java index 5adb5c7fd329..e81d56c4f061 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Dog.java @@ -37,6 +37,7 @@ @JsonPropertyOrder({ Dog.JSON_PROPERTY_BREED }) +@JsonTypeName("Dog") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/DogAllOf.java index e0111656a3ab..deb268002a93 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -33,6 +33,7 @@ @JsonPropertyOrder({ DogAllOf.JSON_PROPERTY_BREED }) +@JsonTypeName("Dog_allOf") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class DogAllOf { public static final String JSON_PROPERTY_BREED = "breed"; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/EnumArrays.java index 86cf02f315c2..951183417dbd 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -36,6 +36,7 @@ EnumArrays.JSON_PROPERTY_JUST_SYMBOL, EnumArrays.JSON_PROPERTY_ARRAY_ENUM }) +@JsonTypeName("EnumArrays") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class EnumArrays { /** diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/EnumTest.java index 7db84922f2e4..e8fa82b03542 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/EnumTest.java @@ -38,6 +38,7 @@ EnumTest.JSON_PROPERTY_ENUM_NUMBER, EnumTest.JSON_PROPERTY_OUTER_ENUM }) +@JsonTypeName("Enum_Test") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class EnumTest { /** diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index 8d4bbba1cca4..5ca05e38be1a 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -36,6 +36,7 @@ FileSchemaTestClass.JSON_PROPERTY_FILE, FileSchemaTestClass.JSON_PROPERTY_FILES }) +@JsonTypeName("FileSchemaTestClass") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class FileSchemaTestClass { public static final String JSON_PROPERTY_FILE = "file"; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/FormatTest.java index 46bbbee3d449..9602ed5d8f61 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/FormatTest.java @@ -51,6 +51,7 @@ FormatTest.JSON_PROPERTY_PASSWORD, FormatTest.JSON_PROPERTY_BIG_DECIMAL }) +@JsonTypeName("format_test") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class FormatTest { public static final String JSON_PROPERTY_INTEGER = "integer"; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index e1eef91976bd..0122ac4712e7 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -34,6 +34,7 @@ HasOnlyReadOnly.JSON_PROPERTY_BAR, HasOnlyReadOnly.JSON_PROPERTY_FOO }) +@JsonTypeName("hasOnlyReadOnly") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class HasOnlyReadOnly { public static final String JSON_PROPERTY_BAR = "bar"; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/MapTest.java index a62998d7dc90..f8f26d972aa5 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/MapTest.java @@ -39,6 +39,7 @@ MapTest.JSON_PROPERTY_DIRECT_MAP, MapTest.JSON_PROPERTY_INDIRECT_MAP }) +@JsonTypeName("MapTest") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class MapTest { public static final String JSON_PROPERTY_MAP_MAP_OF_STRING = "map_map_of_string"; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 7f05131c8a26..cac573fa8d73 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -41,6 +41,7 @@ MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_DATE_TIME, MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_MAP }) +@JsonTypeName("MixedPropertiesAndAdditionalPropertiesClass") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class MixedPropertiesAndAdditionalPropertiesClass { public static final String JSON_PROPERTY_UUID = "uuid"; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Model200Response.java index e9cded1a198d..7f0bd6d0a97e 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Model200Response.java @@ -35,6 +35,7 @@ Model200Response.JSON_PROPERTY_NAME, Model200Response.JSON_PROPERTY_PROPERTY_CLASS }) +@JsonTypeName("200_response") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Model200Response { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ModelApiResponse.java index 10b29e5ccd02..e4e9b9dbf4be 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -35,6 +35,7 @@ ModelApiResponse.JSON_PROPERTY_TYPE, ModelApiResponse.JSON_PROPERTY_MESSAGE }) +@JsonTypeName("ApiResponse") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ModelApiResponse { public static final String JSON_PROPERTY_CODE = "code"; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ModelReturn.java index 51543a59aa27..dd928b4ce535 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -34,6 +34,7 @@ @JsonPropertyOrder({ ModelReturn.JSON_PROPERTY_RETURN }) +@JsonTypeName("Return") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ModelReturn { public static final String JSON_PROPERTY_RETURN = "return"; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Name.java index cbaf054096e6..eb28bc295b58 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Name.java @@ -37,6 +37,7 @@ Name.JSON_PROPERTY_PROPERTY, Name.JSON_PROPERTY_123NUMBER }) +@JsonTypeName("Name") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Name { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/NumberOnly.java index 808c98571fad..3dd9b8242b78 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -34,6 +34,7 @@ @JsonPropertyOrder({ NumberOnly.JSON_PROPERTY_JUST_NUMBER }) +@JsonTypeName("NumberOnly") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class NumberOnly { public static final String JSON_PROPERTY_JUST_NUMBER = "JustNumber"; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Order.java index b3d94578008a..304097272600 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Order.java @@ -39,6 +39,7 @@ Order.JSON_PROPERTY_STATUS, Order.JSON_PROPERTY_COMPLETE }) +@JsonTypeName("Order") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Order { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/OuterComposite.java index d817fe339de1..86989454bbea 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -36,6 +36,7 @@ OuterComposite.JSON_PROPERTY_MY_STRING, OuterComposite.JSON_PROPERTY_MY_BOOLEAN }) +@JsonTypeName("OuterComposite") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class OuterComposite { public static final String JSON_PROPERTY_MY_NUMBER = "my_number"; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Pet.java index 96e32de0d7bf..e537e21c3963 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Pet.java @@ -44,6 +44,7 @@ Pet.JSON_PROPERTY_TAGS, Pet.JSON_PROPERTY_STATUS }) +@JsonTypeName("Pet") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Pet { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index ac3322d67042..d90bc2fb132d 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -34,6 +34,7 @@ ReadOnlyFirst.JSON_PROPERTY_BAR, ReadOnlyFirst.JSON_PROPERTY_BAZ }) +@JsonTypeName("ReadOnlyFirst") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ReadOnlyFirst { public static final String JSON_PROPERTY_BAR = "bar"; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/SpecialModelName.java index 65632ef87f1f..b6e97d4e5b81 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -33,6 +33,7 @@ @JsonPropertyOrder({ SpecialModelName.JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME }) +@JsonTypeName("$special[model.name]") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SpecialModelName { public static final String JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME = "$special[property.name]"; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Tag.java index e35043410b46..302e2555b67a 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Tag.java @@ -34,6 +34,7 @@ Tag.JSON_PROPERTY_ID, Tag.JSON_PROPERTY_NAME }) +@JsonTypeName("Tag") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Tag { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index eeff89514d4c..42c86a3a82f0 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -40,6 +40,7 @@ TypeHolderDefault.JSON_PROPERTY_BOOL_ITEM, TypeHolderDefault.JSON_PROPERTY_ARRAY_ITEM }) +@JsonTypeName("TypeHolderDefault") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TypeHolderDefault { public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/TypeHolderExample.java index 70e592bafc24..3cf28c8bf1ad 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -41,6 +41,7 @@ TypeHolderExample.JSON_PROPERTY_BOOL_ITEM, TypeHolderExample.JSON_PROPERTY_ARRAY_ITEM }) +@JsonTypeName("TypeHolderExample") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TypeHolderExample { public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/User.java index 73fcd3b05e5f..43803f81c9d8 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/User.java @@ -40,6 +40,7 @@ User.JSON_PROPERTY_PHONE, User.JSON_PROPERTY_USER_STATUS }) +@JsonTypeName("User") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class User { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/XmlItem.java index b33587769a7a..7df99e1cf3b9 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/XmlItem.java @@ -64,6 +64,7 @@ XmlItem.JSON_PROPERTY_PREFIX_NS_ARRAY, XmlItem.JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY }) +@JsonTypeName("XmlItem") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class XmlItem { public static final String JSON_PROPERTY_ATTRIBUTE_STRING = "attribute_string"; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index 8d2c7147bdb6..62b1da4c2f00 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -32,6 +32,7 @@ @JsonPropertyOrder({ AdditionalPropertiesAnyType.JSON_PROPERTY_NAME }) +@JsonTypeName("AdditionalPropertiesAnyType") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesAnyType extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index 79e87782bd2c..0115b4dd963b 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -33,6 +33,7 @@ @JsonPropertyOrder({ AdditionalPropertiesArray.JSON_PROPERTY_NAME }) +@JsonTypeName("AdditionalPropertiesArray") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesArray extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index 8c5bc6271da0..a430b6fc5729 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -32,6 +32,7 @@ @JsonPropertyOrder({ AdditionalPropertiesBoolean.JSON_PROPERTY_NAME }) +@JsonTypeName("AdditionalPropertiesBoolean") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesBoolean extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index ed7e62088290..69dabddfb145 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -44,6 +44,7 @@ AdditionalPropertiesClass.JSON_PROPERTY_ANYTYPE2, AdditionalPropertiesClass.JSON_PROPERTY_ANYTYPE3 }) +@JsonTypeName("AdditionalPropertiesClass") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesClass { public static final String JSON_PROPERTY_MAP_STRING = "map_string"; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index 41d50c58ceae..9f7587c2edf3 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -32,6 +32,7 @@ @JsonPropertyOrder({ AdditionalPropertiesInteger.JSON_PROPERTY_NAME }) +@JsonTypeName("AdditionalPropertiesInteger") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesInteger extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index 5b656c5825a4..9700dab2bd2b 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -33,6 +33,7 @@ @JsonPropertyOrder({ AdditionalPropertiesNumber.JSON_PROPERTY_NAME }) +@JsonTypeName("AdditionalPropertiesNumber") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesNumber extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index 2326f099b488..60a59e97a228 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -32,6 +32,7 @@ @JsonPropertyOrder({ AdditionalPropertiesObject.JSON_PROPERTY_NAME }) +@JsonTypeName("AdditionalPropertiesObject") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesObject extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index cde27cbad9fb..5d355241baf8 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -32,6 +32,7 @@ @JsonPropertyOrder({ AdditionalPropertiesString.JSON_PROPERTY_NAME }) +@JsonTypeName("AdditionalPropertiesString") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesString extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Animal.java index 9dc580215d1f..99d5797e86e8 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Animal.java @@ -36,6 +36,7 @@ Animal.JSON_PROPERTY_CLASS_NAME, Animal.JSON_PROPERTY_COLOR }) +@JsonTypeName("Animal") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) @JsonSubTypes({ diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index e8ab9ce9565c..dd0b5d8f55e2 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -33,6 +33,7 @@ @JsonPropertyOrder({ ArrayOfArrayOfNumberOnly.JSON_PROPERTY_ARRAY_ARRAY_NUMBER }) +@JsonTypeName("ArrayOfArrayOfNumberOnly") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ArrayOfArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 48afb5b470bd..e681cb5b8241 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -33,6 +33,7 @@ @JsonPropertyOrder({ ArrayOfNumberOnly.JSON_PROPERTY_ARRAY_NUMBER }) +@JsonTypeName("ArrayOfNumberOnly") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber"; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ArrayTest.java index 55935f343f5c..bdcc439a5ec4 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -35,6 +35,7 @@ ArrayTest.JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER, ArrayTest.JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL }) +@JsonTypeName("ArrayTest") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ArrayTest { public static final String JSON_PROPERTY_ARRAY_OF_STRING = "array_of_string"; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/BigCat.java index 864ec623e435..b3033deacc7d 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/BigCat.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/BigCat.java @@ -34,6 +34,7 @@ @JsonPropertyOrder({ BigCat.JSON_PROPERTY_KIND }) +@JsonTypeName("BigCat") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/BigCatAllOf.java index a22af0b67c02..6a3df7eafcaa 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/BigCatAllOf.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -30,6 +30,7 @@ @JsonPropertyOrder({ BigCatAllOf.JSON_PROPERTY_KIND }) +@JsonTypeName("BigCat_allOf") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class BigCatAllOf { /** diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Capitalization.java index c7ea7879dbef..6d7704bfba08 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Capitalization.java @@ -35,6 +35,7 @@ Capitalization.JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS, Capitalization.JSON_PROPERTY_A_T_T_N_A_M_E }) +@JsonTypeName("Capitalization") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Capitalization { public static final String JSON_PROPERTY_SMALL_CAMEL = "smallCamel"; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Cat.java index 664eb00008be..ed7d126fa5c7 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Cat.java @@ -35,6 +35,7 @@ @JsonPropertyOrder({ Cat.JSON_PROPERTY_DECLAWED }) +@JsonTypeName("Cat") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) @JsonSubTypes({ diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/CatAllOf.java index bbbb99689bdf..a90ea75ffb71 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -30,6 +30,7 @@ @JsonPropertyOrder({ CatAllOf.JSON_PROPERTY_DECLAWED }) +@JsonTypeName("Cat_allOf") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class CatAllOf { public static final String JSON_PROPERTY_DECLAWED = "declawed"; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Category.java index 5823854c4c9f..87a09fb2bae7 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Category.java @@ -31,6 +31,7 @@ Category.JSON_PROPERTY_ID, Category.JSON_PROPERTY_NAME }) +@JsonTypeName("Category") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Category { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ClassModel.java index 93445a9610c1..c4008f60e646 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ClassModel.java @@ -31,6 +31,7 @@ @JsonPropertyOrder({ ClassModel.JSON_PROPERTY_PROPERTY_CLASS }) +@JsonTypeName("ClassModel") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ClassModel { public static final String JSON_PROPERTY_PROPERTY_CLASS = "_class"; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Client.java index 2820a5517c90..013eeba9b6ec 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Client.java @@ -30,6 +30,7 @@ @JsonPropertyOrder({ Client.JSON_PROPERTY_CLIENT }) +@JsonTypeName("Client") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Client { public static final String JSON_PROPERTY_CLIENT = "client"; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Dog.java index d81430849bb3..5f29f08ac2e6 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Dog.java @@ -34,6 +34,7 @@ @JsonPropertyOrder({ Dog.JSON_PROPERTY_BREED }) +@JsonTypeName("Dog") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/DogAllOf.java index 21babf245444..c5af5ce9324b 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -30,6 +30,7 @@ @JsonPropertyOrder({ DogAllOf.JSON_PROPERTY_BREED }) +@JsonTypeName("Dog_allOf") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class DogAllOf { public static final String JSON_PROPERTY_BREED = "breed"; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/EnumArrays.java index 0ac0036a1264..f1250725f78b 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -33,6 +33,7 @@ EnumArrays.JSON_PROPERTY_JUST_SYMBOL, EnumArrays.JSON_PROPERTY_ARRAY_ENUM }) +@JsonTypeName("EnumArrays") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class EnumArrays { /** diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/EnumTest.java index e58cb6c26273..180480621bf2 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/EnumTest.java @@ -35,6 +35,7 @@ EnumTest.JSON_PROPERTY_ENUM_NUMBER, EnumTest.JSON_PROPERTY_OUTER_ENUM }) +@JsonTypeName("Enum_Test") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class EnumTest { /** diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index bd7a3dc18ece..963fe400ccb7 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -33,6 +33,7 @@ FileSchemaTestClass.JSON_PROPERTY_FILE, FileSchemaTestClass.JSON_PROPERTY_FILES }) +@JsonTypeName("FileSchemaTestClass") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class FileSchemaTestClass { public static final String JSON_PROPERTY_FILE = "file"; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/FormatTest.java index 80b36862ad7b..9ff00f4e174b 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/FormatTest.java @@ -48,6 +48,7 @@ FormatTest.JSON_PROPERTY_PASSWORD, FormatTest.JSON_PROPERTY_BIG_DECIMAL }) +@JsonTypeName("format_test") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class FormatTest { public static final String JSON_PROPERTY_INTEGER = "integer"; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index 09ce9ea3cba6..7d19aedaf059 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -31,6 +31,7 @@ HasOnlyReadOnly.JSON_PROPERTY_BAR, HasOnlyReadOnly.JSON_PROPERTY_FOO }) +@JsonTypeName("hasOnlyReadOnly") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class HasOnlyReadOnly { public static final String JSON_PROPERTY_BAR = "bar"; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/MapTest.java index bf8f3e694574..1a01d9966957 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/MapTest.java @@ -36,6 +36,7 @@ MapTest.JSON_PROPERTY_DIRECT_MAP, MapTest.JSON_PROPERTY_INDIRECT_MAP }) +@JsonTypeName("MapTest") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class MapTest { public static final String JSON_PROPERTY_MAP_MAP_OF_STRING = "map_map_of_string"; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 1535857a4de2..9d3468b0efab 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -38,6 +38,7 @@ MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_DATE_TIME, MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_MAP }) +@JsonTypeName("MixedPropertiesAndAdditionalPropertiesClass") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class MixedPropertiesAndAdditionalPropertiesClass { public static final String JSON_PROPERTY_UUID = "uuid"; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Model200Response.java index f4cfa618708f..a0128aa6fa55 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Model200Response.java @@ -32,6 +32,7 @@ Model200Response.JSON_PROPERTY_NAME, Model200Response.JSON_PROPERTY_PROPERTY_CLASS }) +@JsonTypeName("200_response") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Model200Response { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ModelApiResponse.java index fadebd3adae6..d4b95b9f2792 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -32,6 +32,7 @@ ModelApiResponse.JSON_PROPERTY_TYPE, ModelApiResponse.JSON_PROPERTY_MESSAGE }) +@JsonTypeName("ApiResponse") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ModelApiResponse { public static final String JSON_PROPERTY_CODE = "code"; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ModelReturn.java index fd011c26d08f..dff176002fd2 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -31,6 +31,7 @@ @JsonPropertyOrder({ ModelReturn.JSON_PROPERTY_RETURN }) +@JsonTypeName("Return") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ModelReturn { public static final String JSON_PROPERTY_RETURN = "return"; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Name.java index 2856bb62713f..0d2544deef1b 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Name.java @@ -34,6 +34,7 @@ Name.JSON_PROPERTY_PROPERTY, Name.JSON_PROPERTY_123NUMBER }) +@JsonTypeName("Name") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Name { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/NumberOnly.java index 6f75ce84869a..70fd4e2bd2e0 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -31,6 +31,7 @@ @JsonPropertyOrder({ NumberOnly.JSON_PROPERTY_JUST_NUMBER }) +@JsonTypeName("NumberOnly") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class NumberOnly { public static final String JSON_PROPERTY_JUST_NUMBER = "JustNumber"; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Order.java index b3c44d7f5da9..b3ff3f899c21 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Order.java @@ -36,6 +36,7 @@ Order.JSON_PROPERTY_STATUS, Order.JSON_PROPERTY_COMPLETE }) +@JsonTypeName("Order") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Order { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/OuterComposite.java index 01d6299649fd..5065b8e6326c 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -33,6 +33,7 @@ OuterComposite.JSON_PROPERTY_MY_STRING, OuterComposite.JSON_PROPERTY_MY_BOOLEAN }) +@JsonTypeName("OuterComposite") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class OuterComposite { public static final String JSON_PROPERTY_MY_NUMBER = "my_number"; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Pet.java index 6a5bf52230d4..676bb150cf46 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Pet.java @@ -41,6 +41,7 @@ Pet.JSON_PROPERTY_TAGS, Pet.JSON_PROPERTY_STATUS }) +@JsonTypeName("Pet") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Pet { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index 938b1ab5306d..10615e92497a 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -31,6 +31,7 @@ ReadOnlyFirst.JSON_PROPERTY_BAR, ReadOnlyFirst.JSON_PROPERTY_BAZ }) +@JsonTypeName("ReadOnlyFirst") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ReadOnlyFirst { public static final String JSON_PROPERTY_BAR = "bar"; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/SpecialModelName.java index 0e689d7d2dc2..b41f654fab88 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -30,6 +30,7 @@ @JsonPropertyOrder({ SpecialModelName.JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME }) +@JsonTypeName("$special[model.name]") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SpecialModelName { public static final String JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME = "$special[property.name]"; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Tag.java index 09eb968690dd..d551564e69cc 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Tag.java @@ -31,6 +31,7 @@ Tag.JSON_PROPERTY_ID, Tag.JSON_PROPERTY_NAME }) +@JsonTypeName("Tag") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Tag { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index 7591858f5a42..eea3eb5d325e 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -37,6 +37,7 @@ TypeHolderDefault.JSON_PROPERTY_BOOL_ITEM, TypeHolderDefault.JSON_PROPERTY_ARRAY_ITEM }) +@JsonTypeName("TypeHolderDefault") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TypeHolderDefault { public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/TypeHolderExample.java index 7d40ec56e6f1..744c4c540413 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -38,6 +38,7 @@ TypeHolderExample.JSON_PROPERTY_BOOL_ITEM, TypeHolderExample.JSON_PROPERTY_ARRAY_ITEM }) +@JsonTypeName("TypeHolderExample") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TypeHolderExample { public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/User.java index 68d6a47d486d..0f0e9cbde49a 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/User.java @@ -37,6 +37,7 @@ User.JSON_PROPERTY_PHONE, User.JSON_PROPERTY_USER_STATUS }) +@JsonTypeName("User") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class User { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/XmlItem.java index cac71c7221b0..b4d37be1ec11 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/XmlItem.java @@ -61,6 +61,7 @@ XmlItem.JSON_PROPERTY_PREFIX_NS_ARRAY, XmlItem.JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY }) +@JsonTypeName("XmlItem") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class XmlItem { public static final String JSON_PROPERTY_ATTRIBUTE_STRING = "attribute_string"; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index efc3b84bf2a7..c3987e3e6b8b 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -34,6 +34,7 @@ @JsonPropertyOrder({ AdditionalPropertiesAnyType.JSON_PROPERTY_NAME }) +@JsonTypeName("AdditionalPropertiesAnyType") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @XmlRootElement(name = "AdditionalPropertiesAnyType") @XmlAccessorType(XmlAccessType.FIELD) diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index 31a4337b6d25..f712562fe2cb 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -35,6 +35,7 @@ @JsonPropertyOrder({ AdditionalPropertiesArray.JSON_PROPERTY_NAME }) +@JsonTypeName("AdditionalPropertiesArray") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @XmlRootElement(name = "AdditionalPropertiesArray") @XmlAccessorType(XmlAccessType.FIELD) diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index ee23b1af5115..dc2bb3eef1ed 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -34,6 +34,7 @@ @JsonPropertyOrder({ AdditionalPropertiesBoolean.JSON_PROPERTY_NAME }) +@JsonTypeName("AdditionalPropertiesBoolean") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @XmlRootElement(name = "AdditionalPropertiesBoolean") @XmlAccessorType(XmlAccessType.FIELD) diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index 3d5e6fcace6c..9c8e03cc6fa3 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -46,6 +46,7 @@ AdditionalPropertiesClass.JSON_PROPERTY_ANYTYPE2, AdditionalPropertiesClass.JSON_PROPERTY_ANYTYPE3 }) +@JsonTypeName("AdditionalPropertiesClass") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @XmlRootElement(name = "AdditionalPropertiesClass") @XmlAccessorType(XmlAccessType.FIELD) diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index 8e7d92f3c05f..61e3d3782771 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -34,6 +34,7 @@ @JsonPropertyOrder({ AdditionalPropertiesInteger.JSON_PROPERTY_NAME }) +@JsonTypeName("AdditionalPropertiesInteger") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @XmlRootElement(name = "AdditionalPropertiesInteger") @XmlAccessorType(XmlAccessType.FIELD) diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index 78cb61213eaf..3ee492823a2e 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -35,6 +35,7 @@ @JsonPropertyOrder({ AdditionalPropertiesNumber.JSON_PROPERTY_NAME }) +@JsonTypeName("AdditionalPropertiesNumber") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @XmlRootElement(name = "AdditionalPropertiesNumber") @XmlAccessorType(XmlAccessType.FIELD) diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index 4500d7c75e97..8686828cea60 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -34,6 +34,7 @@ @JsonPropertyOrder({ AdditionalPropertiesObject.JSON_PROPERTY_NAME }) +@JsonTypeName("AdditionalPropertiesObject") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @XmlRootElement(name = "AdditionalPropertiesObject") @XmlAccessorType(XmlAccessType.FIELD) diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index ecb1ee65991d..7a1466746e86 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -34,6 +34,7 @@ @JsonPropertyOrder({ AdditionalPropertiesString.JSON_PROPERTY_NAME }) +@JsonTypeName("AdditionalPropertiesString") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @XmlRootElement(name = "AdditionalPropertiesString") @XmlAccessorType(XmlAccessType.FIELD) diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Animal.java index a1c686e40437..f095e15f8fcf 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Animal.java @@ -38,6 +38,7 @@ Animal.JSON_PROPERTY_CLASS_NAME, Animal.JSON_PROPERTY_COLOR }) +@JsonTypeName("Animal") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) @JsonSubTypes({ diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index 5b7a37e2c6c8..419372fe6521 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -35,6 +35,7 @@ @JsonPropertyOrder({ ArrayOfArrayOfNumberOnly.JSON_PROPERTY_ARRAY_ARRAY_NUMBER }) +@JsonTypeName("ArrayOfArrayOfNumberOnly") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @XmlRootElement(name = "ArrayOfArrayOfNumberOnly") @XmlAccessorType(XmlAccessType.FIELD) diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 4229fe879228..3b5fc5fce8b9 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -35,6 +35,7 @@ @JsonPropertyOrder({ ArrayOfNumberOnly.JSON_PROPERTY_ARRAY_NUMBER }) +@JsonTypeName("ArrayOfNumberOnly") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @XmlRootElement(name = "ArrayOfNumberOnly") @XmlAccessorType(XmlAccessType.FIELD) diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ArrayTest.java index a9d28beed59b..e48085b5ed50 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -37,6 +37,7 @@ ArrayTest.JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER, ArrayTest.JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL }) +@JsonTypeName("ArrayTest") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @XmlRootElement(name = "ArrayTest") @XmlAccessorType(XmlAccessType.FIELD) diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/BigCat.java index 6620a9b97f8c..ca4dedcd9312 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/BigCat.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/BigCat.java @@ -36,6 +36,7 @@ @JsonPropertyOrder({ BigCat.JSON_PROPERTY_KIND }) +@JsonTypeName("BigCat") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/BigCatAllOf.java index 2e18b155835f..d316f2b36a9f 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/BigCatAllOf.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -32,6 +32,7 @@ @JsonPropertyOrder({ BigCatAllOf.JSON_PROPERTY_KIND }) +@JsonTypeName("BigCat_allOf") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @XmlRootElement(name = "BigCatAllOf") @XmlAccessorType(XmlAccessType.FIELD) diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Capitalization.java index 99bd1d44c160..d48b6fa88220 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Capitalization.java @@ -37,6 +37,7 @@ Capitalization.JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS, Capitalization.JSON_PROPERTY_A_T_T_N_A_M_E }) +@JsonTypeName("Capitalization") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @XmlRootElement(name = "Capitalization") @XmlAccessorType(XmlAccessType.FIELD) diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Cat.java index 819f471d4d23..e1a042dd2f70 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Cat.java @@ -37,6 +37,7 @@ @JsonPropertyOrder({ Cat.JSON_PROPERTY_DECLAWED }) +@JsonTypeName("Cat") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) @JsonSubTypes({ diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/CatAllOf.java index 08013a05f179..462407581cbc 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -32,6 +32,7 @@ @JsonPropertyOrder({ CatAllOf.JSON_PROPERTY_DECLAWED }) +@JsonTypeName("Cat_allOf") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @XmlRootElement(name = "CatAllOf") @XmlAccessorType(XmlAccessType.FIELD) diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Category.java index 0fac149c3f19..a930d1bc6c1b 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Category.java @@ -33,6 +33,7 @@ Category.JSON_PROPERTY_ID, Category.JSON_PROPERTY_NAME }) +@JsonTypeName("Category") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @XmlRootElement(name = "Category") @XmlAccessorType(XmlAccessType.FIELD) diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ClassModel.java index ddf9c5ff4d0f..c033a35e1230 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ClassModel.java @@ -33,6 +33,7 @@ @JsonPropertyOrder({ ClassModel.JSON_PROPERTY_PROPERTY_CLASS }) +@JsonTypeName("ClassModel") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @XmlRootElement(name = "ClassModel") @XmlAccessorType(XmlAccessType.FIELD) diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Client.java index ea032cc67a2f..600c79b96bc5 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Client.java @@ -32,6 +32,7 @@ @JsonPropertyOrder({ Client.JSON_PROPERTY_CLIENT }) +@JsonTypeName("Client") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @XmlRootElement(name = "Client") @XmlAccessorType(XmlAccessType.FIELD) diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Dog.java index 7b29a6925fba..cda1e44bf96d 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Dog.java @@ -36,6 +36,7 @@ @JsonPropertyOrder({ Dog.JSON_PROPERTY_BREED }) +@JsonTypeName("Dog") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/DogAllOf.java index 245acff75f01..82015fc5922d 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -32,6 +32,7 @@ @JsonPropertyOrder({ DogAllOf.JSON_PROPERTY_BREED }) +@JsonTypeName("Dog_allOf") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @XmlRootElement(name = "DogAllOf") @XmlAccessorType(XmlAccessType.FIELD) diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/EnumArrays.java index 3e0a30d5db42..3fc53e70aaab 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -35,6 +35,7 @@ EnumArrays.JSON_PROPERTY_JUST_SYMBOL, EnumArrays.JSON_PROPERTY_ARRAY_ENUM }) +@JsonTypeName("EnumArrays") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @XmlRootElement(name = "EnumArrays") @XmlAccessorType(XmlAccessType.FIELD) diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/EnumTest.java index 2e7c564e1de4..65d86469fcd3 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/EnumTest.java @@ -37,6 +37,7 @@ EnumTest.JSON_PROPERTY_ENUM_NUMBER, EnumTest.JSON_PROPERTY_OUTER_ENUM }) +@JsonTypeName("Enum_Test") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @XmlRootElement(name = "EnumTest") @XmlAccessorType(XmlAccessType.FIELD) diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index d10064f99179..b780bd75ddf5 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -35,6 +35,7 @@ FileSchemaTestClass.JSON_PROPERTY_FILE, FileSchemaTestClass.JSON_PROPERTY_FILES }) +@JsonTypeName("FileSchemaTestClass") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @XmlRootElement(name = "FileSchemaTestClass") @XmlAccessorType(XmlAccessType.FIELD) diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/FormatTest.java index 91704f198c45..97c7d3db0b65 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/FormatTest.java @@ -50,6 +50,7 @@ FormatTest.JSON_PROPERTY_PASSWORD, FormatTest.JSON_PROPERTY_BIG_DECIMAL }) +@JsonTypeName("format_test") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @XmlRootElement(name = "FormatTest") @XmlAccessorType(XmlAccessType.FIELD) diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index e74c99362cae..159dc84522b0 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -33,6 +33,7 @@ HasOnlyReadOnly.JSON_PROPERTY_BAR, HasOnlyReadOnly.JSON_PROPERTY_FOO }) +@JsonTypeName("hasOnlyReadOnly") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @XmlRootElement(name = "HasOnlyReadOnly") @XmlAccessorType(XmlAccessType.FIELD) diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/MapTest.java index 8b884e9219a8..dfe553a53b46 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/MapTest.java @@ -38,6 +38,7 @@ MapTest.JSON_PROPERTY_DIRECT_MAP, MapTest.JSON_PROPERTY_INDIRECT_MAP }) +@JsonTypeName("MapTest") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @XmlRootElement(name = "MapTest") @XmlAccessorType(XmlAccessType.FIELD) diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 6f861da33cad..baa0706b4487 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -40,6 +40,7 @@ MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_DATE_TIME, MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_MAP }) +@JsonTypeName("MixedPropertiesAndAdditionalPropertiesClass") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @XmlRootElement(name = "MixedPropertiesAndAdditionalPropertiesClass") @XmlAccessorType(XmlAccessType.FIELD) diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Model200Response.java index c3464184ebed..8cc0b01a4656 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Model200Response.java @@ -34,6 +34,7 @@ Model200Response.JSON_PROPERTY_NAME, Model200Response.JSON_PROPERTY_PROPERTY_CLASS }) +@JsonTypeName("200_response") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @XmlRootElement(name = "Name") @XmlAccessorType(XmlAccessType.FIELD) diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ModelApiResponse.java index 614c174f1e97..ea7ade3b0c21 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -34,6 +34,7 @@ ModelApiResponse.JSON_PROPERTY_TYPE, ModelApiResponse.JSON_PROPERTY_MESSAGE }) +@JsonTypeName("ApiResponse") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @XmlRootElement(name = "ModelApiResponse") @XmlAccessorType(XmlAccessType.FIELD) diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ModelReturn.java index 656b594449db..6b134c78ada4 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -33,6 +33,7 @@ @JsonPropertyOrder({ ModelReturn.JSON_PROPERTY_RETURN }) +@JsonTypeName("Return") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @XmlRootElement(name = "Return") @XmlAccessorType(XmlAccessType.FIELD) diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Name.java index 79927485b640..9e94b613cece 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Name.java @@ -36,6 +36,7 @@ Name.JSON_PROPERTY_PROPERTY, Name.JSON_PROPERTY_123NUMBER }) +@JsonTypeName("Name") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @XmlRootElement(name = "Name") @XmlAccessorType(XmlAccessType.FIELD) diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/NumberOnly.java index 272c4dd85eeb..b778927f320d 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -33,6 +33,7 @@ @JsonPropertyOrder({ NumberOnly.JSON_PROPERTY_JUST_NUMBER }) +@JsonTypeName("NumberOnly") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @XmlRootElement(name = "NumberOnly") @XmlAccessorType(XmlAccessType.FIELD) diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Order.java index ee3ecc82c41b..f8495458a350 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Order.java @@ -38,6 +38,7 @@ Order.JSON_PROPERTY_STATUS, Order.JSON_PROPERTY_COMPLETE }) +@JsonTypeName("Order") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @XmlRootElement(name = "Order") @XmlAccessorType(XmlAccessType.FIELD) diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/OuterComposite.java index 35ee47ce134f..0226b0ecbbd7 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -35,6 +35,7 @@ OuterComposite.JSON_PROPERTY_MY_STRING, OuterComposite.JSON_PROPERTY_MY_BOOLEAN }) +@JsonTypeName("OuterComposite") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @XmlRootElement(name = "OuterComposite") @XmlAccessorType(XmlAccessType.FIELD) diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Pet.java index 37909c018d6d..0424303b0767 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Pet.java @@ -43,6 +43,7 @@ Pet.JSON_PROPERTY_TAGS, Pet.JSON_PROPERTY_STATUS }) +@JsonTypeName("Pet") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @XmlRootElement(name = "Pet") @XmlAccessorType(XmlAccessType.FIELD) diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index 0be00a22367e..57084c5e993a 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -33,6 +33,7 @@ ReadOnlyFirst.JSON_PROPERTY_BAR, ReadOnlyFirst.JSON_PROPERTY_BAZ }) +@JsonTypeName("ReadOnlyFirst") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @XmlRootElement(name = "ReadOnlyFirst") @XmlAccessorType(XmlAccessType.FIELD) diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/SpecialModelName.java index 58163dd6d17d..32cce001290d 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -32,6 +32,7 @@ @JsonPropertyOrder({ SpecialModelName.JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME }) +@JsonTypeName("$special[model.name]") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @XmlRootElement(name = "$special[model.name]") @XmlAccessorType(XmlAccessType.FIELD) diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Tag.java index 974ad471b0c7..a2a2a2c4edb6 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Tag.java @@ -33,6 +33,7 @@ Tag.JSON_PROPERTY_ID, Tag.JSON_PROPERTY_NAME }) +@JsonTypeName("Tag") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @XmlRootElement(name = "Tag") @XmlAccessorType(XmlAccessType.FIELD) diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index 0dc0b2bba1d3..194b3f5945fc 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -39,6 +39,7 @@ TypeHolderDefault.JSON_PROPERTY_BOOL_ITEM, TypeHolderDefault.JSON_PROPERTY_ARRAY_ITEM }) +@JsonTypeName("TypeHolderDefault") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @XmlRootElement(name = "TypeHolderDefault") @XmlAccessorType(XmlAccessType.FIELD) diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/TypeHolderExample.java index c9f2384befdc..f92547fa4ae9 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -40,6 +40,7 @@ TypeHolderExample.JSON_PROPERTY_BOOL_ITEM, TypeHolderExample.JSON_PROPERTY_ARRAY_ITEM }) +@JsonTypeName("TypeHolderExample") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @XmlRootElement(name = "TypeHolderExample") @XmlAccessorType(XmlAccessType.FIELD) diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/User.java index 422d7752bd66..13e68b7831f6 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/User.java @@ -39,6 +39,7 @@ User.JSON_PROPERTY_PHONE, User.JSON_PROPERTY_USER_STATUS }) +@JsonTypeName("User") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @XmlRootElement(name = "User") @XmlAccessorType(XmlAccessType.FIELD) diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/XmlItem.java index 203718e6be8c..e52e67606a14 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/XmlItem.java @@ -63,6 +63,7 @@ XmlItem.JSON_PROPERTY_PREFIX_NS_ARRAY, XmlItem.JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY }) +@JsonTypeName("XmlItem") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @XmlRootElement(namespace="http://a.com/schema", name = "XmlItem") @XmlAccessorType(XmlAccessType.FIELD) diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index 8d2c7147bdb6..62b1da4c2f00 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -32,6 +32,7 @@ @JsonPropertyOrder({ AdditionalPropertiesAnyType.JSON_PROPERTY_NAME }) +@JsonTypeName("AdditionalPropertiesAnyType") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesAnyType extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index 79e87782bd2c..0115b4dd963b 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -33,6 +33,7 @@ @JsonPropertyOrder({ AdditionalPropertiesArray.JSON_PROPERTY_NAME }) +@JsonTypeName("AdditionalPropertiesArray") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesArray extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index 8c5bc6271da0..a430b6fc5729 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -32,6 +32,7 @@ @JsonPropertyOrder({ AdditionalPropertiesBoolean.JSON_PROPERTY_NAME }) +@JsonTypeName("AdditionalPropertiesBoolean") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesBoolean extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index ed7e62088290..69dabddfb145 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -44,6 +44,7 @@ AdditionalPropertiesClass.JSON_PROPERTY_ANYTYPE2, AdditionalPropertiesClass.JSON_PROPERTY_ANYTYPE3 }) +@JsonTypeName("AdditionalPropertiesClass") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesClass { public static final String JSON_PROPERTY_MAP_STRING = "map_string"; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index 41d50c58ceae..9f7587c2edf3 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -32,6 +32,7 @@ @JsonPropertyOrder({ AdditionalPropertiesInteger.JSON_PROPERTY_NAME }) +@JsonTypeName("AdditionalPropertiesInteger") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesInteger extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index 5b656c5825a4..9700dab2bd2b 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -33,6 +33,7 @@ @JsonPropertyOrder({ AdditionalPropertiesNumber.JSON_PROPERTY_NAME }) +@JsonTypeName("AdditionalPropertiesNumber") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesNumber extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index 2326f099b488..60a59e97a228 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -32,6 +32,7 @@ @JsonPropertyOrder({ AdditionalPropertiesObject.JSON_PROPERTY_NAME }) +@JsonTypeName("AdditionalPropertiesObject") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesObject extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index cde27cbad9fb..5d355241baf8 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -32,6 +32,7 @@ @JsonPropertyOrder({ AdditionalPropertiesString.JSON_PROPERTY_NAME }) +@JsonTypeName("AdditionalPropertiesString") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesString extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Animal.java index 9dc580215d1f..99d5797e86e8 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Animal.java @@ -36,6 +36,7 @@ Animal.JSON_PROPERTY_CLASS_NAME, Animal.JSON_PROPERTY_COLOR }) +@JsonTypeName("Animal") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) @JsonSubTypes({ diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index e8ab9ce9565c..dd0b5d8f55e2 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -33,6 +33,7 @@ @JsonPropertyOrder({ ArrayOfArrayOfNumberOnly.JSON_PROPERTY_ARRAY_ARRAY_NUMBER }) +@JsonTypeName("ArrayOfArrayOfNumberOnly") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ArrayOfArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 48afb5b470bd..e681cb5b8241 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -33,6 +33,7 @@ @JsonPropertyOrder({ ArrayOfNumberOnly.JSON_PROPERTY_ARRAY_NUMBER }) +@JsonTypeName("ArrayOfNumberOnly") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber"; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ArrayTest.java index 55935f343f5c..bdcc439a5ec4 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -35,6 +35,7 @@ ArrayTest.JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER, ArrayTest.JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL }) +@JsonTypeName("ArrayTest") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ArrayTest { public static final String JSON_PROPERTY_ARRAY_OF_STRING = "array_of_string"; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/BigCat.java index 864ec623e435..b3033deacc7d 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/BigCat.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/BigCat.java @@ -34,6 +34,7 @@ @JsonPropertyOrder({ BigCat.JSON_PROPERTY_KIND }) +@JsonTypeName("BigCat") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/BigCatAllOf.java index a22af0b67c02..6a3df7eafcaa 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/BigCatAllOf.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -30,6 +30,7 @@ @JsonPropertyOrder({ BigCatAllOf.JSON_PROPERTY_KIND }) +@JsonTypeName("BigCat_allOf") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class BigCatAllOf { /** diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Capitalization.java index c7ea7879dbef..6d7704bfba08 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Capitalization.java @@ -35,6 +35,7 @@ Capitalization.JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS, Capitalization.JSON_PROPERTY_A_T_T_N_A_M_E }) +@JsonTypeName("Capitalization") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Capitalization { public static final String JSON_PROPERTY_SMALL_CAMEL = "smallCamel"; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Cat.java index 664eb00008be..ed7d126fa5c7 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Cat.java @@ -35,6 +35,7 @@ @JsonPropertyOrder({ Cat.JSON_PROPERTY_DECLAWED }) +@JsonTypeName("Cat") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) @JsonSubTypes({ diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/CatAllOf.java index bbbb99689bdf..a90ea75ffb71 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -30,6 +30,7 @@ @JsonPropertyOrder({ CatAllOf.JSON_PROPERTY_DECLAWED }) +@JsonTypeName("Cat_allOf") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class CatAllOf { public static final String JSON_PROPERTY_DECLAWED = "declawed"; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Category.java index 5823854c4c9f..87a09fb2bae7 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Category.java @@ -31,6 +31,7 @@ Category.JSON_PROPERTY_ID, Category.JSON_PROPERTY_NAME }) +@JsonTypeName("Category") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Category { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ClassModel.java index 93445a9610c1..c4008f60e646 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ClassModel.java @@ -31,6 +31,7 @@ @JsonPropertyOrder({ ClassModel.JSON_PROPERTY_PROPERTY_CLASS }) +@JsonTypeName("ClassModel") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ClassModel { public static final String JSON_PROPERTY_PROPERTY_CLASS = "_class"; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Client.java index 2820a5517c90..013eeba9b6ec 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Client.java @@ -30,6 +30,7 @@ @JsonPropertyOrder({ Client.JSON_PROPERTY_CLIENT }) +@JsonTypeName("Client") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Client { public static final String JSON_PROPERTY_CLIENT = "client"; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Dog.java index d81430849bb3..5f29f08ac2e6 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Dog.java @@ -34,6 +34,7 @@ @JsonPropertyOrder({ Dog.JSON_PROPERTY_BREED }) +@JsonTypeName("Dog") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/DogAllOf.java index 21babf245444..c5af5ce9324b 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -30,6 +30,7 @@ @JsonPropertyOrder({ DogAllOf.JSON_PROPERTY_BREED }) +@JsonTypeName("Dog_allOf") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class DogAllOf { public static final String JSON_PROPERTY_BREED = "breed"; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/EnumArrays.java index 0ac0036a1264..f1250725f78b 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -33,6 +33,7 @@ EnumArrays.JSON_PROPERTY_JUST_SYMBOL, EnumArrays.JSON_PROPERTY_ARRAY_ENUM }) +@JsonTypeName("EnumArrays") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class EnumArrays { /** diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/EnumTest.java index e58cb6c26273..180480621bf2 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/EnumTest.java @@ -35,6 +35,7 @@ EnumTest.JSON_PROPERTY_ENUM_NUMBER, EnumTest.JSON_PROPERTY_OUTER_ENUM }) +@JsonTypeName("Enum_Test") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class EnumTest { /** diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index bd7a3dc18ece..963fe400ccb7 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -33,6 +33,7 @@ FileSchemaTestClass.JSON_PROPERTY_FILE, FileSchemaTestClass.JSON_PROPERTY_FILES }) +@JsonTypeName("FileSchemaTestClass") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class FileSchemaTestClass { public static final String JSON_PROPERTY_FILE = "file"; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/FormatTest.java index 80b36862ad7b..9ff00f4e174b 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/FormatTest.java @@ -48,6 +48,7 @@ FormatTest.JSON_PROPERTY_PASSWORD, FormatTest.JSON_PROPERTY_BIG_DECIMAL }) +@JsonTypeName("format_test") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class FormatTest { public static final String JSON_PROPERTY_INTEGER = "integer"; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index 09ce9ea3cba6..7d19aedaf059 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -31,6 +31,7 @@ HasOnlyReadOnly.JSON_PROPERTY_BAR, HasOnlyReadOnly.JSON_PROPERTY_FOO }) +@JsonTypeName("hasOnlyReadOnly") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class HasOnlyReadOnly { public static final String JSON_PROPERTY_BAR = "bar"; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/MapTest.java index bf8f3e694574..1a01d9966957 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/MapTest.java @@ -36,6 +36,7 @@ MapTest.JSON_PROPERTY_DIRECT_MAP, MapTest.JSON_PROPERTY_INDIRECT_MAP }) +@JsonTypeName("MapTest") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class MapTest { public static final String JSON_PROPERTY_MAP_MAP_OF_STRING = "map_map_of_string"; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 1535857a4de2..9d3468b0efab 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -38,6 +38,7 @@ MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_DATE_TIME, MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_MAP }) +@JsonTypeName("MixedPropertiesAndAdditionalPropertiesClass") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class MixedPropertiesAndAdditionalPropertiesClass { public static final String JSON_PROPERTY_UUID = "uuid"; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Model200Response.java index f4cfa618708f..a0128aa6fa55 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Model200Response.java @@ -32,6 +32,7 @@ Model200Response.JSON_PROPERTY_NAME, Model200Response.JSON_PROPERTY_PROPERTY_CLASS }) +@JsonTypeName("200_response") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Model200Response { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelApiResponse.java index fadebd3adae6..d4b95b9f2792 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -32,6 +32,7 @@ ModelApiResponse.JSON_PROPERTY_TYPE, ModelApiResponse.JSON_PROPERTY_MESSAGE }) +@JsonTypeName("ApiResponse") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ModelApiResponse { public static final String JSON_PROPERTY_CODE = "code"; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelReturn.java index fd011c26d08f..dff176002fd2 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -31,6 +31,7 @@ @JsonPropertyOrder({ ModelReturn.JSON_PROPERTY_RETURN }) +@JsonTypeName("Return") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ModelReturn { public static final String JSON_PROPERTY_RETURN = "return"; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Name.java index 2856bb62713f..0d2544deef1b 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Name.java @@ -34,6 +34,7 @@ Name.JSON_PROPERTY_PROPERTY, Name.JSON_PROPERTY_123NUMBER }) +@JsonTypeName("Name") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Name { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/NumberOnly.java index 6f75ce84869a..70fd4e2bd2e0 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -31,6 +31,7 @@ @JsonPropertyOrder({ NumberOnly.JSON_PROPERTY_JUST_NUMBER }) +@JsonTypeName("NumberOnly") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class NumberOnly { public static final String JSON_PROPERTY_JUST_NUMBER = "JustNumber"; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Order.java index b3c44d7f5da9..b3ff3f899c21 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Order.java @@ -36,6 +36,7 @@ Order.JSON_PROPERTY_STATUS, Order.JSON_PROPERTY_COMPLETE }) +@JsonTypeName("Order") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Order { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/OuterComposite.java index 01d6299649fd..5065b8e6326c 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -33,6 +33,7 @@ OuterComposite.JSON_PROPERTY_MY_STRING, OuterComposite.JSON_PROPERTY_MY_BOOLEAN }) +@JsonTypeName("OuterComposite") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class OuterComposite { public static final String JSON_PROPERTY_MY_NUMBER = "my_number"; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Pet.java index 6a5bf52230d4..676bb150cf46 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Pet.java @@ -41,6 +41,7 @@ Pet.JSON_PROPERTY_TAGS, Pet.JSON_PROPERTY_STATUS }) +@JsonTypeName("Pet") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Pet { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index 938b1ab5306d..10615e92497a 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -31,6 +31,7 @@ ReadOnlyFirst.JSON_PROPERTY_BAR, ReadOnlyFirst.JSON_PROPERTY_BAZ }) +@JsonTypeName("ReadOnlyFirst") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ReadOnlyFirst { public static final String JSON_PROPERTY_BAR = "bar"; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/SpecialModelName.java index 0e689d7d2dc2..b41f654fab88 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -30,6 +30,7 @@ @JsonPropertyOrder({ SpecialModelName.JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME }) +@JsonTypeName("$special[model.name]") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SpecialModelName { public static final String JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME = "$special[property.name]"; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Tag.java index 09eb968690dd..d551564e69cc 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Tag.java @@ -31,6 +31,7 @@ Tag.JSON_PROPERTY_ID, Tag.JSON_PROPERTY_NAME }) +@JsonTypeName("Tag") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Tag { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index 7591858f5a42..eea3eb5d325e 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -37,6 +37,7 @@ TypeHolderDefault.JSON_PROPERTY_BOOL_ITEM, TypeHolderDefault.JSON_PROPERTY_ARRAY_ITEM }) +@JsonTypeName("TypeHolderDefault") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TypeHolderDefault { public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/TypeHolderExample.java index 7d40ec56e6f1..744c4c540413 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -38,6 +38,7 @@ TypeHolderExample.JSON_PROPERTY_BOOL_ITEM, TypeHolderExample.JSON_PROPERTY_ARRAY_ITEM }) +@JsonTypeName("TypeHolderExample") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TypeHolderExample { public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/User.java index 68d6a47d486d..0f0e9cbde49a 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/User.java @@ -37,6 +37,7 @@ User.JSON_PROPERTY_PHONE, User.JSON_PROPERTY_USER_STATUS }) +@JsonTypeName("User") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class User { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/XmlItem.java index cac71c7221b0..b4d37be1ec11 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/XmlItem.java @@ -61,6 +61,7 @@ XmlItem.JSON_PROPERTY_PREFIX_NS_ARRAY, XmlItem.JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY }) +@JsonTypeName("XmlItem") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class XmlItem { public static final String JSON_PROPERTY_ATTRIBUTE_STRING = "attribute_string"; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index fa6626c94e0e..387b7f51314d 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -34,6 +34,7 @@ @JsonPropertyOrder({ AdditionalPropertiesAnyType.JSON_PROPERTY_NAME }) +@JsonTypeName("AdditionalPropertiesAnyType") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesAnyType extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index 354b09030009..9f5af133b987 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -35,6 +35,7 @@ @JsonPropertyOrder({ AdditionalPropertiesArray.JSON_PROPERTY_NAME }) +@JsonTypeName("AdditionalPropertiesArray") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesArray extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index d7288e217bb5..8ce8a83beb4b 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -34,6 +34,7 @@ @JsonPropertyOrder({ AdditionalPropertiesBoolean.JSON_PROPERTY_NAME }) +@JsonTypeName("AdditionalPropertiesBoolean") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesBoolean extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index 88c288464364..75fd34158216 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -46,6 +46,7 @@ AdditionalPropertiesClass.JSON_PROPERTY_ANYTYPE2, AdditionalPropertiesClass.JSON_PROPERTY_ANYTYPE3 }) +@JsonTypeName("AdditionalPropertiesClass") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesClass { public static final String JSON_PROPERTY_MAP_STRING = "map_string"; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index 124f23b81184..182e01e72738 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -34,6 +34,7 @@ @JsonPropertyOrder({ AdditionalPropertiesInteger.JSON_PROPERTY_NAME }) +@JsonTypeName("AdditionalPropertiesInteger") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesInteger extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index 4e85c9bc75dd..5121298662df 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -35,6 +35,7 @@ @JsonPropertyOrder({ AdditionalPropertiesNumber.JSON_PROPERTY_NAME }) +@JsonTypeName("AdditionalPropertiesNumber") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesNumber extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index 0c207b1ae4e1..276ea5e5d3f0 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -34,6 +34,7 @@ @JsonPropertyOrder({ AdditionalPropertiesObject.JSON_PROPERTY_NAME }) +@JsonTypeName("AdditionalPropertiesObject") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesObject extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index 38a2d64184de..2cb110c33d56 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -34,6 +34,7 @@ @JsonPropertyOrder({ AdditionalPropertiesString.JSON_PROPERTY_NAME }) +@JsonTypeName("AdditionalPropertiesString") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesString extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Animal.java index 8c60f38980a7..331815a23993 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Animal.java @@ -38,6 +38,7 @@ Animal.JSON_PROPERTY_CLASS_NAME, Animal.JSON_PROPERTY_COLOR }) +@JsonTypeName("Animal") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) @JsonSubTypes({ diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index dd4eab207286..d8d7e6c0b348 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -35,6 +35,7 @@ @JsonPropertyOrder({ ArrayOfArrayOfNumberOnly.JSON_PROPERTY_ARRAY_ARRAY_NUMBER }) +@JsonTypeName("ArrayOfArrayOfNumberOnly") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ArrayOfArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index e53d9fa43be0..4174c5c51d57 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -35,6 +35,7 @@ @JsonPropertyOrder({ ArrayOfNumberOnly.JSON_PROPERTY_ARRAY_NUMBER }) +@JsonTypeName("ArrayOfNumberOnly") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber"; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ArrayTest.java index 7c63ae77edf1..fb173a830380 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -37,6 +37,7 @@ ArrayTest.JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER, ArrayTest.JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL }) +@JsonTypeName("ArrayTest") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ArrayTest { public static final String JSON_PROPERTY_ARRAY_OF_STRING = "array_of_string"; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/BigCat.java index 2b715b520bf8..ec916f105275 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/BigCat.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/BigCat.java @@ -36,6 +36,7 @@ @JsonPropertyOrder({ BigCat.JSON_PROPERTY_KIND }) +@JsonTypeName("BigCat") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/BigCatAllOf.java index 753ab4858bdc..527c3c6404c6 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/BigCatAllOf.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -32,6 +32,7 @@ @JsonPropertyOrder({ BigCatAllOf.JSON_PROPERTY_KIND }) +@JsonTypeName("BigCat_allOf") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class BigCatAllOf { /** diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Capitalization.java index b35babfce005..e5989afa63ea 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Capitalization.java @@ -37,6 +37,7 @@ Capitalization.JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS, Capitalization.JSON_PROPERTY_A_T_T_N_A_M_E }) +@JsonTypeName("Capitalization") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Capitalization { public static final String JSON_PROPERTY_SMALL_CAMEL = "smallCamel"; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Cat.java index f3f16caeb0ea..e3334667fbff 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Cat.java @@ -37,6 +37,7 @@ @JsonPropertyOrder({ Cat.JSON_PROPERTY_DECLAWED }) +@JsonTypeName("Cat") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) @JsonSubTypes({ diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/CatAllOf.java index eb7bffd97695..42cb0bc374ee 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -32,6 +32,7 @@ @JsonPropertyOrder({ CatAllOf.JSON_PROPERTY_DECLAWED }) +@JsonTypeName("Cat_allOf") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class CatAllOf { public static final String JSON_PROPERTY_DECLAWED = "declawed"; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Category.java index 6254fd1572c9..f415fdeccb50 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Category.java @@ -33,6 +33,7 @@ Category.JSON_PROPERTY_ID, Category.JSON_PROPERTY_NAME }) +@JsonTypeName("Category") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Category { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ClassModel.java index 9daccdea9873..7fe05b053525 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ClassModel.java @@ -33,6 +33,7 @@ @JsonPropertyOrder({ ClassModel.JSON_PROPERTY_PROPERTY_CLASS }) +@JsonTypeName("ClassModel") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ClassModel { public static final String JSON_PROPERTY_PROPERTY_CLASS = "_class"; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Client.java index 00211f41e450..5ef6ec4dd28a 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Client.java @@ -32,6 +32,7 @@ @JsonPropertyOrder({ Client.JSON_PROPERTY_CLIENT }) +@JsonTypeName("Client") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Client { public static final String JSON_PROPERTY_CLIENT = "client"; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Dog.java index 24a79dd6a8b2..95ef0ecb2eb1 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Dog.java @@ -36,6 +36,7 @@ @JsonPropertyOrder({ Dog.JSON_PROPERTY_BREED }) +@JsonTypeName("Dog") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/DogAllOf.java index 524e0959dbe4..93510a32e632 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -32,6 +32,7 @@ @JsonPropertyOrder({ DogAllOf.JSON_PROPERTY_BREED }) +@JsonTypeName("Dog_allOf") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class DogAllOf { public static final String JSON_PROPERTY_BREED = "breed"; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/EnumArrays.java index ffb811dcd62a..23738bf15329 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -35,6 +35,7 @@ EnumArrays.JSON_PROPERTY_JUST_SYMBOL, EnumArrays.JSON_PROPERTY_ARRAY_ENUM }) +@JsonTypeName("EnumArrays") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class EnumArrays { /** diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/EnumTest.java index 5d1e7704064e..b0b4965fb2fa 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/EnumTest.java @@ -37,6 +37,7 @@ EnumTest.JSON_PROPERTY_ENUM_NUMBER, EnumTest.JSON_PROPERTY_OUTER_ENUM }) +@JsonTypeName("Enum_Test") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class EnumTest { /** diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index 6aa90e5fe21a..1c126d30712d 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -35,6 +35,7 @@ FileSchemaTestClass.JSON_PROPERTY_FILE, FileSchemaTestClass.JSON_PROPERTY_FILES }) +@JsonTypeName("FileSchemaTestClass") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class FileSchemaTestClass { public static final String JSON_PROPERTY_FILE = "file"; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/FormatTest.java index 3c77f93588fb..4f38c6602cfc 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/FormatTest.java @@ -50,6 +50,7 @@ FormatTest.JSON_PROPERTY_PASSWORD, FormatTest.JSON_PROPERTY_BIG_DECIMAL }) +@JsonTypeName("format_test") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class FormatTest { public static final String JSON_PROPERTY_INTEGER = "integer"; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index fd12294525fb..d3a6d83b4ab6 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -33,6 +33,7 @@ HasOnlyReadOnly.JSON_PROPERTY_BAR, HasOnlyReadOnly.JSON_PROPERTY_FOO }) +@JsonTypeName("hasOnlyReadOnly") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class HasOnlyReadOnly { public static final String JSON_PROPERTY_BAR = "bar"; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/MapTest.java index 1af6a8647a36..7cda035f9fa8 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/MapTest.java @@ -38,6 +38,7 @@ MapTest.JSON_PROPERTY_DIRECT_MAP, MapTest.JSON_PROPERTY_INDIRECT_MAP }) +@JsonTypeName("MapTest") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class MapTest { public static final String JSON_PROPERTY_MAP_MAP_OF_STRING = "map_map_of_string"; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index b89403e74c31..616414d02523 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -40,6 +40,7 @@ MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_DATE_TIME, MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_MAP }) +@JsonTypeName("MixedPropertiesAndAdditionalPropertiesClass") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class MixedPropertiesAndAdditionalPropertiesClass { public static final String JSON_PROPERTY_UUID = "uuid"; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Model200Response.java index f81da2c68d4d..8f22137e39cd 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Model200Response.java @@ -34,6 +34,7 @@ Model200Response.JSON_PROPERTY_NAME, Model200Response.JSON_PROPERTY_PROPERTY_CLASS }) +@JsonTypeName("200_response") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Model200Response { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ModelApiResponse.java index d2d83b7c8c85..49f8f9a8b60b 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -34,6 +34,7 @@ ModelApiResponse.JSON_PROPERTY_TYPE, ModelApiResponse.JSON_PROPERTY_MESSAGE }) +@JsonTypeName("ApiResponse") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ModelApiResponse { public static final String JSON_PROPERTY_CODE = "code"; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ModelReturn.java index 615643b0c205..74f47f3347ce 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -33,6 +33,7 @@ @JsonPropertyOrder({ ModelReturn.JSON_PROPERTY_RETURN }) +@JsonTypeName("Return") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ModelReturn { public static final String JSON_PROPERTY_RETURN = "return"; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Name.java index bb632537c295..86d9872a6f96 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Name.java @@ -36,6 +36,7 @@ Name.JSON_PROPERTY_PROPERTY, Name.JSON_PROPERTY_123NUMBER }) +@JsonTypeName("Name") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Name { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/NumberOnly.java index e28055d3e0e4..40e0022dafef 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -33,6 +33,7 @@ @JsonPropertyOrder({ NumberOnly.JSON_PROPERTY_JUST_NUMBER }) +@JsonTypeName("NumberOnly") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class NumberOnly { public static final String JSON_PROPERTY_JUST_NUMBER = "JustNumber"; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Order.java index 958cde521c73..7ad9832e30cc 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Order.java @@ -38,6 +38,7 @@ Order.JSON_PROPERTY_STATUS, Order.JSON_PROPERTY_COMPLETE }) +@JsonTypeName("Order") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Order { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/OuterComposite.java index d43f68b95b7b..373dbdb21165 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -35,6 +35,7 @@ OuterComposite.JSON_PROPERTY_MY_STRING, OuterComposite.JSON_PROPERTY_MY_BOOLEAN }) +@JsonTypeName("OuterComposite") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class OuterComposite { public static final String JSON_PROPERTY_MY_NUMBER = "my_number"; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Pet.java index 5c9aaa274f6f..3cff642f98f6 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Pet.java @@ -43,6 +43,7 @@ Pet.JSON_PROPERTY_TAGS, Pet.JSON_PROPERTY_STATUS }) +@JsonTypeName("Pet") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Pet { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index 94ff8172c382..26b7cbe70eea 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -33,6 +33,7 @@ ReadOnlyFirst.JSON_PROPERTY_BAR, ReadOnlyFirst.JSON_PROPERTY_BAZ }) +@JsonTypeName("ReadOnlyFirst") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ReadOnlyFirst { public static final String JSON_PROPERTY_BAR = "bar"; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/SpecialModelName.java index 244b9b5fe4d8..cc0959a6cd0c 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -32,6 +32,7 @@ @JsonPropertyOrder({ SpecialModelName.JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME }) +@JsonTypeName("$special[model.name]") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SpecialModelName { public static final String JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME = "$special[property.name]"; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Tag.java index 16654daed44d..23dda1dae1f2 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Tag.java @@ -33,6 +33,7 @@ Tag.JSON_PROPERTY_ID, Tag.JSON_PROPERTY_NAME }) +@JsonTypeName("Tag") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Tag { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index c8a59d7a5d83..beaf2efb9df1 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -39,6 +39,7 @@ TypeHolderDefault.JSON_PROPERTY_BOOL_ITEM, TypeHolderDefault.JSON_PROPERTY_ARRAY_ITEM }) +@JsonTypeName("TypeHolderDefault") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TypeHolderDefault { public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/TypeHolderExample.java index cf507a49fdd6..a2e2ab32084c 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -40,6 +40,7 @@ TypeHolderExample.JSON_PROPERTY_BOOL_ITEM, TypeHolderExample.JSON_PROPERTY_ARRAY_ITEM }) +@JsonTypeName("TypeHolderExample") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TypeHolderExample { public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/User.java index f666b56bdd2f..31c43108fa4d 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/User.java @@ -39,6 +39,7 @@ User.JSON_PROPERTY_PHONE, User.JSON_PROPERTY_USER_STATUS }) +@JsonTypeName("User") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class User { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/XmlItem.java index 5fb882c6e856..c862ef57ad89 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/XmlItem.java @@ -63,6 +63,7 @@ XmlItem.JSON_PROPERTY_PREFIX_NS_ARRAY, XmlItem.JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY }) +@JsonTypeName("XmlItem") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class XmlItem { public static final String JSON_PROPERTY_ATTRIBUTE_STRING = "attribute_string"; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index 8d2c7147bdb6..62b1da4c2f00 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -32,6 +32,7 @@ @JsonPropertyOrder({ AdditionalPropertiesAnyType.JSON_PROPERTY_NAME }) +@JsonTypeName("AdditionalPropertiesAnyType") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesAnyType extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index 79e87782bd2c..0115b4dd963b 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -33,6 +33,7 @@ @JsonPropertyOrder({ AdditionalPropertiesArray.JSON_PROPERTY_NAME }) +@JsonTypeName("AdditionalPropertiesArray") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesArray extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index 8c5bc6271da0..a430b6fc5729 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -32,6 +32,7 @@ @JsonPropertyOrder({ AdditionalPropertiesBoolean.JSON_PROPERTY_NAME }) +@JsonTypeName("AdditionalPropertiesBoolean") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesBoolean extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index 72b63a9ecefb..fe92686d699b 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -44,6 +44,7 @@ AdditionalPropertiesClass.JSON_PROPERTY_ANYTYPE2, AdditionalPropertiesClass.JSON_PROPERTY_ANYTYPE3 }) +@JsonTypeName("AdditionalPropertiesClass") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesClass { public static final String JSON_PROPERTY_MAP_STRING = "map_string"; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index 41d50c58ceae..9f7587c2edf3 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -32,6 +32,7 @@ @JsonPropertyOrder({ AdditionalPropertiesInteger.JSON_PROPERTY_NAME }) +@JsonTypeName("AdditionalPropertiesInteger") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesInteger extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index 5b656c5825a4..9700dab2bd2b 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -33,6 +33,7 @@ @JsonPropertyOrder({ AdditionalPropertiesNumber.JSON_PROPERTY_NAME }) +@JsonTypeName("AdditionalPropertiesNumber") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesNumber extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index 2326f099b488..60a59e97a228 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -32,6 +32,7 @@ @JsonPropertyOrder({ AdditionalPropertiesObject.JSON_PROPERTY_NAME }) +@JsonTypeName("AdditionalPropertiesObject") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesObject extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index cde27cbad9fb..5d355241baf8 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -32,6 +32,7 @@ @JsonPropertyOrder({ AdditionalPropertiesString.JSON_PROPERTY_NAME }) +@JsonTypeName("AdditionalPropertiesString") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesString extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Animal.java index 9dc580215d1f..99d5797e86e8 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Animal.java @@ -36,6 +36,7 @@ Animal.JSON_PROPERTY_CLASS_NAME, Animal.JSON_PROPERTY_COLOR }) +@JsonTypeName("Animal") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) @JsonSubTypes({ diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index 13daa9824158..80f01df5c690 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -33,6 +33,7 @@ @JsonPropertyOrder({ ArrayOfArrayOfNumberOnly.JSON_PROPERTY_ARRAY_ARRAY_NUMBER }) +@JsonTypeName("ArrayOfArrayOfNumberOnly") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ArrayOfArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index de2bc5fd8e07..9cc52573b7e6 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -33,6 +33,7 @@ @JsonPropertyOrder({ ArrayOfNumberOnly.JSON_PROPERTY_ARRAY_NUMBER }) +@JsonTypeName("ArrayOfNumberOnly") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber"; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ArrayTest.java index 3c88533eaa52..96f71f6261aa 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -35,6 +35,7 @@ ArrayTest.JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER, ArrayTest.JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL }) +@JsonTypeName("ArrayTest") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ArrayTest { public static final String JSON_PROPERTY_ARRAY_OF_STRING = "array_of_string"; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/BigCat.java index 864ec623e435..b3033deacc7d 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/BigCat.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/BigCat.java @@ -34,6 +34,7 @@ @JsonPropertyOrder({ BigCat.JSON_PROPERTY_KIND }) +@JsonTypeName("BigCat") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/BigCatAllOf.java index a22af0b67c02..6a3df7eafcaa 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/BigCatAllOf.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -30,6 +30,7 @@ @JsonPropertyOrder({ BigCatAllOf.JSON_PROPERTY_KIND }) +@JsonTypeName("BigCat_allOf") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class BigCatAllOf { /** diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Capitalization.java index c7ea7879dbef..6d7704bfba08 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Capitalization.java @@ -35,6 +35,7 @@ Capitalization.JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS, Capitalization.JSON_PROPERTY_A_T_T_N_A_M_E }) +@JsonTypeName("Capitalization") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Capitalization { public static final String JSON_PROPERTY_SMALL_CAMEL = "smallCamel"; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Cat.java index 664eb00008be..ed7d126fa5c7 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Cat.java @@ -35,6 +35,7 @@ @JsonPropertyOrder({ Cat.JSON_PROPERTY_DECLAWED }) +@JsonTypeName("Cat") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) @JsonSubTypes({ diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/CatAllOf.java index bbbb99689bdf..a90ea75ffb71 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -30,6 +30,7 @@ @JsonPropertyOrder({ CatAllOf.JSON_PROPERTY_DECLAWED }) +@JsonTypeName("Cat_allOf") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class CatAllOf { public static final String JSON_PROPERTY_DECLAWED = "declawed"; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Category.java index 5823854c4c9f..87a09fb2bae7 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Category.java @@ -31,6 +31,7 @@ Category.JSON_PROPERTY_ID, Category.JSON_PROPERTY_NAME }) +@JsonTypeName("Category") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Category { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ClassModel.java index 93445a9610c1..c4008f60e646 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ClassModel.java @@ -31,6 +31,7 @@ @JsonPropertyOrder({ ClassModel.JSON_PROPERTY_PROPERTY_CLASS }) +@JsonTypeName("ClassModel") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ClassModel { public static final String JSON_PROPERTY_PROPERTY_CLASS = "_class"; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Client.java index 2820a5517c90..013eeba9b6ec 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Client.java @@ -30,6 +30,7 @@ @JsonPropertyOrder({ Client.JSON_PROPERTY_CLIENT }) +@JsonTypeName("Client") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Client { public static final String JSON_PROPERTY_CLIENT = "client"; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Dog.java index d81430849bb3..5f29f08ac2e6 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Dog.java @@ -34,6 +34,7 @@ @JsonPropertyOrder({ Dog.JSON_PROPERTY_BREED }) +@JsonTypeName("Dog") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/DogAllOf.java index 21babf245444..c5af5ce9324b 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -30,6 +30,7 @@ @JsonPropertyOrder({ DogAllOf.JSON_PROPERTY_BREED }) +@JsonTypeName("Dog_allOf") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class DogAllOf { public static final String JSON_PROPERTY_BREED = "breed"; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/EnumArrays.java index e670cf4b3914..703122c4b773 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -33,6 +33,7 @@ EnumArrays.JSON_PROPERTY_JUST_SYMBOL, EnumArrays.JSON_PROPERTY_ARRAY_ENUM }) +@JsonTypeName("EnumArrays") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class EnumArrays { /** diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/EnumTest.java index e58cb6c26273..180480621bf2 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/EnumTest.java @@ -35,6 +35,7 @@ EnumTest.JSON_PROPERTY_ENUM_NUMBER, EnumTest.JSON_PROPERTY_OUTER_ENUM }) +@JsonTypeName("Enum_Test") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class EnumTest { /** diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index e22a96e86da9..4ed33e999cc9 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -33,6 +33,7 @@ FileSchemaTestClass.JSON_PROPERTY_FILE, FileSchemaTestClass.JSON_PROPERTY_FILES }) +@JsonTypeName("FileSchemaTestClass") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class FileSchemaTestClass { public static final String JSON_PROPERTY_FILE = "file"; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/FormatTest.java index 054cf24c9ce7..4e5f5f4e9db9 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/FormatTest.java @@ -48,6 +48,7 @@ FormatTest.JSON_PROPERTY_PASSWORD, FormatTest.JSON_PROPERTY_BIG_DECIMAL }) +@JsonTypeName("format_test") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class FormatTest { public static final String JSON_PROPERTY_INTEGER = "integer"; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index 09ce9ea3cba6..7d19aedaf059 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -31,6 +31,7 @@ HasOnlyReadOnly.JSON_PROPERTY_BAR, HasOnlyReadOnly.JSON_PROPERTY_FOO }) +@JsonTypeName("hasOnlyReadOnly") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class HasOnlyReadOnly { public static final String JSON_PROPERTY_BAR = "bar"; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/MapTest.java index 4662120ae29d..7a54ba52864a 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/MapTest.java @@ -36,6 +36,7 @@ MapTest.JSON_PROPERTY_DIRECT_MAP, MapTest.JSON_PROPERTY_INDIRECT_MAP }) +@JsonTypeName("MapTest") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class MapTest { public static final String JSON_PROPERTY_MAP_MAP_OF_STRING = "map_map_of_string"; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 15fd74975dfd..b05c8cbc5cd6 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -38,6 +38,7 @@ MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_DATE_TIME, MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_MAP }) +@JsonTypeName("MixedPropertiesAndAdditionalPropertiesClass") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class MixedPropertiesAndAdditionalPropertiesClass { public static final String JSON_PROPERTY_UUID = "uuid"; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Model200Response.java index f4cfa618708f..a0128aa6fa55 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Model200Response.java @@ -32,6 +32,7 @@ Model200Response.JSON_PROPERTY_NAME, Model200Response.JSON_PROPERTY_PROPERTY_CLASS }) +@JsonTypeName("200_response") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Model200Response { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ModelApiResponse.java index fadebd3adae6..d4b95b9f2792 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -32,6 +32,7 @@ ModelApiResponse.JSON_PROPERTY_TYPE, ModelApiResponse.JSON_PROPERTY_MESSAGE }) +@JsonTypeName("ApiResponse") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ModelApiResponse { public static final String JSON_PROPERTY_CODE = "code"; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ModelReturn.java index fd011c26d08f..dff176002fd2 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -31,6 +31,7 @@ @JsonPropertyOrder({ ModelReturn.JSON_PROPERTY_RETURN }) +@JsonTypeName("Return") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ModelReturn { public static final String JSON_PROPERTY_RETURN = "return"; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Name.java index 2856bb62713f..0d2544deef1b 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Name.java @@ -34,6 +34,7 @@ Name.JSON_PROPERTY_PROPERTY, Name.JSON_PROPERTY_123NUMBER }) +@JsonTypeName("Name") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Name { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/NumberOnly.java index 6f75ce84869a..70fd4e2bd2e0 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -31,6 +31,7 @@ @JsonPropertyOrder({ NumberOnly.JSON_PROPERTY_JUST_NUMBER }) +@JsonTypeName("NumberOnly") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class NumberOnly { public static final String JSON_PROPERTY_JUST_NUMBER = "JustNumber"; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Order.java index 7aa3053c0ae3..4b7dd3df38df 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Order.java @@ -36,6 +36,7 @@ Order.JSON_PROPERTY_STATUS, Order.JSON_PROPERTY_COMPLETE }) +@JsonTypeName("Order") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Order { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/OuterComposite.java index 01d6299649fd..5065b8e6326c 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -33,6 +33,7 @@ OuterComposite.JSON_PROPERTY_MY_STRING, OuterComposite.JSON_PROPERTY_MY_BOOLEAN }) +@JsonTypeName("OuterComposite") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class OuterComposite { public static final String JSON_PROPERTY_MY_NUMBER = "my_number"; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Pet.java index 4eec05079924..ed5a336b7de4 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Pet.java @@ -41,6 +41,7 @@ Pet.JSON_PROPERTY_TAGS, Pet.JSON_PROPERTY_STATUS }) +@JsonTypeName("Pet") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Pet { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index 938b1ab5306d..10615e92497a 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -31,6 +31,7 @@ ReadOnlyFirst.JSON_PROPERTY_BAR, ReadOnlyFirst.JSON_PROPERTY_BAZ }) +@JsonTypeName("ReadOnlyFirst") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ReadOnlyFirst { public static final String JSON_PROPERTY_BAR = "bar"; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/SpecialModelName.java index 0e689d7d2dc2..b41f654fab88 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -30,6 +30,7 @@ @JsonPropertyOrder({ SpecialModelName.JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME }) +@JsonTypeName("$special[model.name]") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SpecialModelName { public static final String JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME = "$special[property.name]"; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Tag.java index 09eb968690dd..d551564e69cc 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Tag.java @@ -31,6 +31,7 @@ Tag.JSON_PROPERTY_ID, Tag.JSON_PROPERTY_NAME }) +@JsonTypeName("Tag") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Tag { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index 0c86ba446826..c3629b1c0a7e 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -37,6 +37,7 @@ TypeHolderDefault.JSON_PROPERTY_BOOL_ITEM, TypeHolderDefault.JSON_PROPERTY_ARRAY_ITEM }) +@JsonTypeName("TypeHolderDefault") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TypeHolderDefault { public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/TypeHolderExample.java index 127acb1c0dfd..16071d123fc5 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -38,6 +38,7 @@ TypeHolderExample.JSON_PROPERTY_BOOL_ITEM, TypeHolderExample.JSON_PROPERTY_ARRAY_ITEM }) +@JsonTypeName("TypeHolderExample") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TypeHolderExample { public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/User.java index 68d6a47d486d..0f0e9cbde49a 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/User.java @@ -37,6 +37,7 @@ User.JSON_PROPERTY_PHONE, User.JSON_PROPERTY_USER_STATUS }) +@JsonTypeName("User") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class User { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/XmlItem.java index e7f4fb912d62..1407a6d002c0 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/XmlItem.java @@ -61,6 +61,7 @@ XmlItem.JSON_PROPERTY_PREFIX_NS_ARRAY, XmlItem.JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY }) +@JsonTypeName("XmlItem") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class XmlItem { public static final String JSON_PROPERTY_ATTRIBUTE_STRING = "attribute_string"; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index 8d2c7147bdb6..62b1da4c2f00 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -32,6 +32,7 @@ @JsonPropertyOrder({ AdditionalPropertiesAnyType.JSON_PROPERTY_NAME }) +@JsonTypeName("AdditionalPropertiesAnyType") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesAnyType extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index 79e87782bd2c..0115b4dd963b 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -33,6 +33,7 @@ @JsonPropertyOrder({ AdditionalPropertiesArray.JSON_PROPERTY_NAME }) +@JsonTypeName("AdditionalPropertiesArray") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesArray extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index 8c5bc6271da0..a430b6fc5729 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -32,6 +32,7 @@ @JsonPropertyOrder({ AdditionalPropertiesBoolean.JSON_PROPERTY_NAME }) +@JsonTypeName("AdditionalPropertiesBoolean") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesBoolean extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index 72b63a9ecefb..fe92686d699b 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -44,6 +44,7 @@ AdditionalPropertiesClass.JSON_PROPERTY_ANYTYPE2, AdditionalPropertiesClass.JSON_PROPERTY_ANYTYPE3 }) +@JsonTypeName("AdditionalPropertiesClass") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesClass { public static final String JSON_PROPERTY_MAP_STRING = "map_string"; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index 41d50c58ceae..9f7587c2edf3 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -32,6 +32,7 @@ @JsonPropertyOrder({ AdditionalPropertiesInteger.JSON_PROPERTY_NAME }) +@JsonTypeName("AdditionalPropertiesInteger") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesInteger extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index 5b656c5825a4..9700dab2bd2b 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -33,6 +33,7 @@ @JsonPropertyOrder({ AdditionalPropertiesNumber.JSON_PROPERTY_NAME }) +@JsonTypeName("AdditionalPropertiesNumber") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesNumber extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index 2326f099b488..60a59e97a228 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -32,6 +32,7 @@ @JsonPropertyOrder({ AdditionalPropertiesObject.JSON_PROPERTY_NAME }) +@JsonTypeName("AdditionalPropertiesObject") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesObject extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index cde27cbad9fb..5d355241baf8 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -32,6 +32,7 @@ @JsonPropertyOrder({ AdditionalPropertiesString.JSON_PROPERTY_NAME }) +@JsonTypeName("AdditionalPropertiesString") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesString extends HashMap { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Animal.java index 9dc580215d1f..99d5797e86e8 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Animal.java @@ -36,6 +36,7 @@ Animal.JSON_PROPERTY_CLASS_NAME, Animal.JSON_PROPERTY_COLOR }) +@JsonTypeName("Animal") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) @JsonSubTypes({ diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index 13daa9824158..80f01df5c690 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -33,6 +33,7 @@ @JsonPropertyOrder({ ArrayOfArrayOfNumberOnly.JSON_PROPERTY_ARRAY_ARRAY_NUMBER }) +@JsonTypeName("ArrayOfArrayOfNumberOnly") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ArrayOfArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index de2bc5fd8e07..9cc52573b7e6 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -33,6 +33,7 @@ @JsonPropertyOrder({ ArrayOfNumberOnly.JSON_PROPERTY_ARRAY_NUMBER }) +@JsonTypeName("ArrayOfNumberOnly") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber"; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ArrayTest.java index 3c88533eaa52..96f71f6261aa 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -35,6 +35,7 @@ ArrayTest.JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER, ArrayTest.JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL }) +@JsonTypeName("ArrayTest") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ArrayTest { public static final String JSON_PROPERTY_ARRAY_OF_STRING = "array_of_string"; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/BigCat.java index 864ec623e435..b3033deacc7d 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/BigCat.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/BigCat.java @@ -34,6 +34,7 @@ @JsonPropertyOrder({ BigCat.JSON_PROPERTY_KIND }) +@JsonTypeName("BigCat") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/BigCatAllOf.java index a22af0b67c02..6a3df7eafcaa 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/BigCatAllOf.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -30,6 +30,7 @@ @JsonPropertyOrder({ BigCatAllOf.JSON_PROPERTY_KIND }) +@JsonTypeName("BigCat_allOf") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class BigCatAllOf { /** diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Capitalization.java index c7ea7879dbef..6d7704bfba08 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Capitalization.java @@ -35,6 +35,7 @@ Capitalization.JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS, Capitalization.JSON_PROPERTY_A_T_T_N_A_M_E }) +@JsonTypeName("Capitalization") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Capitalization { public static final String JSON_PROPERTY_SMALL_CAMEL = "smallCamel"; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Cat.java index 664eb00008be..ed7d126fa5c7 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Cat.java @@ -35,6 +35,7 @@ @JsonPropertyOrder({ Cat.JSON_PROPERTY_DECLAWED }) +@JsonTypeName("Cat") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) @JsonSubTypes({ diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/CatAllOf.java index bbbb99689bdf..a90ea75ffb71 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -30,6 +30,7 @@ @JsonPropertyOrder({ CatAllOf.JSON_PROPERTY_DECLAWED }) +@JsonTypeName("Cat_allOf") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class CatAllOf { public static final String JSON_PROPERTY_DECLAWED = "declawed"; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Category.java index 5823854c4c9f..87a09fb2bae7 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Category.java @@ -31,6 +31,7 @@ Category.JSON_PROPERTY_ID, Category.JSON_PROPERTY_NAME }) +@JsonTypeName("Category") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Category { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ClassModel.java index 93445a9610c1..c4008f60e646 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ClassModel.java @@ -31,6 +31,7 @@ @JsonPropertyOrder({ ClassModel.JSON_PROPERTY_PROPERTY_CLASS }) +@JsonTypeName("ClassModel") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ClassModel { public static final String JSON_PROPERTY_PROPERTY_CLASS = "_class"; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Client.java index 2820a5517c90..013eeba9b6ec 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Client.java @@ -30,6 +30,7 @@ @JsonPropertyOrder({ Client.JSON_PROPERTY_CLIENT }) +@JsonTypeName("Client") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Client { public static final String JSON_PROPERTY_CLIENT = "client"; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Dog.java index d81430849bb3..5f29f08ac2e6 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Dog.java @@ -34,6 +34,7 @@ @JsonPropertyOrder({ Dog.JSON_PROPERTY_BREED }) +@JsonTypeName("Dog") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/DogAllOf.java index 21babf245444..c5af5ce9324b 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -30,6 +30,7 @@ @JsonPropertyOrder({ DogAllOf.JSON_PROPERTY_BREED }) +@JsonTypeName("Dog_allOf") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class DogAllOf { public static final String JSON_PROPERTY_BREED = "breed"; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/EnumArrays.java index e670cf4b3914..703122c4b773 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -33,6 +33,7 @@ EnumArrays.JSON_PROPERTY_JUST_SYMBOL, EnumArrays.JSON_PROPERTY_ARRAY_ENUM }) +@JsonTypeName("EnumArrays") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class EnumArrays { /** diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/EnumTest.java index e58cb6c26273..180480621bf2 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/EnumTest.java @@ -35,6 +35,7 @@ EnumTest.JSON_PROPERTY_ENUM_NUMBER, EnumTest.JSON_PROPERTY_OUTER_ENUM }) +@JsonTypeName("Enum_Test") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class EnumTest { /** diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index e22a96e86da9..4ed33e999cc9 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -33,6 +33,7 @@ FileSchemaTestClass.JSON_PROPERTY_FILE, FileSchemaTestClass.JSON_PROPERTY_FILES }) +@JsonTypeName("FileSchemaTestClass") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class FileSchemaTestClass { public static final String JSON_PROPERTY_FILE = "file"; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/FormatTest.java index 16a5c6b6a672..c06b5e2cdb65 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/FormatTest.java @@ -48,6 +48,7 @@ FormatTest.JSON_PROPERTY_PASSWORD, FormatTest.JSON_PROPERTY_BIG_DECIMAL }) +@JsonTypeName("format_test") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class FormatTest { public static final String JSON_PROPERTY_INTEGER = "integer"; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index 09ce9ea3cba6..7d19aedaf059 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -31,6 +31,7 @@ HasOnlyReadOnly.JSON_PROPERTY_BAR, HasOnlyReadOnly.JSON_PROPERTY_FOO }) +@JsonTypeName("hasOnlyReadOnly") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class HasOnlyReadOnly { public static final String JSON_PROPERTY_BAR = "bar"; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/MapTest.java index 4662120ae29d..7a54ba52864a 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/MapTest.java @@ -36,6 +36,7 @@ MapTest.JSON_PROPERTY_DIRECT_MAP, MapTest.JSON_PROPERTY_INDIRECT_MAP }) +@JsonTypeName("MapTest") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class MapTest { public static final String JSON_PROPERTY_MAP_MAP_OF_STRING = "map_map_of_string"; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 15fd74975dfd..b05c8cbc5cd6 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -38,6 +38,7 @@ MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_DATE_TIME, MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_MAP }) +@JsonTypeName("MixedPropertiesAndAdditionalPropertiesClass") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class MixedPropertiesAndAdditionalPropertiesClass { public static final String JSON_PROPERTY_UUID = "uuid"; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Model200Response.java index f4cfa618708f..a0128aa6fa55 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Model200Response.java @@ -32,6 +32,7 @@ Model200Response.JSON_PROPERTY_NAME, Model200Response.JSON_PROPERTY_PROPERTY_CLASS }) +@JsonTypeName("200_response") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Model200Response { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ModelApiResponse.java index fadebd3adae6..d4b95b9f2792 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -32,6 +32,7 @@ ModelApiResponse.JSON_PROPERTY_TYPE, ModelApiResponse.JSON_PROPERTY_MESSAGE }) +@JsonTypeName("ApiResponse") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ModelApiResponse { public static final String JSON_PROPERTY_CODE = "code"; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ModelReturn.java index fd011c26d08f..dff176002fd2 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -31,6 +31,7 @@ @JsonPropertyOrder({ ModelReturn.JSON_PROPERTY_RETURN }) +@JsonTypeName("Return") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ModelReturn { public static final String JSON_PROPERTY_RETURN = "return"; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Name.java index 2856bb62713f..0d2544deef1b 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Name.java @@ -34,6 +34,7 @@ Name.JSON_PROPERTY_PROPERTY, Name.JSON_PROPERTY_123NUMBER }) +@JsonTypeName("Name") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Name { public static final String JSON_PROPERTY_NAME = "name"; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/NumberOnly.java index 6f75ce84869a..70fd4e2bd2e0 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -31,6 +31,7 @@ @JsonPropertyOrder({ NumberOnly.JSON_PROPERTY_JUST_NUMBER }) +@JsonTypeName("NumberOnly") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class NumberOnly { public static final String JSON_PROPERTY_JUST_NUMBER = "JustNumber"; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Order.java index 7aa3053c0ae3..4b7dd3df38df 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Order.java @@ -36,6 +36,7 @@ Order.JSON_PROPERTY_STATUS, Order.JSON_PROPERTY_COMPLETE }) +@JsonTypeName("Order") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Order { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/OuterComposite.java index 01d6299649fd..5065b8e6326c 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -33,6 +33,7 @@ OuterComposite.JSON_PROPERTY_MY_STRING, OuterComposite.JSON_PROPERTY_MY_BOOLEAN }) +@JsonTypeName("OuterComposite") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class OuterComposite { public static final String JSON_PROPERTY_MY_NUMBER = "my_number"; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Pet.java index 4eec05079924..ed5a336b7de4 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Pet.java @@ -41,6 +41,7 @@ Pet.JSON_PROPERTY_TAGS, Pet.JSON_PROPERTY_STATUS }) +@JsonTypeName("Pet") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Pet { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index 938b1ab5306d..10615e92497a 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -31,6 +31,7 @@ ReadOnlyFirst.JSON_PROPERTY_BAR, ReadOnlyFirst.JSON_PROPERTY_BAZ }) +@JsonTypeName("ReadOnlyFirst") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ReadOnlyFirst { public static final String JSON_PROPERTY_BAR = "bar"; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/SpecialModelName.java index 0e689d7d2dc2..b41f654fab88 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -30,6 +30,7 @@ @JsonPropertyOrder({ SpecialModelName.JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME }) +@JsonTypeName("$special[model.name]") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SpecialModelName { public static final String JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME = "$special[property.name]"; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Tag.java index 09eb968690dd..d551564e69cc 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Tag.java @@ -31,6 +31,7 @@ Tag.JSON_PROPERTY_ID, Tag.JSON_PROPERTY_NAME }) +@JsonTypeName("Tag") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Tag { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index 0c86ba446826..c3629b1c0a7e 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -37,6 +37,7 @@ TypeHolderDefault.JSON_PROPERTY_BOOL_ITEM, TypeHolderDefault.JSON_PROPERTY_ARRAY_ITEM }) +@JsonTypeName("TypeHolderDefault") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TypeHolderDefault { public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/TypeHolderExample.java index 127acb1c0dfd..16071d123fc5 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -38,6 +38,7 @@ TypeHolderExample.JSON_PROPERTY_BOOL_ITEM, TypeHolderExample.JSON_PROPERTY_ARRAY_ITEM }) +@JsonTypeName("TypeHolderExample") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TypeHolderExample { public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/User.java index 68d6a47d486d..0f0e9cbde49a 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/User.java @@ -37,6 +37,7 @@ User.JSON_PROPERTY_PHONE, User.JSON_PROPERTY_USER_STATUS }) +@JsonTypeName("User") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class User { public static final String JSON_PROPERTY_ID = "id"; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/XmlItem.java index e7f4fb912d62..1407a6d002c0 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/XmlItem.java @@ -61,6 +61,7 @@ XmlItem.JSON_PROPERTY_PREFIX_NS_ARRAY, XmlItem.JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY }) +@JsonTypeName("XmlItem") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class XmlItem { public static final String JSON_PROPERTY_ATTRIBUTE_STRING = "attribute_string"; From b1dcf65c5b3754a7daa8fc6768d28efb5e989e3d Mon Sep 17 00:00:00 2001 From: Patrice De Saint Steban Date: Wed, 22 Jul 2020 07:13:59 +0200 Subject: [PATCH 045/129] [Avro] Default value for no required fields to null (#7006) * Default value for the non required fields to null When a field is not required, the avro schema has no default value. Has described in an [avro issues](https://issues.apache.org/jira/browse/AVRO-1803), the property default: null must be set. If we don't do this in the avro file, when we generate java code from generated avro schema, the builder fail if the data isn't set in the avro data class. * Update generated avro sample --- .../main/resources/avro-schema/pojo.mustache | 5 ++-- .../avro-schema/.openapi-generator/FILES | 8 ++++++ .../avro-schema/.openapi-generator/VERSION | 2 +- .../petstore/avro-schema/ApiResponse.avsc | 10 +++++--- .../schema/petstore/avro-schema/Category.avsc | 7 ++++-- .../petstore/avro-schema/InlineObject.avsc | 7 ++++-- .../petstore/avro-schema/InlineObject1.avsc | 7 ++++-- .../schema/petstore/avro-schema/Order.avsc | 19 +++++++++----- .../schema/petstore/avro-schema/Pet.avsc | 13 +++++++--- .../schema/petstore/avro-schema/Tag.avsc | 7 ++++-- .../schema/petstore/avro-schema/User.avsc | 25 +++++++++++++------ 11 files changed, 78 insertions(+), 32 deletions(-) create mode 100644 samples/openapi3/schema/petstore/avro-schema/.openapi-generator/FILES diff --git a/modules/openapi-generator/src/main/resources/avro-schema/pojo.mustache b/modules/openapi-generator/src/main/resources/avro-schema/pojo.mustache index 0472804f293c..e6967d322a3a 100644 --- a/modules/openapi-generator/src/main/resources/avro-schema/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/avro-schema/pojo.mustache @@ -3,7 +3,8 @@ { "name": "{{baseName}}", "type": {{^required}}["null", {{/required}}{{>typeProperty}}{{^required}}]{{/required}}, - "doc": "{{{description}}}" + "doc": "{{{description}}}"{{^required}}, + "default": null{{/required}} }{{^-last}},{{/-last}} {{/vars}} - ] \ No newline at end of file + ] diff --git a/samples/openapi3/schema/petstore/avro-schema/.openapi-generator/FILES b/samples/openapi3/schema/petstore/avro-schema/.openapi-generator/FILES new file mode 100644 index 000000000000..894d1ff1db0e --- /dev/null +++ b/samples/openapi3/schema/petstore/avro-schema/.openapi-generator/FILES @@ -0,0 +1,8 @@ +ApiResponse.avsc +Category.avsc +InlineObject.avsc +InlineObject1.avsc +Order.avsc +Pet.avsc +Tag.avsc +User.avsc diff --git a/samples/openapi3/schema/petstore/avro-schema/.openapi-generator/VERSION b/samples/openapi3/schema/petstore/avro-schema/.openapi-generator/VERSION index c3a2c7076fa8..d99e7162d01f 100644 --- a/samples/openapi3/schema/petstore/avro-schema/.openapi-generator/VERSION +++ b/samples/openapi3/schema/petstore/avro-schema/.openapi-generator/VERSION @@ -1 +1 @@ -4.2.0-SNAPSHOT \ No newline at end of file +5.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/schema/petstore/avro-schema/ApiResponse.avsc b/samples/openapi3/schema/petstore/avro-schema/ApiResponse.avsc index d3ce5cc6aea6..f105b1688d36 100644 --- a/samples/openapi3/schema/petstore/avro-schema/ApiResponse.avsc +++ b/samples/openapi3/schema/petstore/avro-schema/ApiResponse.avsc @@ -7,17 +7,21 @@ { "name": "code", "type": ["null", "int"], - "doc": "" + "doc": "", + "default": null }, { "name": "type", "type": ["null", "string"], - "doc": "" + "doc": "", + "default": null }, { "name": "message", "type": ["null", "string"], - "doc": "" + "doc": "", + "default": null } ] + } diff --git a/samples/openapi3/schema/petstore/avro-schema/Category.avsc b/samples/openapi3/schema/petstore/avro-schema/Category.avsc index 527f2d389cd9..1ff49df61c09 100644 --- a/samples/openapi3/schema/petstore/avro-schema/Category.avsc +++ b/samples/openapi3/schema/petstore/avro-schema/Category.avsc @@ -7,12 +7,15 @@ { "name": "id", "type": ["null", "long"], - "doc": "" + "doc": "", + "default": null }, { "name": "name", "type": ["null", "string"], - "doc": "" + "doc": "", + "default": null } ] + } diff --git a/samples/openapi3/schema/petstore/avro-schema/InlineObject.avsc b/samples/openapi3/schema/petstore/avro-schema/InlineObject.avsc index 70af82014c93..57b4895da793 100644 --- a/samples/openapi3/schema/petstore/avro-schema/InlineObject.avsc +++ b/samples/openapi3/schema/petstore/avro-schema/InlineObject.avsc @@ -7,12 +7,15 @@ { "name": "name", "type": ["null", "string"], - "doc": "Updated name of the pet" + "doc": "Updated name of the pet", + "default": null }, { "name": "status", "type": ["null", "string"], - "doc": "Updated status of the pet" + "doc": "Updated status of the pet", + "default": null } ] + } diff --git a/samples/openapi3/schema/petstore/avro-schema/InlineObject1.avsc b/samples/openapi3/schema/petstore/avro-schema/InlineObject1.avsc index 322dae3751e0..6ef909352034 100644 --- a/samples/openapi3/schema/petstore/avro-schema/InlineObject1.avsc +++ b/samples/openapi3/schema/petstore/avro-schema/InlineObject1.avsc @@ -7,12 +7,15 @@ { "name": "additionalMetadata", "type": ["null", "string"], - "doc": "Additional data to pass to server" + "doc": "Additional data to pass to server", + "default": null }, { "name": "file", "type": ["null", "model.File"], - "doc": "file to upload" + "doc": "file to upload", + "default": null } ] + } diff --git a/samples/openapi3/schema/petstore/avro-schema/Order.avsc b/samples/openapi3/schema/petstore/avro-schema/Order.avsc index 945f42d579e6..c1d5e6c0e6ea 100644 --- a/samples/openapi3/schema/petstore/avro-schema/Order.avsc +++ b/samples/openapi3/schema/petstore/avro-schema/Order.avsc @@ -7,22 +7,26 @@ { "name": "id", "type": ["null", "long"], - "doc": "" + "doc": "", + "default": null }, { "name": "petId", "type": ["null", "long"], - "doc": "" + "doc": "", + "default": null }, { "name": "quantity", "type": ["null", "int"], - "doc": "" + "doc": "", + "default": null }, { "name": "shipDate", "type": ["null", "string"], - "doc": "" + "doc": "", + "default": null }, { "name": "status", @@ -35,12 +39,15 @@ "delivered" ] }], - "doc": "Order Status" + "doc": "Order Status", + "default": null }, { "name": "complete", "type": ["null", "boolean"], - "doc": "" + "doc": "", + "default": null } ] + } diff --git a/samples/openapi3/schema/petstore/avro-schema/Pet.avsc b/samples/openapi3/schema/petstore/avro-schema/Pet.avsc index 46ccf5f3d66c..b2925056c203 100644 --- a/samples/openapi3/schema/petstore/avro-schema/Pet.avsc +++ b/samples/openapi3/schema/petstore/avro-schema/Pet.avsc @@ -7,12 +7,14 @@ { "name": "id", "type": ["null", "long"], - "doc": "" + "doc": "", + "default": null }, { "name": "category", "type": ["null", "model.Category"], - "doc": "" + "doc": "", + "default": null }, { "name": "name", @@ -33,7 +35,8 @@ "type": "array", "items": "model.Tag" }], - "doc": "" + "doc": "", + "default": null }, { "name": "status", @@ -46,7 +49,9 @@ "sold" ] }], - "doc": "pet status in the store" + "doc": "pet status in the store", + "default": null } ] + } diff --git a/samples/openapi3/schema/petstore/avro-schema/Tag.avsc b/samples/openapi3/schema/petstore/avro-schema/Tag.avsc index ec31d8fb17ab..ad5b34e5d4a1 100644 --- a/samples/openapi3/schema/petstore/avro-schema/Tag.avsc +++ b/samples/openapi3/schema/petstore/avro-schema/Tag.avsc @@ -7,12 +7,15 @@ { "name": "id", "type": ["null", "long"], - "doc": "" + "doc": "", + "default": null }, { "name": "name", "type": ["null", "string"], - "doc": "" + "doc": "", + "default": null } ] + } diff --git a/samples/openapi3/schema/petstore/avro-schema/User.avsc b/samples/openapi3/schema/petstore/avro-schema/User.avsc index 2654a8179461..53f1f9d36e54 100644 --- a/samples/openapi3/schema/petstore/avro-schema/User.avsc +++ b/samples/openapi3/schema/petstore/avro-schema/User.avsc @@ -7,42 +7,51 @@ { "name": "id", "type": ["null", "long"], - "doc": "" + "doc": "", + "default": null }, { "name": "username", "type": ["null", "string"], - "doc": "" + "doc": "", + "default": null }, { "name": "firstName", "type": ["null", "string"], - "doc": "" + "doc": "", + "default": null }, { "name": "lastName", "type": ["null", "string"], - "doc": "" + "doc": "", + "default": null }, { "name": "email", "type": ["null", "string"], - "doc": "" + "doc": "", + "default": null }, { "name": "password", "type": ["null", "string"], - "doc": "" + "doc": "", + "default": null }, { "name": "phone", "type": ["null", "string"], - "doc": "" + "doc": "", + "default": null }, { "name": "userStatus", "type": ["null", "int"], - "doc": "User Status" + "doc": "User Status", + "default": null } ] + } From 5e2306446f506031da83383d7d1bfa4e3dcd79cb Mon Sep 17 00:00:00 2001 From: William Cheng Date: Wed, 22 Jul 2020 15:55:25 +0800 Subject: [PATCH 046/129] add occ to the user list (#7011) --- README.md | 1 + website/src/dynamic/users.yml | 5 +++++ website/static/img/companies/occ.jpg | Bin 0 -> 3570 bytes 3 files changed, 6 insertions(+) create mode 100644 website/static/img/companies/occ.jpg diff --git a/README.md b/README.md index 585e59267d14..8fc2092b587a 100644 --- a/README.md +++ b/README.md @@ -616,6 +616,7 @@ Here are some companies/projects (alphabetical order) using OpenAPI Generator in - [Myworkout](https://myworkout.com) - [NamSor](https://www.namsor.com/) - [Nokia](https://www.nokia.com/) +- [Options Clearing Corporation (OCC)](https://www.theocc.com/) - [Openet](https://www.openet.com/) - [openVALIDATION](https://openvalidation.io/) - [Oracle](https://www.oracle.com/) diff --git a/website/src/dynamic/users.yml b/website/src/dynamic/users.yml index d7fbcd0bd4b8..00e9130070a9 100644 --- a/website/src/dynamic/users.yml +++ b/website/src/dynamic/users.yml @@ -273,6 +273,11 @@ image: "img/companies/nokia.png" infoLink: "https://www.nokia.com/" pinned: false +- + caption: Options Clearing Corporation (OCC) + image: "img/companies/occ.jpg" + infoLink: "https://www.theocc.com/" + pinned: false - caption: Openet image: "img/companies/openet.jpg" diff --git a/website/static/img/companies/occ.jpg b/website/static/img/companies/occ.jpg new file mode 100644 index 0000000000000000000000000000000000000000..054ed32546f99800bd2b60b0097f50732cbebc29 GIT binary patch literal 3570 zcmd5;i8tF>`~L>rv|3wiwNzVL(r77-c1qt)hc;3&k%p#<8H&bIgrJsaXLPZqgrv2l zwFhA=O^RZ4EQ5xjh$K`swFRlQQCr@0=6!$X{QiO8`F-v=&;H!!IrrRq&m$R@d;k>f zY~i*52m}Bi=>jBtAP(5GbC>b~Ww4?YU=^?;SQ!jfR#sC~R0o5>Y8vY5Dry?q#}8>} z8R)91=$q;r7(q--OwRN+4M!kfasRmNqCOBP;Flf3RyeXs4{) z4jHM}T2bl*f#i0}?2(b(^LGSDMpj8~$4-6IUCJsKQ9lRYKb)$1#O!-V5B!U&(|O=u zs?E{YJVVl2-tWb9)T65e`Wt|Z?0*Y`WRzs}l}#_Af+aj)pEOOX zD*+dPq~CXWD*iX<|C-Al`bqN?Af?|5|D*gz+IR1p@C~~Rvyk8UXbIzr&z`q6O-#>P zy0Y=t?YRN0JT5VVOm#B7$(I0Aq*Raa19&=@uwWM%Zv%mLTfxlR_tr^zm(N?2)z2;YtNN^fz{rBFv>9Wygaai zuKx5Joq0f8+oT4L4Q+0CrkG}q{{Pnf?xOJ%}&kEcan z=7nKN8&(#s{xS5F%K>6$cuGv9%etGldFlEIF3xj$nTT&1k^lptgslT}Un@%^6Wqg{dit$} ztz)A21BZ$yVr!Qm?^jkl%lnL6oGet^&Wr~84j1+^+|{@97WYvE65w&~jCxV+Zxqw+muXYl+u*S!i~3K( zYJxyiG2#1#+ICgdxJQRMY4LS6!aMNYBs}Zni^ikMk%^y~uEPE1oQ-2AMMsk@lq!rB zlRPyF!5ZZ@1|w-_9inEOpCv;>U8<`{`3Q>H=aq}v@OPNMR(<~ICL+(?>qh>6j z8E^L|oZ?mnXkg{ZaUyFJl{lq)Iqw@0Ui<}^eSk#%*6Hz_3B z;noV@xV=q94f5)}2xkU{t_icXwotd*-P|gPr8uwp^P{UZD;UfJo`V&mvau&RcpLM$ zvfsIJr0)x_(aLNBY9CC^M3b=5WT>OXYU$)DHadninM_qJ$f0(6tG0~`7VWo&ryeZ? zpwr;2&J)cxZ%ebneUaD_7TWV}^_}az$G3(nZ63@|qBZ6nDi7us7b!#+KD}hWd+HaV zU7&8o<;Dh`Q*^d-WhuC*f4(%ZBr9V5Pixd>XY*CXwKGk3otMgNSmI*Da|X7AY1;Mn zh+abH8sTu=`qHvKVdi)x(ymg0j8s>fBeInv%oWyVj2SsFn^Vrd>O5?4sV+Kg%H*bcgY96W z3vxOVu?oov?Lw@2DsAzM2j3lpHPmXpWf8>ihbt5*L284^vh{CP>p{|sSlYekK zD`_rd* zA)04dcyL!4?Vk3rVA5*%#k<|QpCFA5TV*_KTxMyK1h8c;tS!tN^boVvsj^PlBU$NL z0k4_wU5L;o{}#>G2jzeQ_}d%Ud-2r}eQxWB`@+kU>5j22qH4=&q<>kh<2(3fWRw=7 zy>1glWcOT{_#p}Ji)SV*zT26Gng8zSR~Pv?QYPxhZ4dVGsxAFH{%05ng-a+mS2RwL za(a(|gb{GZpI8r%CVQtiz-AaJ)=P;wfoune-uZ)Hh1m8RG`EZMB8T{~%6^Wv1gQO< zIM~z>d%T8T6Q)~?F_1UsTpt_%Rk+dl5i&{+w{3W^t(CK$QvUKZ$$4BL|9tUjo0#>0 z`YH9hkyJB6^AQr-H_i(t_Lx}0o>ii+(3r$WHKMdwozyvqpo8JFlT#4cJ3N`J=rH3( z`KzD36xr3>)Jk1%_UJpD$API8sy|XIp#6$8+U!O*@SV=FEp9x;SHC=YxeLLipY(Lc zuA@yvc}=xmdTr`@nJtbLd6+H?+v7)a9C!n(VpU zOjmCYY{8$YPY5p4G-L~=6Op%6`rw29Kjp`>jLUIBA)k|I3F959O7rYTC4X_bzNP5~ zVs}fp$r?Q9whx|ihWM}?#S7|vpEq22(Beou~aW zYT#<2jNg`{#{_N^@I+QO9)v`)$fN;1>!@h=QRNeo#p#wmoqtvf2u#GSpu8 zc`V?r(Q;#lo;#BlH;GiS|(T*3H)v;6$^TxHETg ztO^%VbN`6lXb;(3t2Q4JwfDw$&X|0+D4FK%_6+&w2(IZgHZI>lpjOcANuv-svrqKY zhV!aL{Iwtw6^4RW0};>&?cew<0csGO^s&@WilZX*)-V zWJcfdnN>UIA79yG*M_)KLfrLc^c6=jG$Ahg^%AXn}&&|12gzauT1ad zM&tzC=`V_#AiNw(>ki5OsY=vU$n}4B4#npMn51Dw Date: Wed, 22 Jul 2020 03:29:28 -0500 Subject: [PATCH 047/129] [typescript-angular] Unify authorization lookup (#6953) * [typescript-angular] Unify authorization lookup * [typescript-angular] Update samples. * [typescript-angular] Fix typo. * [typescript-angular] Revert changes to some of the sample files. * [typescript-angular] Fixed compile error. * [typescript-angular] Use arrow functions to avoid "this" issues * Document usage of credentials map. --- .../typescript-angular/api.service.mustache | 43 ++++------- .../typescript-angular/configuration.mustache | 72 +++++++++++++++++++ .../builds/default/api/pet.service.ts | 72 +++++++++---------- .../builds/default/api/store.service.ts | 9 ++- .../builds/default/configuration.ts | 53 ++++++++++++++ .../builds/with-npm/api/pet.service.ts | 72 +++++++++---------- .../builds/with-npm/api/store.service.ts | 9 ++- .../builds/with-npm/configuration.ts | 53 ++++++++++++++ .../builds/default/api/pet.service.ts | 72 +++++++++---------- .../builds/default/api/store.service.ts | 9 ++- .../builds/default/configuration.ts | 53 ++++++++++++++ .../builds/with-npm/api/pet.service.ts | 72 +++++++++---------- .../builds/with-npm/api/store.service.ts | 9 ++- .../builds/with-npm/configuration.ts | 53 ++++++++++++++ .../builds/default/api/pet.service.ts | 72 +++++++++---------- .../builds/default/api/store.service.ts | 9 ++- .../builds/default/configuration.ts | 53 ++++++++++++++ .../builds/with-npm/api/pet.service.ts | 72 +++++++++---------- .../builds/with-npm/api/store.service.ts | 9 ++- .../builds/with-npm/configuration.ts | 53 ++++++++++++++ .../builds/default/api/pet.service.ts | 72 +++++++++---------- .../builds/default/api/store.service.ts | 9 ++- .../builds/default/configuration.ts | 53 ++++++++++++++ .../builds/with-npm/api/pet.service.ts | 72 +++++++++---------- .../builds/with-npm/api/store.service.ts | 9 ++- .../builds/with-npm/configuration.ts | 53 ++++++++++++++ .../api/pet.service.ts | 72 +++++++++---------- .../api/store.service.ts | 9 ++- .../single-request-parameter/configuration.ts | 53 ++++++++++++++ .../builds/with-npm/api/pet.service.ts | 72 +++++++++---------- .../builds/with-npm/api/store.service.ts | 9 ++- .../builds/with-npm/configuration.ts | 53 ++++++++++++++ .../api/pet.service.ts | 72 +++++++++---------- .../api/store.service.ts | 9 ++- .../configuration.ts | 53 ++++++++++++++ 35 files changed, 1066 insertions(+), 523 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/typescript-angular/api.service.mustache b/modules/openapi-generator/src/main/resources/typescript-angular/api.service.mustache index 6483f9d4f21d..9e070e3616bb 100644 --- a/modules/openapi-generator/src/main/resources/typescript-angular/api.service.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-angular/api.service.mustache @@ -213,46 +213,33 @@ export class {{classname}} { {{/headerParams}} {{#authMethods}} +{{#-first}} + let credential: string | undefined; +{{/-first}} // authentication ({{name}}) required + credential = this.configuration.lookupCredential('{{name}}'); + if (credential) { {{#isApiKey}} - if (this.configuration.apiKeys) { - {{! Fallback behaviour may be removed for 5.0 release. See #5062 }} - const key: string | undefined = this.configuration.apiKeys["{{name}}"] || this.configuration.apiKeys["{{keyParamName}}"]; - if (key) { -{{#isKeyInHeader}} - headers = headers.set('{{keyParamName}}', key); -{{/isKeyInHeader}} -{{#isKeyInQuery}} - queryParameters = queryParameters.set('{{keyParamName}}', key); -{{/isKeyInQuery}} - } - } - + {{#isKeyInHeader}} + headers = headers.set('{{keyParamName}}', credential); + {{/isKeyInHeader}} + {{#isKeyInQuery}} + queryParameters = queryParameters.set('{{keyParamName}}', credential); + {{/isKeyInQuery}} {{/isApiKey}} {{#isBasic}} {{#isBasicBasic}} - if (this.configuration.username || this.configuration.password) { - headers = headers.set('Authorization', 'Basic ' + btoa(this.configuration.username + ':' + this.configuration.password)); - } + headers = headers.set('Authorization', 'Basic ' + credential); {{/isBasicBasic}} {{#isBasicBearer}} - if (this.configuration.accessToken) { - const accessToken = typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } + headers = headers.set('Authorization', 'Bearer ' + credential); {{/isBasicBearer}} {{/isBasic}} {{#isOAuth}} - if (this.configuration.accessToken) { - const accessToken = typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); + headers = headers.set('Authorization', 'Bearer ' + credential); +{{/isOAuth}} } -{{/isOAuth}} {{/authMethods}} let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; if (httpHeaderAcceptSelected === undefined) { diff --git a/modules/openapi-generator/src/main/resources/typescript-angular/configuration.mustache b/modules/openapi-generator/src/main/resources/typescript-angular/configuration.mustache index c038bbc94787..19b1314a9f66 100644 --- a/modules/openapi-generator/src/main/resources/typescript-angular/configuration.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-angular/configuration.mustache @@ -1,23 +1,47 @@ import { HttpParameterCodec } from '@angular/common/http'; export interface ConfigurationParameters { + /** + * @deprecated Since 5.0. Use credentials instead + */ apiKeys?: {[ key: string ]: string}; username?: string; password?: string; + /** + * @deprecated Since 5.0. Use credentials instead + */ accessToken?: string | (() => string); basePath?: string; withCredentials?: boolean; encoder?: HttpParameterCodec; + /** + * The keys are the names in the securitySchemes section of the OpenAPI + * document. They should map to the value used for authentication + * minus any standard prefixes such as 'Basic' or 'Bearer'. + */ + credentials?: {[ key: string ]: string | (() => string | undefined)}; } export class Configuration { + /** + * @deprecated Since 5.0. Use credentials instead + */ apiKeys?: {[ key: string ]: string}; username?: string; password?: string; + /** + * @deprecated Since 5.0. Use credentials instead + */ accessToken?: string | (() => string); basePath?: string; withCredentials?: boolean; encoder?: HttpParameterCodec; + /** + * The keys are the names in the securitySchemes section of the OpenAPI + * document. They should map to the value used for authentication + * minus any standard prefixes such as 'Basic' or 'Bearer'. + */ + credentials: {[ key: string ]: string | (() => string | undefined)}; constructor(configurationParameters: ConfigurationParameters = {}) { this.apiKeys = configurationParameters.apiKeys; @@ -27,6 +51,47 @@ export class Configuration { this.basePath = configurationParameters.basePath; this.withCredentials = configurationParameters.withCredentials; this.encoder = configurationParameters.encoder; + if (configurationParameters.credentials) { + this.credentials = configurationParameters.credentials; + } + else { + this.credentials = {}; + } +{{#authMethods}} + + // init default {{name}} credential + if (!this.credentials['{{name}}']) { +{{#isApiKey}} + this.credentials['{{name}}'] = () => { + {{! Fallback behaviour may be removed for 5.0 release. See #5062 }} + return this.apiKeys['{{name}}'] || this.apiKeys['{{keyParamName}}']; + }; +{{/isApiKey}} +{{#isBasic}} + {{#isBasicBasic}} + this.credentials['{{name}}'] = () => { + if (this.username || this.password) { + return btoa(this.username + ':' + this.password); + } + }; + {{/isBasicBasic}} + {{#isBasicBearer}} + this.credentials['{{name}}'] = () => { + return typeof this.accessToken === 'function' + ? this.accessToken() + : this.accessToken; + }; + {{/isBasicBearer}} +{{/isBasic}} +{{#isOAuth}} + this.credentials['{{name}}'] = () => { + return typeof this.accessToken === 'function' + ? this.accessToken() + : this.accessToken; + }; +{{/isOAuth}} + } +{{/authMethods}} } /** @@ -81,4 +146,11 @@ export class Configuration { const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); } + + public lookupCredential(key: string): string | undefined { + const value = this.credentials[key]; + return typeof value === 'function' + ? value() + : value; + } } diff --git a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/pet.service.ts b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/pet.service.ts index 9f889d3ab1c5..c6125084a2d6 100644 --- a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/pet.service.ts @@ -112,12 +112,11 @@ export class PetService { let headers = this.defaultHeaders; + let credential: string | undefined; // authentication (petstore_auth) required - if (this.configuration.accessToken) { - const accessToken = typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); + credential = this.configuration.lookupCredential('petstore_auth'); + if (credential) { + headers = headers.set('Authorization', 'Bearer ' + credential); } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; @@ -179,12 +178,11 @@ export class PetService { headers = headers.set('api_key', String(apiKey)); } + let credential: string | undefined; // authentication (petstore_auth) required - if (this.configuration.accessToken) { - const accessToken = typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); + credential = this.configuration.lookupCredential('petstore_auth'); + if (credential) { + headers = headers.set('Authorization', 'Bearer ' + credential); } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; @@ -238,12 +236,11 @@ export class PetService { let headers = this.defaultHeaders; + let credential: string | undefined; // authentication (petstore_auth) required - if (this.configuration.accessToken) { - const accessToken = typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); + credential = this.configuration.lookupCredential('petstore_auth'); + if (credential) { + headers = headers.set('Authorization', 'Bearer ' + credential); } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; @@ -301,12 +298,11 @@ export class PetService { let headers = this.defaultHeaders; + let credential: string | undefined; // authentication (petstore_auth) required - if (this.configuration.accessToken) { - const accessToken = typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); + credential = this.configuration.lookupCredential('petstore_auth'); + if (credential) { + headers = headers.set('Authorization', 'Bearer ' + credential); } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; @@ -357,12 +353,11 @@ export class PetService { let headers = this.defaultHeaders; + let credential: string | undefined; // authentication (api_key) required - if (this.configuration.apiKeys) { - const key: string | undefined = this.configuration.apiKeys["api_key"] || this.configuration.apiKeys["api_key"]; - if (key) { - headers = headers.set('api_key', key); - } + credential = this.configuration.lookupCredential('api_key'); + if (credential) { + headers = headers.set('api_key', credential); } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; @@ -411,12 +406,11 @@ export class PetService { let headers = this.defaultHeaders; + let credential: string | undefined; // authentication (petstore_auth) required - if (this.configuration.accessToken) { - const accessToken = typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); + credential = this.configuration.lookupCredential('petstore_auth'); + if (credential) { + headers = headers.set('Authorization', 'Bearer ' + credential); } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; @@ -476,12 +470,11 @@ export class PetService { let headers = this.defaultHeaders; + let credential: string | undefined; // authentication (petstore_auth) required - if (this.configuration.accessToken) { - const accessToken = typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); + credential = this.configuration.lookupCredential('petstore_auth'); + if (credential) { + headers = headers.set('Authorization', 'Bearer ' + credential); } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; @@ -553,12 +546,11 @@ export class PetService { let headers = this.defaultHeaders; + let credential: string | undefined; // authentication (petstore_auth) required - if (this.configuration.accessToken) { - const accessToken = typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); + credential = this.configuration.lookupCredential('petstore_auth'); + if (credential) { + headers = headers.set('Authorization', 'Bearer ' + credential); } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; diff --git a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/store.service.ts b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/store.service.ts index d7a108330092..a6065292a6db 100644 --- a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/store.service.ts @@ -140,12 +140,11 @@ export class StoreService { let headers = this.defaultHeaders; + let credential: string | undefined; // authentication (api_key) required - if (this.configuration.apiKeys) { - const key: string | undefined = this.configuration.apiKeys["api_key"] || this.configuration.apiKeys["api_key"]; - if (key) { - headers = headers.set('api_key', key); - } + credential = this.configuration.lookupCredential('api_key'); + if (credential) { + headers = headers.set('api_key', credential); } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; diff --git a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/configuration.ts b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/configuration.ts index c038bbc94787..38126642420d 100644 --- a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/configuration.ts +++ b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/configuration.ts @@ -1,23 +1,47 @@ import { HttpParameterCodec } from '@angular/common/http'; export interface ConfigurationParameters { + /** + * @deprecated Since 5.0. Use credentials instead + */ apiKeys?: {[ key: string ]: string}; username?: string; password?: string; + /** + * @deprecated Since 5.0. Use credentials instead + */ accessToken?: string | (() => string); basePath?: string; withCredentials?: boolean; encoder?: HttpParameterCodec; + /** + * The keys are the names in the securitySchemes section of the OpenAPI + * document. They should map to the value used for authentication + * minus any standard prefixes such as 'Basic' or 'Bearer'. + */ + credentials?: {[ key: string ]: string | (() => string | undefined)}; } export class Configuration { + /** + * @deprecated Since 5.0. Use credentials instead + */ apiKeys?: {[ key: string ]: string}; username?: string; password?: string; + /** + * @deprecated Since 5.0. Use credentials instead + */ accessToken?: string | (() => string); basePath?: string; withCredentials?: boolean; encoder?: HttpParameterCodec; + /** + * The keys are the names in the securitySchemes section of the OpenAPI + * document. They should map to the value used for authentication + * minus any standard prefixes such as 'Basic' or 'Bearer'. + */ + credentials: {[ key: string ]: string | (() => string | undefined)}; constructor(configurationParameters: ConfigurationParameters = {}) { this.apiKeys = configurationParameters.apiKeys; @@ -27,6 +51,28 @@ export class Configuration { this.basePath = configurationParameters.basePath; this.withCredentials = configurationParameters.withCredentials; this.encoder = configurationParameters.encoder; + if (configurationParameters.credentials) { + this.credentials = configurationParameters.credentials; + } + else { + this.credentials = {}; + } + + // init default api_key credential + if (!this.credentials['api_key']) { + this.credentials['api_key'] = () => { + return this.apiKeys['api_key'] || this.apiKeys['api_key']; + }; + } + + // init default petstore_auth credential + if (!this.credentials['petstore_auth']) { + this.credentials['petstore_auth'] = () => { + return typeof this.accessToken === 'function' + ? this.accessToken() + : this.accessToken; + }; + } } /** @@ -81,4 +127,11 @@ export class Configuration { const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); } + + public lookupCredential(key: string): string | undefined { + const value = this.credentials[key]; + return typeof value === 'function' + ? value() + : value; + } } diff --git a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/pet.service.ts index 9f889d3ab1c5..c6125084a2d6 100644 --- a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/pet.service.ts @@ -112,12 +112,11 @@ export class PetService { let headers = this.defaultHeaders; + let credential: string | undefined; // authentication (petstore_auth) required - if (this.configuration.accessToken) { - const accessToken = typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); + credential = this.configuration.lookupCredential('petstore_auth'); + if (credential) { + headers = headers.set('Authorization', 'Bearer ' + credential); } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; @@ -179,12 +178,11 @@ export class PetService { headers = headers.set('api_key', String(apiKey)); } + let credential: string | undefined; // authentication (petstore_auth) required - if (this.configuration.accessToken) { - const accessToken = typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); + credential = this.configuration.lookupCredential('petstore_auth'); + if (credential) { + headers = headers.set('Authorization', 'Bearer ' + credential); } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; @@ -238,12 +236,11 @@ export class PetService { let headers = this.defaultHeaders; + let credential: string | undefined; // authentication (petstore_auth) required - if (this.configuration.accessToken) { - const accessToken = typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); + credential = this.configuration.lookupCredential('petstore_auth'); + if (credential) { + headers = headers.set('Authorization', 'Bearer ' + credential); } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; @@ -301,12 +298,11 @@ export class PetService { let headers = this.defaultHeaders; + let credential: string | undefined; // authentication (petstore_auth) required - if (this.configuration.accessToken) { - const accessToken = typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); + credential = this.configuration.lookupCredential('petstore_auth'); + if (credential) { + headers = headers.set('Authorization', 'Bearer ' + credential); } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; @@ -357,12 +353,11 @@ export class PetService { let headers = this.defaultHeaders; + let credential: string | undefined; // authentication (api_key) required - if (this.configuration.apiKeys) { - const key: string | undefined = this.configuration.apiKeys["api_key"] || this.configuration.apiKeys["api_key"]; - if (key) { - headers = headers.set('api_key', key); - } + credential = this.configuration.lookupCredential('api_key'); + if (credential) { + headers = headers.set('api_key', credential); } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; @@ -411,12 +406,11 @@ export class PetService { let headers = this.defaultHeaders; + let credential: string | undefined; // authentication (petstore_auth) required - if (this.configuration.accessToken) { - const accessToken = typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); + credential = this.configuration.lookupCredential('petstore_auth'); + if (credential) { + headers = headers.set('Authorization', 'Bearer ' + credential); } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; @@ -476,12 +470,11 @@ export class PetService { let headers = this.defaultHeaders; + let credential: string | undefined; // authentication (petstore_auth) required - if (this.configuration.accessToken) { - const accessToken = typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); + credential = this.configuration.lookupCredential('petstore_auth'); + if (credential) { + headers = headers.set('Authorization', 'Bearer ' + credential); } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; @@ -553,12 +546,11 @@ export class PetService { let headers = this.defaultHeaders; + let credential: string | undefined; // authentication (petstore_auth) required - if (this.configuration.accessToken) { - const accessToken = typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); + credential = this.configuration.lookupCredential('petstore_auth'); + if (credential) { + headers = headers.set('Authorization', 'Bearer ' + credential); } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; diff --git a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/store.service.ts index d7a108330092..a6065292a6db 100644 --- a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/store.service.ts @@ -140,12 +140,11 @@ export class StoreService { let headers = this.defaultHeaders; + let credential: string | undefined; // authentication (api_key) required - if (this.configuration.apiKeys) { - const key: string | undefined = this.configuration.apiKeys["api_key"] || this.configuration.apiKeys["api_key"]; - if (key) { - headers = headers.set('api_key', key); - } + credential = this.configuration.lookupCredential('api_key'); + if (credential) { + headers = headers.set('api_key', credential); } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; diff --git a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/configuration.ts b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/configuration.ts index c038bbc94787..38126642420d 100644 --- a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/configuration.ts +++ b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/configuration.ts @@ -1,23 +1,47 @@ import { HttpParameterCodec } from '@angular/common/http'; export interface ConfigurationParameters { + /** + * @deprecated Since 5.0. Use credentials instead + */ apiKeys?: {[ key: string ]: string}; username?: string; password?: string; + /** + * @deprecated Since 5.0. Use credentials instead + */ accessToken?: string | (() => string); basePath?: string; withCredentials?: boolean; encoder?: HttpParameterCodec; + /** + * The keys are the names in the securitySchemes section of the OpenAPI + * document. They should map to the value used for authentication + * minus any standard prefixes such as 'Basic' or 'Bearer'. + */ + credentials?: {[ key: string ]: string | (() => string | undefined)}; } export class Configuration { + /** + * @deprecated Since 5.0. Use credentials instead + */ apiKeys?: {[ key: string ]: string}; username?: string; password?: string; + /** + * @deprecated Since 5.0. Use credentials instead + */ accessToken?: string | (() => string); basePath?: string; withCredentials?: boolean; encoder?: HttpParameterCodec; + /** + * The keys are the names in the securitySchemes section of the OpenAPI + * document. They should map to the value used for authentication + * minus any standard prefixes such as 'Basic' or 'Bearer'. + */ + credentials: {[ key: string ]: string | (() => string | undefined)}; constructor(configurationParameters: ConfigurationParameters = {}) { this.apiKeys = configurationParameters.apiKeys; @@ -27,6 +51,28 @@ export class Configuration { this.basePath = configurationParameters.basePath; this.withCredentials = configurationParameters.withCredentials; this.encoder = configurationParameters.encoder; + if (configurationParameters.credentials) { + this.credentials = configurationParameters.credentials; + } + else { + this.credentials = {}; + } + + // init default api_key credential + if (!this.credentials['api_key']) { + this.credentials['api_key'] = () => { + return this.apiKeys['api_key'] || this.apiKeys['api_key']; + }; + } + + // init default petstore_auth credential + if (!this.credentials['petstore_auth']) { + this.credentials['petstore_auth'] = () => { + return typeof this.accessToken === 'function' + ? this.accessToken() + : this.accessToken; + }; + } } /** @@ -81,4 +127,11 @@ export class Configuration { const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); } + + public lookupCredential(key: string): string | undefined { + const value = this.credentials[key]; + return typeof value === 'function' + ? value() + : value; + } } diff --git a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/pet.service.ts b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/pet.service.ts index 902dd1e814b5..46fef0be89fe 100644 --- a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/pet.service.ts @@ -114,12 +114,11 @@ export class PetService { let headers = this.defaultHeaders; + let credential: string | undefined; // authentication (petstore_auth) required - if (this.configuration.accessToken) { - const accessToken = typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); + credential = this.configuration.lookupCredential('petstore_auth'); + if (credential) { + headers = headers.set('Authorization', 'Bearer ' + credential); } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; @@ -181,12 +180,11 @@ export class PetService { headers = headers.set('api_key', String(apiKey)); } + let credential: string | undefined; // authentication (petstore_auth) required - if (this.configuration.accessToken) { - const accessToken = typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); + credential = this.configuration.lookupCredential('petstore_auth'); + if (credential) { + headers = headers.set('Authorization', 'Bearer ' + credential); } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; @@ -240,12 +238,11 @@ export class PetService { let headers = this.defaultHeaders; + let credential: string | undefined; // authentication (petstore_auth) required - if (this.configuration.accessToken) { - const accessToken = typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); + credential = this.configuration.lookupCredential('petstore_auth'); + if (credential) { + headers = headers.set('Authorization', 'Bearer ' + credential); } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; @@ -303,12 +300,11 @@ export class PetService { let headers = this.defaultHeaders; + let credential: string | undefined; // authentication (petstore_auth) required - if (this.configuration.accessToken) { - const accessToken = typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); + credential = this.configuration.lookupCredential('petstore_auth'); + if (credential) { + headers = headers.set('Authorization', 'Bearer ' + credential); } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; @@ -359,12 +355,11 @@ export class PetService { let headers = this.defaultHeaders; + let credential: string | undefined; // authentication (api_key) required - if (this.configuration.apiKeys) { - const key: string | undefined = this.configuration.apiKeys["api_key"] || this.configuration.apiKeys["api_key"]; - if (key) { - headers = headers.set('api_key', key); - } + credential = this.configuration.lookupCredential('api_key'); + if (credential) { + headers = headers.set('api_key', credential); } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; @@ -413,12 +408,11 @@ export class PetService { let headers = this.defaultHeaders; + let credential: string | undefined; // authentication (petstore_auth) required - if (this.configuration.accessToken) { - const accessToken = typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); + credential = this.configuration.lookupCredential('petstore_auth'); + if (credential) { + headers = headers.set('Authorization', 'Bearer ' + credential); } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; @@ -478,12 +472,11 @@ export class PetService { let headers = this.defaultHeaders; + let credential: string | undefined; // authentication (petstore_auth) required - if (this.configuration.accessToken) { - const accessToken = typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); + credential = this.configuration.lookupCredential('petstore_auth'); + if (credential) { + headers = headers.set('Authorization', 'Bearer ' + credential); } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; @@ -555,12 +548,11 @@ export class PetService { let headers = this.defaultHeaders; + let credential: string | undefined; // authentication (petstore_auth) required - if (this.configuration.accessToken) { - const accessToken = typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); + credential = this.configuration.lookupCredential('petstore_auth'); + if (credential) { + headers = headers.set('Authorization', 'Bearer ' + credential); } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; diff --git a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/store.service.ts b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/store.service.ts index 75ca27df3292..d5d08ab3adc3 100644 --- a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/store.service.ts @@ -142,12 +142,11 @@ export class StoreService { let headers = this.defaultHeaders; + let credential: string | undefined; // authentication (api_key) required - if (this.configuration.apiKeys) { - const key: string | undefined = this.configuration.apiKeys["api_key"] || this.configuration.apiKeys["api_key"]; - if (key) { - headers = headers.set('api_key', key); - } + credential = this.configuration.lookupCredential('api_key'); + if (credential) { + headers = headers.set('api_key', credential); } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; diff --git a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/configuration.ts b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/configuration.ts index c038bbc94787..38126642420d 100644 --- a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/configuration.ts +++ b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/configuration.ts @@ -1,23 +1,47 @@ import { HttpParameterCodec } from '@angular/common/http'; export interface ConfigurationParameters { + /** + * @deprecated Since 5.0. Use credentials instead + */ apiKeys?: {[ key: string ]: string}; username?: string; password?: string; + /** + * @deprecated Since 5.0. Use credentials instead + */ accessToken?: string | (() => string); basePath?: string; withCredentials?: boolean; encoder?: HttpParameterCodec; + /** + * The keys are the names in the securitySchemes section of the OpenAPI + * document. They should map to the value used for authentication + * minus any standard prefixes such as 'Basic' or 'Bearer'. + */ + credentials?: {[ key: string ]: string | (() => string | undefined)}; } export class Configuration { + /** + * @deprecated Since 5.0. Use credentials instead + */ apiKeys?: {[ key: string ]: string}; username?: string; password?: string; + /** + * @deprecated Since 5.0. Use credentials instead + */ accessToken?: string | (() => string); basePath?: string; withCredentials?: boolean; encoder?: HttpParameterCodec; + /** + * The keys are the names in the securitySchemes section of the OpenAPI + * document. They should map to the value used for authentication + * minus any standard prefixes such as 'Basic' or 'Bearer'. + */ + credentials: {[ key: string ]: string | (() => string | undefined)}; constructor(configurationParameters: ConfigurationParameters = {}) { this.apiKeys = configurationParameters.apiKeys; @@ -27,6 +51,28 @@ export class Configuration { this.basePath = configurationParameters.basePath; this.withCredentials = configurationParameters.withCredentials; this.encoder = configurationParameters.encoder; + if (configurationParameters.credentials) { + this.credentials = configurationParameters.credentials; + } + else { + this.credentials = {}; + } + + // init default api_key credential + if (!this.credentials['api_key']) { + this.credentials['api_key'] = () => { + return this.apiKeys['api_key'] || this.apiKeys['api_key']; + }; + } + + // init default petstore_auth credential + if (!this.credentials['petstore_auth']) { + this.credentials['petstore_auth'] = () => { + return typeof this.accessToken === 'function' + ? this.accessToken() + : this.accessToken; + }; + } } /** @@ -81,4 +127,11 @@ export class Configuration { const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); } + + public lookupCredential(key: string): string | undefined { + const value = this.credentials[key]; + return typeof value === 'function' + ? value() + : value; + } } diff --git a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/pet.service.ts index 902dd1e814b5..46fef0be89fe 100644 --- a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/pet.service.ts @@ -114,12 +114,11 @@ export class PetService { let headers = this.defaultHeaders; + let credential: string | undefined; // authentication (petstore_auth) required - if (this.configuration.accessToken) { - const accessToken = typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); + credential = this.configuration.lookupCredential('petstore_auth'); + if (credential) { + headers = headers.set('Authorization', 'Bearer ' + credential); } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; @@ -181,12 +180,11 @@ export class PetService { headers = headers.set('api_key', String(apiKey)); } + let credential: string | undefined; // authentication (petstore_auth) required - if (this.configuration.accessToken) { - const accessToken = typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); + credential = this.configuration.lookupCredential('petstore_auth'); + if (credential) { + headers = headers.set('Authorization', 'Bearer ' + credential); } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; @@ -240,12 +238,11 @@ export class PetService { let headers = this.defaultHeaders; + let credential: string | undefined; // authentication (petstore_auth) required - if (this.configuration.accessToken) { - const accessToken = typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); + credential = this.configuration.lookupCredential('petstore_auth'); + if (credential) { + headers = headers.set('Authorization', 'Bearer ' + credential); } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; @@ -303,12 +300,11 @@ export class PetService { let headers = this.defaultHeaders; + let credential: string | undefined; // authentication (petstore_auth) required - if (this.configuration.accessToken) { - const accessToken = typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); + credential = this.configuration.lookupCredential('petstore_auth'); + if (credential) { + headers = headers.set('Authorization', 'Bearer ' + credential); } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; @@ -359,12 +355,11 @@ export class PetService { let headers = this.defaultHeaders; + let credential: string | undefined; // authentication (api_key) required - if (this.configuration.apiKeys) { - const key: string | undefined = this.configuration.apiKeys["api_key"] || this.configuration.apiKeys["api_key"]; - if (key) { - headers = headers.set('api_key', key); - } + credential = this.configuration.lookupCredential('api_key'); + if (credential) { + headers = headers.set('api_key', credential); } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; @@ -413,12 +408,11 @@ export class PetService { let headers = this.defaultHeaders; + let credential: string | undefined; // authentication (petstore_auth) required - if (this.configuration.accessToken) { - const accessToken = typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); + credential = this.configuration.lookupCredential('petstore_auth'); + if (credential) { + headers = headers.set('Authorization', 'Bearer ' + credential); } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; @@ -478,12 +472,11 @@ export class PetService { let headers = this.defaultHeaders; + let credential: string | undefined; // authentication (petstore_auth) required - if (this.configuration.accessToken) { - const accessToken = typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); + credential = this.configuration.lookupCredential('petstore_auth'); + if (credential) { + headers = headers.set('Authorization', 'Bearer ' + credential); } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; @@ -555,12 +548,11 @@ export class PetService { let headers = this.defaultHeaders; + let credential: string | undefined; // authentication (petstore_auth) required - if (this.configuration.accessToken) { - const accessToken = typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); + credential = this.configuration.lookupCredential('petstore_auth'); + if (credential) { + headers = headers.set('Authorization', 'Bearer ' + credential); } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; diff --git a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/store.service.ts index 75ca27df3292..d5d08ab3adc3 100644 --- a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/store.service.ts @@ -142,12 +142,11 @@ export class StoreService { let headers = this.defaultHeaders; + let credential: string | undefined; // authentication (api_key) required - if (this.configuration.apiKeys) { - const key: string | undefined = this.configuration.apiKeys["api_key"] || this.configuration.apiKeys["api_key"]; - if (key) { - headers = headers.set('api_key', key); - } + credential = this.configuration.lookupCredential('api_key'); + if (credential) { + headers = headers.set('api_key', credential); } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; diff --git a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/configuration.ts b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/configuration.ts index c038bbc94787..38126642420d 100644 --- a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/configuration.ts +++ b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/configuration.ts @@ -1,23 +1,47 @@ import { HttpParameterCodec } from '@angular/common/http'; export interface ConfigurationParameters { + /** + * @deprecated Since 5.0. Use credentials instead + */ apiKeys?: {[ key: string ]: string}; username?: string; password?: string; + /** + * @deprecated Since 5.0. Use credentials instead + */ accessToken?: string | (() => string); basePath?: string; withCredentials?: boolean; encoder?: HttpParameterCodec; + /** + * The keys are the names in the securitySchemes section of the OpenAPI + * document. They should map to the value used for authentication + * minus any standard prefixes such as 'Basic' or 'Bearer'. + */ + credentials?: {[ key: string ]: string | (() => string | undefined)}; } export class Configuration { + /** + * @deprecated Since 5.0. Use credentials instead + */ apiKeys?: {[ key: string ]: string}; username?: string; password?: string; + /** + * @deprecated Since 5.0. Use credentials instead + */ accessToken?: string | (() => string); basePath?: string; withCredentials?: boolean; encoder?: HttpParameterCodec; + /** + * The keys are the names in the securitySchemes section of the OpenAPI + * document. They should map to the value used for authentication + * minus any standard prefixes such as 'Basic' or 'Bearer'. + */ + credentials: {[ key: string ]: string | (() => string | undefined)}; constructor(configurationParameters: ConfigurationParameters = {}) { this.apiKeys = configurationParameters.apiKeys; @@ -27,6 +51,28 @@ export class Configuration { this.basePath = configurationParameters.basePath; this.withCredentials = configurationParameters.withCredentials; this.encoder = configurationParameters.encoder; + if (configurationParameters.credentials) { + this.credentials = configurationParameters.credentials; + } + else { + this.credentials = {}; + } + + // init default api_key credential + if (!this.credentials['api_key']) { + this.credentials['api_key'] = () => { + return this.apiKeys['api_key'] || this.apiKeys['api_key']; + }; + } + + // init default petstore_auth credential + if (!this.credentials['petstore_auth']) { + this.credentials['petstore_auth'] = () => { + return typeof this.accessToken === 'function' + ? this.accessToken() + : this.accessToken; + }; + } } /** @@ -81,4 +127,11 @@ export class Configuration { const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); } + + public lookupCredential(key: string): string | undefined { + const value = this.credentials[key]; + return typeof value === 'function' + ? value() + : value; + } } diff --git a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/pet.service.ts b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/pet.service.ts index 9f889d3ab1c5..c6125084a2d6 100644 --- a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/pet.service.ts @@ -112,12 +112,11 @@ export class PetService { let headers = this.defaultHeaders; + let credential: string | undefined; // authentication (petstore_auth) required - if (this.configuration.accessToken) { - const accessToken = typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); + credential = this.configuration.lookupCredential('petstore_auth'); + if (credential) { + headers = headers.set('Authorization', 'Bearer ' + credential); } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; @@ -179,12 +178,11 @@ export class PetService { headers = headers.set('api_key', String(apiKey)); } + let credential: string | undefined; // authentication (petstore_auth) required - if (this.configuration.accessToken) { - const accessToken = typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); + credential = this.configuration.lookupCredential('petstore_auth'); + if (credential) { + headers = headers.set('Authorization', 'Bearer ' + credential); } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; @@ -238,12 +236,11 @@ export class PetService { let headers = this.defaultHeaders; + let credential: string | undefined; // authentication (petstore_auth) required - if (this.configuration.accessToken) { - const accessToken = typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); + credential = this.configuration.lookupCredential('petstore_auth'); + if (credential) { + headers = headers.set('Authorization', 'Bearer ' + credential); } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; @@ -301,12 +298,11 @@ export class PetService { let headers = this.defaultHeaders; + let credential: string | undefined; // authentication (petstore_auth) required - if (this.configuration.accessToken) { - const accessToken = typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); + credential = this.configuration.lookupCredential('petstore_auth'); + if (credential) { + headers = headers.set('Authorization', 'Bearer ' + credential); } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; @@ -357,12 +353,11 @@ export class PetService { let headers = this.defaultHeaders; + let credential: string | undefined; // authentication (api_key) required - if (this.configuration.apiKeys) { - const key: string | undefined = this.configuration.apiKeys["api_key"] || this.configuration.apiKeys["api_key"]; - if (key) { - headers = headers.set('api_key', key); - } + credential = this.configuration.lookupCredential('api_key'); + if (credential) { + headers = headers.set('api_key', credential); } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; @@ -411,12 +406,11 @@ export class PetService { let headers = this.defaultHeaders; + let credential: string | undefined; // authentication (petstore_auth) required - if (this.configuration.accessToken) { - const accessToken = typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); + credential = this.configuration.lookupCredential('petstore_auth'); + if (credential) { + headers = headers.set('Authorization', 'Bearer ' + credential); } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; @@ -476,12 +470,11 @@ export class PetService { let headers = this.defaultHeaders; + let credential: string | undefined; // authentication (petstore_auth) required - if (this.configuration.accessToken) { - const accessToken = typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); + credential = this.configuration.lookupCredential('petstore_auth'); + if (credential) { + headers = headers.set('Authorization', 'Bearer ' + credential); } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; @@ -553,12 +546,11 @@ export class PetService { let headers = this.defaultHeaders; + let credential: string | undefined; // authentication (petstore_auth) required - if (this.configuration.accessToken) { - const accessToken = typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); + credential = this.configuration.lookupCredential('petstore_auth'); + if (credential) { + headers = headers.set('Authorization', 'Bearer ' + credential); } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; diff --git a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/store.service.ts b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/store.service.ts index d7a108330092..a6065292a6db 100644 --- a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/store.service.ts @@ -140,12 +140,11 @@ export class StoreService { let headers = this.defaultHeaders; + let credential: string | undefined; // authentication (api_key) required - if (this.configuration.apiKeys) { - const key: string | undefined = this.configuration.apiKeys["api_key"] || this.configuration.apiKeys["api_key"]; - if (key) { - headers = headers.set('api_key', key); - } + credential = this.configuration.lookupCredential('api_key'); + if (credential) { + headers = headers.set('api_key', credential); } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; diff --git a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/configuration.ts b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/configuration.ts index c038bbc94787..38126642420d 100644 --- a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/configuration.ts +++ b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/configuration.ts @@ -1,23 +1,47 @@ import { HttpParameterCodec } from '@angular/common/http'; export interface ConfigurationParameters { + /** + * @deprecated Since 5.0. Use credentials instead + */ apiKeys?: {[ key: string ]: string}; username?: string; password?: string; + /** + * @deprecated Since 5.0. Use credentials instead + */ accessToken?: string | (() => string); basePath?: string; withCredentials?: boolean; encoder?: HttpParameterCodec; + /** + * The keys are the names in the securitySchemes section of the OpenAPI + * document. They should map to the value used for authentication + * minus any standard prefixes such as 'Basic' or 'Bearer'. + */ + credentials?: {[ key: string ]: string | (() => string | undefined)}; } export class Configuration { + /** + * @deprecated Since 5.0. Use credentials instead + */ apiKeys?: {[ key: string ]: string}; username?: string; password?: string; + /** + * @deprecated Since 5.0. Use credentials instead + */ accessToken?: string | (() => string); basePath?: string; withCredentials?: boolean; encoder?: HttpParameterCodec; + /** + * The keys are the names in the securitySchemes section of the OpenAPI + * document. They should map to the value used for authentication + * minus any standard prefixes such as 'Basic' or 'Bearer'. + */ + credentials: {[ key: string ]: string | (() => string | undefined)}; constructor(configurationParameters: ConfigurationParameters = {}) { this.apiKeys = configurationParameters.apiKeys; @@ -27,6 +51,28 @@ export class Configuration { this.basePath = configurationParameters.basePath; this.withCredentials = configurationParameters.withCredentials; this.encoder = configurationParameters.encoder; + if (configurationParameters.credentials) { + this.credentials = configurationParameters.credentials; + } + else { + this.credentials = {}; + } + + // init default api_key credential + if (!this.credentials['api_key']) { + this.credentials['api_key'] = () => { + return this.apiKeys['api_key'] || this.apiKeys['api_key']; + }; + } + + // init default petstore_auth credential + if (!this.credentials['petstore_auth']) { + this.credentials['petstore_auth'] = () => { + return typeof this.accessToken === 'function' + ? this.accessToken() + : this.accessToken; + }; + } } /** @@ -81,4 +127,11 @@ export class Configuration { const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); } + + public lookupCredential(key: string): string | undefined { + const value = this.credentials[key]; + return typeof value === 'function' + ? value() + : value; + } } diff --git a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/pet.service.ts index 9f889d3ab1c5..c6125084a2d6 100644 --- a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/pet.service.ts @@ -112,12 +112,11 @@ export class PetService { let headers = this.defaultHeaders; + let credential: string | undefined; // authentication (petstore_auth) required - if (this.configuration.accessToken) { - const accessToken = typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); + credential = this.configuration.lookupCredential('petstore_auth'); + if (credential) { + headers = headers.set('Authorization', 'Bearer ' + credential); } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; @@ -179,12 +178,11 @@ export class PetService { headers = headers.set('api_key', String(apiKey)); } + let credential: string | undefined; // authentication (petstore_auth) required - if (this.configuration.accessToken) { - const accessToken = typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); + credential = this.configuration.lookupCredential('petstore_auth'); + if (credential) { + headers = headers.set('Authorization', 'Bearer ' + credential); } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; @@ -238,12 +236,11 @@ export class PetService { let headers = this.defaultHeaders; + let credential: string | undefined; // authentication (petstore_auth) required - if (this.configuration.accessToken) { - const accessToken = typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); + credential = this.configuration.lookupCredential('petstore_auth'); + if (credential) { + headers = headers.set('Authorization', 'Bearer ' + credential); } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; @@ -301,12 +298,11 @@ export class PetService { let headers = this.defaultHeaders; + let credential: string | undefined; // authentication (petstore_auth) required - if (this.configuration.accessToken) { - const accessToken = typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); + credential = this.configuration.lookupCredential('petstore_auth'); + if (credential) { + headers = headers.set('Authorization', 'Bearer ' + credential); } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; @@ -357,12 +353,11 @@ export class PetService { let headers = this.defaultHeaders; + let credential: string | undefined; // authentication (api_key) required - if (this.configuration.apiKeys) { - const key: string | undefined = this.configuration.apiKeys["api_key"] || this.configuration.apiKeys["api_key"]; - if (key) { - headers = headers.set('api_key', key); - } + credential = this.configuration.lookupCredential('api_key'); + if (credential) { + headers = headers.set('api_key', credential); } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; @@ -411,12 +406,11 @@ export class PetService { let headers = this.defaultHeaders; + let credential: string | undefined; // authentication (petstore_auth) required - if (this.configuration.accessToken) { - const accessToken = typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); + credential = this.configuration.lookupCredential('petstore_auth'); + if (credential) { + headers = headers.set('Authorization', 'Bearer ' + credential); } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; @@ -476,12 +470,11 @@ export class PetService { let headers = this.defaultHeaders; + let credential: string | undefined; // authentication (petstore_auth) required - if (this.configuration.accessToken) { - const accessToken = typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); + credential = this.configuration.lookupCredential('petstore_auth'); + if (credential) { + headers = headers.set('Authorization', 'Bearer ' + credential); } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; @@ -553,12 +546,11 @@ export class PetService { let headers = this.defaultHeaders; + let credential: string | undefined; // authentication (petstore_auth) required - if (this.configuration.accessToken) { - const accessToken = typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); + credential = this.configuration.lookupCredential('petstore_auth'); + if (credential) { + headers = headers.set('Authorization', 'Bearer ' + credential); } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; diff --git a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/store.service.ts index d7a108330092..a6065292a6db 100644 --- a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/store.service.ts @@ -140,12 +140,11 @@ export class StoreService { let headers = this.defaultHeaders; + let credential: string | undefined; // authentication (api_key) required - if (this.configuration.apiKeys) { - const key: string | undefined = this.configuration.apiKeys["api_key"] || this.configuration.apiKeys["api_key"]; - if (key) { - headers = headers.set('api_key', key); - } + credential = this.configuration.lookupCredential('api_key'); + if (credential) { + headers = headers.set('api_key', credential); } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; diff --git a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/configuration.ts b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/configuration.ts index c038bbc94787..38126642420d 100644 --- a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/configuration.ts +++ b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/configuration.ts @@ -1,23 +1,47 @@ import { HttpParameterCodec } from '@angular/common/http'; export interface ConfigurationParameters { + /** + * @deprecated Since 5.0. Use credentials instead + */ apiKeys?: {[ key: string ]: string}; username?: string; password?: string; + /** + * @deprecated Since 5.0. Use credentials instead + */ accessToken?: string | (() => string); basePath?: string; withCredentials?: boolean; encoder?: HttpParameterCodec; + /** + * The keys are the names in the securitySchemes section of the OpenAPI + * document. They should map to the value used for authentication + * minus any standard prefixes such as 'Basic' or 'Bearer'. + */ + credentials?: {[ key: string ]: string | (() => string | undefined)}; } export class Configuration { + /** + * @deprecated Since 5.0. Use credentials instead + */ apiKeys?: {[ key: string ]: string}; username?: string; password?: string; + /** + * @deprecated Since 5.0. Use credentials instead + */ accessToken?: string | (() => string); basePath?: string; withCredentials?: boolean; encoder?: HttpParameterCodec; + /** + * The keys are the names in the securitySchemes section of the OpenAPI + * document. They should map to the value used for authentication + * minus any standard prefixes such as 'Basic' or 'Bearer'. + */ + credentials: {[ key: string ]: string | (() => string | undefined)}; constructor(configurationParameters: ConfigurationParameters = {}) { this.apiKeys = configurationParameters.apiKeys; @@ -27,6 +51,28 @@ export class Configuration { this.basePath = configurationParameters.basePath; this.withCredentials = configurationParameters.withCredentials; this.encoder = configurationParameters.encoder; + if (configurationParameters.credentials) { + this.credentials = configurationParameters.credentials; + } + else { + this.credentials = {}; + } + + // init default api_key credential + if (!this.credentials['api_key']) { + this.credentials['api_key'] = () => { + return this.apiKeys['api_key'] || this.apiKeys['api_key']; + }; + } + + // init default petstore_auth credential + if (!this.credentials['petstore_auth']) { + this.credentials['petstore_auth'] = () => { + return typeof this.accessToken === 'function' + ? this.accessToken() + : this.accessToken; + }; + } } /** @@ -81,4 +127,11 @@ export class Configuration { const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); } + + public lookupCredential(key: string): string | undefined { + const value = this.credentials[key]; + return typeof value === 'function' + ? value() + : value; + } } diff --git a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/pet.service.ts b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/pet.service.ts index 902dd1e814b5..46fef0be89fe 100644 --- a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/pet.service.ts @@ -114,12 +114,11 @@ export class PetService { let headers = this.defaultHeaders; + let credential: string | undefined; // authentication (petstore_auth) required - if (this.configuration.accessToken) { - const accessToken = typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); + credential = this.configuration.lookupCredential('petstore_auth'); + if (credential) { + headers = headers.set('Authorization', 'Bearer ' + credential); } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; @@ -181,12 +180,11 @@ export class PetService { headers = headers.set('api_key', String(apiKey)); } + let credential: string | undefined; // authentication (petstore_auth) required - if (this.configuration.accessToken) { - const accessToken = typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); + credential = this.configuration.lookupCredential('petstore_auth'); + if (credential) { + headers = headers.set('Authorization', 'Bearer ' + credential); } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; @@ -240,12 +238,11 @@ export class PetService { let headers = this.defaultHeaders; + let credential: string | undefined; // authentication (petstore_auth) required - if (this.configuration.accessToken) { - const accessToken = typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); + credential = this.configuration.lookupCredential('petstore_auth'); + if (credential) { + headers = headers.set('Authorization', 'Bearer ' + credential); } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; @@ -303,12 +300,11 @@ export class PetService { let headers = this.defaultHeaders; + let credential: string | undefined; // authentication (petstore_auth) required - if (this.configuration.accessToken) { - const accessToken = typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); + credential = this.configuration.lookupCredential('petstore_auth'); + if (credential) { + headers = headers.set('Authorization', 'Bearer ' + credential); } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; @@ -359,12 +355,11 @@ export class PetService { let headers = this.defaultHeaders; + let credential: string | undefined; // authentication (api_key) required - if (this.configuration.apiKeys) { - const key: string | undefined = this.configuration.apiKeys["api_key"] || this.configuration.apiKeys["api_key"]; - if (key) { - headers = headers.set('api_key', key); - } + credential = this.configuration.lookupCredential('api_key'); + if (credential) { + headers = headers.set('api_key', credential); } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; @@ -413,12 +408,11 @@ export class PetService { let headers = this.defaultHeaders; + let credential: string | undefined; // authentication (petstore_auth) required - if (this.configuration.accessToken) { - const accessToken = typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); + credential = this.configuration.lookupCredential('petstore_auth'); + if (credential) { + headers = headers.set('Authorization', 'Bearer ' + credential); } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; @@ -478,12 +472,11 @@ export class PetService { let headers = this.defaultHeaders; + let credential: string | undefined; // authentication (petstore_auth) required - if (this.configuration.accessToken) { - const accessToken = typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); + credential = this.configuration.lookupCredential('petstore_auth'); + if (credential) { + headers = headers.set('Authorization', 'Bearer ' + credential); } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; @@ -555,12 +548,11 @@ export class PetService { let headers = this.defaultHeaders; + let credential: string | undefined; // authentication (petstore_auth) required - if (this.configuration.accessToken) { - const accessToken = typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); + credential = this.configuration.lookupCredential('petstore_auth'); + if (credential) { + headers = headers.set('Authorization', 'Bearer ' + credential); } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; diff --git a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/store.service.ts b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/store.service.ts index 75ca27df3292..d5d08ab3adc3 100644 --- a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/store.service.ts @@ -142,12 +142,11 @@ export class StoreService { let headers = this.defaultHeaders; + let credential: string | undefined; // authentication (api_key) required - if (this.configuration.apiKeys) { - const key: string | undefined = this.configuration.apiKeys["api_key"] || this.configuration.apiKeys["api_key"]; - if (key) { - headers = headers.set('api_key', key); - } + credential = this.configuration.lookupCredential('api_key'); + if (credential) { + headers = headers.set('api_key', credential); } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; diff --git a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/configuration.ts b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/configuration.ts index c038bbc94787..38126642420d 100644 --- a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/configuration.ts +++ b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/configuration.ts @@ -1,23 +1,47 @@ import { HttpParameterCodec } from '@angular/common/http'; export interface ConfigurationParameters { + /** + * @deprecated Since 5.0. Use credentials instead + */ apiKeys?: {[ key: string ]: string}; username?: string; password?: string; + /** + * @deprecated Since 5.0. Use credentials instead + */ accessToken?: string | (() => string); basePath?: string; withCredentials?: boolean; encoder?: HttpParameterCodec; + /** + * The keys are the names in the securitySchemes section of the OpenAPI + * document. They should map to the value used for authentication + * minus any standard prefixes such as 'Basic' or 'Bearer'. + */ + credentials?: {[ key: string ]: string | (() => string | undefined)}; } export class Configuration { + /** + * @deprecated Since 5.0. Use credentials instead + */ apiKeys?: {[ key: string ]: string}; username?: string; password?: string; + /** + * @deprecated Since 5.0. Use credentials instead + */ accessToken?: string | (() => string); basePath?: string; withCredentials?: boolean; encoder?: HttpParameterCodec; + /** + * The keys are the names in the securitySchemes section of the OpenAPI + * document. They should map to the value used for authentication + * minus any standard prefixes such as 'Basic' or 'Bearer'. + */ + credentials: {[ key: string ]: string | (() => string | undefined)}; constructor(configurationParameters: ConfigurationParameters = {}) { this.apiKeys = configurationParameters.apiKeys; @@ -27,6 +51,28 @@ export class Configuration { this.basePath = configurationParameters.basePath; this.withCredentials = configurationParameters.withCredentials; this.encoder = configurationParameters.encoder; + if (configurationParameters.credentials) { + this.credentials = configurationParameters.credentials; + } + else { + this.credentials = {}; + } + + // init default api_key credential + if (!this.credentials['api_key']) { + this.credentials['api_key'] = () => { + return this.apiKeys['api_key'] || this.apiKeys['api_key']; + }; + } + + // init default petstore_auth credential + if (!this.credentials['petstore_auth']) { + this.credentials['petstore_auth'] = () => { + return typeof this.accessToken === 'function' + ? this.accessToken() + : this.accessToken; + }; + } } /** @@ -81,4 +127,11 @@ export class Configuration { const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); } + + public lookupCredential(key: string): string | undefined { + const value = this.credentials[key]; + return typeof value === 'function' + ? value() + : value; + } } diff --git a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/pet.service.ts index 902dd1e814b5..46fef0be89fe 100644 --- a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/pet.service.ts @@ -114,12 +114,11 @@ export class PetService { let headers = this.defaultHeaders; + let credential: string | undefined; // authentication (petstore_auth) required - if (this.configuration.accessToken) { - const accessToken = typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); + credential = this.configuration.lookupCredential('petstore_auth'); + if (credential) { + headers = headers.set('Authorization', 'Bearer ' + credential); } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; @@ -181,12 +180,11 @@ export class PetService { headers = headers.set('api_key', String(apiKey)); } + let credential: string | undefined; // authentication (petstore_auth) required - if (this.configuration.accessToken) { - const accessToken = typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); + credential = this.configuration.lookupCredential('petstore_auth'); + if (credential) { + headers = headers.set('Authorization', 'Bearer ' + credential); } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; @@ -240,12 +238,11 @@ export class PetService { let headers = this.defaultHeaders; + let credential: string | undefined; // authentication (petstore_auth) required - if (this.configuration.accessToken) { - const accessToken = typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); + credential = this.configuration.lookupCredential('petstore_auth'); + if (credential) { + headers = headers.set('Authorization', 'Bearer ' + credential); } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; @@ -303,12 +300,11 @@ export class PetService { let headers = this.defaultHeaders; + let credential: string | undefined; // authentication (petstore_auth) required - if (this.configuration.accessToken) { - const accessToken = typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); + credential = this.configuration.lookupCredential('petstore_auth'); + if (credential) { + headers = headers.set('Authorization', 'Bearer ' + credential); } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; @@ -359,12 +355,11 @@ export class PetService { let headers = this.defaultHeaders; + let credential: string | undefined; // authentication (api_key) required - if (this.configuration.apiKeys) { - const key: string | undefined = this.configuration.apiKeys["api_key"] || this.configuration.apiKeys["api_key"]; - if (key) { - headers = headers.set('api_key', key); - } + credential = this.configuration.lookupCredential('api_key'); + if (credential) { + headers = headers.set('api_key', credential); } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; @@ -413,12 +408,11 @@ export class PetService { let headers = this.defaultHeaders; + let credential: string | undefined; // authentication (petstore_auth) required - if (this.configuration.accessToken) { - const accessToken = typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); + credential = this.configuration.lookupCredential('petstore_auth'); + if (credential) { + headers = headers.set('Authorization', 'Bearer ' + credential); } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; @@ -478,12 +472,11 @@ export class PetService { let headers = this.defaultHeaders; + let credential: string | undefined; // authentication (petstore_auth) required - if (this.configuration.accessToken) { - const accessToken = typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); + credential = this.configuration.lookupCredential('petstore_auth'); + if (credential) { + headers = headers.set('Authorization', 'Bearer ' + credential); } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; @@ -555,12 +548,11 @@ export class PetService { let headers = this.defaultHeaders; + let credential: string | undefined; // authentication (petstore_auth) required - if (this.configuration.accessToken) { - const accessToken = typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); + credential = this.configuration.lookupCredential('petstore_auth'); + if (credential) { + headers = headers.set('Authorization', 'Bearer ' + credential); } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; diff --git a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/store.service.ts index 75ca27df3292..d5d08ab3adc3 100644 --- a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/store.service.ts @@ -142,12 +142,11 @@ export class StoreService { let headers = this.defaultHeaders; + let credential: string | undefined; // authentication (api_key) required - if (this.configuration.apiKeys) { - const key: string | undefined = this.configuration.apiKeys["api_key"] || this.configuration.apiKeys["api_key"]; - if (key) { - headers = headers.set('api_key', key); - } + credential = this.configuration.lookupCredential('api_key'); + if (credential) { + headers = headers.set('api_key', credential); } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; diff --git a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/configuration.ts b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/configuration.ts index c038bbc94787..38126642420d 100644 --- a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/configuration.ts +++ b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/configuration.ts @@ -1,23 +1,47 @@ import { HttpParameterCodec } from '@angular/common/http'; export interface ConfigurationParameters { + /** + * @deprecated Since 5.0. Use credentials instead + */ apiKeys?: {[ key: string ]: string}; username?: string; password?: string; + /** + * @deprecated Since 5.0. Use credentials instead + */ accessToken?: string | (() => string); basePath?: string; withCredentials?: boolean; encoder?: HttpParameterCodec; + /** + * The keys are the names in the securitySchemes section of the OpenAPI + * document. They should map to the value used for authentication + * minus any standard prefixes such as 'Basic' or 'Bearer'. + */ + credentials?: {[ key: string ]: string | (() => string | undefined)}; } export class Configuration { + /** + * @deprecated Since 5.0. Use credentials instead + */ apiKeys?: {[ key: string ]: string}; username?: string; password?: string; + /** + * @deprecated Since 5.0. Use credentials instead + */ accessToken?: string | (() => string); basePath?: string; withCredentials?: boolean; encoder?: HttpParameterCodec; + /** + * The keys are the names in the securitySchemes section of the OpenAPI + * document. They should map to the value used for authentication + * minus any standard prefixes such as 'Basic' or 'Bearer'. + */ + credentials: {[ key: string ]: string | (() => string | undefined)}; constructor(configurationParameters: ConfigurationParameters = {}) { this.apiKeys = configurationParameters.apiKeys; @@ -27,6 +51,28 @@ export class Configuration { this.basePath = configurationParameters.basePath; this.withCredentials = configurationParameters.withCredentials; this.encoder = configurationParameters.encoder; + if (configurationParameters.credentials) { + this.credentials = configurationParameters.credentials; + } + else { + this.credentials = {}; + } + + // init default api_key credential + if (!this.credentials['api_key']) { + this.credentials['api_key'] = () => { + return this.apiKeys['api_key'] || this.apiKeys['api_key']; + }; + } + + // init default petstore_auth credential + if (!this.credentials['petstore_auth']) { + this.credentials['petstore_auth'] = () => { + return typeof this.accessToken === 'function' + ? this.accessToken() + : this.accessToken; + }; + } } /** @@ -81,4 +127,11 @@ export class Configuration { const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); } + + public lookupCredential(key: string): string | undefined { + const value = this.credentials[key]; + return typeof value === 'function' + ? value() + : value; + } } diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/api/pet.service.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/api/pet.service.ts index 4ef2907062a4..8552f9cb4e50 100644 --- a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/api/pet.service.ts @@ -164,12 +164,11 @@ export class PetService { let headers = this.defaultHeaders; + let credential: string | undefined; // authentication (petstore_auth) required - if (this.configuration.accessToken) { - const accessToken = typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); + credential = this.configuration.lookupCredential('petstore_auth'); + if (credential) { + headers = headers.set('Authorization', 'Bearer ' + credential); } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; @@ -232,12 +231,11 @@ export class PetService { headers = headers.set('api_key', String(apiKey)); } + let credential: string | undefined; // authentication (petstore_auth) required - if (this.configuration.accessToken) { - const accessToken = typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); + credential = this.configuration.lookupCredential('petstore_auth'); + if (credential) { + headers = headers.set('Authorization', 'Bearer ' + credential); } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; @@ -292,12 +290,11 @@ export class PetService { let headers = this.defaultHeaders; + let credential: string | undefined; // authentication (petstore_auth) required - if (this.configuration.accessToken) { - const accessToken = typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); + credential = this.configuration.lookupCredential('petstore_auth'); + if (credential) { + headers = headers.set('Authorization', 'Bearer ' + credential); } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; @@ -356,12 +353,11 @@ export class PetService { let headers = this.defaultHeaders; + let credential: string | undefined; // authentication (petstore_auth) required - if (this.configuration.accessToken) { - const accessToken = typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); + credential = this.configuration.lookupCredential('petstore_auth'); + if (credential) { + headers = headers.set('Authorization', 'Bearer ' + credential); } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; @@ -413,12 +409,11 @@ export class PetService { let headers = this.defaultHeaders; + let credential: string | undefined; // authentication (api_key) required - if (this.configuration.apiKeys) { - const key: string | undefined = this.configuration.apiKeys["api_key"] || this.configuration.apiKeys["api_key"]; - if (key) { - headers = headers.set('api_key', key); - } + credential = this.configuration.lookupCredential('api_key'); + if (credential) { + headers = headers.set('api_key', credential); } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; @@ -468,12 +463,11 @@ export class PetService { let headers = this.defaultHeaders; + let credential: string | undefined; // authentication (petstore_auth) required - if (this.configuration.accessToken) { - const accessToken = typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); + credential = this.configuration.lookupCredential('petstore_auth'); + if (credential) { + headers = headers.set('Authorization', 'Bearer ' + credential); } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; @@ -534,12 +528,11 @@ export class PetService { let headers = this.defaultHeaders; + let credential: string | undefined; // authentication (petstore_auth) required - if (this.configuration.accessToken) { - const accessToken = typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); + credential = this.configuration.lookupCredential('petstore_auth'); + if (credential) { + headers = headers.set('Authorization', 'Bearer ' + credential); } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; @@ -612,12 +605,11 @@ export class PetService { let headers = this.defaultHeaders; + let credential: string | undefined; // authentication (petstore_auth) required - if (this.configuration.accessToken) { - const accessToken = typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); + credential = this.configuration.lookupCredential('petstore_auth'); + if (credential) { + headers = headers.set('Authorization', 'Bearer ' + credential); } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/api/store.service.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/api/store.service.ts index 6eefcb781440..b44e765a0fa4 100644 --- a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/api/store.service.ts @@ -158,12 +158,11 @@ export class StoreService { let headers = this.defaultHeaders; + let credential: string | undefined; // authentication (api_key) required - if (this.configuration.apiKeys) { - const key: string | undefined = this.configuration.apiKeys["api_key"] || this.configuration.apiKeys["api_key"]; - if (key) { - headers = headers.set('api_key', key); - } + credential = this.configuration.lookupCredential('api_key'); + if (credential) { + headers = headers.set('api_key', credential); } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/configuration.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/configuration.ts index c038bbc94787..38126642420d 100644 --- a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/configuration.ts +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/configuration.ts @@ -1,23 +1,47 @@ import { HttpParameterCodec } from '@angular/common/http'; export interface ConfigurationParameters { + /** + * @deprecated Since 5.0. Use credentials instead + */ apiKeys?: {[ key: string ]: string}; username?: string; password?: string; + /** + * @deprecated Since 5.0. Use credentials instead + */ accessToken?: string | (() => string); basePath?: string; withCredentials?: boolean; encoder?: HttpParameterCodec; + /** + * The keys are the names in the securitySchemes section of the OpenAPI + * document. They should map to the value used for authentication + * minus any standard prefixes such as 'Basic' or 'Bearer'. + */ + credentials?: {[ key: string ]: string | (() => string | undefined)}; } export class Configuration { + /** + * @deprecated Since 5.0. Use credentials instead + */ apiKeys?: {[ key: string ]: string}; username?: string; password?: string; + /** + * @deprecated Since 5.0. Use credentials instead + */ accessToken?: string | (() => string); basePath?: string; withCredentials?: boolean; encoder?: HttpParameterCodec; + /** + * The keys are the names in the securitySchemes section of the OpenAPI + * document. They should map to the value used for authentication + * minus any standard prefixes such as 'Basic' or 'Bearer'. + */ + credentials: {[ key: string ]: string | (() => string | undefined)}; constructor(configurationParameters: ConfigurationParameters = {}) { this.apiKeys = configurationParameters.apiKeys; @@ -27,6 +51,28 @@ export class Configuration { this.basePath = configurationParameters.basePath; this.withCredentials = configurationParameters.withCredentials; this.encoder = configurationParameters.encoder; + if (configurationParameters.credentials) { + this.credentials = configurationParameters.credentials; + } + else { + this.credentials = {}; + } + + // init default api_key credential + if (!this.credentials['api_key']) { + this.credentials['api_key'] = () => { + return this.apiKeys['api_key'] || this.apiKeys['api_key']; + }; + } + + // init default petstore_auth credential + if (!this.credentials['petstore_auth']) { + this.credentials['petstore_auth'] = () => { + return typeof this.accessToken === 'function' + ? this.accessToken() + : this.accessToken; + }; + } } /** @@ -81,4 +127,11 @@ export class Configuration { const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); } + + public lookupCredential(key: string): string | undefined { + const value = this.credentials[key]; + return typeof value === 'function' + ? value() + : value; + } } diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api/pet.service.ts index 902dd1e814b5..46fef0be89fe 100644 --- a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api/pet.service.ts @@ -114,12 +114,11 @@ export class PetService { let headers = this.defaultHeaders; + let credential: string | undefined; // authentication (petstore_auth) required - if (this.configuration.accessToken) { - const accessToken = typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); + credential = this.configuration.lookupCredential('petstore_auth'); + if (credential) { + headers = headers.set('Authorization', 'Bearer ' + credential); } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; @@ -181,12 +180,11 @@ export class PetService { headers = headers.set('api_key', String(apiKey)); } + let credential: string | undefined; // authentication (petstore_auth) required - if (this.configuration.accessToken) { - const accessToken = typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); + credential = this.configuration.lookupCredential('petstore_auth'); + if (credential) { + headers = headers.set('Authorization', 'Bearer ' + credential); } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; @@ -240,12 +238,11 @@ export class PetService { let headers = this.defaultHeaders; + let credential: string | undefined; // authentication (petstore_auth) required - if (this.configuration.accessToken) { - const accessToken = typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); + credential = this.configuration.lookupCredential('petstore_auth'); + if (credential) { + headers = headers.set('Authorization', 'Bearer ' + credential); } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; @@ -303,12 +300,11 @@ export class PetService { let headers = this.defaultHeaders; + let credential: string | undefined; // authentication (petstore_auth) required - if (this.configuration.accessToken) { - const accessToken = typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); + credential = this.configuration.lookupCredential('petstore_auth'); + if (credential) { + headers = headers.set('Authorization', 'Bearer ' + credential); } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; @@ -359,12 +355,11 @@ export class PetService { let headers = this.defaultHeaders; + let credential: string | undefined; // authentication (api_key) required - if (this.configuration.apiKeys) { - const key: string | undefined = this.configuration.apiKeys["api_key"] || this.configuration.apiKeys["api_key"]; - if (key) { - headers = headers.set('api_key', key); - } + credential = this.configuration.lookupCredential('api_key'); + if (credential) { + headers = headers.set('api_key', credential); } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; @@ -413,12 +408,11 @@ export class PetService { let headers = this.defaultHeaders; + let credential: string | undefined; // authentication (petstore_auth) required - if (this.configuration.accessToken) { - const accessToken = typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); + credential = this.configuration.lookupCredential('petstore_auth'); + if (credential) { + headers = headers.set('Authorization', 'Bearer ' + credential); } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; @@ -478,12 +472,11 @@ export class PetService { let headers = this.defaultHeaders; + let credential: string | undefined; // authentication (petstore_auth) required - if (this.configuration.accessToken) { - const accessToken = typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); + credential = this.configuration.lookupCredential('petstore_auth'); + if (credential) { + headers = headers.set('Authorization', 'Bearer ' + credential); } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; @@ -555,12 +548,11 @@ export class PetService { let headers = this.defaultHeaders; + let credential: string | undefined; // authentication (petstore_auth) required - if (this.configuration.accessToken) { - const accessToken = typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); + credential = this.configuration.lookupCredential('petstore_auth'); + if (credential) { + headers = headers.set('Authorization', 'Bearer ' + credential); } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api/store.service.ts index 75ca27df3292..d5d08ab3adc3 100644 --- a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api/store.service.ts @@ -142,12 +142,11 @@ export class StoreService { let headers = this.defaultHeaders; + let credential: string | undefined; // authentication (api_key) required - if (this.configuration.apiKeys) { - const key: string | undefined = this.configuration.apiKeys["api_key"] || this.configuration.apiKeys["api_key"]; - if (key) { - headers = headers.set('api_key', key); - } + credential = this.configuration.lookupCredential('api_key'); + if (credential) { + headers = headers.set('api_key', credential); } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/configuration.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/configuration.ts index c038bbc94787..38126642420d 100644 --- a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/configuration.ts +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/configuration.ts @@ -1,23 +1,47 @@ import { HttpParameterCodec } from '@angular/common/http'; export interface ConfigurationParameters { + /** + * @deprecated Since 5.0. Use credentials instead + */ apiKeys?: {[ key: string ]: string}; username?: string; password?: string; + /** + * @deprecated Since 5.0. Use credentials instead + */ accessToken?: string | (() => string); basePath?: string; withCredentials?: boolean; encoder?: HttpParameterCodec; + /** + * The keys are the names in the securitySchemes section of the OpenAPI + * document. They should map to the value used for authentication + * minus any standard prefixes such as 'Basic' or 'Bearer'. + */ + credentials?: {[ key: string ]: string | (() => string | undefined)}; } export class Configuration { + /** + * @deprecated Since 5.0. Use credentials instead + */ apiKeys?: {[ key: string ]: string}; username?: string; password?: string; + /** + * @deprecated Since 5.0. Use credentials instead + */ accessToken?: string | (() => string); basePath?: string; withCredentials?: boolean; encoder?: HttpParameterCodec; + /** + * The keys are the names in the securitySchemes section of the OpenAPI + * document. They should map to the value used for authentication + * minus any standard prefixes such as 'Basic' or 'Bearer'. + */ + credentials: {[ key: string ]: string | (() => string | undefined)}; constructor(configurationParameters: ConfigurationParameters = {}) { this.apiKeys = configurationParameters.apiKeys; @@ -27,6 +51,28 @@ export class Configuration { this.basePath = configurationParameters.basePath; this.withCredentials = configurationParameters.withCredentials; this.encoder = configurationParameters.encoder; + if (configurationParameters.credentials) { + this.credentials = configurationParameters.credentials; + } + else { + this.credentials = {}; + } + + // init default api_key credential + if (!this.credentials['api_key']) { + this.credentials['api_key'] = () => { + return this.apiKeys['api_key'] || this.apiKeys['api_key']; + }; + } + + // init default petstore_auth credential + if (!this.credentials['petstore_auth']) { + this.credentials['petstore_auth'] = () => { + return typeof this.accessToken === 'function' + ? this.accessToken() + : this.accessToken; + }; + } } /** @@ -81,4 +127,11 @@ export class Configuration { const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); } + + public lookupCredential(key: string): string | undefined { + const value = this.credentials[key]; + return typeof value === 'function' + ? value() + : value; + } } diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/api/pet.service.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/api/pet.service.ts index 902dd1e814b5..46fef0be89fe 100644 --- a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/api/pet.service.ts @@ -114,12 +114,11 @@ export class PetService { let headers = this.defaultHeaders; + let credential: string | undefined; // authentication (petstore_auth) required - if (this.configuration.accessToken) { - const accessToken = typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); + credential = this.configuration.lookupCredential('petstore_auth'); + if (credential) { + headers = headers.set('Authorization', 'Bearer ' + credential); } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; @@ -181,12 +180,11 @@ export class PetService { headers = headers.set('api_key', String(apiKey)); } + let credential: string | undefined; // authentication (petstore_auth) required - if (this.configuration.accessToken) { - const accessToken = typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); + credential = this.configuration.lookupCredential('petstore_auth'); + if (credential) { + headers = headers.set('Authorization', 'Bearer ' + credential); } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; @@ -240,12 +238,11 @@ export class PetService { let headers = this.defaultHeaders; + let credential: string | undefined; // authentication (petstore_auth) required - if (this.configuration.accessToken) { - const accessToken = typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); + credential = this.configuration.lookupCredential('petstore_auth'); + if (credential) { + headers = headers.set('Authorization', 'Bearer ' + credential); } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; @@ -303,12 +300,11 @@ export class PetService { let headers = this.defaultHeaders; + let credential: string | undefined; // authentication (petstore_auth) required - if (this.configuration.accessToken) { - const accessToken = typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); + credential = this.configuration.lookupCredential('petstore_auth'); + if (credential) { + headers = headers.set('Authorization', 'Bearer ' + credential); } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; @@ -359,12 +355,11 @@ export class PetService { let headers = this.defaultHeaders; + let credential: string | undefined; // authentication (api_key) required - if (this.configuration.apiKeys) { - const key: string | undefined = this.configuration.apiKeys["api_key"] || this.configuration.apiKeys["api_key"]; - if (key) { - headers = headers.set('api_key', key); - } + credential = this.configuration.lookupCredential('api_key'); + if (credential) { + headers = headers.set('api_key', credential); } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; @@ -413,12 +408,11 @@ export class PetService { let headers = this.defaultHeaders; + let credential: string | undefined; // authentication (petstore_auth) required - if (this.configuration.accessToken) { - const accessToken = typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); + credential = this.configuration.lookupCredential('petstore_auth'); + if (credential) { + headers = headers.set('Authorization', 'Bearer ' + credential); } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; @@ -478,12 +472,11 @@ export class PetService { let headers = this.defaultHeaders; + let credential: string | undefined; // authentication (petstore_auth) required - if (this.configuration.accessToken) { - const accessToken = typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); + credential = this.configuration.lookupCredential('petstore_auth'); + if (credential) { + headers = headers.set('Authorization', 'Bearer ' + credential); } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; @@ -555,12 +548,11 @@ export class PetService { let headers = this.defaultHeaders; + let credential: string | undefined; // authentication (petstore_auth) required - if (this.configuration.accessToken) { - const accessToken = typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); + credential = this.configuration.lookupCredential('petstore_auth'); + if (credential) { + headers = headers.set('Authorization', 'Bearer ' + credential); } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/api/store.service.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/api/store.service.ts index 75ca27df3292..d5d08ab3adc3 100644 --- a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/api/store.service.ts @@ -142,12 +142,11 @@ export class StoreService { let headers = this.defaultHeaders; + let credential: string | undefined; // authentication (api_key) required - if (this.configuration.apiKeys) { - const key: string | undefined = this.configuration.apiKeys["api_key"] || this.configuration.apiKeys["api_key"]; - if (key) { - headers = headers.set('api_key', key); - } + credential = this.configuration.lookupCredential('api_key'); + if (credential) { + headers = headers.set('api_key', credential); } let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/configuration.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/configuration.ts index c038bbc94787..38126642420d 100644 --- a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/configuration.ts +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/configuration.ts @@ -1,23 +1,47 @@ import { HttpParameterCodec } from '@angular/common/http'; export interface ConfigurationParameters { + /** + * @deprecated Since 5.0. Use credentials instead + */ apiKeys?: {[ key: string ]: string}; username?: string; password?: string; + /** + * @deprecated Since 5.0. Use credentials instead + */ accessToken?: string | (() => string); basePath?: string; withCredentials?: boolean; encoder?: HttpParameterCodec; + /** + * The keys are the names in the securitySchemes section of the OpenAPI + * document. They should map to the value used for authentication + * minus any standard prefixes such as 'Basic' or 'Bearer'. + */ + credentials?: {[ key: string ]: string | (() => string | undefined)}; } export class Configuration { + /** + * @deprecated Since 5.0. Use credentials instead + */ apiKeys?: {[ key: string ]: string}; username?: string; password?: string; + /** + * @deprecated Since 5.0. Use credentials instead + */ accessToken?: string | (() => string); basePath?: string; withCredentials?: boolean; encoder?: HttpParameterCodec; + /** + * The keys are the names in the securitySchemes section of the OpenAPI + * document. They should map to the value used for authentication + * minus any standard prefixes such as 'Basic' or 'Bearer'. + */ + credentials: {[ key: string ]: string | (() => string | undefined)}; constructor(configurationParameters: ConfigurationParameters = {}) { this.apiKeys = configurationParameters.apiKeys; @@ -27,6 +51,28 @@ export class Configuration { this.basePath = configurationParameters.basePath; this.withCredentials = configurationParameters.withCredentials; this.encoder = configurationParameters.encoder; + if (configurationParameters.credentials) { + this.credentials = configurationParameters.credentials; + } + else { + this.credentials = {}; + } + + // init default api_key credential + if (!this.credentials['api_key']) { + this.credentials['api_key'] = () => { + return this.apiKeys['api_key'] || this.apiKeys['api_key']; + }; + } + + // init default petstore_auth credential + if (!this.credentials['petstore_auth']) { + this.credentials['petstore_auth'] = () => { + return typeof this.accessToken === 'function' + ? this.accessToken() + : this.accessToken; + }; + } } /** @@ -81,4 +127,11 @@ export class Configuration { const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); } + + public lookupCredential(key: string): string | undefined { + const value = this.credentials[key]; + return typeof value === 'function' + ? value() + : value; + } } From a59e506c9e351b267f718a6e427c08680bcd1c2d Mon Sep 17 00:00:00 2001 From: agilob Date: Wed, 22 Jul 2020 09:52:54 +0100 Subject: [PATCH 048/129] [dart] fix toJson does not handle complex type (#6730) Co-authored-by: arndt <17650715+dont1like1this@users.noreply.github.com> --- .../src/main/resources/dart/class.mustache | 16 +++++++++++++--- .../openapi/lib/model/api_response.dart | 6 +++--- .../openapi/lib/model/category.dart | 4 ++-- .../openapi/lib/model/inline_object.dart | 4 ++-- .../openapi/lib/model/inline_object1.dart | 4 ++-- .../openapi/lib/model/order.dart | 12 ++++++------ .../flutter_petstore/openapi/lib/model/pet.dart | 12 ++++++------ .../flutter_petstore/openapi/lib/model/tag.dart | 4 ++-- .../flutter_petstore/openapi/lib/model/user.dart | 16 ++++++++-------- .../lib/model/api_response.dart | 6 +++--- .../lib/model/category.dart | 4 ++-- .../openapi-browser-client/lib/model/order.dart | 12 ++++++------ .../openapi-browser-client/lib/model/pet.dart | 12 ++++++------ .../openapi-browser-client/lib/model/tag.dart | 4 ++-- .../openapi-browser-client/lib/model/user.dart | 16 ++++++++-------- .../dart/openapi/lib/model/api_response.dart | 6 +++--- .../dart/openapi/lib/model/category.dart | 4 ++-- .../petstore/dart/openapi/lib/model/order.dart | 12 ++++++------ .../petstore/dart/openapi/lib/model/pet.dart | 12 ++++++------ .../petstore/dart/openapi/lib/model/tag.dart | 4 ++-- .../petstore/dart/openapi/lib/model/user.dart | 16 ++++++++-------- 21 files changed, 98 insertions(+), 88 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/dart/class.mustache b/modules/openapi-generator/src/main/resources/dart/class.mustache index 64726de30675..b69af46ffaa9 100644 --- a/modules/openapi-generator/src/main/resources/dart/class.mustache +++ b/modules/openapi-generator/src/main/resources/dart/class.mustache @@ -58,14 +58,24 @@ class {{classname}} { return { {{#vars}} {{#isDateTime}} - '{{baseName}}': {{name}} == null ? '' : {{name}}.toUtc().toIso8601String(){{^-last}},{{/-last}} + '{{baseName}}': {{name}} == null ? '' : {{name}}.toUtc().toIso8601String(){{^-last}},{{/-last}} {{/isDateTime}} {{#isDate}} - '{{baseName}}': {{name}} == null ? '' : {{name}}.toUtc().toIso8601String(){{^-last}},{{/-last}} + '{{baseName}}': {{name}} == null ? '' : {{name}}.toUtc().toIso8601String(){{^-last}},{{/-last}} {{/isDate}} {{^isDateTime}} {{^isDate}} - '{{baseName}}': {{name}}{{^-last}},{{/-last}} + {{#complexType}} + {{#isListContainer}} + '{{baseName}}': {{name}} == null ? null : {{name}}.map((item) => item.toJson()).toList(){{^-last}},{{/-last}} + {{/isListContainer}} + {{^isListContainer}} + '{{baseName}}': {{name}} == null ? null : {{name}}.toJson(){{^-last}},{{/-last}} + {{/isListContainer}} + {{/complexType}} + {{^complexType}} + '{{baseName}}': {{name}}{{^-last}},{{/-last}} + {{/complexType}} {{/isDate}} {{/isDateTime}} {{/vars}} diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/api_response.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/api_response.dart index f2fddde347ae..07ab760f4f8c 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/api_response.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/api_response.dart @@ -35,9 +35,9 @@ class ApiResponse { Map toJson() { return { - 'code': code, - 'type': type, - 'message': message + 'code': code, + 'type': type, + 'message': message }; } diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/category.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/category.dart index 1750c6a0acb1..817df42fa46c 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/category.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/category.dart @@ -28,8 +28,8 @@ class Category { Map toJson() { return { - 'id': id, - 'name': name + 'id': id, + 'name': name }; } diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/inline_object.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/inline_object.dart index 01da636b114a..70b56f81369f 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/inline_object.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/inline_object.dart @@ -28,8 +28,8 @@ class InlineObject { Map toJson() { return { - 'name': name, - 'status': status + 'name': name, + 'status': status }; } diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/inline_object1.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/inline_object1.dart index 9a50a7b88be3..f0a458ab2802 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/inline_object1.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/inline_object1.dart @@ -28,8 +28,8 @@ class InlineObject1 { Map toJson() { return { - 'additionalMetadata': additionalMetadata, - 'file': file + 'additionalMetadata': additionalMetadata, + 'file': file == null ? null : file.toJson() }; } diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/order.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/order.dart index 51d15f730415..6bd66bb554a3 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/order.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/order.dart @@ -57,12 +57,12 @@ class Order { Map toJson() { return { - 'id': id, - 'petId': petId, - 'quantity': quantity, - 'shipDate': shipDate == null ? '' : shipDate.toUtc().toIso8601String(), - 'status': status, - 'complete': complete + 'id': id, + 'petId': petId, + 'quantity': quantity, + 'shipDate': shipDate == null ? '' : shipDate.toUtc().toIso8601String(), + 'status': status, + 'complete': complete }; } diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/pet.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/pet.dart index c64406368d87..30db0ebc8417 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/pet.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/pet.dart @@ -57,12 +57,12 @@ class Pet { Map toJson() { return { - 'id': id, - 'category': category, - 'name': name, - 'photoUrls': photoUrls, - 'tags': tags, - 'status': status + 'id': id, + 'category': category == null ? null : category.toJson(), + 'name': name, + 'photoUrls': photoUrls, + 'tags': tags == null ? null : tags.map((item) => item.toJson()).toList(), + 'status': status }; } diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/tag.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/tag.dart index 980c6e016302..4657fde0d393 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/tag.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/tag.dart @@ -28,8 +28,8 @@ class Tag { Map toJson() { return { - 'id': id, - 'name': name + 'id': id, + 'name': name }; } diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/user.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/user.dart index 1555eb0a3ef5..41ed8d742f1d 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/user.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/user.dart @@ -70,14 +70,14 @@ class User { Map toJson() { return { - 'id': id, - 'username': username, - 'firstName': firstName, - 'lastName': lastName, - 'email': email, - 'password': password, - 'phone': phone, - 'userStatus': userStatus + 'id': id, + 'username': username, + 'firstName': firstName, + 'lastName': lastName, + 'email': email, + 'password': password, + 'phone': phone, + 'userStatus': userStatus }; } diff --git a/samples/client/petstore/dart/openapi-browser-client/lib/model/api_response.dart b/samples/client/petstore/dart/openapi-browser-client/lib/model/api_response.dart index f2fddde347ae..07ab760f4f8c 100644 --- a/samples/client/petstore/dart/openapi-browser-client/lib/model/api_response.dart +++ b/samples/client/petstore/dart/openapi-browser-client/lib/model/api_response.dart @@ -35,9 +35,9 @@ class ApiResponse { Map toJson() { return { - 'code': code, - 'type': type, - 'message': message + 'code': code, + 'type': type, + 'message': message }; } diff --git a/samples/client/petstore/dart/openapi-browser-client/lib/model/category.dart b/samples/client/petstore/dart/openapi-browser-client/lib/model/category.dart index 1750c6a0acb1..817df42fa46c 100644 --- a/samples/client/petstore/dart/openapi-browser-client/lib/model/category.dart +++ b/samples/client/petstore/dart/openapi-browser-client/lib/model/category.dart @@ -28,8 +28,8 @@ class Category { Map toJson() { return { - 'id': id, - 'name': name + 'id': id, + 'name': name }; } diff --git a/samples/client/petstore/dart/openapi-browser-client/lib/model/order.dart b/samples/client/petstore/dart/openapi-browser-client/lib/model/order.dart index 51d15f730415..6bd66bb554a3 100644 --- a/samples/client/petstore/dart/openapi-browser-client/lib/model/order.dart +++ b/samples/client/petstore/dart/openapi-browser-client/lib/model/order.dart @@ -57,12 +57,12 @@ class Order { Map toJson() { return { - 'id': id, - 'petId': petId, - 'quantity': quantity, - 'shipDate': shipDate == null ? '' : shipDate.toUtc().toIso8601String(), - 'status': status, - 'complete': complete + 'id': id, + 'petId': petId, + 'quantity': quantity, + 'shipDate': shipDate == null ? '' : shipDate.toUtc().toIso8601String(), + 'status': status, + 'complete': complete }; } diff --git a/samples/client/petstore/dart/openapi-browser-client/lib/model/pet.dart b/samples/client/petstore/dart/openapi-browser-client/lib/model/pet.dart index c64406368d87..30db0ebc8417 100644 --- a/samples/client/petstore/dart/openapi-browser-client/lib/model/pet.dart +++ b/samples/client/petstore/dart/openapi-browser-client/lib/model/pet.dart @@ -57,12 +57,12 @@ class Pet { Map toJson() { return { - 'id': id, - 'category': category, - 'name': name, - 'photoUrls': photoUrls, - 'tags': tags, - 'status': status + 'id': id, + 'category': category == null ? null : category.toJson(), + 'name': name, + 'photoUrls': photoUrls, + 'tags': tags == null ? null : tags.map((item) => item.toJson()).toList(), + 'status': status }; } diff --git a/samples/client/petstore/dart/openapi-browser-client/lib/model/tag.dart b/samples/client/petstore/dart/openapi-browser-client/lib/model/tag.dart index 980c6e016302..4657fde0d393 100644 --- a/samples/client/petstore/dart/openapi-browser-client/lib/model/tag.dart +++ b/samples/client/petstore/dart/openapi-browser-client/lib/model/tag.dart @@ -28,8 +28,8 @@ class Tag { Map toJson() { return { - 'id': id, - 'name': name + 'id': id, + 'name': name }; } diff --git a/samples/client/petstore/dart/openapi-browser-client/lib/model/user.dart b/samples/client/petstore/dart/openapi-browser-client/lib/model/user.dart index 1555eb0a3ef5..41ed8d742f1d 100644 --- a/samples/client/petstore/dart/openapi-browser-client/lib/model/user.dart +++ b/samples/client/petstore/dart/openapi-browser-client/lib/model/user.dart @@ -70,14 +70,14 @@ class User { Map toJson() { return { - 'id': id, - 'username': username, - 'firstName': firstName, - 'lastName': lastName, - 'email': email, - 'password': password, - 'phone': phone, - 'userStatus': userStatus + 'id': id, + 'username': username, + 'firstName': firstName, + 'lastName': lastName, + 'email': email, + 'password': password, + 'phone': phone, + 'userStatus': userStatus }; } diff --git a/samples/client/petstore/dart/openapi/lib/model/api_response.dart b/samples/client/petstore/dart/openapi/lib/model/api_response.dart index f2fddde347ae..07ab760f4f8c 100644 --- a/samples/client/petstore/dart/openapi/lib/model/api_response.dart +++ b/samples/client/petstore/dart/openapi/lib/model/api_response.dart @@ -35,9 +35,9 @@ class ApiResponse { Map toJson() { return { - 'code': code, - 'type': type, - 'message': message + 'code': code, + 'type': type, + 'message': message }; } diff --git a/samples/client/petstore/dart/openapi/lib/model/category.dart b/samples/client/petstore/dart/openapi/lib/model/category.dart index 1750c6a0acb1..817df42fa46c 100644 --- a/samples/client/petstore/dart/openapi/lib/model/category.dart +++ b/samples/client/petstore/dart/openapi/lib/model/category.dart @@ -28,8 +28,8 @@ class Category { Map toJson() { return { - 'id': id, - 'name': name + 'id': id, + 'name': name }; } diff --git a/samples/client/petstore/dart/openapi/lib/model/order.dart b/samples/client/petstore/dart/openapi/lib/model/order.dart index 51d15f730415..6bd66bb554a3 100644 --- a/samples/client/petstore/dart/openapi/lib/model/order.dart +++ b/samples/client/petstore/dart/openapi/lib/model/order.dart @@ -57,12 +57,12 @@ class Order { Map toJson() { return { - 'id': id, - 'petId': petId, - 'quantity': quantity, - 'shipDate': shipDate == null ? '' : shipDate.toUtc().toIso8601String(), - 'status': status, - 'complete': complete + 'id': id, + 'petId': petId, + 'quantity': quantity, + 'shipDate': shipDate == null ? '' : shipDate.toUtc().toIso8601String(), + 'status': status, + 'complete': complete }; } diff --git a/samples/client/petstore/dart/openapi/lib/model/pet.dart b/samples/client/petstore/dart/openapi/lib/model/pet.dart index c64406368d87..30db0ebc8417 100644 --- a/samples/client/petstore/dart/openapi/lib/model/pet.dart +++ b/samples/client/petstore/dart/openapi/lib/model/pet.dart @@ -57,12 +57,12 @@ class Pet { Map toJson() { return { - 'id': id, - 'category': category, - 'name': name, - 'photoUrls': photoUrls, - 'tags': tags, - 'status': status + 'id': id, + 'category': category == null ? null : category.toJson(), + 'name': name, + 'photoUrls': photoUrls, + 'tags': tags == null ? null : tags.map((item) => item.toJson()).toList(), + 'status': status }; } diff --git a/samples/client/petstore/dart/openapi/lib/model/tag.dart b/samples/client/petstore/dart/openapi/lib/model/tag.dart index 980c6e016302..4657fde0d393 100644 --- a/samples/client/petstore/dart/openapi/lib/model/tag.dart +++ b/samples/client/petstore/dart/openapi/lib/model/tag.dart @@ -28,8 +28,8 @@ class Tag { Map toJson() { return { - 'id': id, - 'name': name + 'id': id, + 'name': name }; } diff --git a/samples/client/petstore/dart/openapi/lib/model/user.dart b/samples/client/petstore/dart/openapi/lib/model/user.dart index 1555eb0a3ef5..41ed8d742f1d 100644 --- a/samples/client/petstore/dart/openapi/lib/model/user.dart +++ b/samples/client/petstore/dart/openapi/lib/model/user.dart @@ -70,14 +70,14 @@ class User { Map toJson() { return { - 'id': id, - 'username': username, - 'firstName': firstName, - 'lastName': lastName, - 'email': email, - 'password': password, - 'phone': phone, - 'userStatus': userStatus + 'id': id, + 'username': username, + 'firstName': firstName, + 'lastName': lastName, + 'email': email, + 'password': password, + 'phone': phone, + 'userStatus': userStatus }; } From 454ceb45fa60575cfadc96e38d2831e9d176dcb4 Mon Sep 17 00:00:00 2001 From: mvistein Date: Wed, 22 Jul 2020 11:06:14 +0200 Subject: [PATCH 049/129] Enabling forward declarations also for cpp-restsdk generator (#6996) --- .../main/resources/cpp-rest-sdk-client/model-header.mustache | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/model-header.mustache b/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/model-header.mustache index e8321341c07f..109596f437e3 100644 --- a/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/model-header.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/model-header.mustache @@ -20,6 +20,10 @@ namespace {{this}} { {{/modelNamespaceDeclarations}} +{{#vendorExtensions.x-has-forward-declarations}} +{{#vendorExtensions.x-forward-declarations}}{{.}} +{{/vendorExtensions.x-forward-declarations}} +{{/vendorExtensions.x-has-forward-declarations}} {{#isEnum}} class {{declspec}} {{classname}} : public {{#parent}}{{{parent}}}{{/parent}}{{^parent}}ModelBase{{/parent}} From df2c927dcb76bab9794c0d018204d24ae5004dfb Mon Sep 17 00:00:00 2001 From: agilob Date: Wed, 22 Jul 2020 10:14:36 +0100 Subject: [PATCH 050/129] [Dart] Annotate required named parameters in model (#6798) --- .../src/main/resources/dart2/apilib.mustache | 1 + .../src/main/resources/dart2/class.mustache | 2 +- .../src/main/resources/dart2/pubspec.mustache | 1 + .../petstore/dart2/petstore/test/pet_test.dart | 12 ++++++------ .../petstore/dart2/petstore_client_lib/lib/api.dart | 1 + .../dart2/petstore_client_lib/lib/model/pet.dart | 4 ++-- .../petstore/dart2/petstore_client_lib/pubspec.yaml | 1 + 7 files changed, 13 insertions(+), 9 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/dart2/apilib.mustache b/modules/openapi-generator/src/main/resources/dart2/apilib.mustache index 365ae92eb1d3..14c674c97de4 100644 --- a/modules/openapi-generator/src/main/resources/dart2/apilib.mustache +++ b/modules/openapi-generator/src/main/resources/dart2/apilib.mustache @@ -3,6 +3,7 @@ library {{pubName}}.api; import 'dart:async'; import 'dart:convert'; import 'package:http/http.dart'; +import 'package:meta/meta.dart'; part 'api_client.dart'; part 'api_helper.dart'; diff --git a/modules/openapi-generator/src/main/resources/dart2/class.mustache b/modules/openapi-generator/src/main/resources/dart2/class.mustache index 6c7eca10552a..0a32e58c7ab6 100644 --- a/modules/openapi-generator/src/main/resources/dart2/class.mustache +++ b/modules/openapi-generator/src/main/resources/dart2/class.mustache @@ -9,7 +9,7 @@ class {{classname}} { {{classname}}({ {{#vars}} - this.{{name}}, + {{#required}}@required this.{{name}},{{/required}}{{^required}}this.{{name}},{{/required}} {{/vars}} }); diff --git a/modules/openapi-generator/src/main/resources/dart2/pubspec.mustache b/modules/openapi-generator/src/main/resources/dart2/pubspec.mustache index 6f1bd2bb4a03..ab082fe34d86 100644 --- a/modules/openapi-generator/src/main/resources/dart2/pubspec.mustache +++ b/modules/openapi-generator/src/main/resources/dart2/pubspec.mustache @@ -8,5 +8,6 @@ environment: sdk: '>=2.0.0 <3.0.0' dependencies: http: '>=0.12.0 <0.13.0' + meta: ^1.1.8 dev_dependencies: test: ^1.3.0 diff --git a/samples/client/petstore/dart2/petstore/test/pet_test.dart b/samples/client/petstore/dart2/petstore/test/pet_test.dart index 5898c221607c..1ec614e0fddd 100644 --- a/samples/client/petstore/dart2/petstore/test/pet_test.dart +++ b/samples/client/petstore/dart2/petstore/test/pet_test.dart @@ -26,13 +26,13 @@ void main() { ..name = 'Jose' ]; return Pet( - id : id, - category: category, - tags: tags, - name: name, + id : id, + category: category, + name: name, //required field + photoUrls: ['https://petstore.com/sample/photo1.jpg'] //required field ) - ..status = status - ..photoUrls = ['https://petstore.com/sample/photo1.jpg']; + ..tags = tags + ..status = ''; } group('Pet API with live client', () { diff --git a/samples/client/petstore/dart2/petstore_client_lib/lib/api.dart b/samples/client/petstore/dart2/petstore_client_lib/lib/api.dart index e73e87223819..c13c8922431b 100644 --- a/samples/client/petstore/dart2/petstore_client_lib/lib/api.dart +++ b/samples/client/petstore/dart2/petstore_client_lib/lib/api.dart @@ -3,6 +3,7 @@ library openapi.api; import 'dart:async'; import 'dart:convert'; import 'package:http/http.dart'; +import 'package:meta/meta.dart'; part 'api_client.dart'; part 'api_helper.dart'; diff --git a/samples/client/petstore/dart2/petstore_client_lib/lib/model/pet.dart b/samples/client/petstore/dart2/petstore_client_lib/lib/model/pet.dart index 4b9c7869e656..507661984e26 100644 --- a/samples/client/petstore/dart2/petstore_client_lib/lib/model/pet.dart +++ b/samples/client/petstore/dart2/petstore_client_lib/lib/model/pet.dart @@ -18,8 +18,8 @@ class Pet { Pet({ this.id, this.category, - this.name, - this.photoUrls, + @required this.name, + @required this.photoUrls, this.tags, this.status, }); diff --git a/samples/client/petstore/dart2/petstore_client_lib/pubspec.yaml b/samples/client/petstore/dart2/petstore_client_lib/pubspec.yaml index 58c44ac9eb57..023b0822fdfb 100644 --- a/samples/client/petstore/dart2/petstore_client_lib/pubspec.yaml +++ b/samples/client/petstore/dart2/petstore_client_lib/pubspec.yaml @@ -8,5 +8,6 @@ environment: sdk: '>=2.0.0 <3.0.0' dependencies: http: '>=0.12.0 <0.13.0' + meta: ^1.1.8 dev_dependencies: test: ^1.3.0 From e9c231b50aee42da6b29c0508ba38eb732d929b0 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Wed, 22 Jul 2020 21:21:11 +0800 Subject: [PATCH 051/129] rollback feign version to 10.11 (#7012) --- docs/generators/java.md | 2 +- .../openapitools/codegen/languages/JavaClientCodegen.java | 2 +- .../resources/Java/libraries/feign/build.gradle.mustache | 2 +- .../main/resources/Java/libraries/feign/build.sbt.mustache | 6 +++--- .../src/main/resources/Java/libraries/feign/pom.mustache | 2 +- samples/client/petstore/java/feign/build.gradle | 2 +- samples/client/petstore/java/feign/build.sbt | 6 +++--- samples/client/petstore/java/feign/pom.xml | 2 +- 8 files changed, 12 insertions(+), 12 deletions(-) diff --git a/docs/generators/java.md b/docs/generators/java.md index fdbe518090d1..050d887557db 100644 --- a/docs/generators/java.md +++ b/docs/generators/java.md @@ -31,7 +31,7 @@ sidebar_label: java |invokerPackage|root package for generated code| |org.openapitools.client| |java8|Use Java8 classes instead of third party equivalents. Starting in 5.x, JDK8 is the default and the support for JDK7, JDK6 has been dropped|
**true**
Use Java 8 classes such as Base64
**false**
Various third party libraries as needed
|true| |legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. Note to developers supporting a language generator in OpenAPITools; to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.|
**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| -|library|library template (sub-template) to use|
**jersey1**
HTTP client: Jersey client 1.19.x. JSON processing: Jackson 2.9.x. Enable Java6 support using '-DsupportJava6=true'. Enable gzip request encoding using '-DuseGzipFeature=true'. IMPORTANT NOTE: jersey 1.x is no longer actively maintained so please upgrade to 'jersey2' or other HTTP libaries instead.
**jersey2**
HTTP client: Jersey client 2.25.1. JSON processing: Jackson 2.9.x
**feign**
HTTP client: OpenFeign 11.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: Jackson 2.9.x
|okhttp-gson| +|library|library template (sub-template) to use|
**jersey1**
HTTP client: Jersey client 1.19.x. JSON processing: Jackson 2.9.x. Enable Java6 support using '-DsupportJava6=true'. Enable gzip request encoding using '-DuseGzipFeature=true'. IMPORTANT NOTE: jersey 1.x is no longer actively maintained so please upgrade to 'jersey2' or other HTTP libaries instead.
**jersey2**
HTTP client: Jersey client 2.25.1. JSON processing: Jackson 2.9.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: Jackson 2.9.x
|okhttp-gson| |licenseName|The name of the license| |Unlicense| |licenseUrl|The URL of the license| |http://unlicense.org| |modelPackage|package for generated models| |org.openapitools.client.model| diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java index 797bec2c8783..0190175004a8 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java @@ -146,7 +146,7 @@ public JavaClientCodegen() { supportedLibraries.put(JERSEY1, "HTTP client: Jersey client 1.19.x. JSON processing: Jackson 2.9.x. Enable Java6 support using '-DsupportJava6=true'. Enable gzip request encoding using '-DuseGzipFeature=true'. IMPORTANT NOTE: jersey 1.x is no longer actively maintained so please upgrade to 'jersey2' or other HTTP libaries instead."); supportedLibraries.put(JERSEY2, "HTTP client: Jersey client 2.25.1. JSON processing: Jackson 2.9.x"); - supportedLibraries.put(FEIGN, "HTTP client: OpenFeign 11.x. JSON processing: Jackson 2.9.x."); + supportedLibraries.put(FEIGN, "HTTP client: OpenFeign 10.x. JSON processing: Jackson 2.9.x."); supportedLibraries.put(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'."); supportedLibraries.put(RETROFIT_2, "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)"); supportedLibraries.put(RESTTEMPLATE, "HTTP client: Spring RestTemplate 4.x. JSON processing: Jackson 2.9.x"); diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/feign/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/feign/build.gradle.mustache index 075db4f0cdbf..be03d172b213 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/feign/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/feign/build.gradle.mustache @@ -126,7 +126,7 @@ ext { {{#threetenbp}} jackson_threetenbp_version = "2.9.10" {{/threetenbp}} - feign_version = "11.0" + feign_version = "10.11" feign_form_version = "3.8.0" junit_version = "4.13" oltu_version = "1.0.1" diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/feign/build.sbt.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/feign/build.sbt.mustache index 664cc67edfca..933c9137af01 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/feign/build.sbt.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/feign/build.sbt.mustache @@ -10,9 +10,9 @@ lazy val root = (project in file(".")). resolvers += Resolver.mavenLocal, libraryDependencies ++= Seq( "io.swagger" % "swagger-annotations" % "1.5.24" % "compile", - "io.github.openfeign" % "feign-core" % "11.0" % "compile", - "io.github.openfeign" % "feign-jackson" % "11.0" % "compile", - "io.github.openfeign" % "feign-slf4j" % "11.0" % "compile", + "io.github.openfeign" % "feign-core" % "10.11" % "compile", + "io.github.openfeign" % "feign-jackson" % "10.11" % "compile", + "io.github.openfeign" % "feign-slf4j" % "10.11" % "compile", "io.github.openfeign.form" % "feign-form" % "3.8.0" % "compile", "com.fasterxml.jackson.core" % "jackson-core" % "2.10.3" % "compile", "com.fasterxml.jackson.core" % "jackson-annotations" % "2.10.3" % "compile", diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/feign/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/feign/pom.mustache index 60581b5336f2..57bf1040dfec 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/feign/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/feign/pom.mustache @@ -348,7 +348,7 @@ ${java.version} ${java.version} 1.5.24 - 11.0 + 10.11 3.8.0 2.10.3 0.2.1 diff --git a/samples/client/petstore/java/feign/build.gradle b/samples/client/petstore/java/feign/build.gradle index 5e255fb6e1ad..c6f4d17d72dd 100644 --- a/samples/client/petstore/java/feign/build.gradle +++ b/samples/client/petstore/java/feign/build.gradle @@ -100,7 +100,7 @@ ext { jackson_databind_version = "2.10.3" jackson_databind_nullable_version = "0.2.1" jackson_threetenbp_version = "2.9.10" - feign_version = "11.0" + feign_version = "10.11" feign_form_version = "3.8.0" junit_version = "4.13" oltu_version = "1.0.1" diff --git a/samples/client/petstore/java/feign/build.sbt b/samples/client/petstore/java/feign/build.sbt index 7cb8c67a8baf..4bdf37f8f7bd 100644 --- a/samples/client/petstore/java/feign/build.sbt +++ b/samples/client/petstore/java/feign/build.sbt @@ -10,9 +10,9 @@ lazy val root = (project in file(".")). resolvers += Resolver.mavenLocal, libraryDependencies ++= Seq( "io.swagger" % "swagger-annotations" % "1.5.24" % "compile", - "io.github.openfeign" % "feign-core" % "11.0" % "compile", - "io.github.openfeign" % "feign-jackson" % "11.0" % "compile", - "io.github.openfeign" % "feign-slf4j" % "11.0" % "compile", + "io.github.openfeign" % "feign-core" % "10.11" % "compile", + "io.github.openfeign" % "feign-jackson" % "10.11" % "compile", + "io.github.openfeign" % "feign-slf4j" % "10.11" % "compile", "io.github.openfeign.form" % "feign-form" % "3.8.0" % "compile", "com.fasterxml.jackson.core" % "jackson-core" % "2.10.3" % "compile", "com.fasterxml.jackson.core" % "jackson-annotations" % "2.10.3" % "compile", diff --git a/samples/client/petstore/java/feign/pom.xml b/samples/client/petstore/java/feign/pom.xml index f39214ac8926..857184f41fde 100644 --- a/samples/client/petstore/java/feign/pom.xml +++ b/samples/client/petstore/java/feign/pom.xml @@ -305,7 +305,7 @@ ${java.version} ${java.version} 1.5.24 - 11.0 + 10.11 3.8.0 2.10.3 0.2.1 From 763b8fbe3eda65543a41dbc13ff1c491c3da5381 Mon Sep 17 00:00:00 2001 From: Slavek Kabrda Date: Wed, 22 Jul 2020 18:27:02 +0200 Subject: [PATCH 052/129] [go-experimental] Fix generating array aliases as models (#6939) Co-authored-by: William Cheng --- .../go-experimental/model_simple.mustache | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/modules/openapi-generator/src/main/resources/go-experimental/model_simple.mustache b/modules/openapi-generator/src/main/resources/go-experimental/model_simple.mustache index da50f18f8e72..ddf021192f65 100644 --- a/modules/openapi-generator/src/main/resources/go-experimental/model_simple.mustache +++ b/modules/openapi-generator/src/main/resources/go-experimental/model_simple.mustache @@ -2,8 +2,13 @@ type {{classname}} struct { {{#parent}} {{^isMapModel}} +{{^isArrayModel}} {{{parent}}} +{{/isArrayModel}} {{/isMapModel}} +{{#isArrayModel}} + Items {{{parent}}} +{{/isArrayModel}} {{/parent}} {{#vars}} {{^-first}} @@ -218,9 +223,10 @@ func (o *{{classname}}) Unset{{name}}() { {{/required}} {{/vars}} func (o {{classname}}) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} + toSerialize := {{#isArrayModel}}make([]interface{}, len(o.Items)){{/isArrayModel}}{{^isArrayModel}}map[string]interface{}{}{{/isArrayModel}} {{#parent}} {{^isMapModel}} + {{^isArrayModel}} serialized{{parent}}, err{{parent}} := json.Marshal(o.{{parent}}) if err{{parent}} != nil { return []byte{}, err{{parent}} @@ -229,7 +235,13 @@ func (o {{classname}}) MarshalJSON() ([]byte, error) { if err{{parent}} != nil { return []byte{}, err{{parent}} } + {{/isArrayModel}} {{/isMapModel}} + {{#isArrayModel}} + for i, item := range o.Items { + toSerialize[i] = item + } + {{/isArrayModel}} {{/parent}} {{#vars}} {{! if argument is nullable, only serialize it if it is set}} @@ -370,4 +382,10 @@ func (o *{{{classname}}}) UnmarshalJSON(bytes []byte) (err error) { } {{/isAdditionalPropertiesTrue}} +{{#isArrayModel}} +func (o *{{{classname}}}) UnmarshalJSON(bytes []byte) (err error) { + return json.Unmarshal(bytes, &o.Items) +} + +{{/isArrayModel}} {{>nullable_model}} From 6e21ca5930978a1b468a255e6d11566f08c68d2c Mon Sep 17 00:00:00 2001 From: William Cheng Date: Thu, 23 Jul 2020 10:32:52 +0800 Subject: [PATCH 053/129] Add a link to datadog blog (#7025) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8fc2092b587a..e31497aea01e 100644 --- a/README.md +++ b/README.md @@ -762,7 +762,7 @@ Here are some companies/projects (alphabetical order) using OpenAPI Generator in - 2020-06-23 - [新規サーバーアプリケーションにTypeScriptを採用してみた](https://www.cam-inc.co.jp/news/20200623) at [CAM Tech Blog](https://www.cam-inc.co.jp/news/tech-blog/) - 2020-07-07 - [5 Best API Documentation Tools](https://blog.dreamfactory.com/5-best-api-documentation-tools/) by Susanna Bouse at [DreamFactory Blog](https://blog.dreamfactory.com/) - 2020-07-12 - [Open API 3.0の定義からgolangのサーバコードのスケルトンを作成する](https://qiita.com/professor/items/4cbd04ec084d13057bc2) by [@professor (Qiita Blog)](https://qiita.com/professor) - +- 2020-07-20 - [Datadog API client libraries now available for Java and Go](https://www.datadoghq.com/blog/java-go-libraries/) by Jordan Obey at [Datadog Blog](https://www.datadoghq.com/blog) ## [6 - About Us](#table-of-contents) From 9899315aab8d5a823898479b9ecc6405c7533acd Mon Sep 17 00:00:00 2001 From: William Cheng Date: Thu, 23 Jul 2020 10:39:04 +0800 Subject: [PATCH 054/129] [Java][jersey2] Fix `serializeToString` (#6956) * fix empty get body in serializeToString, add tests * add new file * fix serialize to better handle null string * update test comments --- .../Java/libraries/jersey2/ApiClient.mustache | 14 +++- .../org/openapitools/client/ApiClient.java | 14 +++- .../org/openapitools/client/ApiClient.java | 14 +++- .../openapitools/client/ApiClientTest.java | 64 +++++++++++++++++++ 4 files changed, 97 insertions(+), 9 deletions(-) create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/ApiClientTest.java diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/ApiClient.mustache index a10302b183df..48c9d986bb53 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/ApiClient.mustache @@ -874,9 +874,17 @@ public class ApiClient { } else { // We let jersey handle the serialization if (isBodyNullable) { // payload is nullable - entity = Entity.entity(obj == null ? "null" : obj, contentType); + if (obj instanceof String) { + entity = Entity.entity(obj == null ? "null" : "\"" + ((String)obj).replaceAll("\"", Matcher.quoteReplacement("\\\"")) + "\"", contentType); + } else { + entity = Entity.entity(obj == null ? "null" : obj, contentType); + } } else { - entity = Entity.entity(obj == null ? "" : obj, contentType); + if (obj instanceof String) { + entity = Entity.entity(obj == null ? "" : "\"" + ((String)obj).replaceAll("\"", Matcher.quoteReplacement("\\\"")) + "\"", contentType); + } else { + entity = Entity.entity(obj == null ? "" : obj, contentType); + } } } return entity; @@ -911,7 +919,7 @@ public class ApiClient { if (isBodyNullable) { return obj == null ? "null" : json.getMapper().writeValueAsString(obj); } else { - return json.getMapper().writeValueAsString(obj); + return obj == null ? "" : json.getMapper().writeValueAsString(obj); } } } catch (Exception ex) { diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java index a8ce193dc362..a0529ef23392 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java @@ -791,9 +791,17 @@ public Entity serialize(Object obj, Map formParams, String co } else { // We let jersey handle the serialization if (isBodyNullable) { // payload is nullable - entity = Entity.entity(obj == null ? "null" : obj, contentType); + if (obj instanceof String) { + entity = Entity.entity(obj == null ? "null" : "\"" + ((String)obj).replaceAll("\"", Matcher.quoteReplacement("\\\"")) + "\"", contentType); + } else { + entity = Entity.entity(obj == null ? "null" : obj, contentType); + } } else { - entity = Entity.entity(obj == null ? "" : obj, contentType); + if (obj instanceof String) { + entity = Entity.entity(obj == null ? "" : "\"" + ((String)obj).replaceAll("\"", Matcher.quoteReplacement("\\\"")) + "\"", contentType); + } else { + entity = Entity.entity(obj == null ? "" : obj, contentType); + } } } return entity; @@ -828,7 +836,7 @@ public String serializeToString(Object obj, Map formParams, Stri if (isBodyNullable) { return obj == null ? "null" : json.getMapper().writeValueAsString(obj); } else { - return json.getMapper().writeValueAsString(obj); + return obj == null ? "" : json.getMapper().writeValueAsString(obj); } } } catch (Exception ex) { diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java index 2e37397e8ab7..af327d787786 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java @@ -870,9 +870,17 @@ public Entity serialize(Object obj, Map formParams, String co } else { // We let jersey handle the serialization if (isBodyNullable) { // payload is nullable - entity = Entity.entity(obj == null ? "null" : obj, contentType); + if (obj instanceof String) { + entity = Entity.entity(obj == null ? "null" : "\"" + ((String)obj).replaceAll("\"", Matcher.quoteReplacement("\\\"")) + "\"", contentType); + } else { + entity = Entity.entity(obj == null ? "null" : obj, contentType); + } } else { - entity = Entity.entity(obj == null ? "" : obj, contentType); + if (obj instanceof String) { + entity = Entity.entity(obj == null ? "" : "\"" + ((String)obj).replaceAll("\"", Matcher.quoteReplacement("\\\"")) + "\"", contentType); + } else { + entity = Entity.entity(obj == null ? "" : obj, contentType); + } } } return entity; @@ -907,7 +915,7 @@ public String serializeToString(Object obj, Map formParams, Stri if (isBodyNullable) { return obj == null ? "null" : json.getMapper().writeValueAsString(obj); } else { - return json.getMapper().writeValueAsString(obj); + return obj == null ? "" : json.getMapper().writeValueAsString(obj); } } } catch (Exception ex) { diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/ApiClientTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/ApiClientTest.java new file mode 100644 index 000000000000..fcccad7efba3 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/ApiClientTest.java @@ -0,0 +1,64 @@ +package org.openapitools.client; + +import org.openapitools.client.model.*; +import org.openapitools.client.ApiClient; + +import java.lang.Exception; +import java.util.Arrays; +import java.util.Date; +import java.util.TimeZone; +import java.text.SimpleDateFormat; +import java.time.OffsetDateTime; +import java.time.ZoneId; +import java.time.format.DateTimeFormatter; +import org.junit.*; +import static org.junit.Assert.*; + +public class ApiClientTest { + ApiClient apiClient = null; + Pet pet = null; + + @Before + public void setup() { + apiClient = new ApiClient(); + pet = new Pet(); + } + + @Test + public void testSerializeToString() throws Exception { + Long petId = 4321L; + pet.setId(petId); + pet.setName("jersey2 java8 pet"); + Category category = new Category(); + category.setId(petId); + category.setName("jersey2 java8 category"); + pet.setCategory(category); + pet.setStatus(Pet.StatusEnum.AVAILABLE); + pet.setPhotoUrls(Arrays.asList("A", "B", "C")); + Tag tag = new Tag(); + tag.setId(petId); + tag.setName("jersey2 java8 tag"); + pet.setTags(Arrays.asList(tag)); + + String result = "{\"id\":4321,\"category\":{\"id\":4321,\"name\":\"jersey2 java8 category\"},\"name\":\"jersey2 java8 pet\",\"photoUrls\":[\"A\",\"B\",\"C\"],\"tags\":[{\"id\":4321,\"name\":\"jersey2 java8 tag\"}],\"status\":\"available\"}"; + assertEquals(result, apiClient.serializeToString(pet, null, "application/json", false)); + // nulllable and there should be no diffencne as the payload is not null + assertEquals(result, apiClient.serializeToString(pet, null, "application/json", true)); + + // non-nullable null object should be converted to "" (empty body) + assertEquals("", apiClient.serializeToString(null, null, "application/json", false)); + // nullable null object should be converted to "null" + assertEquals("null", apiClient.serializeToString(null, null, "application/json", true)); + + // non-nullable empty string should be converted to "\"\"" (empty json string) + assertEquals("\"\"", apiClient.serializeToString("", null, "application/json", false)); + // nullable empty string should be converted to "\"\"" (empty json string) + assertEquals("\"\"", apiClient.serializeToString("", null, "application/json", true)); + + // non-nullable string "null" should be converted to "\"null\"" + assertEquals("\"null\"", apiClient.serializeToString("null", null, "application/json", false)); + // nullable string "null" should be converted to "\"null\"" + assertEquals("\"null\"", apiClient.serializeToString("null", null, "application/json", true)); + } + +} From d6549f78b42ab9eb8e98c53c501896daa27caa62 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Thu, 23 Jul 2020 11:20:37 +0800 Subject: [PATCH 055/129] Add a link to the dev.to article (#7026) --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index e31497aea01e..8461a0fdfbd6 100644 --- a/README.md +++ b/README.md @@ -763,6 +763,7 @@ Here are some companies/projects (alphabetical order) using OpenAPI Generator in - 2020-07-07 - [5 Best API Documentation Tools](https://blog.dreamfactory.com/5-best-api-documentation-tools/) by Susanna Bouse at [DreamFactory Blog](https://blog.dreamfactory.com/) - 2020-07-12 - [Open API 3.0の定義からgolangのサーバコードのスケルトンを作成する](https://qiita.com/professor/items/4cbd04ec084d13057bc2) by [@professor (Qiita Blog)](https://qiita.com/professor) - 2020-07-20 - [Datadog API client libraries now available for Java and Go](https://www.datadoghq.com/blog/java-go-libraries/) by Jordan Obey at [Datadog Blog](https://www.datadoghq.com/blog) +- 2020-07-23 - [Generate Client SDK for .NET Core using Open Api](https://dev.to/no0law1/generate-client-sdk-for-net-core-using-open-api-2dgh) by [Nuno Reis](https://dev.to/no0law1) ## [6 - About Us](#table-of-contents) From 90d8c32906fa2d2ac58abc0f192bd556543d9b57 Mon Sep 17 00:00:00 2001 From: agilob Date: Thu, 23 Jul 2020 04:26:25 +0100 Subject: [PATCH 056/129] [Dart] Fix enum generation (#6729) * [Dart] Fix enum generation * Update generated Order file * Re-add constructor * Generate dart2 files * Dart - nicer enum formatting * Dart - generate enum name as className+enumName * Dart - dont initialize vars to null by default Fixes #3633 * Dart - Generate inlined enums and deserialize them * Merge branch 'master' of github.com:agilob/openapi-generator into 6727 * Dart - Fix using default value * Fix typo * Regenerate add dart files * dart Revert override for dart dio and jaguar * Fix dart model tests * Fix dart1 generated template * Use {{{datatypeWithEnum}}} * Dart - throw when enum not known * Fix generating enum with datatype from list --- .../openapitools/codegen/DefaultCodegen.java | 7 +- .../codegen/languages/DartClientCodegen.java | 62 +++++++------ .../languages/DartDioClientCodegen.java | 16 +++- .../languages/DartJaguarClientCodegen.java | 16 +++- .../src/main/resources/dart/class.mustache | 2 +- .../src/main/resources/dart2/class.mustache | 45 +++++++--- .../src/main/resources/dart2/enum.mustache | 17 ++-- .../main/resources/dart2/enum_inline.mustache | 52 +++++++++++ .../codegen/dart/DartModelTest.java | 26 ++++-- .../openapi/doc/ApiResponse.md | 6 +- .../flutter_petstore/openapi/doc/Category.md | 4 +- .../openapi/doc/InlineObject.md | 4 +- .../openapi/doc/InlineObject1.md | 4 +- .../flutter_petstore/openapi/doc/Order.md | 10 +-- .../dart/flutter_petstore/openapi/doc/Pet.md | 12 +-- .../flutter_petstore/openapi/doc/PetApi.md | 22 ++--- .../flutter_petstore/openapi/doc/StoreApi.md | 4 +- .../dart/flutter_petstore/openapi/doc/Tag.md | 4 +- .../dart/flutter_petstore/openapi/doc/User.md | 16 ++-- .../flutter_petstore/openapi/doc/UserApi.md | 10 +-- .../openapi/lib/model/pet.dart | 4 +- .../openapi-browser-client/doc/ApiResponse.md | 6 +- .../openapi-browser-client/doc/Category.md | 4 +- .../dart/openapi-browser-client/doc/Order.md | 10 +-- .../dart/openapi-browser-client/doc/Pet.md | 12 +-- .../dart/openapi-browser-client/doc/PetApi.md | 22 ++--- .../openapi-browser-client/doc/StoreApi.md | 4 +- .../dart/openapi-browser-client/doc/Tag.md | 4 +- .../dart/openapi-browser-client/doc/User.md | 16 ++-- .../openapi-browser-client/doc/UserApi.md | 10 +-- .../openapi-browser-client/lib/model/pet.dart | 4 +- .../petstore/dart/openapi/doc/ApiResponse.md | 6 +- .../petstore/dart/openapi/doc/Category.md | 4 +- .../client/petstore/dart/openapi/doc/Order.md | 10 +-- .../client/petstore/dart/openapi/doc/Pet.md | 12 +-- .../petstore/dart/openapi/doc/PetApi.md | 22 ++--- .../petstore/dart/openapi/doc/StoreApi.md | 4 +- .../client/petstore/dart/openapi/doc/Tag.md | 4 +- .../client/petstore/dart/openapi/doc/User.md | 16 ++-- .../petstore/dart/openapi/doc/UserApi.md | 10 +-- .../petstore/dart/openapi/lib/model/pet.dart | 4 +- .../dart2/openapi/lib/model/order.dart | 22 ++--- .../petstore/dart2/openapi/lib/model/pet.dart | 20 ++--- .../petstore/dart2/openapi/lib/model/tag.dart | 14 ++- .../dart2/petstore/test/order_model_test.dart | 9 ++ .../petstore/test/pet_faked_client_test.dart | 11 ++- .../dart2/petstore/test/pet_test.dart | 10 ++- .../petstore_client_lib/doc/ApiResponse.md | 6 +- .../dart2/petstore_client_lib/doc/Category.md | 4 +- .../dart2/petstore_client_lib/doc/Order.md | 10 +-- .../dart2/petstore_client_lib/doc/Pet.md | 12 +-- .../dart2/petstore_client_lib/doc/PetApi.md | 22 ++--- .../dart2/petstore_client_lib/doc/StoreApi.md | 4 +- .../dart2/petstore_client_lib/doc/Tag.md | 4 +- .../dart2/petstore_client_lib/doc/User.md | 16 ++-- .../dart2/petstore_client_lib/doc/UserApi.md | 10 +-- .../lib/model/api_response.dart | 24 ++--- .../lib/model/category.dart | 22 ++--- .../petstore_client_lib/lib/model/order.dart | 86 ++++++++++++++---- .../petstore_client_lib/lib/model/pet.dart | 88 ++++++++++++++----- .../petstore_client_lib/lib/model/tag.dart | 22 ++--- .../petstore_client_lib/lib/model/user.dart | 36 ++++---- 62 files changed, 597 insertions(+), 382 deletions(-) create mode 100644 modules/openapi-generator/src/main/resources/dart2/enum_inline.mustache create mode 100644 samples/client/petstore/dart2/petstore/test/order_model_test.dart diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java index d5222c0f8bd9..049cf935f8c8 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java @@ -1768,7 +1768,7 @@ public void setParameterContentType(CodegenParameter codegenParameter, MediaType if (encoding != null) { codegenParameter.contentType = encoding.getContentType(); } else { - LOGGER.debug("encoding not specified for " + codegenParameter.baseName); + LOGGER.debug("encoding not specified for {}", codegenParameter.baseName); } } } @@ -1790,6 +1790,9 @@ public String toExampleValue(Schema 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 */ @@ -1810,7 +1813,7 @@ public String toDefaultValue(Schema schema) { */ @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)) { diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartClientCodegen.java index 2ba3d7be485a..c27dc88a82c0 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartClientCodegen.java @@ -17,6 +17,7 @@ package org.openapitools.codegen.languages; +import com.google.common.collect.Sets; import io.swagger.v3.oas.models.media.ArraySchema; import io.swagger.v3.oas.models.media.Schema; @@ -30,9 +31,8 @@ import java.io.BufferedReader; import java.io.File; -import java.io.FileInputStream; import java.io.InputStreamReader; -import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; import java.util.*; import static org.openapitools.codegen.utils.StringUtils.camelize; @@ -50,6 +50,7 @@ public class DartClientCodegen extends DefaultCodegen implements CodegenConfig { public static final String PUB_HOMEPAGE = "pubHomepage"; public static final String USE_ENUM_EXTENSION = "useEnumExtension"; public static final String SUPPORT_DART2 = "supportDart2"; + protected boolean browserClient = true; protected String pubName = "openapi"; protected String pubVersion = "1.0.0"; @@ -106,9 +107,11 @@ public DartClientCodegen() { modelTestTemplateFiles.put("model_test.mustache", ".dart"); apiTestTemplateFiles.put("api_test.mustache", ".dart"); - List reservedWordsList = new ArrayList(); + List reservedWordsList = new ArrayList<>(); try { - BufferedReader reader = new BufferedReader(new InputStreamReader(DartClientCodegen.class.getResourceAsStream("/dart/dart-keywords.txt"), Charset.forName("UTF-8"))); + BufferedReader reader = new BufferedReader( + new InputStreamReader(DartClientCodegen.class.getResourceAsStream("/dart/dart-keywords.txt"), + StandardCharsets.UTF_8)); while (reader.ready()) { reservedWordsList.add(reader.readLine()); } @@ -118,18 +121,17 @@ public DartClientCodegen() { } setReservedWordsLowerCase(reservedWordsList); - languageSpecificPrimitives = new HashSet( - Arrays.asList( - "String", - "bool", - "int", - "num", - "double") + languageSpecificPrimitives = Sets.newHashSet( + "String", + "bool", + "int", + "num", + "double" ); instantiationTypes.put("array", "List"); instantiationTypes.put("map", "Map"); - typeMapping = new HashMap(); + typeMapping = new HashMap<>(); typeMapping.put("Array", "List"); typeMapping.put("array", "List"); typeMapping.put("List", "List"); @@ -329,7 +331,7 @@ public String toVarName(String name) { // replace - with _ e.g. created-at => created_at name = name.replaceAll("-", "_"); - // if it's all uppper case, do nothing + // if it's all upper case, do nothing if (name.matches("^[A-Z_]*$")) { return name; } @@ -403,9 +405,9 @@ public String toModelTestFilename(String name) { @Override public String toDefaultValue(Schema schema) { if (ModelUtils.isMapSchema(schema)) { - return "{}"; + return "const {}"; } else if (ModelUtils.isArraySchema(schema)) { - return "[]"; + return "const []"; } if (schema.getDefault() != null) { @@ -414,7 +416,7 @@ public String toDefaultValue(Schema schema) { } return schema.getDefault().toString(); } else { - return "null"; + return null; } } @@ -435,7 +437,7 @@ public String getTypeDeclaration(Schema p) { @Override public String getSchemaType(Schema p) { String openAPIType = super.getSchemaType(p); - String type = null; + String type; if (typeMapping.containsKey(openAPIType)) { type = typeMapping.get(openAPIType); if (languageSpecificPrimitives.contains(type)) { @@ -495,19 +497,16 @@ private boolean buildEnumFromVendorExtension(CodegenModel cm) { return false; } Object extension = cm.vendorExtensions.get("x-enum-values"); - List> values = - (List>) extension; - List> enumVars = - new ArrayList>(); + List> values = (List>) extension; + List> enumVars = new ArrayList<>(); for (Map value : values) { - Map enumVar = new HashMap(); + Map enumVar = new HashMap<>(); String name = camelize((String) value.get("identifier"), true); if (isReservedWord(name)) { name = escapeReservedWord(name); } enumVar.put("name", name); - enumVar.put("value", toEnumValue( - value.get("numericValue").toString(), cm.dataType)); + enumVar.put("value", toEnumValue(value.get("numericValue").toString(), cm.dataType)); if (value.containsKey("description")) { enumVar.put("description", value.get("description").toString()); } @@ -611,13 +610,12 @@ public void postProcessFile(File file, String fileType) { } // only procees the following type (or we can simply rely on the file extension to check if it's a Dart file) - Set supportedFileType = new HashSet( - Arrays.asList( - "supporting-mustache", - "model-test", - "model", - "api-test", - "api")); + Set supportedFileType = Sets.newHashSet( + "supporting-mustache", + "model-test", + "model", + "api-test", + "api"); if (!supportedFileType.contains(fileType)) { return; } @@ -632,7 +630,7 @@ public void postProcessFile(File file, String fileType) { if (exitValue != 0) { LOGGER.error("Error running the command ({}). Exit code: {}", command, exitValue); } else { - LOGGER.info("Successfully executed: " + command); + LOGGER.info("Successfully executed: {}", command); } } catch (Exception e) { LOGGER.error("Error running the command ({}). Exception: {}", command, e.getMessage()); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioClientCodegen.java index ef750c05f8f1..21a1441642cc 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioClientCodegen.java @@ -130,13 +130,21 @@ public void setBrowserClient(boolean browserClient) { } @Override - public String toDefaultValue(Schema p) { - if (ModelUtils.isMapSchema(p)) { + public String toDefaultValue(Schema schema) { + if (ModelUtils.isMapSchema(schema)) { return "const {}"; - } else if (ModelUtils.isArraySchema(p)) { + } else if (ModelUtils.isArraySchema(schema)) { return "const []"; } - return super.toDefaultValue(p); + + if (schema.getDefault() != null) { + if (ModelUtils.isStringSchema(schema)) { + return "\"" + schema.getDefault().toString().replaceAll("\"", "\\\"") + "\""; + } + return schema.getDefault().toString(); + } else { + return "null"; + } } @Override diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartJaguarClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartJaguarClientCodegen.java index c5042947a17b..b29946c56c51 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartJaguarClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartJaguarClientCodegen.java @@ -132,13 +132,21 @@ public String getHelp() { } @Override - public String toDefaultValue(Schema p) { - if (ModelUtils.isMapSchema(p)) { + public String toDefaultValue(Schema schema) { + if (ModelUtils.isMapSchema(schema)) { return "const {}"; - } else if (ModelUtils.isArraySchema(p)) { + } else if (ModelUtils.isArraySchema(schema)) { return "const []"; } - return super.toDefaultValue(p); + + if (schema.getDefault() != null) { + if (ModelUtils.isStringSchema(schema)) { + return "\"" + schema.getDefault().toString().replaceAll("\"", "\\\"") + "\""; + } + return schema.getDefault().toString(); + } else { + return "null"; + } } @Override diff --git a/modules/openapi-generator/src/main/resources/dart/class.mustache b/modules/openapi-generator/src/main/resources/dart/class.mustache index b69af46ffaa9..9739e84c69a9 100644 --- a/modules/openapi-generator/src/main/resources/dart/class.mustache +++ b/modules/openapi-generator/src/main/resources/dart/class.mustache @@ -1,7 +1,7 @@ class {{classname}} { {{#vars}} {{#description}}/* {{{description}}} */{{/description}} - {{{dataType}}} {{name}} = {{{defaultValue}}}; + {{^defaultValue}}{{{dataType}}} {{name}} = null;{{/defaultValue}}{{#defaultValue}}{{{dataType}}} {{name}} = {{defaultValue}};{{/defaultValue}} {{#allowableValues}} {{#min}} // range from {{min}} to {{max}}{{/min}}//{{^min}}enum {{name}}Enum { {{#values}} {{.}}, {{/values}} };{{/min}}{ {{/allowableValues}} diff --git a/modules/openapi-generator/src/main/resources/dart2/class.mustache b/modules/openapi-generator/src/main/resources/dart2/class.mustache index 0a32e58c7ab6..2dca6c790514 100644 --- a/modules/openapi-generator/src/main/resources/dart2/class.mustache +++ b/modules/openapi-generator/src/main/resources/dart2/class.mustache @@ -1,15 +1,19 @@ class {{classname}} { {{#vars}} - {{#description}}/* {{{description}}} */{{/description}} - {{{dataType}}} {{name}} = {{{defaultValue}}}; + {{#description}}/// {{{description}}}{{/description}} + {{^isEnum}} + {{^defaultValue}}{{{dataType}}} {{name}};{{/defaultValue}}{{#defaultValue}}{{{dataType}}} {{name}} = {{defaultValue}};{{/defaultValue}} + {{/isEnum}} + {{#isEnum}} {{#allowableValues}} - {{#min}} // range from {{min}} to {{max}}{{/min}}//{{^min}}enum {{name}}Enum { {{#values}} {{.}}, {{/values}} };{{/min}}{ + {{#min}} // range from {{min}} to {{max}}{{/min}}{{classname}}{{{enumName}}} {{name}}{{#required}} = {{{defaultValue}}}{{/required}}{{^required}}{{/required}}; {{/allowableValues}} + {{/isEnum}} {{/vars}} {{classname}}({ {{#vars}} - {{#required}}@required this.{{name}},{{/required}}{{^required}}this.{{name}},{{/required}} + {{#required}}@required this.{{name}}{{/required}}{{^required}}this.{{name}}{{#defaultValue}} = {{defaultValue}}{{/defaultValue}}{{/required}}, {{/vars}} }); @@ -78,7 +82,12 @@ class {{classname}} { json['{{baseName}}'].toDouble(); {{/isDouble}} {{^isDouble}} + {{^isEnum}} {{name}} = json['{{baseName}}']; + {{/isEnum}} + {{#isEnum}} + {{name}} = {{classname}}{{{enumName}}}.fromJson(json['{{baseName}}']); + {{/isEnum}} {{/isDouble}} {{/isMapContainer}} {{/isListContainer}} @@ -89,7 +98,7 @@ class {{classname}} { } Map toJson() { - Map json = {}; + Map json = {}; {{#vars}} {{^isNullable}} if ({{name}} != null) @@ -102,7 +111,12 @@ class {{classname}} { {{/isDate}} {{^isDateTime}} {{^isDate}} + {{^isEnum}} json['{{baseName}}'] = {{name}}; + {{/isEnum}} + {{#isEnum}} + json['{{baseName}}'] = {{name}}.value; + {{/isEnum}} {{/isDate}} {{/isDateTime}} {{/vars}} @@ -114,7 +128,7 @@ class {{classname}} { } static Map mapFromJson(Map json) { - var map = Map(); + final map = Map(); if (json != null && json.isNotEmpty) { json.forEach((String key, dynamic value) => map[key] = {{classname}}.fromJson(value)); } @@ -123,12 +137,17 @@ class {{classname}} { // maps a json object with a list of {{classname}}-objects as value to a dart map static Map> mapListFromJson(Map json) { - var map = Map>(); - if (json != null && json.isNotEmpty) { - json.forEach((String key, dynamic value) { - map[key] = {{classname}}.listFromJson(value); - }); - } - return map; + final map = Map>(); + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic value) { + map[key] = {{classname}}.listFromJson(value); + }); + } + return map; } } +{{#vars}} +{{#isEnum}} +{{>enum_inline}} +{{/isEnum}} +{{/vars}} diff --git a/modules/openapi-generator/src/main/resources/dart2/enum.mustache b/modules/openapi-generator/src/main/resources/dart2/enum.mustache index 034d377f2612..bdd82a161437 100644 --- a/modules/openapi-generator/src/main/resources/dart2/enum.mustache +++ b/modules/openapi-generator/src/main/resources/dart2/enum.mustache @@ -9,20 +9,27 @@ class {{classname}} { {{#description}} /// {{description}} {{/description}} - static const {{classname}} {{{name}}} = const {{classname}}._internal({{{value}}}); + static const {{classname}} {{{name}}} = {{classname}}._internal({{value}}); {{/enumVars}} {{/allowableValues}} - {{dataType}} toJson (){ - return this.value; + {{dataType}} toJson () { + return value; + } + + @override + String toString () { + return value; } static {{classname}} fromJson({{dataType}} value) { - return new {{classname}}TypeTransformer().decode(value); + return {{classname}}TypeTransformer().decode(value); } static List<{{classname}}> listFromJson(List json) { - return json == null ? new List<{{classname}}>() : json.map((value) => {{classname}}.fromJson(value)).toList(); + return json == null + ? List<{{classname}}>() + : json.map((value) => {{classname}}.fromJson(value)).toList(); } } diff --git a/modules/openapi-generator/src/main/resources/dart2/enum_inline.mustache b/modules/openapi-generator/src/main/resources/dart2/enum_inline.mustache new file mode 100644 index 000000000000..5ecc2b1a6ac5 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart2/enum_inline.mustache @@ -0,0 +1,52 @@ +class {{classname}}{{enumName}} { + /// The underlying value of this enum member. + final {{{dataType}}} value; + + const {{classname}}{{enumName}}._internal(this.value); + + {{#allowableValues}} + {{#enumVars}} + {{#description}} + /// {{description}} + {{/description}} + static const {{classname}}{{enumName}} {{name}} = {{classname}}{{enumName}}._internal({{{value}}}); + {{/enumVars}} + {{/allowableValues}} + + {{{dataType}}} toJson () { + return value; + } + + @override + String toString () { + return value; + } + + static {{classname}}{{enumName}} fromJson({{{dataType}}} value) { + return {{classname}}{{enumName}}TypeTransformer().decode(value); + } + + static List<{{classname}}{{enumName}}> listFromJson(List json) { + return json == null + ? List<{{classname}}{{enumName}}>() + : json.map((value) => {{classname}}{{enumName}}.fromJson(value)).toList(); + } +} + +class {{classname}}{{enumName}}TypeTransformer { + + dynamic encode({{classname}}{{enumName}} data) { + return data.value; + } + + {{classname}}{{enumName}} decode(dynamic data) { + switch (data) { + {{#allowableValues}} + {{#enumVars}} + case {{{value}}}: return {{classname}}{{enumName}}.{{{name}}}; + {{/enumVars}} + {{/allowableValues}} + default: return null; + } + } +} diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/DartModelTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/DartModelTest.java index e9133bc605d5..6e1a9974fda5 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/DartModelTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/DartModelTest.java @@ -36,6 +36,7 @@ public void simpleModelTest() { .addProperties("id", new IntegerSchema()) .addProperties("name", new StringSchema()) .addProperties("createdAt", new DateTimeSchema()) + .addProperties("defaultItem", new IntegerSchema()._default(1)) .addRequiredItem("id") .addRequiredItem("name"); final DefaultCodegen codegen = new DartClientCodegen(); @@ -46,7 +47,7 @@ public void simpleModelTest() { Assert.assertEquals(cm.name, "sample"); Assert.assertEquals(cm.classname, "Sample"); Assert.assertEquals(cm.description, "a sample model"); - Assert.assertEquals(cm.vars.size(), 3); + Assert.assertEquals(cm.vars.size(), 4); // {{imports}} is not used in template //Assert.assertEquals(cm.imports.size(), 1); @@ -54,7 +55,7 @@ public void simpleModelTest() { Assert.assertEquals(property1.baseName, "id"); Assert.assertEquals(property1.dataType, "int"); Assert.assertEquals(property1.name, "id"); - Assert.assertEquals(property1.defaultValue, "null"); + Assert.assertNull(property1.defaultValue); Assert.assertEquals(property1.baseType, "int"); Assert.assertTrue(property1.hasMore); Assert.assertTrue(property1.required); @@ -65,7 +66,7 @@ public void simpleModelTest() { Assert.assertEquals(property2.baseName, "name"); Assert.assertEquals(property2.dataType, "String"); Assert.assertEquals(property2.name, "name"); - Assert.assertEquals(property2.defaultValue, "null"); + Assert.assertNull(property2.defaultValue); Assert.assertEquals(property2.baseType, "String"); Assert.assertTrue(property2.hasMore); Assert.assertTrue(property2.required); @@ -77,11 +78,20 @@ public void simpleModelTest() { Assert.assertEquals(property3.complexType, "DateTime"); Assert.assertEquals(property3.dataType, "DateTime"); Assert.assertEquals(property3.name, "createdAt"); - Assert.assertEquals(property3.defaultValue, "null"); + Assert.assertNull(property3.defaultValue); Assert.assertEquals(property3.baseType, "DateTime"); - Assert.assertFalse(property3.hasMore); + Assert.assertTrue(property3.hasMore); Assert.assertFalse(property3.required); Assert.assertFalse(property3.isContainer); + + final CodegenProperty property4 = cm.vars.get(3); + Assert.assertEquals(property4.baseName, "defaultItem"); + Assert.assertEquals(property4.dataType, "int"); + Assert.assertEquals(property4.defaultValue, "1"); + Assert.assertEquals(property4.baseType, "int"); + Assert.assertFalse(property4.hasMore); + Assert.assertFalse(property4.required); + Assert.assertFalse(property4.isContainer); } @Test(description = "convert a model with list property") @@ -89,9 +99,9 @@ public void listPropertyTest() { final Schema model = new Schema() .description("a sample model") .addProperties("id", new IntegerSchema()) - .addProperties("urls", new ArraySchema() - .items(new StringSchema())) + .addProperties("urls", new ArraySchema().items(new StringSchema())) .addRequiredItem("id"); + final DefaultCodegen codegen = new DartClientCodegen(); OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", model); codegen.setOpenAPI(openAPI); @@ -106,7 +116,7 @@ public void listPropertyTest() { Assert.assertEquals(property1.baseName, "id"); Assert.assertEquals(property1.dataType, "int"); Assert.assertEquals(property1.name, "id"); - Assert.assertEquals(property1.defaultValue, "null"); + Assert.assertNull(property1.defaultValue); Assert.assertEquals(property1.baseType, "int"); Assert.assertTrue(property1.hasMore); Assert.assertTrue(property1.required); diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/doc/ApiResponse.md b/samples/client/petstore/dart/flutter_petstore/openapi/doc/ApiResponse.md index 92422f0f446e..7ad5da0f89e4 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/doc/ApiResponse.md +++ b/samples/client/petstore/dart/flutter_petstore/openapi/doc/ApiResponse.md @@ -8,9 +8,9 @@ import 'package:openapi/api.dart'; ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**code** | **int** | | [optional] [default to null] -**type** | **String** | | [optional] [default to null] -**message** | **String** | | [optional] [default to null] +**code** | **int** | | [optional] +**type** | **String** | | [optional] +**message** | **String** | | [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/client/petstore/dart/flutter_petstore/openapi/doc/Category.md b/samples/client/petstore/dart/flutter_petstore/openapi/doc/Category.md index cc0d1633b59c..98d0b14be7b1 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/doc/Category.md +++ b/samples/client/petstore/dart/flutter_petstore/openapi/doc/Category.md @@ -8,8 +8,8 @@ import 'package:openapi/api.dart'; ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **int** | | [optional] [default to null] -**name** | **String** | | [optional] [default to null] +**id** | **int** | | [optional] +**name** | **String** | | [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/client/petstore/dart/flutter_petstore/openapi/doc/InlineObject.md b/samples/client/petstore/dart/flutter_petstore/openapi/doc/InlineObject.md index 1789b30bb816..9aa480dee58b 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/doc/InlineObject.md +++ b/samples/client/petstore/dart/flutter_petstore/openapi/doc/InlineObject.md @@ -8,8 +8,8 @@ import 'package:openapi/api.dart'; ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**name** | **String** | Updated name of the pet | [optional] [default to null] -**status** | **String** | Updated status of the pet | [optional] [default to null] +**name** | **String** | Updated name of the pet | [optional] +**status** | **String** | Updated status of the pet | [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/client/petstore/dart/flutter_petstore/openapi/doc/InlineObject1.md b/samples/client/petstore/dart/flutter_petstore/openapi/doc/InlineObject1.md index a5c2c120129c..013aa87e9bbe 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/doc/InlineObject1.md +++ b/samples/client/petstore/dart/flutter_petstore/openapi/doc/InlineObject1.md @@ -8,8 +8,8 @@ import 'package:openapi/api.dart'; ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**additionalMetadata** | **String** | Additional data to pass to server | [optional] [default to null] -**file** | [**MultipartFile**](File.md) | file to upload | [optional] [default to null] +**additionalMetadata** | **String** | Additional data to pass to server | [optional] +**file** | [**MultipartFile**](File.md) | file to upload | [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/client/petstore/dart/flutter_petstore/openapi/doc/Order.md b/samples/client/petstore/dart/flutter_petstore/openapi/doc/Order.md index 310ce6c65be3..bde5ffe51a2c 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/doc/Order.md +++ b/samples/client/petstore/dart/flutter_petstore/openapi/doc/Order.md @@ -8,11 +8,11 @@ import 'package:openapi/api.dart'; ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **int** | | [optional] [default to null] -**petId** | **int** | | [optional] [default to null] -**quantity** | **int** | | [optional] [default to null] -**shipDate** | [**DateTime**](DateTime.md) | | [optional] [default to null] -**status** | **String** | Order Status | [optional] [default to null] +**id** | **int** | | [optional] +**petId** | **int** | | [optional] +**quantity** | **int** | | [optional] +**shipDate** | [**DateTime**](DateTime.md) | | [optional] +**status** | **String** | Order Status | [optional] **complete** | **bool** | | [optional] [default to 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/client/petstore/dart/flutter_petstore/openapi/doc/Pet.md b/samples/client/petstore/dart/flutter_petstore/openapi/doc/Pet.md index 191e1fc66a95..dc6c184bd030 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/doc/Pet.md +++ b/samples/client/petstore/dart/flutter_petstore/openapi/doc/Pet.md @@ -8,12 +8,12 @@ import 'package:openapi/api.dart'; ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **int** | | [optional] [default to null] -**category** | [**Category**](Category.md) | | [optional] [default to null] -**name** | **String** | | [default to null] -**photoUrls** | **List<String>** | | [default to []] -**tags** | [**List<Tag>**](Tag.md) | | [optional] [default to []] -**status** | **String** | pet status in the store | [optional] [default to null] +**id** | **int** | | [optional] +**category** | [**Category**](Category.md) | | [optional] +**name** | **String** | | +**photoUrls** | **List<String>** | | [default to const []] +**tags** | [**List<Tag>**](Tag.md) | | [optional] [default to const []] +**status** | **String** | pet status in the store | [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/client/petstore/dart/flutter_petstore/openapi/doc/PetApi.md b/samples/client/petstore/dart/flutter_petstore/openapi/doc/PetApi.md index 3a188dec3b3e..e27d897b1c4f 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/doc/PetApi.md +++ b/samples/client/petstore/dart/flutter_petstore/openapi/doc/PetApi.md @@ -88,8 +88,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **petId** | **int**| Pet id to delete | [default to null] - **apiKey** | **String**| | [optional] [default to null] + **petId** | **int**| Pet id to delete | + **apiKey** | **String**| | [optional] ### Return type @@ -134,7 +134,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **status** | [**List<String>**](String.md)| Status values that need to be considered for filter | [default to []] + **status** | [**List<String>**](String.md)| Status values that need to be considered for filter | [default to const []] ### Return type @@ -179,7 +179,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **tags** | [**List<String>**](String.md)| Tags to filter by | [default to []] + **tags** | [**List<String>**](String.md)| Tags to filter by | [default to const []] ### Return type @@ -226,7 +226,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **petId** | **int**| ID of pet to return | [default to null] + **petId** | **int**| ID of pet to return | ### Return type @@ -313,9 +313,9 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **petId** | **int**| ID of pet that needs to be updated | [default to null] - **name** | **String**| Updated name of the pet | [optional] [default to null] - **status** | **String**| Updated status of the pet | [optional] [default to null] + **petId** | **int**| ID of pet that needs to be updated | + **name** | **String**| Updated name of the pet | [optional] + **status** | **String**| Updated status of the pet | [optional] ### Return type @@ -360,9 +360,9 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **petId** | **int**| ID of pet to update | [default to null] - **additionalMetadata** | **String**| Additional data to pass to server | [optional] [default to null] - **file** | **MultipartFile**| file to upload | [optional] [default to null] + **petId** | **int**| ID of pet to update | + **additionalMetadata** | **String**| Additional data to pass to server | [optional] + **file** | **MultipartFile**| file to upload | [optional] ### Return type diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/doc/StoreApi.md b/samples/client/petstore/dart/flutter_petstore/openapi/doc/StoreApi.md index a3c03643770d..9a722ebd9ccc 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/doc/StoreApi.md +++ b/samples/client/petstore/dart/flutter_petstore/openapi/doc/StoreApi.md @@ -40,7 +40,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **orderId** | **String**| ID of the order that needs to be deleted | [default to null] + **orderId** | **String**| ID of the order that needs to be deleted | ### Return type @@ -126,7 +126,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **orderId** | **int**| ID of pet that needs to be fetched | [default to null] + **orderId** | **int**| ID of pet that needs to be fetched | ### Return type diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/doc/Tag.md b/samples/client/petstore/dart/flutter_petstore/openapi/doc/Tag.md index ded7b32ac3d7..c219f987c19c 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/doc/Tag.md +++ b/samples/client/petstore/dart/flutter_petstore/openapi/doc/Tag.md @@ -8,8 +8,8 @@ import 'package:openapi/api.dart'; ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **int** | | [optional] [default to null] -**name** | **String** | | [optional] [default to null] +**id** | **int** | | [optional] +**name** | **String** | | [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/client/petstore/dart/flutter_petstore/openapi/doc/User.md b/samples/client/petstore/dart/flutter_petstore/openapi/doc/User.md index 3761b70cf0b7..fa87e64d8595 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/doc/User.md +++ b/samples/client/petstore/dart/flutter_petstore/openapi/doc/User.md @@ -8,14 +8,14 @@ import 'package:openapi/api.dart'; ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **int** | | [optional] [default to null] -**username** | **String** | | [optional] [default to null] -**firstName** | **String** | | [optional] [default to null] -**lastName** | **String** | | [optional] [default to null] -**email** | **String** | | [optional] [default to null] -**password** | **String** | | [optional] [default to null] -**phone** | **String** | | [optional] [default to null] -**userStatus** | **int** | User Status | [optional] [default to null] +**id** | **int** | | [optional] +**username** | **String** | | [optional] +**firstName** | **String** | | [optional] +**lastName** | **String** | | [optional] +**email** | **String** | | [optional] +**password** | **String** | | [optional] +**phone** | **String** | | [optional] +**userStatus** | **int** | User Status | [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/client/petstore/dart/flutter_petstore/openapi/doc/UserApi.md b/samples/client/petstore/dart/flutter_petstore/openapi/doc/UserApi.md index ca539ab556f7..8228ca37ca5f 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/doc/UserApi.md +++ b/samples/client/petstore/dart/flutter_petstore/openapi/doc/UserApi.md @@ -182,7 +182,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | **String**| The name that needs to be deleted | [default to null] + **username** | **String**| The name that needs to be deleted | ### Return type @@ -223,7 +223,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | **String**| The name that needs to be fetched. Use user1 for testing. | [default to null] + **username** | **String**| The name that needs to be fetched. Use user1 for testing. | ### Return type @@ -265,8 +265,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | **String**| The user name for login | [default to null] - **password** | **String**| The password for login in clear text | [default to null] + **username** | **String**| The user name for login | + **password** | **String**| The password for login in clear text | ### Return type @@ -353,7 +353,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | **String**| name that need to be deleted | [default to null] + **username** | **String**| name that need to be deleted | **user** | [**User**](User.md)| Updated user object | ### Return type diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/pet.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/pet.dart index 30db0ebc8417..3552b385a115 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/pet.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/pet.dart @@ -8,9 +8,9 @@ class Pet { String name = null; - List photoUrls = []; + List photoUrls = const []; - List tags = []; + List tags = const []; /* pet status in the store */ String status = null; //enum statusEnum { available, pending, sold, };{ diff --git a/samples/client/petstore/dart/openapi-browser-client/doc/ApiResponse.md b/samples/client/petstore/dart/openapi-browser-client/doc/ApiResponse.md index 92422f0f446e..7ad5da0f89e4 100644 --- a/samples/client/petstore/dart/openapi-browser-client/doc/ApiResponse.md +++ b/samples/client/petstore/dart/openapi-browser-client/doc/ApiResponse.md @@ -8,9 +8,9 @@ import 'package:openapi/api.dart'; ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**code** | **int** | | [optional] [default to null] -**type** | **String** | | [optional] [default to null] -**message** | **String** | | [optional] [default to null] +**code** | **int** | | [optional] +**type** | **String** | | [optional] +**message** | **String** | | [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/client/petstore/dart/openapi-browser-client/doc/Category.md b/samples/client/petstore/dart/openapi-browser-client/doc/Category.md index cc0d1633b59c..98d0b14be7b1 100644 --- a/samples/client/petstore/dart/openapi-browser-client/doc/Category.md +++ b/samples/client/petstore/dart/openapi-browser-client/doc/Category.md @@ -8,8 +8,8 @@ import 'package:openapi/api.dart'; ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **int** | | [optional] [default to null] -**name** | **String** | | [optional] [default to null] +**id** | **int** | | [optional] +**name** | **String** | | [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/client/petstore/dart/openapi-browser-client/doc/Order.md b/samples/client/petstore/dart/openapi-browser-client/doc/Order.md index 310ce6c65be3..bde5ffe51a2c 100644 --- a/samples/client/petstore/dart/openapi-browser-client/doc/Order.md +++ b/samples/client/petstore/dart/openapi-browser-client/doc/Order.md @@ -8,11 +8,11 @@ import 'package:openapi/api.dart'; ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **int** | | [optional] [default to null] -**petId** | **int** | | [optional] [default to null] -**quantity** | **int** | | [optional] [default to null] -**shipDate** | [**DateTime**](DateTime.md) | | [optional] [default to null] -**status** | **String** | Order Status | [optional] [default to null] +**id** | **int** | | [optional] +**petId** | **int** | | [optional] +**quantity** | **int** | | [optional] +**shipDate** | [**DateTime**](DateTime.md) | | [optional] +**status** | **String** | Order Status | [optional] **complete** | **bool** | | [optional] [default to 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/client/petstore/dart/openapi-browser-client/doc/Pet.md b/samples/client/petstore/dart/openapi-browser-client/doc/Pet.md index 191e1fc66a95..dc6c184bd030 100644 --- a/samples/client/petstore/dart/openapi-browser-client/doc/Pet.md +++ b/samples/client/petstore/dart/openapi-browser-client/doc/Pet.md @@ -8,12 +8,12 @@ import 'package:openapi/api.dart'; ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **int** | | [optional] [default to null] -**category** | [**Category**](Category.md) | | [optional] [default to null] -**name** | **String** | | [default to null] -**photoUrls** | **List<String>** | | [default to []] -**tags** | [**List<Tag>**](Tag.md) | | [optional] [default to []] -**status** | **String** | pet status in the store | [optional] [default to null] +**id** | **int** | | [optional] +**category** | [**Category**](Category.md) | | [optional] +**name** | **String** | | +**photoUrls** | **List<String>** | | [default to const []] +**tags** | [**List<Tag>**](Tag.md) | | [optional] [default to const []] +**status** | **String** | pet status in the store | [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/client/petstore/dart/openapi-browser-client/doc/PetApi.md b/samples/client/petstore/dart/openapi-browser-client/doc/PetApi.md index 5780e7f38022..a1e7858060f4 100644 --- a/samples/client/petstore/dart/openapi-browser-client/doc/PetApi.md +++ b/samples/client/petstore/dart/openapi-browser-client/doc/PetApi.md @@ -87,8 +87,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **petId** | **int**| Pet id to delete | [default to null] - **apiKey** | **String**| | [optional] [default to null] + **petId** | **int**| Pet id to delete | + **apiKey** | **String**| | [optional] ### Return type @@ -133,7 +133,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **status** | [**List<String>**](String.md)| Status values that need to be considered for filter | [default to []] + **status** | [**List<String>**](String.md)| Status values that need to be considered for filter | [default to const []] ### Return type @@ -178,7 +178,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **tags** | [**List<String>**](String.md)| Tags to filter by | [default to []] + **tags** | [**List<String>**](String.md)| Tags to filter by | [default to const []] ### Return type @@ -225,7 +225,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **petId** | **int**| ID of pet to return | [default to null] + **petId** | **int**| ID of pet to return | ### Return type @@ -311,9 +311,9 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **petId** | **int**| ID of pet that needs to be updated | [default to null] - **name** | **String**| Updated name of the pet | [optional] [default to null] - **status** | **String**| Updated status of the pet | [optional] [default to null] + **petId** | **int**| ID of pet that needs to be updated | + **name** | **String**| Updated name of the pet | [optional] + **status** | **String**| Updated status of the pet | [optional] ### Return type @@ -358,9 +358,9 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **petId** | **int**| ID of pet to update | [default to null] - **additionalMetadata** | **String**| Additional data to pass to server | [optional] [default to null] - **file** | **MultipartFile**| file to upload | [optional] [default to null] + **petId** | **int**| ID of pet to update | + **additionalMetadata** | **String**| Additional data to pass to server | [optional] + **file** | **MultipartFile**| file to upload | [optional] ### Return type diff --git a/samples/client/petstore/dart/openapi-browser-client/doc/StoreApi.md b/samples/client/petstore/dart/openapi-browser-client/doc/StoreApi.md index df76647f11ae..e5e8613c7afe 100644 --- a/samples/client/petstore/dart/openapi-browser-client/doc/StoreApi.md +++ b/samples/client/petstore/dart/openapi-browser-client/doc/StoreApi.md @@ -40,7 +40,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **orderId** | **String**| ID of the order that needs to be deleted | [default to null] + **orderId** | **String**| ID of the order that needs to be deleted | ### Return type @@ -126,7 +126,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **orderId** | **int**| ID of pet that needs to be fetched | [default to null] + **orderId** | **int**| ID of pet that needs to be fetched | ### Return type diff --git a/samples/client/petstore/dart/openapi-browser-client/doc/Tag.md b/samples/client/petstore/dart/openapi-browser-client/doc/Tag.md index ded7b32ac3d7..c219f987c19c 100644 --- a/samples/client/petstore/dart/openapi-browser-client/doc/Tag.md +++ b/samples/client/petstore/dart/openapi-browser-client/doc/Tag.md @@ -8,8 +8,8 @@ import 'package:openapi/api.dart'; ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **int** | | [optional] [default to null] -**name** | **String** | | [optional] [default to null] +**id** | **int** | | [optional] +**name** | **String** | | [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/client/petstore/dart/openapi-browser-client/doc/User.md b/samples/client/petstore/dart/openapi-browser-client/doc/User.md index 3761b70cf0b7..fa87e64d8595 100644 --- a/samples/client/petstore/dart/openapi-browser-client/doc/User.md +++ b/samples/client/petstore/dart/openapi-browser-client/doc/User.md @@ -8,14 +8,14 @@ import 'package:openapi/api.dart'; ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **int** | | [optional] [default to null] -**username** | **String** | | [optional] [default to null] -**firstName** | **String** | | [optional] [default to null] -**lastName** | **String** | | [optional] [default to null] -**email** | **String** | | [optional] [default to null] -**password** | **String** | | [optional] [default to null] -**phone** | **String** | | [optional] [default to null] -**userStatus** | **int** | User Status | [optional] [default to null] +**id** | **int** | | [optional] +**username** | **String** | | [optional] +**firstName** | **String** | | [optional] +**lastName** | **String** | | [optional] +**email** | **String** | | [optional] +**password** | **String** | | [optional] +**phone** | **String** | | [optional] +**userStatus** | **int** | User Status | [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/client/petstore/dart/openapi-browser-client/doc/UserApi.md b/samples/client/petstore/dart/openapi-browser-client/doc/UserApi.md index d3bb61265e9a..a07d2e4e4a4f 100644 --- a/samples/client/petstore/dart/openapi-browser-client/doc/UserApi.md +++ b/samples/client/petstore/dart/openapi-browser-client/doc/UserApi.md @@ -166,7 +166,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | **String**| The name that needs to be deleted | [default to null] + **username** | **String**| The name that needs to be deleted | ### Return type @@ -207,7 +207,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | **String**| The name that needs to be fetched. Use user1 for testing. | [default to null] + **username** | **String**| The name that needs to be fetched. Use user1 for testing. | ### Return type @@ -249,8 +249,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | **String**| The user name for login | [default to null] - **password** | **String**| The password for login in clear text | [default to null] + **username** | **String**| The user name for login | + **password** | **String**| The password for login in clear text | ### Return type @@ -329,7 +329,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | **String**| name that need to be deleted | [default to null] + **username** | **String**| name that need to be deleted | **body** | [**User**](User.md)| Updated user object | ### Return type diff --git a/samples/client/petstore/dart/openapi-browser-client/lib/model/pet.dart b/samples/client/petstore/dart/openapi-browser-client/lib/model/pet.dart index 30db0ebc8417..3552b385a115 100644 --- a/samples/client/petstore/dart/openapi-browser-client/lib/model/pet.dart +++ b/samples/client/petstore/dart/openapi-browser-client/lib/model/pet.dart @@ -8,9 +8,9 @@ class Pet { String name = null; - List photoUrls = []; + List photoUrls = const []; - List tags = []; + List tags = const []; /* pet status in the store */ String status = null; //enum statusEnum { available, pending, sold, };{ diff --git a/samples/client/petstore/dart/openapi/doc/ApiResponse.md b/samples/client/petstore/dart/openapi/doc/ApiResponse.md index 92422f0f446e..7ad5da0f89e4 100644 --- a/samples/client/petstore/dart/openapi/doc/ApiResponse.md +++ b/samples/client/petstore/dart/openapi/doc/ApiResponse.md @@ -8,9 +8,9 @@ import 'package:openapi/api.dart'; ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**code** | **int** | | [optional] [default to null] -**type** | **String** | | [optional] [default to null] -**message** | **String** | | [optional] [default to null] +**code** | **int** | | [optional] +**type** | **String** | | [optional] +**message** | **String** | | [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/client/petstore/dart/openapi/doc/Category.md b/samples/client/petstore/dart/openapi/doc/Category.md index cc0d1633b59c..98d0b14be7b1 100644 --- a/samples/client/petstore/dart/openapi/doc/Category.md +++ b/samples/client/petstore/dart/openapi/doc/Category.md @@ -8,8 +8,8 @@ import 'package:openapi/api.dart'; ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **int** | | [optional] [default to null] -**name** | **String** | | [optional] [default to null] +**id** | **int** | | [optional] +**name** | **String** | | [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/client/petstore/dart/openapi/doc/Order.md b/samples/client/petstore/dart/openapi/doc/Order.md index 310ce6c65be3..bde5ffe51a2c 100644 --- a/samples/client/petstore/dart/openapi/doc/Order.md +++ b/samples/client/petstore/dart/openapi/doc/Order.md @@ -8,11 +8,11 @@ import 'package:openapi/api.dart'; ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **int** | | [optional] [default to null] -**petId** | **int** | | [optional] [default to null] -**quantity** | **int** | | [optional] [default to null] -**shipDate** | [**DateTime**](DateTime.md) | | [optional] [default to null] -**status** | **String** | Order Status | [optional] [default to null] +**id** | **int** | | [optional] +**petId** | **int** | | [optional] +**quantity** | **int** | | [optional] +**shipDate** | [**DateTime**](DateTime.md) | | [optional] +**status** | **String** | Order Status | [optional] **complete** | **bool** | | [optional] [default to 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/client/petstore/dart/openapi/doc/Pet.md b/samples/client/petstore/dart/openapi/doc/Pet.md index 191e1fc66a95..dc6c184bd030 100644 --- a/samples/client/petstore/dart/openapi/doc/Pet.md +++ b/samples/client/petstore/dart/openapi/doc/Pet.md @@ -8,12 +8,12 @@ import 'package:openapi/api.dart'; ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **int** | | [optional] [default to null] -**category** | [**Category**](Category.md) | | [optional] [default to null] -**name** | **String** | | [default to null] -**photoUrls** | **List<String>** | | [default to []] -**tags** | [**List<Tag>**](Tag.md) | | [optional] [default to []] -**status** | **String** | pet status in the store | [optional] [default to null] +**id** | **int** | | [optional] +**category** | [**Category**](Category.md) | | [optional] +**name** | **String** | | +**photoUrls** | **List<String>** | | [default to const []] +**tags** | [**List<Tag>**](Tag.md) | | [optional] [default to const []] +**status** | **String** | pet status in the store | [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/client/petstore/dart/openapi/doc/PetApi.md b/samples/client/petstore/dart/openapi/doc/PetApi.md index 5780e7f38022..a1e7858060f4 100644 --- a/samples/client/petstore/dart/openapi/doc/PetApi.md +++ b/samples/client/petstore/dart/openapi/doc/PetApi.md @@ -87,8 +87,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **petId** | **int**| Pet id to delete | [default to null] - **apiKey** | **String**| | [optional] [default to null] + **petId** | **int**| Pet id to delete | + **apiKey** | **String**| | [optional] ### Return type @@ -133,7 +133,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **status** | [**List<String>**](String.md)| Status values that need to be considered for filter | [default to []] + **status** | [**List<String>**](String.md)| Status values that need to be considered for filter | [default to const []] ### Return type @@ -178,7 +178,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **tags** | [**List<String>**](String.md)| Tags to filter by | [default to []] + **tags** | [**List<String>**](String.md)| Tags to filter by | [default to const []] ### Return type @@ -225,7 +225,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **petId** | **int**| ID of pet to return | [default to null] + **petId** | **int**| ID of pet to return | ### Return type @@ -311,9 +311,9 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **petId** | **int**| ID of pet that needs to be updated | [default to null] - **name** | **String**| Updated name of the pet | [optional] [default to null] - **status** | **String**| Updated status of the pet | [optional] [default to null] + **petId** | **int**| ID of pet that needs to be updated | + **name** | **String**| Updated name of the pet | [optional] + **status** | **String**| Updated status of the pet | [optional] ### Return type @@ -358,9 +358,9 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **petId** | **int**| ID of pet to update | [default to null] - **additionalMetadata** | **String**| Additional data to pass to server | [optional] [default to null] - **file** | **MultipartFile**| file to upload | [optional] [default to null] + **petId** | **int**| ID of pet to update | + **additionalMetadata** | **String**| Additional data to pass to server | [optional] + **file** | **MultipartFile**| file to upload | [optional] ### Return type diff --git a/samples/client/petstore/dart/openapi/doc/StoreApi.md b/samples/client/petstore/dart/openapi/doc/StoreApi.md index df76647f11ae..e5e8613c7afe 100644 --- a/samples/client/petstore/dart/openapi/doc/StoreApi.md +++ b/samples/client/petstore/dart/openapi/doc/StoreApi.md @@ -40,7 +40,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **orderId** | **String**| ID of the order that needs to be deleted | [default to null] + **orderId** | **String**| ID of the order that needs to be deleted | ### Return type @@ -126,7 +126,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **orderId** | **int**| ID of pet that needs to be fetched | [default to null] + **orderId** | **int**| ID of pet that needs to be fetched | ### Return type diff --git a/samples/client/petstore/dart/openapi/doc/Tag.md b/samples/client/petstore/dart/openapi/doc/Tag.md index ded7b32ac3d7..c219f987c19c 100644 --- a/samples/client/petstore/dart/openapi/doc/Tag.md +++ b/samples/client/petstore/dart/openapi/doc/Tag.md @@ -8,8 +8,8 @@ import 'package:openapi/api.dart'; ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **int** | | [optional] [default to null] -**name** | **String** | | [optional] [default to null] +**id** | **int** | | [optional] +**name** | **String** | | [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/client/petstore/dart/openapi/doc/User.md b/samples/client/petstore/dart/openapi/doc/User.md index 3761b70cf0b7..fa87e64d8595 100644 --- a/samples/client/petstore/dart/openapi/doc/User.md +++ b/samples/client/petstore/dart/openapi/doc/User.md @@ -8,14 +8,14 @@ import 'package:openapi/api.dart'; ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **int** | | [optional] [default to null] -**username** | **String** | | [optional] [default to null] -**firstName** | **String** | | [optional] [default to null] -**lastName** | **String** | | [optional] [default to null] -**email** | **String** | | [optional] [default to null] -**password** | **String** | | [optional] [default to null] -**phone** | **String** | | [optional] [default to null] -**userStatus** | **int** | User Status | [optional] [default to null] +**id** | **int** | | [optional] +**username** | **String** | | [optional] +**firstName** | **String** | | [optional] +**lastName** | **String** | | [optional] +**email** | **String** | | [optional] +**password** | **String** | | [optional] +**phone** | **String** | | [optional] +**userStatus** | **int** | User Status | [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/client/petstore/dart/openapi/doc/UserApi.md b/samples/client/petstore/dart/openapi/doc/UserApi.md index d3bb61265e9a..a07d2e4e4a4f 100644 --- a/samples/client/petstore/dart/openapi/doc/UserApi.md +++ b/samples/client/petstore/dart/openapi/doc/UserApi.md @@ -166,7 +166,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | **String**| The name that needs to be deleted | [default to null] + **username** | **String**| The name that needs to be deleted | ### Return type @@ -207,7 +207,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | **String**| The name that needs to be fetched. Use user1 for testing. | [default to null] + **username** | **String**| The name that needs to be fetched. Use user1 for testing. | ### Return type @@ -249,8 +249,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | **String**| The user name for login | [default to null] - **password** | **String**| The password for login in clear text | [default to null] + **username** | **String**| The user name for login | + **password** | **String**| The password for login in clear text | ### Return type @@ -329,7 +329,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | **String**| name that need to be deleted | [default to null] + **username** | **String**| name that need to be deleted | **body** | [**User**](User.md)| Updated user object | ### Return type diff --git a/samples/client/petstore/dart/openapi/lib/model/pet.dart b/samples/client/petstore/dart/openapi/lib/model/pet.dart index 30db0ebc8417..3552b385a115 100644 --- a/samples/client/petstore/dart/openapi/lib/model/pet.dart +++ b/samples/client/petstore/dart/openapi/lib/model/pet.dart @@ -8,9 +8,9 @@ class Pet { String name = null; - List photoUrls = []; + List photoUrls = const []; - List tags = []; + List tags = const []; /* pet status in the store */ String status = null; //enum statusEnum { available, pending, sold, };{ diff --git a/samples/client/petstore/dart2/openapi/lib/model/order.dart b/samples/client/petstore/dart2/openapi/lib/model/order.dart index 34370b21e3b8..66cbd07902f6 100644 --- a/samples/client/petstore/dart2/openapi/lib/model/order.dart +++ b/samples/client/petstore/dart2/openapi/lib/model/order.dart @@ -9,12 +9,10 @@ class Order { int quantity = null; DateTime shipDate = null; - /* Order Status */ - String status = null; - //enum statusEnum { placed, approved, delivered, };{ - + /// Order Status + StatusEnum status = null; + bool complete = false; - Order(); @override String toString() { @@ -65,12 +63,14 @@ class Order { // maps a json object with a list of Order-objects as value to a dart map static Map> mapListFromJson(Map json) { var map = Map>(); - if (json != null && json.isNotEmpty) { - json.forEach((String key, dynamic value) { - map[key] = Order.listFromJson(value); - }); - } - return map; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic value) { + map[key] = Order.listFromJson(value); + }); + } + return map; } } + +enum StatusEnum { placed, approved, delivered, } diff --git a/samples/client/petstore/dart2/openapi/lib/model/pet.dart b/samples/client/petstore/dart2/openapi/lib/model/pet.dart index 92a096c4027d..09c1325f9ca5 100644 --- a/samples/client/petstore/dart2/openapi/lib/model/pet.dart +++ b/samples/client/petstore/dart2/openapi/lib/model/pet.dart @@ -11,10 +11,8 @@ class Pet { List photoUrls = []; List tags = []; - /* pet status in the store */ - String status = null; - //enum statusEnum { available, pending, sold, };{ - Pet(); + /// pet status in the store + StatusEnum status = null; @override String toString() { @@ -69,12 +67,14 @@ class Pet { // maps a json object with a list of Pet-objects as value to a dart map static Map> mapListFromJson(Map json) { var map = Map>(); - if (json != null && json.isNotEmpty) { - json.forEach((String key, dynamic value) { - map[key] = Pet.listFromJson(value); - }); - } - return map; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic value) { + map[key] = Pet.listFromJson(value); + }); + } + return map; } } + +enum StatusEnum { available, pending, sold, } diff --git a/samples/client/petstore/dart2/openapi/lib/model/tag.dart b/samples/client/petstore/dart2/openapi/lib/model/tag.dart index 5b758c01b7af..01be72b58064 100644 --- a/samples/client/petstore/dart2/openapi/lib/model/tag.dart +++ b/samples/client/petstore/dart2/openapi/lib/model/tag.dart @@ -5,7 +5,6 @@ class Tag { int id = null; String name = null; - Tag(); @override String toString() { @@ -42,12 +41,11 @@ class Tag { // maps a json object with a list of Tag-objects as value to a dart map static Map> mapListFromJson(Map json) { var map = Map>(); - if (json != null && json.isNotEmpty) { - json.forEach((String key, dynamic value) { - map[key] = Tag.listFromJson(value); - }); - } - return map; + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic value) { + map[key] = Tag.listFromJson(value); + }); + } + return map; } } - diff --git a/samples/client/petstore/dart2/petstore/test/order_model_test.dart b/samples/client/petstore/dart2/petstore/test/order_model_test.dart new file mode 100644 index 000000000000..9cdc65fe52dc --- /dev/null +++ b/samples/client/petstore/dart2/petstore/test/order_model_test.dart @@ -0,0 +1,9 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +void main() { + test('Check if default value is generated', () async { + var order = Order(); + expect(order.complete, equals(false)); + }); +} diff --git a/samples/client/petstore/dart2/petstore/test/pet_faked_client_test.dart b/samples/client/petstore/dart2/petstore/test/pet_faked_client_test.dart index 376b02b47eb4..ada6c5fd444a 100644 --- a/samples/client/petstore/dart2/petstore/test/pet_faked_client_test.dart +++ b/samples/client/petstore/dart2/petstore/test/pet_faked_client_test.dart @@ -1,4 +1,5 @@ import 'dart:io'; +import 'dart:math'; import 'package:http/http.dart'; import 'package:openapi/api.dart'; @@ -31,7 +32,7 @@ void main() { ..category = category ..tags = tags ..name = name - ..status = status + ..status = PetStatusEnum.fromJson(status) ..photoUrls = ['https://petstore.com/sample/photo1.jpg']; } @@ -188,10 +189,10 @@ void main() { final id1 = newId(); final id2 = newId(); final id3 = newId(); - final status = 'available'; + final status = PetStatusEnum.available_.value; final pet1 = makePet(id: id1, status: status); final pet2 = makePet(id: id2, status: status); - final pet3 = makePet(id: id3, status: 'sold'); + final pet3 = makePet(id: id3, status: PetStatusEnum.sold_.value); return Future.wait([addPet(pet1), addPet(pet2), addPet(pet3)]) .then((_) async { @@ -202,6 +203,10 @@ void main() { getResponseBody: petApi.apiClient.serialize([pet1, pet2]), ); final pets = await petApi.findPetsByStatus([status]); + + // tests serialisation and deserialisation of enum + final petsByStatus = pets.where((p) => p.status == PetStatusEnum.available_); + expect(petsByStatus.length, equals(2)); final petIds = pets.map((pet) => pet.id).toList(); expect(petIds, contains(id1)); expect(petIds, contains(id2)); diff --git a/samples/client/petstore/dart2/petstore/test/pet_test.dart b/samples/client/petstore/dart2/petstore/test/pet_test.dart index 1ec614e0fddd..10a71acd9a09 100644 --- a/samples/client/petstore/dart2/petstore/test/pet_test.dart +++ b/samples/client/petstore/dart2/petstore/test/pet_test.dart @@ -25,14 +25,16 @@ void main() { ..id = 124321 ..name = 'Jose' ]; + return Pet( id : id, category: category, name: name, //required field + tags: tags, photoUrls: ['https://petstore.com/sample/photo1.jpg'] //required field ) - ..tags = tags - ..status = ''; + ..status = PetStatusEnum.fromJson(status) + ..photoUrls = ['https://petstore.com/sample/photo1.jpg']; } group('Pet API with live client', () { @@ -79,12 +81,12 @@ void main() { var id1 = newId(); var id2 = newId(); var id3 = newId(); - var status = 'available'; + var status = PetStatusEnum.available_.value; return Future.wait([ petApi.addPet(makePet(id: id1, status: status)), petApi.addPet(makePet(id: id2, status: status)), - petApi.addPet(makePet(id: id3, status: 'sold')) + petApi.addPet(makePet(id: id3, status: PetStatusEnum.sold_.value)) ]).then((_) async { var pets = await petApi.findPetsByStatus([status]); var petIds = pets.map((pet) => pet.id).toList(); diff --git a/samples/client/petstore/dart2/petstore_client_lib/doc/ApiResponse.md b/samples/client/petstore/dart2/petstore_client_lib/doc/ApiResponse.md index 92422f0f446e..7ad5da0f89e4 100644 --- a/samples/client/petstore/dart2/petstore_client_lib/doc/ApiResponse.md +++ b/samples/client/petstore/dart2/petstore_client_lib/doc/ApiResponse.md @@ -8,9 +8,9 @@ import 'package:openapi/api.dart'; ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**code** | **int** | | [optional] [default to null] -**type** | **String** | | [optional] [default to null] -**message** | **String** | | [optional] [default to null] +**code** | **int** | | [optional] +**type** | **String** | | [optional] +**message** | **String** | | [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/client/petstore/dart2/petstore_client_lib/doc/Category.md b/samples/client/petstore/dart2/petstore_client_lib/doc/Category.md index cc0d1633b59c..98d0b14be7b1 100644 --- a/samples/client/petstore/dart2/petstore_client_lib/doc/Category.md +++ b/samples/client/petstore/dart2/petstore_client_lib/doc/Category.md @@ -8,8 +8,8 @@ import 'package:openapi/api.dart'; ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **int** | | [optional] [default to null] -**name** | **String** | | [optional] [default to null] +**id** | **int** | | [optional] +**name** | **String** | | [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/client/petstore/dart2/petstore_client_lib/doc/Order.md b/samples/client/petstore/dart2/petstore_client_lib/doc/Order.md index 310ce6c65be3..bde5ffe51a2c 100644 --- a/samples/client/petstore/dart2/petstore_client_lib/doc/Order.md +++ b/samples/client/petstore/dart2/petstore_client_lib/doc/Order.md @@ -8,11 +8,11 @@ import 'package:openapi/api.dart'; ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **int** | | [optional] [default to null] -**petId** | **int** | | [optional] [default to null] -**quantity** | **int** | | [optional] [default to null] -**shipDate** | [**DateTime**](DateTime.md) | | [optional] [default to null] -**status** | **String** | Order Status | [optional] [default to null] +**id** | **int** | | [optional] +**petId** | **int** | | [optional] +**quantity** | **int** | | [optional] +**shipDate** | [**DateTime**](DateTime.md) | | [optional] +**status** | **String** | Order Status | [optional] **complete** | **bool** | | [optional] [default to 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/client/petstore/dart2/petstore_client_lib/doc/Pet.md b/samples/client/petstore/dart2/petstore_client_lib/doc/Pet.md index 191e1fc66a95..dc6c184bd030 100644 --- a/samples/client/petstore/dart2/petstore_client_lib/doc/Pet.md +++ b/samples/client/petstore/dart2/petstore_client_lib/doc/Pet.md @@ -8,12 +8,12 @@ import 'package:openapi/api.dart'; ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **int** | | [optional] [default to null] -**category** | [**Category**](Category.md) | | [optional] [default to null] -**name** | **String** | | [default to null] -**photoUrls** | **List<String>** | | [default to []] -**tags** | [**List<Tag>**](Tag.md) | | [optional] [default to []] -**status** | **String** | pet status in the store | [optional] [default to null] +**id** | **int** | | [optional] +**category** | [**Category**](Category.md) | | [optional] +**name** | **String** | | +**photoUrls** | **List<String>** | | [default to const []] +**tags** | [**List<Tag>**](Tag.md) | | [optional] [default to const []] +**status** | **String** | pet status in the store | [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/client/petstore/dart2/petstore_client_lib/doc/PetApi.md b/samples/client/petstore/dart2/petstore_client_lib/doc/PetApi.md index 7b5de3894a91..cdd56362b2db 100644 --- a/samples/client/petstore/dart2/petstore_client_lib/doc/PetApi.md +++ b/samples/client/petstore/dart2/petstore_client_lib/doc/PetApi.md @@ -87,8 +87,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **petId** | **int**| Pet id to delete | [default to null] - **apiKey** | **String**| | [optional] [default to null] + **petId** | **int**| Pet id to delete | + **apiKey** | **String**| | [optional] ### Return type @@ -133,7 +133,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **status** | [**List<String>**](String.md)| Status values that need to be considered for filter | [default to []] + **status** | [**List<String>**](String.md)| Status values that need to be considered for filter | [default to const []] ### Return type @@ -178,7 +178,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **tags** | [**List<String>**](String.md)| Tags to filter by | [default to []] + **tags** | [**List<String>**](String.md)| Tags to filter by | [default to const []] ### Return type @@ -225,7 +225,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **petId** | **int**| ID of pet to return | [default to null] + **petId** | **int**| ID of pet to return | ### Return type @@ -311,9 +311,9 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **petId** | **int**| ID of pet that needs to be updated | [default to null] - **name** | **String**| Updated name of the pet | [optional] [default to null] - **status** | **String**| Updated status of the pet | [optional] [default to null] + **petId** | **int**| ID of pet that needs to be updated | + **name** | **String**| Updated name of the pet | [optional] + **status** | **String**| Updated status of the pet | [optional] ### Return type @@ -358,9 +358,9 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **petId** | **int**| ID of pet to update | [default to null] - **additionalMetadata** | **String**| Additional data to pass to server | [optional] [default to null] - **file** | **MultipartFile**| file to upload | [optional] [default to null] + **petId** | **int**| ID of pet to update | + **additionalMetadata** | **String**| Additional data to pass to server | [optional] + **file** | **MultipartFile**| file to upload | [optional] ### Return type diff --git a/samples/client/petstore/dart2/petstore_client_lib/doc/StoreApi.md b/samples/client/petstore/dart2/petstore_client_lib/doc/StoreApi.md index 1cc37e2a47ab..6ff167fc834f 100644 --- a/samples/client/petstore/dart2/petstore_client_lib/doc/StoreApi.md +++ b/samples/client/petstore/dart2/petstore_client_lib/doc/StoreApi.md @@ -40,7 +40,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **orderId** | **String**| ID of the order that needs to be deleted | [default to null] + **orderId** | **String**| ID of the order that needs to be deleted | ### Return type @@ -126,7 +126,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **orderId** | **int**| ID of pet that needs to be fetched | [default to null] + **orderId** | **int**| ID of pet that needs to be fetched | ### Return type diff --git a/samples/client/petstore/dart2/petstore_client_lib/doc/Tag.md b/samples/client/petstore/dart2/petstore_client_lib/doc/Tag.md index ded7b32ac3d7..c219f987c19c 100644 --- a/samples/client/petstore/dart2/petstore_client_lib/doc/Tag.md +++ b/samples/client/petstore/dart2/petstore_client_lib/doc/Tag.md @@ -8,8 +8,8 @@ import 'package:openapi/api.dart'; ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **int** | | [optional] [default to null] -**name** | **String** | | [optional] [default to null] +**id** | **int** | | [optional] +**name** | **String** | | [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/client/petstore/dart2/petstore_client_lib/doc/User.md b/samples/client/petstore/dart2/petstore_client_lib/doc/User.md index 3761b70cf0b7..fa87e64d8595 100644 --- a/samples/client/petstore/dart2/petstore_client_lib/doc/User.md +++ b/samples/client/petstore/dart2/petstore_client_lib/doc/User.md @@ -8,14 +8,14 @@ import 'package:openapi/api.dart'; ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **int** | | [optional] [default to null] -**username** | **String** | | [optional] [default to null] -**firstName** | **String** | | [optional] [default to null] -**lastName** | **String** | | [optional] [default to null] -**email** | **String** | | [optional] [default to null] -**password** | **String** | | [optional] [default to null] -**phone** | **String** | | [optional] [default to null] -**userStatus** | **int** | User Status | [optional] [default to null] +**id** | **int** | | [optional] +**username** | **String** | | [optional] +**firstName** | **String** | | [optional] +**lastName** | **String** | | [optional] +**email** | **String** | | [optional] +**password** | **String** | | [optional] +**phone** | **String** | | [optional] +**userStatus** | **int** | User Status | [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/client/petstore/dart2/petstore_client_lib/doc/UserApi.md b/samples/client/petstore/dart2/petstore_client_lib/doc/UserApi.md index 1ee5f6fced69..f3809ef73a35 100644 --- a/samples/client/petstore/dart2/petstore_client_lib/doc/UserApi.md +++ b/samples/client/petstore/dart2/petstore_client_lib/doc/UserApi.md @@ -166,7 +166,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | **String**| The name that needs to be deleted | [default to null] + **username** | **String**| The name that needs to be deleted | ### Return type @@ -207,7 +207,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | **String**| The name that needs to be fetched. Use user1 for testing. | [default to null] + **username** | **String**| The name that needs to be fetched. Use user1 for testing. | ### Return type @@ -249,8 +249,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | **String**| The user name for login | [default to null] - **password** | **String**| The password for login in clear text | [default to null] + **username** | **String**| The user name for login | + **password** | **String**| The password for login in clear text | ### Return type @@ -329,7 +329,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | **String**| name that need to be deleted | [default to null] + **username** | **String**| name that need to be deleted | **body** | [**User**](User.md)| Updated user object | ### Return type diff --git a/samples/client/petstore/dart2/petstore_client_lib/lib/model/api_response.dart b/samples/client/petstore/dart2/petstore_client_lib/lib/model/api_response.dart index ddc3cafb99db..423d533a97b6 100644 --- a/samples/client/petstore/dart2/petstore_client_lib/lib/model/api_response.dart +++ b/samples/client/petstore/dart2/petstore_client_lib/lib/model/api_response.dart @@ -2,11 +2,11 @@ part of openapi.api; class ApiResponse { - int code = null; + int code; - String type = null; + String type; - String message = null; + String message; ApiResponse({ this.code, @@ -27,7 +27,7 @@ class ApiResponse { } Map toJson() { - Map json = {}; + Map json = {}; if (code != null) json['code'] = code; if (type != null) @@ -42,7 +42,7 @@ class ApiResponse { } static Map mapFromJson(Map json) { - var map = Map(); + final map = Map(); if (json != null && json.isNotEmpty) { json.forEach((String key, dynamic value) => map[key] = ApiResponse.fromJson(value)); } @@ -51,13 +51,13 @@ class ApiResponse { // maps a json object with a list of ApiResponse-objects as value to a dart map static Map> mapListFromJson(Map json) { - var map = Map>(); - if (json != null && json.isNotEmpty) { - json.forEach((String key, dynamic value) { - map[key] = ApiResponse.listFromJson(value); - }); - } - return map; + final map = Map>(); + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic value) { + map[key] = ApiResponse.listFromJson(value); + }); + } + return map; } } diff --git a/samples/client/petstore/dart2/petstore_client_lib/lib/model/category.dart b/samples/client/petstore/dart2/petstore_client_lib/lib/model/category.dart index 3bcb27396bc5..243b8855d352 100644 --- a/samples/client/petstore/dart2/petstore_client_lib/lib/model/category.dart +++ b/samples/client/petstore/dart2/petstore_client_lib/lib/model/category.dart @@ -2,9 +2,9 @@ part of openapi.api; class Category { - int id = null; + int id; - String name = null; + String name; Category({ this.id, @@ -23,7 +23,7 @@ class Category { } Map toJson() { - Map json = {}; + Map json = {}; if (id != null) json['id'] = id; if (name != null) @@ -36,7 +36,7 @@ class Category { } static Map mapFromJson(Map json) { - var map = Map(); + final map = Map(); if (json != null && json.isNotEmpty) { json.forEach((String key, dynamic value) => map[key] = Category.fromJson(value)); } @@ -45,13 +45,13 @@ class Category { // maps a json object with a list of Category-objects as value to a dart map static Map> mapListFromJson(Map json) { - var map = Map>(); - if (json != null && json.isNotEmpty) { - json.forEach((String key, dynamic value) { - map[key] = Category.listFromJson(value); - }); - } - return map; + final map = Map>(); + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic value) { + map[key] = Category.listFromJson(value); + }); + } + return map; } } diff --git a/samples/client/petstore/dart2/petstore_client_lib/lib/model/order.dart b/samples/client/petstore/dart2/petstore_client_lib/lib/model/order.dart index f313282411e8..821b59586aa1 100644 --- a/samples/client/petstore/dart2/petstore_client_lib/lib/model/order.dart +++ b/samples/client/petstore/dart2/petstore_client_lib/lib/model/order.dart @@ -2,16 +2,15 @@ part of openapi.api; class Order { - int id = null; + int id; - int petId = null; + int petId; - int quantity = null; + int quantity; - DateTime shipDate = null; - /* Order Status */ - String status = null; - //enum statusEnum { placed, approved, delivered, };{ + DateTime shipDate; + /// Order Status + OrderStatusEnum status; bool complete = false; @@ -21,7 +20,7 @@ class Order { this.quantity, this.shipDate, this.status, - this.complete, + this.complete = false, }); @override @@ -37,12 +36,12 @@ class Order { shipDate = (json['shipDate'] == null) ? null : DateTime.parse(json['shipDate']); - status = json['status']; + status = OrderStatusEnum.fromJson(json['status']); complete = json['complete']; } Map toJson() { - Map json = {}; + Map json = {}; if (id != null) json['id'] = id; if (petId != null) @@ -52,7 +51,7 @@ class Order { if (shipDate != null) json['shipDate'] = shipDate == null ? null : shipDate.toUtc().toIso8601String(); if (status != null) - json['status'] = status; + json['status'] = status.value; if (complete != null) json['complete'] = complete; return json; @@ -63,7 +62,7 @@ class Order { } static Map mapFromJson(Map json) { - var map = Map(); + final map = Map(); if (json != null && json.isNotEmpty) { json.forEach((String key, dynamic value) => map[key] = Order.fromJson(value)); } @@ -72,13 +71,62 @@ class Order { // maps a json object with a list of Order-objects as value to a dart map static Map> mapListFromJson(Map json) { - var map = Map>(); - if (json != null && json.isNotEmpty) { - json.forEach((String key, dynamic value) { - map[key] = Order.listFromJson(value); - }); - } - return map; + final map = Map>(); + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic value) { + map[key] = Order.listFromJson(value); + }); + } + return map; } } +class OrderStatusEnum { + /// The underlying value of this enum member. + final String value; + + const OrderStatusEnum._internal(this.value); + + /// Order Status + static const OrderStatusEnum placed_ = OrderStatusEnum._internal("placed"); + /// Order Status + static const OrderStatusEnum approved_ = OrderStatusEnum._internal("approved"); + /// Order Status + static const OrderStatusEnum delivered_ = OrderStatusEnum._internal("delivered"); + + String toJson () { + return value; + } + + @override + String toString () { + return value; + } + + static OrderStatusEnum fromJson(String value) { + return OrderStatusEnumTypeTransformer().decode(value); + } + + static List listFromJson(List json) { + return json == null + ? List() + : json.map((value) => OrderStatusEnum.fromJson(value)).toList(); + } +} + +class OrderStatusEnumTypeTransformer { + + dynamic encode(OrderStatusEnum data) { + return data.value; + } + + OrderStatusEnum decode(dynamic data) { + switch (data) { + case "placed": return OrderStatusEnum.placed_; + case "approved": return OrderStatusEnum.approved_; + case "delivered": return OrderStatusEnum.delivered_; + default: return null; + } + } +} + diff --git a/samples/client/petstore/dart2/petstore_client_lib/lib/model/pet.dart b/samples/client/petstore/dart2/petstore_client_lib/lib/model/pet.dart index 507661984e26..0999f9f638ec 100644 --- a/samples/client/petstore/dart2/petstore_client_lib/lib/model/pet.dart +++ b/samples/client/petstore/dart2/petstore_client_lib/lib/model/pet.dart @@ -2,25 +2,24 @@ part of openapi.api; class Pet { - int id = null; + int id; - Category category = null; + Category category; - String name = null; + String name; - List photoUrls = []; + List photoUrls = const []; - List tags = []; - /* pet status in the store */ - String status = null; - //enum statusEnum { available, pending, sold, };{ + List tags = const []; + /// pet status in the store + PetStatusEnum status; Pet({ this.id, this.category, @required this.name, @required this.photoUrls, - this.tags, + this.tags = const [], this.status, }); @@ -42,11 +41,11 @@ class Pet { tags = (json['tags'] == null) ? null : Tag.listFromJson(json['tags']); - status = json['status']; + status = PetStatusEnum.fromJson(json['status']); } Map toJson() { - Map json = {}; + Map json = {}; if (id != null) json['id'] = id; if (category != null) @@ -58,7 +57,7 @@ class Pet { if (tags != null) json['tags'] = tags; if (status != null) - json['status'] = status; + json['status'] = status.value; return json; } @@ -67,7 +66,7 @@ class Pet { } static Map mapFromJson(Map json) { - var map = Map(); + final map = Map(); if (json != null && json.isNotEmpty) { json.forEach((String key, dynamic value) => map[key] = Pet.fromJson(value)); } @@ -76,13 +75,62 @@ class Pet { // maps a json object with a list of Pet-objects as value to a dart map static Map> mapListFromJson(Map json) { - var map = Map>(); - if (json != null && json.isNotEmpty) { - json.forEach((String key, dynamic value) { - map[key] = Pet.listFromJson(value); - }); - } - return map; + final map = Map>(); + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic value) { + map[key] = Pet.listFromJson(value); + }); + } + return map; } } +class PetStatusEnum { + /// The underlying value of this enum member. + final String value; + + const PetStatusEnum._internal(this.value); + + /// pet status in the store + static const PetStatusEnum available_ = PetStatusEnum._internal("available"); + /// pet status in the store + static const PetStatusEnum pending_ = PetStatusEnum._internal("pending"); + /// pet status in the store + static const PetStatusEnum sold_ = PetStatusEnum._internal("sold"); + + String toJson () { + return value; + } + + @override + String toString () { + return value; + } + + static PetStatusEnum fromJson(String value) { + return PetStatusEnumTypeTransformer().decode(value); + } + + static List listFromJson(List json) { + return json == null + ? List() + : json.map((value) => PetStatusEnum.fromJson(value)).toList(); + } +} + +class PetStatusEnumTypeTransformer { + + dynamic encode(PetStatusEnum data) { + return data.value; + } + + PetStatusEnum decode(dynamic data) { + switch (data) { + case "available": return PetStatusEnum.available_; + case "pending": return PetStatusEnum.pending_; + case "sold": return PetStatusEnum.sold_; + default: return null; + } + } +} + diff --git a/samples/client/petstore/dart2/petstore_client_lib/lib/model/tag.dart b/samples/client/petstore/dart2/petstore_client_lib/lib/model/tag.dart index 743382dc408b..0907897e1c89 100644 --- a/samples/client/petstore/dart2/petstore_client_lib/lib/model/tag.dart +++ b/samples/client/petstore/dart2/petstore_client_lib/lib/model/tag.dart @@ -2,9 +2,9 @@ part of openapi.api; class Tag { - int id = null; + int id; - String name = null; + String name; Tag({ this.id, @@ -23,7 +23,7 @@ class Tag { } Map toJson() { - Map json = {}; + Map json = {}; if (id != null) json['id'] = id; if (name != null) @@ -36,7 +36,7 @@ class Tag { } static Map mapFromJson(Map json) { - var map = Map(); + final map = Map(); if (json != null && json.isNotEmpty) { json.forEach((String key, dynamic value) => map[key] = Tag.fromJson(value)); } @@ -45,13 +45,13 @@ class Tag { // maps a json object with a list of Tag-objects as value to a dart map static Map> mapListFromJson(Map json) { - var map = Map>(); - if (json != null && json.isNotEmpty) { - json.forEach((String key, dynamic value) { - map[key] = Tag.listFromJson(value); - }); - } - return map; + final map = Map>(); + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic value) { + map[key] = Tag.listFromJson(value); + }); + } + return map; } } diff --git a/samples/client/petstore/dart2/petstore_client_lib/lib/model/user.dart b/samples/client/petstore/dart2/petstore_client_lib/lib/model/user.dart index b7ce4924183c..29fb77ec9660 100644 --- a/samples/client/petstore/dart2/petstore_client_lib/lib/model/user.dart +++ b/samples/client/petstore/dart2/petstore_client_lib/lib/model/user.dart @@ -2,21 +2,21 @@ part of openapi.api; class User { - int id = null; + int id; - String username = null; + String username; - String firstName = null; + String firstName; - String lastName = null; + String lastName; - String email = null; + String email; - String password = null; + String password; - String phone = null; - /* User Status */ - int userStatus = null; + String phone; + /// User Status + int userStatus; User({ this.id, @@ -47,7 +47,7 @@ class User { } Map toJson() { - Map json = {}; + Map json = {}; if (id != null) json['id'] = id; if (username != null) @@ -72,7 +72,7 @@ class User { } static Map mapFromJson(Map json) { - var map = Map(); + final map = Map(); if (json != null && json.isNotEmpty) { json.forEach((String key, dynamic value) => map[key] = User.fromJson(value)); } @@ -81,13 +81,13 @@ class User { // maps a json object with a list of User-objects as value to a dart map static Map> mapListFromJson(Map json) { - var map = Map>(); - if (json != null && json.isNotEmpty) { - json.forEach((String key, dynamic value) { - map[key] = User.listFromJson(value); - }); - } - return map; + final map = Map>(); + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic value) { + map[key] = User.listFromJson(value); + }); + } + return map; } } From 1bfd86a35089832d329ef25b0d93bdf99f32e602 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Zubkowicz?= Date: Thu, 23 Jul 2020 08:09:27 +0200 Subject: [PATCH 057/129] typescript-inversify: client compile error, type casting warning and apostrophes (#6970) --- .../ApiServiceBinder.mustache | 4 +- .../typescript-inversify/HttpClient.mustache | 36 +++++------ .../HttpResponse.mustache | 4 +- .../typescript-inversify/IHttpClient.mustache | 10 +-- .../typescript-inversify/api.service.mustache | 46 ++++++------- .../apiInterface.mustache | 10 +-- .../typescript-inversify/ApiServiceBinder.ts | 8 +-- .../typescript-inversify/HttpClient.ts | 34 +++++----- .../typescript-inversify/HttpResponse.ts | 4 +- .../typescript-inversify/IHttpClient.ts | 8 +-- .../typescript-inversify/api/pet.service.ts | 64 +++++++++---------- .../typescript-inversify/api/store.service.ts | 42 ++++++------ .../typescript-inversify/api/user.service.ts | 58 ++++++++--------- 13 files changed, 164 insertions(+), 164 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/typescript-inversify/ApiServiceBinder.mustache b/modules/openapi-generator/src/main/resources/typescript-inversify/ApiServiceBinder.mustache index 0026933c69c8..0910471d09c6 100644 --- a/modules/openapi-generator/src/main/resources/typescript-inversify/ApiServiceBinder.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-inversify/ApiServiceBinder.mustache @@ -1,4 +1,4 @@ -import {interfaces} from "inversify"; +import {interfaces} from 'inversify'; {{#apiInfo}} {{#apis}} @@ -13,7 +13,7 @@ export class ApiServiceBinder { public static with(container: interfaces.Container) { {{#apiInfo}} {{#apis}} - container.bind<{{classname}}{{#withInterfaces}}Interface{{/withInterfaces}}>("{{classname}}").to({{classname}}).inSingletonScope(); + container.bind<{{classname}}{{#withInterfaces}}Interface{{/withInterfaces}}>('{{classname}}').to({{classname}}).inSingletonScope(); {{/apis}} {{/apiInfo}} } diff --git a/modules/openapi-generator/src/main/resources/typescript-inversify/HttpClient.mustache b/modules/openapi-generator/src/main/resources/typescript-inversify/HttpClient.mustache index 23c9363ff34d..ec584a0fe6d9 100644 --- a/modules/openapi-generator/src/main/resources/typescript-inversify/HttpClient.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-inversify/HttpClient.mustache @@ -1,39 +1,39 @@ -import IHttpClient from "./IHttpClient"; +import IHttpClient from './IHttpClient'; {{^useRxJS6}} -import { Observable } from "rxjs/Observable"; +import { Observable } from 'rxjs/Observable'; {{/useRxJS6}} {{#useRxJS6}} -import { Observable, from } from "rxjs"; +import { Observable, from } from 'rxjs'; {{/useRxJS6}} -import "whatwg-fetch"; -import HttpResponse from "./HttpResponse"; -import {injectable} from "inversify"; -import { Headers } from "./Headers"; +import 'whatwg-fetch'; +import HttpResponse from './HttpResponse'; +import {injectable} from 'inversify'; +import { Headers } from './Headers'; @injectable() class HttpClient implements IHttpClient { get(url:string, headers?: Headers):Observable { - return this.performNetworkCall(url, "GET", undefined, headers); + return this.performNetworkCall(url, 'GET', undefined, headers); } post(url: string, body?: {}|FormData, headers?: Headers): Observable { - return this.performNetworkCall(url, "POST", this.getJsonBody(body), this.addJsonHeaders(headers)); + return this.performNetworkCall(url, 'POST', this.getJsonBody(body), this.addJsonHeaders(headers)); } put(url: string, body?: {}, headers?: Headers): Observable { - return this.performNetworkCall(url, "PUT", this.getJsonBody(body), this.addJsonHeaders(headers)); + return this.performNetworkCall(url, 'PUT', this.getJsonBody(body), this.addJsonHeaders(headers)); } patch(url: string, body?: {}, headers?: Headers): Observable { - return this.performNetworkCall(url, "PATCH", this.getJsonBody(body), this.addJsonHeaders(headers)); + return this.performNetworkCall(url, 'PATCH', this.getJsonBody(body), this.addJsonHeaders(headers)); } delete(url: string, headers?: Headers): Observable { - return this.performNetworkCall(url, "DELETE", undefined, headers); + return this.performNetworkCall(url, 'DELETE', undefined, headers); } private getJsonBody(body?: {}|FormData) { @@ -45,16 +45,16 @@ class HttpClient implements IHttpClient { private addJsonHeaders(headers?: Headers) { return Object.assign({}, { - "Accept": "application/json", - "Content-Type": "application/json" + 'Accept': 'application/json', + 'Content-Type': 'application/json' }, headers); }; private performNetworkCall(url: string, method: string, body?: any, headers?: Headers): Observable { // when using fetch & a multipart upload, the requests content-type is handled by the browser, so should be left unset otherwise the multipart boundry is not added - if(headers && headers["Content-Type"] === "multipart/form-data") { - delete headers["Content-Type"]; + if(headers && headers['Content-Type'] === 'multipart/form-data') { + delete headers['Content-Type']; } let promise = window.fetch(url, { @@ -67,8 +67,8 @@ class HttpClient implements IHttpClient { headers[name.toString().toLowerCase()] = value; }); return response.text().then(text => { - let contentType = headers["content-type"] || ""; - let payload = contentType.match("application/json") ? JSON.parse(text) : text; + let contentType = headers['content-type'] || ''; + let payload = contentType.match('application/json') ? JSON.parse(text) : text; let httpResponse = new HttpResponse(payload, response.status, headers); if (response.status >= 400) diff --git a/modules/openapi-generator/src/main/resources/typescript-inversify/HttpResponse.mustache b/modules/openapi-generator/src/main/resources/typescript-inversify/HttpResponse.mustache index 411240cde2bd..1ad12e80856c 100644 --- a/modules/openapi-generator/src/main/resources/typescript-inversify/HttpResponse.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-inversify/HttpResponse.mustache @@ -1,8 +1,8 @@ -import { Headers } from "./Headers" +import { Headers } from './Headers' class HttpResponse { constructor(public response: T, public status:number, public headers?: Headers) { } } -export default HttpResponse \ No newline at end of file +export default HttpResponse diff --git a/modules/openapi-generator/src/main/resources/typescript-inversify/IHttpClient.mustache b/modules/openapi-generator/src/main/resources/typescript-inversify/IHttpClient.mustache index 211d881ba5eb..b2a8ce50aca6 100644 --- a/modules/openapi-generator/src/main/resources/typescript-inversify/IHttpClient.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-inversify/IHttpClient.mustache @@ -1,11 +1,11 @@ {{^useRxJS6}} -import { Observable } from "rxjs/Observable"; +import { Observable } from 'rxjs/Observable'; {{/useRxJS6}} {{#useRxJS6}} -import { Observable, from } from "rxjs"; +import { Observable, from } from 'rxjs'; {{/useRxJS6}} -import HttpResponse from "./HttpResponse"; -import { Headers } from "./Headers"; +import HttpResponse from './HttpResponse'; +import { Headers } from './Headers'; interface IHttpClient { get(url:string, headers?: Headers):Observable @@ -15,4 +15,4 @@ interface IHttpClient { delete(url:string, headers?: Headers):Observable } -export default IHttpClient \ No newline at end of file +export default IHttpClient diff --git a/modules/openapi-generator/src/main/resources/typescript-inversify/api.service.mustache b/modules/openapi-generator/src/main/resources/typescript-inversify/api.service.mustache index 1e1c87b7525b..eb6f523add6b 100644 --- a/modules/openapi-generator/src/main/resources/typescript-inversify/api.service.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-inversify/api.service.mustache @@ -2,26 +2,26 @@ /* tslint:disable:no-unused-variable member-ordering */ {{^useRxJS6}} -import { Observable } from "rxjs/Observable"; +import { Observable } from 'rxjs/Observable'; {{/useRxJS6}} {{#useRxJS6}} -import { Observable } from "rxjs"; +import { Observable } from 'rxjs'; {{/useRxJS6}} -import { map } from "rxjs/operators"; -import IHttpClient from "../IHttpClient"; -import { inject, injectable } from "inversify"; -import { IAPIConfiguration } from "../IAPIConfiguration"; -import { Headers } from "../Headers"; -import HttpResponse from "../HttpResponse"; +import { map } from 'rxjs/operators'; +import IHttpClient from '../IHttpClient'; +import { inject, injectable } from 'inversify'; +import { IAPIConfiguration } from '../IAPIConfiguration'; +import { Headers } from '../Headers'; +import HttpResponse from '../HttpResponse'; {{#imports}} -import { {{classname}} } from "../{{filename}}"; +import { {{classname}} } from '../{{filename}}'; {{/imports}} -import { COLLECTION_FORMATS } from "../variables"; +import { COLLECTION_FORMATS } from '../variables'; {{#withInterfaces}} -import { {{classname}}Interface } from "./{{classFilename}}Interface"; +import { {{classname}}Interface } from './{{classFilename}}Interface'; {{/withInterfaces}} {{#operations}} @@ -41,8 +41,8 @@ export class {{classname}} { {{/withInterfaces}} private basePath: string = '{{{basePath}}}'; - constructor(@inject("IApiHttpClient") private httpClient: IHttpClient, - @inject("IAPIConfiguration") private APIConfiguration: IAPIConfiguration ) { + constructor(@inject('IApiHttpClient') private httpClient: IHttpClient, + @inject('IAPIConfiguration') private APIConfiguration: IAPIConfiguration ) { if(this.APIConfiguration.basePath) this.basePath = this.APIConfiguration.basePath; } @@ -73,21 +73,21 @@ export class {{classname}} { if ({{paramName}}) { {{#isCollectionFormatMulti}} {{paramName}}.forEach((element) => { - queryParameters.push("{{paramName}}="+encodeURIComponent(String({{paramName}}))); + queryParameters.push('{{paramName}}='+encodeURIComponent(String({{paramName}}))); }) {{/isCollectionFormatMulti}} {{^isCollectionFormatMulti}} - queryParameters.push("{{paramName}}="+encodeURIComponent({{paramName}}.join(COLLECTION_FORMATS['{{collectionFormat}}']))); + queryParameters.push('{{paramName}}='+encodeURIComponent({{paramName}}.join(COLLECTION_FORMATS['{{collectionFormat}}']))); {{/isCollectionFormatMulti}} } {{/isListContainer}} {{^isListContainer}} if ({{paramName}} !== undefined) { {{#isDateTime}} - queryParameters.push("{{paramName}}="+encodeURIComponent({{paramName}}.toISOString())); + queryParameters.push('{{paramName}}='+encodeURIComponent(({{paramName}} as Date).toISOString())); {{/isDateTime}} {{^isDateTime}} - queryParameters.push("{{paramName}}="+encodeURIComponent(String({{paramName}}))); + queryParameters.push('{{paramName}}='+encodeURIComponent(String({{paramName}}))); {{/isDateTime}} } {{/isListContainer}} @@ -111,13 +111,13 @@ export class {{classname}} { // authentication ({{name}}) required {{#isApiKey}} {{#isKeyInHeader}} - if (this.APIConfiguration.apiKeys && this.APIConfiguration.apiKeys["{{keyParamName}}"]) { - headers['{{keyParamName}}'] = this.APIConfiguration.apiKeys["{{keyParamName}}"]; + if (this.APIConfiguration.apiKeys && this.APIConfiguration.apiKeys['{{keyParamName}}']) { + headers['{{keyParamName}}'] = this.APIConfiguration.apiKeys['{{keyParamName}}']; } {{/isKeyInHeader}} {{#isKeyInQuery}} - if (this.APIConfiguration.apiKeys && this.APIConfiguration.apiKeys["{{keyParamName}}"]) { - queryParameters.push("{{paramName}}="+encodeURIComponent(String(this.APIConfiguration.apiKeys["{{keyParamName}}"]))); + if (this.APIConfiguration.apiKeys && this.APIConfiguration.apiKeys['{{keyParamName}}']) { + queryParameters.push('{{paramName}}='+encodeURIComponent(String(this.APIConfiguration.apiKeys['{{keyParamName}}']))); } {{/isKeyInQuery}} {{/isApiKey}} @@ -180,9 +180,9 @@ export class {{classname}} { {{/hasFormParams}} const response: Observable> = this.httpClient.{{httpMethod}}(`${this.basePath}{{{path}}}{{#hasQueryParams}}?${queryParameters.join('&')}{{/hasQueryParams}}`{{#bodyParam}}, {{paramName}} {{/bodyParam}}{{#hasFormParams}}, formData{{/hasFormParams}}, headers); - if (observe == 'body') { + if (observe === 'body') { return response.pipe( - map(httpResponse => <{{#returnType}}{{{returnType}}}{{#isResponseTypeFile}}|undefined{{/isResponseTypeFile}}{{/returnType}}{{^returnType}}any{{/returnType}}>(httpResponse.response)) + map((httpResponse: HttpResponse) => <{{#returnType}}{{{returnType}}}{{#isResponseTypeFile}}|undefined{{/isResponseTypeFile}}{{/returnType}}{{^returnType}}any{{/returnType}}>(httpResponse.response)) ){{#usePromise}}.toPromise(){{/usePromise}}; } return response{{#usePromise}}.toPromise(){{/usePromise}}; diff --git a/modules/openapi-generator/src/main/resources/typescript-inversify/apiInterface.mustache b/modules/openapi-generator/src/main/resources/typescript-inversify/apiInterface.mustache index f6c4c03e5ccd..11f0c15809ac 100644 --- a/modules/openapi-generator/src/main/resources/typescript-inversify/apiInterface.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-inversify/apiInterface.mustache @@ -1,15 +1,15 @@ {{>licenseInfo}} -import { Headers } from "../Headers"; +import { Headers } from '../Headers'; {{^useRxJS6}} -import { Observable } from "rxjs/Observable"; +import { Observable } from 'rxjs/Observable'; {{/useRxJS6}} {{#useRxJS6}} -import { Observable } from "rxjs"; +import { Observable } from 'rxjs'; {{/useRxJS6}} {{#imports}} -import { {{classname}} } from "../{{filename}}"; +import { {{classname}} } from '../{{filename}}'; {{/imports}} -import HttpResponse from "../HttpResponse"; +import HttpResponse from '../HttpResponse'; {{#operations}} diff --git a/samples/client/petstore/typescript-inversify/ApiServiceBinder.ts b/samples/client/petstore/typescript-inversify/ApiServiceBinder.ts index 779a08712085..ee6cfa0717bc 100644 --- a/samples/client/petstore/typescript-inversify/ApiServiceBinder.ts +++ b/samples/client/petstore/typescript-inversify/ApiServiceBinder.ts @@ -1,4 +1,4 @@ -import {interfaces} from "inversify"; +import {interfaces} from 'inversify'; import { PetService } from './api/pet.service'; import { StoreService } from './api/store.service'; @@ -6,8 +6,8 @@ import { UserService } from './api/user.service'; export class ApiServiceBinder { public static with(container: interfaces.Container) { - container.bind("PetService").to(PetService).inSingletonScope(); - container.bind("StoreService").to(StoreService).inSingletonScope(); - container.bind("UserService").to(UserService).inSingletonScope(); + container.bind('PetService').to(PetService).inSingletonScope(); + container.bind('StoreService').to(StoreService).inSingletonScope(); + container.bind('UserService').to(UserService).inSingletonScope(); } } diff --git a/samples/client/petstore/typescript-inversify/HttpClient.ts b/samples/client/petstore/typescript-inversify/HttpClient.ts index 785d1db32f1e..3d3e7c2c1c37 100644 --- a/samples/client/petstore/typescript-inversify/HttpClient.ts +++ b/samples/client/petstore/typescript-inversify/HttpClient.ts @@ -1,34 +1,34 @@ -import IHttpClient from "./IHttpClient"; +import IHttpClient from './IHttpClient'; -import { Observable } from "rxjs/Observable"; +import { Observable } from 'rxjs/Observable'; -import "whatwg-fetch"; -import HttpResponse from "./HttpResponse"; -import {injectable} from "inversify"; -import { Headers } from "./Headers"; +import 'whatwg-fetch'; +import HttpResponse from './HttpResponse'; +import {injectable} from 'inversify'; +import { Headers } from './Headers'; @injectable() class HttpClient implements IHttpClient { get(url:string, headers?: Headers):Observable { - return this.performNetworkCall(url, "GET", undefined, headers); + return this.performNetworkCall(url, 'GET', undefined, headers); } post(url: string, body?: {}|FormData, headers?: Headers): Observable { - return this.performNetworkCall(url, "POST", this.getJsonBody(body), this.addJsonHeaders(headers)); + return this.performNetworkCall(url, 'POST', this.getJsonBody(body), this.addJsonHeaders(headers)); } put(url: string, body?: {}, headers?: Headers): Observable { - return this.performNetworkCall(url, "PUT", this.getJsonBody(body), this.addJsonHeaders(headers)); + return this.performNetworkCall(url, 'PUT', this.getJsonBody(body), this.addJsonHeaders(headers)); } patch(url: string, body?: {}, headers?: Headers): Observable { - return this.performNetworkCall(url, "PATCH", this.getJsonBody(body), this.addJsonHeaders(headers)); + return this.performNetworkCall(url, 'PATCH', this.getJsonBody(body), this.addJsonHeaders(headers)); } delete(url: string, headers?: Headers): Observable { - return this.performNetworkCall(url, "DELETE", undefined, headers); + return this.performNetworkCall(url, 'DELETE', undefined, headers); } private getJsonBody(body?: {}|FormData) { @@ -40,16 +40,16 @@ class HttpClient implements IHttpClient { private addJsonHeaders(headers?: Headers) { return Object.assign({}, { - "Accept": "application/json", - "Content-Type": "application/json" + 'Accept': 'application/json', + 'Content-Type': 'application/json' }, headers); }; private performNetworkCall(url: string, method: string, body?: any, headers?: Headers): Observable { // when using fetch & a multipart upload, the requests content-type is handled by the browser, so should be left unset otherwise the multipart boundry is not added - if(headers && headers["Content-Type"] === "multipart/form-data") { - delete headers["Content-Type"]; + if(headers && headers['Content-Type'] === 'multipart/form-data') { + delete headers['Content-Type']; } let promise = window.fetch(url, { @@ -62,8 +62,8 @@ class HttpClient implements IHttpClient { headers[name.toString().toLowerCase()] = value; }); return response.text().then(text => { - let contentType = headers["content-type"] || ""; - let payload = contentType.match("application/json") ? JSON.parse(text) : text; + let contentType = headers['content-type'] || ''; + let payload = contentType.match('application/json') ? JSON.parse(text) : text; let httpResponse = new HttpResponse(payload, response.status, headers); if (response.status >= 400) diff --git a/samples/client/petstore/typescript-inversify/HttpResponse.ts b/samples/client/petstore/typescript-inversify/HttpResponse.ts index 411240cde2bd..1ad12e80856c 100644 --- a/samples/client/petstore/typescript-inversify/HttpResponse.ts +++ b/samples/client/petstore/typescript-inversify/HttpResponse.ts @@ -1,8 +1,8 @@ -import { Headers } from "./Headers" +import { Headers } from './Headers' class HttpResponse { constructor(public response: T, public status:number, public headers?: Headers) { } } -export default HttpResponse \ No newline at end of file +export default HttpResponse diff --git a/samples/client/petstore/typescript-inversify/IHttpClient.ts b/samples/client/petstore/typescript-inversify/IHttpClient.ts index 51064868934b..0e5cb0cbebd7 100644 --- a/samples/client/petstore/typescript-inversify/IHttpClient.ts +++ b/samples/client/petstore/typescript-inversify/IHttpClient.ts @@ -1,6 +1,6 @@ -import { Observable } from "rxjs/Observable"; -import HttpResponse from "./HttpResponse"; -import { Headers } from "./Headers"; +import { Observable } from 'rxjs/Observable'; +import HttpResponse from './HttpResponse'; +import { Headers } from './Headers'; interface IHttpClient { get(url:string, headers?: Headers):Observable @@ -10,4 +10,4 @@ interface IHttpClient { delete(url:string, headers?: Headers):Observable } -export default IHttpClient \ No newline at end of file +export default IHttpClient diff --git a/samples/client/petstore/typescript-inversify/api/pet.service.ts b/samples/client/petstore/typescript-inversify/api/pet.service.ts index 167af86019df..4c9251d993b1 100644 --- a/samples/client/petstore/typescript-inversify/api/pet.service.ts +++ b/samples/client/petstore/typescript-inversify/api/pet.service.ts @@ -11,19 +11,19 @@ */ /* tslint:disable:no-unused-variable member-ordering */ -import { Observable } from "rxjs/Observable"; +import { Observable } from 'rxjs/Observable'; -import { map } from "rxjs/operators"; -import IHttpClient from "../IHttpClient"; -import { inject, injectable } from "inversify"; -import { IAPIConfiguration } from "../IAPIConfiguration"; -import { Headers } from "../Headers"; -import HttpResponse from "../HttpResponse"; +import { map } from 'rxjs/operators'; +import IHttpClient from '../IHttpClient'; +import { inject, injectable } from 'inversify'; +import { IAPIConfiguration } from '../IAPIConfiguration'; +import { Headers } from '../Headers'; +import HttpResponse from '../HttpResponse'; -import { ApiResponse } from "../model/apiResponse"; -import { Pet } from "../model/pet"; +import { ApiResponse } from '../model/apiResponse'; +import { Pet } from '../model/pet'; -import { COLLECTION_FORMATS } from "../variables"; +import { COLLECTION_FORMATS } from '../variables'; @@ -31,8 +31,8 @@ import { COLLECTION_FORMATS } from "../variables"; export class PetService { private basePath: string = 'http://petstore.swagger.io/v2'; - constructor(@inject("IApiHttpClient") private httpClient: IHttpClient, - @inject("IAPIConfiguration") private APIConfiguration: IAPIConfiguration ) { + constructor(@inject('IApiHttpClient') private httpClient: IHttpClient, + @inject('IAPIConfiguration') private APIConfiguration: IAPIConfiguration ) { if(this.APIConfiguration.basePath) this.basePath = this.APIConfiguration.basePath; } @@ -61,9 +61,9 @@ export class PetService { headers['Content-Type'] = 'application/json'; const response: Observable> = this.httpClient.post(`${this.basePath}/pet`, body , headers); - if (observe == 'body') { + if (observe === 'body') { return response.pipe( - map(httpResponse => (httpResponse.response)) + map((httpResponse: HttpResponse) => (httpResponse.response)) ); } return response; @@ -98,9 +98,9 @@ export class PetService { headers['Accept'] = 'application/json'; const response: Observable> = this.httpClient.delete(`${this.basePath}/pet/${encodeURIComponent(String(petId))}`, headers); - if (observe == 'body') { + if (observe === 'body') { return response.pipe( - map(httpResponse => (httpResponse.response)) + map((httpResponse: HttpResponse) => (httpResponse.response)) ); } return response; @@ -122,7 +122,7 @@ export class PetService { let queryParameters: string[] = []; if (status) { - queryParameters.push("status="+encodeURIComponent(status.join(COLLECTION_FORMATS['csv']))); + queryParameters.push('status='+encodeURIComponent(status.join(COLLECTION_FORMATS['csv']))); } // authentication (petstore_auth) required @@ -135,9 +135,9 @@ export class PetService { headers['Accept'] = 'application/xml, application/json'; const response: Observable>> = this.httpClient.get(`${this.basePath}/pet/findByStatus?${queryParameters.join('&')}`, headers); - if (observe == 'body') { + if (observe === 'body') { return response.pipe( - map(httpResponse => >(httpResponse.response)) + map((httpResponse: HttpResponse) => >(httpResponse.response)) ); } return response; @@ -159,7 +159,7 @@ export class PetService { let queryParameters: string[] = []; if (tags) { - queryParameters.push("tags="+encodeURIComponent(tags.join(COLLECTION_FORMATS['csv']))); + queryParameters.push('tags='+encodeURIComponent(tags.join(COLLECTION_FORMATS['csv']))); } // authentication (petstore_auth) required @@ -172,9 +172,9 @@ export class PetService { headers['Accept'] = 'application/xml, application/json'; const response: Observable>> = this.httpClient.get(`${this.basePath}/pet/findByTags?${queryParameters.join('&')}`, headers); - if (observe == 'body') { + if (observe === 'body') { return response.pipe( - map(httpResponse => >(httpResponse.response)) + map((httpResponse: HttpResponse) => >(httpResponse.response)) ); } return response; @@ -195,15 +195,15 @@ export class PetService { } // authentication (api_key) required - if (this.APIConfiguration.apiKeys && this.APIConfiguration.apiKeys["api_key"]) { - headers['api_key'] = this.APIConfiguration.apiKeys["api_key"]; + if (this.APIConfiguration.apiKeys && this.APIConfiguration.apiKeys['api_key']) { + headers['api_key'] = this.APIConfiguration.apiKeys['api_key']; } headers['Accept'] = 'application/xml, application/json'; const response: Observable> = this.httpClient.get(`${this.basePath}/pet/${encodeURIComponent(String(petId))}`, headers); - if (observe == 'body') { + if (observe === 'body') { return response.pipe( - map(httpResponse => (httpResponse.response)) + map((httpResponse: HttpResponse) => (httpResponse.response)) ); } return response; @@ -234,9 +234,9 @@ export class PetService { headers['Content-Type'] = 'application/json'; const response: Observable> = this.httpClient.put(`${this.basePath}/pet`, body , headers); - if (observe == 'body') { + if (observe === 'body') { return response.pipe( - map(httpResponse => (httpResponse.response)) + map((httpResponse: HttpResponse) => (httpResponse.response)) ); } return response; @@ -277,9 +277,9 @@ export class PetService { } const response: Observable> = this.httpClient.post(`${this.basePath}/pet/${encodeURIComponent(String(petId))}`, formData, headers); - if (observe == 'body') { + if (observe === 'body') { return response.pipe( - map(httpResponse => (httpResponse.response)) + map((httpResponse: HttpResponse) => (httpResponse.response)) ); } return response; @@ -320,9 +320,9 @@ export class PetService { } const response: Observable> = this.httpClient.post(`${this.basePath}/pet/${encodeURIComponent(String(petId))}/uploadImage`, formData, headers); - if (observe == 'body') { + if (observe === 'body') { return response.pipe( - map(httpResponse => (httpResponse.response)) + map((httpResponse: HttpResponse) => (httpResponse.response)) ); } return response; diff --git a/samples/client/petstore/typescript-inversify/api/store.service.ts b/samples/client/petstore/typescript-inversify/api/store.service.ts index b383a6937d5c..37db9280b1f2 100644 --- a/samples/client/petstore/typescript-inversify/api/store.service.ts +++ b/samples/client/petstore/typescript-inversify/api/store.service.ts @@ -11,18 +11,18 @@ */ /* tslint:disable:no-unused-variable member-ordering */ -import { Observable } from "rxjs/Observable"; +import { Observable } from 'rxjs/Observable'; -import { map } from "rxjs/operators"; -import IHttpClient from "../IHttpClient"; -import { inject, injectable } from "inversify"; -import { IAPIConfiguration } from "../IAPIConfiguration"; -import { Headers } from "../Headers"; -import HttpResponse from "../HttpResponse"; +import { map } from 'rxjs/operators'; +import IHttpClient from '../IHttpClient'; +import { inject, injectable } from 'inversify'; +import { IAPIConfiguration } from '../IAPIConfiguration'; +import { Headers } from '../Headers'; +import HttpResponse from '../HttpResponse'; -import { Order } from "../model/order"; +import { Order } from '../model/order'; -import { COLLECTION_FORMATS } from "../variables"; +import { COLLECTION_FORMATS } from '../variables'; @@ -30,8 +30,8 @@ import { COLLECTION_FORMATS } from "../variables"; export class StoreService { private basePath: string = 'http://petstore.swagger.io/v2'; - constructor(@inject("IApiHttpClient") private httpClient: IHttpClient, - @inject("IAPIConfiguration") private APIConfiguration: IAPIConfiguration ) { + constructor(@inject('IApiHttpClient') private httpClient: IHttpClient, + @inject('IAPIConfiguration') private APIConfiguration: IAPIConfiguration ) { if(this.APIConfiguration.basePath) this.basePath = this.APIConfiguration.basePath; } @@ -52,9 +52,9 @@ export class StoreService { headers['Accept'] = 'application/json'; const response: Observable> = this.httpClient.delete(`${this.basePath}/store/order/${encodeURIComponent(String(orderId))}`, headers); - if (observe == 'body') { + if (observe === 'body') { return response.pipe( - map(httpResponse => (httpResponse.response)) + map((httpResponse: HttpResponse) => (httpResponse.response)) ); } return response; @@ -70,15 +70,15 @@ export class StoreService { public getInventory(observe?: 'response', headers?: Headers): Observable>; public getInventory(observe: any = 'body', headers: Headers = {}): Observable { // authentication (api_key) required - if (this.APIConfiguration.apiKeys && this.APIConfiguration.apiKeys["api_key"]) { - headers['api_key'] = this.APIConfiguration.apiKeys["api_key"]; + if (this.APIConfiguration.apiKeys && this.APIConfiguration.apiKeys['api_key']) { + headers['api_key'] = this.APIConfiguration.apiKeys['api_key']; } headers['Accept'] = 'application/json'; const response: Observable> = this.httpClient.get(`${this.basePath}/store/inventory`, headers); - if (observe == 'body') { + if (observe === 'body') { return response.pipe( - map(httpResponse => <{ [key: string]: number; }>(httpResponse.response)) + map((httpResponse: HttpResponse) => <{ [key: string]: number; }>(httpResponse.response)) ); } return response; @@ -101,9 +101,9 @@ export class StoreService { headers['Accept'] = 'application/xml, application/json'; const response: Observable> = this.httpClient.get(`${this.basePath}/store/order/${encodeURIComponent(String(orderId))}`, headers); - if (observe == 'body') { + if (observe === 'body') { return response.pipe( - map(httpResponse => (httpResponse.response)) + map((httpResponse: HttpResponse) => (httpResponse.response)) ); } return response; @@ -127,9 +127,9 @@ export class StoreService { headers['Content-Type'] = 'application/json'; const response: Observable> = this.httpClient.post(`${this.basePath}/store/order`, body , headers); - if (observe == 'body') { + if (observe === 'body') { return response.pipe( - map(httpResponse => (httpResponse.response)) + map((httpResponse: HttpResponse) => (httpResponse.response)) ); } return response; diff --git a/samples/client/petstore/typescript-inversify/api/user.service.ts b/samples/client/petstore/typescript-inversify/api/user.service.ts index a2c15a745413..1f8ed49283e6 100644 --- a/samples/client/petstore/typescript-inversify/api/user.service.ts +++ b/samples/client/petstore/typescript-inversify/api/user.service.ts @@ -11,18 +11,18 @@ */ /* tslint:disable:no-unused-variable member-ordering */ -import { Observable } from "rxjs/Observable"; +import { Observable } from 'rxjs/Observable'; -import { map } from "rxjs/operators"; -import IHttpClient from "../IHttpClient"; -import { inject, injectable } from "inversify"; -import { IAPIConfiguration } from "../IAPIConfiguration"; -import { Headers } from "../Headers"; -import HttpResponse from "../HttpResponse"; +import { map } from 'rxjs/operators'; +import IHttpClient from '../IHttpClient'; +import { inject, injectable } from 'inversify'; +import { IAPIConfiguration } from '../IAPIConfiguration'; +import { Headers } from '../Headers'; +import HttpResponse from '../HttpResponse'; -import { User } from "../model/user"; +import { User } from '../model/user'; -import { COLLECTION_FORMATS } from "../variables"; +import { COLLECTION_FORMATS } from '../variables'; @@ -30,8 +30,8 @@ import { COLLECTION_FORMATS } from "../variables"; export class UserService { private basePath: string = 'http://petstore.swagger.io/v2'; - constructor(@inject("IApiHttpClient") private httpClient: IHttpClient, - @inject("IAPIConfiguration") private APIConfiguration: IAPIConfiguration ) { + constructor(@inject('IApiHttpClient') private httpClient: IHttpClient, + @inject('IAPIConfiguration') private APIConfiguration: IAPIConfiguration ) { if(this.APIConfiguration.basePath) this.basePath = this.APIConfiguration.basePath; } @@ -53,9 +53,9 @@ export class UserService { headers['Content-Type'] = 'application/json'; const response: Observable> = this.httpClient.post(`${this.basePath}/user`, body , headers); - if (observe == 'body') { + if (observe === 'body') { return response.pipe( - map(httpResponse => (httpResponse.response)) + map((httpResponse: HttpResponse) => (httpResponse.response)) ); } return response; @@ -79,9 +79,9 @@ export class UserService { headers['Content-Type'] = 'application/json'; const response: Observable> = this.httpClient.post(`${this.basePath}/user/createWithArray`, body , headers); - if (observe == 'body') { + if (observe === 'body') { return response.pipe( - map(httpResponse => (httpResponse.response)) + map((httpResponse: HttpResponse) => (httpResponse.response)) ); } return response; @@ -105,9 +105,9 @@ export class UserService { headers['Content-Type'] = 'application/json'; const response: Observable> = this.httpClient.post(`${this.basePath}/user/createWithList`, body , headers); - if (observe == 'body') { + if (observe === 'body') { return response.pipe( - map(httpResponse => (httpResponse.response)) + map((httpResponse: HttpResponse) => (httpResponse.response)) ); } return response; @@ -130,9 +130,9 @@ export class UserService { headers['Accept'] = 'application/json'; const response: Observable> = this.httpClient.delete(`${this.basePath}/user/${encodeURIComponent(String(username))}`, headers); - if (observe == 'body') { + if (observe === 'body') { return response.pipe( - map(httpResponse => (httpResponse.response)) + map((httpResponse: HttpResponse) => (httpResponse.response)) ); } return response; @@ -155,9 +155,9 @@ export class UserService { headers['Accept'] = 'application/xml, application/json'; const response: Observable> = this.httpClient.get(`${this.basePath}/user/${encodeURIComponent(String(username))}`, headers); - if (observe == 'body') { + if (observe === 'body') { return response.pipe( - map(httpResponse => (httpResponse.response)) + map((httpResponse: HttpResponse) => (httpResponse.response)) ); } return response; @@ -184,18 +184,18 @@ export class UserService { let queryParameters: string[] = []; if (username !== undefined) { - queryParameters.push("username="+encodeURIComponent(String(username))); + queryParameters.push('username='+encodeURIComponent(String(username))); } if (password !== undefined) { - queryParameters.push("password="+encodeURIComponent(String(password))); + queryParameters.push('password='+encodeURIComponent(String(password))); } headers['Accept'] = 'application/xml, application/json'; const response: Observable> = this.httpClient.get(`${this.basePath}/user/login?${queryParameters.join('&')}`, headers); - if (observe == 'body') { + if (observe === 'body') { return response.pipe( - map(httpResponse => (httpResponse.response)) + map((httpResponse: HttpResponse) => (httpResponse.response)) ); } return response; @@ -213,9 +213,9 @@ export class UserService { headers['Accept'] = 'application/json'; const response: Observable> = this.httpClient.get(`${this.basePath}/user/logout`, headers); - if (observe == 'body') { + if (observe === 'body') { return response.pipe( - map(httpResponse => (httpResponse.response)) + map((httpResponse: HttpResponse) => (httpResponse.response)) ); } return response; @@ -244,9 +244,9 @@ export class UserService { headers['Content-Type'] = 'application/json'; const response: Observable> = this.httpClient.put(`${this.basePath}/user/${encodeURIComponent(String(username))}`, body , headers); - if (observe == 'body') { + if (observe === 'body') { return response.pipe( - map(httpResponse => (httpResponse.response)) + map((httpResponse: HttpResponse) => (httpResponse.response)) ); } return response; From d1fe2e17f17b1accf8bc9c5f7ee809a97d07ddad Mon Sep 17 00:00:00 2001 From: William Cheng Date: Thu, 23 Jul 2020 15:01:22 +0800 Subject: [PATCH 058/129] update samples --- .../java/org/openapitools/client/ApiClient.java | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/ApiClient.java b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/ApiClient.java index ed31d4f37de2..543a3ae4ff1e 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/ApiClient.java @@ -672,9 +672,17 @@ public Entity serialize(Object obj, Map formParams, String co } else { // We let jersey handle the serialization if (isBodyNullable) { // payload is nullable - entity = Entity.entity(obj == null ? "null" : obj, contentType); + if (obj instanceof String) { + entity = Entity.entity(obj == null ? "null" : "\"" + ((String)obj).replaceAll("\"", Matcher.quoteReplacement("\\\"")) + "\"", contentType); + } else { + entity = Entity.entity(obj == null ? "null" : obj, contentType); + } } else { - entity = Entity.entity(obj == null ? "" : obj, contentType); + if (obj instanceof String) { + entity = Entity.entity(obj == null ? "" : "\"" + ((String)obj).replaceAll("\"", Matcher.quoteReplacement("\\\"")) + "\"", contentType); + } else { + entity = Entity.entity(obj == null ? "" : obj, contentType); + } } } return entity; @@ -709,7 +717,7 @@ public String serializeToString(Object obj, Map formParams, Stri if (isBodyNullable) { return obj == null ? "null" : json.getMapper().writeValueAsString(obj); } else { - return json.getMapper().writeValueAsString(obj); + return obj == null ? "" : json.getMapper().writeValueAsString(obj); } } } catch (Exception ex) { From 3199ddc6152effe92aa8fa5ba4918d9054337bcb Mon Sep 17 00:00:00 2001 From: Slavek Kabrda Date: Thu, 23 Jul 2020 10:26:18 +0200 Subject: [PATCH 059/129] Add 'x-generate-alias-as-model' extension to allow enabling generating alias as model per-schema (#6937) --- .../java/org/openapitools/codegen/DefaultCodegen.java | 4 ++-- .../java/org/openapitools/codegen/DefaultGenerator.java | 4 ++-- .../codegen/languages/JavaCXFExtServerCodegen.java | 2 +- .../java/org/openapitools/codegen/utils/ModelUtils.java | 8 ++++++-- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java index 049cf935f8c8..e8ec89556643 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java @@ -5909,7 +5909,7 @@ public CodegenParameter fromRequestBody(RequestBody body, Set imports, S if (ModelUtils.isMapSchema(schema)) { // Schema with additionalproperties: true (including composed schemas with additionalproperties: true) - if (ModelUtils.isGenerateAliasAsModel() && StringUtils.isNotBlank(name)) { + if (ModelUtils.isGenerateAliasAsModel(schema) && StringUtils.isNotBlank(name)) { this.addBodyModelSchema(codegenParameter, name, schema, imports, bodyParameterName, true); } else { Schema inner = getAdditionalProperties(schema); @@ -5950,7 +5950,7 @@ public CodegenParameter fromRequestBody(RequestBody body, Set imports, S setParameterNullable(codegenParameter, codegenProperty); } } else if (ModelUtils.isArraySchema(schema)) { - if (ModelUtils.isGenerateAliasAsModel() && StringUtils.isNotBlank(name)) { + if (ModelUtils.isGenerateAliasAsModel(schema) && StringUtils.isNotBlank(name)) { this.addBodyModelSchema(codegenParameter, name, schema, imports, bodyParameterName, true); } else { final ArraySchema arraySchema = (ArraySchema) schema; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultGenerator.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultGenerator.java index 47d3540b1112..ee7b50c05c73 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultGenerator.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultGenerator.java @@ -452,13 +452,13 @@ void generateModels(List files, List allModels, List unuse // 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() && !ModelUtils.isComposedSchema(schema) && (schema.getProperties() == null || schema.getProperties().isEmpty())) { + 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.getProperties() == null || schema.getProperties().isEmpty())) { + 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; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaCXFExtServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaCXFExtServerCodegen.java index 4160502f47e7..f440163d4d6c 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaCXFExtServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaCXFExtServerCodegen.java @@ -1400,7 +1400,7 @@ public void setTestDataFile(File testDataFile) { @Override public String toDefaultValue(Schema p) { - if (ModelUtils.isGenerateAliasAsModel() && StringUtils.isNotEmpty(p.get$ref())) { + if (ModelUtils.isGenerateAliasAsModel(p) && StringUtils.isNotEmpty(p.get$ref())) { Schema ref = ModelUtils.getReferencedSchema(this.openAPI, p); if (ModelUtils.isArraySchema(ref) || ModelUtils.isMapSchema(ref)) { String typeDeclaration = getTypeDeclaration(p); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/ModelUtils.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/ModelUtils.java index 5320f58f256e..4c3e9fe01180 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/ModelUtils.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/ModelUtils.java @@ -88,6 +88,10 @@ 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 * @@ -1037,7 +1041,7 @@ public static Schema unaliasSchema(OpenAPI openAPI, // top-level enum class return schema; } else if (isArraySchema(ref)) { - if (isGenerateAliasAsModel()) { + if (isGenerateAliasAsModel(ref)) { return schema; // generate a model extending array } else { return unaliasSchema(openAPI, allSchemas.get(ModelUtils.getSimpleRef(schema.get$ref())), @@ -1049,7 +1053,7 @@ public static Schema unaliasSchema(OpenAPI openAPI, if (ref.getProperties() != null && !ref.getProperties().isEmpty()) // has at least one property return schema; // treat it as model else { - if (isGenerateAliasAsModel()) { + if (isGenerateAliasAsModel(ref)) { return schema; // generate a model extending map } else { // treat it as a typical map From 03e8aee8ea415eadf70290916c3c290759a0b2fb Mon Sep 17 00:00:00 2001 From: Slavek Kabrda Date: Thu, 23 Jul 2020 10:33:15 +0200 Subject: [PATCH 060/129] [java][jersey2-client] Disable coercion of scalars (#6811) * [java][jersey2-client] Disable coercion of scalars * Respect the coercion objectmapper setting in deserializers * Update jackson in maven plugin to get version that has ALLOW_COERCION_OF_SCALARS --- .../examples/java-client.xml | 2 +- .../examples/kotlin.xml | 2 +- .../examples/multi-module/pom.xml | 2 +- .../Java/libraries/jersey2/JSON.mustache | 1 + .../libraries/jersey2/oneof_model.mustache | 32 ++++++-- .../java/org/openapitools/client/JSON.java | 1 + .../java/org/openapitools/client/JSON.java | 1 + .../org/openapitools/client/model/Fruit.java | 54 ++++++++++--- .../openapitools/client/model/FruitReq.java | 56 ++++++++++--- .../org/openapitools/client/model/Mammal.java | 79 ++++++++++++++----- .../client/model/NullableShape.java | 56 ++++++++++--- .../org/openapitools/client/model/Pig.java | 54 ++++++++++--- .../client/model/Quadrilateral.java | 54 ++++++++++--- .../org/openapitools/client/model/Shape.java | 54 ++++++++++--- .../client/model/ShapeOrNull.java | 56 ++++++++++--- .../openapitools/client/model/Triangle.java | 79 ++++++++++++++----- 16 files changed, 454 insertions(+), 129 deletions(-) diff --git a/modules/openapi-generator-maven-plugin/examples/java-client.xml b/modules/openapi-generator-maven-plugin/examples/java-client.xml index c22f4cfcce92..c966e5c63ee4 100644 --- a/modules/openapi-generator-maven-plugin/examples/java-client.xml +++ b/modules/openapi-generator-maven-plugin/examples/java-client.xml @@ -185,7 +185,7 @@ 1.5.8 2.27 - 2.8.9 + 2.9.10 0.2.0 2.7 1.0.0 diff --git a/modules/openapi-generator-maven-plugin/examples/kotlin.xml b/modules/openapi-generator-maven-plugin/examples/kotlin.xml index 130a359b06a1..51b21f3030e9 100644 --- a/modules/openapi-generator-maven-plugin/examples/kotlin.xml +++ b/modules/openapi-generator-maven-plugin/examples/kotlin.xml @@ -224,7 +224,7 @@ 1.5.8 2.27 - 2.8.9 + 2.9.10 0.2.0 2.7 1.0.0 diff --git a/modules/openapi-generator-maven-plugin/examples/multi-module/pom.xml b/modules/openapi-generator-maven-plugin/examples/multi-module/pom.xml index c8a899829925..f63c803d62dd 100644 --- a/modules/openapi-generator-maven-plugin/examples/multi-module/pom.xml +++ b/modules/openapi-generator-maven-plugin/examples/multi-module/pom.xml @@ -15,7 +15,7 @@ 1.5.8 2.27 - 2.8.9 + 2.9.10 0.2.0 2.7 1.0.0 diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/JSON.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/JSON.mustache index bcc075ac9fcb..2820eaa4bb15 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/JSON.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/JSON.mustache @@ -34,6 +34,7 @@ public class JSON implements ContextResolver { public JSON() { mapper = new ObjectMapper(); mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); + mapper.configure(MapperFeature.ALLOW_COERCION_OF_SCALARS, false); mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, true); mapper.configure(DeserializationFeature.FAIL_ON_INVALID_SUBTYPE, true); mapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS); diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/oneof_model.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/oneof_model.mustache index dedc9d634f72..f3a51dccdc01 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/oneof_model.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/oneof_model.mustache @@ -10,10 +10,12 @@ import java.util.HashSet; import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.JsonToken; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.DeserializationContext; import com.fasterxml.jackson.databind.JsonMappingException; import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.MapperFeature; import com.fasterxml.jackson.databind.SerializerProvider; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; @@ -73,16 +75,34 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im {{/discriminator}} {{/useOneOfDiscriminatorLookup}} + boolean typeCoercion = ctxt.isEnabled(MapperFeature.ALLOW_COERCION_OF_SCALARS); int match = 0; + JsonToken token = tree.traverse(jp.getCodec()).nextToken(); {{#oneOf}} // deserialize {{{.}}} try { - deserialized = tree.traverse(jp.getCodec()).readValueAs({{{.}}}.class); - // TODO: there is no validation against JSON schema constraints - // (min, max, enum, pattern...), this does not perform a strict JSON - // validation, which means the 'match' count may be higher than it should be. - match++; - log.log(Level.FINER, "Input data matches schema '{{{.}}}'"); + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if ({{{.}}}.class.equals(Integer.class) || {{{.}}}.class.equals(Long.class) || {{{.}}}.class.equals(Float.class) || {{{.}}}.class.equals(Double.class) || {{{.}}}.class.equals(Boolean.class) || {{{.}}}.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= (({{{.}}}.class.equals(Integer.class) || {{{.}}}.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= (({{{.}}}.class.equals(Float.class) || {{{.}}}.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= ({{{.}}}.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= ({{{.}}}.class.equals(String.class) && token == JsonToken.VALUE_STRING); + {{#isNullable}} + attemptParsing |= (token == JsonToken.VALUE_NULL); + {{/isNullable}} + } + } + if (attemptParsing) { + deserialized = tree.traverse(jp.getCodec()).readValueAs({{{.}}}.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + match++; + log.log(Level.FINER, "Input data matches schema '{{{.}}}'"); + } } catch (Exception e) { // deserialization failed, continue log.log(Level.FINER, "Input data does not match schema '{{{.}}}'", e); diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/JSON.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/JSON.java index 9d748f6e7c22..d29b48becb12 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/JSON.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/JSON.java @@ -21,6 +21,7 @@ public class JSON implements ContextResolver { public JSON() { mapper = new ObjectMapper(); mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); + mapper.configure(MapperFeature.ALLOW_COERCION_OF_SCALARS, false); mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, true); mapper.configure(DeserializationFeature.FAIL_ON_INVALID_SUBTYPE, true); mapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS); diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/JSON.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/JSON.java index 9d748f6e7c22..d29b48becb12 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/JSON.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/JSON.java @@ -21,6 +21,7 @@ public class JSON implements ContextResolver { public JSON() { mapper = new ObjectMapper(); mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); + mapper.configure(MapperFeature.ALLOW_COERCION_OF_SCALARS, false); mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, true); mapper.configure(DeserializationFeature.FAIL_ON_INVALID_SUBTYPE, true); mapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS); diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Fruit.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Fruit.java index 0d482282095d..b7c2f8364148 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Fruit.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Fruit.java @@ -44,10 +44,12 @@ import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.JsonToken; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.DeserializationContext; import com.fasterxml.jackson.databind.JsonMappingException; import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.MapperFeature; import com.fasterxml.jackson.databind.SerializerProvider; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; @@ -89,15 +91,30 @@ public FruitDeserializer(Class vc) { public Fruit deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { JsonNode tree = jp.readValueAsTree(); Object deserialized = null; + boolean typeCoercion = ctxt.isEnabled(MapperFeature.ALLOW_COERCION_OF_SCALARS); int match = 0; + JsonToken token = tree.traverse(jp.getCodec()).nextToken(); // deserialize Apple try { - deserialized = tree.traverse(jp.getCodec()).readValueAs(Apple.class); - // TODO: there is no validation against JSON schema constraints - // (min, max, enum, pattern...), this does not perform a strict JSON - // validation, which means the 'match' count may be higher than it should be. - match++; - log.log(Level.FINER, "Input data matches schema 'Apple'"); + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (Apple.class.equals(Integer.class) || Apple.class.equals(Long.class) || Apple.class.equals(Float.class) || Apple.class.equals(Double.class) || Apple.class.equals(Boolean.class) || Apple.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= ((Apple.class.equals(Integer.class) || Apple.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((Apple.class.equals(Float.class) || Apple.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (Apple.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (Apple.class.equals(String.class) && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + deserialized = tree.traverse(jp.getCodec()).readValueAs(Apple.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + match++; + log.log(Level.FINER, "Input data matches schema 'Apple'"); + } } catch (Exception e) { // deserialization failed, continue log.log(Level.FINER, "Input data does not match schema 'Apple'", e); @@ -105,12 +122,25 @@ public Fruit deserialize(JsonParser jp, DeserializationContext ctxt) throws IOEx // deserialize Banana try { - deserialized = tree.traverse(jp.getCodec()).readValueAs(Banana.class); - // TODO: there is no validation against JSON schema constraints - // (min, max, enum, pattern...), this does not perform a strict JSON - // validation, which means the 'match' count may be higher than it should be. - match++; - log.log(Level.FINER, "Input data matches schema 'Banana'"); + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (Banana.class.equals(Integer.class) || Banana.class.equals(Long.class) || Banana.class.equals(Float.class) || Banana.class.equals(Double.class) || Banana.class.equals(Boolean.class) || Banana.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= ((Banana.class.equals(Integer.class) || Banana.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((Banana.class.equals(Float.class) || Banana.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (Banana.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (Banana.class.equals(String.class) && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + deserialized = tree.traverse(jp.getCodec()).readValueAs(Banana.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + match++; + log.log(Level.FINER, "Input data matches schema 'Banana'"); + } } catch (Exception e) { // deserialization failed, continue log.log(Level.FINER, "Input data does not match schema 'Banana'", e); diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FruitReq.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FruitReq.java index ba0fc1a2bf76..e780f72ecb85 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FruitReq.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FruitReq.java @@ -44,10 +44,12 @@ import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.JsonToken; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.DeserializationContext; import com.fasterxml.jackson.databind.JsonMappingException; import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.MapperFeature; import com.fasterxml.jackson.databind.SerializerProvider; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; @@ -89,15 +91,31 @@ public FruitReqDeserializer(Class vc) { public FruitReq deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { JsonNode tree = jp.readValueAsTree(); Object deserialized = null; + boolean typeCoercion = ctxt.isEnabled(MapperFeature.ALLOW_COERCION_OF_SCALARS); int match = 0; + JsonToken token = tree.traverse(jp.getCodec()).nextToken(); // deserialize AppleReq try { - deserialized = tree.traverse(jp.getCodec()).readValueAs(AppleReq.class); - // TODO: there is no validation against JSON schema constraints - // (min, max, enum, pattern...), this does not perform a strict JSON - // validation, which means the 'match' count may be higher than it should be. - match++; - log.log(Level.FINER, "Input data matches schema 'AppleReq'"); + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (AppleReq.class.equals(Integer.class) || AppleReq.class.equals(Long.class) || AppleReq.class.equals(Float.class) || AppleReq.class.equals(Double.class) || AppleReq.class.equals(Boolean.class) || AppleReq.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= ((AppleReq.class.equals(Integer.class) || AppleReq.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((AppleReq.class.equals(Float.class) || AppleReq.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (AppleReq.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (AppleReq.class.equals(String.class) && token == JsonToken.VALUE_STRING); + attemptParsing |= (token == JsonToken.VALUE_NULL); + } + } + if (attemptParsing) { + deserialized = tree.traverse(jp.getCodec()).readValueAs(AppleReq.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + match++; + log.log(Level.FINER, "Input data matches schema 'AppleReq'"); + } } catch (Exception e) { // deserialization failed, continue log.log(Level.FINER, "Input data does not match schema 'AppleReq'", e); @@ -105,12 +123,26 @@ public FruitReq deserialize(JsonParser jp, DeserializationContext ctxt) throws I // deserialize BananaReq try { - deserialized = tree.traverse(jp.getCodec()).readValueAs(BananaReq.class); - // TODO: there is no validation against JSON schema constraints - // (min, max, enum, pattern...), this does not perform a strict JSON - // validation, which means the 'match' count may be higher than it should be. - match++; - log.log(Level.FINER, "Input data matches schema 'BananaReq'"); + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (BananaReq.class.equals(Integer.class) || BananaReq.class.equals(Long.class) || BananaReq.class.equals(Float.class) || BananaReq.class.equals(Double.class) || BananaReq.class.equals(Boolean.class) || BananaReq.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= ((BananaReq.class.equals(Integer.class) || BananaReq.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((BananaReq.class.equals(Float.class) || BananaReq.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (BananaReq.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (BananaReq.class.equals(String.class) && token == JsonToken.VALUE_STRING); + attemptParsing |= (token == JsonToken.VALUE_NULL); + } + } + if (attemptParsing) { + deserialized = tree.traverse(jp.getCodec()).readValueAs(BananaReq.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + match++; + log.log(Level.FINER, "Input data matches schema 'BananaReq'"); + } } catch (Exception e) { // deserialization failed, continue log.log(Level.FINER, "Input data does not match schema 'BananaReq'", e); diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Mammal.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Mammal.java index db1f6b9b5e13..ae0b2f3d97ec 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Mammal.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Mammal.java @@ -50,10 +50,12 @@ import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.JsonToken; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.DeserializationContext; import com.fasterxml.jackson.databind.JsonMappingException; import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.MapperFeature; import com.fasterxml.jackson.databind.SerializerProvider; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; @@ -115,15 +117,30 @@ public Mammal deserialize(JsonParser jp, DeserializationContext ctxt) throws IOE log.log(Level.WARNING, String.format("Failed to lookup discriminator value `%s` for Mammal. Possible values: Pig whale zebra", discriminatorValue)); } + boolean typeCoercion = ctxt.isEnabled(MapperFeature.ALLOW_COERCION_OF_SCALARS); int match = 0; + JsonToken token = tree.traverse(jp.getCodec()).nextToken(); // deserialize Pig try { - deserialized = tree.traverse(jp.getCodec()).readValueAs(Pig.class); - // TODO: there is no validation against JSON schema constraints - // (min, max, enum, pattern...), this does not perform a strict JSON - // validation, which means the 'match' count may be higher than it should be. - match++; - log.log(Level.FINER, "Input data matches schema 'Pig'"); + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (Pig.class.equals(Integer.class) || Pig.class.equals(Long.class) || Pig.class.equals(Float.class) || Pig.class.equals(Double.class) || Pig.class.equals(Boolean.class) || Pig.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= ((Pig.class.equals(Integer.class) || Pig.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((Pig.class.equals(Float.class) || Pig.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (Pig.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (Pig.class.equals(String.class) && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + deserialized = tree.traverse(jp.getCodec()).readValueAs(Pig.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + match++; + log.log(Level.FINER, "Input data matches schema 'Pig'"); + } } catch (Exception e) { // deserialization failed, continue log.log(Level.FINER, "Input data does not match schema 'Pig'", e); @@ -131,12 +148,25 @@ public Mammal deserialize(JsonParser jp, DeserializationContext ctxt) throws IOE // deserialize Whale try { - deserialized = tree.traverse(jp.getCodec()).readValueAs(Whale.class); - // TODO: there is no validation against JSON schema constraints - // (min, max, enum, pattern...), this does not perform a strict JSON - // validation, which means the 'match' count may be higher than it should be. - match++; - log.log(Level.FINER, "Input data matches schema 'Whale'"); + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (Whale.class.equals(Integer.class) || Whale.class.equals(Long.class) || Whale.class.equals(Float.class) || Whale.class.equals(Double.class) || Whale.class.equals(Boolean.class) || Whale.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= ((Whale.class.equals(Integer.class) || Whale.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((Whale.class.equals(Float.class) || Whale.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (Whale.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (Whale.class.equals(String.class) && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + deserialized = tree.traverse(jp.getCodec()).readValueAs(Whale.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + match++; + log.log(Level.FINER, "Input data matches schema 'Whale'"); + } } catch (Exception e) { // deserialization failed, continue log.log(Level.FINER, "Input data does not match schema 'Whale'", e); @@ -144,12 +174,25 @@ public Mammal deserialize(JsonParser jp, DeserializationContext ctxt) throws IOE // deserialize Zebra try { - deserialized = tree.traverse(jp.getCodec()).readValueAs(Zebra.class); - // TODO: there is no validation against JSON schema constraints - // (min, max, enum, pattern...), this does not perform a strict JSON - // validation, which means the 'match' count may be higher than it should be. - match++; - log.log(Level.FINER, "Input data matches schema 'Zebra'"); + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (Zebra.class.equals(Integer.class) || Zebra.class.equals(Long.class) || Zebra.class.equals(Float.class) || Zebra.class.equals(Double.class) || Zebra.class.equals(Boolean.class) || Zebra.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= ((Zebra.class.equals(Integer.class) || Zebra.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((Zebra.class.equals(Float.class) || Zebra.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (Zebra.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (Zebra.class.equals(String.class) && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + deserialized = tree.traverse(jp.getCodec()).readValueAs(Zebra.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + match++; + log.log(Level.FINER, "Input data matches schema 'Zebra'"); + } } catch (Exception e) { // deserialization failed, continue log.log(Level.FINER, "Input data does not match schema 'Zebra'", e); diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NullableShape.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NullableShape.java index bcc0fc2b1c67..7807b98979e8 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NullableShape.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NullableShape.java @@ -49,10 +49,12 @@ import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.JsonToken; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.DeserializationContext; import com.fasterxml.jackson.databind.JsonMappingException; import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.MapperFeature; import com.fasterxml.jackson.databind.SerializerProvider; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; @@ -110,15 +112,31 @@ public NullableShape deserialize(JsonParser jp, DeserializationContext ctxt) thr log.log(Level.WARNING, String.format("Failed to lookup discriminator value `%s` for NullableShape. Possible values: Quadrilateral Triangle", discriminatorValue)); } + boolean typeCoercion = ctxt.isEnabled(MapperFeature.ALLOW_COERCION_OF_SCALARS); int match = 0; + JsonToken token = tree.traverse(jp.getCodec()).nextToken(); // deserialize Quadrilateral try { - deserialized = tree.traverse(jp.getCodec()).readValueAs(Quadrilateral.class); - // TODO: there is no validation against JSON schema constraints - // (min, max, enum, pattern...), this does not perform a strict JSON - // validation, which means the 'match' count may be higher than it should be. - match++; - log.log(Level.FINER, "Input data matches schema 'Quadrilateral'"); + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (Quadrilateral.class.equals(Integer.class) || Quadrilateral.class.equals(Long.class) || Quadrilateral.class.equals(Float.class) || Quadrilateral.class.equals(Double.class) || Quadrilateral.class.equals(Boolean.class) || Quadrilateral.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= ((Quadrilateral.class.equals(Integer.class) || Quadrilateral.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((Quadrilateral.class.equals(Float.class) || Quadrilateral.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (Quadrilateral.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (Quadrilateral.class.equals(String.class) && token == JsonToken.VALUE_STRING); + attemptParsing |= (token == JsonToken.VALUE_NULL); + } + } + if (attemptParsing) { + deserialized = tree.traverse(jp.getCodec()).readValueAs(Quadrilateral.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + match++; + log.log(Level.FINER, "Input data matches schema 'Quadrilateral'"); + } } catch (Exception e) { // deserialization failed, continue log.log(Level.FINER, "Input data does not match schema 'Quadrilateral'", e); @@ -126,12 +144,26 @@ public NullableShape deserialize(JsonParser jp, DeserializationContext ctxt) thr // deserialize Triangle try { - deserialized = tree.traverse(jp.getCodec()).readValueAs(Triangle.class); - // TODO: there is no validation against JSON schema constraints - // (min, max, enum, pattern...), this does not perform a strict JSON - // validation, which means the 'match' count may be higher than it should be. - match++; - log.log(Level.FINER, "Input data matches schema 'Triangle'"); + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (Triangle.class.equals(Integer.class) || Triangle.class.equals(Long.class) || Triangle.class.equals(Float.class) || Triangle.class.equals(Double.class) || Triangle.class.equals(Boolean.class) || Triangle.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= ((Triangle.class.equals(Integer.class) || Triangle.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((Triangle.class.equals(Float.class) || Triangle.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (Triangle.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (Triangle.class.equals(String.class) && token == JsonToken.VALUE_STRING); + attemptParsing |= (token == JsonToken.VALUE_NULL); + } + } + if (attemptParsing) { + deserialized = tree.traverse(jp.getCodec()).readValueAs(Triangle.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + match++; + log.log(Level.FINER, "Input data matches schema 'Triangle'"); + } } catch (Exception e) { // deserialization failed, continue log.log(Level.FINER, "Input data does not match schema 'Triangle'", e); diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Pig.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Pig.java index a43bf499aac7..a2e751069a32 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Pig.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Pig.java @@ -49,10 +49,12 @@ import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.JsonToken; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.DeserializationContext; import com.fasterxml.jackson.databind.JsonMappingException; import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.MapperFeature; import com.fasterxml.jackson.databind.SerializerProvider; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; @@ -110,15 +112,30 @@ public Pig deserialize(JsonParser jp, DeserializationContext ctxt) throws IOExce log.log(Level.WARNING, String.format("Failed to lookup discriminator value `%s` for Pig. Possible values: BasquePig DanishPig", discriminatorValue)); } + boolean typeCoercion = ctxt.isEnabled(MapperFeature.ALLOW_COERCION_OF_SCALARS); int match = 0; + JsonToken token = tree.traverse(jp.getCodec()).nextToken(); // deserialize BasquePig try { - deserialized = tree.traverse(jp.getCodec()).readValueAs(BasquePig.class); - // TODO: there is no validation against JSON schema constraints - // (min, max, enum, pattern...), this does not perform a strict JSON - // validation, which means the 'match' count may be higher than it should be. - match++; - log.log(Level.FINER, "Input data matches schema 'BasquePig'"); + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (BasquePig.class.equals(Integer.class) || BasquePig.class.equals(Long.class) || BasquePig.class.equals(Float.class) || BasquePig.class.equals(Double.class) || BasquePig.class.equals(Boolean.class) || BasquePig.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= ((BasquePig.class.equals(Integer.class) || BasquePig.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((BasquePig.class.equals(Float.class) || BasquePig.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (BasquePig.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (BasquePig.class.equals(String.class) && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + deserialized = tree.traverse(jp.getCodec()).readValueAs(BasquePig.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + match++; + log.log(Level.FINER, "Input data matches schema 'BasquePig'"); + } } catch (Exception e) { // deserialization failed, continue log.log(Level.FINER, "Input data does not match schema 'BasquePig'", e); @@ -126,12 +143,25 @@ public Pig deserialize(JsonParser jp, DeserializationContext ctxt) throws IOExce // deserialize DanishPig try { - deserialized = tree.traverse(jp.getCodec()).readValueAs(DanishPig.class); - // TODO: there is no validation against JSON schema constraints - // (min, max, enum, pattern...), this does not perform a strict JSON - // validation, which means the 'match' count may be higher than it should be. - match++; - log.log(Level.FINER, "Input data matches schema 'DanishPig'"); + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (DanishPig.class.equals(Integer.class) || DanishPig.class.equals(Long.class) || DanishPig.class.equals(Float.class) || DanishPig.class.equals(Double.class) || DanishPig.class.equals(Boolean.class) || DanishPig.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= ((DanishPig.class.equals(Integer.class) || DanishPig.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((DanishPig.class.equals(Float.class) || DanishPig.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (DanishPig.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (DanishPig.class.equals(String.class) && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + deserialized = tree.traverse(jp.getCodec()).readValueAs(DanishPig.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + match++; + log.log(Level.FINER, "Input data matches schema 'DanishPig'"); + } } catch (Exception e) { // deserialization failed, continue log.log(Level.FINER, "Input data does not match schema 'DanishPig'", e); diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Quadrilateral.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Quadrilateral.java index 16f693339480..8e892e346b38 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Quadrilateral.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Quadrilateral.java @@ -49,10 +49,12 @@ import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.JsonToken; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.DeserializationContext; import com.fasterxml.jackson.databind.JsonMappingException; import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.MapperFeature; import com.fasterxml.jackson.databind.SerializerProvider; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; @@ -110,15 +112,30 @@ public Quadrilateral deserialize(JsonParser jp, DeserializationContext ctxt) thr log.log(Level.WARNING, String.format("Failed to lookup discriminator value `%s` for Quadrilateral. Possible values: ComplexQuadrilateral SimpleQuadrilateral", discriminatorValue)); } + boolean typeCoercion = ctxt.isEnabled(MapperFeature.ALLOW_COERCION_OF_SCALARS); int match = 0; + JsonToken token = tree.traverse(jp.getCodec()).nextToken(); // deserialize ComplexQuadrilateral try { - deserialized = tree.traverse(jp.getCodec()).readValueAs(ComplexQuadrilateral.class); - // TODO: there is no validation against JSON schema constraints - // (min, max, enum, pattern...), this does not perform a strict JSON - // validation, which means the 'match' count may be higher than it should be. - match++; - log.log(Level.FINER, "Input data matches schema 'ComplexQuadrilateral'"); + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (ComplexQuadrilateral.class.equals(Integer.class) || ComplexQuadrilateral.class.equals(Long.class) || ComplexQuadrilateral.class.equals(Float.class) || ComplexQuadrilateral.class.equals(Double.class) || ComplexQuadrilateral.class.equals(Boolean.class) || ComplexQuadrilateral.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= ((ComplexQuadrilateral.class.equals(Integer.class) || ComplexQuadrilateral.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((ComplexQuadrilateral.class.equals(Float.class) || ComplexQuadrilateral.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (ComplexQuadrilateral.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (ComplexQuadrilateral.class.equals(String.class) && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + deserialized = tree.traverse(jp.getCodec()).readValueAs(ComplexQuadrilateral.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + match++; + log.log(Level.FINER, "Input data matches schema 'ComplexQuadrilateral'"); + } } catch (Exception e) { // deserialization failed, continue log.log(Level.FINER, "Input data does not match schema 'ComplexQuadrilateral'", e); @@ -126,12 +143,25 @@ public Quadrilateral deserialize(JsonParser jp, DeserializationContext ctxt) thr // deserialize SimpleQuadrilateral try { - deserialized = tree.traverse(jp.getCodec()).readValueAs(SimpleQuadrilateral.class); - // TODO: there is no validation against JSON schema constraints - // (min, max, enum, pattern...), this does not perform a strict JSON - // validation, which means the 'match' count may be higher than it should be. - match++; - log.log(Level.FINER, "Input data matches schema 'SimpleQuadrilateral'"); + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (SimpleQuadrilateral.class.equals(Integer.class) || SimpleQuadrilateral.class.equals(Long.class) || SimpleQuadrilateral.class.equals(Float.class) || SimpleQuadrilateral.class.equals(Double.class) || SimpleQuadrilateral.class.equals(Boolean.class) || SimpleQuadrilateral.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= ((SimpleQuadrilateral.class.equals(Integer.class) || SimpleQuadrilateral.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((SimpleQuadrilateral.class.equals(Float.class) || SimpleQuadrilateral.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (SimpleQuadrilateral.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (SimpleQuadrilateral.class.equals(String.class) && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + deserialized = tree.traverse(jp.getCodec()).readValueAs(SimpleQuadrilateral.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + match++; + log.log(Level.FINER, "Input data matches schema 'SimpleQuadrilateral'"); + } } catch (Exception e) { // deserialization failed, continue log.log(Level.FINER, "Input data does not match schema 'SimpleQuadrilateral'", e); diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Shape.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Shape.java index 53fb100975d6..eba2e38da48c 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Shape.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Shape.java @@ -49,10 +49,12 @@ import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.JsonToken; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.DeserializationContext; import com.fasterxml.jackson.databind.JsonMappingException; import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.MapperFeature; import com.fasterxml.jackson.databind.SerializerProvider; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; @@ -110,15 +112,30 @@ public Shape deserialize(JsonParser jp, DeserializationContext ctxt) throws IOEx log.log(Level.WARNING, String.format("Failed to lookup discriminator value `%s` for Shape. Possible values: Quadrilateral Triangle", discriminatorValue)); } + boolean typeCoercion = ctxt.isEnabled(MapperFeature.ALLOW_COERCION_OF_SCALARS); int match = 0; + JsonToken token = tree.traverse(jp.getCodec()).nextToken(); // deserialize Quadrilateral try { - deserialized = tree.traverse(jp.getCodec()).readValueAs(Quadrilateral.class); - // TODO: there is no validation against JSON schema constraints - // (min, max, enum, pattern...), this does not perform a strict JSON - // validation, which means the 'match' count may be higher than it should be. - match++; - log.log(Level.FINER, "Input data matches schema 'Quadrilateral'"); + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (Quadrilateral.class.equals(Integer.class) || Quadrilateral.class.equals(Long.class) || Quadrilateral.class.equals(Float.class) || Quadrilateral.class.equals(Double.class) || Quadrilateral.class.equals(Boolean.class) || Quadrilateral.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= ((Quadrilateral.class.equals(Integer.class) || Quadrilateral.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((Quadrilateral.class.equals(Float.class) || Quadrilateral.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (Quadrilateral.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (Quadrilateral.class.equals(String.class) && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + deserialized = tree.traverse(jp.getCodec()).readValueAs(Quadrilateral.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + match++; + log.log(Level.FINER, "Input data matches schema 'Quadrilateral'"); + } } catch (Exception e) { // deserialization failed, continue log.log(Level.FINER, "Input data does not match schema 'Quadrilateral'", e); @@ -126,12 +143,25 @@ public Shape deserialize(JsonParser jp, DeserializationContext ctxt) throws IOEx // deserialize Triangle try { - deserialized = tree.traverse(jp.getCodec()).readValueAs(Triangle.class); - // TODO: there is no validation against JSON schema constraints - // (min, max, enum, pattern...), this does not perform a strict JSON - // validation, which means the 'match' count may be higher than it should be. - match++; - log.log(Level.FINER, "Input data matches schema 'Triangle'"); + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (Triangle.class.equals(Integer.class) || Triangle.class.equals(Long.class) || Triangle.class.equals(Float.class) || Triangle.class.equals(Double.class) || Triangle.class.equals(Boolean.class) || Triangle.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= ((Triangle.class.equals(Integer.class) || Triangle.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((Triangle.class.equals(Float.class) || Triangle.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (Triangle.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (Triangle.class.equals(String.class) && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + deserialized = tree.traverse(jp.getCodec()).readValueAs(Triangle.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + match++; + log.log(Level.FINER, "Input data matches schema 'Triangle'"); + } } catch (Exception e) { // deserialization failed, continue log.log(Level.FINER, "Input data does not match schema 'Triangle'", e); diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ShapeOrNull.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ShapeOrNull.java index 1a8d3c0a0764..b951e2f4e9cd 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ShapeOrNull.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ShapeOrNull.java @@ -49,10 +49,12 @@ import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.JsonToken; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.DeserializationContext; import com.fasterxml.jackson.databind.JsonMappingException; import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.MapperFeature; import com.fasterxml.jackson.databind.SerializerProvider; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; @@ -110,15 +112,31 @@ public ShapeOrNull deserialize(JsonParser jp, DeserializationContext ctxt) throw log.log(Level.WARNING, String.format("Failed to lookup discriminator value `%s` for ShapeOrNull. Possible values: Quadrilateral Triangle", discriminatorValue)); } + boolean typeCoercion = ctxt.isEnabled(MapperFeature.ALLOW_COERCION_OF_SCALARS); int match = 0; + JsonToken token = tree.traverse(jp.getCodec()).nextToken(); // deserialize Quadrilateral try { - deserialized = tree.traverse(jp.getCodec()).readValueAs(Quadrilateral.class); - // TODO: there is no validation against JSON schema constraints - // (min, max, enum, pattern...), this does not perform a strict JSON - // validation, which means the 'match' count may be higher than it should be. - match++; - log.log(Level.FINER, "Input data matches schema 'Quadrilateral'"); + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (Quadrilateral.class.equals(Integer.class) || Quadrilateral.class.equals(Long.class) || Quadrilateral.class.equals(Float.class) || Quadrilateral.class.equals(Double.class) || Quadrilateral.class.equals(Boolean.class) || Quadrilateral.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= ((Quadrilateral.class.equals(Integer.class) || Quadrilateral.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((Quadrilateral.class.equals(Float.class) || Quadrilateral.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (Quadrilateral.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (Quadrilateral.class.equals(String.class) && token == JsonToken.VALUE_STRING); + attemptParsing |= (token == JsonToken.VALUE_NULL); + } + } + if (attemptParsing) { + deserialized = tree.traverse(jp.getCodec()).readValueAs(Quadrilateral.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + match++; + log.log(Level.FINER, "Input data matches schema 'Quadrilateral'"); + } } catch (Exception e) { // deserialization failed, continue log.log(Level.FINER, "Input data does not match schema 'Quadrilateral'", e); @@ -126,12 +144,26 @@ public ShapeOrNull deserialize(JsonParser jp, DeserializationContext ctxt) throw // deserialize Triangle try { - deserialized = tree.traverse(jp.getCodec()).readValueAs(Triangle.class); - // TODO: there is no validation against JSON schema constraints - // (min, max, enum, pattern...), this does not perform a strict JSON - // validation, which means the 'match' count may be higher than it should be. - match++; - log.log(Level.FINER, "Input data matches schema 'Triangle'"); + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (Triangle.class.equals(Integer.class) || Triangle.class.equals(Long.class) || Triangle.class.equals(Float.class) || Triangle.class.equals(Double.class) || Triangle.class.equals(Boolean.class) || Triangle.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= ((Triangle.class.equals(Integer.class) || Triangle.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((Triangle.class.equals(Float.class) || Triangle.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (Triangle.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (Triangle.class.equals(String.class) && token == JsonToken.VALUE_STRING); + attemptParsing |= (token == JsonToken.VALUE_NULL); + } + } + if (attemptParsing) { + deserialized = tree.traverse(jp.getCodec()).readValueAs(Triangle.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + match++; + log.log(Level.FINER, "Input data matches schema 'Triangle'"); + } } catch (Exception e) { // deserialization failed, continue log.log(Level.FINER, "Input data does not match schema 'Triangle'", e); diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Triangle.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Triangle.java index ab7f93d1a737..232fed5dc91c 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Triangle.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Triangle.java @@ -50,10 +50,12 @@ import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.JsonToken; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.DeserializationContext; import com.fasterxml.jackson.databind.JsonMappingException; import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.MapperFeature; import com.fasterxml.jackson.databind.SerializerProvider; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; @@ -115,15 +117,30 @@ public Triangle deserialize(JsonParser jp, DeserializationContext ctxt) throws I log.log(Level.WARNING, String.format("Failed to lookup discriminator value `%s` for Triangle. Possible values: EquilateralTriangle IsoscelesTriangle ScaleneTriangle", discriminatorValue)); } + boolean typeCoercion = ctxt.isEnabled(MapperFeature.ALLOW_COERCION_OF_SCALARS); int match = 0; + JsonToken token = tree.traverse(jp.getCodec()).nextToken(); // deserialize EquilateralTriangle try { - deserialized = tree.traverse(jp.getCodec()).readValueAs(EquilateralTriangle.class); - // TODO: there is no validation against JSON schema constraints - // (min, max, enum, pattern...), this does not perform a strict JSON - // validation, which means the 'match' count may be higher than it should be. - match++; - log.log(Level.FINER, "Input data matches schema 'EquilateralTriangle'"); + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (EquilateralTriangle.class.equals(Integer.class) || EquilateralTriangle.class.equals(Long.class) || EquilateralTriangle.class.equals(Float.class) || EquilateralTriangle.class.equals(Double.class) || EquilateralTriangle.class.equals(Boolean.class) || EquilateralTriangle.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= ((EquilateralTriangle.class.equals(Integer.class) || EquilateralTriangle.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((EquilateralTriangle.class.equals(Float.class) || EquilateralTriangle.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (EquilateralTriangle.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (EquilateralTriangle.class.equals(String.class) && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + deserialized = tree.traverse(jp.getCodec()).readValueAs(EquilateralTriangle.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + match++; + log.log(Level.FINER, "Input data matches schema 'EquilateralTriangle'"); + } } catch (Exception e) { // deserialization failed, continue log.log(Level.FINER, "Input data does not match schema 'EquilateralTriangle'", e); @@ -131,12 +148,25 @@ public Triangle deserialize(JsonParser jp, DeserializationContext ctxt) throws I // deserialize IsoscelesTriangle try { - deserialized = tree.traverse(jp.getCodec()).readValueAs(IsoscelesTriangle.class); - // TODO: there is no validation against JSON schema constraints - // (min, max, enum, pattern...), this does not perform a strict JSON - // validation, which means the 'match' count may be higher than it should be. - match++; - log.log(Level.FINER, "Input data matches schema 'IsoscelesTriangle'"); + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (IsoscelesTriangle.class.equals(Integer.class) || IsoscelesTriangle.class.equals(Long.class) || IsoscelesTriangle.class.equals(Float.class) || IsoscelesTriangle.class.equals(Double.class) || IsoscelesTriangle.class.equals(Boolean.class) || IsoscelesTriangle.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= ((IsoscelesTriangle.class.equals(Integer.class) || IsoscelesTriangle.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((IsoscelesTriangle.class.equals(Float.class) || IsoscelesTriangle.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (IsoscelesTriangle.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (IsoscelesTriangle.class.equals(String.class) && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + deserialized = tree.traverse(jp.getCodec()).readValueAs(IsoscelesTriangle.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + match++; + log.log(Level.FINER, "Input data matches schema 'IsoscelesTriangle'"); + } } catch (Exception e) { // deserialization failed, continue log.log(Level.FINER, "Input data does not match schema 'IsoscelesTriangle'", e); @@ -144,12 +174,25 @@ public Triangle deserialize(JsonParser jp, DeserializationContext ctxt) throws I // deserialize ScaleneTriangle try { - deserialized = tree.traverse(jp.getCodec()).readValueAs(ScaleneTriangle.class); - // TODO: there is no validation against JSON schema constraints - // (min, max, enum, pattern...), this does not perform a strict JSON - // validation, which means the 'match' count may be higher than it should be. - match++; - log.log(Level.FINER, "Input data matches schema 'ScaleneTriangle'"); + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (ScaleneTriangle.class.equals(Integer.class) || ScaleneTriangle.class.equals(Long.class) || ScaleneTriangle.class.equals(Float.class) || ScaleneTriangle.class.equals(Double.class) || ScaleneTriangle.class.equals(Boolean.class) || ScaleneTriangle.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= ((ScaleneTriangle.class.equals(Integer.class) || ScaleneTriangle.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((ScaleneTriangle.class.equals(Float.class) || ScaleneTriangle.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (ScaleneTriangle.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (ScaleneTriangle.class.equals(String.class) && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + deserialized = tree.traverse(jp.getCodec()).readValueAs(ScaleneTriangle.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + match++; + log.log(Level.FINER, "Input data matches schema 'ScaleneTriangle'"); + } } catch (Exception e) { // deserialization failed, continue log.log(Level.FINER, "Input data does not match schema 'ScaleneTriangle'", e); From 8e150ab94e1be4cc85a99537937052f51ed06699 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Thu, 23 Jul 2020 23:01:57 +0800 Subject: [PATCH 061/129] fix string comparison (#7027) --- .../codegen/languages/AbstractTypeScriptClientCodegen.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractTypeScriptClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractTypeScriptClientCodegen.java index 5e84b3fec18e..c4a34d2ca32e 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractTypeScriptClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractTypeScriptClientCodegen.java @@ -846,7 +846,7 @@ public String toAllOfName(List names, ComposedSchema composedSchema) { */ protected List getTypesFromSchemas(List schemas) { List filteredSchemas = schemas.size() > 1 - ? schemas.stream().filter(schema -> super.getSchemaType(schema) != "AnyType").collect(Collectors.toList()) + ? schemas.stream().filter(schema -> !"AnyType".equals(super.getSchemaType(schema))).collect(Collectors.toList()) : schemas; return filteredSchemas.stream().map(schema -> { From 83f64dbc15ecea31e8bfe71d6ebc5d8e9f279398 Mon Sep 17 00:00:00 2001 From: Alexandre Date: Fri, 24 Jul 2020 05:56:18 +0200 Subject: [PATCH 062/129] [Swift5] Fix Datetime default value (#7003) * [Swift5] Fix Datetime default value If a default value is provided by the API spec for a date-time attribute, this commit fixes the generation code to build a correct Swift `Date` object. * update samples with swiftlint Co-authored-by: William Cheng --- .../languages/Swift5ClientCodegen.java | 19 ++++++++++++++----- .../Models/AdditionalPropertiesClass.swift | 2 +- .../Classes/OpenAPIs/Models/Animal.swift | 2 +- .../Classes/OpenAPIs/Models/ApiResponse.swift | 2 +- .../Models/ArrayOfArrayOfNumberOnly.swift | 2 +- .../OpenAPIs/Models/ArrayOfNumberOnly.swift | 2 +- .../Classes/OpenAPIs/Models/ArrayTest.swift | 2 +- .../OpenAPIs/Models/Capitalization.swift | 2 +- .../Classes/OpenAPIs/Models/Cat.swift | 2 +- .../Classes/OpenAPIs/Models/CatAllOf.swift | 2 +- .../Classes/OpenAPIs/Models/Category.swift | 2 +- .../Classes/OpenAPIs/Models/ClassModel.swift | 2 +- .../Classes/OpenAPIs/Models/Client.swift | 2 +- .../Classes/OpenAPIs/Models/Dog.swift | 2 +- .../Classes/OpenAPIs/Models/DogAllOf.swift | 2 +- .../Classes/OpenAPIs/Models/EnumArrays.swift | 2 +- .../Classes/OpenAPIs/Models/EnumTest.swift | 2 +- .../Classes/OpenAPIs/Models/File.swift | 2 +- .../OpenAPIs/Models/FileSchemaTestClass.swift | 2 +- .../Classes/OpenAPIs/Models/FormatTest.swift | 2 +- .../OpenAPIs/Models/HasOnlyReadOnly.swift | 2 +- .../Classes/OpenAPIs/Models/List.swift | 2 +- .../Classes/OpenAPIs/Models/MapTest.swift | 2 +- ...opertiesAndAdditionalPropertiesClass.swift | 2 +- .../OpenAPIs/Models/Model200Response.swift | 2 +- .../Classes/OpenAPIs/Models/Name.swift | 2 +- .../Classes/OpenAPIs/Models/NumberOnly.swift | 2 +- .../Classes/OpenAPIs/Models/Order.swift | 2 +- .../OpenAPIs/Models/OuterComposite.swift | 2 +- .../Classes/OpenAPIs/Models/Pet.swift | 2 +- .../OpenAPIs/Models/ReadOnlyFirst.swift | 2 +- .../Classes/OpenAPIs/Models/Return.swift | 2 +- .../OpenAPIs/Models/SpecialModelName.swift | 2 +- .../Classes/OpenAPIs/Models/Tag.swift | 2 +- .../Classes/OpenAPIs/Models/User.swift | 2 +- .../Models/AdditionalPropertiesClass.swift | 2 +- .../Classes/OpenAPIs/Models/Animal.swift | 2 +- .../Classes/OpenAPIs/Models/ApiResponse.swift | 2 +- .../Models/ArrayOfArrayOfNumberOnly.swift | 2 +- .../OpenAPIs/Models/ArrayOfNumberOnly.swift | 2 +- .../Classes/OpenAPIs/Models/ArrayTest.swift | 2 +- .../OpenAPIs/Models/Capitalization.swift | 2 +- .../Classes/OpenAPIs/Models/Cat.swift | 2 +- .../Classes/OpenAPIs/Models/CatAllOf.swift | 2 +- .../Classes/OpenAPIs/Models/Category.swift | 2 +- .../Classes/OpenAPIs/Models/ClassModel.swift | 2 +- .../Classes/OpenAPIs/Models/Client.swift | 2 +- .../Classes/OpenAPIs/Models/Dog.swift | 2 +- .../Classes/OpenAPIs/Models/DogAllOf.swift | 2 +- .../Classes/OpenAPIs/Models/EnumArrays.swift | 2 +- .../Classes/OpenAPIs/Models/EnumTest.swift | 2 +- .../Classes/OpenAPIs/Models/File.swift | 2 +- .../OpenAPIs/Models/FileSchemaTestClass.swift | 2 +- .../Classes/OpenAPIs/Models/FormatTest.swift | 2 +- .../OpenAPIs/Models/HasOnlyReadOnly.swift | 2 +- .../Classes/OpenAPIs/Models/List.swift | 2 +- .../Classes/OpenAPIs/Models/MapTest.swift | 2 +- ...opertiesAndAdditionalPropertiesClass.swift | 2 +- .../OpenAPIs/Models/Model200Response.swift | 2 +- .../Classes/OpenAPIs/Models/Name.swift | 2 +- .../Classes/OpenAPIs/Models/NumberOnly.swift | 2 +- .../Classes/OpenAPIs/Models/Order.swift | 2 +- .../OpenAPIs/Models/OuterComposite.swift | 2 +- .../Classes/OpenAPIs/Models/Pet.swift | 2 +- .../OpenAPIs/Models/ReadOnlyFirst.swift | 2 +- .../Classes/OpenAPIs/Models/Return.swift | 2 +- .../OpenAPIs/Models/SpecialModelName.swift | 2 +- .../Classes/OpenAPIs/Models/Tag.swift | 2 +- .../Classes/OpenAPIs/Models/User.swift | 2 +- .../Models/AdditionalPropertiesClass.swift | 2 +- .../Classes/OpenAPIs/Models/Animal.swift | 2 +- .../Classes/OpenAPIs/Models/ApiResponse.swift | 2 +- .../Models/ArrayOfArrayOfNumberOnly.swift | 2 +- .../OpenAPIs/Models/ArrayOfNumberOnly.swift | 2 +- .../Classes/OpenAPIs/Models/ArrayTest.swift | 2 +- .../OpenAPIs/Models/Capitalization.swift | 2 +- .../Classes/OpenAPIs/Models/Cat.swift | 2 +- .../Classes/OpenAPIs/Models/CatAllOf.swift | 2 +- .../Classes/OpenAPIs/Models/Category.swift | 2 +- .../Classes/OpenAPIs/Models/ClassModel.swift | 2 +- .../Classes/OpenAPIs/Models/Client.swift | 2 +- .../Classes/OpenAPIs/Models/Dog.swift | 2 +- .../Classes/OpenAPIs/Models/DogAllOf.swift | 2 +- .../Classes/OpenAPIs/Models/EnumArrays.swift | 2 +- .../Classes/OpenAPIs/Models/EnumTest.swift | 2 +- .../Classes/OpenAPIs/Models/File.swift | 2 +- .../OpenAPIs/Models/FileSchemaTestClass.swift | 2 +- .../Classes/OpenAPIs/Models/FormatTest.swift | 2 +- .../OpenAPIs/Models/HasOnlyReadOnly.swift | 2 +- .../Classes/OpenAPIs/Models/List.swift | 2 +- .../Classes/OpenAPIs/Models/MapTest.swift | 2 +- ...opertiesAndAdditionalPropertiesClass.swift | 2 +- .../OpenAPIs/Models/Model200Response.swift | 2 +- .../Classes/OpenAPIs/Models/Name.swift | 2 +- .../Classes/OpenAPIs/Models/NumberOnly.swift | 2 +- .../Classes/OpenAPIs/Models/Order.swift | 2 +- .../OpenAPIs/Models/OuterComposite.swift | 2 +- .../Classes/OpenAPIs/Models/Pet.swift | 2 +- .../OpenAPIs/Models/ReadOnlyFirst.swift | 2 +- .../Classes/OpenAPIs/Models/Return.swift | 2 +- .../OpenAPIs/Models/SpecialModelName.swift | 2 +- .../Classes/OpenAPIs/Models/Tag.swift | 2 +- .../Classes/OpenAPIs/Models/User.swift | 2 +- .../Classes/OpenAPIs/Models/ApiResponse.swift | 2 +- .../Classes/OpenAPIs/Models/Category.swift | 2 +- .../OpenAPIs/Models/InlineObject.swift | 2 +- .../OpenAPIs/Models/InlineObject1.swift | 2 +- .../Classes/OpenAPIs/Models/Order.swift | 2 +- .../Classes/OpenAPIs/Models/Pet.swift | 2 +- .../Classes/OpenAPIs/Models/Tag.swift | 2 +- .../Classes/OpenAPIs/Models/User.swift | 2 +- .../Models/AdditionalPropertiesClass.swift | 2 +- .../Classes/OpenAPIs/Models/Animal.swift | 2 +- .../Classes/OpenAPIs/Models/ApiResponse.swift | 2 +- .../Models/ArrayOfArrayOfNumberOnly.swift | 2 +- .../OpenAPIs/Models/ArrayOfNumberOnly.swift | 2 +- .../Classes/OpenAPIs/Models/ArrayTest.swift | 2 +- .../OpenAPIs/Models/Capitalization.swift | 2 +- .../Classes/OpenAPIs/Models/Cat.swift | 2 +- .../Classes/OpenAPIs/Models/CatAllOf.swift | 2 +- .../Classes/OpenAPIs/Models/Category.swift | 2 +- .../Classes/OpenAPIs/Models/ClassModel.swift | 2 +- .../Classes/OpenAPIs/Models/Client.swift | 2 +- .../Classes/OpenAPIs/Models/Dog.swift | 2 +- .../Classes/OpenAPIs/Models/DogAllOf.swift | 2 +- .../Classes/OpenAPIs/Models/EnumArrays.swift | 2 +- .../Classes/OpenAPIs/Models/EnumTest.swift | 2 +- .../Classes/OpenAPIs/Models/File.swift | 2 +- .../OpenAPIs/Models/FileSchemaTestClass.swift | 2 +- .../Classes/OpenAPIs/Models/FormatTest.swift | 2 +- .../OpenAPIs/Models/HasOnlyReadOnly.swift | 2 +- .../Classes/OpenAPIs/Models/List.swift | 2 +- .../Classes/OpenAPIs/Models/MapTest.swift | 2 +- ...opertiesAndAdditionalPropertiesClass.swift | 2 +- .../OpenAPIs/Models/Model200Response.swift | 2 +- .../Classes/OpenAPIs/Models/Name.swift | 2 +- .../Classes/OpenAPIs/Models/NumberOnly.swift | 2 +- .../Classes/OpenAPIs/Models/Order.swift | 2 +- .../OpenAPIs/Models/OuterComposite.swift | 2 +- .../Classes/OpenAPIs/Models/Pet.swift | 2 +- .../OpenAPIs/Models/ReadOnlyFirst.swift | 2 +- .../Classes/OpenAPIs/Models/Return.swift | 2 +- .../OpenAPIs/Models/SpecialModelName.swift | 2 +- .../Classes/OpenAPIs/Models/Tag.swift | 2 +- .../Classes/OpenAPIs/Models/User.swift | 2 +- .../Models/AdditionalPropertiesClass.swift | 2 +- .../Classes/OpenAPIs/Models/Animal.swift | 2 +- .../Classes/OpenAPIs/Models/ApiResponse.swift | 2 +- .../Models/ArrayOfArrayOfNumberOnly.swift | 2 +- .../OpenAPIs/Models/ArrayOfNumberOnly.swift | 2 +- .../Classes/OpenAPIs/Models/ArrayTest.swift | 2 +- .../OpenAPIs/Models/Capitalization.swift | 2 +- .../Classes/OpenAPIs/Models/Cat.swift | 2 +- .../Classes/OpenAPIs/Models/CatAllOf.swift | 2 +- .../Classes/OpenAPIs/Models/Category.swift | 2 +- .../Classes/OpenAPIs/Models/ClassModel.swift | 2 +- .../Classes/OpenAPIs/Models/Client.swift | 2 +- .../Classes/OpenAPIs/Models/Dog.swift | 2 +- .../Classes/OpenAPIs/Models/DogAllOf.swift | 2 +- .../Classes/OpenAPIs/Models/EnumArrays.swift | 2 +- .../Classes/OpenAPIs/Models/EnumTest.swift | 2 +- .../Classes/OpenAPIs/Models/File.swift | 2 +- .../OpenAPIs/Models/FileSchemaTestClass.swift | 2 +- .../Classes/OpenAPIs/Models/FormatTest.swift | 2 +- .../OpenAPIs/Models/HasOnlyReadOnly.swift | 2 +- .../Classes/OpenAPIs/Models/List.swift | 2 +- .../Classes/OpenAPIs/Models/MapTest.swift | 2 +- ...opertiesAndAdditionalPropertiesClass.swift | 2 +- .../OpenAPIs/Models/Model200Response.swift | 2 +- .../Classes/OpenAPIs/Models/Name.swift | 2 +- .../Classes/OpenAPIs/Models/NumberOnly.swift | 2 +- .../Classes/OpenAPIs/Models/Order.swift | 2 +- .../OpenAPIs/Models/OuterComposite.swift | 2 +- .../Classes/OpenAPIs/Models/Pet.swift | 2 +- .../OpenAPIs/Models/ReadOnlyFirst.swift | 2 +- .../Classes/OpenAPIs/Models/Return.swift | 2 +- .../OpenAPIs/Models/SpecialModelName.swift | 2 +- .../Classes/OpenAPIs/Models/Tag.swift | 2 +- .../Classes/OpenAPIs/Models/User.swift | 2 +- .../Models/AdditionalPropertiesClass.swift | 2 +- .../Classes/OpenAPIs/Models/Animal.swift | 2 +- .../Classes/OpenAPIs/Models/ApiResponse.swift | 2 +- .../Models/ArrayOfArrayOfNumberOnly.swift | 2 +- .../OpenAPIs/Models/ArrayOfNumberOnly.swift | 2 +- .../Classes/OpenAPIs/Models/ArrayTest.swift | 2 +- .../OpenAPIs/Models/Capitalization.swift | 2 +- .../Classes/OpenAPIs/Models/Cat.swift | 2 +- .../Classes/OpenAPIs/Models/CatAllOf.swift | 2 +- .../Classes/OpenAPIs/Models/Category.swift | 2 +- .../Classes/OpenAPIs/Models/ClassModel.swift | 2 +- .../Classes/OpenAPIs/Models/Client.swift | 2 +- .../Classes/OpenAPIs/Models/Dog.swift | 2 +- .../Classes/OpenAPIs/Models/DogAllOf.swift | 2 +- .../Classes/OpenAPIs/Models/EnumArrays.swift | 2 +- .../Classes/OpenAPIs/Models/EnumTest.swift | 2 +- .../Classes/OpenAPIs/Models/File.swift | 2 +- .../OpenAPIs/Models/FileSchemaTestClass.swift | 2 +- .../Classes/OpenAPIs/Models/FormatTest.swift | 2 +- .../OpenAPIs/Models/HasOnlyReadOnly.swift | 2 +- .../Classes/OpenAPIs/Models/List.swift | 2 +- .../Classes/OpenAPIs/Models/MapTest.swift | 2 +- ...opertiesAndAdditionalPropertiesClass.swift | 2 +- .../OpenAPIs/Models/Model200Response.swift | 2 +- .../Classes/OpenAPIs/Models/Name.swift | 2 +- .../Classes/OpenAPIs/Models/NumberOnly.swift | 2 +- .../Classes/OpenAPIs/Models/Order.swift | 2 +- .../OpenAPIs/Models/OuterComposite.swift | 2 +- .../Classes/OpenAPIs/Models/Pet.swift | 2 +- .../OpenAPIs/Models/ReadOnlyFirst.swift | 2 +- .../Classes/OpenAPIs/Models/Return.swift | 2 +- .../OpenAPIs/Models/SpecialModelName.swift | 2 +- .../Classes/OpenAPIs/Models/Tag.swift | 2 +- .../Classes/OpenAPIs/Models/User.swift | 2 +- .../Models/AdditionalPropertiesClass.swift | 2 +- .../Classes/OpenAPIs/Models/Animal.swift | 2 +- .../Classes/OpenAPIs/Models/ApiResponse.swift | 2 +- .../Models/ArrayOfArrayOfNumberOnly.swift | 2 +- .../OpenAPIs/Models/ArrayOfNumberOnly.swift | 2 +- .../Classes/OpenAPIs/Models/ArrayTest.swift | 2 +- .../OpenAPIs/Models/Capitalization.swift | 2 +- .../Classes/OpenAPIs/Models/Cat.swift | 2 +- .../Classes/OpenAPIs/Models/CatAllOf.swift | 2 +- .../Classes/OpenAPIs/Models/Category.swift | 2 +- .../Classes/OpenAPIs/Models/ClassModel.swift | 2 +- .../Classes/OpenAPIs/Models/Client.swift | 2 +- .../Classes/OpenAPIs/Models/Dog.swift | 2 +- .../Classes/OpenAPIs/Models/DogAllOf.swift | 2 +- .../Classes/OpenAPIs/Models/EnumArrays.swift | 2 +- .../Classes/OpenAPIs/Models/EnumTest.swift | 2 +- .../Classes/OpenAPIs/Models/File.swift | 2 +- .../OpenAPIs/Models/FileSchemaTestClass.swift | 2 +- .../Classes/OpenAPIs/Models/FormatTest.swift | 2 +- .../OpenAPIs/Models/HasOnlyReadOnly.swift | 2 +- .../Classes/OpenAPIs/Models/List.swift | 2 +- .../Classes/OpenAPIs/Models/MapTest.swift | 2 +- ...opertiesAndAdditionalPropertiesClass.swift | 2 +- .../OpenAPIs/Models/Model200Response.swift | 2 +- .../Classes/OpenAPIs/Models/Name.swift | 2 +- .../Classes/OpenAPIs/Models/NumberOnly.swift | 2 +- .../Classes/OpenAPIs/Models/Order.swift | 2 +- .../OpenAPIs/Models/OuterComposite.swift | 2 +- .../Classes/OpenAPIs/Models/Pet.swift | 2 +- .../OpenAPIs/Models/ReadOnlyFirst.swift | 2 +- .../Classes/OpenAPIs/Models/Return.swift | 2 +- .../OpenAPIs/Models/SpecialModelName.swift | 2 +- .../Classes/OpenAPIs/Models/Tag.swift | 2 +- .../Classes/OpenAPIs/Models/User.swift | 2 +- .../Models/AdditionalPropertiesClass.swift | 2 +- .../Classes/OpenAPIs/Models/Animal.swift | 2 +- .../Classes/OpenAPIs/Models/ApiResponse.swift | 2 +- .../Models/ArrayOfArrayOfNumberOnly.swift | 2 +- .../OpenAPIs/Models/ArrayOfNumberOnly.swift | 2 +- .../Classes/OpenAPIs/Models/ArrayTest.swift | 2 +- .../OpenAPIs/Models/Capitalization.swift | 2 +- .../Classes/OpenAPIs/Models/Cat.swift | 2 +- .../Classes/OpenAPIs/Models/CatAllOf.swift | 2 +- .../Classes/OpenAPIs/Models/Category.swift | 2 +- .../Classes/OpenAPIs/Models/ClassModel.swift | 2 +- .../Classes/OpenAPIs/Models/Client.swift | 2 +- .../Classes/OpenAPIs/Models/Dog.swift | 2 +- .../Classes/OpenAPIs/Models/DogAllOf.swift | 2 +- .../Classes/OpenAPIs/Models/EnumArrays.swift | 2 +- .../Classes/OpenAPIs/Models/EnumTest.swift | 2 +- .../Classes/OpenAPIs/Models/File.swift | 2 +- .../OpenAPIs/Models/FileSchemaTestClass.swift | 2 +- .../Classes/OpenAPIs/Models/FormatTest.swift | 2 +- .../OpenAPIs/Models/HasOnlyReadOnly.swift | 2 +- .../Classes/OpenAPIs/Models/List.swift | 2 +- .../Classes/OpenAPIs/Models/MapTest.swift | 2 +- ...opertiesAndAdditionalPropertiesClass.swift | 2 +- .../OpenAPIs/Models/Model200Response.swift | 2 +- .../Classes/OpenAPIs/Models/Name.swift | 2 +- .../Classes/OpenAPIs/Models/NumberOnly.swift | 2 +- .../Classes/OpenAPIs/Models/Order.swift | 2 +- .../OpenAPIs/Models/OuterComposite.swift | 2 +- .../Classes/OpenAPIs/Models/Pet.swift | 2 +- .../OpenAPIs/Models/ReadOnlyFirst.swift | 2 +- .../Classes/OpenAPIs/Models/Return.swift | 2 +- .../OpenAPIs/Models/SpecialModelName.swift | 2 +- .../Classes/OpenAPIs/Models/Tag.swift | 2 +- .../Classes/OpenAPIs/Models/User.swift | 2 +- .../Models/AdditionalPropertiesClass.swift | 2 +- .../Classes/OpenAPIs/Models/Animal.swift | 2 +- .../Classes/OpenAPIs/Models/ApiResponse.swift | 2 +- .../Models/ArrayOfArrayOfNumberOnly.swift | 2 +- .../OpenAPIs/Models/ArrayOfNumberOnly.swift | 2 +- .../Classes/OpenAPIs/Models/ArrayTest.swift | 2 +- .../OpenAPIs/Models/Capitalization.swift | 2 +- .../Classes/OpenAPIs/Models/Cat.swift | 2 +- .../Classes/OpenAPIs/Models/CatAllOf.swift | 2 +- .../Classes/OpenAPIs/Models/Category.swift | 2 +- .../Classes/OpenAPIs/Models/ClassModel.swift | 2 +- .../Classes/OpenAPIs/Models/Client.swift | 2 +- .../Classes/OpenAPIs/Models/Dog.swift | 2 +- .../Classes/OpenAPIs/Models/DogAllOf.swift | 2 +- .../Classes/OpenAPIs/Models/EnumArrays.swift | 2 +- .../Classes/OpenAPIs/Models/EnumTest.swift | 2 +- .../Classes/OpenAPIs/Models/File.swift | 2 +- .../OpenAPIs/Models/FileSchemaTestClass.swift | 2 +- .../Classes/OpenAPIs/Models/FormatTest.swift | 2 +- .../OpenAPIs/Models/HasOnlyReadOnly.swift | 2 +- .../Classes/OpenAPIs/Models/List.swift | 2 +- .../Classes/OpenAPIs/Models/MapTest.swift | 2 +- ...opertiesAndAdditionalPropertiesClass.swift | 2 +- .../OpenAPIs/Models/Model200Response.swift | 2 +- .../Classes/OpenAPIs/Models/Name.swift | 2 +- .../Classes/OpenAPIs/Models/NumberOnly.swift | 2 +- .../Classes/OpenAPIs/Models/Order.swift | 2 +- .../OpenAPIs/Models/OuterComposite.swift | 2 +- .../Classes/OpenAPIs/Models/Pet.swift | 2 +- .../OpenAPIs/Models/ReadOnlyFirst.swift | 2 +- .../Classes/OpenAPIs/Models/Return.swift | 2 +- .../OpenAPIs/Models/SpecialModelName.swift | 2 +- .../Classes/OpenAPIs/Models/Tag.swift | 2 +- .../Classes/OpenAPIs/Models/User.swift | 2 +- .../Models/AdditionalPropertiesClass.swift | 2 +- .../Classes/OpenAPIs/Models/Animal.swift | 2 +- .../Classes/OpenAPIs/Models/ApiResponse.swift | 2 +- .../Models/ArrayOfArrayOfNumberOnly.swift | 2 +- .../OpenAPIs/Models/ArrayOfNumberOnly.swift | 2 +- .../Classes/OpenAPIs/Models/ArrayTest.swift | 2 +- .../OpenAPIs/Models/Capitalization.swift | 2 +- .../Classes/OpenAPIs/Models/Cat.swift | 2 +- .../Classes/OpenAPIs/Models/CatAllOf.swift | 2 +- .../Classes/OpenAPIs/Models/Category.swift | 2 +- .../Classes/OpenAPIs/Models/ClassModel.swift | 2 +- .../Classes/OpenAPIs/Models/Client.swift | 2 +- .../Classes/OpenAPIs/Models/Dog.swift | 2 +- .../Classes/OpenAPIs/Models/DogAllOf.swift | 2 +- .../Classes/OpenAPIs/Models/EnumArrays.swift | 2 +- .../Classes/OpenAPIs/Models/EnumTest.swift | 2 +- .../Classes/OpenAPIs/Models/File.swift | 2 +- .../OpenAPIs/Models/FileSchemaTestClass.swift | 2 +- .../Classes/OpenAPIs/Models/FormatTest.swift | 2 +- .../OpenAPIs/Models/HasOnlyReadOnly.swift | 2 +- .../Classes/OpenAPIs/Models/List.swift | 2 +- .../Classes/OpenAPIs/Models/MapTest.swift | 2 +- ...opertiesAndAdditionalPropertiesClass.swift | 2 +- .../OpenAPIs/Models/Model200Response.swift | 2 +- .../Classes/OpenAPIs/Models/Name.swift | 2 +- .../Classes/OpenAPIs/Models/NumberOnly.swift | 2 +- .../Classes/OpenAPIs/Models/Order.swift | 2 +- .../OpenAPIs/Models/OuterComposite.swift | 2 +- .../Classes/OpenAPIs/Models/Pet.swift | 2 +- .../OpenAPIs/Models/ReadOnlyFirst.swift | 2 +- .../Classes/OpenAPIs/Models/Return.swift | 2 +- .../OpenAPIs/Models/SpecialModelName.swift | 2 +- .../Classes/OpenAPIs/Models/Tag.swift | 2 +- .../Classes/OpenAPIs/Models/User.swift | 2 +- 349 files changed, 362 insertions(+), 353 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift5ClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift5ClientCodegen.java index 57325357218b..3eb2c0ee6508 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift5ClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift5ClientCodegen.java @@ -34,6 +34,10 @@ import java.util.*; import java.util.regex.Matcher; import java.util.regex.Pattern; +import java.time.OffsetDateTime; +import java.time.Instant; +import java.time.temporal.ChronoField; +import java.util.concurrent.TimeUnit; import static org.openapitools.codegen.utils.StringUtils.camelize; @@ -620,14 +624,19 @@ public String toDefaultValue(Schema p) { } } } - if (ModelUtils.isIntegerSchema(p) || ModelUtils.isNumberSchema(p) || ModelUtils.isBooleanSchema(p)) { - if (p.getDefault() != null) { + if (p.getDefault() != null) { + if (ModelUtils.isIntegerSchema(p) || ModelUtils.isNumberSchema(p) || ModelUtils.isBooleanSchema(p)) { return p.getDefault().toString(); - } - } else if (ModelUtils.isStringSchema(p)) { - if (p.getDefault() != null) { + } else if (ModelUtils.isDateTimeSchema(p)) { + // Datetime time stamps in Swift are expressed as Seconds with Microsecond precision. + // In Java, we need to be creative to get the Timestamp in Microseconds as a long. + Instant instant = ((OffsetDateTime) p.getDefault()).toInstant(); + long epochMicro = TimeUnit.SECONDS.toMicros(instant.getEpochSecond()) + ((long) instant.get(ChronoField.MICRO_OF_SECOND)); + return "Date(timeIntervalSince1970: " + String.valueOf(epochMicro) + ".0 / 1_000_000)"; + } else if (ModelUtils.isStringSchema(p)) { return "\"" + escapeText((String) p.getDefault()) + "\""; } + // TODO: Handle more cases from `ModelUtils`, such as Date } return null; } diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift index 1af031535967..81020425ad1a 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift @@ -12,7 +12,7 @@ public struct AdditionalPropertiesClass: Codable { public var mapString: [String: String]? public var mapMapString: [String: [String: String]]? - public init(mapString: [String: String]?, mapMapString: [String: [String: String]]?) { + public init(mapString: [String: String]? = nil, mapMapString: [String: [String: String]]? = nil) { self.mapString = mapString self.mapMapString = mapMapString } diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift index 5ed9f31e2a36..c34ac85ac63f 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift @@ -12,7 +12,7 @@ public struct Animal: Codable { public var className: String public var color: String? = "red" - public init(className: String, color: String?) { + public init(className: String, color: String? = nil) { self.className = className self.color = color } diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift index ec270da89074..6ad3d808a97d 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift @@ -13,7 +13,7 @@ public struct ApiResponse: Codable { public var type: String? public var message: String? - public init(code: Int?, type: String?, message: String?) { + public init(code: Int? = nil, type: String? = nil, message: String? = nil) { self.code = code self.type = type self.message = message diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift index 6c252ed475b2..6d99f90fdd19 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift @@ -11,7 +11,7 @@ public struct ArrayOfArrayOfNumberOnly: Codable { public var arrayArrayNumber: [[Double]]? - public init(arrayArrayNumber: [[Double]]?) { + public init(arrayArrayNumber: [[Double]]? = nil) { self.arrayArrayNumber = arrayArrayNumber } diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift index e84eb5d65025..d59c529ef659 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift @@ -11,7 +11,7 @@ public struct ArrayOfNumberOnly: Codable { public var arrayNumber: [Double]? - public init(arrayNumber: [Double]?) { + public init(arrayNumber: [Double]? = nil) { self.arrayNumber = arrayNumber } diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift index d2140933d181..fdab67b0c59f 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift @@ -13,7 +13,7 @@ public struct ArrayTest: Codable { public var arrayArrayOfInteger: [[Int64]]? public var arrayArrayOfModel: [[ReadOnlyFirst]]? - public init(arrayOfString: [String]?, arrayArrayOfInteger: [[Int64]]?, arrayArrayOfModel: [[ReadOnlyFirst]]?) { + public init(arrayOfString: [String]? = nil, arrayArrayOfInteger: [[Int64]]? = nil, arrayArrayOfModel: [[ReadOnlyFirst]]? = nil) { self.arrayOfString = arrayOfString self.arrayArrayOfInteger = arrayArrayOfInteger self.arrayArrayOfModel = arrayArrayOfModel diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift index d1b3b27616ed..a7f8abe97195 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift @@ -17,7 +17,7 @@ public struct Capitalization: Codable { /** Name of the pet */ public var ATT_NAME: String? - public init(smallCamel: String?, capitalCamel: String?, smallSnake: String?, capitalSnake: String?, sCAETHFlowPoints: String?, ATT_NAME: String?) { + public init(smallCamel: String? = nil, capitalCamel: String? = nil, smallSnake: String? = nil, capitalSnake: String? = nil, sCAETHFlowPoints: String? = nil, ATT_NAME: String? = nil) { self.smallCamel = smallCamel self.capitalCamel = capitalCamel self.smallSnake = smallSnake diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift index 7ab887f3113f..884020d1a72c 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift @@ -13,7 +13,7 @@ public struct Cat: Codable { public var color: String? = "red" public var declawed: Bool? - public init(className: String, color: String?, declawed: Bool?) { + public init(className: String, color: String? = nil, declawed: Bool? = nil) { self.className = className self.color = color self.declawed = declawed diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift index a51ad0dffab1..c7178efcb166 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift @@ -11,7 +11,7 @@ public struct CatAllOf: Codable { public var declawed: Bool? - public init(declawed: Bool?) { + public init(declawed: Bool? = nil) { self.declawed = declawed } diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift index eb8f7e5e1974..78bf6826d690 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift @@ -12,7 +12,7 @@ public struct Category: Codable { public var id: Int64? public var name: String = "default-name" - public init(id: Int64?, name: String) { + public init(id: Int64? = nil, name: String) { self.id = id self.name = name } diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift index e2a7d4427a06..d7299a058561 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift @@ -12,7 +12,7 @@ public struct ClassModel: Codable { public var _class: String? - public init(_class: String?) { + public init(_class: String? = nil) { self._class = _class } diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift index 00245ca37280..c8e0b51314d6 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift @@ -11,7 +11,7 @@ public struct Client: Codable { public var client: String? - public init(client: String?) { + public init(client: String? = nil) { self.client = client } diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift index 492c1228008e..e7e0efa931e8 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift @@ -13,7 +13,7 @@ public struct Dog: Codable { public var color: String? = "red" public var breed: String? - public init(className: String, color: String?, breed: String?) { + public init(className: String, color: String? = nil, breed: String? = nil) { self.className = className self.color = color self.breed = breed diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift index 7786f8acc5ae..1f61ed3c3431 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift @@ -11,7 +11,7 @@ public struct DogAllOf: Codable { public var breed: String? - public init(breed: String?) { + public init(breed: String? = nil) { self.breed = breed } diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift index 9844e7c40e35..10536376ccc6 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift @@ -20,7 +20,7 @@ public struct EnumArrays: Codable { public var justSymbol: JustSymbol? public var arrayEnum: [ArrayEnum]? - public init(justSymbol: JustSymbol?, arrayEnum: [ArrayEnum]?) { + public init(justSymbol: JustSymbol? = nil, arrayEnum: [ArrayEnum]? = nil) { self.justSymbol = justSymbol self.arrayEnum = arrayEnum } diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift index 789f583e1d77..c0d7c84b69d0 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift @@ -33,7 +33,7 @@ public struct EnumTest: Codable { public var enumNumber: EnumNumber? public var outerEnum: OuterEnum? - public init(enumString: EnumString?, enumStringRequired: EnumStringRequired, enumInteger: EnumInteger?, enumNumber: EnumNumber?, outerEnum: OuterEnum?) { + public init(enumString: EnumString? = nil, enumStringRequired: EnumStringRequired, enumInteger: EnumInteger? = nil, enumNumber: EnumNumber? = nil, outerEnum: OuterEnum? = nil) { self.enumString = enumString self.enumStringRequired = enumStringRequired self.enumInteger = enumInteger diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift index abf3ccffc485..54ffb6e70e3e 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift @@ -13,7 +13,7 @@ public struct File: Codable { /** Test capitalization */ public var sourceURI: String? - public init(sourceURI: String?) { + public init(sourceURI: String? = nil) { self.sourceURI = sourceURI } diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift index 532f1457939a..3d70ffe0a598 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift @@ -12,7 +12,7 @@ public struct FileSchemaTestClass: Codable { public var file: File? public var files: [File]? - public init(file: File?, files: [File]?) { + public init(file: File? = nil, files: [File]? = nil) { self.file = file self.files = files } diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift index 20bd6d103b3d..c934df71b34c 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift @@ -23,7 +23,7 @@ public struct FormatTest: Codable { public var uuid: UUID? public var password: String - public init(integer: Int?, int32: Int?, int64: Int64?, number: Double, float: Float?, double: Double?, string: String?, byte: Data, binary: URL?, date: Date, dateTime: Date?, uuid: UUID?, password: String) { + public init(integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, number: Double, float: Float? = nil, double: Double? = nil, string: String? = nil, byte: Data, binary: URL? = nil, date: Date, dateTime: Date? = nil, uuid: UUID? = nil, password: String) { self.integer = integer self.int32 = int32 self.int64 = int64 diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift index 906ddb06fb17..a6d3567e8859 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift @@ -12,7 +12,7 @@ public struct HasOnlyReadOnly: Codable { public var bar: String? public var foo: String? - public init(bar: String?, foo: String?) { + public init(bar: String? = nil, foo: String? = nil) { self.bar = bar self.foo = foo } diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift index fe13d302ccbf..6de49531ac1c 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift @@ -11,7 +11,7 @@ public struct List: Codable { public var _123list: String? - public init(_123list: String?) { + public init(_123list: String? = nil) { self._123list = _123list } diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift index 4b6037f378ee..a9762da61554 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift @@ -18,7 +18,7 @@ public struct MapTest: Codable { public var directMap: [String: Bool]? public var indirectMap: StringBooleanMap? - public init(mapMapOfString: [String: [String: String]]?, mapOfEnumString: [String: String]?, directMap: [String: Bool]?, indirectMap: StringBooleanMap?) { + public init(mapMapOfString: [String: [String: String]]? = nil, mapOfEnumString: [String: String]? = nil, directMap: [String: Bool]? = nil, indirectMap: StringBooleanMap? = nil) { self.mapMapOfString = mapMapOfString self.mapOfEnumString = mapOfEnumString self.directMap = directMap diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift index c3deb2f28932..f1d081064b62 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift @@ -13,7 +13,7 @@ public struct MixedPropertiesAndAdditionalPropertiesClass: Codable { public var dateTime: Date? public var map: [String: Animal]? - public init(uuid: UUID?, dateTime: Date?, map: [String: Animal]?) { + public init(uuid: UUID? = nil, dateTime: Date? = nil, map: [String: Animal]? = nil) { self.uuid = uuid self.dateTime = dateTime self.map = map diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift index b61db7d6e716..6365e8799f7c 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift @@ -13,7 +13,7 @@ public struct Model200Response: Codable { public var name: Int? public var _class: String? - public init(name: Int?, _class: String?) { + public init(name: Int? = nil, _class: String? = nil) { self.name = name self._class = _class } diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift index 8ab4db44b73a..5797209dce3c 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift @@ -15,7 +15,7 @@ public struct Name: Codable { public var property: String? public var _123number: Int? - public init(name: Int, snakeCase: Int?, property: String?, _123number: Int?) { + public init(name: Int, snakeCase: Int? = nil, property: String? = nil, _123number: Int? = nil) { self.name = name self.snakeCase = snakeCase self.property = property diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift index 4d1dafcc2c1f..979335c098bd 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift @@ -11,7 +11,7 @@ public struct NumberOnly: Codable { public var justNumber: Double? - public init(justNumber: Double?) { + public init(justNumber: Double? = nil) { self.justNumber = justNumber } diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift index 40c30cc8609c..f1817f7792a1 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift @@ -22,7 +22,7 @@ public struct Order: Codable { public var status: Status? public var complete: Bool? = false - public init(id: Int64?, petId: Int64?, quantity: Int?, shipDate: Date?, status: Status?, complete: Bool?) { + public init(id: Int64? = nil, petId: Int64? = nil, quantity: Int? = nil, shipDate: Date? = nil, status: Status? = nil, complete: Bool? = nil) { self.id = id self.petId = petId self.quantity = quantity diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift index 18c3a024f122..d01e8da21668 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift @@ -13,7 +13,7 @@ public struct OuterComposite: Codable { public var myString: String? public var myBoolean: Bool? - public init(myNumber: Double?, myString: String?, myBoolean: Bool?) { + public init(myNumber: Double? = nil, myString: String? = nil, myBoolean: Bool? = nil) { self.myNumber = myNumber self.myString = myString self.myBoolean = myBoolean diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift index b9ce0e933256..caea19425d85 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift @@ -22,7 +22,7 @@ public struct Pet: Codable { /** pet status in the store */ public var status: Status? - public init(id: Int64?, category: Category?, name: String, photoUrls: [String], tags: [Tag]?, status: Status?) { + public init(id: Int64? = nil, category: Category? = nil, name: String, photoUrls: [String], tags: [Tag]? = nil, status: Status? = nil) { self.id = id self.category = category self.name = name diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift index 0acd21fd1000..f643334038e2 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift @@ -12,7 +12,7 @@ public struct ReadOnlyFirst: Codable { public var bar: String? public var baz: String? - public init(bar: String?, baz: String?) { + public init(bar: String? = nil, baz: String? = nil) { self.bar = bar self.baz = baz } diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift index c223f993a69e..45479e2b0de8 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift @@ -12,7 +12,7 @@ public struct Return: Codable { public var _return: Int? - public init(_return: Int?) { + public init(_return: Int? = nil) { self._return = _return } diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift index 6e8650f76d8e..8515496eb272 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift @@ -11,7 +11,7 @@ public struct SpecialModelName: Codable { public var specialPropertyName: Int64? - public init(specialPropertyName: Int64?) { + public init(specialPropertyName: Int64? = nil) { self.specialPropertyName = specialPropertyName } diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift index 4dd8a9a9f5a0..82c02f04b69d 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift @@ -12,7 +12,7 @@ public struct Tag: Codable { public var id: Int64? public var name: String? - public init(id: Int64?, name: String?) { + public init(id: Int64? = nil, name: String? = nil) { self.id = id self.name = name } diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift index 79f271ed7356..03e2736bd234 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift @@ -19,7 +19,7 @@ public struct User: Codable { /** User Status */ public var userStatus: Int? - public init(id: Int64?, username: String?, firstName: String?, lastName: String?, email: String?, password: String?, phone: String?, userStatus: Int?) { + public init(id: Int64? = nil, username: String? = nil, firstName: String? = nil, lastName: String? = nil, email: String? = nil, password: String? = nil, phone: String? = nil, userStatus: Int? = nil) { self.id = id self.username = username self.firstName = firstName diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift index 1af031535967..81020425ad1a 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift @@ -12,7 +12,7 @@ public struct AdditionalPropertiesClass: Codable { public var mapString: [String: String]? public var mapMapString: [String: [String: String]]? - public init(mapString: [String: String]?, mapMapString: [String: [String: String]]?) { + public init(mapString: [String: String]? = nil, mapMapString: [String: [String: String]]? = nil) { self.mapString = mapString self.mapMapString = mapMapString } diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift index 5ed9f31e2a36..c34ac85ac63f 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift @@ -12,7 +12,7 @@ public struct Animal: Codable { public var className: String public var color: String? = "red" - public init(className: String, color: String?) { + public init(className: String, color: String? = nil) { self.className = className self.color = color } diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift index ec270da89074..6ad3d808a97d 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift @@ -13,7 +13,7 @@ public struct ApiResponse: Codable { public var type: String? public var message: String? - public init(code: Int?, type: String?, message: String?) { + public init(code: Int? = nil, type: String? = nil, message: String? = nil) { self.code = code self.type = type self.message = message diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift index 6c252ed475b2..6d99f90fdd19 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift @@ -11,7 +11,7 @@ public struct ArrayOfArrayOfNumberOnly: Codable { public var arrayArrayNumber: [[Double]]? - public init(arrayArrayNumber: [[Double]]?) { + public init(arrayArrayNumber: [[Double]]? = nil) { self.arrayArrayNumber = arrayArrayNumber } diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift index e84eb5d65025..d59c529ef659 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift @@ -11,7 +11,7 @@ public struct ArrayOfNumberOnly: Codable { public var arrayNumber: [Double]? - public init(arrayNumber: [Double]?) { + public init(arrayNumber: [Double]? = nil) { self.arrayNumber = arrayNumber } diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift index d2140933d181..fdab67b0c59f 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift @@ -13,7 +13,7 @@ public struct ArrayTest: Codable { public var arrayArrayOfInteger: [[Int64]]? public var arrayArrayOfModel: [[ReadOnlyFirst]]? - public init(arrayOfString: [String]?, arrayArrayOfInteger: [[Int64]]?, arrayArrayOfModel: [[ReadOnlyFirst]]?) { + public init(arrayOfString: [String]? = nil, arrayArrayOfInteger: [[Int64]]? = nil, arrayArrayOfModel: [[ReadOnlyFirst]]? = nil) { self.arrayOfString = arrayOfString self.arrayArrayOfInteger = arrayArrayOfInteger self.arrayArrayOfModel = arrayArrayOfModel diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift index d1b3b27616ed..a7f8abe97195 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift @@ -17,7 +17,7 @@ public struct Capitalization: Codable { /** Name of the pet */ public var ATT_NAME: String? - public init(smallCamel: String?, capitalCamel: String?, smallSnake: String?, capitalSnake: String?, sCAETHFlowPoints: String?, ATT_NAME: String?) { + public init(smallCamel: String? = nil, capitalCamel: String? = nil, smallSnake: String? = nil, capitalSnake: String? = nil, sCAETHFlowPoints: String? = nil, ATT_NAME: String? = nil) { self.smallCamel = smallCamel self.capitalCamel = capitalCamel self.smallSnake = smallSnake diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift index 7ab887f3113f..884020d1a72c 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift @@ -13,7 +13,7 @@ public struct Cat: Codable { public var color: String? = "red" public var declawed: Bool? - public init(className: String, color: String?, declawed: Bool?) { + public init(className: String, color: String? = nil, declawed: Bool? = nil) { self.className = className self.color = color self.declawed = declawed diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift index a51ad0dffab1..c7178efcb166 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift @@ -11,7 +11,7 @@ public struct CatAllOf: Codable { public var declawed: Bool? - public init(declawed: Bool?) { + public init(declawed: Bool? = nil) { self.declawed = declawed } diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift index eb8f7e5e1974..78bf6826d690 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift @@ -12,7 +12,7 @@ public struct Category: Codable { public var id: Int64? public var name: String = "default-name" - public init(id: Int64?, name: String) { + public init(id: Int64? = nil, name: String) { self.id = id self.name = name } diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift index e2a7d4427a06..d7299a058561 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift @@ -12,7 +12,7 @@ public struct ClassModel: Codable { public var _class: String? - public init(_class: String?) { + public init(_class: String? = nil) { self._class = _class } diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift index 00245ca37280..c8e0b51314d6 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift @@ -11,7 +11,7 @@ public struct Client: Codable { public var client: String? - public init(client: String?) { + public init(client: String? = nil) { self.client = client } diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift index 492c1228008e..e7e0efa931e8 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift @@ -13,7 +13,7 @@ public struct Dog: Codable { public var color: String? = "red" public var breed: String? - public init(className: String, color: String?, breed: String?) { + public init(className: String, color: String? = nil, breed: String? = nil) { self.className = className self.color = color self.breed = breed diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift index 7786f8acc5ae..1f61ed3c3431 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift @@ -11,7 +11,7 @@ public struct DogAllOf: Codable { public var breed: String? - public init(breed: String?) { + public init(breed: String? = nil) { self.breed = breed } diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift index 9844e7c40e35..10536376ccc6 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift @@ -20,7 +20,7 @@ public struct EnumArrays: Codable { public var justSymbol: JustSymbol? public var arrayEnum: [ArrayEnum]? - public init(justSymbol: JustSymbol?, arrayEnum: [ArrayEnum]?) { + public init(justSymbol: JustSymbol? = nil, arrayEnum: [ArrayEnum]? = nil) { self.justSymbol = justSymbol self.arrayEnum = arrayEnum } diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift index 789f583e1d77..c0d7c84b69d0 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift @@ -33,7 +33,7 @@ public struct EnumTest: Codable { public var enumNumber: EnumNumber? public var outerEnum: OuterEnum? - public init(enumString: EnumString?, enumStringRequired: EnumStringRequired, enumInteger: EnumInteger?, enumNumber: EnumNumber?, outerEnum: OuterEnum?) { + public init(enumString: EnumString? = nil, enumStringRequired: EnumStringRequired, enumInteger: EnumInteger? = nil, enumNumber: EnumNumber? = nil, outerEnum: OuterEnum? = nil) { self.enumString = enumString self.enumStringRequired = enumStringRequired self.enumInteger = enumInteger diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift index abf3ccffc485..54ffb6e70e3e 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift @@ -13,7 +13,7 @@ public struct File: Codable { /** Test capitalization */ public var sourceURI: String? - public init(sourceURI: String?) { + public init(sourceURI: String? = nil) { self.sourceURI = sourceURI } diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift index 532f1457939a..3d70ffe0a598 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift @@ -12,7 +12,7 @@ public struct FileSchemaTestClass: Codable { public var file: File? public var files: [File]? - public init(file: File?, files: [File]?) { + public init(file: File? = nil, files: [File]? = nil) { self.file = file self.files = files } diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift index 20bd6d103b3d..c934df71b34c 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift @@ -23,7 +23,7 @@ public struct FormatTest: Codable { public var uuid: UUID? public var password: String - public init(integer: Int?, int32: Int?, int64: Int64?, number: Double, float: Float?, double: Double?, string: String?, byte: Data, binary: URL?, date: Date, dateTime: Date?, uuid: UUID?, password: String) { + public init(integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, number: Double, float: Float? = nil, double: Double? = nil, string: String? = nil, byte: Data, binary: URL? = nil, date: Date, dateTime: Date? = nil, uuid: UUID? = nil, password: String) { self.integer = integer self.int32 = int32 self.int64 = int64 diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift index 906ddb06fb17..a6d3567e8859 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift @@ -12,7 +12,7 @@ public struct HasOnlyReadOnly: Codable { public var bar: String? public var foo: String? - public init(bar: String?, foo: String?) { + public init(bar: String? = nil, foo: String? = nil) { self.bar = bar self.foo = foo } diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift index fe13d302ccbf..6de49531ac1c 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift @@ -11,7 +11,7 @@ public struct List: Codable { public var _123list: String? - public init(_123list: String?) { + public init(_123list: String? = nil) { self._123list = _123list } diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift index 4b6037f378ee..a9762da61554 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift @@ -18,7 +18,7 @@ public struct MapTest: Codable { public var directMap: [String: Bool]? public var indirectMap: StringBooleanMap? - public init(mapMapOfString: [String: [String: String]]?, mapOfEnumString: [String: String]?, directMap: [String: Bool]?, indirectMap: StringBooleanMap?) { + public init(mapMapOfString: [String: [String: String]]? = nil, mapOfEnumString: [String: String]? = nil, directMap: [String: Bool]? = nil, indirectMap: StringBooleanMap? = nil) { self.mapMapOfString = mapMapOfString self.mapOfEnumString = mapOfEnumString self.directMap = directMap diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift index c3deb2f28932..f1d081064b62 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift @@ -13,7 +13,7 @@ public struct MixedPropertiesAndAdditionalPropertiesClass: Codable { public var dateTime: Date? public var map: [String: Animal]? - public init(uuid: UUID?, dateTime: Date?, map: [String: Animal]?) { + public init(uuid: UUID? = nil, dateTime: Date? = nil, map: [String: Animal]? = nil) { self.uuid = uuid self.dateTime = dateTime self.map = map diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift index b61db7d6e716..6365e8799f7c 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift @@ -13,7 +13,7 @@ public struct Model200Response: Codable { public var name: Int? public var _class: String? - public init(name: Int?, _class: String?) { + public init(name: Int? = nil, _class: String? = nil) { self.name = name self._class = _class } diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift index 8ab4db44b73a..5797209dce3c 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift @@ -15,7 +15,7 @@ public struct Name: Codable { public var property: String? public var _123number: Int? - public init(name: Int, snakeCase: Int?, property: String?, _123number: Int?) { + public init(name: Int, snakeCase: Int? = nil, property: String? = nil, _123number: Int? = nil) { self.name = name self.snakeCase = snakeCase self.property = property diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift index 4d1dafcc2c1f..979335c098bd 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift @@ -11,7 +11,7 @@ public struct NumberOnly: Codable { public var justNumber: Double? - public init(justNumber: Double?) { + public init(justNumber: Double? = nil) { self.justNumber = justNumber } diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift index 40c30cc8609c..f1817f7792a1 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift @@ -22,7 +22,7 @@ public struct Order: Codable { public var status: Status? public var complete: Bool? = false - public init(id: Int64?, petId: Int64?, quantity: Int?, shipDate: Date?, status: Status?, complete: Bool?) { + public init(id: Int64? = nil, petId: Int64? = nil, quantity: Int? = nil, shipDate: Date? = nil, status: Status? = nil, complete: Bool? = nil) { self.id = id self.petId = petId self.quantity = quantity diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift index 18c3a024f122..d01e8da21668 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift @@ -13,7 +13,7 @@ public struct OuterComposite: Codable { public var myString: String? public var myBoolean: Bool? - public init(myNumber: Double?, myString: String?, myBoolean: Bool?) { + public init(myNumber: Double? = nil, myString: String? = nil, myBoolean: Bool? = nil) { self.myNumber = myNumber self.myString = myString self.myBoolean = myBoolean diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift index b9ce0e933256..caea19425d85 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift @@ -22,7 +22,7 @@ public struct Pet: Codable { /** pet status in the store */ public var status: Status? - public init(id: Int64?, category: Category?, name: String, photoUrls: [String], tags: [Tag]?, status: Status?) { + public init(id: Int64? = nil, category: Category? = nil, name: String, photoUrls: [String], tags: [Tag]? = nil, status: Status? = nil) { self.id = id self.category = category self.name = name diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift index 0acd21fd1000..f643334038e2 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift @@ -12,7 +12,7 @@ public struct ReadOnlyFirst: Codable { public var bar: String? public var baz: String? - public init(bar: String?, baz: String?) { + public init(bar: String? = nil, baz: String? = nil) { self.bar = bar self.baz = baz } diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift index c223f993a69e..45479e2b0de8 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift @@ -12,7 +12,7 @@ public struct Return: Codable { public var _return: Int? - public init(_return: Int?) { + public init(_return: Int? = nil) { self._return = _return } diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift index 6e8650f76d8e..8515496eb272 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift @@ -11,7 +11,7 @@ public struct SpecialModelName: Codable { public var specialPropertyName: Int64? - public init(specialPropertyName: Int64?) { + public init(specialPropertyName: Int64? = nil) { self.specialPropertyName = specialPropertyName } diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift index 4dd8a9a9f5a0..82c02f04b69d 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift @@ -12,7 +12,7 @@ public struct Tag: Codable { public var id: Int64? public var name: String? - public init(id: Int64?, name: String?) { + public init(id: Int64? = nil, name: String? = nil) { self.id = id self.name = name } diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift index 79f271ed7356..03e2736bd234 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift @@ -19,7 +19,7 @@ public struct User: Codable { /** User Status */ public var userStatus: Int? - public init(id: Int64?, username: String?, firstName: String?, lastName: String?, email: String?, password: String?, phone: String?, userStatus: Int?) { + public init(id: Int64? = nil, username: String? = nil, firstName: String? = nil, lastName: String? = nil, email: String? = nil, password: String? = nil, phone: String? = nil, userStatus: Int? = nil) { self.id = id self.username = username self.firstName = firstName diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift index 1af031535967..81020425ad1a 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift @@ -12,7 +12,7 @@ public struct AdditionalPropertiesClass: Codable { public var mapString: [String: String]? public var mapMapString: [String: [String: String]]? - public init(mapString: [String: String]?, mapMapString: [String: [String: String]]?) { + public init(mapString: [String: String]? = nil, mapMapString: [String: [String: String]]? = nil) { self.mapString = mapString self.mapMapString = mapMapString } diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift index 5ed9f31e2a36..c34ac85ac63f 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift @@ -12,7 +12,7 @@ public struct Animal: Codable { public var className: String public var color: String? = "red" - public init(className: String, color: String?) { + public init(className: String, color: String? = nil) { self.className = className self.color = color } diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift index ec270da89074..6ad3d808a97d 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift @@ -13,7 +13,7 @@ public struct ApiResponse: Codable { public var type: String? public var message: String? - public init(code: Int?, type: String?, message: String?) { + public init(code: Int? = nil, type: String? = nil, message: String? = nil) { self.code = code self.type = type self.message = message diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift index 6c252ed475b2..6d99f90fdd19 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift @@ -11,7 +11,7 @@ public struct ArrayOfArrayOfNumberOnly: Codable { public var arrayArrayNumber: [[Double]]? - public init(arrayArrayNumber: [[Double]]?) { + public init(arrayArrayNumber: [[Double]]? = nil) { self.arrayArrayNumber = arrayArrayNumber } diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift index e84eb5d65025..d59c529ef659 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift @@ -11,7 +11,7 @@ public struct ArrayOfNumberOnly: Codable { public var arrayNumber: [Double]? - public init(arrayNumber: [Double]?) { + public init(arrayNumber: [Double]? = nil) { self.arrayNumber = arrayNumber } diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift index d2140933d181..fdab67b0c59f 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift @@ -13,7 +13,7 @@ public struct ArrayTest: Codable { public var arrayArrayOfInteger: [[Int64]]? public var arrayArrayOfModel: [[ReadOnlyFirst]]? - public init(arrayOfString: [String]?, arrayArrayOfInteger: [[Int64]]?, arrayArrayOfModel: [[ReadOnlyFirst]]?) { + public init(arrayOfString: [String]? = nil, arrayArrayOfInteger: [[Int64]]? = nil, arrayArrayOfModel: [[ReadOnlyFirst]]? = nil) { self.arrayOfString = arrayOfString self.arrayArrayOfInteger = arrayArrayOfInteger self.arrayArrayOfModel = arrayArrayOfModel diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift index d1b3b27616ed..a7f8abe97195 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift @@ -17,7 +17,7 @@ public struct Capitalization: Codable { /** Name of the pet */ public var ATT_NAME: String? - public init(smallCamel: String?, capitalCamel: String?, smallSnake: String?, capitalSnake: String?, sCAETHFlowPoints: String?, ATT_NAME: String?) { + public init(smallCamel: String? = nil, capitalCamel: String? = nil, smallSnake: String? = nil, capitalSnake: String? = nil, sCAETHFlowPoints: String? = nil, ATT_NAME: String? = nil) { self.smallCamel = smallCamel self.capitalCamel = capitalCamel self.smallSnake = smallSnake diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift index 7ab887f3113f..884020d1a72c 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift @@ -13,7 +13,7 @@ public struct Cat: Codable { public var color: String? = "red" public var declawed: Bool? - public init(className: String, color: String?, declawed: Bool?) { + public init(className: String, color: String? = nil, declawed: Bool? = nil) { self.className = className self.color = color self.declawed = declawed diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift index a51ad0dffab1..c7178efcb166 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift @@ -11,7 +11,7 @@ public struct CatAllOf: Codable { public var declawed: Bool? - public init(declawed: Bool?) { + public init(declawed: Bool? = nil) { self.declawed = declawed } diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Category.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Category.swift index eb8f7e5e1974..78bf6826d690 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Category.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Category.swift @@ -12,7 +12,7 @@ public struct Category: Codable { public var id: Int64? public var name: String = "default-name" - public init(id: Int64?, name: String) { + public init(id: Int64? = nil, name: String) { self.id = id self.name = name } diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift index e2a7d4427a06..d7299a058561 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift @@ -12,7 +12,7 @@ public struct ClassModel: Codable { public var _class: String? - public init(_class: String?) { + public init(_class: String? = nil) { self._class = _class } diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Client.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Client.swift index 00245ca37280..c8e0b51314d6 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Client.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Client.swift @@ -11,7 +11,7 @@ public struct Client: Codable { public var client: String? - public init(client: String?) { + public init(client: String? = nil) { self.client = client } diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift index 492c1228008e..e7e0efa931e8 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift @@ -13,7 +13,7 @@ public struct Dog: Codable { public var color: String? = "red" public var breed: String? - public init(className: String, color: String?, breed: String?) { + public init(className: String, color: String? = nil, breed: String? = nil) { self.className = className self.color = color self.breed = breed diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift index 7786f8acc5ae..1f61ed3c3431 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift @@ -11,7 +11,7 @@ public struct DogAllOf: Codable { public var breed: String? - public init(breed: String?) { + public init(breed: String? = nil) { self.breed = breed } diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift index 9844e7c40e35..10536376ccc6 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift @@ -20,7 +20,7 @@ public struct EnumArrays: Codable { public var justSymbol: JustSymbol? public var arrayEnum: [ArrayEnum]? - public init(justSymbol: JustSymbol?, arrayEnum: [ArrayEnum]?) { + public init(justSymbol: JustSymbol? = nil, arrayEnum: [ArrayEnum]? = nil) { self.justSymbol = justSymbol self.arrayEnum = arrayEnum } diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift index 789f583e1d77..c0d7c84b69d0 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift @@ -33,7 +33,7 @@ public struct EnumTest: Codable { public var enumNumber: EnumNumber? public var outerEnum: OuterEnum? - public init(enumString: EnumString?, enumStringRequired: EnumStringRequired, enumInteger: EnumInteger?, enumNumber: EnumNumber?, outerEnum: OuterEnum?) { + public init(enumString: EnumString? = nil, enumStringRequired: EnumStringRequired, enumInteger: EnumInteger? = nil, enumNumber: EnumNumber? = nil, outerEnum: OuterEnum? = nil) { self.enumString = enumString self.enumStringRequired = enumStringRequired self.enumInteger = enumInteger diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/File.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/File.swift index abf3ccffc485..54ffb6e70e3e 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/File.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/File.swift @@ -13,7 +13,7 @@ public struct File: Codable { /** Test capitalization */ public var sourceURI: String? - public init(sourceURI: String?) { + public init(sourceURI: String? = nil) { self.sourceURI = sourceURI } diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift index 532f1457939a..3d70ffe0a598 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift @@ -12,7 +12,7 @@ public struct FileSchemaTestClass: Codable { public var file: File? public var files: [File]? - public init(file: File?, files: [File]?) { + public init(file: File? = nil, files: [File]? = nil) { self.file = file self.files = files } diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift index 20bd6d103b3d..c934df71b34c 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift @@ -23,7 +23,7 @@ public struct FormatTest: Codable { public var uuid: UUID? public var password: String - public init(integer: Int?, int32: Int?, int64: Int64?, number: Double, float: Float?, double: Double?, string: String?, byte: Data, binary: URL?, date: Date, dateTime: Date?, uuid: UUID?, password: String) { + public init(integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, number: Double, float: Float? = nil, double: Double? = nil, string: String? = nil, byte: Data, binary: URL? = nil, date: Date, dateTime: Date? = nil, uuid: UUID? = nil, password: String) { self.integer = integer self.int32 = int32 self.int64 = int64 diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift index 906ddb06fb17..a6d3567e8859 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift @@ -12,7 +12,7 @@ public struct HasOnlyReadOnly: Codable { public var bar: String? public var foo: String? - public init(bar: String?, foo: String?) { + public init(bar: String? = nil, foo: String? = nil) { self.bar = bar self.foo = foo } diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/List.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/List.swift index fe13d302ccbf..6de49531ac1c 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/List.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/List.swift @@ -11,7 +11,7 @@ public struct List: Codable { public var _123list: String? - public init(_123list: String?) { + public init(_123list: String? = nil) { self._123list = _123list } diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift index 4b6037f378ee..a9762da61554 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift @@ -18,7 +18,7 @@ public struct MapTest: Codable { public var directMap: [String: Bool]? public var indirectMap: StringBooleanMap? - public init(mapMapOfString: [String: [String: String]]?, mapOfEnumString: [String: String]?, directMap: [String: Bool]?, indirectMap: StringBooleanMap?) { + public init(mapMapOfString: [String: [String: String]]? = nil, mapOfEnumString: [String: String]? = nil, directMap: [String: Bool]? = nil, indirectMap: StringBooleanMap? = nil) { self.mapMapOfString = mapMapOfString self.mapOfEnumString = mapOfEnumString self.directMap = directMap diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift index c3deb2f28932..f1d081064b62 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift @@ -13,7 +13,7 @@ public struct MixedPropertiesAndAdditionalPropertiesClass: Codable { public var dateTime: Date? public var map: [String: Animal]? - public init(uuid: UUID?, dateTime: Date?, map: [String: Animal]?) { + public init(uuid: UUID? = nil, dateTime: Date? = nil, map: [String: Animal]? = nil) { self.uuid = uuid self.dateTime = dateTime self.map = map diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift index b61db7d6e716..6365e8799f7c 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift @@ -13,7 +13,7 @@ public struct Model200Response: Codable { public var name: Int? public var _class: String? - public init(name: Int?, _class: String?) { + public init(name: Int? = nil, _class: String? = nil) { self.name = name self._class = _class } diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Name.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Name.swift index 8ab4db44b73a..5797209dce3c 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Name.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Name.swift @@ -15,7 +15,7 @@ public struct Name: Codable { public var property: String? public var _123number: Int? - public init(name: Int, snakeCase: Int?, property: String?, _123number: Int?) { + public init(name: Int, snakeCase: Int? = nil, property: String? = nil, _123number: Int? = nil) { self.name = name self.snakeCase = snakeCase self.property = property diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift index 4d1dafcc2c1f..979335c098bd 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift @@ -11,7 +11,7 @@ public struct NumberOnly: Codable { public var justNumber: Double? - public init(justNumber: Double?) { + public init(justNumber: Double? = nil) { self.justNumber = justNumber } diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Order.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Order.swift index 40c30cc8609c..f1817f7792a1 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Order.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Order.swift @@ -22,7 +22,7 @@ public struct Order: Codable { public var status: Status? public var complete: Bool? = false - public init(id: Int64?, petId: Int64?, quantity: Int?, shipDate: Date?, status: Status?, complete: Bool?) { + public init(id: Int64? = nil, petId: Int64? = nil, quantity: Int? = nil, shipDate: Date? = nil, status: Status? = nil, complete: Bool? = nil) { self.id = id self.petId = petId self.quantity = quantity diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift index 18c3a024f122..d01e8da21668 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift @@ -13,7 +13,7 @@ public struct OuterComposite: Codable { public var myString: String? public var myBoolean: Bool? - public init(myNumber: Double?, myString: String?, myBoolean: Bool?) { + public init(myNumber: Double? = nil, myString: String? = nil, myBoolean: Bool? = nil) { self.myNumber = myNumber self.myString = myString self.myBoolean = myBoolean diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift index b9ce0e933256..caea19425d85 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift @@ -22,7 +22,7 @@ public struct Pet: Codable { /** pet status in the store */ public var status: Status? - public init(id: Int64?, category: Category?, name: String, photoUrls: [String], tags: [Tag]?, status: Status?) { + public init(id: Int64? = nil, category: Category? = nil, name: String, photoUrls: [String], tags: [Tag]? = nil, status: Status? = nil) { self.id = id self.category = category self.name = name diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift index 0acd21fd1000..f643334038e2 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift @@ -12,7 +12,7 @@ public struct ReadOnlyFirst: Codable { public var bar: String? public var baz: String? - public init(bar: String?, baz: String?) { + public init(bar: String? = nil, baz: String? = nil) { self.bar = bar self.baz = baz } diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Return.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Return.swift index c223f993a69e..45479e2b0de8 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Return.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Return.swift @@ -12,7 +12,7 @@ public struct Return: Codable { public var _return: Int? - public init(_return: Int?) { + public init(_return: Int? = nil) { self._return = _return } diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift index 6e8650f76d8e..8515496eb272 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift @@ -11,7 +11,7 @@ public struct SpecialModelName: Codable { public var specialPropertyName: Int64? - public init(specialPropertyName: Int64?) { + public init(specialPropertyName: Int64? = nil) { self.specialPropertyName = specialPropertyName } diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift index 4dd8a9a9f5a0..82c02f04b69d 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift @@ -12,7 +12,7 @@ public struct Tag: Codable { public var id: Int64? public var name: String? - public init(id: Int64?, name: String?) { + public init(id: Int64? = nil, name: String? = nil) { self.id = id self.name = name } diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/User.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/User.swift index 79f271ed7356..03e2736bd234 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/User.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/User.swift @@ -19,7 +19,7 @@ public struct User: Codable { /** User Status */ public var userStatus: Int? - public init(id: Int64?, username: String?, firstName: String?, lastName: String?, email: String?, password: String?, phone: String?, userStatus: Int?) { + public init(id: Int64? = nil, username: String? = nil, firstName: String? = nil, lastName: String? = nil, email: String? = nil, password: String? = nil, phone: String? = nil, userStatus: Int? = nil) { self.id = id self.username = username self.firstName = firstName diff --git a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift index e74820fd28ac..0d028ae6dfa3 100644 --- a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift +++ b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift @@ -14,7 +14,7 @@ public struct ApiResponse: Codable { public var type: String? public var message: String? - public init(code: Int?, type: String?, message: String?) { + public init(code: Int? = nil, type: String? = nil, message: String? = nil) { self.code = code self.type = type self.message = message diff --git a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/Category.swift b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/Category.swift index fec18cc7a6c7..cce4425f2e0d 100644 --- a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/Category.swift +++ b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/Category.swift @@ -13,7 +13,7 @@ public struct Category: Codable { public var id: Int64? public var name: String? - public init(id: Int64?, name: String?) { + public init(id: Int64? = nil, name: String? = nil) { self.id = id self.name = name } diff --git a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/InlineObject.swift b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/InlineObject.swift index ac5216fe6876..105118c79fb6 100644 --- a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/InlineObject.swift +++ b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/InlineObject.swift @@ -14,7 +14,7 @@ public struct InlineObject: Codable { /** Updated status of the pet */ public var status: String? - public init(name: String?, status: String?) { + public init(name: String? = nil, status: String? = nil) { self.name = name self.status = status } diff --git a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/InlineObject1.swift b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/InlineObject1.swift index 1c2fd3255dd1..b19120339cdf 100644 --- a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/InlineObject1.swift +++ b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/InlineObject1.swift @@ -14,7 +14,7 @@ public struct InlineObject1: Codable { /** file to upload */ public var file: URL? - public init(additionalMetadata: String?, file: URL?) { + public init(additionalMetadata: String? = nil, file: URL? = nil) { self.additionalMetadata = additionalMetadata self.file = file } diff --git a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/Order.swift b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/Order.swift index 1fa6995d1c7b..f3d9fcb15fb0 100644 --- a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/Order.swift +++ b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/Order.swift @@ -24,7 +24,7 @@ public struct Order: Codable { public var status: Status? public var complete: Bool? = false - public init(id: Int64?, petId: Int64?, quantity: Int?, shipDate: Date?, status: Status?, complete: Bool?) { + public init(id: Int64? = nil, petId: Int64? = nil, quantity: Int? = nil, shipDate: Date? = nil, status: Status? = nil, complete: Bool? = nil) { self.id = id self.petId = petId self.quantity = quantity diff --git a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift index 622f2c9bd432..cb69946cd9fb 100644 --- a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift +++ b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift @@ -25,7 +25,7 @@ public struct Pet: Codable { /** pet status in the store */ public var status: Status? - public init(id: Int64?, category: Category?, name: String?, photoUrls: [String], tags: [Tag]?, status: Status?) { + public init(id: Int64? = nil, category: Category? = nil, name: String?, photoUrls: [String], tags: [Tag]? = nil, status: Status? = nil) { self.id = id self.category = category self.name = name diff --git a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift index 98a78982e592..a8aec56825c1 100644 --- a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift +++ b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift @@ -13,7 +13,7 @@ public struct Tag: Codable { public var id: Int64? public var name: String? - public init(id: Int64?, name: String?) { + public init(id: Int64? = nil, name: String? = nil) { self.id = id self.name = name } diff --git a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/User.swift b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/User.swift index 4e42f6f28595..a9856d0c2507 100644 --- a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/User.swift +++ b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/User.swift @@ -20,7 +20,7 @@ public struct User: Codable { /** User Status */ public var userStatus: Int? - public init(id: Int64?, username: String?, firstName: String?, lastName: String?, email: String?, password: String?, phone: String?, userStatus: Int?) { + public init(id: Int64? = nil, username: String? = nil, firstName: String? = nil, lastName: String? = nil, email: String? = nil, password: String? = nil, phone: String? = nil, userStatus: Int? = nil) { self.id = id self.username = username self.firstName = firstName diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift index b4d5ae6faf93..09e6ebc4b495 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift @@ -12,7 +12,7 @@ internal struct AdditionalPropertiesClass: Codable { internal var mapString: [String: String]? internal var mapMapString: [String: [String: String]]? - internal init(mapString: [String: String]?, mapMapString: [String: [String: String]]?) { + internal init(mapString: [String: String]? = nil, mapMapString: [String: [String: String]]? = nil) { self.mapString = mapString self.mapMapString = mapMapString } diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift index ada7f86de509..1bafc8ada6f3 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift @@ -12,7 +12,7 @@ internal struct Animal: Codable { internal var className: String internal var color: String? = "red" - internal init(className: String, color: String?) { + internal init(className: String, color: String? = nil) { self.className = className self.color = color } diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift index b60d8999b4b2..fc77d48b36b2 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift @@ -13,7 +13,7 @@ internal struct ApiResponse: Codable { internal var type: String? internal var message: String? - internal init(code: Int?, type: String?, message: String?) { + internal init(code: Int? = nil, type: String? = nil, message: String? = nil) { self.code = code self.type = type self.message = message diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift index 67371b816b30..439da58f805b 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift @@ -11,7 +11,7 @@ internal struct ArrayOfArrayOfNumberOnly: Codable { internal var arrayArrayNumber: [[Double]]? - internal init(arrayArrayNumber: [[Double]]?) { + internal init(arrayArrayNumber: [[Double]]? = nil) { self.arrayArrayNumber = arrayArrayNumber } diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift index 2c7047eac4b0..30de538bcdd0 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift @@ -11,7 +11,7 @@ internal struct ArrayOfNumberOnly: Codable { internal var arrayNumber: [Double]? - internal init(arrayNumber: [Double]?) { + internal init(arrayNumber: [Double]? = nil) { self.arrayNumber = arrayNumber } diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift index 9c3a3a9f5e1f..eaa2955731dc 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift @@ -13,7 +13,7 @@ internal struct ArrayTest: Codable { internal var arrayArrayOfInteger: [[Int64]]? internal var arrayArrayOfModel: [[ReadOnlyFirst]]? - internal init(arrayOfString: [String]?, arrayArrayOfInteger: [[Int64]]?, arrayArrayOfModel: [[ReadOnlyFirst]]?) { + internal init(arrayOfString: [String]? = nil, arrayArrayOfInteger: [[Int64]]? = nil, arrayArrayOfModel: [[ReadOnlyFirst]]? = nil) { self.arrayOfString = arrayOfString self.arrayArrayOfInteger = arrayArrayOfInteger self.arrayArrayOfModel = arrayArrayOfModel diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift index 965ec5aefba3..2671163a05c0 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift @@ -17,7 +17,7 @@ internal struct Capitalization: Codable { /** Name of the pet */ internal var ATT_NAME: String? - internal init(smallCamel: String?, capitalCamel: String?, smallSnake: String?, capitalSnake: String?, sCAETHFlowPoints: String?, ATT_NAME: String?) { + internal init(smallCamel: String? = nil, capitalCamel: String? = nil, smallSnake: String? = nil, capitalSnake: String? = nil, sCAETHFlowPoints: String? = nil, ATT_NAME: String? = nil) { self.smallCamel = smallCamel self.capitalCamel = capitalCamel self.smallSnake = smallSnake diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift index 8a603dee5f1f..0959d1301da7 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift @@ -13,7 +13,7 @@ internal struct Cat: Codable { internal var color: String? = "red" internal var declawed: Bool? - internal init(className: String, color: String?, declawed: Bool?) { + internal init(className: String, color: String? = nil, declawed: Bool? = nil) { self.className = className self.color = color self.declawed = declawed diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift index 45b7dbb26dcf..83f120f746b5 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift @@ -11,7 +11,7 @@ internal struct CatAllOf: Codable { internal var declawed: Bool? - internal init(declawed: Bool?) { + internal init(declawed: Bool? = nil) { self.declawed = declawed } diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Category.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Category.swift index 849bf788dfb3..5910c7e82cef 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Category.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Category.swift @@ -12,7 +12,7 @@ internal struct Category: Codable { internal var id: Int64? internal var name: String = "default-name" - internal init(id: Int64?, name: String) { + internal init(id: Int64? = nil, name: String) { self.id = id self.name = name } diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift index 0f1bc19fe595..7fc865ea3d43 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift @@ -12,7 +12,7 @@ internal struct ClassModel: Codable { internal var _class: String? - internal init(_class: String?) { + internal init(_class: String? = nil) { self._class = _class } diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Client.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Client.swift index ddee836043fa..59724d8cdb67 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Client.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Client.swift @@ -11,7 +11,7 @@ internal struct Client: Codable { internal var client: String? - internal init(client: String?) { + internal init(client: String? = nil) { self.client = client } diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift index 6b5250de4a4a..2af5a26ba541 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift @@ -13,7 +13,7 @@ internal struct Dog: Codable { internal var color: String? = "red" internal var breed: String? - internal init(className: String, color: String?, breed: String?) { + internal init(className: String, color: String? = nil, breed: String? = nil) { self.className = className self.color = color self.breed = breed diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift index ef3ff7f1d78b..11b13c686cda 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift @@ -11,7 +11,7 @@ internal struct DogAllOf: Codable { internal var breed: String? - internal init(breed: String?) { + internal init(breed: String? = nil) { self.breed = breed } diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift index bb9f64cfb438..71a14c425db9 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift @@ -20,7 +20,7 @@ internal struct EnumArrays: Codable { internal var justSymbol: JustSymbol? internal var arrayEnum: [ArrayEnum]? - internal init(justSymbol: JustSymbol?, arrayEnum: [ArrayEnum]?) { + internal init(justSymbol: JustSymbol? = nil, arrayEnum: [ArrayEnum]? = nil) { self.justSymbol = justSymbol self.arrayEnum = arrayEnum } diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift index 421aa5436b04..7fc50b1d9adb 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift @@ -33,7 +33,7 @@ internal struct EnumTest: Codable { internal var enumNumber: EnumNumber? internal var outerEnum: OuterEnum? - internal init(enumString: EnumString?, enumStringRequired: EnumStringRequired, enumInteger: EnumInteger?, enumNumber: EnumNumber?, outerEnum: OuterEnum?) { + internal init(enumString: EnumString? = nil, enumStringRequired: EnumStringRequired, enumInteger: EnumInteger? = nil, enumNumber: EnumNumber? = nil, outerEnum: OuterEnum? = nil) { self.enumString = enumString self.enumStringRequired = enumStringRequired self.enumInteger = enumInteger diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/File.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/File.swift index 632402fb9e03..9eec1bbe3cea 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/File.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/File.swift @@ -13,7 +13,7 @@ internal struct File: Codable { /** Test capitalization */ internal var sourceURI: String? - internal init(sourceURI: String?) { + internal init(sourceURI: String? = nil) { self.sourceURI = sourceURI } diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift index e478e6c4b7d1..1561814449a1 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift @@ -12,7 +12,7 @@ internal struct FileSchemaTestClass: Codable { internal var file: File? internal var files: [File]? - internal init(file: File?, files: [File]?) { + internal init(file: File? = nil, files: [File]? = nil) { self.file = file self.files = files } diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift index 23395c93b569..1fdef5a2da1e 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift @@ -23,7 +23,7 @@ internal struct FormatTest: Codable { internal var uuid: UUID? internal var password: String - internal init(integer: Int?, int32: Int?, int64: Int64?, number: Double, float: Float?, double: Double?, string: String?, byte: Data, binary: URL?, date: Date, dateTime: Date?, uuid: UUID?, password: String) { + internal init(integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, number: Double, float: Float? = nil, double: Double? = nil, string: String? = nil, byte: Data, binary: URL? = nil, date: Date, dateTime: Date? = nil, uuid: UUID? = nil, password: String) { self.integer = integer self.int32 = int32 self.int64 = int64 diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift index 831963ba2ed2..d32e73c16cec 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift @@ -12,7 +12,7 @@ internal struct HasOnlyReadOnly: Codable { internal var bar: String? internal var foo: String? - internal init(bar: String?, foo: String?) { + internal init(bar: String? = nil, foo: String? = nil) { self.bar = bar self.foo = foo } diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/List.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/List.swift index c5960de21513..ecbe69589ca5 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/List.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/List.swift @@ -11,7 +11,7 @@ internal struct List: Codable { internal var _123list: String? - internal init(_123list: String?) { + internal init(_123list: String? = nil) { self._123list = _123list } diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift index db4f8f436aa5..def9e790c872 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift @@ -18,7 +18,7 @@ internal struct MapTest: Codable { internal var directMap: [String: Bool]? internal var indirectMap: StringBooleanMap? - internal init(mapMapOfString: [String: [String: String]]?, mapOfEnumString: [String: String]?, directMap: [String: Bool]?, indirectMap: StringBooleanMap?) { + internal init(mapMapOfString: [String: [String: String]]? = nil, mapOfEnumString: [String: String]? = nil, directMap: [String: Bool]? = nil, indirectMap: StringBooleanMap? = nil) { self.mapMapOfString = mapMapOfString self.mapOfEnumString = mapOfEnumString self.directMap = directMap diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift index c71bb9256b0a..2051ee9029a6 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift @@ -13,7 +13,7 @@ internal struct MixedPropertiesAndAdditionalPropertiesClass: Codable { internal var dateTime: Date? internal var map: [String: Animal]? - internal init(uuid: UUID?, dateTime: Date?, map: [String: Animal]?) { + internal init(uuid: UUID? = nil, dateTime: Date? = nil, map: [String: Animal]? = nil) { self.uuid = uuid self.dateTime = dateTime self.map = map diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift index 5d31a885f751..4a8f23355764 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift @@ -13,7 +13,7 @@ internal struct Model200Response: Codable { internal var name: Int? internal var _class: String? - internal init(name: Int?, _class: String?) { + internal init(name: Int? = nil, _class: String? = nil) { self.name = name self._class = _class } diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Name.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Name.swift index 2aa8fb1524c3..68c69c938f28 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Name.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Name.swift @@ -15,7 +15,7 @@ internal struct Name: Codable { internal var property: String? internal var _123number: Int? - internal init(name: Int, snakeCase: Int?, property: String?, _123number: Int?) { + internal init(name: Int, snakeCase: Int? = nil, property: String? = nil, _123number: Int? = nil) { self.name = name self.snakeCase = snakeCase self.property = property diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift index 49d73706e398..e85566c5faf2 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift @@ -11,7 +11,7 @@ internal struct NumberOnly: Codable { internal var justNumber: Double? - internal init(justNumber: Double?) { + internal init(justNumber: Double? = nil) { self.justNumber = justNumber } diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Order.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Order.swift index dcefb40efa2b..e29eae4ef78f 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Order.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Order.swift @@ -22,7 +22,7 @@ internal struct Order: Codable { internal var status: Status? internal var complete: Bool? = false - internal init(id: Int64?, petId: Int64?, quantity: Int?, shipDate: Date?, status: Status?, complete: Bool?) { + internal init(id: Int64? = nil, petId: Int64? = nil, quantity: Int? = nil, shipDate: Date? = nil, status: Status? = nil, complete: Bool? = nil) { self.id = id self.petId = petId self.quantity = quantity diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift index c61c2c4a4620..26fde8ac39af 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift @@ -13,7 +13,7 @@ internal struct OuterComposite: Codable { internal var myString: String? internal var myBoolean: Bool? - internal init(myNumber: Double?, myString: String?, myBoolean: Bool?) { + internal init(myNumber: Double? = nil, myString: String? = nil, myBoolean: Bool? = nil) { self.myNumber = myNumber self.myString = myString self.myBoolean = myBoolean diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift index b71700544d06..6d0dee3d3d39 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift @@ -22,7 +22,7 @@ internal struct Pet: Codable { /** pet status in the store */ internal var status: Status? - internal init(id: Int64?, category: Category?, name: String, photoUrls: [String], tags: [Tag]?, status: Status?) { + internal init(id: Int64? = nil, category: Category? = nil, name: String, photoUrls: [String], tags: [Tag]? = nil, status: Status? = nil) { self.id = id self.category = category self.name = name diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift index d02c6cc5fd9f..c60dbfc84660 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift @@ -12,7 +12,7 @@ internal struct ReadOnlyFirst: Codable { internal var bar: String? internal var baz: String? - internal init(bar: String?, baz: String?) { + internal init(bar: String? = nil, baz: String? = nil) { self.bar = bar self.baz = baz } diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Return.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Return.swift index 95a18b571ade..f1ca7ea2b280 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Return.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Return.swift @@ -12,7 +12,7 @@ internal struct Return: Codable { internal var _return: Int? - internal init(_return: Int?) { + internal init(_return: Int? = nil) { self._return = _return } diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift index b6ac3651f0e7..e48bb1e791b5 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift @@ -11,7 +11,7 @@ internal struct SpecialModelName: Codable { internal var specialPropertyName: Int64? - internal init(specialPropertyName: Int64?) { + internal init(specialPropertyName: Int64? = nil) { self.specialPropertyName = specialPropertyName } diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift index 1e4de951fb2c..9ef32df964c6 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift @@ -12,7 +12,7 @@ internal struct Tag: Codable { internal var id: Int64? internal var name: String? - internal init(id: Int64?, name: String?) { + internal init(id: Int64? = nil, name: String? = nil) { self.id = id self.name = name } diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/User.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/User.swift index ada8a7f82d96..bd8c6e5d6832 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/User.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/User.swift @@ -19,7 +19,7 @@ internal struct User: Codable { /** User Status */ internal var userStatus: Int? - internal init(id: Int64?, username: String?, firstName: String?, lastName: String?, email: String?, password: String?, phone: String?, userStatus: Int?) { + internal init(id: Int64? = nil, username: String? = nil, firstName: String? = nil, lastName: String? = nil, email: String? = nil, password: String? = nil, phone: String? = nil, userStatus: Int? = nil) { self.id = id self.username = username self.firstName = firstName diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift index e184d7691799..620f778bcc9a 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift @@ -12,7 +12,7 @@ import Foundation public var mapString: [String: String]? public var mapMapString: [String: [String: String]]? - public init(mapString: [String: String]?, mapMapString: [String: [String: String]]?) { + public init(mapString: [String: String]? = nil, mapMapString: [String: [String: String]]? = nil) { self.mapString = mapString self.mapMapString = mapMapString } diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift index 88152934da2b..e870a6023c6e 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift @@ -12,7 +12,7 @@ import Foundation public var _className: String public var color: String? = "red" - public init(_className: String, color: String?) { + public init(_className: String, color: String? = nil) { self._className = _className self.color = color } diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift index d0fcd4368854..38334c39011c 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift @@ -18,7 +18,7 @@ import Foundation public var type: String? public var message: String? - public init(code: Int?, type: String?, message: String?) { + public init(code: Int? = nil, type: String? = nil, message: String? = nil) { self.code = code self.type = type self.message = message diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift index 9e3f3aba246a..8ef73e96f019 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift @@ -11,7 +11,7 @@ import Foundation public var arrayArrayNumber: [[Double]]? - public init(arrayArrayNumber: [[Double]]?) { + public init(arrayArrayNumber: [[Double]]? = nil) { self.arrayArrayNumber = arrayArrayNumber } diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift index d287cc1563aa..dd95bb5be0cd 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift @@ -11,7 +11,7 @@ import Foundation public var arrayNumber: [Double]? - public init(arrayNumber: [Double]?) { + public init(arrayNumber: [Double]? = nil) { self.arrayNumber = arrayNumber } diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift index dcc3e9c3dd51..7b93023aa354 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift @@ -13,7 +13,7 @@ import Foundation public var arrayArrayOfInteger: [[Int64]]? public var arrayArrayOfModel: [[ReadOnlyFirst]]? - public init(arrayOfString: [String]?, arrayArrayOfInteger: [[Int64]]?, arrayArrayOfModel: [[ReadOnlyFirst]]?) { + public init(arrayOfString: [String]? = nil, arrayArrayOfInteger: [[Int64]]? = nil, arrayArrayOfModel: [[ReadOnlyFirst]]? = nil) { self.arrayOfString = arrayOfString self.arrayArrayOfInteger = arrayArrayOfInteger self.arrayArrayOfModel = arrayArrayOfModel diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift index 80a5667445f2..2b42d0b45862 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift @@ -17,7 +17,7 @@ import Foundation /** Name of the pet */ public var ATT_NAME: String? - public init(smallCamel: String?, capitalCamel: String?, smallSnake: String?, capitalSnake: String?, sCAETHFlowPoints: String?, ATT_NAME: String?) { + public init(smallCamel: String? = nil, capitalCamel: String? = nil, smallSnake: String? = nil, capitalSnake: String? = nil, sCAETHFlowPoints: String? = nil, ATT_NAME: String? = nil) { self.smallCamel = smallCamel self.capitalCamel = capitalCamel self.smallSnake = smallSnake diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift index 78de5a909f54..4368187bfba7 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift @@ -18,7 +18,7 @@ import Foundation } } - public init(_className: String, color: String?, declawed: Bool?) { + public init(_className: String, color: String? = nil, declawed: Bool? = nil) { self._className = _className self.color = color self.declawed = declawed diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift index ef8cec45aff1..6a4b10e996c1 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift @@ -16,7 +16,7 @@ import Foundation } } - public init(declawed: Bool?) { + public init(declawed: Bool? = nil) { self.declawed = declawed } diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Category.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Category.swift index 0610c10c982f..b5b8b86b56b1 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Category.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Category.swift @@ -17,7 +17,7 @@ import Foundation } public var name: String = "default-name" - public init(_id: Int64?, name: String) { + public init(_id: Int64? = nil, name: String) { self._id = _id self.name = name } diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift index 4197ffcaed6c..2005900e6b52 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift @@ -13,7 +13,7 @@ import Foundation public var _class: String? - public init(_class: String?) { + public init(_class: String? = nil) { self._class = _class } diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Client.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Client.swift index 517dbbba2ec2..4c1efdd41407 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Client.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Client.swift @@ -11,7 +11,7 @@ import Foundation public var client: String? - public init(client: String?) { + public init(client: String? = nil) { self.client = client } diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift index 37733cd1f3be..a55d537695d9 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift @@ -13,7 +13,7 @@ import Foundation public var color: String? = "red" public var breed: String? - public init(_className: String, color: String?, breed: String?) { + public init(_className: String, color: String? = nil, breed: String? = nil) { self._className = _className self.color = color self.breed = breed diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift index 73fd1822725c..41c63007088d 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift @@ -11,7 +11,7 @@ import Foundation public var breed: String? - public init(breed: String?) { + public init(breed: String? = nil) { self.breed = breed } diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift index 034a58c6c0eb..6e8c9d0f9abc 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift @@ -20,7 +20,7 @@ import Foundation public var justSymbol: JustSymbol? public var arrayEnum: [ArrayEnum]? - public init(justSymbol: JustSymbol?, arrayEnum: [ArrayEnum]?) { + public init(justSymbol: JustSymbol? = nil, arrayEnum: [ArrayEnum]? = nil) { self.justSymbol = justSymbol self.arrayEnum = arrayEnum } diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift index ce3a03006097..dd3e83306c3d 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift @@ -33,7 +33,7 @@ import Foundation public var enumNumber: EnumNumber? public var outerEnum: OuterEnum? - public init(enumString: EnumString?, enumStringRequired: EnumStringRequired, enumInteger: EnumInteger?, enumNumber: EnumNumber?, outerEnum: OuterEnum?) { + public init(enumString: EnumString? = nil, enumStringRequired: EnumStringRequired, enumInteger: EnumInteger? = nil, enumNumber: EnumNumber? = nil, outerEnum: OuterEnum? = nil) { self.enumString = enumString self.enumStringRequired = enumStringRequired self.enumInteger = enumInteger diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/File.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/File.swift index 7a320c177d38..4c6ab7da6c89 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/File.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/File.swift @@ -14,7 +14,7 @@ import Foundation /** Test capitalization */ public var sourceURI: String? - public init(sourceURI: String?) { + public init(sourceURI: String? = nil) { self.sourceURI = sourceURI } diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift index a6437b4fe901..be5963357fdc 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift @@ -12,7 +12,7 @@ import Foundation public var file: File? public var files: [File]? - public init(file: File?, files: [File]?) { + public init(file: File? = nil, files: [File]? = nil) { self.file = file self.files = files } diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift index df2c46d3757b..84f419103a41 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift @@ -48,7 +48,7 @@ import Foundation public var uuid: UUID? public var password: String - public init(integer: Int?, int32: Int?, int64: Int64?, number: Double, float: Float?, double: Double?, string: String?, byte: Data, binary: URL?, date: Date, dateTime: Date?, uuid: UUID?, password: String) { + public init(integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, number: Double, float: Float? = nil, double: Double? = nil, string: String? = nil, byte: Data, binary: URL? = nil, date: Date, dateTime: Date? = nil, uuid: UUID? = nil, password: String) { self.integer = integer self.int32 = int32 self.int64 = int64 diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift index b9f5b39117d7..7ca91927af7e 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift @@ -12,7 +12,7 @@ import Foundation public var bar: String? public var foo: String? - public init(bar: String?, foo: String?) { + public init(bar: String? = nil, foo: String? = nil) { self.bar = bar self.foo = foo } diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/List.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/List.swift index 826dc9e27f2b..7a977c19c7c7 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/List.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/List.swift @@ -11,7 +11,7 @@ import Foundation public var _123list: String? - public init(_123list: String?) { + public init(_123list: String? = nil) { self._123list = _123list } diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift index 2b97660b80e8..ba407e3ea25d 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift @@ -18,7 +18,7 @@ import Foundation public var directMap: [String: Bool]? public var indirectMap: StringBooleanMap? - public init(mapMapOfString: [String: [String: String]]?, mapOfEnumString: [String: String]?, directMap: [String: Bool]?, indirectMap: StringBooleanMap?) { + public init(mapMapOfString: [String: [String: String]]? = nil, mapOfEnumString: [String: String]? = nil, directMap: [String: Bool]? = nil, indirectMap: StringBooleanMap? = nil) { self.mapMapOfString = mapMapOfString self.mapOfEnumString = mapOfEnumString self.directMap = directMap diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift index e10adad0a7e1..bd503cb36fce 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift @@ -13,7 +13,7 @@ import Foundation public var dateTime: Date? public var map: [String: Animal]? - public init(uuid: UUID?, dateTime: Date?, map: [String: Animal]?) { + public init(uuid: UUID? = nil, dateTime: Date? = nil, map: [String: Animal]? = nil) { self.uuid = uuid self.dateTime = dateTime self.map = map diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift index 1c5410f61dde..6814183719d9 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift @@ -19,7 +19,7 @@ import Foundation } public var _class: String? - public init(name: Int?, _class: String?) { + public init(name: Int? = nil, _class: String? = nil) { self.name = name self._class = _class } diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Name.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Name.swift index 06f8a2f81a3a..6ecf78e38859 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Name.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Name.swift @@ -26,7 +26,7 @@ import Foundation } } - public init(name: Int, snakeCase: Int?, property: String?, _123number: Int?) { + public init(name: Int, snakeCase: Int? = nil, property: String? = nil, _123number: Int? = nil) { self.name = name self.snakeCase = snakeCase self.property = property diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift index 3bd9859378d8..40fa7365d0ac 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift @@ -11,7 +11,7 @@ import Foundation public var justNumber: Double? - public init(justNumber: Double?) { + public init(justNumber: Double? = nil) { self.justNumber = justNumber } diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Order.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Order.swift index 586a4c2d55a8..1281a50c1dc2 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Order.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Order.swift @@ -42,7 +42,7 @@ import Foundation } } - public init(_id: Int64?, petId: Int64?, quantity: Int?, shipDate: Date?, status: Status?, complete: Bool?) { + public init(_id: Int64? = nil, petId: Int64? = nil, quantity: Int? = nil, shipDate: Date? = nil, status: Status? = nil, complete: Bool? = nil) { self._id = _id self.petId = petId self.quantity = quantity diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift index 434111678de7..9238070c2cb1 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift @@ -18,7 +18,7 @@ import Foundation } } - public init(myNumber: Double?, myString: String?, myBoolean: Bool?) { + public init(myNumber: Double? = nil, myString: String? = nil, myBoolean: Bool? = nil) { self.myNumber = myNumber self.myString = myString self.myBoolean = myBoolean diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift index d84079a2b48d..e17ada14c425 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift @@ -27,7 +27,7 @@ import Foundation /** pet status in the store */ public var status: Status? - public init(_id: Int64?, category: Category?, name: String, photoUrls: [String], tags: [Tag]?, status: Status?) { + public init(_id: Int64? = nil, category: Category? = nil, name: String, photoUrls: [String], tags: [Tag]? = nil, status: Status? = nil) { self._id = _id self.category = category self.name = name diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift index d1252433b2d8..c16846f4ac19 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift @@ -12,7 +12,7 @@ import Foundation public var bar: String? public var baz: String? - public init(bar: String?, baz: String?) { + public init(bar: String? = nil, baz: String? = nil) { self.bar = bar self.baz = baz } diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Return.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Return.swift index 4b10ac18cf0d..9f886e6d507b 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Return.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Return.swift @@ -18,7 +18,7 @@ import Foundation } } - public init(_return: Int?) { + public init(_return: Int? = nil) { self._return = _return } diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift index 85e33352531d..41b2bf459eff 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift @@ -16,7 +16,7 @@ import Foundation } } - public init(specialPropertyName: Int64?) { + public init(specialPropertyName: Int64? = nil) { self.specialPropertyName = specialPropertyName } diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift index 88583be7f5dd..fc02765d30e2 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift @@ -17,7 +17,7 @@ import Foundation } public var name: String? - public init(_id: Int64?, name: String?) { + public init(_id: Int64? = nil, name: String? = nil) { self._id = _id self.name = name } diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/User.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/User.swift index 7dc3cc5954d6..5b9831507979 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/User.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/User.swift @@ -29,7 +29,7 @@ import Foundation } } - public init(_id: Int64?, username: String?, firstName: String?, lastName: String?, email: String?, password: String?, phone: String?, userStatus: Int?) { + public init(_id: Int64? = nil, username: String? = nil, firstName: String? = nil, lastName: String? = nil, email: String? = nil, password: String? = nil, phone: String? = nil, userStatus: Int? = nil) { self._id = _id self.username = username self.firstName = firstName diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift index 1af031535967..81020425ad1a 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift @@ -12,7 +12,7 @@ public struct AdditionalPropertiesClass: Codable { public var mapString: [String: String]? public var mapMapString: [String: [String: String]]? - public init(mapString: [String: String]?, mapMapString: [String: [String: String]]?) { + public init(mapString: [String: String]? = nil, mapMapString: [String: [String: String]]? = nil) { self.mapString = mapString self.mapMapString = mapMapString } diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift index 5ed9f31e2a36..c34ac85ac63f 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift @@ -12,7 +12,7 @@ public struct Animal: Codable { public var className: String public var color: String? = "red" - public init(className: String, color: String?) { + public init(className: String, color: String? = nil) { self.className = className self.color = color } diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift index ec270da89074..6ad3d808a97d 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift @@ -13,7 +13,7 @@ public struct ApiResponse: Codable { public var type: String? public var message: String? - public init(code: Int?, type: String?, message: String?) { + public init(code: Int? = nil, type: String? = nil, message: String? = nil) { self.code = code self.type = type self.message = message diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift index 6c252ed475b2..6d99f90fdd19 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift @@ -11,7 +11,7 @@ public struct ArrayOfArrayOfNumberOnly: Codable { public var arrayArrayNumber: [[Double]]? - public init(arrayArrayNumber: [[Double]]?) { + public init(arrayArrayNumber: [[Double]]? = nil) { self.arrayArrayNumber = arrayArrayNumber } diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift index e84eb5d65025..d59c529ef659 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift @@ -11,7 +11,7 @@ public struct ArrayOfNumberOnly: Codable { public var arrayNumber: [Double]? - public init(arrayNumber: [Double]?) { + public init(arrayNumber: [Double]? = nil) { self.arrayNumber = arrayNumber } diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift index d2140933d181..fdab67b0c59f 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift @@ -13,7 +13,7 @@ public struct ArrayTest: Codable { public var arrayArrayOfInteger: [[Int64]]? public var arrayArrayOfModel: [[ReadOnlyFirst]]? - public init(arrayOfString: [String]?, arrayArrayOfInteger: [[Int64]]?, arrayArrayOfModel: [[ReadOnlyFirst]]?) { + public init(arrayOfString: [String]? = nil, arrayArrayOfInteger: [[Int64]]? = nil, arrayArrayOfModel: [[ReadOnlyFirst]]? = nil) { self.arrayOfString = arrayOfString self.arrayArrayOfInteger = arrayArrayOfInteger self.arrayArrayOfModel = arrayArrayOfModel diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift index d1b3b27616ed..a7f8abe97195 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift @@ -17,7 +17,7 @@ public struct Capitalization: Codable { /** Name of the pet */ public var ATT_NAME: String? - public init(smallCamel: String?, capitalCamel: String?, smallSnake: String?, capitalSnake: String?, sCAETHFlowPoints: String?, ATT_NAME: String?) { + public init(smallCamel: String? = nil, capitalCamel: String? = nil, smallSnake: String? = nil, capitalSnake: String? = nil, sCAETHFlowPoints: String? = nil, ATT_NAME: String? = nil) { self.smallCamel = smallCamel self.capitalCamel = capitalCamel self.smallSnake = smallSnake diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift index 7ab887f3113f..884020d1a72c 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift @@ -13,7 +13,7 @@ public struct Cat: Codable { public var color: String? = "red" public var declawed: Bool? - public init(className: String, color: String?, declawed: Bool?) { + public init(className: String, color: String? = nil, declawed: Bool? = nil) { self.className = className self.color = color self.declawed = declawed diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift index a51ad0dffab1..c7178efcb166 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift @@ -11,7 +11,7 @@ public struct CatAllOf: Codable { public var declawed: Bool? - public init(declawed: Bool?) { + public init(declawed: Bool? = nil) { self.declawed = declawed } diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift index eb8f7e5e1974..78bf6826d690 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift @@ -12,7 +12,7 @@ public struct Category: Codable { public var id: Int64? public var name: String = "default-name" - public init(id: Int64?, name: String) { + public init(id: Int64? = nil, name: String) { self.id = id self.name = name } diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift index e2a7d4427a06..d7299a058561 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift @@ -12,7 +12,7 @@ public struct ClassModel: Codable { public var _class: String? - public init(_class: String?) { + public init(_class: String? = nil) { self._class = _class } diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift index 00245ca37280..c8e0b51314d6 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift @@ -11,7 +11,7 @@ public struct Client: Codable { public var client: String? - public init(client: String?) { + public init(client: String? = nil) { self.client = client } diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift index 492c1228008e..e7e0efa931e8 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift @@ -13,7 +13,7 @@ public struct Dog: Codable { public var color: String? = "red" public var breed: String? - public init(className: String, color: String?, breed: String?) { + public init(className: String, color: String? = nil, breed: String? = nil) { self.className = className self.color = color self.breed = breed diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift index 7786f8acc5ae..1f61ed3c3431 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift @@ -11,7 +11,7 @@ public struct DogAllOf: Codable { public var breed: String? - public init(breed: String?) { + public init(breed: String? = nil) { self.breed = breed } diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift index 9844e7c40e35..10536376ccc6 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift @@ -20,7 +20,7 @@ public struct EnumArrays: Codable { public var justSymbol: JustSymbol? public var arrayEnum: [ArrayEnum]? - public init(justSymbol: JustSymbol?, arrayEnum: [ArrayEnum]?) { + public init(justSymbol: JustSymbol? = nil, arrayEnum: [ArrayEnum]? = nil) { self.justSymbol = justSymbol self.arrayEnum = arrayEnum } diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift index 789f583e1d77..c0d7c84b69d0 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift @@ -33,7 +33,7 @@ public struct EnumTest: Codable { public var enumNumber: EnumNumber? public var outerEnum: OuterEnum? - public init(enumString: EnumString?, enumStringRequired: EnumStringRequired, enumInteger: EnumInteger?, enumNumber: EnumNumber?, outerEnum: OuterEnum?) { + public init(enumString: EnumString? = nil, enumStringRequired: EnumStringRequired, enumInteger: EnumInteger? = nil, enumNumber: EnumNumber? = nil, outerEnum: OuterEnum? = nil) { self.enumString = enumString self.enumStringRequired = enumStringRequired self.enumInteger = enumInteger diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift index abf3ccffc485..54ffb6e70e3e 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift @@ -13,7 +13,7 @@ public struct File: Codable { /** Test capitalization */ public var sourceURI: String? - public init(sourceURI: String?) { + public init(sourceURI: String? = nil) { self.sourceURI = sourceURI } diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift index 532f1457939a..3d70ffe0a598 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift @@ -12,7 +12,7 @@ public struct FileSchemaTestClass: Codable { public var file: File? public var files: [File]? - public init(file: File?, files: [File]?) { + public init(file: File? = nil, files: [File]? = nil) { self.file = file self.files = files } diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift index 20bd6d103b3d..c934df71b34c 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift @@ -23,7 +23,7 @@ public struct FormatTest: Codable { public var uuid: UUID? public var password: String - public init(integer: Int?, int32: Int?, int64: Int64?, number: Double, float: Float?, double: Double?, string: String?, byte: Data, binary: URL?, date: Date, dateTime: Date?, uuid: UUID?, password: String) { + public init(integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, number: Double, float: Float? = nil, double: Double? = nil, string: String? = nil, byte: Data, binary: URL? = nil, date: Date, dateTime: Date? = nil, uuid: UUID? = nil, password: String) { self.integer = integer self.int32 = int32 self.int64 = int64 diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift index 906ddb06fb17..a6d3567e8859 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift @@ -12,7 +12,7 @@ public struct HasOnlyReadOnly: Codable { public var bar: String? public var foo: String? - public init(bar: String?, foo: String?) { + public init(bar: String? = nil, foo: String? = nil) { self.bar = bar self.foo = foo } diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift index fe13d302ccbf..6de49531ac1c 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift @@ -11,7 +11,7 @@ public struct List: Codable { public var _123list: String? - public init(_123list: String?) { + public init(_123list: String? = nil) { self._123list = _123list } diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift index 4b6037f378ee..a9762da61554 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift @@ -18,7 +18,7 @@ public struct MapTest: Codable { public var directMap: [String: Bool]? public var indirectMap: StringBooleanMap? - public init(mapMapOfString: [String: [String: String]]?, mapOfEnumString: [String: String]?, directMap: [String: Bool]?, indirectMap: StringBooleanMap?) { + public init(mapMapOfString: [String: [String: String]]? = nil, mapOfEnumString: [String: String]? = nil, directMap: [String: Bool]? = nil, indirectMap: StringBooleanMap? = nil) { self.mapMapOfString = mapMapOfString self.mapOfEnumString = mapOfEnumString self.directMap = directMap diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift index c3deb2f28932..f1d081064b62 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift @@ -13,7 +13,7 @@ public struct MixedPropertiesAndAdditionalPropertiesClass: Codable { public var dateTime: Date? public var map: [String: Animal]? - public init(uuid: UUID?, dateTime: Date?, map: [String: Animal]?) { + public init(uuid: UUID? = nil, dateTime: Date? = nil, map: [String: Animal]? = nil) { self.uuid = uuid self.dateTime = dateTime self.map = map diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift index b61db7d6e716..6365e8799f7c 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift @@ -13,7 +13,7 @@ public struct Model200Response: Codable { public var name: Int? public var _class: String? - public init(name: Int?, _class: String?) { + public init(name: Int? = nil, _class: String? = nil) { self.name = name self._class = _class } diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift index 8ab4db44b73a..5797209dce3c 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift @@ -15,7 +15,7 @@ public struct Name: Codable { public var property: String? public var _123number: Int? - public init(name: Int, snakeCase: Int?, property: String?, _123number: Int?) { + public init(name: Int, snakeCase: Int? = nil, property: String? = nil, _123number: Int? = nil) { self.name = name self.snakeCase = snakeCase self.property = property diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift index 4d1dafcc2c1f..979335c098bd 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift @@ -11,7 +11,7 @@ public struct NumberOnly: Codable { public var justNumber: Double? - public init(justNumber: Double?) { + public init(justNumber: Double? = nil) { self.justNumber = justNumber } diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift index 40c30cc8609c..f1817f7792a1 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift @@ -22,7 +22,7 @@ public struct Order: Codable { public var status: Status? public var complete: Bool? = false - public init(id: Int64?, petId: Int64?, quantity: Int?, shipDate: Date?, status: Status?, complete: Bool?) { + public init(id: Int64? = nil, petId: Int64? = nil, quantity: Int? = nil, shipDate: Date? = nil, status: Status? = nil, complete: Bool? = nil) { self.id = id self.petId = petId self.quantity = quantity diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift index 18c3a024f122..d01e8da21668 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift @@ -13,7 +13,7 @@ public struct OuterComposite: Codable { public var myString: String? public var myBoolean: Bool? - public init(myNumber: Double?, myString: String?, myBoolean: Bool?) { + public init(myNumber: Double? = nil, myString: String? = nil, myBoolean: Bool? = nil) { self.myNumber = myNumber self.myString = myString self.myBoolean = myBoolean diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift index b9ce0e933256..caea19425d85 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift @@ -22,7 +22,7 @@ public struct Pet: Codable { /** pet status in the store */ public var status: Status? - public init(id: Int64?, category: Category?, name: String, photoUrls: [String], tags: [Tag]?, status: Status?) { + public init(id: Int64? = nil, category: Category? = nil, name: String, photoUrls: [String], tags: [Tag]? = nil, status: Status? = nil) { self.id = id self.category = category self.name = name diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift index 0acd21fd1000..f643334038e2 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift @@ -12,7 +12,7 @@ public struct ReadOnlyFirst: Codable { public var bar: String? public var baz: String? - public init(bar: String?, baz: String?) { + public init(bar: String? = nil, baz: String? = nil) { self.bar = bar self.baz = baz } diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift index c223f993a69e..45479e2b0de8 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift @@ -12,7 +12,7 @@ public struct Return: Codable { public var _return: Int? - public init(_return: Int?) { + public init(_return: Int? = nil) { self._return = _return } diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift index 6e8650f76d8e..8515496eb272 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift @@ -11,7 +11,7 @@ public struct SpecialModelName: Codable { public var specialPropertyName: Int64? - public init(specialPropertyName: Int64?) { + public init(specialPropertyName: Int64? = nil) { self.specialPropertyName = specialPropertyName } diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift index 4dd8a9a9f5a0..82c02f04b69d 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift @@ -12,7 +12,7 @@ public struct Tag: Codable { public var id: Int64? public var name: String? - public init(id: Int64?, name: String?) { + public init(id: Int64? = nil, name: String? = nil) { self.id = id self.name = name } diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift index 79f271ed7356..03e2736bd234 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift @@ -19,7 +19,7 @@ public struct User: Codable { /** User Status */ public var userStatus: Int? - public init(id: Int64?, username: String?, firstName: String?, lastName: String?, email: String?, password: String?, phone: String?, userStatus: Int?) { + public init(id: Int64? = nil, username: String? = nil, firstName: String? = nil, lastName: String? = nil, email: String? = nil, password: String? = nil, phone: String? = nil, userStatus: Int? = nil) { self.id = id self.username = username self.firstName = firstName diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift index 3fda7052a7d3..d7144747d6dd 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift @@ -12,7 +12,7 @@ public struct AdditionalPropertiesClass: Codable { public private(set) var mapString: [String: String]? public private(set) var mapMapString: [String: [String: String]]? - public init(mapString: [String: String]?, mapMapString: [String: [String: String]]?) { + public init(mapString: [String: String]? = nil, mapMapString: [String: [String: String]]? = nil) { self.mapString = mapString self.mapMapString = mapMapString } diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift index af59c2a9ef62..7daa5138de00 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift @@ -12,7 +12,7 @@ public struct Animal: Codable { public private(set) var className: String public private(set) var color: String? = "red" - public init(className: String, color: String?) { + public init(className: String, color: String? = nil) { self.className = className self.color = color } diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift index a89768595cc5..2046c61cab10 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift @@ -13,7 +13,7 @@ public struct ApiResponse: Codable { public private(set) var type: String? public private(set) var message: String? - public init(code: Int?, type: String?, message: String?) { + public init(code: Int? = nil, type: String? = nil, message: String? = nil) { self.code = code self.type = type self.message = message diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift index a2593b7c1a39..34d3808c996a 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift @@ -11,7 +11,7 @@ public struct ArrayOfArrayOfNumberOnly: Codable { public private(set) var arrayArrayNumber: [[Double]]? - public init(arrayArrayNumber: [[Double]]?) { + public init(arrayArrayNumber: [[Double]]? = nil) { self.arrayArrayNumber = arrayArrayNumber } diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift index c5edf1100537..05698f00cf3b 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift @@ -11,7 +11,7 @@ public struct ArrayOfNumberOnly: Codable { public private(set) var arrayNumber: [Double]? - public init(arrayNumber: [Double]?) { + public init(arrayNumber: [Double]? = nil) { self.arrayNumber = arrayNumber } diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift index 8ad39b8c09fc..1175bd6ea59b 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift @@ -13,7 +13,7 @@ public struct ArrayTest: Codable { public private(set) var arrayArrayOfInteger: [[Int64]]? public private(set) var arrayArrayOfModel: [[ReadOnlyFirst]]? - public init(arrayOfString: [String]?, arrayArrayOfInteger: [[Int64]]?, arrayArrayOfModel: [[ReadOnlyFirst]]?) { + public init(arrayOfString: [String]? = nil, arrayArrayOfInteger: [[Int64]]? = nil, arrayArrayOfModel: [[ReadOnlyFirst]]? = nil) { self.arrayOfString = arrayOfString self.arrayArrayOfInteger = arrayArrayOfInteger self.arrayArrayOfModel = arrayArrayOfModel diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift index eb3d6777e52b..ad1a6d34edef 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift @@ -17,7 +17,7 @@ public struct Capitalization: Codable { /** Name of the pet */ public private(set) var ATT_NAME: String? - public init(smallCamel: String?, capitalCamel: String?, smallSnake: String?, capitalSnake: String?, sCAETHFlowPoints: String?, ATT_NAME: String?) { + public init(smallCamel: String? = nil, capitalCamel: String? = nil, smallSnake: String? = nil, capitalSnake: String? = nil, sCAETHFlowPoints: String? = nil, ATT_NAME: String? = nil) { self.smallCamel = smallCamel self.capitalCamel = capitalCamel self.smallSnake = smallSnake diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift index 2978b016f98e..44de9d88fe36 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift @@ -13,7 +13,7 @@ public struct Cat: Codable { public private(set) var color: String? = "red" public private(set) var declawed: Bool? - public init(className: String, color: String?, declawed: Bool?) { + public init(className: String, color: String? = nil, declawed: Bool? = nil) { self.className = className self.color = color self.declawed = declawed diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift index 4ab80fbcd99e..7cfc1de3a15a 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift @@ -11,7 +11,7 @@ public struct CatAllOf: Codable { public private(set) var declawed: Bool? - public init(declawed: Bool?) { + public init(declawed: Bool? = nil) { self.declawed = declawed } diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Category.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Category.swift index 3482703a6b41..5b2ec18905fc 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Category.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Category.swift @@ -12,7 +12,7 @@ public struct Category: Codable { public private(set) var id: Int64? public private(set) var name: String = "default-name" - public init(id: Int64?, name: String) { + public init(id: Int64? = nil, name: String) { self.id = id self.name = name } diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift index 319d88a70f7a..75ab2a99cbb9 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift @@ -12,7 +12,7 @@ public struct ClassModel: Codable { public private(set) var _class: String? - public init(_class: String?) { + public init(_class: String? = nil) { self._class = _class } diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Client.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Client.swift index 5dd8cc3062dd..6e416e1d15ed 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Client.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Client.swift @@ -11,7 +11,7 @@ public struct Client: Codable { public private(set) var client: String? - public init(client: String?) { + public init(client: String? = nil) { self.client = client } diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift index 16ab196b8724..1e660e05bd27 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift @@ -13,7 +13,7 @@ public struct Dog: Codable { public private(set) var color: String? = "red" public private(set) var breed: String? - public init(className: String, color: String?, breed: String?) { + public init(className: String, color: String? = nil, breed: String? = nil) { self.className = className self.color = color self.breed = breed diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift index d8a838725cbf..b0e9fa0c8429 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift @@ -11,7 +11,7 @@ public struct DogAllOf: Codable { public private(set) var breed: String? - public init(breed: String?) { + public init(breed: String? = nil) { self.breed = breed } diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift index d9ce69e9fc86..aaba025176a1 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift @@ -20,7 +20,7 @@ public struct EnumArrays: Codable { public private(set) var justSymbol: JustSymbol? public private(set) var arrayEnum: [ArrayEnum]? - public init(justSymbol: JustSymbol?, arrayEnum: [ArrayEnum]?) { + public init(justSymbol: JustSymbol? = nil, arrayEnum: [ArrayEnum]? = nil) { self.justSymbol = justSymbol self.arrayEnum = arrayEnum } diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift index 2b114d422d1b..0fb1c191009f 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift @@ -33,7 +33,7 @@ public struct EnumTest: Codable { public private(set) var enumNumber: EnumNumber? public private(set) var outerEnum: OuterEnum? - public init(enumString: EnumString?, enumStringRequired: EnumStringRequired, enumInteger: EnumInteger?, enumNumber: EnumNumber?, outerEnum: OuterEnum?) { + public init(enumString: EnumString? = nil, enumStringRequired: EnumStringRequired, enumInteger: EnumInteger? = nil, enumNumber: EnumNumber? = nil, outerEnum: OuterEnum? = nil) { self.enumString = enumString self.enumStringRequired = enumStringRequired self.enumInteger = enumInteger diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/File.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/File.swift index eeab58194415..89b0f40d736c 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/File.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/File.swift @@ -13,7 +13,7 @@ public struct File: Codable { /** Test capitalization */ public private(set) var sourceURI: String? - public init(sourceURI: String?) { + public init(sourceURI: String? = nil) { self.sourceURI = sourceURI } diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift index 94574ca9955b..6e914ed4db4c 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift @@ -12,7 +12,7 @@ public struct FileSchemaTestClass: Codable { public private(set) var file: File? public private(set) var files: [File]? - public init(file: File?, files: [File]?) { + public init(file: File? = nil, files: [File]? = nil) { self.file = file self.files = files } diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift index 57bbd464b510..571dd3c36fef 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift @@ -23,7 +23,7 @@ public struct FormatTest: Codable { public private(set) var uuid: UUID? public private(set) var password: String - public init(integer: Int?, int32: Int?, int64: Int64?, number: Double, float: Float?, double: Double?, string: String?, byte: Data, binary: URL?, date: Date, dateTime: Date?, uuid: UUID?, password: String) { + public init(integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, number: Double, float: Float? = nil, double: Double? = nil, string: String? = nil, byte: Data, binary: URL? = nil, date: Date, dateTime: Date? = nil, uuid: UUID? = nil, password: String) { self.integer = integer self.int32 = int32 self.int64 = int64 diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift index 4de261f092d2..223a6433fdcc 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift @@ -12,7 +12,7 @@ public struct HasOnlyReadOnly: Codable { public private(set) var bar: String? public private(set) var foo: String? - public init(bar: String?, foo: String?) { + public init(bar: String? = nil, foo: String? = nil) { self.bar = bar self.foo = foo } diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/List.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/List.swift index 135160ff8de2..f1d47b6e07ea 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/List.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/List.swift @@ -11,7 +11,7 @@ public struct List: Codable { public private(set) var _123list: String? - public init(_123list: String?) { + public init(_123list: String? = nil) { self._123list = _123list } diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift index ebd9dd5b5bc7..e0d9e0bc2d52 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift @@ -18,7 +18,7 @@ public struct MapTest: Codable { public private(set) var directMap: [String: Bool]? public private(set) var indirectMap: StringBooleanMap? - public init(mapMapOfString: [String: [String: String]]?, mapOfEnumString: [String: String]?, directMap: [String: Bool]?, indirectMap: StringBooleanMap?) { + public init(mapMapOfString: [String: [String: String]]? = nil, mapOfEnumString: [String: String]? = nil, directMap: [String: Bool]? = nil, indirectMap: StringBooleanMap? = nil) { self.mapMapOfString = mapMapOfString self.mapOfEnumString = mapOfEnumString self.directMap = directMap diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift index dc1ee0461be7..6e0b65a7092e 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift @@ -13,7 +13,7 @@ public struct MixedPropertiesAndAdditionalPropertiesClass: Codable { public private(set) var dateTime: Date? public private(set) var map: [String: Animal]? - public init(uuid: UUID?, dateTime: Date?, map: [String: Animal]?) { + public init(uuid: UUID? = nil, dateTime: Date? = nil, map: [String: Animal]? = nil) { self.uuid = uuid self.dateTime = dateTime self.map = map diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift index a0f7127ef65c..b6591caa9508 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift @@ -13,7 +13,7 @@ public struct Model200Response: Codable { public private(set) var name: Int? public private(set) var _class: String? - public init(name: Int?, _class: String?) { + public init(name: Int? = nil, _class: String? = nil) { self.name = name self._class = _class } diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Name.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Name.swift index ee70b1f6ee9b..69e07f057edc 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Name.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Name.swift @@ -15,7 +15,7 @@ public struct Name: Codable { public private(set) var property: String? public private(set) var _123number: Int? - public init(name: Int, snakeCase: Int?, property: String?, _123number: Int?) { + public init(name: Int, snakeCase: Int? = nil, property: String? = nil, _123number: Int? = nil) { self.name = name self.snakeCase = snakeCase self.property = property diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift index 007dfab800ce..77fdfc7a1cd6 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift @@ -11,7 +11,7 @@ public struct NumberOnly: Codable { public private(set) var justNumber: Double? - public init(justNumber: Double?) { + public init(justNumber: Double? = nil) { self.justNumber = justNumber } diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Order.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Order.swift index 41a1d7d664e7..966cc61ac873 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Order.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Order.swift @@ -22,7 +22,7 @@ public struct Order: Codable { public private(set) var status: Status? public private(set) var complete: Bool? = false - public init(id: Int64?, petId: Int64?, quantity: Int?, shipDate: Date?, status: Status?, complete: Bool?) { + public init(id: Int64? = nil, petId: Int64? = nil, quantity: Int? = nil, shipDate: Date? = nil, status: Status? = nil, complete: Bool? = nil) { self.id = id self.petId = petId self.quantity = quantity diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift index df6d2512d6e4..721ec8e983d9 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift @@ -13,7 +13,7 @@ public struct OuterComposite: Codable { public private(set) var myString: String? public private(set) var myBoolean: Bool? - public init(myNumber: Double?, myString: String?, myBoolean: Bool?) { + public init(myNumber: Double? = nil, myString: String? = nil, myBoolean: Bool? = nil) { self.myNumber = myNumber self.myString = myString self.myBoolean = myBoolean diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift index 7b99ef33751a..f13bd2f2c31b 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift @@ -22,7 +22,7 @@ public struct Pet: Codable { /** pet status in the store */ public private(set) var status: Status? - public init(id: Int64?, category: Category?, name: String, photoUrls: [String], tags: [Tag]?, status: Status?) { + public init(id: Int64? = nil, category: Category? = nil, name: String, photoUrls: [String], tags: [Tag]? = nil, status: Status? = nil) { self.id = id self.category = category self.name = name diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift index 30cd4837cc78..914adf7f7ae1 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift @@ -12,7 +12,7 @@ public struct ReadOnlyFirst: Codable { public private(set) var bar: String? public private(set) var baz: String? - public init(bar: String?, baz: String?) { + public init(bar: String? = nil, baz: String? = nil) { self.bar = bar self.baz = baz } diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Return.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Return.swift index b28b6e99d777..470353cdce91 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Return.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Return.swift @@ -12,7 +12,7 @@ public struct Return: Codable { public private(set) var _return: Int? - public init(_return: Int?) { + public init(_return: Int? = nil) { self._return = _return } diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift index 266833a0dbc6..ad0619f04716 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift @@ -11,7 +11,7 @@ public struct SpecialModelName: Codable { public private(set) var specialPropertyName: Int64? - public init(specialPropertyName: Int64?) { + public init(specialPropertyName: Int64? = nil) { self.specialPropertyName = specialPropertyName } diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift index f827ccf107ad..08c29fb3f36b 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift @@ -12,7 +12,7 @@ public struct Tag: Codable { public private(set) var id: Int64? public private(set) var name: String? - public init(id: Int64?, name: String?) { + public init(id: Int64? = nil, name: String? = nil) { self.id = id self.name = name } diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/User.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/User.swift index 9fba7de81820..3826f33ed6af 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/User.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/User.swift @@ -19,7 +19,7 @@ public struct User: Codable { /** User Status */ public private(set) var userStatus: Int? - public init(id: Int64?, username: String?, firstName: String?, lastName: String?, email: String?, password: String?, phone: String?, userStatus: Int?) { + public init(id: Int64? = nil, username: String? = nil, firstName: String? = nil, lastName: String? = nil, email: String? = nil, password: String? = nil, phone: String? = nil, userStatus: Int? = nil) { self.id = id self.username = username self.firstName = firstName diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift index 1af031535967..81020425ad1a 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift @@ -12,7 +12,7 @@ public struct AdditionalPropertiesClass: Codable { public var mapString: [String: String]? public var mapMapString: [String: [String: String]]? - public init(mapString: [String: String]?, mapMapString: [String: [String: String]]?) { + public init(mapString: [String: String]? = nil, mapMapString: [String: [String: String]]? = nil) { self.mapString = mapString self.mapMapString = mapMapString } diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift index 5ed9f31e2a36..c34ac85ac63f 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift @@ -12,7 +12,7 @@ public struct Animal: Codable { public var className: String public var color: String? = "red" - public init(className: String, color: String?) { + public init(className: String, color: String? = nil) { self.className = className self.color = color } diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift index ec270da89074..6ad3d808a97d 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift @@ -13,7 +13,7 @@ public struct ApiResponse: Codable { public var type: String? public var message: String? - public init(code: Int?, type: String?, message: String?) { + public init(code: Int? = nil, type: String? = nil, message: String? = nil) { self.code = code self.type = type self.message = message diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift index 6c252ed475b2..6d99f90fdd19 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift @@ -11,7 +11,7 @@ public struct ArrayOfArrayOfNumberOnly: Codable { public var arrayArrayNumber: [[Double]]? - public init(arrayArrayNumber: [[Double]]?) { + public init(arrayArrayNumber: [[Double]]? = nil) { self.arrayArrayNumber = arrayArrayNumber } diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift index e84eb5d65025..d59c529ef659 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift @@ -11,7 +11,7 @@ public struct ArrayOfNumberOnly: Codable { public var arrayNumber: [Double]? - public init(arrayNumber: [Double]?) { + public init(arrayNumber: [Double]? = nil) { self.arrayNumber = arrayNumber } diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift index d2140933d181..fdab67b0c59f 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift @@ -13,7 +13,7 @@ public struct ArrayTest: Codable { public var arrayArrayOfInteger: [[Int64]]? public var arrayArrayOfModel: [[ReadOnlyFirst]]? - public init(arrayOfString: [String]?, arrayArrayOfInteger: [[Int64]]?, arrayArrayOfModel: [[ReadOnlyFirst]]?) { + public init(arrayOfString: [String]? = nil, arrayArrayOfInteger: [[Int64]]? = nil, arrayArrayOfModel: [[ReadOnlyFirst]]? = nil) { self.arrayOfString = arrayOfString self.arrayArrayOfInteger = arrayArrayOfInteger self.arrayArrayOfModel = arrayArrayOfModel diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift index d1b3b27616ed..a7f8abe97195 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift @@ -17,7 +17,7 @@ public struct Capitalization: Codable { /** Name of the pet */ public var ATT_NAME: String? - public init(smallCamel: String?, capitalCamel: String?, smallSnake: String?, capitalSnake: String?, sCAETHFlowPoints: String?, ATT_NAME: String?) { + public init(smallCamel: String? = nil, capitalCamel: String? = nil, smallSnake: String? = nil, capitalSnake: String? = nil, sCAETHFlowPoints: String? = nil, ATT_NAME: String? = nil) { self.smallCamel = smallCamel self.capitalCamel = capitalCamel self.smallSnake = smallSnake diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift index 7ab887f3113f..884020d1a72c 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift @@ -13,7 +13,7 @@ public struct Cat: Codable { public var color: String? = "red" public var declawed: Bool? - public init(className: String, color: String?, declawed: Bool?) { + public init(className: String, color: String? = nil, declawed: Bool? = nil) { self.className = className self.color = color self.declawed = declawed diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift index a51ad0dffab1..c7178efcb166 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift @@ -11,7 +11,7 @@ public struct CatAllOf: Codable { public var declawed: Bool? - public init(declawed: Bool?) { + public init(declawed: Bool? = nil) { self.declawed = declawed } diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift index eb8f7e5e1974..78bf6826d690 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift @@ -12,7 +12,7 @@ public struct Category: Codable { public var id: Int64? public var name: String = "default-name" - public init(id: Int64?, name: String) { + public init(id: Int64? = nil, name: String) { self.id = id self.name = name } diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift index e2a7d4427a06..d7299a058561 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift @@ -12,7 +12,7 @@ public struct ClassModel: Codable { public var _class: String? - public init(_class: String?) { + public init(_class: String? = nil) { self._class = _class } diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift index 00245ca37280..c8e0b51314d6 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift @@ -11,7 +11,7 @@ public struct Client: Codable { public var client: String? - public init(client: String?) { + public init(client: String? = nil) { self.client = client } diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift index 492c1228008e..e7e0efa931e8 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift @@ -13,7 +13,7 @@ public struct Dog: Codable { public var color: String? = "red" public var breed: String? - public init(className: String, color: String?, breed: String?) { + public init(className: String, color: String? = nil, breed: String? = nil) { self.className = className self.color = color self.breed = breed diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift index 7786f8acc5ae..1f61ed3c3431 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift @@ -11,7 +11,7 @@ public struct DogAllOf: Codable { public var breed: String? - public init(breed: String?) { + public init(breed: String? = nil) { self.breed = breed } diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift index 9844e7c40e35..10536376ccc6 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift @@ -20,7 +20,7 @@ public struct EnumArrays: Codable { public var justSymbol: JustSymbol? public var arrayEnum: [ArrayEnum]? - public init(justSymbol: JustSymbol?, arrayEnum: [ArrayEnum]?) { + public init(justSymbol: JustSymbol? = nil, arrayEnum: [ArrayEnum]? = nil) { self.justSymbol = justSymbol self.arrayEnum = arrayEnum } diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift index 789f583e1d77..c0d7c84b69d0 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift @@ -33,7 +33,7 @@ public struct EnumTest: Codable { public var enumNumber: EnumNumber? public var outerEnum: OuterEnum? - public init(enumString: EnumString?, enumStringRequired: EnumStringRequired, enumInteger: EnumInteger?, enumNumber: EnumNumber?, outerEnum: OuterEnum?) { + public init(enumString: EnumString? = nil, enumStringRequired: EnumStringRequired, enumInteger: EnumInteger? = nil, enumNumber: EnumNumber? = nil, outerEnum: OuterEnum? = nil) { self.enumString = enumString self.enumStringRequired = enumStringRequired self.enumInteger = enumInteger diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift index abf3ccffc485..54ffb6e70e3e 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift @@ -13,7 +13,7 @@ public struct File: Codable { /** Test capitalization */ public var sourceURI: String? - public init(sourceURI: String?) { + public init(sourceURI: String? = nil) { self.sourceURI = sourceURI } diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift index 532f1457939a..3d70ffe0a598 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift @@ -12,7 +12,7 @@ public struct FileSchemaTestClass: Codable { public var file: File? public var files: [File]? - public init(file: File?, files: [File]?) { + public init(file: File? = nil, files: [File]? = nil) { self.file = file self.files = files } diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift index 20bd6d103b3d..c934df71b34c 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift @@ -23,7 +23,7 @@ public struct FormatTest: Codable { public var uuid: UUID? public var password: String - public init(integer: Int?, int32: Int?, int64: Int64?, number: Double, float: Float?, double: Double?, string: String?, byte: Data, binary: URL?, date: Date, dateTime: Date?, uuid: UUID?, password: String) { + public init(integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, number: Double, float: Float? = nil, double: Double? = nil, string: String? = nil, byte: Data, binary: URL? = nil, date: Date, dateTime: Date? = nil, uuid: UUID? = nil, password: String) { self.integer = integer self.int32 = int32 self.int64 = int64 diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift index 906ddb06fb17..a6d3567e8859 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift @@ -12,7 +12,7 @@ public struct HasOnlyReadOnly: Codable { public var bar: String? public var foo: String? - public init(bar: String?, foo: String?) { + public init(bar: String? = nil, foo: String? = nil) { self.bar = bar self.foo = foo } diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift index fe13d302ccbf..6de49531ac1c 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift @@ -11,7 +11,7 @@ public struct List: Codable { public var _123list: String? - public init(_123list: String?) { + public init(_123list: String? = nil) { self._123list = _123list } diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift index 4b6037f378ee..a9762da61554 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift @@ -18,7 +18,7 @@ public struct MapTest: Codable { public var directMap: [String: Bool]? public var indirectMap: StringBooleanMap? - public init(mapMapOfString: [String: [String: String]]?, mapOfEnumString: [String: String]?, directMap: [String: Bool]?, indirectMap: StringBooleanMap?) { + public init(mapMapOfString: [String: [String: String]]? = nil, mapOfEnumString: [String: String]? = nil, directMap: [String: Bool]? = nil, indirectMap: StringBooleanMap? = nil) { self.mapMapOfString = mapMapOfString self.mapOfEnumString = mapOfEnumString self.directMap = directMap diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift index c3deb2f28932..f1d081064b62 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift @@ -13,7 +13,7 @@ public struct MixedPropertiesAndAdditionalPropertiesClass: Codable { public var dateTime: Date? public var map: [String: Animal]? - public init(uuid: UUID?, dateTime: Date?, map: [String: Animal]?) { + public init(uuid: UUID? = nil, dateTime: Date? = nil, map: [String: Animal]? = nil) { self.uuid = uuid self.dateTime = dateTime self.map = map diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift index b61db7d6e716..6365e8799f7c 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift @@ -13,7 +13,7 @@ public struct Model200Response: Codable { public var name: Int? public var _class: String? - public init(name: Int?, _class: String?) { + public init(name: Int? = nil, _class: String? = nil) { self.name = name self._class = _class } diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift index 8ab4db44b73a..5797209dce3c 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift @@ -15,7 +15,7 @@ public struct Name: Codable { public var property: String? public var _123number: Int? - public init(name: Int, snakeCase: Int?, property: String?, _123number: Int?) { + public init(name: Int, snakeCase: Int? = nil, property: String? = nil, _123number: Int? = nil) { self.name = name self.snakeCase = snakeCase self.property = property diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift index 4d1dafcc2c1f..979335c098bd 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift @@ -11,7 +11,7 @@ public struct NumberOnly: Codable { public var justNumber: Double? - public init(justNumber: Double?) { + public init(justNumber: Double? = nil) { self.justNumber = justNumber } diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift index 40c30cc8609c..f1817f7792a1 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift @@ -22,7 +22,7 @@ public struct Order: Codable { public var status: Status? public var complete: Bool? = false - public init(id: Int64?, petId: Int64?, quantity: Int?, shipDate: Date?, status: Status?, complete: Bool?) { + public init(id: Int64? = nil, petId: Int64? = nil, quantity: Int? = nil, shipDate: Date? = nil, status: Status? = nil, complete: Bool? = nil) { self.id = id self.petId = petId self.quantity = quantity diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift index 18c3a024f122..d01e8da21668 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift @@ -13,7 +13,7 @@ public struct OuterComposite: Codable { public var myString: String? public var myBoolean: Bool? - public init(myNumber: Double?, myString: String?, myBoolean: Bool?) { + public init(myNumber: Double? = nil, myString: String? = nil, myBoolean: Bool? = nil) { self.myNumber = myNumber self.myString = myString self.myBoolean = myBoolean diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift index b9ce0e933256..caea19425d85 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift @@ -22,7 +22,7 @@ public struct Pet: Codable { /** pet status in the store */ public var status: Status? - public init(id: Int64?, category: Category?, name: String, photoUrls: [String], tags: [Tag]?, status: Status?) { + public init(id: Int64? = nil, category: Category? = nil, name: String, photoUrls: [String], tags: [Tag]? = nil, status: Status? = nil) { self.id = id self.category = category self.name = name diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift index 0acd21fd1000..f643334038e2 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift @@ -12,7 +12,7 @@ public struct ReadOnlyFirst: Codable { public var bar: String? public var baz: String? - public init(bar: String?, baz: String?) { + public init(bar: String? = nil, baz: String? = nil) { self.bar = bar self.baz = baz } diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift index c223f993a69e..45479e2b0de8 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift @@ -12,7 +12,7 @@ public struct Return: Codable { public var _return: Int? - public init(_return: Int?) { + public init(_return: Int? = nil) { self._return = _return } diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift index 6e8650f76d8e..8515496eb272 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift @@ -11,7 +11,7 @@ public struct SpecialModelName: Codable { public var specialPropertyName: Int64? - public init(specialPropertyName: Int64?) { + public init(specialPropertyName: Int64? = nil) { self.specialPropertyName = specialPropertyName } diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift index 4dd8a9a9f5a0..82c02f04b69d 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift @@ -12,7 +12,7 @@ public struct Tag: Codable { public var id: Int64? public var name: String? - public init(id: Int64?, name: String?) { + public init(id: Int64? = nil, name: String? = nil) { self.id = id self.name = name } diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift index 79f271ed7356..03e2736bd234 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift @@ -19,7 +19,7 @@ public struct User: Codable { /** User Status */ public var userStatus: Int? - public init(id: Int64?, username: String?, firstName: String?, lastName: String?, email: String?, password: String?, phone: String?, userStatus: Int?) { + public init(id: Int64? = nil, username: String? = nil, firstName: String? = nil, lastName: String? = nil, email: String? = nil, password: String? = nil, phone: String? = nil, userStatus: Int? = nil) { self.id = id self.username = username self.firstName = firstName diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift index 1af031535967..81020425ad1a 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift @@ -12,7 +12,7 @@ public struct AdditionalPropertiesClass: Codable { public var mapString: [String: String]? public var mapMapString: [String: [String: String]]? - public init(mapString: [String: String]?, mapMapString: [String: [String: String]]?) { + public init(mapString: [String: String]? = nil, mapMapString: [String: [String: String]]? = nil) { self.mapString = mapString self.mapMapString = mapMapString } diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift index 5ed9f31e2a36..c34ac85ac63f 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift @@ -12,7 +12,7 @@ public struct Animal: Codable { public var className: String public var color: String? = "red" - public init(className: String, color: String?) { + public init(className: String, color: String? = nil) { self.className = className self.color = color } diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift index ec270da89074..6ad3d808a97d 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift @@ -13,7 +13,7 @@ public struct ApiResponse: Codable { public var type: String? public var message: String? - public init(code: Int?, type: String?, message: String?) { + public init(code: Int? = nil, type: String? = nil, message: String? = nil) { self.code = code self.type = type self.message = message diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift index 6c252ed475b2..6d99f90fdd19 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift @@ -11,7 +11,7 @@ public struct ArrayOfArrayOfNumberOnly: Codable { public var arrayArrayNumber: [[Double]]? - public init(arrayArrayNumber: [[Double]]?) { + public init(arrayArrayNumber: [[Double]]? = nil) { self.arrayArrayNumber = arrayArrayNumber } diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift index e84eb5d65025..d59c529ef659 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift @@ -11,7 +11,7 @@ public struct ArrayOfNumberOnly: Codable { public var arrayNumber: [Double]? - public init(arrayNumber: [Double]?) { + public init(arrayNumber: [Double]? = nil) { self.arrayNumber = arrayNumber } diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift index d2140933d181..fdab67b0c59f 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift @@ -13,7 +13,7 @@ public struct ArrayTest: Codable { public var arrayArrayOfInteger: [[Int64]]? public var arrayArrayOfModel: [[ReadOnlyFirst]]? - public init(arrayOfString: [String]?, arrayArrayOfInteger: [[Int64]]?, arrayArrayOfModel: [[ReadOnlyFirst]]?) { + public init(arrayOfString: [String]? = nil, arrayArrayOfInteger: [[Int64]]? = nil, arrayArrayOfModel: [[ReadOnlyFirst]]? = nil) { self.arrayOfString = arrayOfString self.arrayArrayOfInteger = arrayArrayOfInteger self.arrayArrayOfModel = arrayArrayOfModel diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift index d1b3b27616ed..a7f8abe97195 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift @@ -17,7 +17,7 @@ public struct Capitalization: Codable { /** Name of the pet */ public var ATT_NAME: String? - public init(smallCamel: String?, capitalCamel: String?, smallSnake: String?, capitalSnake: String?, sCAETHFlowPoints: String?, ATT_NAME: String?) { + public init(smallCamel: String? = nil, capitalCamel: String? = nil, smallSnake: String? = nil, capitalSnake: String? = nil, sCAETHFlowPoints: String? = nil, ATT_NAME: String? = nil) { self.smallCamel = smallCamel self.capitalCamel = capitalCamel self.smallSnake = smallSnake diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift index 7ab887f3113f..884020d1a72c 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift @@ -13,7 +13,7 @@ public struct Cat: Codable { public var color: String? = "red" public var declawed: Bool? - public init(className: String, color: String?, declawed: Bool?) { + public init(className: String, color: String? = nil, declawed: Bool? = nil) { self.className = className self.color = color self.declawed = declawed diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift index a51ad0dffab1..c7178efcb166 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift @@ -11,7 +11,7 @@ public struct CatAllOf: Codable { public var declawed: Bool? - public init(declawed: Bool?) { + public init(declawed: Bool? = nil) { self.declawed = declawed } diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift index eb8f7e5e1974..78bf6826d690 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift @@ -12,7 +12,7 @@ public struct Category: Codable { public var id: Int64? public var name: String = "default-name" - public init(id: Int64?, name: String) { + public init(id: Int64? = nil, name: String) { self.id = id self.name = name } diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift index e2a7d4427a06..d7299a058561 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift @@ -12,7 +12,7 @@ public struct ClassModel: Codable { public var _class: String? - public init(_class: String?) { + public init(_class: String? = nil) { self._class = _class } diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift index 00245ca37280..c8e0b51314d6 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift @@ -11,7 +11,7 @@ public struct Client: Codable { public var client: String? - public init(client: String?) { + public init(client: String? = nil) { self.client = client } diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift index 492c1228008e..e7e0efa931e8 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift @@ -13,7 +13,7 @@ public struct Dog: Codable { public var color: String? = "red" public var breed: String? - public init(className: String, color: String?, breed: String?) { + public init(className: String, color: String? = nil, breed: String? = nil) { self.className = className self.color = color self.breed = breed diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift index 7786f8acc5ae..1f61ed3c3431 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift @@ -11,7 +11,7 @@ public struct DogAllOf: Codable { public var breed: String? - public init(breed: String?) { + public init(breed: String? = nil) { self.breed = breed } diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift index 9844e7c40e35..10536376ccc6 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift @@ -20,7 +20,7 @@ public struct EnumArrays: Codable { public var justSymbol: JustSymbol? public var arrayEnum: [ArrayEnum]? - public init(justSymbol: JustSymbol?, arrayEnum: [ArrayEnum]?) { + public init(justSymbol: JustSymbol? = nil, arrayEnum: [ArrayEnum]? = nil) { self.justSymbol = justSymbol self.arrayEnum = arrayEnum } diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift index 789f583e1d77..c0d7c84b69d0 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift @@ -33,7 +33,7 @@ public struct EnumTest: Codable { public var enumNumber: EnumNumber? public var outerEnum: OuterEnum? - public init(enumString: EnumString?, enumStringRequired: EnumStringRequired, enumInteger: EnumInteger?, enumNumber: EnumNumber?, outerEnum: OuterEnum?) { + public init(enumString: EnumString? = nil, enumStringRequired: EnumStringRequired, enumInteger: EnumInteger? = nil, enumNumber: EnumNumber? = nil, outerEnum: OuterEnum? = nil) { self.enumString = enumString self.enumStringRequired = enumStringRequired self.enumInteger = enumInteger diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift index abf3ccffc485..54ffb6e70e3e 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift @@ -13,7 +13,7 @@ public struct File: Codable { /** Test capitalization */ public var sourceURI: String? - public init(sourceURI: String?) { + public init(sourceURI: String? = nil) { self.sourceURI = sourceURI } diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift index 532f1457939a..3d70ffe0a598 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift @@ -12,7 +12,7 @@ public struct FileSchemaTestClass: Codable { public var file: File? public var files: [File]? - public init(file: File?, files: [File]?) { + public init(file: File? = nil, files: [File]? = nil) { self.file = file self.files = files } diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift index 20bd6d103b3d..c934df71b34c 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift @@ -23,7 +23,7 @@ public struct FormatTest: Codable { public var uuid: UUID? public var password: String - public init(integer: Int?, int32: Int?, int64: Int64?, number: Double, float: Float?, double: Double?, string: String?, byte: Data, binary: URL?, date: Date, dateTime: Date?, uuid: UUID?, password: String) { + public init(integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, number: Double, float: Float? = nil, double: Double? = nil, string: String? = nil, byte: Data, binary: URL? = nil, date: Date, dateTime: Date? = nil, uuid: UUID? = nil, password: String) { self.integer = integer self.int32 = int32 self.int64 = int64 diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift index 906ddb06fb17..a6d3567e8859 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift @@ -12,7 +12,7 @@ public struct HasOnlyReadOnly: Codable { public var bar: String? public var foo: String? - public init(bar: String?, foo: String?) { + public init(bar: String? = nil, foo: String? = nil) { self.bar = bar self.foo = foo } diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift index fe13d302ccbf..6de49531ac1c 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift @@ -11,7 +11,7 @@ public struct List: Codable { public var _123list: String? - public init(_123list: String?) { + public init(_123list: String? = nil) { self._123list = _123list } diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift index 4b6037f378ee..a9762da61554 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift @@ -18,7 +18,7 @@ public struct MapTest: Codable { public var directMap: [String: Bool]? public var indirectMap: StringBooleanMap? - public init(mapMapOfString: [String: [String: String]]?, mapOfEnumString: [String: String]?, directMap: [String: Bool]?, indirectMap: StringBooleanMap?) { + public init(mapMapOfString: [String: [String: String]]? = nil, mapOfEnumString: [String: String]? = nil, directMap: [String: Bool]? = nil, indirectMap: StringBooleanMap? = nil) { self.mapMapOfString = mapMapOfString self.mapOfEnumString = mapOfEnumString self.directMap = directMap diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift index c3deb2f28932..f1d081064b62 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift @@ -13,7 +13,7 @@ public struct MixedPropertiesAndAdditionalPropertiesClass: Codable { public var dateTime: Date? public var map: [String: Animal]? - public init(uuid: UUID?, dateTime: Date?, map: [String: Animal]?) { + public init(uuid: UUID? = nil, dateTime: Date? = nil, map: [String: Animal]? = nil) { self.uuid = uuid self.dateTime = dateTime self.map = map diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift index b61db7d6e716..6365e8799f7c 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift @@ -13,7 +13,7 @@ public struct Model200Response: Codable { public var name: Int? public var _class: String? - public init(name: Int?, _class: String?) { + public init(name: Int? = nil, _class: String? = nil) { self.name = name self._class = _class } diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift index 8ab4db44b73a..5797209dce3c 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift @@ -15,7 +15,7 @@ public struct Name: Codable { public var property: String? public var _123number: Int? - public init(name: Int, snakeCase: Int?, property: String?, _123number: Int?) { + public init(name: Int, snakeCase: Int? = nil, property: String? = nil, _123number: Int? = nil) { self.name = name self.snakeCase = snakeCase self.property = property diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift index 4d1dafcc2c1f..979335c098bd 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift @@ -11,7 +11,7 @@ public struct NumberOnly: Codable { public var justNumber: Double? - public init(justNumber: Double?) { + public init(justNumber: Double? = nil) { self.justNumber = justNumber } diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift index 40c30cc8609c..f1817f7792a1 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift @@ -22,7 +22,7 @@ public struct Order: Codable { public var status: Status? public var complete: Bool? = false - public init(id: Int64?, petId: Int64?, quantity: Int?, shipDate: Date?, status: Status?, complete: Bool?) { + public init(id: Int64? = nil, petId: Int64? = nil, quantity: Int? = nil, shipDate: Date? = nil, status: Status? = nil, complete: Bool? = nil) { self.id = id self.petId = petId self.quantity = quantity diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift index 18c3a024f122..d01e8da21668 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift @@ -13,7 +13,7 @@ public struct OuterComposite: Codable { public var myString: String? public var myBoolean: Bool? - public init(myNumber: Double?, myString: String?, myBoolean: Bool?) { + public init(myNumber: Double? = nil, myString: String? = nil, myBoolean: Bool? = nil) { self.myNumber = myNumber self.myString = myString self.myBoolean = myBoolean diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift index b9ce0e933256..caea19425d85 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift @@ -22,7 +22,7 @@ public struct Pet: Codable { /** pet status in the store */ public var status: Status? - public init(id: Int64?, category: Category?, name: String, photoUrls: [String], tags: [Tag]?, status: Status?) { + public init(id: Int64? = nil, category: Category? = nil, name: String, photoUrls: [String], tags: [Tag]? = nil, status: Status? = nil) { self.id = id self.category = category self.name = name diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift index 0acd21fd1000..f643334038e2 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift @@ -12,7 +12,7 @@ public struct ReadOnlyFirst: Codable { public var bar: String? public var baz: String? - public init(bar: String?, baz: String?) { + public init(bar: String? = nil, baz: String? = nil) { self.bar = bar self.baz = baz } diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift index c223f993a69e..45479e2b0de8 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift @@ -12,7 +12,7 @@ public struct Return: Codable { public var _return: Int? - public init(_return: Int?) { + public init(_return: Int? = nil) { self._return = _return } diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift index 6e8650f76d8e..8515496eb272 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift @@ -11,7 +11,7 @@ public struct SpecialModelName: Codable { public var specialPropertyName: Int64? - public init(specialPropertyName: Int64?) { + public init(specialPropertyName: Int64? = nil) { self.specialPropertyName = specialPropertyName } diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift index 4dd8a9a9f5a0..82c02f04b69d 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift @@ -12,7 +12,7 @@ public struct Tag: Codable { public var id: Int64? public var name: String? - public init(id: Int64?, name: String?) { + public init(id: Int64? = nil, name: String? = nil) { self.id = id self.name = name } diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift index 79f271ed7356..03e2736bd234 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift @@ -19,7 +19,7 @@ public struct User: Codable { /** User Status */ public var userStatus: Int? - public init(id: Int64?, username: String?, firstName: String?, lastName: String?, email: String?, password: String?, phone: String?, userStatus: Int?) { + public init(id: Int64? = nil, username: String? = nil, firstName: String? = nil, lastName: String? = nil, email: String? = nil, password: String? = nil, phone: String? = nil, userStatus: Int? = nil) { self.id = id self.username = username self.firstName = firstName diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift index 1af031535967..81020425ad1a 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift @@ -12,7 +12,7 @@ public struct AdditionalPropertiesClass: Codable { public var mapString: [String: String]? public var mapMapString: [String: [String: String]]? - public init(mapString: [String: String]?, mapMapString: [String: [String: String]]?) { + public init(mapString: [String: String]? = nil, mapMapString: [String: [String: String]]? = nil) { self.mapString = mapString self.mapMapString = mapMapString } diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift index 5ed9f31e2a36..c34ac85ac63f 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift @@ -12,7 +12,7 @@ public struct Animal: Codable { public var className: String public var color: String? = "red" - public init(className: String, color: String?) { + public init(className: String, color: String? = nil) { self.className = className self.color = color } diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift index ec270da89074..6ad3d808a97d 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift @@ -13,7 +13,7 @@ public struct ApiResponse: Codable { public var type: String? public var message: String? - public init(code: Int?, type: String?, message: String?) { + public init(code: Int? = nil, type: String? = nil, message: String? = nil) { self.code = code self.type = type self.message = message diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift index 6c252ed475b2..6d99f90fdd19 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift @@ -11,7 +11,7 @@ public struct ArrayOfArrayOfNumberOnly: Codable { public var arrayArrayNumber: [[Double]]? - public init(arrayArrayNumber: [[Double]]?) { + public init(arrayArrayNumber: [[Double]]? = nil) { self.arrayArrayNumber = arrayArrayNumber } diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift index e84eb5d65025..d59c529ef659 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift @@ -11,7 +11,7 @@ public struct ArrayOfNumberOnly: Codable { public var arrayNumber: [Double]? - public init(arrayNumber: [Double]?) { + public init(arrayNumber: [Double]? = nil) { self.arrayNumber = arrayNumber } diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift index d2140933d181..fdab67b0c59f 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift @@ -13,7 +13,7 @@ public struct ArrayTest: Codable { public var arrayArrayOfInteger: [[Int64]]? public var arrayArrayOfModel: [[ReadOnlyFirst]]? - public init(arrayOfString: [String]?, arrayArrayOfInteger: [[Int64]]?, arrayArrayOfModel: [[ReadOnlyFirst]]?) { + public init(arrayOfString: [String]? = nil, arrayArrayOfInteger: [[Int64]]? = nil, arrayArrayOfModel: [[ReadOnlyFirst]]? = nil) { self.arrayOfString = arrayOfString self.arrayArrayOfInteger = arrayArrayOfInteger self.arrayArrayOfModel = arrayArrayOfModel diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift index d1b3b27616ed..a7f8abe97195 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift @@ -17,7 +17,7 @@ public struct Capitalization: Codable { /** Name of the pet */ public var ATT_NAME: String? - public init(smallCamel: String?, capitalCamel: String?, smallSnake: String?, capitalSnake: String?, sCAETHFlowPoints: String?, ATT_NAME: String?) { + public init(smallCamel: String? = nil, capitalCamel: String? = nil, smallSnake: String? = nil, capitalSnake: String? = nil, sCAETHFlowPoints: String? = nil, ATT_NAME: String? = nil) { self.smallCamel = smallCamel self.capitalCamel = capitalCamel self.smallSnake = smallSnake diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift index 7ab887f3113f..884020d1a72c 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift @@ -13,7 +13,7 @@ public struct Cat: Codable { public var color: String? = "red" public var declawed: Bool? - public init(className: String, color: String?, declawed: Bool?) { + public init(className: String, color: String? = nil, declawed: Bool? = nil) { self.className = className self.color = color self.declawed = declawed diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift index a51ad0dffab1..c7178efcb166 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift @@ -11,7 +11,7 @@ public struct CatAllOf: Codable { public var declawed: Bool? - public init(declawed: Bool?) { + public init(declawed: Bool? = nil) { self.declawed = declawed } diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift index eb8f7e5e1974..78bf6826d690 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift @@ -12,7 +12,7 @@ public struct Category: Codable { public var id: Int64? public var name: String = "default-name" - public init(id: Int64?, name: String) { + public init(id: Int64? = nil, name: String) { self.id = id self.name = name } diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift index e2a7d4427a06..d7299a058561 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift @@ -12,7 +12,7 @@ public struct ClassModel: Codable { public var _class: String? - public init(_class: String?) { + public init(_class: String? = nil) { self._class = _class } diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift index 00245ca37280..c8e0b51314d6 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift @@ -11,7 +11,7 @@ public struct Client: Codable { public var client: String? - public init(client: String?) { + public init(client: String? = nil) { self.client = client } diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift index 492c1228008e..e7e0efa931e8 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift @@ -13,7 +13,7 @@ public struct Dog: Codable { public var color: String? = "red" public var breed: String? - public init(className: String, color: String?, breed: String?) { + public init(className: String, color: String? = nil, breed: String? = nil) { self.className = className self.color = color self.breed = breed diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift index 7786f8acc5ae..1f61ed3c3431 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift @@ -11,7 +11,7 @@ public struct DogAllOf: Codable { public var breed: String? - public init(breed: String?) { + public init(breed: String? = nil) { self.breed = breed } diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift index 9844e7c40e35..10536376ccc6 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift @@ -20,7 +20,7 @@ public struct EnumArrays: Codable { public var justSymbol: JustSymbol? public var arrayEnum: [ArrayEnum]? - public init(justSymbol: JustSymbol?, arrayEnum: [ArrayEnum]?) { + public init(justSymbol: JustSymbol? = nil, arrayEnum: [ArrayEnum]? = nil) { self.justSymbol = justSymbol self.arrayEnum = arrayEnum } diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift index 789f583e1d77..c0d7c84b69d0 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift @@ -33,7 +33,7 @@ public struct EnumTest: Codable { public var enumNumber: EnumNumber? public var outerEnum: OuterEnum? - public init(enumString: EnumString?, enumStringRequired: EnumStringRequired, enumInteger: EnumInteger?, enumNumber: EnumNumber?, outerEnum: OuterEnum?) { + public init(enumString: EnumString? = nil, enumStringRequired: EnumStringRequired, enumInteger: EnumInteger? = nil, enumNumber: EnumNumber? = nil, outerEnum: OuterEnum? = nil) { self.enumString = enumString self.enumStringRequired = enumStringRequired self.enumInteger = enumInteger diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift index abf3ccffc485..54ffb6e70e3e 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift @@ -13,7 +13,7 @@ public struct File: Codable { /** Test capitalization */ public var sourceURI: String? - public init(sourceURI: String?) { + public init(sourceURI: String? = nil) { self.sourceURI = sourceURI } diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift index 532f1457939a..3d70ffe0a598 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift @@ -12,7 +12,7 @@ public struct FileSchemaTestClass: Codable { public var file: File? public var files: [File]? - public init(file: File?, files: [File]?) { + public init(file: File? = nil, files: [File]? = nil) { self.file = file self.files = files } diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift index 20bd6d103b3d..c934df71b34c 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift @@ -23,7 +23,7 @@ public struct FormatTest: Codable { public var uuid: UUID? public var password: String - public init(integer: Int?, int32: Int?, int64: Int64?, number: Double, float: Float?, double: Double?, string: String?, byte: Data, binary: URL?, date: Date, dateTime: Date?, uuid: UUID?, password: String) { + public init(integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, number: Double, float: Float? = nil, double: Double? = nil, string: String? = nil, byte: Data, binary: URL? = nil, date: Date, dateTime: Date? = nil, uuid: UUID? = nil, password: String) { self.integer = integer self.int32 = int32 self.int64 = int64 diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift index 906ddb06fb17..a6d3567e8859 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift @@ -12,7 +12,7 @@ public struct HasOnlyReadOnly: Codable { public var bar: String? public var foo: String? - public init(bar: String?, foo: String?) { + public init(bar: String? = nil, foo: String? = nil) { self.bar = bar self.foo = foo } diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift index fe13d302ccbf..6de49531ac1c 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift @@ -11,7 +11,7 @@ public struct List: Codable { public var _123list: String? - public init(_123list: String?) { + public init(_123list: String? = nil) { self._123list = _123list } diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift index 4b6037f378ee..a9762da61554 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift @@ -18,7 +18,7 @@ public struct MapTest: Codable { public var directMap: [String: Bool]? public var indirectMap: StringBooleanMap? - public init(mapMapOfString: [String: [String: String]]?, mapOfEnumString: [String: String]?, directMap: [String: Bool]?, indirectMap: StringBooleanMap?) { + public init(mapMapOfString: [String: [String: String]]? = nil, mapOfEnumString: [String: String]? = nil, directMap: [String: Bool]? = nil, indirectMap: StringBooleanMap? = nil) { self.mapMapOfString = mapMapOfString self.mapOfEnumString = mapOfEnumString self.directMap = directMap diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift index c3deb2f28932..f1d081064b62 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift @@ -13,7 +13,7 @@ public struct MixedPropertiesAndAdditionalPropertiesClass: Codable { public var dateTime: Date? public var map: [String: Animal]? - public init(uuid: UUID?, dateTime: Date?, map: [String: Animal]?) { + public init(uuid: UUID? = nil, dateTime: Date? = nil, map: [String: Animal]? = nil) { self.uuid = uuid self.dateTime = dateTime self.map = map diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift index b61db7d6e716..6365e8799f7c 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift @@ -13,7 +13,7 @@ public struct Model200Response: Codable { public var name: Int? public var _class: String? - public init(name: Int?, _class: String?) { + public init(name: Int? = nil, _class: String? = nil) { self.name = name self._class = _class } diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift index 8ab4db44b73a..5797209dce3c 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift @@ -15,7 +15,7 @@ public struct Name: Codable { public var property: String? public var _123number: Int? - public init(name: Int, snakeCase: Int?, property: String?, _123number: Int?) { + public init(name: Int, snakeCase: Int? = nil, property: String? = nil, _123number: Int? = nil) { self.name = name self.snakeCase = snakeCase self.property = property diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift index 4d1dafcc2c1f..979335c098bd 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift @@ -11,7 +11,7 @@ public struct NumberOnly: Codable { public var justNumber: Double? - public init(justNumber: Double?) { + public init(justNumber: Double? = nil) { self.justNumber = justNumber } diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift index 40c30cc8609c..f1817f7792a1 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift @@ -22,7 +22,7 @@ public struct Order: Codable { public var status: Status? public var complete: Bool? = false - public init(id: Int64?, petId: Int64?, quantity: Int?, shipDate: Date?, status: Status?, complete: Bool?) { + public init(id: Int64? = nil, petId: Int64? = nil, quantity: Int? = nil, shipDate: Date? = nil, status: Status? = nil, complete: Bool? = nil) { self.id = id self.petId = petId self.quantity = quantity diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift index 18c3a024f122..d01e8da21668 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift @@ -13,7 +13,7 @@ public struct OuterComposite: Codable { public var myString: String? public var myBoolean: Bool? - public init(myNumber: Double?, myString: String?, myBoolean: Bool?) { + public init(myNumber: Double? = nil, myString: String? = nil, myBoolean: Bool? = nil) { self.myNumber = myNumber self.myString = myString self.myBoolean = myBoolean diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift index b9ce0e933256..caea19425d85 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift @@ -22,7 +22,7 @@ public struct Pet: Codable { /** pet status in the store */ public var status: Status? - public init(id: Int64?, category: Category?, name: String, photoUrls: [String], tags: [Tag]?, status: Status?) { + public init(id: Int64? = nil, category: Category? = nil, name: String, photoUrls: [String], tags: [Tag]? = nil, status: Status? = nil) { self.id = id self.category = category self.name = name diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift index 0acd21fd1000..f643334038e2 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift @@ -12,7 +12,7 @@ public struct ReadOnlyFirst: Codable { public var bar: String? public var baz: String? - public init(bar: String?, baz: String?) { + public init(bar: String? = nil, baz: String? = nil) { self.bar = bar self.baz = baz } diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift index c223f993a69e..45479e2b0de8 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift @@ -12,7 +12,7 @@ public struct Return: Codable { public var _return: Int? - public init(_return: Int?) { + public init(_return: Int? = nil) { self._return = _return } diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift index 6e8650f76d8e..8515496eb272 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift @@ -11,7 +11,7 @@ public struct SpecialModelName: Codable { public var specialPropertyName: Int64? - public init(specialPropertyName: Int64?) { + public init(specialPropertyName: Int64? = nil) { self.specialPropertyName = specialPropertyName } diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift index 4dd8a9a9f5a0..82c02f04b69d 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift @@ -12,7 +12,7 @@ public struct Tag: Codable { public var id: Int64? public var name: String? - public init(id: Int64?, name: String?) { + public init(id: Int64? = nil, name: String? = nil) { self.id = id self.name = name } diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift index 79f271ed7356..03e2736bd234 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift @@ -19,7 +19,7 @@ public struct User: Codable { /** User Status */ public var userStatus: Int? - public init(id: Int64?, username: String?, firstName: String?, lastName: String?, email: String?, password: String?, phone: String?, userStatus: Int?) { + public init(id: Int64? = nil, username: String? = nil, firstName: String? = nil, lastName: String? = nil, email: String? = nil, password: String? = nil, phone: String? = nil, userStatus: Int? = nil) { self.id = id self.username = username self.firstName = firstName From 1897f6f96ccc8da33142cfa14b9ddc6c9d42cc39 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Fri, 24 Jul 2020 12:07:23 +0800 Subject: [PATCH 063/129] update samples --- .../src/main/java/org/openapitools/client/JSON.java | 1 + 1 file changed, 1 insertion(+) diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/JSON.java b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/JSON.java index 9d748f6e7c22..d29b48becb12 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/JSON.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/JSON.java @@ -21,6 +21,7 @@ public class JSON implements ContextResolver { public JSON() { mapper = new ObjectMapper(); mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); + mapper.configure(MapperFeature.ALLOW_COERCION_OF_SCALARS, false); mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, true); mapper.configure(DeserializationFeature.FAIL_ON_INVALID_SUBTYPE, true); mapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS); From 276a983fe8aa708c182a44c1e9e273b5196b3b02 Mon Sep 17 00:00:00 2001 From: Ravisankar-Challa Date: Fri, 24 Jul 2020 14:08:30 +1000 Subject: [PATCH 064/129] Add property additionalModelTypeAnnotations on the top of pojo class (#6037) --- .../src/main/resources/Java/libraries/microprofile/pojo.mustache | 1 + .../src/main/java/org/openapitools/client/model/Category.java | 1 + .../java/org/openapitools/client/model/ModelApiResponse.java | 1 + .../src/main/java/org/openapitools/client/model/Order.java | 1 + .../src/main/java/org/openapitools/client/model/Pet.java | 1 + .../src/main/java/org/openapitools/client/model/Tag.java | 1 + .../src/main/java/org/openapitools/client/model/User.java | 1 + 7 files changed, 7 insertions(+) diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/pojo.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/pojo.mustache index b69cf9dbfd6c..a2bd33a47669 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/pojo.mustache @@ -33,6 +33,7 @@ import javax.json.bind.annotation.JsonbProperty; * {{{description}}} **/ {{/description}} +{{>additionalModelTypeAnnotations}} public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}}{{#serializableModel}} implements Serializable{{/serializableModel}} { {{#vars}}{{#isEnum}}{{^isContainer}} {{>enumClass}}{{/isContainer}}{{#isContainer}}{{#mostInnerItems}} diff --git a/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/Category.java index c06b02b09a6f..98195981d663 100644 --- a/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/Category.java @@ -39,6 +39,7 @@ /** * A category for a pet **/ + public class Category { private Long id; diff --git a/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/ModelApiResponse.java index 077d0887c926..6ab5e35dbf47 100644 --- a/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -39,6 +39,7 @@ /** * Describes the result of uploading an image resource **/ + public class ModelApiResponse { private Integer code; diff --git a/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/Order.java index 8d6322fb43e7..9d2128db1b91 100644 --- a/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/Order.java @@ -40,6 +40,7 @@ /** * An order for a pets from the pet store **/ + public class Order { private Long id; diff --git a/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/Pet.java index c2a78c8f00e0..edbd1fac379c 100644 --- a/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/Pet.java @@ -43,6 +43,7 @@ /** * A pet for sale in the pet store **/ + public class Pet { private Long id; diff --git a/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/Tag.java index c04d84f4b853..efb749f209db 100644 --- a/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/Tag.java @@ -39,6 +39,7 @@ /** * A tag for a pet **/ + public class Tag { private Long id; diff --git a/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/User.java index d3db19903efe..6487510ea528 100644 --- a/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/User.java @@ -39,6 +39,7 @@ /** * A User who is purchasing from the pet store **/ + public class User { private Long id; From 5f8e28a39d1b3fbba574ab7de4f4e9438bb7ef0c Mon Sep 17 00:00:00 2001 From: William Cheng Date: Fri, 24 Jul 2020 16:43:39 +0800 Subject: [PATCH 065/129] Fix string comparison in Python generator's abstract class (#7030) * fix string comparison in PythonAbstractConnexionServerCodegen.java * rename abstract class * put public first --- ...gen.java => AbstractPythonConnexionServerCodegen.java} | 8 ++++---- .../languages/PythonAiohttpConnexionServerCodegen.java | 2 +- .../codegen/languages/PythonBluePlanetServerCodegen.java | 2 +- .../languages/PythonFlaskConnexionServerCodegen.java | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) rename modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/{PythonAbstractConnexionServerCodegen.java => AbstractPythonConnexionServerCodegen.java} (99%) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonAbstractConnexionServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPythonConnexionServerCodegen.java similarity index 99% rename from modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonAbstractConnexionServerCodegen.java rename to modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPythonConnexionServerCodegen.java index e94279d5ac4b..4bf8b029e0cb 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonAbstractConnexionServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPythonConnexionServerCodegen.java @@ -43,8 +43,8 @@ import static org.openapitools.codegen.utils.StringUtils.camelize; import static org.openapitools.codegen.utils.StringUtils.underscore; -public class PythonAbstractConnexionServerCodegen extends DefaultCodegen implements CodegenConfig { - private static final Logger LOGGER = LoggerFactory.getLogger(PythonAbstractConnexionServerCodegen.class); +public abstract class AbstractPythonConnexionServerCodegen extends DefaultCodegen implements CodegenConfig { + private static final Logger LOGGER = LoggerFactory.getLogger(AbstractPythonConnexionServerCodegen.class); public static final String CONTROLLER_PACKAGE = "controllerPackage"; public static final String DEFAULT_CONTROLLER = "defaultController"; @@ -64,7 +64,7 @@ public class PythonAbstractConnexionServerCodegen extends DefaultCodegen impleme protected boolean useNose = Boolean.FALSE; protected String pythonSrcRoot; - public PythonAbstractConnexionServerCodegen(String templateDirectory, boolean fixBodyNameValue) { + public AbstractPythonConnexionServerCodegen(String templateDirectory, boolean fixBodyNameValue) { super(); modifyFeatureSet(features -> features.includeDocumentationFeatures(DocumentationFeature.Readme)); @@ -248,7 +248,7 @@ public void setPythonSrcRoot(String val) { pySrcRoot = val.replaceAll("[/\\\\]+$", ""); } - if (pySrcRoot.isEmpty() || pySrcRoot == ".") { + if (pySrcRoot.isEmpty() || ".".equals(pySrcRoot)) { this.pythonSrcRoot = ""; } else { this.pythonSrcRoot = pySrcRoot + File.separator; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonAiohttpConnexionServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonAiohttpConnexionServerCodegen.java index 1e29687eb8cc..77fd92ae970d 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonAiohttpConnexionServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonAiohttpConnexionServerCodegen.java @@ -22,7 +22,7 @@ import java.util.EnumSet; -public class PythonAiohttpConnexionServerCodegen extends PythonAbstractConnexionServerCodegen { +public class PythonAiohttpConnexionServerCodegen extends AbstractPythonConnexionServerCodegen { private static final Logger LOGGER = LoggerFactory.getLogger(PythonAiohttpConnexionServerCodegen.class); public PythonAiohttpConnexionServerCodegen() { diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonBluePlanetServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonBluePlanetServerCodegen.java index 6e7a32ca217c..0abd9aa39935 100755 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonBluePlanetServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonBluePlanetServerCodegen.java @@ -24,7 +24,7 @@ import java.io.File; import java.util.EnumSet; -public class PythonBluePlanetServerCodegen extends PythonAbstractConnexionServerCodegen { +public class PythonBluePlanetServerCodegen extends AbstractPythonConnexionServerCodegen { private static final Logger LOGGER = LoggerFactory.getLogger(PythonBluePlanetServerCodegen.class); protected String modelDocPath = ""; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonFlaskConnexionServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonFlaskConnexionServerCodegen.java index 085b9e821ef1..a1b9abaa7aba 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonFlaskConnexionServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonFlaskConnexionServerCodegen.java @@ -22,7 +22,7 @@ import java.io.File; -public class PythonFlaskConnexionServerCodegen extends PythonAbstractConnexionServerCodegen { +public class PythonFlaskConnexionServerCodegen extends AbstractPythonConnexionServerCodegen { private static final Logger LOGGER = LoggerFactory.getLogger(PythonFlaskConnexionServerCodegen.class); public PythonFlaskConnexionServerCodegen() { From 9139f91b48570ef48cd2a4dc52402202aac3d130 Mon Sep 17 00:00:00 2001 From: Matthew Davis <7035647+mdavis-xyz@users.noreply.github.com> Date: Fri, 24 Jul 2020 18:44:50 +1000 Subject: [PATCH 066/129] add missing space for flask basic auth header (#7031) Co-authored-by: Matthew Davis --- .../src/main/resources/python-flask/controller_test.mustache | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/openapi-generator/src/main/resources/python-flask/controller_test.mustache b/modules/openapi-generator/src/main/resources/python-flask/controller_test.mustache index fcaedffa78a6..a5c426898efa 100644 --- a/modules/openapi-generator/src/main/resources/python-flask/controller_test.mustache +++ b/modules/openapi-generator/src/main/resources/python-flask/controller_test.mustache @@ -33,7 +33,7 @@ class {{#operations}}Test{{classname}}(BaseTestCase): 'Accept': '{{mediaType}}',{{/vendorExtensions.x-prefered-produce}}{{#vendorExtensions.x-prefered-consume}} 'Content-Type': '{{mediaType}}',{{/vendorExtensions.x-prefered-consume}}{{#headerParams}} '{{paramName}}': {{{example}}},{{/headerParams}}{{#authMethods}} - {{#isOAuth}}'Authorization': 'Bearer special-key',{{/isOAuth}}{{#isApiKey}}'{{name}}': 'special-key',{{/isApiKey}}{{#isBasicBasic}}'Authorization': 'BasicZm9vOmJhcg==',{{/isBasicBasic}}{{#isBasicBearer}}'Authorization': 'Bearer special-key',{{/isBasicBearer}}{{/authMethods}} + {{#isOAuth}}'Authorization': 'Bearer special-key',{{/isOAuth}}{{#isApiKey}}'{{name}}': 'special-key',{{/isApiKey}}{{#isBasicBasic}}'Authorization': 'Basic Zm9vOmJhcg==',{{/isBasicBasic}}{{#isBasicBearer}}'Authorization': 'Bearer special-key',{{/isBasicBearer}}{{/authMethods}} } {{#formParams}} {{#-first}}data = dict({{/-first}}{{^-first}} {{/-first}}{{paramName}}={{{example}}}{{#hasMore}},{{/hasMore}}{{#-last}}){{/-last}} From 04c41d47a2fc85ab917cbcab6b65f0959d9d529c Mon Sep 17 00:00:00 2001 From: William Cheng Date: Fri, 24 Jul 2020 18:44:15 +0800 Subject: [PATCH 067/129] [Java][jersey2] fix query parameters in applyToParams (#7028) * fix query parameters in applyToParams * update samples --- .../jersey2/auth/HttpSignatureAuth.mustache | 2 +- .../client/auth/HttpSignatureAuth.java | 2 +- .../openapitools/client/ApiClientTest.java | 66 +++++++++++++++++-- 3 files changed, 61 insertions(+), 9 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/auth/HttpSignatureAuth.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/auth/HttpSignatureAuth.mustache index 9ff634208834..b9fff30675f8 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/auth/HttpSignatureAuth.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/auth/HttpSignatureAuth.mustache @@ -257,7 +257,7 @@ public class HttpSignatureAuth implements Authentication { // Calling getRawPath and getRawQuery ensures the path is URL-encoded as it will be serialized // on the wire. The HTTP signature must use the encode URL as it is sent on the wire. String path = uri.getRawPath(); - if (uri.getRawQuery() != "") { + if (uri.getRawQuery() != null && !"".equals(uri.getRawQuery())) { path += "?" + uri.getRawQuery(); } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/auth/HttpSignatureAuth.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/auth/HttpSignatureAuth.java index 9c3bac079355..49ca39ecb749 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/auth/HttpSignatureAuth.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/auth/HttpSignatureAuth.java @@ -268,7 +268,7 @@ public void applyToParams(List queryParams, Map headerPara // Calling getRawPath and getRawQuery ensures the path is URL-encoded as it will be serialized // on the wire. The HTTP signature must use the encode URL as it is sent on the wire. String path = uri.getRawPath(); - if (uri.getRawQuery() != "") { + if (uri.getRawQuery() != null && !"".equals(uri.getRawQuery())) { path += "?" + uri.getRawQuery(); } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/ApiClientTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/ApiClientTest.java index fcccad7efba3..b89affd9fd96 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/ApiClientTest.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/ApiClientTest.java @@ -1,29 +1,81 @@ package org.openapitools.client; +import org.openapitools.client.auth.Authentication; +import org.openapitools.client.auth.HttpSignatureAuth; import org.openapitools.client.model.*; import org.openapitools.client.ApiClient; import java.lang.Exception; -import java.util.Arrays; -import java.util.Date; -import java.util.TimeZone; -import java.text.SimpleDateFormat; -import java.time.OffsetDateTime; -import java.time.ZoneId; -import java.time.format.DateTimeFormatter; +import java.security.spec.AlgorithmParameterSpec; +import java.util.*; +import java.net.URI; import org.junit.*; +import org.tomitribe.auth.signatures.Algorithm; +import org.tomitribe.auth.signatures.Signer; +import org.tomitribe.auth.signatures.SigningAlgorithm; +import java.security.spec.PSSParameterSpec; +import java.security.spec.MGF1ParameterSpec; +import org.tomitribe.auth.signatures.*; +import java.io.ByteArrayInputStream; +import java.security.PublicKey; +import java.security.PrivateKey; + import static org.junit.Assert.*; public class ApiClientTest { ApiClient apiClient = null; Pet pet = null; + private final String privateKeyPem = "-----BEGIN RSA PRIVATE KEY-----\n" + + "MIICXgIBAAKBgQDCFENGw33yGihy92pDjZQhl0C36rPJj+CvfSC8+q28hxA161QF\n" + + "NUd13wuCTUcq0Qd2qsBe/2hFyc2DCJJg0h1L78+6Z4UMR7EOcpfdUE9Hf3m/hs+F\n" + + "UR45uBJeDK1HSFHD8bHKD6kv8FPGfJTotc+2xjJwoYi+1hqp1fIekaxsyQIDAQAB\n" + + "AoGBAJR8ZkCUvx5kzv+utdl7T5MnordT1TvoXXJGXK7ZZ+UuvMNUCdN2QPc4sBiA\n" + + "QWvLw1cSKt5DsKZ8UETpYPy8pPYnnDEz2dDYiaew9+xEpubyeW2oH4Zx71wqBtOK\n" + + "kqwrXa/pzdpiucRRjk6vE6YY7EBBs/g7uanVpGibOVAEsqH1AkEA7DkjVH28WDUg\n" + + "f1nqvfn2Kj6CT7nIcE3jGJsZZ7zlZmBmHFDONMLUrXR/Zm3pR5m0tCmBqa5RK95u\n" + + "412jt1dPIwJBANJT3v8pnkth48bQo/fKel6uEYyboRtA5/uHuHkZ6FQF7OUkGogc\n" + + "mSJluOdc5t6hI1VsLn0QZEjQZMEOWr+wKSMCQQCC4kXJEsHAve77oP6HtG/IiEn7\n" + + "kpyUXRNvFsDE0czpJJBvL/aRFUJxuRK91jhjC68sA7NsKMGg5OXb5I5Jj36xAkEA\n" + + "gIT7aFOYBFwGgQAQkWNKLvySgKbAZRTeLBacpHMuQdl1DfdntvAyqpAZ0lY0RKmW\n" + + "G6aFKaqQfOXKCyWoUiVknQJAXrlgySFci/2ueKlIE1QqIiLSZ8V8OlpFLRnb1pzI\n" + + "7U1yQXnTAEFYM560yJlzUpOb1V4cScGd365tiSMvxLOvTA==\n" + + "-----END RSA PRIVATE KEY-----\n"; + @Before public void setup() { apiClient = new ApiClient(); pet = new Pet(); } + @Test + public void testUpdateParamsForAuth() throws Exception { + Map headerParams = new HashMap(); + List queryParams = new ArrayList<>(); + + URI uri = new URI("/api/v1/telemetry/TimeSeries"); + + // auth name + String[] authNames = {"http_signature_test"}; + + HashMap authMap = new HashMap(); + + HttpSignatureAuth signatureAuth = new HttpSignatureAuth("some-key-1", SigningAlgorithm.HS2019, Algorithm.RSA_SHA512, null, + null, Arrays.asList(new String[] { "(request-target)" }), 128L); + + signatureAuth.setPrivateKey(PEM.readPrivateKey(new ByteArrayInputStream(privateKeyPem.getBytes()))); + + authMap.put("http_signature_test", signatureAuth); + + ApiClient client = new ApiClient(authMap); + + client.updateParamsForAuth(authNames, queryParams, headerParams, null, null, "post", uri); + + // hard to test as expire will always be different + // ApiClientTest.testUpdateParamsForAuth:77 expected:<...-1",created=15954814[97,expires=1595481497.760],algorithm="hs2019",...> but was:<...-1",created=15954814[60,expires=1595481460.841],algorithm="hs2019",...> + //assertEquals(headerParams.get("Authorization"), "Signature keyId=\"some-key-1\",created=1595481460,expires=1595481460.841,algorithm=\"hs2019\",headers=\"(request-target)\",signature=\"eahPOLOTIH5AJyXbvpDyUIYBdYLAv6RbcAtGCEG9J1y6JyFWS+1IT/n/u4ZGMteiUvtoPm52dUXrhN3OMump+ivi+2JgMjHhd2G89zj7wcOVkZwaFfHjymHb8SwkVrda35GYsmXlnx01JRHCShk9yVHS7VYkY0CpQw171VaFWUc=\""); + } + @Test public void testSerializeToString() throws Exception { Long petId = 4321L; From a00521f260cd247c8e6a1d9c663c794f7a632ba1 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Fri, 24 Jul 2020 18:46:48 +0800 Subject: [PATCH 068/129] add justin to core team in public page (#7043) --- website/src/dynamic/team.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/website/src/dynamic/team.yml b/website/src/dynamic/team.yml index a72bfae34090..4737afb059b5 100644 --- a/website/src/dynamic/team.yml +++ b/website/src/dynamic/team.yml @@ -18,3 +18,6 @@ core: - name: sunn github: etherealjoy joined: 2019/06 + - name: Justin Black + github: spacether + joined: 2020/05 From 468d80be4beff74de33a2dd1d533f855030038d5 Mon Sep 17 00:00:00 2001 From: patst Date: Fri, 24 Jul 2020 14:30:58 +0200 Subject: [PATCH 069/129] typescript-angular: Angular 10 support (#7037) * 7036- angular 10 support * update example files * fix jersey exmaple file bc of circle ci fail * add ./ to FILES manually to pass tests --- ...angular-v10-provided-in-root-with-npm.yaml | 9 + ...pescript-angular-v10-provided-in-root.yaml | 5 + ...-angular-v9-provided-in-root-with-npm.yaml | 9 + ...ypescript-angular-v9-provided-in-root.yaml | 5 + docs/generators/typescript-angular.md | 2 +- .../TypeScriptAngularClientCodegen.java | 17 +- .../builds/default/.gitignore | 4 + .../builds/default/.openapi-generator-ignore | 23 + .../builds/default/.openapi-generator/FILES | 19 + .../builds/default/.openapi-generator/VERSION | 1 + .../builds/default/README.md | 203 ++++++ .../builds/default/api.module.ts | 33 + .../builds/default/api/api.ts | 7 + .../builds/default/api/pet.service.ts | 613 ++++++++++++++++++ .../builds/default/api/store.service.ts | 283 ++++++++ .../builds/default/api/user.service.ts | 497 ++++++++++++++ .../builds/default/configuration.ts | 137 ++++ .../builds/default/encoder.ts | 20 + .../builds/default/git_push.sh | 58 ++ .../builds/default/index.ts | 5 + .../builds/default/model/apiResponse.ts | 22 + .../builds/default/model/category.ts | 21 + .../builds/default/model/models.ts | 6 + .../builds/default/model/order.ts | 37 ++ .../builds/default/model/pet.ts | 39 ++ .../builds/default/model/tag.ts | 21 + .../builds/default/model/user.ts | 30 + .../builds/default/variables.ts | 9 + .../builds/with-npm/.gitignore | 4 + .../builds/with-npm/.openapi-generator-ignore | 23 + .../builds/with-npm/.openapi-generator/FILES | 22 + .../with-npm/.openapi-generator/VERSION | 1 + .../builds/with-npm/README.md | 203 ++++++ .../builds/with-npm/api.module.ts | 33 + .../builds/with-npm/api/api.ts | 7 + .../builds/with-npm/api/pet.service.ts | 613 ++++++++++++++++++ .../builds/with-npm/api/store.service.ts | 283 ++++++++ .../builds/with-npm/api/user.service.ts | 497 ++++++++++++++ .../builds/with-npm/configuration.ts | 137 ++++ .../builds/with-npm/encoder.ts | 20 + .../builds/with-npm/git_push.sh | 58 ++ .../builds/with-npm/index.ts | 5 + .../builds/with-npm/model/apiResponse.ts | 22 + .../builds/with-npm/model/category.ts | 21 + .../builds/with-npm/model/models.ts | 6 + .../builds/with-npm/model/order.ts | 37 ++ .../builds/with-npm/model/pet.ts | 39 ++ .../builds/with-npm/model/tag.ts | 21 + .../builds/with-npm/model/user.ts | 30 + .../builds/with-npm/ng-package.json | 6 + .../builds/with-npm/package.json | 34 + .../builds/with-npm/tsconfig.json | 28 + .../builds/with-npm/variables.ts | 9 + .../builds/default/.gitignore | 4 + .../builds/default/.openapi-generator-ignore | 23 + .../builds/default/.openapi-generator/FILES | 19 + .../builds/default/.openapi-generator/VERSION | 1 + .../builds/default/README.md | 203 ++++++ .../builds/default/api.module.ts | 33 + .../builds/default/api/api.ts | 7 + .../builds/default/api/pet.service.ts | 613 ++++++++++++++++++ .../builds/default/api/store.service.ts | 283 ++++++++ .../builds/default/api/user.service.ts | 497 ++++++++++++++ .../builds/default/configuration.ts | 137 ++++ .../builds/default/encoder.ts | 20 + .../builds/default/git_push.sh | 58 ++ .../builds/default/index.ts | 5 + .../builds/default/model/apiResponse.ts | 22 + .../builds/default/model/category.ts | 21 + .../builds/default/model/models.ts | 6 + .../builds/default/model/order.ts | 37 ++ .../builds/default/model/pet.ts | 39 ++ .../builds/default/model/tag.ts | 21 + .../builds/default/model/user.ts | 30 + .../builds/default/variables.ts | 9 + .../builds/with-npm/.gitignore | 4 + .../builds/with-npm/.openapi-generator-ignore | 23 + .../builds/with-npm/.openapi-generator/FILES | 22 + .../with-npm/.openapi-generator/VERSION | 1 + .../builds/with-npm/README.md | 203 ++++++ .../builds/with-npm/api.module.ts | 33 + .../builds/with-npm/api/api.ts | 7 + .../builds/with-npm/api/pet.service.ts | 613 ++++++++++++++++++ .../builds/with-npm/api/store.service.ts | 283 ++++++++ .../builds/with-npm/api/user.service.ts | 497 ++++++++++++++ .../builds/with-npm/configuration.ts | 137 ++++ .../builds/with-npm/encoder.ts | 20 + .../builds/with-npm/git_push.sh | 58 ++ .../builds/with-npm/index.ts | 5 + .../builds/with-npm/model/apiResponse.ts | 22 + .../builds/with-npm/model/category.ts | 21 + .../builds/with-npm/model/models.ts | 6 + .../builds/with-npm/model/order.ts | 37 ++ .../builds/with-npm/model/pet.ts | 39 ++ .../builds/with-npm/model/tag.ts | 21 + .../builds/with-npm/model/user.ts | 30 + .../builds/with-npm/ng-package.json | 6 + .../builds/with-npm/package.json | 34 + .../builds/with-npm/tsconfig.json | 28 + .../builds/with-npm/variables.ts | 9 + 100 files changed, 8535 insertions(+), 6 deletions(-) create mode 100644 bin/configs/typescript-angular-v10-provided-in-root-with-npm.yaml create mode 100644 bin/configs/typescript-angular-v10-provided-in-root.yaml create mode 100644 bin/configs/typescript-angular-v9-provided-in-root-with-npm.yaml create mode 100644 bin/configs/typescript-angular-v9-provided-in-root.yaml create mode 100644 samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/.gitignore create mode 100644 samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/.openapi-generator-ignore create mode 100644 samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/.openapi-generator/FILES create mode 100644 samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/.openapi-generator/VERSION create mode 100644 samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/README.md create mode 100644 samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/api.module.ts create mode 100644 samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/api/api.ts create mode 100644 samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/api/pet.service.ts create mode 100644 samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/api/store.service.ts create mode 100644 samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/api/user.service.ts create mode 100644 samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/configuration.ts create mode 100644 samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/encoder.ts create mode 100644 samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/git_push.sh create mode 100644 samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/index.ts create mode 100644 samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/model/apiResponse.ts create mode 100644 samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/model/category.ts create mode 100644 samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/model/models.ts create mode 100644 samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/model/order.ts create mode 100644 samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/model/pet.ts create mode 100644 samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/model/tag.ts create mode 100644 samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/model/user.ts create mode 100644 samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/variables.ts create mode 100644 samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/.gitignore create mode 100644 samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/.openapi-generator-ignore create mode 100644 samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/.openapi-generator/FILES create mode 100644 samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/.openapi-generator/VERSION create mode 100644 samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/README.md create mode 100644 samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/api.module.ts create mode 100644 samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/api/api.ts create mode 100644 samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/api/pet.service.ts create mode 100644 samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/api/store.service.ts create mode 100644 samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/api/user.service.ts create mode 100644 samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/configuration.ts create mode 100644 samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/encoder.ts create mode 100644 samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/git_push.sh create mode 100644 samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/index.ts create mode 100644 samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/model/apiResponse.ts create mode 100644 samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/model/category.ts create mode 100644 samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/model/models.ts create mode 100644 samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/model/order.ts create mode 100644 samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/model/pet.ts create mode 100644 samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/model/tag.ts create mode 100644 samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/model/user.ts create mode 100644 samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/ng-package.json create mode 100644 samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/package.json create mode 100644 samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/tsconfig.json create mode 100644 samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/variables.ts create mode 100644 samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/.gitignore create mode 100644 samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/.openapi-generator-ignore create mode 100644 samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/.openapi-generator/FILES create mode 100644 samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/.openapi-generator/VERSION create mode 100644 samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/README.md create mode 100644 samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/api.module.ts create mode 100644 samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/api/api.ts create mode 100644 samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/api/pet.service.ts create mode 100644 samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/api/store.service.ts create mode 100644 samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/api/user.service.ts create mode 100644 samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/configuration.ts create mode 100644 samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/encoder.ts create mode 100644 samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/git_push.sh create mode 100644 samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/index.ts create mode 100644 samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/model/apiResponse.ts create mode 100644 samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/model/category.ts create mode 100644 samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/model/models.ts create mode 100644 samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/model/order.ts create mode 100644 samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/model/pet.ts create mode 100644 samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/model/tag.ts create mode 100644 samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/model/user.ts create mode 100644 samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/variables.ts create mode 100644 samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/.gitignore create mode 100644 samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/.openapi-generator-ignore create mode 100644 samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/.openapi-generator/FILES create mode 100644 samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/.openapi-generator/VERSION create mode 100644 samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/README.md create mode 100644 samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/api.module.ts create mode 100644 samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/api/api.ts create mode 100644 samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/api/pet.service.ts create mode 100644 samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/api/store.service.ts create mode 100644 samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/api/user.service.ts create mode 100644 samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/configuration.ts create mode 100644 samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/encoder.ts create mode 100644 samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/git_push.sh create mode 100644 samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/index.ts create mode 100644 samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/model/apiResponse.ts create mode 100644 samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/model/category.ts create mode 100644 samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/model/models.ts create mode 100644 samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/model/order.ts create mode 100644 samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/model/pet.ts create mode 100644 samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/model/tag.ts create mode 100644 samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/model/user.ts create mode 100644 samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/ng-package.json create mode 100644 samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/package.json create mode 100644 samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/tsconfig.json create mode 100644 samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/variables.ts diff --git a/bin/configs/typescript-angular-v10-provided-in-root-with-npm.yaml b/bin/configs/typescript-angular-v10-provided-in-root-with-npm.yaml new file mode 100644 index 000000000000..12874213fa74 --- /dev/null +++ b/bin/configs/typescript-angular-v10-provided-in-root-with-npm.yaml @@ -0,0 +1,9 @@ +generatorName: typescript-angular +outputDir: samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +additionalProperties: + ngVersion: 10.0.0 + npmVersion: 1.0.0 + npmName: '@openapitools/typescript-angular-petstore' + npmRepository: https://skimdb.npmjs.com/registry + snapshot: false diff --git a/bin/configs/typescript-angular-v10-provided-in-root.yaml b/bin/configs/typescript-angular-v10-provided-in-root.yaml new file mode 100644 index 000000000000..3f8a062cb6a0 --- /dev/null +++ b/bin/configs/typescript-angular-v10-provided-in-root.yaml @@ -0,0 +1,5 @@ +generatorName: typescript-angular +outputDir: samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +additionalProperties: + ngVersion: 10.0.0 diff --git a/bin/configs/typescript-angular-v9-provided-in-root-with-npm.yaml b/bin/configs/typescript-angular-v9-provided-in-root-with-npm.yaml new file mode 100644 index 000000000000..7a0b1c3df776 --- /dev/null +++ b/bin/configs/typescript-angular-v9-provided-in-root-with-npm.yaml @@ -0,0 +1,9 @@ +generatorName: typescript-angular +outputDir: samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +additionalProperties: + ngVersion: 9.0.0 + npmVersion: 1.0.0 + npmName: '@openapitools/typescript-angular-petstore' + npmRepository: https://skimdb.npmjs.com/registry + snapshot: false diff --git a/bin/configs/typescript-angular-v9-provided-in-root.yaml b/bin/configs/typescript-angular-v9-provided-in-root.yaml new file mode 100644 index 000000000000..1bcdebaf797b --- /dev/null +++ b/bin/configs/typescript-angular-v9-provided-in-root.yaml @@ -0,0 +1,5 @@ +generatorName: typescript-angular +outputDir: samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +additionalProperties: + ngVersion: 9.0.0 diff --git a/docs/generators/typescript-angular.md b/docs/generators/typescript-angular.md index a8afda57ac1a..9af8d25825ec 100644 --- a/docs/generators/typescript-angular.md +++ b/docs/generators/typescript-angular.md @@ -16,7 +16,7 @@ sidebar_label: typescript-angular |modelFileSuffix|The suffix of the file of the generated model (model<suffix>.ts).| |null| |modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name. Only change it if you provide your own run-time code for (de-)serialization of models| |original| |modelSuffix|The suffix of the generated model.| |null| -|ngVersion|The version of Angular. (At least 6.0.0)| |9.0.0| +|ngVersion|The version of Angular. (At least 6.0.0)| |10.0.0| |npmName|The name under which you want to publish generated npm package. Required to generate a full package| |null| |npmRepository|Use this property to set an url your private npmRepo in the package.json| |null| |npmVersion|The version of your npm package. If not provided, using the version from the OpenAPI specification file.| |1.0.0| diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAngularClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAngularClientCodegen.java index b9632aee1947..2ddd43eb04de 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAngularClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAngularClientCodegen.java @@ -61,7 +61,7 @@ public static enum QUERY_PARAM_OBJECT_FORMAT_TYPE {dot, json, key}; public static final String STRING_ENUMS_DESC = "Generate string enums instead of objects for enum values."; public static final String QUERY_PARAM_OBJECT_FORMAT = "queryParamObjectFormat"; - protected String ngVersion = "9.0.0"; + protected String ngVersion = "10.0.0"; protected String npmRepository = null; private boolean useSingleRequestParameter = false; protected String serviceSuffix = "Service"; @@ -129,7 +129,7 @@ public String getName() { @Override public String getHelp() { - return "Generates a TypeScript Angular (6.x - 9.x) client library."; + return "Generates a TypeScript Angular (6.x - 10.x) client library."; } @Override @@ -246,7 +246,9 @@ private void addNpmPackageGeneration(SemVer ngVersion) { } // Set the typescript version compatible to the Angular version - if (ngVersion.atLeast("9.0.0")) { + if (ngVersion.atLeast("10.0.0")) { + additionalProperties.put("tsVersion", ">=3.9.2 <4.0.0"); + } else if (ngVersion.atLeast("9.0.0")) { additionalProperties.put("tsVersion", ">=3.6.0 <3.8.0"); } else if (ngVersion.atLeast("8.0.0")) { additionalProperties.put("tsVersion", ">=3.4.0 <3.6.0"); @@ -258,7 +260,9 @@ private void addNpmPackageGeneration(SemVer ngVersion) { } // Set the rxJS version compatible to the Angular version - if (ngVersion.atLeast("9.0.0")) { + if (ngVersion.atLeast("10.0.0")) { + additionalProperties.put("rxjsVersion", "6.6.0"); + } else if (ngVersion.atLeast("9.0.0")) { additionalProperties.put("rxjsVersion", "6.5.3"); } else if (ngVersion.atLeast("8.0.0")) { additionalProperties.put("rxjsVersion", "6.5.0"); @@ -272,7 +276,10 @@ private void addNpmPackageGeneration(SemVer ngVersion) { supportingFiles.add(new SupportingFile("ng-package.mustache", getIndexDirectory(), "ng-package.json")); // Specific ng-packagr configuration - if (ngVersion.atLeast("9.0.0")) { + if (ngVersion.atLeast("10.0.0")) { + additionalProperties.put("ngPackagrVersion", "10.0.3"); + additionalProperties.put("tsickleVersion", "0.39.1"); + } else if (ngVersion.atLeast("9.0.0")) { additionalProperties.put("ngPackagrVersion", "9.0.1"); additionalProperties.put("tsickleVersion", "0.38.0"); } else if (ngVersion.atLeast("8.0.0")) { diff --git a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/.gitignore b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/.gitignore new file mode 100644 index 000000000000..149b57654723 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/.gitignore @@ -0,0 +1,4 @@ +wwwroot/*.js +node_modules +typings +dist diff --git a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/.openapi-generator-ignore b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/.openapi-generator-ignore new file mode 100644 index 000000000000..7484ee590a38 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/.openapi-generator/FILES b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/.openapi-generator/FILES new file mode 100644 index 000000000000..bc66e2a3865f --- /dev/null +++ b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/.openapi-generator/FILES @@ -0,0 +1,19 @@ +.gitignore +README.md +api.module.ts +api/api.ts +api/pet.service.ts +api/store.service.ts +api/user.service.ts +configuration.ts +encoder.ts +git_push.sh +index.ts +model/./apiResponse.ts +model/./category.ts +model/./order.ts +model/./pet.ts +model/./tag.ts +model/./user.ts +model/models.ts +variables.ts diff --git a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/.openapi-generator/VERSION new file mode 100644 index 000000000000..d99e7162d01f --- /dev/null +++ b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/.openapi-generator/VERSION @@ -0,0 +1 @@ +5.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/README.md b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/README.md new file mode 100644 index 000000000000..94e4af489d64 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/README.md @@ -0,0 +1,203 @@ +## @ + +### Building + +To install the required dependencies and to build the typescript sources run: +``` +npm install +npm run build +``` + +### publishing + +First build the package then run ```npm publish dist``` (don't forget to specify the `dist` folder!) + +### consuming + +Navigate to the folder of your consuming project and run one of next commands. + +_published:_ + +``` +npm install @ --save +``` + +_without publishing (not recommended):_ + +``` +npm install PATH_TO_GENERATED_PACKAGE/dist.tgz --save +``` + +_It's important to take the tgz file, otherwise you'll get trouble with links on windows_ + +_using `npm link`:_ + +In PATH_TO_GENERATED_PACKAGE/dist: +``` +npm link +``` + +In your project: +``` +npm link +``` + +__Note for Windows users:__ The Angular CLI has troubles to use linked npm packages. +Please refer to this issue https://github.com/angular/angular-cli/issues/8284 for a solution / workaround. +Published packages are not effected by this issue. + + +#### General usage + +In your Angular project: + + +``` +// without configuring providers +import { ApiModule } from ''; +import { HttpClientModule } from '@angular/common/http'; + +@NgModule({ + imports: [ + ApiModule, + // make sure to import the HttpClientModule in the AppModule only, + // see https://github.com/angular/angular/issues/20575 + HttpClientModule + ], + declarations: [ AppComponent ], + providers: [], + bootstrap: [ AppComponent ] +}) +export class AppModule {} +``` + +``` +// configuring providers +import { ApiModule, Configuration, ConfigurationParameters } from ''; + +export function apiConfigFactory (): Configuration => { + const params: ConfigurationParameters = { + // set configuration parameters here. + } + return new Configuration(params); +} + +@NgModule({ + imports: [ ApiModule.forRoot(apiConfigFactory) ], + declarations: [ AppComponent ], + providers: [], + bootstrap: [ AppComponent ] +}) +export class AppModule {} +``` + +``` +// configuring providers with an authentication service that manages your access tokens +import { ApiModule, Configuration } from ''; + +@NgModule({ + imports: [ ApiModule ], + declarations: [ AppComponent ], + providers: [ + { + provide: Configuration, + useFactory: (authService: AuthService) => new Configuration( + { + basePath: environment.apiUrl, + accessToken: authService.getAccessToken.bind(authService) + } + ), + deps: [AuthService], + multi: false + } + ], + bootstrap: [ AppComponent ] +}) +export class AppModule {} +``` + +``` +import { DefaultApi } from ''; + +export class AppComponent { + constructor(private apiGateway: DefaultApi) { } +} +``` + +Note: The ApiModule is restricted to being instantiated once app wide. +This is to ensure that all services are treated as singletons. + +#### Using multiple OpenAPI files / APIs / ApiModules +In order to use multiple `ApiModules` generated from different OpenAPI files, +you can create an alias name when importing the modules +in order to avoid naming conflicts: +``` +import { ApiModule } from 'my-api-path'; +import { ApiModule as OtherApiModule } from 'my-other-api-path'; +import { HttpClientModule } from '@angular/common/http'; + +@NgModule({ + imports: [ + ApiModule, + OtherApiModule, + // make sure to import the HttpClientModule in the AppModule only, + // see https://github.com/angular/angular/issues/20575 + HttpClientModule + ] +}) +export class AppModule { + +} +``` + + +### Set service base path +If different than the generated base path, during app bootstrap, you can provide the base path to your service. + +``` +import { BASE_PATH } from ''; + +bootstrap(AppComponent, [ + { provide: BASE_PATH, useValue: 'https://your-web-service.com' }, +]); +``` +or + +``` +import { BASE_PATH } from ''; + +@NgModule({ + imports: [], + declarations: [ AppComponent ], + providers: [ provide: BASE_PATH, useValue: 'https://your-web-service.com' ], + bootstrap: [ AppComponent ] +}) +export class AppModule {} +``` + + +#### Using @angular/cli +First extend your `src/environments/*.ts` files by adding the corresponding base path: + +``` +export const environment = { + production: false, + API_BASE_PATH: 'http://127.0.0.1:8080' +}; +``` + +In the src/app/app.module.ts: +``` +import { BASE_PATH } from ''; +import { environment } from '../environments/environment'; + +@NgModule({ + declarations: [ + AppComponent + ], + imports: [ ], + providers: [{ provide: BASE_PATH, useValue: environment.API_BASE_PATH }], + bootstrap: [ AppComponent ] +}) +export class AppModule { } +``` diff --git a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/api.module.ts b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/api.module.ts new file mode 100644 index 000000000000..2afb8f64e926 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/api.module.ts @@ -0,0 +1,33 @@ +import { NgModule, ModuleWithProviders, SkipSelf, Optional } from '@angular/core'; +import { Configuration } from './configuration'; +import { HttpClient } from '@angular/common/http'; + +import { PetService } from './api/pet.service'; +import { StoreService } from './api/store.service'; +import { UserService } from './api/user.service'; + +@NgModule({ + imports: [], + declarations: [], + exports: [], + providers: [] +}) +export class ApiModule { + public static forRoot(configurationFactory: () => Configuration): ModuleWithProviders { + return { + ngModule: ApiModule, + providers: [ { provide: Configuration, useFactory: configurationFactory } ] + }; + } + + constructor( @Optional() @SkipSelf() parentModule: ApiModule, + @Optional() http: HttpClient) { + if (parentModule) { + throw new Error('ApiModule is already loaded. Import in your base AppModule only.'); + } + if (!http) { + throw new Error('You need to import the HttpClientModule in your AppModule! \n' + + 'See also https://github.com/angular/angular/issues/20575'); + } + } +} diff --git a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/api/api.ts b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/api/api.ts new file mode 100644 index 000000000000..8e44b64083d5 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/api/api.ts @@ -0,0 +1,7 @@ +export * from './pet.service'; +import { PetService } from './pet.service'; +export * from './store.service'; +import { StoreService } from './store.service'; +export * from './user.service'; +import { UserService } from './user.service'; +export const APIS = [PetService, StoreService, UserService]; diff --git a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/api/pet.service.ts b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/api/pet.service.ts new file mode 100644 index 000000000000..46fef0be89fe --- /dev/null +++ b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/api/pet.service.ts @@ -0,0 +1,613 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +/* tslint:disable:no-unused-variable member-ordering */ + +import { Inject, Injectable, Optional } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpParams, + HttpResponse, HttpEvent, HttpParameterCodec } from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; + +import { ApiResponse } from '../model/models'; +import { Pet } from '../model/models'; + +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; + + + +@Injectable({ + providedIn: 'root' +}) +export class PetService { + + protected basePath = 'http://petstore.swagger.io/v2'; + public defaultHeaders = new HttpHeaders(); + public configuration = new Configuration(); + public encoder: HttpParameterCodec; + + constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string, @Optional() configuration: Configuration) { + if (configuration) { + this.configuration = configuration; + } + if (typeof this.configuration.basePath !== 'string') { + if (typeof basePath !== 'string') { + basePath = this.basePath; + } + this.configuration.basePath = basePath; + } + this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); + } + + /** + * @param consumes string[] mime-types + * @return true: consumes contains 'multipart/form-data', false: otherwise + */ + private canConsumeForm(consumes: string[]): boolean { + const form = 'multipart/form-data'; + for (const consume of consumes) { + if (form === consume) { + return true; + } + } + return false; + } + + private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object" && value instanceof Date === false) { + httpParams = this.addToHttpParamsRecursive(httpParams, value); + } else { + httpParams = this.addToHttpParamsRecursive(httpParams, value, key); + } + return httpParams; + } + + private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { + if (value == null) { + return httpParams; + } + + if (typeof value === "object") { + if (Array.isArray(value)) { + (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); + } else if (value instanceof Date) { + if (key != null) { + httpParams = httpParams.append(key, + (value as Date).toISOString().substr(0, 10)); + } else { + throw Error("key may not be null if value is Date"); + } + } else { + Object.keys(value).forEach( k => httpParams = this.addToHttpParamsRecursive( + httpParams, value[k], key != null ? `${key}.${k}` : k)); + } + } else if (key != null) { + httpParams = httpParams.append(key, value); + } else { + throw Error("key may not be null if value is not object or array"); + } + return httpParams; + } + + /** + * Add a new pet to the store + * @param body Pet object that needs to be added to the store + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public addPet(body: Pet, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; + public addPet(body: Pet, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; + public addPet(body: Pet, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; + public addPet(body: Pet, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling addPet.'); + } + + let headers = this.defaultHeaders; + + let credential: string | undefined; + // authentication (petstore_auth) required + credential = this.configuration.lookupCredential('petstore_auth'); + if (credential) { + headers = headers.set('Authorization', 'Bearer ' + credential); + } + + let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (httpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/json', + 'application/xml' + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + headers = headers.set('Content-Type', httpContentTypeSelected); + } + + let responseType: 'text' | 'json' = 'json'; + if(httpHeaderAcceptSelected && httpHeaderAcceptSelected.startsWith('text')) { + responseType = 'text'; + } + + return this.httpClient.post(`${this.configuration.basePath}/pet`, + body, + { + responseType: responseType, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Deletes a pet + * @param petId Pet id to delete + * @param apiKey + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public deletePet(petId: number, apiKey?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; + public deletePet(petId: number, apiKey?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; + public deletePet(petId: number, apiKey?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; + public deletePet(petId: number, apiKey?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + if (petId === null || petId === undefined) { + throw new Error('Required parameter petId was null or undefined when calling deletePet.'); + } + + let headers = this.defaultHeaders; + if (apiKey !== undefined && apiKey !== null) { + headers = headers.set('api_key', String(apiKey)); + } + + let credential: string | undefined; + // authentication (petstore_auth) required + credential = this.configuration.lookupCredential('petstore_auth'); + if (credential) { + headers = headers.set('Authorization', 'Bearer ' + credential); + } + + let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (httpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + + let responseType: 'text' | 'json' = 'json'; + if(httpHeaderAcceptSelected && httpHeaderAcceptSelected.startsWith('text')) { + responseType = 'text'; + } + + return this.httpClient.delete(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, + { + responseType: responseType, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Finds Pets by status + * Multiple status values can be provided with comma separated strings + * @param status Status values that need to be considered for filter + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>>; + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>>; + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + if (status === null || status === undefined) { + throw new Error('Required parameter status was null or undefined when calling findPetsByStatus.'); + } + + let queryParameters = new HttpParams({encoder: this.encoder}); + if (status) { + queryParameters = this.addToHttpParams(queryParameters, + status.join(COLLECTION_FORMATS['csv']), 'status'); + } + + let headers = this.defaultHeaders; + + let credential: string | undefined; + // authentication (petstore_auth) required + credential = this.configuration.lookupCredential('petstore_auth'); + if (credential) { + headers = headers.set('Authorization', 'Bearer ' + credential); + } + + let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (httpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/xml', + 'application/json' + ]; + httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + + let responseType: 'text' | 'json' = 'json'; + if(httpHeaderAcceptSelected && httpHeaderAcceptSelected.startsWith('text')) { + responseType = 'text'; + } + + return this.httpClient.get>(`${this.configuration.basePath}/pet/findByStatus`, + { + params: queryParameters, + responseType: responseType, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * @param tags Tags to filter by + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + * @deprecated + */ + public findPetsByTags(tags: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; + public findPetsByTags(tags: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>>; + public findPetsByTags(tags: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>>; + public findPetsByTags(tags: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + if (tags === null || tags === undefined) { + throw new Error('Required parameter tags was null or undefined when calling findPetsByTags.'); + } + + let queryParameters = new HttpParams({encoder: this.encoder}); + if (tags) { + queryParameters = this.addToHttpParams(queryParameters, + tags.join(COLLECTION_FORMATS['csv']), 'tags'); + } + + let headers = this.defaultHeaders; + + let credential: string | undefined; + // authentication (petstore_auth) required + credential = this.configuration.lookupCredential('petstore_auth'); + if (credential) { + headers = headers.set('Authorization', 'Bearer ' + credential); + } + + let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (httpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/xml', + 'application/json' + ]; + httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + + let responseType: 'text' | 'json' = 'json'; + if(httpHeaderAcceptSelected && httpHeaderAcceptSelected.startsWith('text')) { + responseType = 'text'; + } + + return this.httpClient.get>(`${this.configuration.basePath}/pet/findByTags`, + { + params: queryParameters, + responseType: responseType, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Find pet by ID + * Returns a single pet + * @param petId ID of pet to return + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getPetById(petId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable; + public getPetById(petId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; + public getPetById(petId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; + public getPetById(petId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + if (petId === null || petId === undefined) { + throw new Error('Required parameter petId was null or undefined when calling getPetById.'); + } + + let headers = this.defaultHeaders; + + let credential: string | undefined; + // authentication (api_key) required + credential = this.configuration.lookupCredential('api_key'); + if (credential) { + headers = headers.set('api_key', credential); + } + + let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (httpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/xml', + 'application/json' + ]; + httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + + let responseType: 'text' | 'json' = 'json'; + if(httpHeaderAcceptSelected && httpHeaderAcceptSelected.startsWith('text')) { + responseType = 'text'; + } + + return this.httpClient.get(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, + { + responseType: responseType, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Update an existing pet + * @param body Pet object that needs to be added to the store + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public updatePet(body: Pet, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; + public updatePet(body: Pet, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; + public updatePet(body: Pet, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; + public updatePet(body: Pet, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling updatePet.'); + } + + let headers = this.defaultHeaders; + + let credential: string | undefined; + // authentication (petstore_auth) required + credential = this.configuration.lookupCredential('petstore_auth'); + if (credential) { + headers = headers.set('Authorization', 'Bearer ' + credential); + } + + let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (httpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/json', + 'application/xml' + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + headers = headers.set('Content-Type', httpContentTypeSelected); + } + + let responseType: 'text' | 'json' = 'json'; + if(httpHeaderAcceptSelected && httpHeaderAcceptSelected.startsWith('text')) { + responseType = 'text'; + } + + return this.httpClient.put(`${this.configuration.basePath}/pet`, + body, + { + responseType: responseType, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Updates a pet in the store with form data + * @param petId ID of pet that needs to be updated + * @param name Updated name of the pet + * @param status Updated status of the pet + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; + public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; + public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; + public updatePetWithForm(petId: number, name?: string, status?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + if (petId === null || petId === undefined) { + throw new Error('Required parameter petId was null or undefined when calling updatePetWithForm.'); + } + + let headers = this.defaultHeaders; + + let credential: string | undefined; + // authentication (petstore_auth) required + credential = this.configuration.lookupCredential('petstore_auth'); + if (credential) { + headers = headers.set('Authorization', 'Bearer ' + credential); + } + + let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (httpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/x-www-form-urlencoded' + ]; + + const canConsumeForm = this.canConsumeForm(consumes); + + let formParams: { append(param: string, value: any): any; }; + let useForm = false; + let convertFormParamsToString = false; + if (useForm) { + formParams = new FormData(); + } else { + formParams = new HttpParams({encoder: this.encoder}); + } + + if (name !== undefined) { + formParams = formParams.append('name', name) as any || formParams; + } + if (status !== undefined) { + formParams = formParams.append('status', status) as any || formParams; + } + + let responseType: 'text' | 'json' = 'json'; + if(httpHeaderAcceptSelected && httpHeaderAcceptSelected.startsWith('text')) { + responseType = 'text'; + } + + return this.httpClient.post(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, + convertFormParamsToString ? formParams.toString() : formParams, + { + responseType: responseType, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * uploads an image + * @param petId ID of pet to update + * @param additionalMetadata Additional data to pass to server + * @param file file to upload + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable; + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>; + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>; + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json'}): Observable { + if (petId === null || petId === undefined) { + throw new Error('Required parameter petId was null or undefined when calling uploadFile.'); + } + + let headers = this.defaultHeaders; + + let credential: string | undefined; + // authentication (petstore_auth) required + credential = this.configuration.lookupCredential('petstore_auth'); + if (credential) { + headers = headers.set('Authorization', 'Bearer ' + credential); + } + + let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (httpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/json' + ]; + httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + // to determine the Content-Type header + const consumes: string[] = [ + 'multipart/form-data' + ]; + + const canConsumeForm = this.canConsumeForm(consumes); + + let formParams: { append(param: string, value: any): any; }; + let useForm = false; + let convertFormParamsToString = false; + // use FormData to transmit files using content-type "multipart/form-data" + // see https://stackoverflow.com/questions/4007969/application-x-www-form-urlencoded-or-multipart-form-data + useForm = canConsumeForm; + if (useForm) { + formParams = new FormData(); + } else { + formParams = new HttpParams({encoder: this.encoder}); + } + + if (additionalMetadata !== undefined) { + formParams = formParams.append('additionalMetadata', additionalMetadata) as any || formParams; + } + if (file !== undefined) { + formParams = formParams.append('file', file) as any || formParams; + } + + let responseType: 'text' | 'json' = 'json'; + if(httpHeaderAcceptSelected && httpHeaderAcceptSelected.startsWith('text')) { + responseType = 'text'; + } + + return this.httpClient.post(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}/uploadImage`, + convertFormParamsToString ? formParams.toString() : formParams, + { + responseType: responseType, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + +} diff --git a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/api/store.service.ts b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/api/store.service.ts new file mode 100644 index 000000000000..d5d08ab3adc3 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/api/store.service.ts @@ -0,0 +1,283 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +/* tslint:disable:no-unused-variable member-ordering */ + +import { Inject, Injectable, Optional } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpParams, + HttpResponse, HttpEvent, HttpParameterCodec } from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; + +import { Order } from '../model/models'; + +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; + + + +@Injectable({ + providedIn: 'root' +}) +export class StoreService { + + protected basePath = 'http://petstore.swagger.io/v2'; + public defaultHeaders = new HttpHeaders(); + public configuration = new Configuration(); + public encoder: HttpParameterCodec; + + constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string, @Optional() configuration: Configuration) { + if (configuration) { + this.configuration = configuration; + } + if (typeof this.configuration.basePath !== 'string') { + if (typeof basePath !== 'string') { + basePath = this.basePath; + } + this.configuration.basePath = basePath; + } + this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); + } + + + private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object" && value instanceof Date === false) { + httpParams = this.addToHttpParamsRecursive(httpParams, value); + } else { + httpParams = this.addToHttpParamsRecursive(httpParams, value, key); + } + return httpParams; + } + + private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { + if (value == null) { + return httpParams; + } + + if (typeof value === "object") { + if (Array.isArray(value)) { + (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); + } else if (value instanceof Date) { + if (key != null) { + httpParams = httpParams.append(key, + (value as Date).toISOString().substr(0, 10)); + } else { + throw Error("key may not be null if value is Date"); + } + } else { + Object.keys(value).forEach( k => httpParams = this.addToHttpParamsRecursive( + httpParams, value[k], key != null ? `${key}.${k}` : k)); + } + } else if (key != null) { + httpParams = httpParams.append(key, value); + } else { + throw Error("key may not be null if value is not object or array"); + } + return httpParams; + } + + /** + * Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * @param orderId ID of the order that needs to be deleted + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public deleteOrder(orderId: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; + public deleteOrder(orderId: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; + public deleteOrder(orderId: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; + public deleteOrder(orderId: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + if (orderId === null || orderId === undefined) { + throw new Error('Required parameter orderId was null or undefined when calling deleteOrder.'); + } + + let headers = this.defaultHeaders; + + let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (httpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + + let responseType: 'text' | 'json' = 'json'; + if(httpHeaderAcceptSelected && httpHeaderAcceptSelected.startsWith('text')) { + responseType = 'text'; + } + + return this.httpClient.delete(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, + { + responseType: responseType, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Returns pet inventories by status + * Returns a map of status codes to quantities + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getInventory(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable<{ [key: string]: number; }>; + public getInventory(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>; + public getInventory(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>; + public getInventory(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json'}): Observable { + + let headers = this.defaultHeaders; + + let credential: string | undefined; + // authentication (api_key) required + credential = this.configuration.lookupCredential('api_key'); + if (credential) { + headers = headers.set('api_key', credential); + } + + let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (httpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/json' + ]; + httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + + let responseType: 'text' | 'json' = 'json'; + if(httpHeaderAcceptSelected && httpHeaderAcceptSelected.startsWith('text')) { + responseType = 'text'; + } + + return this.httpClient.get<{ [key: string]: number; }>(`${this.configuration.basePath}/store/inventory`, + { + responseType: responseType, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * @param orderId ID of pet that needs to be fetched + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getOrderById(orderId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable; + public getOrderById(orderId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; + public getOrderById(orderId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; + public getOrderById(orderId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + if (orderId === null || orderId === undefined) { + throw new Error('Required parameter orderId was null or undefined when calling getOrderById.'); + } + + let headers = this.defaultHeaders; + + let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (httpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/xml', + 'application/json' + ]; + httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + + let responseType: 'text' | 'json' = 'json'; + if(httpHeaderAcceptSelected && httpHeaderAcceptSelected.startsWith('text')) { + responseType = 'text'; + } + + return this.httpClient.get(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, + { + responseType: responseType, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Place an order for a pet + * @param body order placed for purchasing the pet + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public placeOrder(body: Order, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable; + public placeOrder(body: Order, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; + public placeOrder(body: Order, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; + public placeOrder(body: Order, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling placeOrder.'); + } + + let headers = this.defaultHeaders; + + let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (httpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/xml', + 'application/json' + ]; + httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + + // to determine the Content-Type header + const consumes: string[] = [ + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + headers = headers.set('Content-Type', httpContentTypeSelected); + } + + let responseType: 'text' | 'json' = 'json'; + if(httpHeaderAcceptSelected && httpHeaderAcceptSelected.startsWith('text')) { + responseType = 'text'; + } + + return this.httpClient.post(`${this.configuration.basePath}/store/order`, + body, + { + responseType: responseType, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + +} diff --git a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/api/user.service.ts b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/api/user.service.ts new file mode 100644 index 000000000000..399676219054 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/api/user.service.ts @@ -0,0 +1,497 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +/* tslint:disable:no-unused-variable member-ordering */ + +import { Inject, Injectable, Optional } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpParams, + HttpResponse, HttpEvent, HttpParameterCodec } from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; + +import { User } from '../model/models'; + +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; + + + +@Injectable({ + providedIn: 'root' +}) +export class UserService { + + protected basePath = 'http://petstore.swagger.io/v2'; + public defaultHeaders = new HttpHeaders(); + public configuration = new Configuration(); + public encoder: HttpParameterCodec; + + constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string, @Optional() configuration: Configuration) { + if (configuration) { + this.configuration = configuration; + } + if (typeof this.configuration.basePath !== 'string') { + if (typeof basePath !== 'string') { + basePath = this.basePath; + } + this.configuration.basePath = basePath; + } + this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); + } + + + private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object" && value instanceof Date === false) { + httpParams = this.addToHttpParamsRecursive(httpParams, value); + } else { + httpParams = this.addToHttpParamsRecursive(httpParams, value, key); + } + return httpParams; + } + + private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { + if (value == null) { + return httpParams; + } + + if (typeof value === "object") { + if (Array.isArray(value)) { + (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); + } else if (value instanceof Date) { + if (key != null) { + httpParams = httpParams.append(key, + (value as Date).toISOString().substr(0, 10)); + } else { + throw Error("key may not be null if value is Date"); + } + } else { + Object.keys(value).forEach( k => httpParams = this.addToHttpParamsRecursive( + httpParams, value[k], key != null ? `${key}.${k}` : k)); + } + } else if (key != null) { + httpParams = httpParams.append(key, value); + } else { + throw Error("key may not be null if value is not object or array"); + } + return httpParams; + } + + /** + * Create user + * This can only be done by the logged in user. + * @param body Created user object + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public createUser(body: User, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; + public createUser(body: User, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; + public createUser(body: User, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; + public createUser(body: User, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling createUser.'); + } + + let headers = this.defaultHeaders; + + let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (httpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + + // to determine the Content-Type header + const consumes: string[] = [ + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + headers = headers.set('Content-Type', httpContentTypeSelected); + } + + let responseType: 'text' | 'json' = 'json'; + if(httpHeaderAcceptSelected && httpHeaderAcceptSelected.startsWith('text')) { + responseType = 'text'; + } + + return this.httpClient.post(`${this.configuration.basePath}/user`, + body, + { + responseType: responseType, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Creates list of users with given input array + * @param body List of user object + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public createUsersWithArrayInput(body: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; + public createUsersWithArrayInput(body: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; + public createUsersWithArrayInput(body: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; + public createUsersWithArrayInput(body: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling createUsersWithArrayInput.'); + } + + let headers = this.defaultHeaders; + + let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (httpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + + // to determine the Content-Type header + const consumes: string[] = [ + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + headers = headers.set('Content-Type', httpContentTypeSelected); + } + + let responseType: 'text' | 'json' = 'json'; + if(httpHeaderAcceptSelected && httpHeaderAcceptSelected.startsWith('text')) { + responseType = 'text'; + } + + return this.httpClient.post(`${this.configuration.basePath}/user/createWithArray`, + body, + { + responseType: responseType, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Creates list of users with given input array + * @param body List of user object + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public createUsersWithListInput(body: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; + public createUsersWithListInput(body: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; + public createUsersWithListInput(body: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; + public createUsersWithListInput(body: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling createUsersWithListInput.'); + } + + let headers = this.defaultHeaders; + + let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (httpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + + // to determine the Content-Type header + const consumes: string[] = [ + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + headers = headers.set('Content-Type', httpContentTypeSelected); + } + + let responseType: 'text' | 'json' = 'json'; + if(httpHeaderAcceptSelected && httpHeaderAcceptSelected.startsWith('text')) { + responseType = 'text'; + } + + return this.httpClient.post(`${this.configuration.basePath}/user/createWithList`, + body, + { + responseType: responseType, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Delete user + * This can only be done by the logged in user. + * @param username The name that needs to be deleted + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public deleteUser(username: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; + public deleteUser(username: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; + public deleteUser(username: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; + public deleteUser(username: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + if (username === null || username === undefined) { + throw new Error('Required parameter username was null or undefined when calling deleteUser.'); + } + + let headers = this.defaultHeaders; + + let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (httpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + + let responseType: 'text' | 'json' = 'json'; + if(httpHeaderAcceptSelected && httpHeaderAcceptSelected.startsWith('text')) { + responseType = 'text'; + } + + return this.httpClient.delete(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, + { + responseType: responseType, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Get user by user name + * @param username The name that needs to be fetched. Use user1 for testing. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getUserByName(username: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable; + public getUserByName(username: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; + public getUserByName(username: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; + public getUserByName(username: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + if (username === null || username === undefined) { + throw new Error('Required parameter username was null or undefined when calling getUserByName.'); + } + + let headers = this.defaultHeaders; + + let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (httpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/xml', + 'application/json' + ]; + httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + + let responseType: 'text' | 'json' = 'json'; + if(httpHeaderAcceptSelected && httpHeaderAcceptSelected.startsWith('text')) { + responseType = 'text'; + } + + return this.httpClient.get(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, + { + responseType: responseType, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Logs user into the system + * @param username The user name for login + * @param password The password for login in clear text + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public loginUser(username: string, password: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable; + public loginUser(username: string, password: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; + public loginUser(username: string, password: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; + public loginUser(username: string, password: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + if (username === null || username === undefined) { + throw new Error('Required parameter username was null or undefined when calling loginUser.'); + } + if (password === null || password === undefined) { + throw new Error('Required parameter password was null or undefined when calling loginUser.'); + } + + let queryParameters = new HttpParams({encoder: this.encoder}); + if (username !== undefined && username !== null) { + queryParameters = this.addToHttpParams(queryParameters, + username, 'username'); + } + if (password !== undefined && password !== null) { + queryParameters = this.addToHttpParams(queryParameters, + password, 'password'); + } + + let headers = this.defaultHeaders; + + let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (httpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/xml', + 'application/json' + ]; + httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + + let responseType: 'text' | 'json' = 'json'; + if(httpHeaderAcceptSelected && httpHeaderAcceptSelected.startsWith('text')) { + responseType = 'text'; + } + + return this.httpClient.get(`${this.configuration.basePath}/user/login`, + { + params: queryParameters, + responseType: responseType, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Logs out current logged in user session + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public logoutUser(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; + public logoutUser(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; + public logoutUser(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; + public logoutUser(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + + let headers = this.defaultHeaders; + + let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (httpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + + let responseType: 'text' | 'json' = 'json'; + if(httpHeaderAcceptSelected && httpHeaderAcceptSelected.startsWith('text')) { + responseType = 'text'; + } + + return this.httpClient.get(`${this.configuration.basePath}/user/logout`, + { + responseType: responseType, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Updated user + * This can only be done by the logged in user. + * @param username name that need to be deleted + * @param body Updated user object + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public updateUser(username: string, body: User, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; + public updateUser(username: string, body: User, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; + public updateUser(username: string, body: User, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; + public updateUser(username: string, body: User, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + if (username === null || username === undefined) { + throw new Error('Required parameter username was null or undefined when calling updateUser.'); + } + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling updateUser.'); + } + + let headers = this.defaultHeaders; + + let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (httpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + + // to determine the Content-Type header + const consumes: string[] = [ + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + headers = headers.set('Content-Type', httpContentTypeSelected); + } + + let responseType: 'text' | 'json' = 'json'; + if(httpHeaderAcceptSelected && httpHeaderAcceptSelected.startsWith('text')) { + responseType = 'text'; + } + + return this.httpClient.put(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, + body, + { + responseType: responseType, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + +} diff --git a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/configuration.ts b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/configuration.ts new file mode 100644 index 000000000000..38126642420d --- /dev/null +++ b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/configuration.ts @@ -0,0 +1,137 @@ +import { HttpParameterCodec } from '@angular/common/http'; + +export interface ConfigurationParameters { + /** + * @deprecated Since 5.0. Use credentials instead + */ + apiKeys?: {[ key: string ]: string}; + username?: string; + password?: string; + /** + * @deprecated Since 5.0. Use credentials instead + */ + accessToken?: string | (() => string); + basePath?: string; + withCredentials?: boolean; + encoder?: HttpParameterCodec; + /** + * The keys are the names in the securitySchemes section of the OpenAPI + * document. They should map to the value used for authentication + * minus any standard prefixes such as 'Basic' or 'Bearer'. + */ + credentials?: {[ key: string ]: string | (() => string | undefined)}; +} + +export class Configuration { + /** + * @deprecated Since 5.0. Use credentials instead + */ + apiKeys?: {[ key: string ]: string}; + username?: string; + password?: string; + /** + * @deprecated Since 5.0. Use credentials instead + */ + accessToken?: string | (() => string); + basePath?: string; + withCredentials?: boolean; + encoder?: HttpParameterCodec; + /** + * The keys are the names in the securitySchemes section of the OpenAPI + * document. They should map to the value used for authentication + * minus any standard prefixes such as 'Basic' or 'Bearer'. + */ + credentials: {[ key: string ]: string | (() => string | undefined)}; + + constructor(configurationParameters: ConfigurationParameters = {}) { + this.apiKeys = configurationParameters.apiKeys; + this.username = configurationParameters.username; + this.password = configurationParameters.password; + this.accessToken = configurationParameters.accessToken; + this.basePath = configurationParameters.basePath; + this.withCredentials = configurationParameters.withCredentials; + this.encoder = configurationParameters.encoder; + if (configurationParameters.credentials) { + this.credentials = configurationParameters.credentials; + } + else { + this.credentials = {}; + } + + // init default api_key credential + if (!this.credentials['api_key']) { + this.credentials['api_key'] = () => { + return this.apiKeys['api_key'] || this.apiKeys['api_key']; + }; + } + + // init default petstore_auth credential + if (!this.credentials['petstore_auth']) { + this.credentials['petstore_auth'] = () => { + return typeof this.accessToken === 'function' + ? this.accessToken() + : this.accessToken; + }; + } + } + + /** + * Select the correct content-type to use for a request. + * Uses {@link Configuration#isJsonMime} to determine the correct content-type. + * If no content type is found return the first found type if the contentTypes is not empty + * @param contentTypes - the array of content types that are available for selection + * @returns the selected content-type or undefined if no selection could be made. + */ + public selectHeaderContentType (contentTypes: string[]): string | undefined { + if (contentTypes.length === 0) { + return undefined; + } + + const type = contentTypes.find((x: string) => this.isJsonMime(x)); + if (type === undefined) { + return contentTypes[0]; + } + return type; + } + + /** + * Select the correct accept content-type to use for a request. + * Uses {@link Configuration#isJsonMime} to determine the correct accept content-type. + * If no content type is found return the first found type if the contentTypes is not empty + * @param accepts - the array of content types that are available for selection. + * @returns the selected content-type or undefined if no selection could be made. + */ + public selectHeaderAccept(accepts: string[]): string | undefined { + if (accepts.length === 0) { + return undefined; + } + + const type = accepts.find((x: string) => this.isJsonMime(x)); + if (type === undefined) { + return accepts[0]; + } + return type; + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * application/vnd.company+json + * @param mime - MIME (Multipurpose Internet Mail Extensions) + * @return True if the given MIME is JSON, false otherwise. + */ + public isJsonMime(mime: string): boolean { + const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); + return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); + } + + public lookupCredential(key: string): string | undefined { + const value = this.credentials[key]; + return typeof value === 'function' + ? value() + : value; + } +} diff --git a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/encoder.ts b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/encoder.ts new file mode 100644 index 000000000000..138c4d5cf2c1 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/encoder.ts @@ -0,0 +1,20 @@ +import { HttpParameterCodec } from '@angular/common/http'; + +/** + * Custom HttpParameterCodec + * Workaround for https://github.com/angular/angular/issues/18261 + */ +export class CustomHttpParameterCodec implements HttpParameterCodec { + encodeKey(k: string): string { + return encodeURIComponent(k); + } + encodeValue(v: string): string { + return encodeURIComponent(v); + } + decodeKey(k: string): string { + return decodeURIComponent(k); + } + decodeValue(v: string): string { + return decodeURIComponent(v); + } +} diff --git a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/git_push.sh b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/git_push.sh new file mode 100644 index 000000000000..ced3be2b0c7b --- /dev/null +++ b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/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/client/petstore/typescript-angular-v10-provided-in-root/builds/default/index.ts b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/index.ts new file mode 100644 index 000000000000..c312b70fa3ef --- /dev/null +++ b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/index.ts @@ -0,0 +1,5 @@ +export * from './api/api'; +export * from './model/models'; +export * from './variables'; +export * from './configuration'; +export * from './api.module'; \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/model/apiResponse.ts b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/model/apiResponse.ts new file mode 100644 index 000000000000..682ba478921e --- /dev/null +++ b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/model/apiResponse.ts @@ -0,0 +1,22 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +/** + * Describes the result of uploading an image resource + */ +export interface ApiResponse { + code?: number; + type?: string; + message?: string; +} + diff --git a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/model/category.ts b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/model/category.ts new file mode 100644 index 000000000000..b988b6827a05 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/model/category.ts @@ -0,0 +1,21 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +/** + * A category for a pet + */ +export interface Category { + id?: number; + name?: string; +} + diff --git a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/model/models.ts b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/model/models.ts new file mode 100644 index 000000000000..8607c5dabd0c --- /dev/null +++ b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/model/models.ts @@ -0,0 +1,6 @@ +export * from './apiResponse'; +export * from './category'; +export * from './order'; +export * from './pet'; +export * from './tag'; +export * from './user'; diff --git a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/model/order.ts b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/model/order.ts new file mode 100644 index 000000000000..a29bebe49065 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/model/order.ts @@ -0,0 +1,37 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +/** + * An order for a pets from the pet store + */ +export interface Order { + id?: number; + petId?: number; + quantity?: number; + shipDate?: string; + /** + * Order Status + */ + status?: Order.StatusEnum; + complete?: boolean; +} +export namespace Order { + export type StatusEnum = 'placed' | 'approved' | 'delivered'; + export const StatusEnum = { + Placed: 'placed' as StatusEnum, + Approved: 'approved' as StatusEnum, + Delivered: 'delivered' as StatusEnum + }; +} + + diff --git a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/model/pet.ts b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/model/pet.ts new file mode 100644 index 000000000000..e0404395f91c --- /dev/null +++ b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/model/pet.ts @@ -0,0 +1,39 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { Category } from './category'; +import { Tag } from './tag'; + + +/** + * A pet for sale in the pet store + */ +export interface Pet { + id?: number; + category?: Category; + name: string; + photoUrls: Array; + tags?: Array; + /** + * pet status in the store + */ + status?: Pet.StatusEnum; +} +export namespace Pet { + export type StatusEnum = 'available' | 'pending' | 'sold'; + export const StatusEnum = { + Available: 'available' as StatusEnum, + Pending: 'pending' as StatusEnum, + Sold: 'sold' as StatusEnum + }; +} + + diff --git a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/model/tag.ts b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/model/tag.ts new file mode 100644 index 000000000000..b6ff210e8df4 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/model/tag.ts @@ -0,0 +1,21 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +/** + * A tag for a pet + */ +export interface Tag { + id?: number; + name?: string; +} + diff --git a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/model/user.ts b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/model/user.ts new file mode 100644 index 000000000000..fce51005300c --- /dev/null +++ b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/model/user.ts @@ -0,0 +1,30 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +/** + * A User who is purchasing from the pet store + */ +export interface User { + id?: number; + username?: string; + firstName?: string; + lastName?: string; + email?: string; + password?: string; + phone?: string; + /** + * User Status + */ + userStatus?: number; +} + diff --git a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/variables.ts b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/variables.ts new file mode 100644 index 000000000000..6fe58549f395 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/variables.ts @@ -0,0 +1,9 @@ +import { InjectionToken } from '@angular/core'; + +export const BASE_PATH = new InjectionToken('basePath'); +export const COLLECTION_FORMATS = { + 'csv': ',', + 'tsv': ' ', + 'ssv': ' ', + 'pipes': '|' +} diff --git a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/.gitignore b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/.gitignore new file mode 100644 index 000000000000..149b57654723 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/.gitignore @@ -0,0 +1,4 @@ +wwwroot/*.js +node_modules +typings +dist diff --git a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/.openapi-generator-ignore b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/.openapi-generator-ignore new file mode 100644 index 000000000000..7484ee590a38 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/.openapi-generator/FILES b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/.openapi-generator/FILES new file mode 100644 index 000000000000..a2650d9db088 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/.openapi-generator/FILES @@ -0,0 +1,22 @@ +.gitignore +README.md +api.module.ts +api/api.ts +api/pet.service.ts +api/store.service.ts +api/user.service.ts +configuration.ts +encoder.ts +git_push.sh +index.ts +model/./apiResponse.ts +model/./category.ts +model/./order.ts +model/./pet.ts +model/./tag.ts +model/./user.ts +model/models.ts +ng-package.json +package.json +tsconfig.json +variables.ts diff --git a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/.openapi-generator/VERSION new file mode 100644 index 000000000000..d99e7162d01f --- /dev/null +++ b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/.openapi-generator/VERSION @@ -0,0 +1 @@ +5.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/README.md b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/README.md new file mode 100644 index 000000000000..151fb2f1a505 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/README.md @@ -0,0 +1,203 @@ +## @openapitools/typescript-angular-petstore@1.0.0 + +### Building + +To install the required dependencies and to build the typescript sources run: +``` +npm install +npm run build +``` + +### publishing + +First build the package then run ```npm publish dist``` (don't forget to specify the `dist` folder!) + +### consuming + +Navigate to the folder of your consuming project and run one of next commands. + +_published:_ + +``` +npm install @openapitools/typescript-angular-petstore@1.0.0 --save +``` + +_without publishing (not recommended):_ + +``` +npm install PATH_TO_GENERATED_PACKAGE/dist.tgz --save +``` + +_It's important to take the tgz file, otherwise you'll get trouble with links on windows_ + +_using `npm link`:_ + +In PATH_TO_GENERATED_PACKAGE/dist: +``` +npm link +``` + +In your project: +``` +npm link @openapitools/typescript-angular-petstore +``` + +__Note for Windows users:__ The Angular CLI has troubles to use linked npm packages. +Please refer to this issue https://github.com/angular/angular-cli/issues/8284 for a solution / workaround. +Published packages are not effected by this issue. + + +#### General usage + +In your Angular project: + + +``` +// without configuring providers +import { ApiModule } from '@openapitools/typescript-angular-petstore'; +import { HttpClientModule } from '@angular/common/http'; + +@NgModule({ + imports: [ + ApiModule, + // make sure to import the HttpClientModule in the AppModule only, + // see https://github.com/angular/angular/issues/20575 + HttpClientModule + ], + declarations: [ AppComponent ], + providers: [], + bootstrap: [ AppComponent ] +}) +export class AppModule {} +``` + +``` +// configuring providers +import { ApiModule, Configuration, ConfigurationParameters } from '@openapitools/typescript-angular-petstore'; + +export function apiConfigFactory (): Configuration => { + const params: ConfigurationParameters = { + // set configuration parameters here. + } + return new Configuration(params); +} + +@NgModule({ + imports: [ ApiModule.forRoot(apiConfigFactory) ], + declarations: [ AppComponent ], + providers: [], + bootstrap: [ AppComponent ] +}) +export class AppModule {} +``` + +``` +// configuring providers with an authentication service that manages your access tokens +import { ApiModule, Configuration } from '@openapitools/typescript-angular-petstore'; + +@NgModule({ + imports: [ ApiModule ], + declarations: [ AppComponent ], + providers: [ + { + provide: Configuration, + useFactory: (authService: AuthService) => new Configuration( + { + basePath: environment.apiUrl, + accessToken: authService.getAccessToken.bind(authService) + } + ), + deps: [AuthService], + multi: false + } + ], + bootstrap: [ AppComponent ] +}) +export class AppModule {} +``` + +``` +import { DefaultApi } from '@openapitools/typescript-angular-petstore'; + +export class AppComponent { + constructor(private apiGateway: DefaultApi) { } +} +``` + +Note: The ApiModule is restricted to being instantiated once app wide. +This is to ensure that all services are treated as singletons. + +#### Using multiple OpenAPI files / APIs / ApiModules +In order to use multiple `ApiModules` generated from different OpenAPI files, +you can create an alias name when importing the modules +in order to avoid naming conflicts: +``` +import { ApiModule } from 'my-api-path'; +import { ApiModule as OtherApiModule } from 'my-other-api-path'; +import { HttpClientModule } from '@angular/common/http'; + +@NgModule({ + imports: [ + ApiModule, + OtherApiModule, + // make sure to import the HttpClientModule in the AppModule only, + // see https://github.com/angular/angular/issues/20575 + HttpClientModule + ] +}) +export class AppModule { + +} +``` + + +### Set service base path +If different than the generated base path, during app bootstrap, you can provide the base path to your service. + +``` +import { BASE_PATH } from '@openapitools/typescript-angular-petstore'; + +bootstrap(AppComponent, [ + { provide: BASE_PATH, useValue: 'https://your-web-service.com' }, +]); +``` +or + +``` +import { BASE_PATH } from '@openapitools/typescript-angular-petstore'; + +@NgModule({ + imports: [], + declarations: [ AppComponent ], + providers: [ provide: BASE_PATH, useValue: 'https://your-web-service.com' ], + bootstrap: [ AppComponent ] +}) +export class AppModule {} +``` + + +#### Using @angular/cli +First extend your `src/environments/*.ts` files by adding the corresponding base path: + +``` +export const environment = { + production: false, + API_BASE_PATH: 'http://127.0.0.1:8080' +}; +``` + +In the src/app/app.module.ts: +``` +import { BASE_PATH } from '@openapitools/typescript-angular-petstore'; +import { environment } from '../environments/environment'; + +@NgModule({ + declarations: [ + AppComponent + ], + imports: [ ], + providers: [{ provide: BASE_PATH, useValue: environment.API_BASE_PATH }], + bootstrap: [ AppComponent ] +}) +export class AppModule { } +``` diff --git a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/api.module.ts b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/api.module.ts new file mode 100644 index 000000000000..2afb8f64e926 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/api.module.ts @@ -0,0 +1,33 @@ +import { NgModule, ModuleWithProviders, SkipSelf, Optional } from '@angular/core'; +import { Configuration } from './configuration'; +import { HttpClient } from '@angular/common/http'; + +import { PetService } from './api/pet.service'; +import { StoreService } from './api/store.service'; +import { UserService } from './api/user.service'; + +@NgModule({ + imports: [], + declarations: [], + exports: [], + providers: [] +}) +export class ApiModule { + public static forRoot(configurationFactory: () => Configuration): ModuleWithProviders { + return { + ngModule: ApiModule, + providers: [ { provide: Configuration, useFactory: configurationFactory } ] + }; + } + + constructor( @Optional() @SkipSelf() parentModule: ApiModule, + @Optional() http: HttpClient) { + if (parentModule) { + throw new Error('ApiModule is already loaded. Import in your base AppModule only.'); + } + if (!http) { + throw new Error('You need to import the HttpClientModule in your AppModule! \n' + + 'See also https://github.com/angular/angular/issues/20575'); + } + } +} diff --git a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/api/api.ts b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/api/api.ts new file mode 100644 index 000000000000..8e44b64083d5 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/api/api.ts @@ -0,0 +1,7 @@ +export * from './pet.service'; +import { PetService } from './pet.service'; +export * from './store.service'; +import { StoreService } from './store.service'; +export * from './user.service'; +import { UserService } from './user.service'; +export const APIS = [PetService, StoreService, UserService]; diff --git a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/api/pet.service.ts new file mode 100644 index 000000000000..46fef0be89fe --- /dev/null +++ b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/api/pet.service.ts @@ -0,0 +1,613 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +/* tslint:disable:no-unused-variable member-ordering */ + +import { Inject, Injectable, Optional } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpParams, + HttpResponse, HttpEvent, HttpParameterCodec } from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; + +import { ApiResponse } from '../model/models'; +import { Pet } from '../model/models'; + +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; + + + +@Injectable({ + providedIn: 'root' +}) +export class PetService { + + protected basePath = 'http://petstore.swagger.io/v2'; + public defaultHeaders = new HttpHeaders(); + public configuration = new Configuration(); + public encoder: HttpParameterCodec; + + constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string, @Optional() configuration: Configuration) { + if (configuration) { + this.configuration = configuration; + } + if (typeof this.configuration.basePath !== 'string') { + if (typeof basePath !== 'string') { + basePath = this.basePath; + } + this.configuration.basePath = basePath; + } + this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); + } + + /** + * @param consumes string[] mime-types + * @return true: consumes contains 'multipart/form-data', false: otherwise + */ + private canConsumeForm(consumes: string[]): boolean { + const form = 'multipart/form-data'; + for (const consume of consumes) { + if (form === consume) { + return true; + } + } + return false; + } + + private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object" && value instanceof Date === false) { + httpParams = this.addToHttpParamsRecursive(httpParams, value); + } else { + httpParams = this.addToHttpParamsRecursive(httpParams, value, key); + } + return httpParams; + } + + private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { + if (value == null) { + return httpParams; + } + + if (typeof value === "object") { + if (Array.isArray(value)) { + (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); + } else if (value instanceof Date) { + if (key != null) { + httpParams = httpParams.append(key, + (value as Date).toISOString().substr(0, 10)); + } else { + throw Error("key may not be null if value is Date"); + } + } else { + Object.keys(value).forEach( k => httpParams = this.addToHttpParamsRecursive( + httpParams, value[k], key != null ? `${key}.${k}` : k)); + } + } else if (key != null) { + httpParams = httpParams.append(key, value); + } else { + throw Error("key may not be null if value is not object or array"); + } + return httpParams; + } + + /** + * Add a new pet to the store + * @param body Pet object that needs to be added to the store + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public addPet(body: Pet, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; + public addPet(body: Pet, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; + public addPet(body: Pet, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; + public addPet(body: Pet, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling addPet.'); + } + + let headers = this.defaultHeaders; + + let credential: string | undefined; + // authentication (petstore_auth) required + credential = this.configuration.lookupCredential('petstore_auth'); + if (credential) { + headers = headers.set('Authorization', 'Bearer ' + credential); + } + + let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (httpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/json', + 'application/xml' + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + headers = headers.set('Content-Type', httpContentTypeSelected); + } + + let responseType: 'text' | 'json' = 'json'; + if(httpHeaderAcceptSelected && httpHeaderAcceptSelected.startsWith('text')) { + responseType = 'text'; + } + + return this.httpClient.post(`${this.configuration.basePath}/pet`, + body, + { + responseType: responseType, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Deletes a pet + * @param petId Pet id to delete + * @param apiKey + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public deletePet(petId: number, apiKey?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; + public deletePet(petId: number, apiKey?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; + public deletePet(petId: number, apiKey?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; + public deletePet(petId: number, apiKey?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + if (petId === null || petId === undefined) { + throw new Error('Required parameter petId was null or undefined when calling deletePet.'); + } + + let headers = this.defaultHeaders; + if (apiKey !== undefined && apiKey !== null) { + headers = headers.set('api_key', String(apiKey)); + } + + let credential: string | undefined; + // authentication (petstore_auth) required + credential = this.configuration.lookupCredential('petstore_auth'); + if (credential) { + headers = headers.set('Authorization', 'Bearer ' + credential); + } + + let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (httpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + + let responseType: 'text' | 'json' = 'json'; + if(httpHeaderAcceptSelected && httpHeaderAcceptSelected.startsWith('text')) { + responseType = 'text'; + } + + return this.httpClient.delete(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, + { + responseType: responseType, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Finds Pets by status + * Multiple status values can be provided with comma separated strings + * @param status Status values that need to be considered for filter + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>>; + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>>; + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + if (status === null || status === undefined) { + throw new Error('Required parameter status was null or undefined when calling findPetsByStatus.'); + } + + let queryParameters = new HttpParams({encoder: this.encoder}); + if (status) { + queryParameters = this.addToHttpParams(queryParameters, + status.join(COLLECTION_FORMATS['csv']), 'status'); + } + + let headers = this.defaultHeaders; + + let credential: string | undefined; + // authentication (petstore_auth) required + credential = this.configuration.lookupCredential('petstore_auth'); + if (credential) { + headers = headers.set('Authorization', 'Bearer ' + credential); + } + + let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (httpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/xml', + 'application/json' + ]; + httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + + let responseType: 'text' | 'json' = 'json'; + if(httpHeaderAcceptSelected && httpHeaderAcceptSelected.startsWith('text')) { + responseType = 'text'; + } + + return this.httpClient.get>(`${this.configuration.basePath}/pet/findByStatus`, + { + params: queryParameters, + responseType: responseType, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * @param tags Tags to filter by + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + * @deprecated + */ + public findPetsByTags(tags: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; + public findPetsByTags(tags: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>>; + public findPetsByTags(tags: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>>; + public findPetsByTags(tags: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + if (tags === null || tags === undefined) { + throw new Error('Required parameter tags was null or undefined when calling findPetsByTags.'); + } + + let queryParameters = new HttpParams({encoder: this.encoder}); + if (tags) { + queryParameters = this.addToHttpParams(queryParameters, + tags.join(COLLECTION_FORMATS['csv']), 'tags'); + } + + let headers = this.defaultHeaders; + + let credential: string | undefined; + // authentication (petstore_auth) required + credential = this.configuration.lookupCredential('petstore_auth'); + if (credential) { + headers = headers.set('Authorization', 'Bearer ' + credential); + } + + let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (httpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/xml', + 'application/json' + ]; + httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + + let responseType: 'text' | 'json' = 'json'; + if(httpHeaderAcceptSelected && httpHeaderAcceptSelected.startsWith('text')) { + responseType = 'text'; + } + + return this.httpClient.get>(`${this.configuration.basePath}/pet/findByTags`, + { + params: queryParameters, + responseType: responseType, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Find pet by ID + * Returns a single pet + * @param petId ID of pet to return + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getPetById(petId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable; + public getPetById(petId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; + public getPetById(petId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; + public getPetById(petId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + if (petId === null || petId === undefined) { + throw new Error('Required parameter petId was null or undefined when calling getPetById.'); + } + + let headers = this.defaultHeaders; + + let credential: string | undefined; + // authentication (api_key) required + credential = this.configuration.lookupCredential('api_key'); + if (credential) { + headers = headers.set('api_key', credential); + } + + let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (httpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/xml', + 'application/json' + ]; + httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + + let responseType: 'text' | 'json' = 'json'; + if(httpHeaderAcceptSelected && httpHeaderAcceptSelected.startsWith('text')) { + responseType = 'text'; + } + + return this.httpClient.get(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, + { + responseType: responseType, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Update an existing pet + * @param body Pet object that needs to be added to the store + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public updatePet(body: Pet, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; + public updatePet(body: Pet, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; + public updatePet(body: Pet, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; + public updatePet(body: Pet, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling updatePet.'); + } + + let headers = this.defaultHeaders; + + let credential: string | undefined; + // authentication (petstore_auth) required + credential = this.configuration.lookupCredential('petstore_auth'); + if (credential) { + headers = headers.set('Authorization', 'Bearer ' + credential); + } + + let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (httpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/json', + 'application/xml' + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + headers = headers.set('Content-Type', httpContentTypeSelected); + } + + let responseType: 'text' | 'json' = 'json'; + if(httpHeaderAcceptSelected && httpHeaderAcceptSelected.startsWith('text')) { + responseType = 'text'; + } + + return this.httpClient.put(`${this.configuration.basePath}/pet`, + body, + { + responseType: responseType, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Updates a pet in the store with form data + * @param petId ID of pet that needs to be updated + * @param name Updated name of the pet + * @param status Updated status of the pet + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; + public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; + public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; + public updatePetWithForm(petId: number, name?: string, status?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + if (petId === null || petId === undefined) { + throw new Error('Required parameter petId was null or undefined when calling updatePetWithForm.'); + } + + let headers = this.defaultHeaders; + + let credential: string | undefined; + // authentication (petstore_auth) required + credential = this.configuration.lookupCredential('petstore_auth'); + if (credential) { + headers = headers.set('Authorization', 'Bearer ' + credential); + } + + let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (httpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/x-www-form-urlencoded' + ]; + + const canConsumeForm = this.canConsumeForm(consumes); + + let formParams: { append(param: string, value: any): any; }; + let useForm = false; + let convertFormParamsToString = false; + if (useForm) { + formParams = new FormData(); + } else { + formParams = new HttpParams({encoder: this.encoder}); + } + + if (name !== undefined) { + formParams = formParams.append('name', name) as any || formParams; + } + if (status !== undefined) { + formParams = formParams.append('status', status) as any || formParams; + } + + let responseType: 'text' | 'json' = 'json'; + if(httpHeaderAcceptSelected && httpHeaderAcceptSelected.startsWith('text')) { + responseType = 'text'; + } + + return this.httpClient.post(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, + convertFormParamsToString ? formParams.toString() : formParams, + { + responseType: responseType, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * uploads an image + * @param petId ID of pet to update + * @param additionalMetadata Additional data to pass to server + * @param file file to upload + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable; + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>; + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>; + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json'}): Observable { + if (petId === null || petId === undefined) { + throw new Error('Required parameter petId was null or undefined when calling uploadFile.'); + } + + let headers = this.defaultHeaders; + + let credential: string | undefined; + // authentication (petstore_auth) required + credential = this.configuration.lookupCredential('petstore_auth'); + if (credential) { + headers = headers.set('Authorization', 'Bearer ' + credential); + } + + let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (httpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/json' + ]; + httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + // to determine the Content-Type header + const consumes: string[] = [ + 'multipart/form-data' + ]; + + const canConsumeForm = this.canConsumeForm(consumes); + + let formParams: { append(param: string, value: any): any; }; + let useForm = false; + let convertFormParamsToString = false; + // use FormData to transmit files using content-type "multipart/form-data" + // see https://stackoverflow.com/questions/4007969/application-x-www-form-urlencoded-or-multipart-form-data + useForm = canConsumeForm; + if (useForm) { + formParams = new FormData(); + } else { + formParams = new HttpParams({encoder: this.encoder}); + } + + if (additionalMetadata !== undefined) { + formParams = formParams.append('additionalMetadata', additionalMetadata) as any || formParams; + } + if (file !== undefined) { + formParams = formParams.append('file', file) as any || formParams; + } + + let responseType: 'text' | 'json' = 'json'; + if(httpHeaderAcceptSelected && httpHeaderAcceptSelected.startsWith('text')) { + responseType = 'text'; + } + + return this.httpClient.post(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}/uploadImage`, + convertFormParamsToString ? formParams.toString() : formParams, + { + responseType: responseType, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + +} diff --git a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/api/store.service.ts new file mode 100644 index 000000000000..d5d08ab3adc3 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/api/store.service.ts @@ -0,0 +1,283 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +/* tslint:disable:no-unused-variable member-ordering */ + +import { Inject, Injectable, Optional } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpParams, + HttpResponse, HttpEvent, HttpParameterCodec } from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; + +import { Order } from '../model/models'; + +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; + + + +@Injectable({ + providedIn: 'root' +}) +export class StoreService { + + protected basePath = 'http://petstore.swagger.io/v2'; + public defaultHeaders = new HttpHeaders(); + public configuration = new Configuration(); + public encoder: HttpParameterCodec; + + constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string, @Optional() configuration: Configuration) { + if (configuration) { + this.configuration = configuration; + } + if (typeof this.configuration.basePath !== 'string') { + if (typeof basePath !== 'string') { + basePath = this.basePath; + } + this.configuration.basePath = basePath; + } + this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); + } + + + private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object" && value instanceof Date === false) { + httpParams = this.addToHttpParamsRecursive(httpParams, value); + } else { + httpParams = this.addToHttpParamsRecursive(httpParams, value, key); + } + return httpParams; + } + + private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { + if (value == null) { + return httpParams; + } + + if (typeof value === "object") { + if (Array.isArray(value)) { + (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); + } else if (value instanceof Date) { + if (key != null) { + httpParams = httpParams.append(key, + (value as Date).toISOString().substr(0, 10)); + } else { + throw Error("key may not be null if value is Date"); + } + } else { + Object.keys(value).forEach( k => httpParams = this.addToHttpParamsRecursive( + httpParams, value[k], key != null ? `${key}.${k}` : k)); + } + } else if (key != null) { + httpParams = httpParams.append(key, value); + } else { + throw Error("key may not be null if value is not object or array"); + } + return httpParams; + } + + /** + * Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * @param orderId ID of the order that needs to be deleted + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public deleteOrder(orderId: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; + public deleteOrder(orderId: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; + public deleteOrder(orderId: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; + public deleteOrder(orderId: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + if (orderId === null || orderId === undefined) { + throw new Error('Required parameter orderId was null or undefined when calling deleteOrder.'); + } + + let headers = this.defaultHeaders; + + let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (httpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + + let responseType: 'text' | 'json' = 'json'; + if(httpHeaderAcceptSelected && httpHeaderAcceptSelected.startsWith('text')) { + responseType = 'text'; + } + + return this.httpClient.delete(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, + { + responseType: responseType, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Returns pet inventories by status + * Returns a map of status codes to quantities + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getInventory(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable<{ [key: string]: number; }>; + public getInventory(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>; + public getInventory(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>; + public getInventory(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json'}): Observable { + + let headers = this.defaultHeaders; + + let credential: string | undefined; + // authentication (api_key) required + credential = this.configuration.lookupCredential('api_key'); + if (credential) { + headers = headers.set('api_key', credential); + } + + let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (httpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/json' + ]; + httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + + let responseType: 'text' | 'json' = 'json'; + if(httpHeaderAcceptSelected && httpHeaderAcceptSelected.startsWith('text')) { + responseType = 'text'; + } + + return this.httpClient.get<{ [key: string]: number; }>(`${this.configuration.basePath}/store/inventory`, + { + responseType: responseType, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * @param orderId ID of pet that needs to be fetched + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getOrderById(orderId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable; + public getOrderById(orderId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; + public getOrderById(orderId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; + public getOrderById(orderId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + if (orderId === null || orderId === undefined) { + throw new Error('Required parameter orderId was null or undefined when calling getOrderById.'); + } + + let headers = this.defaultHeaders; + + let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (httpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/xml', + 'application/json' + ]; + httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + + let responseType: 'text' | 'json' = 'json'; + if(httpHeaderAcceptSelected && httpHeaderAcceptSelected.startsWith('text')) { + responseType = 'text'; + } + + return this.httpClient.get(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, + { + responseType: responseType, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Place an order for a pet + * @param body order placed for purchasing the pet + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public placeOrder(body: Order, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable; + public placeOrder(body: Order, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; + public placeOrder(body: Order, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; + public placeOrder(body: Order, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling placeOrder.'); + } + + let headers = this.defaultHeaders; + + let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (httpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/xml', + 'application/json' + ]; + httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + + // to determine the Content-Type header + const consumes: string[] = [ + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + headers = headers.set('Content-Type', httpContentTypeSelected); + } + + let responseType: 'text' | 'json' = 'json'; + if(httpHeaderAcceptSelected && httpHeaderAcceptSelected.startsWith('text')) { + responseType = 'text'; + } + + return this.httpClient.post(`${this.configuration.basePath}/store/order`, + body, + { + responseType: responseType, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + +} diff --git a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/api/user.service.ts b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/api/user.service.ts new file mode 100644 index 000000000000..399676219054 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/api/user.service.ts @@ -0,0 +1,497 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +/* tslint:disable:no-unused-variable member-ordering */ + +import { Inject, Injectable, Optional } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpParams, + HttpResponse, HttpEvent, HttpParameterCodec } from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; + +import { User } from '../model/models'; + +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; + + + +@Injectable({ + providedIn: 'root' +}) +export class UserService { + + protected basePath = 'http://petstore.swagger.io/v2'; + public defaultHeaders = new HttpHeaders(); + public configuration = new Configuration(); + public encoder: HttpParameterCodec; + + constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string, @Optional() configuration: Configuration) { + if (configuration) { + this.configuration = configuration; + } + if (typeof this.configuration.basePath !== 'string') { + if (typeof basePath !== 'string') { + basePath = this.basePath; + } + this.configuration.basePath = basePath; + } + this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); + } + + + private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object" && value instanceof Date === false) { + httpParams = this.addToHttpParamsRecursive(httpParams, value); + } else { + httpParams = this.addToHttpParamsRecursive(httpParams, value, key); + } + return httpParams; + } + + private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { + if (value == null) { + return httpParams; + } + + if (typeof value === "object") { + if (Array.isArray(value)) { + (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); + } else if (value instanceof Date) { + if (key != null) { + httpParams = httpParams.append(key, + (value as Date).toISOString().substr(0, 10)); + } else { + throw Error("key may not be null if value is Date"); + } + } else { + Object.keys(value).forEach( k => httpParams = this.addToHttpParamsRecursive( + httpParams, value[k], key != null ? `${key}.${k}` : k)); + } + } else if (key != null) { + httpParams = httpParams.append(key, value); + } else { + throw Error("key may not be null if value is not object or array"); + } + return httpParams; + } + + /** + * Create user + * This can only be done by the logged in user. + * @param body Created user object + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public createUser(body: User, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; + public createUser(body: User, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; + public createUser(body: User, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; + public createUser(body: User, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling createUser.'); + } + + let headers = this.defaultHeaders; + + let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (httpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + + // to determine the Content-Type header + const consumes: string[] = [ + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + headers = headers.set('Content-Type', httpContentTypeSelected); + } + + let responseType: 'text' | 'json' = 'json'; + if(httpHeaderAcceptSelected && httpHeaderAcceptSelected.startsWith('text')) { + responseType = 'text'; + } + + return this.httpClient.post(`${this.configuration.basePath}/user`, + body, + { + responseType: responseType, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Creates list of users with given input array + * @param body List of user object + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public createUsersWithArrayInput(body: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; + public createUsersWithArrayInput(body: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; + public createUsersWithArrayInput(body: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; + public createUsersWithArrayInput(body: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling createUsersWithArrayInput.'); + } + + let headers = this.defaultHeaders; + + let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (httpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + + // to determine the Content-Type header + const consumes: string[] = [ + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + headers = headers.set('Content-Type', httpContentTypeSelected); + } + + let responseType: 'text' | 'json' = 'json'; + if(httpHeaderAcceptSelected && httpHeaderAcceptSelected.startsWith('text')) { + responseType = 'text'; + } + + return this.httpClient.post(`${this.configuration.basePath}/user/createWithArray`, + body, + { + responseType: responseType, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Creates list of users with given input array + * @param body List of user object + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public createUsersWithListInput(body: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; + public createUsersWithListInput(body: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; + public createUsersWithListInput(body: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; + public createUsersWithListInput(body: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling createUsersWithListInput.'); + } + + let headers = this.defaultHeaders; + + let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (httpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + + // to determine the Content-Type header + const consumes: string[] = [ + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + headers = headers.set('Content-Type', httpContentTypeSelected); + } + + let responseType: 'text' | 'json' = 'json'; + if(httpHeaderAcceptSelected && httpHeaderAcceptSelected.startsWith('text')) { + responseType = 'text'; + } + + return this.httpClient.post(`${this.configuration.basePath}/user/createWithList`, + body, + { + responseType: responseType, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Delete user + * This can only be done by the logged in user. + * @param username The name that needs to be deleted + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public deleteUser(username: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; + public deleteUser(username: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; + public deleteUser(username: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; + public deleteUser(username: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + if (username === null || username === undefined) { + throw new Error('Required parameter username was null or undefined when calling deleteUser.'); + } + + let headers = this.defaultHeaders; + + let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (httpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + + let responseType: 'text' | 'json' = 'json'; + if(httpHeaderAcceptSelected && httpHeaderAcceptSelected.startsWith('text')) { + responseType = 'text'; + } + + return this.httpClient.delete(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, + { + responseType: responseType, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Get user by user name + * @param username The name that needs to be fetched. Use user1 for testing. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getUserByName(username: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable; + public getUserByName(username: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; + public getUserByName(username: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; + public getUserByName(username: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + if (username === null || username === undefined) { + throw new Error('Required parameter username was null or undefined when calling getUserByName.'); + } + + let headers = this.defaultHeaders; + + let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (httpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/xml', + 'application/json' + ]; + httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + + let responseType: 'text' | 'json' = 'json'; + if(httpHeaderAcceptSelected && httpHeaderAcceptSelected.startsWith('text')) { + responseType = 'text'; + } + + return this.httpClient.get(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, + { + responseType: responseType, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Logs user into the system + * @param username The user name for login + * @param password The password for login in clear text + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public loginUser(username: string, password: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable; + public loginUser(username: string, password: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; + public loginUser(username: string, password: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; + public loginUser(username: string, password: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + if (username === null || username === undefined) { + throw new Error('Required parameter username was null or undefined when calling loginUser.'); + } + if (password === null || password === undefined) { + throw new Error('Required parameter password was null or undefined when calling loginUser.'); + } + + let queryParameters = new HttpParams({encoder: this.encoder}); + if (username !== undefined && username !== null) { + queryParameters = this.addToHttpParams(queryParameters, + username, 'username'); + } + if (password !== undefined && password !== null) { + queryParameters = this.addToHttpParams(queryParameters, + password, 'password'); + } + + let headers = this.defaultHeaders; + + let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (httpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/xml', + 'application/json' + ]; + httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + + let responseType: 'text' | 'json' = 'json'; + if(httpHeaderAcceptSelected && httpHeaderAcceptSelected.startsWith('text')) { + responseType = 'text'; + } + + return this.httpClient.get(`${this.configuration.basePath}/user/login`, + { + params: queryParameters, + responseType: responseType, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Logs out current logged in user session + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public logoutUser(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; + public logoutUser(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; + public logoutUser(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; + public logoutUser(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + + let headers = this.defaultHeaders; + + let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (httpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + + let responseType: 'text' | 'json' = 'json'; + if(httpHeaderAcceptSelected && httpHeaderAcceptSelected.startsWith('text')) { + responseType = 'text'; + } + + return this.httpClient.get(`${this.configuration.basePath}/user/logout`, + { + responseType: responseType, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Updated user + * This can only be done by the logged in user. + * @param username name that need to be deleted + * @param body Updated user object + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public updateUser(username: string, body: User, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; + public updateUser(username: string, body: User, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; + public updateUser(username: string, body: User, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; + public updateUser(username: string, body: User, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + if (username === null || username === undefined) { + throw new Error('Required parameter username was null or undefined when calling updateUser.'); + } + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling updateUser.'); + } + + let headers = this.defaultHeaders; + + let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (httpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + + // to determine the Content-Type header + const consumes: string[] = [ + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + headers = headers.set('Content-Type', httpContentTypeSelected); + } + + let responseType: 'text' | 'json' = 'json'; + if(httpHeaderAcceptSelected && httpHeaderAcceptSelected.startsWith('text')) { + responseType = 'text'; + } + + return this.httpClient.put(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, + body, + { + responseType: responseType, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + +} diff --git a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/configuration.ts b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/configuration.ts new file mode 100644 index 000000000000..38126642420d --- /dev/null +++ b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/configuration.ts @@ -0,0 +1,137 @@ +import { HttpParameterCodec } from '@angular/common/http'; + +export interface ConfigurationParameters { + /** + * @deprecated Since 5.0. Use credentials instead + */ + apiKeys?: {[ key: string ]: string}; + username?: string; + password?: string; + /** + * @deprecated Since 5.0. Use credentials instead + */ + accessToken?: string | (() => string); + basePath?: string; + withCredentials?: boolean; + encoder?: HttpParameterCodec; + /** + * The keys are the names in the securitySchemes section of the OpenAPI + * document. They should map to the value used for authentication + * minus any standard prefixes such as 'Basic' or 'Bearer'. + */ + credentials?: {[ key: string ]: string | (() => string | undefined)}; +} + +export class Configuration { + /** + * @deprecated Since 5.0. Use credentials instead + */ + apiKeys?: {[ key: string ]: string}; + username?: string; + password?: string; + /** + * @deprecated Since 5.0. Use credentials instead + */ + accessToken?: string | (() => string); + basePath?: string; + withCredentials?: boolean; + encoder?: HttpParameterCodec; + /** + * The keys are the names in the securitySchemes section of the OpenAPI + * document. They should map to the value used for authentication + * minus any standard prefixes such as 'Basic' or 'Bearer'. + */ + credentials: {[ key: string ]: string | (() => string | undefined)}; + + constructor(configurationParameters: ConfigurationParameters = {}) { + this.apiKeys = configurationParameters.apiKeys; + this.username = configurationParameters.username; + this.password = configurationParameters.password; + this.accessToken = configurationParameters.accessToken; + this.basePath = configurationParameters.basePath; + this.withCredentials = configurationParameters.withCredentials; + this.encoder = configurationParameters.encoder; + if (configurationParameters.credentials) { + this.credentials = configurationParameters.credentials; + } + else { + this.credentials = {}; + } + + // init default api_key credential + if (!this.credentials['api_key']) { + this.credentials['api_key'] = () => { + return this.apiKeys['api_key'] || this.apiKeys['api_key']; + }; + } + + // init default petstore_auth credential + if (!this.credentials['petstore_auth']) { + this.credentials['petstore_auth'] = () => { + return typeof this.accessToken === 'function' + ? this.accessToken() + : this.accessToken; + }; + } + } + + /** + * Select the correct content-type to use for a request. + * Uses {@link Configuration#isJsonMime} to determine the correct content-type. + * If no content type is found return the first found type if the contentTypes is not empty + * @param contentTypes - the array of content types that are available for selection + * @returns the selected content-type or undefined if no selection could be made. + */ + public selectHeaderContentType (contentTypes: string[]): string | undefined { + if (contentTypes.length === 0) { + return undefined; + } + + const type = contentTypes.find((x: string) => this.isJsonMime(x)); + if (type === undefined) { + return contentTypes[0]; + } + return type; + } + + /** + * Select the correct accept content-type to use for a request. + * Uses {@link Configuration#isJsonMime} to determine the correct accept content-type. + * If no content type is found return the first found type if the contentTypes is not empty + * @param accepts - the array of content types that are available for selection. + * @returns the selected content-type or undefined if no selection could be made. + */ + public selectHeaderAccept(accepts: string[]): string | undefined { + if (accepts.length === 0) { + return undefined; + } + + const type = accepts.find((x: string) => this.isJsonMime(x)); + if (type === undefined) { + return accepts[0]; + } + return type; + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * application/vnd.company+json + * @param mime - MIME (Multipurpose Internet Mail Extensions) + * @return True if the given MIME is JSON, false otherwise. + */ + public isJsonMime(mime: string): boolean { + const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); + return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); + } + + public lookupCredential(key: string): string | undefined { + const value = this.credentials[key]; + return typeof value === 'function' + ? value() + : value; + } +} diff --git a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/encoder.ts b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/encoder.ts new file mode 100644 index 000000000000..138c4d5cf2c1 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/encoder.ts @@ -0,0 +1,20 @@ +import { HttpParameterCodec } from '@angular/common/http'; + +/** + * Custom HttpParameterCodec + * Workaround for https://github.com/angular/angular/issues/18261 + */ +export class CustomHttpParameterCodec implements HttpParameterCodec { + encodeKey(k: string): string { + return encodeURIComponent(k); + } + encodeValue(v: string): string { + return encodeURIComponent(v); + } + decodeKey(k: string): string { + return decodeURIComponent(k); + } + decodeValue(v: string): string { + return decodeURIComponent(v); + } +} diff --git a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/git_push.sh b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/git_push.sh new file mode 100644 index 000000000000..ced3be2b0c7b --- /dev/null +++ b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/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/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/index.ts b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/index.ts new file mode 100644 index 000000000000..c312b70fa3ef --- /dev/null +++ b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/index.ts @@ -0,0 +1,5 @@ +export * from './api/api'; +export * from './model/models'; +export * from './variables'; +export * from './configuration'; +export * from './api.module'; \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/model/apiResponse.ts b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/model/apiResponse.ts new file mode 100644 index 000000000000..682ba478921e --- /dev/null +++ b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/model/apiResponse.ts @@ -0,0 +1,22 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +/** + * Describes the result of uploading an image resource + */ +export interface ApiResponse { + code?: number; + type?: string; + message?: string; +} + diff --git a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/model/category.ts b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/model/category.ts new file mode 100644 index 000000000000..b988b6827a05 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/model/category.ts @@ -0,0 +1,21 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +/** + * A category for a pet + */ +export interface Category { + id?: number; + name?: string; +} + diff --git a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/model/models.ts b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/model/models.ts new file mode 100644 index 000000000000..8607c5dabd0c --- /dev/null +++ b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/model/models.ts @@ -0,0 +1,6 @@ +export * from './apiResponse'; +export * from './category'; +export * from './order'; +export * from './pet'; +export * from './tag'; +export * from './user'; diff --git a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/model/order.ts b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/model/order.ts new file mode 100644 index 000000000000..a29bebe49065 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/model/order.ts @@ -0,0 +1,37 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +/** + * An order for a pets from the pet store + */ +export interface Order { + id?: number; + petId?: number; + quantity?: number; + shipDate?: string; + /** + * Order Status + */ + status?: Order.StatusEnum; + complete?: boolean; +} +export namespace Order { + export type StatusEnum = 'placed' | 'approved' | 'delivered'; + export const StatusEnum = { + Placed: 'placed' as StatusEnum, + Approved: 'approved' as StatusEnum, + Delivered: 'delivered' as StatusEnum + }; +} + + diff --git a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/model/pet.ts b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/model/pet.ts new file mode 100644 index 000000000000..e0404395f91c --- /dev/null +++ b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/model/pet.ts @@ -0,0 +1,39 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { Category } from './category'; +import { Tag } from './tag'; + + +/** + * A pet for sale in the pet store + */ +export interface Pet { + id?: number; + category?: Category; + name: string; + photoUrls: Array; + tags?: Array; + /** + * pet status in the store + */ + status?: Pet.StatusEnum; +} +export namespace Pet { + export type StatusEnum = 'available' | 'pending' | 'sold'; + export const StatusEnum = { + Available: 'available' as StatusEnum, + Pending: 'pending' as StatusEnum, + Sold: 'sold' as StatusEnum + }; +} + + diff --git a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/model/tag.ts b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/model/tag.ts new file mode 100644 index 000000000000..b6ff210e8df4 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/model/tag.ts @@ -0,0 +1,21 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +/** + * A tag for a pet + */ +export interface Tag { + id?: number; + name?: string; +} + diff --git a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/model/user.ts b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/model/user.ts new file mode 100644 index 000000000000..fce51005300c --- /dev/null +++ b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/model/user.ts @@ -0,0 +1,30 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +/** + * A User who is purchasing from the pet store + */ +export interface User { + id?: number; + username?: string; + firstName?: string; + lastName?: string; + email?: string; + password?: string; + phone?: string; + /** + * User Status + */ + userStatus?: number; +} + diff --git a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/ng-package.json b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/ng-package.json new file mode 100644 index 000000000000..3b17900dc9c3 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/ng-package.json @@ -0,0 +1,6 @@ +{ + "$schema": "./node_modules/ng-packagr/ng-package.schema.json", + "lib": { + "entryFile": "index.ts" + } +} diff --git a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/package.json b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/package.json new file mode 100644 index 000000000000..48f013434a6c --- /dev/null +++ b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/package.json @@ -0,0 +1,34 @@ +{ + "name": "@openapitools/typescript-angular-petstore", + "version": "1.0.0", + "description": "OpenAPI client for @openapitools/typescript-angular-petstore", + "author": "OpenAPI-Generator Contributors", + "keywords": [ + "openapi-client", + "openapi-generator" + ], + "license": "Unlicense", + "scripts": { + "build": "ng-packagr -p ng-package.json" + }, + "peerDependencies": { + "@angular/core": "^10.0.0", + "rxjs": "^6.6.0" + }, + "devDependencies": { + "@angular/common": "^10.0.0", + "@angular/compiler": "^10.0.0", + "@angular/compiler-cli": "^10.0.0", + "@angular/core": "^10.0.0", + "@angular/platform-browser": "^10.0.0", + "ng-packagr": "^10.0.3", + "reflect-metadata": "^0.1.3", + "rxjs": "^6.6.0", + "tsickle": "^0.39.1", + "typescript": ">=3.9.2 <4.0.0", + "zone.js": "^0.10.2" + }, + "publishConfig": { + "registry": "https://skimdb.npmjs.com/registry" + } +} diff --git a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/tsconfig.json b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/tsconfig.json new file mode 100644 index 000000000000..c01ebe255d4c --- /dev/null +++ b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/tsconfig.json @@ -0,0 +1,28 @@ +{ + "compilerOptions": { + "emitDecoratorMetadata": true, + "experimentalDecorators": true, + "noImplicitAny": false, + "suppressImplicitAnyIndexErrors": true, + "target": "es5", + "module": "commonjs", + "moduleResolution": "node", + "removeComments": true, + "sourceMap": true, + "outDir": "./dist", + "noLib": false, + "declaration": true, + "lib": [ "es6", "dom" ], + "typeRoots": [ + "node_modules/@types" + ] + }, + "exclude": [ + "node_modules", + "dist" + ], + "filesGlob": [ + "./model/*.ts", + "./api/*.ts" + ] +} diff --git a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/variables.ts b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/variables.ts new file mode 100644 index 000000000000..6fe58549f395 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/variables.ts @@ -0,0 +1,9 @@ +import { InjectionToken } from '@angular/core'; + +export const BASE_PATH = new InjectionToken('basePath'); +export const COLLECTION_FORMATS = { + 'csv': ',', + 'tsv': ' ', + 'ssv': ' ', + 'pipes': '|' +} diff --git a/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/.gitignore b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/.gitignore new file mode 100644 index 000000000000..149b57654723 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/.gitignore @@ -0,0 +1,4 @@ +wwwroot/*.js +node_modules +typings +dist diff --git a/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/.openapi-generator-ignore b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/.openapi-generator-ignore new file mode 100644 index 000000000000..7484ee590a38 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/.openapi-generator/FILES b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/.openapi-generator/FILES new file mode 100644 index 000000000000..bc66e2a3865f --- /dev/null +++ b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/.openapi-generator/FILES @@ -0,0 +1,19 @@ +.gitignore +README.md +api.module.ts +api/api.ts +api/pet.service.ts +api/store.service.ts +api/user.service.ts +configuration.ts +encoder.ts +git_push.sh +index.ts +model/./apiResponse.ts +model/./category.ts +model/./order.ts +model/./pet.ts +model/./tag.ts +model/./user.ts +model/models.ts +variables.ts diff --git a/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/.openapi-generator/VERSION new file mode 100644 index 000000000000..d99e7162d01f --- /dev/null +++ b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/.openapi-generator/VERSION @@ -0,0 +1 @@ +5.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/README.md b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/README.md new file mode 100644 index 000000000000..94e4af489d64 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/README.md @@ -0,0 +1,203 @@ +## @ + +### Building + +To install the required dependencies and to build the typescript sources run: +``` +npm install +npm run build +``` + +### publishing + +First build the package then run ```npm publish dist``` (don't forget to specify the `dist` folder!) + +### consuming + +Navigate to the folder of your consuming project and run one of next commands. + +_published:_ + +``` +npm install @ --save +``` + +_without publishing (not recommended):_ + +``` +npm install PATH_TO_GENERATED_PACKAGE/dist.tgz --save +``` + +_It's important to take the tgz file, otherwise you'll get trouble with links on windows_ + +_using `npm link`:_ + +In PATH_TO_GENERATED_PACKAGE/dist: +``` +npm link +``` + +In your project: +``` +npm link +``` + +__Note for Windows users:__ The Angular CLI has troubles to use linked npm packages. +Please refer to this issue https://github.com/angular/angular-cli/issues/8284 for a solution / workaround. +Published packages are not effected by this issue. + + +#### General usage + +In your Angular project: + + +``` +// without configuring providers +import { ApiModule } from ''; +import { HttpClientModule } from '@angular/common/http'; + +@NgModule({ + imports: [ + ApiModule, + // make sure to import the HttpClientModule in the AppModule only, + // see https://github.com/angular/angular/issues/20575 + HttpClientModule + ], + declarations: [ AppComponent ], + providers: [], + bootstrap: [ AppComponent ] +}) +export class AppModule {} +``` + +``` +// configuring providers +import { ApiModule, Configuration, ConfigurationParameters } from ''; + +export function apiConfigFactory (): Configuration => { + const params: ConfigurationParameters = { + // set configuration parameters here. + } + return new Configuration(params); +} + +@NgModule({ + imports: [ ApiModule.forRoot(apiConfigFactory) ], + declarations: [ AppComponent ], + providers: [], + bootstrap: [ AppComponent ] +}) +export class AppModule {} +``` + +``` +// configuring providers with an authentication service that manages your access tokens +import { ApiModule, Configuration } from ''; + +@NgModule({ + imports: [ ApiModule ], + declarations: [ AppComponent ], + providers: [ + { + provide: Configuration, + useFactory: (authService: AuthService) => new Configuration( + { + basePath: environment.apiUrl, + accessToken: authService.getAccessToken.bind(authService) + } + ), + deps: [AuthService], + multi: false + } + ], + bootstrap: [ AppComponent ] +}) +export class AppModule {} +``` + +``` +import { DefaultApi } from ''; + +export class AppComponent { + constructor(private apiGateway: DefaultApi) { } +} +``` + +Note: The ApiModule is restricted to being instantiated once app wide. +This is to ensure that all services are treated as singletons. + +#### Using multiple OpenAPI files / APIs / ApiModules +In order to use multiple `ApiModules` generated from different OpenAPI files, +you can create an alias name when importing the modules +in order to avoid naming conflicts: +``` +import { ApiModule } from 'my-api-path'; +import { ApiModule as OtherApiModule } from 'my-other-api-path'; +import { HttpClientModule } from '@angular/common/http'; + +@NgModule({ + imports: [ + ApiModule, + OtherApiModule, + // make sure to import the HttpClientModule in the AppModule only, + // see https://github.com/angular/angular/issues/20575 + HttpClientModule + ] +}) +export class AppModule { + +} +``` + + +### Set service base path +If different than the generated base path, during app bootstrap, you can provide the base path to your service. + +``` +import { BASE_PATH } from ''; + +bootstrap(AppComponent, [ + { provide: BASE_PATH, useValue: 'https://your-web-service.com' }, +]); +``` +or + +``` +import { BASE_PATH } from ''; + +@NgModule({ + imports: [], + declarations: [ AppComponent ], + providers: [ provide: BASE_PATH, useValue: 'https://your-web-service.com' ], + bootstrap: [ AppComponent ] +}) +export class AppModule {} +``` + + +#### Using @angular/cli +First extend your `src/environments/*.ts` files by adding the corresponding base path: + +``` +export const environment = { + production: false, + API_BASE_PATH: 'http://127.0.0.1:8080' +}; +``` + +In the src/app/app.module.ts: +``` +import { BASE_PATH } from ''; +import { environment } from '../environments/environment'; + +@NgModule({ + declarations: [ + AppComponent + ], + imports: [ ], + providers: [{ provide: BASE_PATH, useValue: environment.API_BASE_PATH }], + bootstrap: [ AppComponent ] +}) +export class AppModule { } +``` diff --git a/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/api.module.ts b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/api.module.ts new file mode 100644 index 000000000000..2afb8f64e926 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/api.module.ts @@ -0,0 +1,33 @@ +import { NgModule, ModuleWithProviders, SkipSelf, Optional } from '@angular/core'; +import { Configuration } from './configuration'; +import { HttpClient } from '@angular/common/http'; + +import { PetService } from './api/pet.service'; +import { StoreService } from './api/store.service'; +import { UserService } from './api/user.service'; + +@NgModule({ + imports: [], + declarations: [], + exports: [], + providers: [] +}) +export class ApiModule { + public static forRoot(configurationFactory: () => Configuration): ModuleWithProviders { + return { + ngModule: ApiModule, + providers: [ { provide: Configuration, useFactory: configurationFactory } ] + }; + } + + constructor( @Optional() @SkipSelf() parentModule: ApiModule, + @Optional() http: HttpClient) { + if (parentModule) { + throw new Error('ApiModule is already loaded. Import in your base AppModule only.'); + } + if (!http) { + throw new Error('You need to import the HttpClientModule in your AppModule! \n' + + 'See also https://github.com/angular/angular/issues/20575'); + } + } +} diff --git a/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/api/api.ts b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/api/api.ts new file mode 100644 index 000000000000..8e44b64083d5 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/api/api.ts @@ -0,0 +1,7 @@ +export * from './pet.service'; +import { PetService } from './pet.service'; +export * from './store.service'; +import { StoreService } from './store.service'; +export * from './user.service'; +import { UserService } from './user.service'; +export const APIS = [PetService, StoreService, UserService]; diff --git a/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/api/pet.service.ts b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/api/pet.service.ts new file mode 100644 index 000000000000..46fef0be89fe --- /dev/null +++ b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/api/pet.service.ts @@ -0,0 +1,613 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +/* tslint:disable:no-unused-variable member-ordering */ + +import { Inject, Injectable, Optional } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpParams, + HttpResponse, HttpEvent, HttpParameterCodec } from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; + +import { ApiResponse } from '../model/models'; +import { Pet } from '../model/models'; + +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; + + + +@Injectable({ + providedIn: 'root' +}) +export class PetService { + + protected basePath = 'http://petstore.swagger.io/v2'; + public defaultHeaders = new HttpHeaders(); + public configuration = new Configuration(); + public encoder: HttpParameterCodec; + + constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string, @Optional() configuration: Configuration) { + if (configuration) { + this.configuration = configuration; + } + if (typeof this.configuration.basePath !== 'string') { + if (typeof basePath !== 'string') { + basePath = this.basePath; + } + this.configuration.basePath = basePath; + } + this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); + } + + /** + * @param consumes string[] mime-types + * @return true: consumes contains 'multipart/form-data', false: otherwise + */ + private canConsumeForm(consumes: string[]): boolean { + const form = 'multipart/form-data'; + for (const consume of consumes) { + if (form === consume) { + return true; + } + } + return false; + } + + private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object" && value instanceof Date === false) { + httpParams = this.addToHttpParamsRecursive(httpParams, value); + } else { + httpParams = this.addToHttpParamsRecursive(httpParams, value, key); + } + return httpParams; + } + + private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { + if (value == null) { + return httpParams; + } + + if (typeof value === "object") { + if (Array.isArray(value)) { + (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); + } else if (value instanceof Date) { + if (key != null) { + httpParams = httpParams.append(key, + (value as Date).toISOString().substr(0, 10)); + } else { + throw Error("key may not be null if value is Date"); + } + } else { + Object.keys(value).forEach( k => httpParams = this.addToHttpParamsRecursive( + httpParams, value[k], key != null ? `${key}.${k}` : k)); + } + } else if (key != null) { + httpParams = httpParams.append(key, value); + } else { + throw Error("key may not be null if value is not object or array"); + } + return httpParams; + } + + /** + * Add a new pet to the store + * @param body Pet object that needs to be added to the store + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public addPet(body: Pet, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; + public addPet(body: Pet, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; + public addPet(body: Pet, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; + public addPet(body: Pet, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling addPet.'); + } + + let headers = this.defaultHeaders; + + let credential: string | undefined; + // authentication (petstore_auth) required + credential = this.configuration.lookupCredential('petstore_auth'); + if (credential) { + headers = headers.set('Authorization', 'Bearer ' + credential); + } + + let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (httpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/json', + 'application/xml' + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + headers = headers.set('Content-Type', httpContentTypeSelected); + } + + let responseType: 'text' | 'json' = 'json'; + if(httpHeaderAcceptSelected && httpHeaderAcceptSelected.startsWith('text')) { + responseType = 'text'; + } + + return this.httpClient.post(`${this.configuration.basePath}/pet`, + body, + { + responseType: responseType, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Deletes a pet + * @param petId Pet id to delete + * @param apiKey + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public deletePet(petId: number, apiKey?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; + public deletePet(petId: number, apiKey?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; + public deletePet(petId: number, apiKey?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; + public deletePet(petId: number, apiKey?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + if (petId === null || petId === undefined) { + throw new Error('Required parameter petId was null or undefined when calling deletePet.'); + } + + let headers = this.defaultHeaders; + if (apiKey !== undefined && apiKey !== null) { + headers = headers.set('api_key', String(apiKey)); + } + + let credential: string | undefined; + // authentication (petstore_auth) required + credential = this.configuration.lookupCredential('petstore_auth'); + if (credential) { + headers = headers.set('Authorization', 'Bearer ' + credential); + } + + let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (httpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + + let responseType: 'text' | 'json' = 'json'; + if(httpHeaderAcceptSelected && httpHeaderAcceptSelected.startsWith('text')) { + responseType = 'text'; + } + + return this.httpClient.delete(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, + { + responseType: responseType, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Finds Pets by status + * Multiple status values can be provided with comma separated strings + * @param status Status values that need to be considered for filter + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>>; + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>>; + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + if (status === null || status === undefined) { + throw new Error('Required parameter status was null or undefined when calling findPetsByStatus.'); + } + + let queryParameters = new HttpParams({encoder: this.encoder}); + if (status) { + queryParameters = this.addToHttpParams(queryParameters, + status.join(COLLECTION_FORMATS['csv']), 'status'); + } + + let headers = this.defaultHeaders; + + let credential: string | undefined; + // authentication (petstore_auth) required + credential = this.configuration.lookupCredential('petstore_auth'); + if (credential) { + headers = headers.set('Authorization', 'Bearer ' + credential); + } + + let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (httpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/xml', + 'application/json' + ]; + httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + + let responseType: 'text' | 'json' = 'json'; + if(httpHeaderAcceptSelected && httpHeaderAcceptSelected.startsWith('text')) { + responseType = 'text'; + } + + return this.httpClient.get>(`${this.configuration.basePath}/pet/findByStatus`, + { + params: queryParameters, + responseType: responseType, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * @param tags Tags to filter by + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + * @deprecated + */ + public findPetsByTags(tags: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; + public findPetsByTags(tags: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>>; + public findPetsByTags(tags: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>>; + public findPetsByTags(tags: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + if (tags === null || tags === undefined) { + throw new Error('Required parameter tags was null or undefined when calling findPetsByTags.'); + } + + let queryParameters = new HttpParams({encoder: this.encoder}); + if (tags) { + queryParameters = this.addToHttpParams(queryParameters, + tags.join(COLLECTION_FORMATS['csv']), 'tags'); + } + + let headers = this.defaultHeaders; + + let credential: string | undefined; + // authentication (petstore_auth) required + credential = this.configuration.lookupCredential('petstore_auth'); + if (credential) { + headers = headers.set('Authorization', 'Bearer ' + credential); + } + + let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (httpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/xml', + 'application/json' + ]; + httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + + let responseType: 'text' | 'json' = 'json'; + if(httpHeaderAcceptSelected && httpHeaderAcceptSelected.startsWith('text')) { + responseType = 'text'; + } + + return this.httpClient.get>(`${this.configuration.basePath}/pet/findByTags`, + { + params: queryParameters, + responseType: responseType, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Find pet by ID + * Returns a single pet + * @param petId ID of pet to return + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getPetById(petId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable; + public getPetById(petId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; + public getPetById(petId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; + public getPetById(petId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + if (petId === null || petId === undefined) { + throw new Error('Required parameter petId was null or undefined when calling getPetById.'); + } + + let headers = this.defaultHeaders; + + let credential: string | undefined; + // authentication (api_key) required + credential = this.configuration.lookupCredential('api_key'); + if (credential) { + headers = headers.set('api_key', credential); + } + + let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (httpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/xml', + 'application/json' + ]; + httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + + let responseType: 'text' | 'json' = 'json'; + if(httpHeaderAcceptSelected && httpHeaderAcceptSelected.startsWith('text')) { + responseType = 'text'; + } + + return this.httpClient.get(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, + { + responseType: responseType, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Update an existing pet + * @param body Pet object that needs to be added to the store + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public updatePet(body: Pet, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; + public updatePet(body: Pet, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; + public updatePet(body: Pet, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; + public updatePet(body: Pet, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling updatePet.'); + } + + let headers = this.defaultHeaders; + + let credential: string | undefined; + // authentication (petstore_auth) required + credential = this.configuration.lookupCredential('petstore_auth'); + if (credential) { + headers = headers.set('Authorization', 'Bearer ' + credential); + } + + let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (httpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/json', + 'application/xml' + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + headers = headers.set('Content-Type', httpContentTypeSelected); + } + + let responseType: 'text' | 'json' = 'json'; + if(httpHeaderAcceptSelected && httpHeaderAcceptSelected.startsWith('text')) { + responseType = 'text'; + } + + return this.httpClient.put(`${this.configuration.basePath}/pet`, + body, + { + responseType: responseType, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Updates a pet in the store with form data + * @param petId ID of pet that needs to be updated + * @param name Updated name of the pet + * @param status Updated status of the pet + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; + public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; + public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; + public updatePetWithForm(petId: number, name?: string, status?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + if (petId === null || petId === undefined) { + throw new Error('Required parameter petId was null or undefined when calling updatePetWithForm.'); + } + + let headers = this.defaultHeaders; + + let credential: string | undefined; + // authentication (petstore_auth) required + credential = this.configuration.lookupCredential('petstore_auth'); + if (credential) { + headers = headers.set('Authorization', 'Bearer ' + credential); + } + + let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (httpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/x-www-form-urlencoded' + ]; + + const canConsumeForm = this.canConsumeForm(consumes); + + let formParams: { append(param: string, value: any): any; }; + let useForm = false; + let convertFormParamsToString = false; + if (useForm) { + formParams = new FormData(); + } else { + formParams = new HttpParams({encoder: this.encoder}); + } + + if (name !== undefined) { + formParams = formParams.append('name', name) as any || formParams; + } + if (status !== undefined) { + formParams = formParams.append('status', status) as any || formParams; + } + + let responseType: 'text' | 'json' = 'json'; + if(httpHeaderAcceptSelected && httpHeaderAcceptSelected.startsWith('text')) { + responseType = 'text'; + } + + return this.httpClient.post(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, + convertFormParamsToString ? formParams.toString() : formParams, + { + responseType: responseType, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * uploads an image + * @param petId ID of pet to update + * @param additionalMetadata Additional data to pass to server + * @param file file to upload + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable; + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>; + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>; + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json'}): Observable { + if (petId === null || petId === undefined) { + throw new Error('Required parameter petId was null or undefined when calling uploadFile.'); + } + + let headers = this.defaultHeaders; + + let credential: string | undefined; + // authentication (petstore_auth) required + credential = this.configuration.lookupCredential('petstore_auth'); + if (credential) { + headers = headers.set('Authorization', 'Bearer ' + credential); + } + + let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (httpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/json' + ]; + httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + // to determine the Content-Type header + const consumes: string[] = [ + 'multipart/form-data' + ]; + + const canConsumeForm = this.canConsumeForm(consumes); + + let formParams: { append(param: string, value: any): any; }; + let useForm = false; + let convertFormParamsToString = false; + // use FormData to transmit files using content-type "multipart/form-data" + // see https://stackoverflow.com/questions/4007969/application-x-www-form-urlencoded-or-multipart-form-data + useForm = canConsumeForm; + if (useForm) { + formParams = new FormData(); + } else { + formParams = new HttpParams({encoder: this.encoder}); + } + + if (additionalMetadata !== undefined) { + formParams = formParams.append('additionalMetadata', additionalMetadata) as any || formParams; + } + if (file !== undefined) { + formParams = formParams.append('file', file) as any || formParams; + } + + let responseType: 'text' | 'json' = 'json'; + if(httpHeaderAcceptSelected && httpHeaderAcceptSelected.startsWith('text')) { + responseType = 'text'; + } + + return this.httpClient.post(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}/uploadImage`, + convertFormParamsToString ? formParams.toString() : formParams, + { + responseType: responseType, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + +} diff --git a/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/api/store.service.ts b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/api/store.service.ts new file mode 100644 index 000000000000..d5d08ab3adc3 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/api/store.service.ts @@ -0,0 +1,283 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +/* tslint:disable:no-unused-variable member-ordering */ + +import { Inject, Injectable, Optional } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpParams, + HttpResponse, HttpEvent, HttpParameterCodec } from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; + +import { Order } from '../model/models'; + +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; + + + +@Injectable({ + providedIn: 'root' +}) +export class StoreService { + + protected basePath = 'http://petstore.swagger.io/v2'; + public defaultHeaders = new HttpHeaders(); + public configuration = new Configuration(); + public encoder: HttpParameterCodec; + + constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string, @Optional() configuration: Configuration) { + if (configuration) { + this.configuration = configuration; + } + if (typeof this.configuration.basePath !== 'string') { + if (typeof basePath !== 'string') { + basePath = this.basePath; + } + this.configuration.basePath = basePath; + } + this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); + } + + + private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object" && value instanceof Date === false) { + httpParams = this.addToHttpParamsRecursive(httpParams, value); + } else { + httpParams = this.addToHttpParamsRecursive(httpParams, value, key); + } + return httpParams; + } + + private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { + if (value == null) { + return httpParams; + } + + if (typeof value === "object") { + if (Array.isArray(value)) { + (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); + } else if (value instanceof Date) { + if (key != null) { + httpParams = httpParams.append(key, + (value as Date).toISOString().substr(0, 10)); + } else { + throw Error("key may not be null if value is Date"); + } + } else { + Object.keys(value).forEach( k => httpParams = this.addToHttpParamsRecursive( + httpParams, value[k], key != null ? `${key}.${k}` : k)); + } + } else if (key != null) { + httpParams = httpParams.append(key, value); + } else { + throw Error("key may not be null if value is not object or array"); + } + return httpParams; + } + + /** + * Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * @param orderId ID of the order that needs to be deleted + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public deleteOrder(orderId: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; + public deleteOrder(orderId: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; + public deleteOrder(orderId: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; + public deleteOrder(orderId: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + if (orderId === null || orderId === undefined) { + throw new Error('Required parameter orderId was null or undefined when calling deleteOrder.'); + } + + let headers = this.defaultHeaders; + + let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (httpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + + let responseType: 'text' | 'json' = 'json'; + if(httpHeaderAcceptSelected && httpHeaderAcceptSelected.startsWith('text')) { + responseType = 'text'; + } + + return this.httpClient.delete(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, + { + responseType: responseType, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Returns pet inventories by status + * Returns a map of status codes to quantities + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getInventory(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable<{ [key: string]: number; }>; + public getInventory(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>; + public getInventory(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>; + public getInventory(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json'}): Observable { + + let headers = this.defaultHeaders; + + let credential: string | undefined; + // authentication (api_key) required + credential = this.configuration.lookupCredential('api_key'); + if (credential) { + headers = headers.set('api_key', credential); + } + + let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (httpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/json' + ]; + httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + + let responseType: 'text' | 'json' = 'json'; + if(httpHeaderAcceptSelected && httpHeaderAcceptSelected.startsWith('text')) { + responseType = 'text'; + } + + return this.httpClient.get<{ [key: string]: number; }>(`${this.configuration.basePath}/store/inventory`, + { + responseType: responseType, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * @param orderId ID of pet that needs to be fetched + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getOrderById(orderId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable; + public getOrderById(orderId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; + public getOrderById(orderId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; + public getOrderById(orderId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + if (orderId === null || orderId === undefined) { + throw new Error('Required parameter orderId was null or undefined when calling getOrderById.'); + } + + let headers = this.defaultHeaders; + + let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (httpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/xml', + 'application/json' + ]; + httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + + let responseType: 'text' | 'json' = 'json'; + if(httpHeaderAcceptSelected && httpHeaderAcceptSelected.startsWith('text')) { + responseType = 'text'; + } + + return this.httpClient.get(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, + { + responseType: responseType, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Place an order for a pet + * @param body order placed for purchasing the pet + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public placeOrder(body: Order, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable; + public placeOrder(body: Order, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; + public placeOrder(body: Order, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; + public placeOrder(body: Order, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling placeOrder.'); + } + + let headers = this.defaultHeaders; + + let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (httpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/xml', + 'application/json' + ]; + httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + + // to determine the Content-Type header + const consumes: string[] = [ + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + headers = headers.set('Content-Type', httpContentTypeSelected); + } + + let responseType: 'text' | 'json' = 'json'; + if(httpHeaderAcceptSelected && httpHeaderAcceptSelected.startsWith('text')) { + responseType = 'text'; + } + + return this.httpClient.post(`${this.configuration.basePath}/store/order`, + body, + { + responseType: responseType, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + +} diff --git a/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/api/user.service.ts b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/api/user.service.ts new file mode 100644 index 000000000000..399676219054 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/api/user.service.ts @@ -0,0 +1,497 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +/* tslint:disable:no-unused-variable member-ordering */ + +import { Inject, Injectable, Optional } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpParams, + HttpResponse, HttpEvent, HttpParameterCodec } from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; + +import { User } from '../model/models'; + +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; + + + +@Injectable({ + providedIn: 'root' +}) +export class UserService { + + protected basePath = 'http://petstore.swagger.io/v2'; + public defaultHeaders = new HttpHeaders(); + public configuration = new Configuration(); + public encoder: HttpParameterCodec; + + constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string, @Optional() configuration: Configuration) { + if (configuration) { + this.configuration = configuration; + } + if (typeof this.configuration.basePath !== 'string') { + if (typeof basePath !== 'string') { + basePath = this.basePath; + } + this.configuration.basePath = basePath; + } + this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); + } + + + private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object" && value instanceof Date === false) { + httpParams = this.addToHttpParamsRecursive(httpParams, value); + } else { + httpParams = this.addToHttpParamsRecursive(httpParams, value, key); + } + return httpParams; + } + + private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { + if (value == null) { + return httpParams; + } + + if (typeof value === "object") { + if (Array.isArray(value)) { + (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); + } else if (value instanceof Date) { + if (key != null) { + httpParams = httpParams.append(key, + (value as Date).toISOString().substr(0, 10)); + } else { + throw Error("key may not be null if value is Date"); + } + } else { + Object.keys(value).forEach( k => httpParams = this.addToHttpParamsRecursive( + httpParams, value[k], key != null ? `${key}.${k}` : k)); + } + } else if (key != null) { + httpParams = httpParams.append(key, value); + } else { + throw Error("key may not be null if value is not object or array"); + } + return httpParams; + } + + /** + * Create user + * This can only be done by the logged in user. + * @param body Created user object + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public createUser(body: User, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; + public createUser(body: User, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; + public createUser(body: User, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; + public createUser(body: User, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling createUser.'); + } + + let headers = this.defaultHeaders; + + let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (httpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + + // to determine the Content-Type header + const consumes: string[] = [ + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + headers = headers.set('Content-Type', httpContentTypeSelected); + } + + let responseType: 'text' | 'json' = 'json'; + if(httpHeaderAcceptSelected && httpHeaderAcceptSelected.startsWith('text')) { + responseType = 'text'; + } + + return this.httpClient.post(`${this.configuration.basePath}/user`, + body, + { + responseType: responseType, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Creates list of users with given input array + * @param body List of user object + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public createUsersWithArrayInput(body: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; + public createUsersWithArrayInput(body: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; + public createUsersWithArrayInput(body: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; + public createUsersWithArrayInput(body: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling createUsersWithArrayInput.'); + } + + let headers = this.defaultHeaders; + + let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (httpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + + // to determine the Content-Type header + const consumes: string[] = [ + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + headers = headers.set('Content-Type', httpContentTypeSelected); + } + + let responseType: 'text' | 'json' = 'json'; + if(httpHeaderAcceptSelected && httpHeaderAcceptSelected.startsWith('text')) { + responseType = 'text'; + } + + return this.httpClient.post(`${this.configuration.basePath}/user/createWithArray`, + body, + { + responseType: responseType, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Creates list of users with given input array + * @param body List of user object + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public createUsersWithListInput(body: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; + public createUsersWithListInput(body: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; + public createUsersWithListInput(body: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; + public createUsersWithListInput(body: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling createUsersWithListInput.'); + } + + let headers = this.defaultHeaders; + + let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (httpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + + // to determine the Content-Type header + const consumes: string[] = [ + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + headers = headers.set('Content-Type', httpContentTypeSelected); + } + + let responseType: 'text' | 'json' = 'json'; + if(httpHeaderAcceptSelected && httpHeaderAcceptSelected.startsWith('text')) { + responseType = 'text'; + } + + return this.httpClient.post(`${this.configuration.basePath}/user/createWithList`, + body, + { + responseType: responseType, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Delete user + * This can only be done by the logged in user. + * @param username The name that needs to be deleted + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public deleteUser(username: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; + public deleteUser(username: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; + public deleteUser(username: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; + public deleteUser(username: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + if (username === null || username === undefined) { + throw new Error('Required parameter username was null or undefined when calling deleteUser.'); + } + + let headers = this.defaultHeaders; + + let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (httpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + + let responseType: 'text' | 'json' = 'json'; + if(httpHeaderAcceptSelected && httpHeaderAcceptSelected.startsWith('text')) { + responseType = 'text'; + } + + return this.httpClient.delete(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, + { + responseType: responseType, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Get user by user name + * @param username The name that needs to be fetched. Use user1 for testing. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getUserByName(username: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable; + public getUserByName(username: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; + public getUserByName(username: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; + public getUserByName(username: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + if (username === null || username === undefined) { + throw new Error('Required parameter username was null or undefined when calling getUserByName.'); + } + + let headers = this.defaultHeaders; + + let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (httpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/xml', + 'application/json' + ]; + httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + + let responseType: 'text' | 'json' = 'json'; + if(httpHeaderAcceptSelected && httpHeaderAcceptSelected.startsWith('text')) { + responseType = 'text'; + } + + return this.httpClient.get(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, + { + responseType: responseType, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Logs user into the system + * @param username The user name for login + * @param password The password for login in clear text + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public loginUser(username: string, password: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable; + public loginUser(username: string, password: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; + public loginUser(username: string, password: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; + public loginUser(username: string, password: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + if (username === null || username === undefined) { + throw new Error('Required parameter username was null or undefined when calling loginUser.'); + } + if (password === null || password === undefined) { + throw new Error('Required parameter password was null or undefined when calling loginUser.'); + } + + let queryParameters = new HttpParams({encoder: this.encoder}); + if (username !== undefined && username !== null) { + queryParameters = this.addToHttpParams(queryParameters, + username, 'username'); + } + if (password !== undefined && password !== null) { + queryParameters = this.addToHttpParams(queryParameters, + password, 'password'); + } + + let headers = this.defaultHeaders; + + let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (httpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/xml', + 'application/json' + ]; + httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + + let responseType: 'text' | 'json' = 'json'; + if(httpHeaderAcceptSelected && httpHeaderAcceptSelected.startsWith('text')) { + responseType = 'text'; + } + + return this.httpClient.get(`${this.configuration.basePath}/user/login`, + { + params: queryParameters, + responseType: responseType, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Logs out current logged in user session + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public logoutUser(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; + public logoutUser(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; + public logoutUser(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; + public logoutUser(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + + let headers = this.defaultHeaders; + + let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (httpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + + let responseType: 'text' | 'json' = 'json'; + if(httpHeaderAcceptSelected && httpHeaderAcceptSelected.startsWith('text')) { + responseType = 'text'; + } + + return this.httpClient.get(`${this.configuration.basePath}/user/logout`, + { + responseType: responseType, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Updated user + * This can only be done by the logged in user. + * @param username name that need to be deleted + * @param body Updated user object + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public updateUser(username: string, body: User, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; + public updateUser(username: string, body: User, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; + public updateUser(username: string, body: User, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; + public updateUser(username: string, body: User, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + if (username === null || username === undefined) { + throw new Error('Required parameter username was null or undefined when calling updateUser.'); + } + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling updateUser.'); + } + + let headers = this.defaultHeaders; + + let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (httpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + + // to determine the Content-Type header + const consumes: string[] = [ + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + headers = headers.set('Content-Type', httpContentTypeSelected); + } + + let responseType: 'text' | 'json' = 'json'; + if(httpHeaderAcceptSelected && httpHeaderAcceptSelected.startsWith('text')) { + responseType = 'text'; + } + + return this.httpClient.put(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, + body, + { + responseType: responseType, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + +} diff --git a/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/configuration.ts b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/configuration.ts new file mode 100644 index 000000000000..38126642420d --- /dev/null +++ b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/configuration.ts @@ -0,0 +1,137 @@ +import { HttpParameterCodec } from '@angular/common/http'; + +export interface ConfigurationParameters { + /** + * @deprecated Since 5.0. Use credentials instead + */ + apiKeys?: {[ key: string ]: string}; + username?: string; + password?: string; + /** + * @deprecated Since 5.0. Use credentials instead + */ + accessToken?: string | (() => string); + basePath?: string; + withCredentials?: boolean; + encoder?: HttpParameterCodec; + /** + * The keys are the names in the securitySchemes section of the OpenAPI + * document. They should map to the value used for authentication + * minus any standard prefixes such as 'Basic' or 'Bearer'. + */ + credentials?: {[ key: string ]: string | (() => string | undefined)}; +} + +export class Configuration { + /** + * @deprecated Since 5.0. Use credentials instead + */ + apiKeys?: {[ key: string ]: string}; + username?: string; + password?: string; + /** + * @deprecated Since 5.0. Use credentials instead + */ + accessToken?: string | (() => string); + basePath?: string; + withCredentials?: boolean; + encoder?: HttpParameterCodec; + /** + * The keys are the names in the securitySchemes section of the OpenAPI + * document. They should map to the value used for authentication + * minus any standard prefixes such as 'Basic' or 'Bearer'. + */ + credentials: {[ key: string ]: string | (() => string | undefined)}; + + constructor(configurationParameters: ConfigurationParameters = {}) { + this.apiKeys = configurationParameters.apiKeys; + this.username = configurationParameters.username; + this.password = configurationParameters.password; + this.accessToken = configurationParameters.accessToken; + this.basePath = configurationParameters.basePath; + this.withCredentials = configurationParameters.withCredentials; + this.encoder = configurationParameters.encoder; + if (configurationParameters.credentials) { + this.credentials = configurationParameters.credentials; + } + else { + this.credentials = {}; + } + + // init default api_key credential + if (!this.credentials['api_key']) { + this.credentials['api_key'] = () => { + return this.apiKeys['api_key'] || this.apiKeys['api_key']; + }; + } + + // init default petstore_auth credential + if (!this.credentials['petstore_auth']) { + this.credentials['petstore_auth'] = () => { + return typeof this.accessToken === 'function' + ? this.accessToken() + : this.accessToken; + }; + } + } + + /** + * Select the correct content-type to use for a request. + * Uses {@link Configuration#isJsonMime} to determine the correct content-type. + * If no content type is found return the first found type if the contentTypes is not empty + * @param contentTypes - the array of content types that are available for selection + * @returns the selected content-type or undefined if no selection could be made. + */ + public selectHeaderContentType (contentTypes: string[]): string | undefined { + if (contentTypes.length === 0) { + return undefined; + } + + const type = contentTypes.find((x: string) => this.isJsonMime(x)); + if (type === undefined) { + return contentTypes[0]; + } + return type; + } + + /** + * Select the correct accept content-type to use for a request. + * Uses {@link Configuration#isJsonMime} to determine the correct accept content-type. + * If no content type is found return the first found type if the contentTypes is not empty + * @param accepts - the array of content types that are available for selection. + * @returns the selected content-type or undefined if no selection could be made. + */ + public selectHeaderAccept(accepts: string[]): string | undefined { + if (accepts.length === 0) { + return undefined; + } + + const type = accepts.find((x: string) => this.isJsonMime(x)); + if (type === undefined) { + return accepts[0]; + } + return type; + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * application/vnd.company+json + * @param mime - MIME (Multipurpose Internet Mail Extensions) + * @return True if the given MIME is JSON, false otherwise. + */ + public isJsonMime(mime: string): boolean { + const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); + return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); + } + + public lookupCredential(key: string): string | undefined { + const value = this.credentials[key]; + return typeof value === 'function' + ? value() + : value; + } +} diff --git a/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/encoder.ts b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/encoder.ts new file mode 100644 index 000000000000..138c4d5cf2c1 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/encoder.ts @@ -0,0 +1,20 @@ +import { HttpParameterCodec } from '@angular/common/http'; + +/** + * Custom HttpParameterCodec + * Workaround for https://github.com/angular/angular/issues/18261 + */ +export class CustomHttpParameterCodec implements HttpParameterCodec { + encodeKey(k: string): string { + return encodeURIComponent(k); + } + encodeValue(v: string): string { + return encodeURIComponent(v); + } + decodeKey(k: string): string { + return decodeURIComponent(k); + } + decodeValue(v: string): string { + return decodeURIComponent(v); + } +} diff --git a/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/git_push.sh b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/git_push.sh new file mode 100644 index 000000000000..ced3be2b0c7b --- /dev/null +++ b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/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/client/petstore/typescript-angular-v9-provided-in-root/builds/default/index.ts b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/index.ts new file mode 100644 index 000000000000..c312b70fa3ef --- /dev/null +++ b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/index.ts @@ -0,0 +1,5 @@ +export * from './api/api'; +export * from './model/models'; +export * from './variables'; +export * from './configuration'; +export * from './api.module'; \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/model/apiResponse.ts b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/model/apiResponse.ts new file mode 100644 index 000000000000..682ba478921e --- /dev/null +++ b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/model/apiResponse.ts @@ -0,0 +1,22 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +/** + * Describes the result of uploading an image resource + */ +export interface ApiResponse { + code?: number; + type?: string; + message?: string; +} + diff --git a/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/model/category.ts b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/model/category.ts new file mode 100644 index 000000000000..b988b6827a05 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/model/category.ts @@ -0,0 +1,21 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +/** + * A category for a pet + */ +export interface Category { + id?: number; + name?: string; +} + diff --git a/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/model/models.ts b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/model/models.ts new file mode 100644 index 000000000000..8607c5dabd0c --- /dev/null +++ b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/model/models.ts @@ -0,0 +1,6 @@ +export * from './apiResponse'; +export * from './category'; +export * from './order'; +export * from './pet'; +export * from './tag'; +export * from './user'; diff --git a/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/model/order.ts b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/model/order.ts new file mode 100644 index 000000000000..a29bebe49065 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/model/order.ts @@ -0,0 +1,37 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +/** + * An order for a pets from the pet store + */ +export interface Order { + id?: number; + petId?: number; + quantity?: number; + shipDate?: string; + /** + * Order Status + */ + status?: Order.StatusEnum; + complete?: boolean; +} +export namespace Order { + export type StatusEnum = 'placed' | 'approved' | 'delivered'; + export const StatusEnum = { + Placed: 'placed' as StatusEnum, + Approved: 'approved' as StatusEnum, + Delivered: 'delivered' as StatusEnum + }; +} + + diff --git a/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/model/pet.ts b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/model/pet.ts new file mode 100644 index 000000000000..e0404395f91c --- /dev/null +++ b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/model/pet.ts @@ -0,0 +1,39 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { Category } from './category'; +import { Tag } from './tag'; + + +/** + * A pet for sale in the pet store + */ +export interface Pet { + id?: number; + category?: Category; + name: string; + photoUrls: Array; + tags?: Array; + /** + * pet status in the store + */ + status?: Pet.StatusEnum; +} +export namespace Pet { + export type StatusEnum = 'available' | 'pending' | 'sold'; + export const StatusEnum = { + Available: 'available' as StatusEnum, + Pending: 'pending' as StatusEnum, + Sold: 'sold' as StatusEnum + }; +} + + diff --git a/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/model/tag.ts b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/model/tag.ts new file mode 100644 index 000000000000..b6ff210e8df4 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/model/tag.ts @@ -0,0 +1,21 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +/** + * A tag for a pet + */ +export interface Tag { + id?: number; + name?: string; +} + diff --git a/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/model/user.ts b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/model/user.ts new file mode 100644 index 000000000000..fce51005300c --- /dev/null +++ b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/model/user.ts @@ -0,0 +1,30 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +/** + * A User who is purchasing from the pet store + */ +export interface User { + id?: number; + username?: string; + firstName?: string; + lastName?: string; + email?: string; + password?: string; + phone?: string; + /** + * User Status + */ + userStatus?: number; +} + diff --git a/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/variables.ts b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/variables.ts new file mode 100644 index 000000000000..6fe58549f395 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/variables.ts @@ -0,0 +1,9 @@ +import { InjectionToken } from '@angular/core'; + +export const BASE_PATH = new InjectionToken('basePath'); +export const COLLECTION_FORMATS = { + 'csv': ',', + 'tsv': ' ', + 'ssv': ' ', + 'pipes': '|' +} diff --git a/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/.gitignore b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/.gitignore new file mode 100644 index 000000000000..149b57654723 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/.gitignore @@ -0,0 +1,4 @@ +wwwroot/*.js +node_modules +typings +dist diff --git a/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/.openapi-generator-ignore b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/.openapi-generator-ignore new file mode 100644 index 000000000000..7484ee590a38 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/.openapi-generator/FILES b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/.openapi-generator/FILES new file mode 100644 index 000000000000..a2650d9db088 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/.openapi-generator/FILES @@ -0,0 +1,22 @@ +.gitignore +README.md +api.module.ts +api/api.ts +api/pet.service.ts +api/store.service.ts +api/user.service.ts +configuration.ts +encoder.ts +git_push.sh +index.ts +model/./apiResponse.ts +model/./category.ts +model/./order.ts +model/./pet.ts +model/./tag.ts +model/./user.ts +model/models.ts +ng-package.json +package.json +tsconfig.json +variables.ts diff --git a/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/.openapi-generator/VERSION new file mode 100644 index 000000000000..d99e7162d01f --- /dev/null +++ b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/.openapi-generator/VERSION @@ -0,0 +1 @@ +5.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/README.md b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/README.md new file mode 100644 index 000000000000..151fb2f1a505 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/README.md @@ -0,0 +1,203 @@ +## @openapitools/typescript-angular-petstore@1.0.0 + +### Building + +To install the required dependencies and to build the typescript sources run: +``` +npm install +npm run build +``` + +### publishing + +First build the package then run ```npm publish dist``` (don't forget to specify the `dist` folder!) + +### consuming + +Navigate to the folder of your consuming project and run one of next commands. + +_published:_ + +``` +npm install @openapitools/typescript-angular-petstore@1.0.0 --save +``` + +_without publishing (not recommended):_ + +``` +npm install PATH_TO_GENERATED_PACKAGE/dist.tgz --save +``` + +_It's important to take the tgz file, otherwise you'll get trouble with links on windows_ + +_using `npm link`:_ + +In PATH_TO_GENERATED_PACKAGE/dist: +``` +npm link +``` + +In your project: +``` +npm link @openapitools/typescript-angular-petstore +``` + +__Note for Windows users:__ The Angular CLI has troubles to use linked npm packages. +Please refer to this issue https://github.com/angular/angular-cli/issues/8284 for a solution / workaround. +Published packages are not effected by this issue. + + +#### General usage + +In your Angular project: + + +``` +// without configuring providers +import { ApiModule } from '@openapitools/typescript-angular-petstore'; +import { HttpClientModule } from '@angular/common/http'; + +@NgModule({ + imports: [ + ApiModule, + // make sure to import the HttpClientModule in the AppModule only, + // see https://github.com/angular/angular/issues/20575 + HttpClientModule + ], + declarations: [ AppComponent ], + providers: [], + bootstrap: [ AppComponent ] +}) +export class AppModule {} +``` + +``` +// configuring providers +import { ApiModule, Configuration, ConfigurationParameters } from '@openapitools/typescript-angular-petstore'; + +export function apiConfigFactory (): Configuration => { + const params: ConfigurationParameters = { + // set configuration parameters here. + } + return new Configuration(params); +} + +@NgModule({ + imports: [ ApiModule.forRoot(apiConfigFactory) ], + declarations: [ AppComponent ], + providers: [], + bootstrap: [ AppComponent ] +}) +export class AppModule {} +``` + +``` +// configuring providers with an authentication service that manages your access tokens +import { ApiModule, Configuration } from '@openapitools/typescript-angular-petstore'; + +@NgModule({ + imports: [ ApiModule ], + declarations: [ AppComponent ], + providers: [ + { + provide: Configuration, + useFactory: (authService: AuthService) => new Configuration( + { + basePath: environment.apiUrl, + accessToken: authService.getAccessToken.bind(authService) + } + ), + deps: [AuthService], + multi: false + } + ], + bootstrap: [ AppComponent ] +}) +export class AppModule {} +``` + +``` +import { DefaultApi } from '@openapitools/typescript-angular-petstore'; + +export class AppComponent { + constructor(private apiGateway: DefaultApi) { } +} +``` + +Note: The ApiModule is restricted to being instantiated once app wide. +This is to ensure that all services are treated as singletons. + +#### Using multiple OpenAPI files / APIs / ApiModules +In order to use multiple `ApiModules` generated from different OpenAPI files, +you can create an alias name when importing the modules +in order to avoid naming conflicts: +``` +import { ApiModule } from 'my-api-path'; +import { ApiModule as OtherApiModule } from 'my-other-api-path'; +import { HttpClientModule } from '@angular/common/http'; + +@NgModule({ + imports: [ + ApiModule, + OtherApiModule, + // make sure to import the HttpClientModule in the AppModule only, + // see https://github.com/angular/angular/issues/20575 + HttpClientModule + ] +}) +export class AppModule { + +} +``` + + +### Set service base path +If different than the generated base path, during app bootstrap, you can provide the base path to your service. + +``` +import { BASE_PATH } from '@openapitools/typescript-angular-petstore'; + +bootstrap(AppComponent, [ + { provide: BASE_PATH, useValue: 'https://your-web-service.com' }, +]); +``` +or + +``` +import { BASE_PATH } from '@openapitools/typescript-angular-petstore'; + +@NgModule({ + imports: [], + declarations: [ AppComponent ], + providers: [ provide: BASE_PATH, useValue: 'https://your-web-service.com' ], + bootstrap: [ AppComponent ] +}) +export class AppModule {} +``` + + +#### Using @angular/cli +First extend your `src/environments/*.ts` files by adding the corresponding base path: + +``` +export const environment = { + production: false, + API_BASE_PATH: 'http://127.0.0.1:8080' +}; +``` + +In the src/app/app.module.ts: +``` +import { BASE_PATH } from '@openapitools/typescript-angular-petstore'; +import { environment } from '../environments/environment'; + +@NgModule({ + declarations: [ + AppComponent + ], + imports: [ ], + providers: [{ provide: BASE_PATH, useValue: environment.API_BASE_PATH }], + bootstrap: [ AppComponent ] +}) +export class AppModule { } +``` diff --git a/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/api.module.ts b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/api.module.ts new file mode 100644 index 000000000000..2afb8f64e926 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/api.module.ts @@ -0,0 +1,33 @@ +import { NgModule, ModuleWithProviders, SkipSelf, Optional } from '@angular/core'; +import { Configuration } from './configuration'; +import { HttpClient } from '@angular/common/http'; + +import { PetService } from './api/pet.service'; +import { StoreService } from './api/store.service'; +import { UserService } from './api/user.service'; + +@NgModule({ + imports: [], + declarations: [], + exports: [], + providers: [] +}) +export class ApiModule { + public static forRoot(configurationFactory: () => Configuration): ModuleWithProviders { + return { + ngModule: ApiModule, + providers: [ { provide: Configuration, useFactory: configurationFactory } ] + }; + } + + constructor( @Optional() @SkipSelf() parentModule: ApiModule, + @Optional() http: HttpClient) { + if (parentModule) { + throw new Error('ApiModule is already loaded. Import in your base AppModule only.'); + } + if (!http) { + throw new Error('You need to import the HttpClientModule in your AppModule! \n' + + 'See also https://github.com/angular/angular/issues/20575'); + } + } +} diff --git a/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/api/api.ts b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/api/api.ts new file mode 100644 index 000000000000..8e44b64083d5 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/api/api.ts @@ -0,0 +1,7 @@ +export * from './pet.service'; +import { PetService } from './pet.service'; +export * from './store.service'; +import { StoreService } from './store.service'; +export * from './user.service'; +import { UserService } from './user.service'; +export const APIS = [PetService, StoreService, UserService]; diff --git a/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/api/pet.service.ts new file mode 100644 index 000000000000..46fef0be89fe --- /dev/null +++ b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/api/pet.service.ts @@ -0,0 +1,613 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +/* tslint:disable:no-unused-variable member-ordering */ + +import { Inject, Injectable, Optional } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpParams, + HttpResponse, HttpEvent, HttpParameterCodec } from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; + +import { ApiResponse } from '../model/models'; +import { Pet } from '../model/models'; + +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; + + + +@Injectable({ + providedIn: 'root' +}) +export class PetService { + + protected basePath = 'http://petstore.swagger.io/v2'; + public defaultHeaders = new HttpHeaders(); + public configuration = new Configuration(); + public encoder: HttpParameterCodec; + + constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string, @Optional() configuration: Configuration) { + if (configuration) { + this.configuration = configuration; + } + if (typeof this.configuration.basePath !== 'string') { + if (typeof basePath !== 'string') { + basePath = this.basePath; + } + this.configuration.basePath = basePath; + } + this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); + } + + /** + * @param consumes string[] mime-types + * @return true: consumes contains 'multipart/form-data', false: otherwise + */ + private canConsumeForm(consumes: string[]): boolean { + const form = 'multipart/form-data'; + for (const consume of consumes) { + if (form === consume) { + return true; + } + } + return false; + } + + private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object" && value instanceof Date === false) { + httpParams = this.addToHttpParamsRecursive(httpParams, value); + } else { + httpParams = this.addToHttpParamsRecursive(httpParams, value, key); + } + return httpParams; + } + + private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { + if (value == null) { + return httpParams; + } + + if (typeof value === "object") { + if (Array.isArray(value)) { + (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); + } else if (value instanceof Date) { + if (key != null) { + httpParams = httpParams.append(key, + (value as Date).toISOString().substr(0, 10)); + } else { + throw Error("key may not be null if value is Date"); + } + } else { + Object.keys(value).forEach( k => httpParams = this.addToHttpParamsRecursive( + httpParams, value[k], key != null ? `${key}.${k}` : k)); + } + } else if (key != null) { + httpParams = httpParams.append(key, value); + } else { + throw Error("key may not be null if value is not object or array"); + } + return httpParams; + } + + /** + * Add a new pet to the store + * @param body Pet object that needs to be added to the store + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public addPet(body: Pet, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; + public addPet(body: Pet, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; + public addPet(body: Pet, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; + public addPet(body: Pet, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling addPet.'); + } + + let headers = this.defaultHeaders; + + let credential: string | undefined; + // authentication (petstore_auth) required + credential = this.configuration.lookupCredential('petstore_auth'); + if (credential) { + headers = headers.set('Authorization', 'Bearer ' + credential); + } + + let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (httpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/json', + 'application/xml' + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + headers = headers.set('Content-Type', httpContentTypeSelected); + } + + let responseType: 'text' | 'json' = 'json'; + if(httpHeaderAcceptSelected && httpHeaderAcceptSelected.startsWith('text')) { + responseType = 'text'; + } + + return this.httpClient.post(`${this.configuration.basePath}/pet`, + body, + { + responseType: responseType, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Deletes a pet + * @param petId Pet id to delete + * @param apiKey + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public deletePet(petId: number, apiKey?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; + public deletePet(petId: number, apiKey?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; + public deletePet(petId: number, apiKey?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; + public deletePet(petId: number, apiKey?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + if (petId === null || petId === undefined) { + throw new Error('Required parameter petId was null or undefined when calling deletePet.'); + } + + let headers = this.defaultHeaders; + if (apiKey !== undefined && apiKey !== null) { + headers = headers.set('api_key', String(apiKey)); + } + + let credential: string | undefined; + // authentication (petstore_auth) required + credential = this.configuration.lookupCredential('petstore_auth'); + if (credential) { + headers = headers.set('Authorization', 'Bearer ' + credential); + } + + let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (httpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + + let responseType: 'text' | 'json' = 'json'; + if(httpHeaderAcceptSelected && httpHeaderAcceptSelected.startsWith('text')) { + responseType = 'text'; + } + + return this.httpClient.delete(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, + { + responseType: responseType, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Finds Pets by status + * Multiple status values can be provided with comma separated strings + * @param status Status values that need to be considered for filter + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>>; + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>>; + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + if (status === null || status === undefined) { + throw new Error('Required parameter status was null or undefined when calling findPetsByStatus.'); + } + + let queryParameters = new HttpParams({encoder: this.encoder}); + if (status) { + queryParameters = this.addToHttpParams(queryParameters, + status.join(COLLECTION_FORMATS['csv']), 'status'); + } + + let headers = this.defaultHeaders; + + let credential: string | undefined; + // authentication (petstore_auth) required + credential = this.configuration.lookupCredential('petstore_auth'); + if (credential) { + headers = headers.set('Authorization', 'Bearer ' + credential); + } + + let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (httpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/xml', + 'application/json' + ]; + httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + + let responseType: 'text' | 'json' = 'json'; + if(httpHeaderAcceptSelected && httpHeaderAcceptSelected.startsWith('text')) { + responseType = 'text'; + } + + return this.httpClient.get>(`${this.configuration.basePath}/pet/findByStatus`, + { + params: queryParameters, + responseType: responseType, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * @param tags Tags to filter by + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + * @deprecated + */ + public findPetsByTags(tags: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; + public findPetsByTags(tags: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>>; + public findPetsByTags(tags: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>>; + public findPetsByTags(tags: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + if (tags === null || tags === undefined) { + throw new Error('Required parameter tags was null or undefined when calling findPetsByTags.'); + } + + let queryParameters = new HttpParams({encoder: this.encoder}); + if (tags) { + queryParameters = this.addToHttpParams(queryParameters, + tags.join(COLLECTION_FORMATS['csv']), 'tags'); + } + + let headers = this.defaultHeaders; + + let credential: string | undefined; + // authentication (petstore_auth) required + credential = this.configuration.lookupCredential('petstore_auth'); + if (credential) { + headers = headers.set('Authorization', 'Bearer ' + credential); + } + + let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (httpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/xml', + 'application/json' + ]; + httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + + let responseType: 'text' | 'json' = 'json'; + if(httpHeaderAcceptSelected && httpHeaderAcceptSelected.startsWith('text')) { + responseType = 'text'; + } + + return this.httpClient.get>(`${this.configuration.basePath}/pet/findByTags`, + { + params: queryParameters, + responseType: responseType, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Find pet by ID + * Returns a single pet + * @param petId ID of pet to return + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getPetById(petId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable; + public getPetById(petId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; + public getPetById(petId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; + public getPetById(petId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + if (petId === null || petId === undefined) { + throw new Error('Required parameter petId was null or undefined when calling getPetById.'); + } + + let headers = this.defaultHeaders; + + let credential: string | undefined; + // authentication (api_key) required + credential = this.configuration.lookupCredential('api_key'); + if (credential) { + headers = headers.set('api_key', credential); + } + + let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (httpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/xml', + 'application/json' + ]; + httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + + let responseType: 'text' | 'json' = 'json'; + if(httpHeaderAcceptSelected && httpHeaderAcceptSelected.startsWith('text')) { + responseType = 'text'; + } + + return this.httpClient.get(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, + { + responseType: responseType, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Update an existing pet + * @param body Pet object that needs to be added to the store + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public updatePet(body: Pet, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; + public updatePet(body: Pet, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; + public updatePet(body: Pet, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; + public updatePet(body: Pet, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling updatePet.'); + } + + let headers = this.defaultHeaders; + + let credential: string | undefined; + // authentication (petstore_auth) required + credential = this.configuration.lookupCredential('petstore_auth'); + if (credential) { + headers = headers.set('Authorization', 'Bearer ' + credential); + } + + let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (httpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/json', + 'application/xml' + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + headers = headers.set('Content-Type', httpContentTypeSelected); + } + + let responseType: 'text' | 'json' = 'json'; + if(httpHeaderAcceptSelected && httpHeaderAcceptSelected.startsWith('text')) { + responseType = 'text'; + } + + return this.httpClient.put(`${this.configuration.basePath}/pet`, + body, + { + responseType: responseType, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Updates a pet in the store with form data + * @param petId ID of pet that needs to be updated + * @param name Updated name of the pet + * @param status Updated status of the pet + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; + public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; + public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; + public updatePetWithForm(petId: number, name?: string, status?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + if (petId === null || petId === undefined) { + throw new Error('Required parameter petId was null or undefined when calling updatePetWithForm.'); + } + + let headers = this.defaultHeaders; + + let credential: string | undefined; + // authentication (petstore_auth) required + credential = this.configuration.lookupCredential('petstore_auth'); + if (credential) { + headers = headers.set('Authorization', 'Bearer ' + credential); + } + + let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (httpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/x-www-form-urlencoded' + ]; + + const canConsumeForm = this.canConsumeForm(consumes); + + let formParams: { append(param: string, value: any): any; }; + let useForm = false; + let convertFormParamsToString = false; + if (useForm) { + formParams = new FormData(); + } else { + formParams = new HttpParams({encoder: this.encoder}); + } + + if (name !== undefined) { + formParams = formParams.append('name', name) as any || formParams; + } + if (status !== undefined) { + formParams = formParams.append('status', status) as any || formParams; + } + + let responseType: 'text' | 'json' = 'json'; + if(httpHeaderAcceptSelected && httpHeaderAcceptSelected.startsWith('text')) { + responseType = 'text'; + } + + return this.httpClient.post(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, + convertFormParamsToString ? formParams.toString() : formParams, + { + responseType: responseType, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * uploads an image + * @param petId ID of pet to update + * @param additionalMetadata Additional data to pass to server + * @param file file to upload + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable; + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>; + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>; + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json'}): Observable { + if (petId === null || petId === undefined) { + throw new Error('Required parameter petId was null or undefined when calling uploadFile.'); + } + + let headers = this.defaultHeaders; + + let credential: string | undefined; + // authentication (petstore_auth) required + credential = this.configuration.lookupCredential('petstore_auth'); + if (credential) { + headers = headers.set('Authorization', 'Bearer ' + credential); + } + + let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (httpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/json' + ]; + httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + // to determine the Content-Type header + const consumes: string[] = [ + 'multipart/form-data' + ]; + + const canConsumeForm = this.canConsumeForm(consumes); + + let formParams: { append(param: string, value: any): any; }; + let useForm = false; + let convertFormParamsToString = false; + // use FormData to transmit files using content-type "multipart/form-data" + // see https://stackoverflow.com/questions/4007969/application-x-www-form-urlencoded-or-multipart-form-data + useForm = canConsumeForm; + if (useForm) { + formParams = new FormData(); + } else { + formParams = new HttpParams({encoder: this.encoder}); + } + + if (additionalMetadata !== undefined) { + formParams = formParams.append('additionalMetadata', additionalMetadata) as any || formParams; + } + if (file !== undefined) { + formParams = formParams.append('file', file) as any || formParams; + } + + let responseType: 'text' | 'json' = 'json'; + if(httpHeaderAcceptSelected && httpHeaderAcceptSelected.startsWith('text')) { + responseType = 'text'; + } + + return this.httpClient.post(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}/uploadImage`, + convertFormParamsToString ? formParams.toString() : formParams, + { + responseType: responseType, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + +} diff --git a/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/api/store.service.ts new file mode 100644 index 000000000000..d5d08ab3adc3 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/api/store.service.ts @@ -0,0 +1,283 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +/* tslint:disable:no-unused-variable member-ordering */ + +import { Inject, Injectable, Optional } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpParams, + HttpResponse, HttpEvent, HttpParameterCodec } from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; + +import { Order } from '../model/models'; + +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; + + + +@Injectable({ + providedIn: 'root' +}) +export class StoreService { + + protected basePath = 'http://petstore.swagger.io/v2'; + public defaultHeaders = new HttpHeaders(); + public configuration = new Configuration(); + public encoder: HttpParameterCodec; + + constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string, @Optional() configuration: Configuration) { + if (configuration) { + this.configuration = configuration; + } + if (typeof this.configuration.basePath !== 'string') { + if (typeof basePath !== 'string') { + basePath = this.basePath; + } + this.configuration.basePath = basePath; + } + this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); + } + + + private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object" && value instanceof Date === false) { + httpParams = this.addToHttpParamsRecursive(httpParams, value); + } else { + httpParams = this.addToHttpParamsRecursive(httpParams, value, key); + } + return httpParams; + } + + private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { + if (value == null) { + return httpParams; + } + + if (typeof value === "object") { + if (Array.isArray(value)) { + (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); + } else if (value instanceof Date) { + if (key != null) { + httpParams = httpParams.append(key, + (value as Date).toISOString().substr(0, 10)); + } else { + throw Error("key may not be null if value is Date"); + } + } else { + Object.keys(value).forEach( k => httpParams = this.addToHttpParamsRecursive( + httpParams, value[k], key != null ? `${key}.${k}` : k)); + } + } else if (key != null) { + httpParams = httpParams.append(key, value); + } else { + throw Error("key may not be null if value is not object or array"); + } + return httpParams; + } + + /** + * Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * @param orderId ID of the order that needs to be deleted + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public deleteOrder(orderId: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; + public deleteOrder(orderId: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; + public deleteOrder(orderId: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; + public deleteOrder(orderId: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + if (orderId === null || orderId === undefined) { + throw new Error('Required parameter orderId was null or undefined when calling deleteOrder.'); + } + + let headers = this.defaultHeaders; + + let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (httpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + + let responseType: 'text' | 'json' = 'json'; + if(httpHeaderAcceptSelected && httpHeaderAcceptSelected.startsWith('text')) { + responseType = 'text'; + } + + return this.httpClient.delete(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, + { + responseType: responseType, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Returns pet inventories by status + * Returns a map of status codes to quantities + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getInventory(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable<{ [key: string]: number; }>; + public getInventory(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>; + public getInventory(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>; + public getInventory(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json'}): Observable { + + let headers = this.defaultHeaders; + + let credential: string | undefined; + // authentication (api_key) required + credential = this.configuration.lookupCredential('api_key'); + if (credential) { + headers = headers.set('api_key', credential); + } + + let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (httpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/json' + ]; + httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + + let responseType: 'text' | 'json' = 'json'; + if(httpHeaderAcceptSelected && httpHeaderAcceptSelected.startsWith('text')) { + responseType = 'text'; + } + + return this.httpClient.get<{ [key: string]: number; }>(`${this.configuration.basePath}/store/inventory`, + { + responseType: responseType, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * @param orderId ID of pet that needs to be fetched + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getOrderById(orderId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable; + public getOrderById(orderId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; + public getOrderById(orderId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; + public getOrderById(orderId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + if (orderId === null || orderId === undefined) { + throw new Error('Required parameter orderId was null or undefined when calling getOrderById.'); + } + + let headers = this.defaultHeaders; + + let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (httpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/xml', + 'application/json' + ]; + httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + + let responseType: 'text' | 'json' = 'json'; + if(httpHeaderAcceptSelected && httpHeaderAcceptSelected.startsWith('text')) { + responseType = 'text'; + } + + return this.httpClient.get(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, + { + responseType: responseType, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Place an order for a pet + * @param body order placed for purchasing the pet + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public placeOrder(body: Order, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable; + public placeOrder(body: Order, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; + public placeOrder(body: Order, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; + public placeOrder(body: Order, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling placeOrder.'); + } + + let headers = this.defaultHeaders; + + let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (httpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/xml', + 'application/json' + ]; + httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + + // to determine the Content-Type header + const consumes: string[] = [ + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + headers = headers.set('Content-Type', httpContentTypeSelected); + } + + let responseType: 'text' | 'json' = 'json'; + if(httpHeaderAcceptSelected && httpHeaderAcceptSelected.startsWith('text')) { + responseType = 'text'; + } + + return this.httpClient.post(`${this.configuration.basePath}/store/order`, + body, + { + responseType: responseType, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + +} diff --git a/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/api/user.service.ts b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/api/user.service.ts new file mode 100644 index 000000000000..399676219054 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/api/user.service.ts @@ -0,0 +1,497 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +/* tslint:disable:no-unused-variable member-ordering */ + +import { Inject, Injectable, Optional } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpParams, + HttpResponse, HttpEvent, HttpParameterCodec } from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; + +import { User } from '../model/models'; + +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; + + + +@Injectable({ + providedIn: 'root' +}) +export class UserService { + + protected basePath = 'http://petstore.swagger.io/v2'; + public defaultHeaders = new HttpHeaders(); + public configuration = new Configuration(); + public encoder: HttpParameterCodec; + + constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string, @Optional() configuration: Configuration) { + if (configuration) { + this.configuration = configuration; + } + if (typeof this.configuration.basePath !== 'string') { + if (typeof basePath !== 'string') { + basePath = this.basePath; + } + this.configuration.basePath = basePath; + } + this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); + } + + + private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object" && value instanceof Date === false) { + httpParams = this.addToHttpParamsRecursive(httpParams, value); + } else { + httpParams = this.addToHttpParamsRecursive(httpParams, value, key); + } + return httpParams; + } + + private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { + if (value == null) { + return httpParams; + } + + if (typeof value === "object") { + if (Array.isArray(value)) { + (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); + } else if (value instanceof Date) { + if (key != null) { + httpParams = httpParams.append(key, + (value as Date).toISOString().substr(0, 10)); + } else { + throw Error("key may not be null if value is Date"); + } + } else { + Object.keys(value).forEach( k => httpParams = this.addToHttpParamsRecursive( + httpParams, value[k], key != null ? `${key}.${k}` : k)); + } + } else if (key != null) { + httpParams = httpParams.append(key, value); + } else { + throw Error("key may not be null if value is not object or array"); + } + return httpParams; + } + + /** + * Create user + * This can only be done by the logged in user. + * @param body Created user object + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public createUser(body: User, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; + public createUser(body: User, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; + public createUser(body: User, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; + public createUser(body: User, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling createUser.'); + } + + let headers = this.defaultHeaders; + + let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (httpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + + // to determine the Content-Type header + const consumes: string[] = [ + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + headers = headers.set('Content-Type', httpContentTypeSelected); + } + + let responseType: 'text' | 'json' = 'json'; + if(httpHeaderAcceptSelected && httpHeaderAcceptSelected.startsWith('text')) { + responseType = 'text'; + } + + return this.httpClient.post(`${this.configuration.basePath}/user`, + body, + { + responseType: responseType, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Creates list of users with given input array + * @param body List of user object + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public createUsersWithArrayInput(body: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; + public createUsersWithArrayInput(body: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; + public createUsersWithArrayInput(body: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; + public createUsersWithArrayInput(body: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling createUsersWithArrayInput.'); + } + + let headers = this.defaultHeaders; + + let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (httpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + + // to determine the Content-Type header + const consumes: string[] = [ + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + headers = headers.set('Content-Type', httpContentTypeSelected); + } + + let responseType: 'text' | 'json' = 'json'; + if(httpHeaderAcceptSelected && httpHeaderAcceptSelected.startsWith('text')) { + responseType = 'text'; + } + + return this.httpClient.post(`${this.configuration.basePath}/user/createWithArray`, + body, + { + responseType: responseType, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Creates list of users with given input array + * @param body List of user object + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public createUsersWithListInput(body: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; + public createUsersWithListInput(body: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; + public createUsersWithListInput(body: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; + public createUsersWithListInput(body: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling createUsersWithListInput.'); + } + + let headers = this.defaultHeaders; + + let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (httpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + + // to determine the Content-Type header + const consumes: string[] = [ + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + headers = headers.set('Content-Type', httpContentTypeSelected); + } + + let responseType: 'text' | 'json' = 'json'; + if(httpHeaderAcceptSelected && httpHeaderAcceptSelected.startsWith('text')) { + responseType = 'text'; + } + + return this.httpClient.post(`${this.configuration.basePath}/user/createWithList`, + body, + { + responseType: responseType, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Delete user + * This can only be done by the logged in user. + * @param username The name that needs to be deleted + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public deleteUser(username: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; + public deleteUser(username: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; + public deleteUser(username: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; + public deleteUser(username: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + if (username === null || username === undefined) { + throw new Error('Required parameter username was null or undefined when calling deleteUser.'); + } + + let headers = this.defaultHeaders; + + let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (httpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + + let responseType: 'text' | 'json' = 'json'; + if(httpHeaderAcceptSelected && httpHeaderAcceptSelected.startsWith('text')) { + responseType = 'text'; + } + + return this.httpClient.delete(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, + { + responseType: responseType, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Get user by user name + * @param username The name that needs to be fetched. Use user1 for testing. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getUserByName(username: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable; + public getUserByName(username: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; + public getUserByName(username: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; + public getUserByName(username: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + if (username === null || username === undefined) { + throw new Error('Required parameter username was null or undefined when calling getUserByName.'); + } + + let headers = this.defaultHeaders; + + let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (httpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/xml', + 'application/json' + ]; + httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + + let responseType: 'text' | 'json' = 'json'; + if(httpHeaderAcceptSelected && httpHeaderAcceptSelected.startsWith('text')) { + responseType = 'text'; + } + + return this.httpClient.get(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, + { + responseType: responseType, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Logs user into the system + * @param username The user name for login + * @param password The password for login in clear text + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public loginUser(username: string, password: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable; + public loginUser(username: string, password: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; + public loginUser(username: string, password: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable>; + public loginUser(username: string, password: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json'}): Observable { + if (username === null || username === undefined) { + throw new Error('Required parameter username was null or undefined when calling loginUser.'); + } + if (password === null || password === undefined) { + throw new Error('Required parameter password was null or undefined when calling loginUser.'); + } + + let queryParameters = new HttpParams({encoder: this.encoder}); + if (username !== undefined && username !== null) { + queryParameters = this.addToHttpParams(queryParameters, + username, 'username'); + } + if (password !== undefined && password !== null) { + queryParameters = this.addToHttpParams(queryParameters, + password, 'password'); + } + + let headers = this.defaultHeaders; + + let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (httpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/xml', + 'application/json' + ]; + httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + + let responseType: 'text' | 'json' = 'json'; + if(httpHeaderAcceptSelected && httpHeaderAcceptSelected.startsWith('text')) { + responseType = 'text'; + } + + return this.httpClient.get(`${this.configuration.basePath}/user/login`, + { + params: queryParameters, + responseType: responseType, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Logs out current logged in user session + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public logoutUser(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; + public logoutUser(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; + public logoutUser(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; + public logoutUser(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + + let headers = this.defaultHeaders; + + let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (httpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + + let responseType: 'text' | 'json' = 'json'; + if(httpHeaderAcceptSelected && httpHeaderAcceptSelected.startsWith('text')) { + responseType = 'text'; + } + + return this.httpClient.get(`${this.configuration.basePath}/user/logout`, + { + responseType: responseType, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Updated user + * This can only be done by the logged in user. + * @param username name that need to be deleted + * @param body Updated user object + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public updateUser(username: string, body: User, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable; + public updateUser(username: string, body: User, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; + public updateUser(username: string, body: User, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable>; + public updateUser(username: string, body: User, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable { + if (username === null || username === undefined) { + throw new Error('Required parameter username was null or undefined when calling updateUser.'); + } + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling updateUser.'); + } + + let headers = this.defaultHeaders; + + let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (httpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + + // to determine the Content-Type header + const consumes: string[] = [ + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + headers = headers.set('Content-Type', httpContentTypeSelected); + } + + let responseType: 'text' | 'json' = 'json'; + if(httpHeaderAcceptSelected && httpHeaderAcceptSelected.startsWith('text')) { + responseType = 'text'; + } + + return this.httpClient.put(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, + body, + { + responseType: responseType, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + +} diff --git a/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/configuration.ts b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/configuration.ts new file mode 100644 index 000000000000..38126642420d --- /dev/null +++ b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/configuration.ts @@ -0,0 +1,137 @@ +import { HttpParameterCodec } from '@angular/common/http'; + +export interface ConfigurationParameters { + /** + * @deprecated Since 5.0. Use credentials instead + */ + apiKeys?: {[ key: string ]: string}; + username?: string; + password?: string; + /** + * @deprecated Since 5.0. Use credentials instead + */ + accessToken?: string | (() => string); + basePath?: string; + withCredentials?: boolean; + encoder?: HttpParameterCodec; + /** + * The keys are the names in the securitySchemes section of the OpenAPI + * document. They should map to the value used for authentication + * minus any standard prefixes such as 'Basic' or 'Bearer'. + */ + credentials?: {[ key: string ]: string | (() => string | undefined)}; +} + +export class Configuration { + /** + * @deprecated Since 5.0. Use credentials instead + */ + apiKeys?: {[ key: string ]: string}; + username?: string; + password?: string; + /** + * @deprecated Since 5.0. Use credentials instead + */ + accessToken?: string | (() => string); + basePath?: string; + withCredentials?: boolean; + encoder?: HttpParameterCodec; + /** + * The keys are the names in the securitySchemes section of the OpenAPI + * document. They should map to the value used for authentication + * minus any standard prefixes such as 'Basic' or 'Bearer'. + */ + credentials: {[ key: string ]: string | (() => string | undefined)}; + + constructor(configurationParameters: ConfigurationParameters = {}) { + this.apiKeys = configurationParameters.apiKeys; + this.username = configurationParameters.username; + this.password = configurationParameters.password; + this.accessToken = configurationParameters.accessToken; + this.basePath = configurationParameters.basePath; + this.withCredentials = configurationParameters.withCredentials; + this.encoder = configurationParameters.encoder; + if (configurationParameters.credentials) { + this.credentials = configurationParameters.credentials; + } + else { + this.credentials = {}; + } + + // init default api_key credential + if (!this.credentials['api_key']) { + this.credentials['api_key'] = () => { + return this.apiKeys['api_key'] || this.apiKeys['api_key']; + }; + } + + // init default petstore_auth credential + if (!this.credentials['petstore_auth']) { + this.credentials['petstore_auth'] = () => { + return typeof this.accessToken === 'function' + ? this.accessToken() + : this.accessToken; + }; + } + } + + /** + * Select the correct content-type to use for a request. + * Uses {@link Configuration#isJsonMime} to determine the correct content-type. + * If no content type is found return the first found type if the contentTypes is not empty + * @param contentTypes - the array of content types that are available for selection + * @returns the selected content-type or undefined if no selection could be made. + */ + public selectHeaderContentType (contentTypes: string[]): string | undefined { + if (contentTypes.length === 0) { + return undefined; + } + + const type = contentTypes.find((x: string) => this.isJsonMime(x)); + if (type === undefined) { + return contentTypes[0]; + } + return type; + } + + /** + * Select the correct accept content-type to use for a request. + * Uses {@link Configuration#isJsonMime} to determine the correct accept content-type. + * If no content type is found return the first found type if the contentTypes is not empty + * @param accepts - the array of content types that are available for selection. + * @returns the selected content-type or undefined if no selection could be made. + */ + public selectHeaderAccept(accepts: string[]): string | undefined { + if (accepts.length === 0) { + return undefined; + } + + const type = accepts.find((x: string) => this.isJsonMime(x)); + if (type === undefined) { + return accepts[0]; + } + return type; + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * application/vnd.company+json + * @param mime - MIME (Multipurpose Internet Mail Extensions) + * @return True if the given MIME is JSON, false otherwise. + */ + public isJsonMime(mime: string): boolean { + const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); + return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); + } + + public lookupCredential(key: string): string | undefined { + const value = this.credentials[key]; + return typeof value === 'function' + ? value() + : value; + } +} diff --git a/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/encoder.ts b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/encoder.ts new file mode 100644 index 000000000000..138c4d5cf2c1 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/encoder.ts @@ -0,0 +1,20 @@ +import { HttpParameterCodec } from '@angular/common/http'; + +/** + * Custom HttpParameterCodec + * Workaround for https://github.com/angular/angular/issues/18261 + */ +export class CustomHttpParameterCodec implements HttpParameterCodec { + encodeKey(k: string): string { + return encodeURIComponent(k); + } + encodeValue(v: string): string { + return encodeURIComponent(v); + } + decodeKey(k: string): string { + return decodeURIComponent(k); + } + decodeValue(v: string): string { + return decodeURIComponent(v); + } +} diff --git a/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/git_push.sh b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/git_push.sh new file mode 100644 index 000000000000..ced3be2b0c7b --- /dev/null +++ b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/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/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/index.ts b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/index.ts new file mode 100644 index 000000000000..c312b70fa3ef --- /dev/null +++ b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/index.ts @@ -0,0 +1,5 @@ +export * from './api/api'; +export * from './model/models'; +export * from './variables'; +export * from './configuration'; +export * from './api.module'; \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/model/apiResponse.ts b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/model/apiResponse.ts new file mode 100644 index 000000000000..682ba478921e --- /dev/null +++ b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/model/apiResponse.ts @@ -0,0 +1,22 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +/** + * Describes the result of uploading an image resource + */ +export interface ApiResponse { + code?: number; + type?: string; + message?: string; +} + diff --git a/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/model/category.ts b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/model/category.ts new file mode 100644 index 000000000000..b988b6827a05 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/model/category.ts @@ -0,0 +1,21 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +/** + * A category for a pet + */ +export interface Category { + id?: number; + name?: string; +} + diff --git a/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/model/models.ts b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/model/models.ts new file mode 100644 index 000000000000..8607c5dabd0c --- /dev/null +++ b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/model/models.ts @@ -0,0 +1,6 @@ +export * from './apiResponse'; +export * from './category'; +export * from './order'; +export * from './pet'; +export * from './tag'; +export * from './user'; diff --git a/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/model/order.ts b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/model/order.ts new file mode 100644 index 000000000000..a29bebe49065 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/model/order.ts @@ -0,0 +1,37 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +/** + * An order for a pets from the pet store + */ +export interface Order { + id?: number; + petId?: number; + quantity?: number; + shipDate?: string; + /** + * Order Status + */ + status?: Order.StatusEnum; + complete?: boolean; +} +export namespace Order { + export type StatusEnum = 'placed' | 'approved' | 'delivered'; + export const StatusEnum = { + Placed: 'placed' as StatusEnum, + Approved: 'approved' as StatusEnum, + Delivered: 'delivered' as StatusEnum + }; +} + + diff --git a/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/model/pet.ts b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/model/pet.ts new file mode 100644 index 000000000000..e0404395f91c --- /dev/null +++ b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/model/pet.ts @@ -0,0 +1,39 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { Category } from './category'; +import { Tag } from './tag'; + + +/** + * A pet for sale in the pet store + */ +export interface Pet { + id?: number; + category?: Category; + name: string; + photoUrls: Array; + tags?: Array; + /** + * pet status in the store + */ + status?: Pet.StatusEnum; +} +export namespace Pet { + export type StatusEnum = 'available' | 'pending' | 'sold'; + export const StatusEnum = { + Available: 'available' as StatusEnum, + Pending: 'pending' as StatusEnum, + Sold: 'sold' as StatusEnum + }; +} + + diff --git a/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/model/tag.ts b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/model/tag.ts new file mode 100644 index 000000000000..b6ff210e8df4 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/model/tag.ts @@ -0,0 +1,21 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +/** + * A tag for a pet + */ +export interface Tag { + id?: number; + name?: string; +} + diff --git a/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/model/user.ts b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/model/user.ts new file mode 100644 index 000000000000..fce51005300c --- /dev/null +++ b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/model/user.ts @@ -0,0 +1,30 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +/** + * A User who is purchasing from the pet store + */ +export interface User { + id?: number; + username?: string; + firstName?: string; + lastName?: string; + email?: string; + password?: string; + phone?: string; + /** + * User Status + */ + userStatus?: number; +} + diff --git a/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/ng-package.json b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/ng-package.json new file mode 100644 index 000000000000..3b17900dc9c3 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/ng-package.json @@ -0,0 +1,6 @@ +{ + "$schema": "./node_modules/ng-packagr/ng-package.schema.json", + "lib": { + "entryFile": "index.ts" + } +} diff --git a/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/package.json b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/package.json new file mode 100644 index 000000000000..f8686e1665dc --- /dev/null +++ b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/package.json @@ -0,0 +1,34 @@ +{ + "name": "@openapitools/typescript-angular-petstore", + "version": "1.0.0", + "description": "OpenAPI client for @openapitools/typescript-angular-petstore", + "author": "OpenAPI-Generator Contributors", + "keywords": [ + "openapi-client", + "openapi-generator" + ], + "license": "Unlicense", + "scripts": { + "build": "ng-packagr -p ng-package.json" + }, + "peerDependencies": { + "@angular/core": "^9.0.0", + "rxjs": "^6.5.3" + }, + "devDependencies": { + "@angular/common": "^9.0.0", + "@angular/compiler": "^9.0.0", + "@angular/compiler-cli": "^9.0.0", + "@angular/core": "^9.0.0", + "@angular/platform-browser": "^9.0.0", + "ng-packagr": "^9.0.1", + "reflect-metadata": "^0.1.3", + "rxjs": "^6.5.3", + "tsickle": "^0.38.0", + "typescript": ">=3.6.0 <3.8.0", + "zone.js": "^0.10.2" + }, + "publishConfig": { + "registry": "https://skimdb.npmjs.com/registry" + } +} diff --git a/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/tsconfig.json b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/tsconfig.json new file mode 100644 index 000000000000..c01ebe255d4c --- /dev/null +++ b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/tsconfig.json @@ -0,0 +1,28 @@ +{ + "compilerOptions": { + "emitDecoratorMetadata": true, + "experimentalDecorators": true, + "noImplicitAny": false, + "suppressImplicitAnyIndexErrors": true, + "target": "es5", + "module": "commonjs", + "moduleResolution": "node", + "removeComments": true, + "sourceMap": true, + "outDir": "./dist", + "noLib": false, + "declaration": true, + "lib": [ "es6", "dom" ], + "typeRoots": [ + "node_modules/@types" + ] + }, + "exclude": [ + "node_modules", + "dist" + ], + "filesGlob": [ + "./model/*.ts", + "./api/*.ts" + ] +} diff --git a/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/variables.ts b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/variables.ts new file mode 100644 index 000000000000..6fe58549f395 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/variables.ts @@ -0,0 +1,9 @@ +import { InjectionToken } from '@angular/core'; + +export const BASE_PATH = new InjectionToken('basePath'); +export const COLLECTION_FORMATS = { + 'csv': ',', + 'tsv': ' ', + 'ssv': ' ', + 'pipes': '|' +} From 9592754e57b75c00cbdd6857d98e24439443e9cb Mon Sep 17 00:00:00 2001 From: TIm Clark Date: Sun, 26 Jul 2020 03:24:59 -0400 Subject: [PATCH 070/129] [Java][jersey2] Test HttpSignature verification (#7047) * [Java][jersey2] Test HttpSignature verification Tests that `HttpSignatureAuth` headers can be verified after signing. * Fix formatting --- .../openapitools/client/ApiClientTest.java | 37 ++++++++----------- 1 file changed, 16 insertions(+), 21 deletions(-) diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/ApiClientTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/ApiClientTest.java index b89affd9fd96..55d3103597c0 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/ApiClientTest.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/ApiClientTest.java @@ -17,6 +17,9 @@ import java.security.spec.MGF1ParameterSpec; import org.tomitribe.auth.signatures.*; import java.io.ByteArrayInputStream; +import java.security.KeyPair; +import java.security.KeyPairGenerator; +import java.security.NoSuchAlgorithmException; import java.security.PublicKey; import java.security.PrivateKey; @@ -25,27 +28,20 @@ public class ApiClientTest { ApiClient apiClient = null; Pet pet = null; - - private final String privateKeyPem = "-----BEGIN RSA PRIVATE KEY-----\n" + - "MIICXgIBAAKBgQDCFENGw33yGihy92pDjZQhl0C36rPJj+CvfSC8+q28hxA161QF\n" + - "NUd13wuCTUcq0Qd2qsBe/2hFyc2DCJJg0h1L78+6Z4UMR7EOcpfdUE9Hf3m/hs+F\n" + - "UR45uBJeDK1HSFHD8bHKD6kv8FPGfJTotc+2xjJwoYi+1hqp1fIekaxsyQIDAQAB\n" + - "AoGBAJR8ZkCUvx5kzv+utdl7T5MnordT1TvoXXJGXK7ZZ+UuvMNUCdN2QPc4sBiA\n" + - "QWvLw1cSKt5DsKZ8UETpYPy8pPYnnDEz2dDYiaew9+xEpubyeW2oH4Zx71wqBtOK\n" + - "kqwrXa/pzdpiucRRjk6vE6YY7EBBs/g7uanVpGibOVAEsqH1AkEA7DkjVH28WDUg\n" + - "f1nqvfn2Kj6CT7nIcE3jGJsZZ7zlZmBmHFDONMLUrXR/Zm3pR5m0tCmBqa5RK95u\n" + - "412jt1dPIwJBANJT3v8pnkth48bQo/fKel6uEYyboRtA5/uHuHkZ6FQF7OUkGogc\n" + - "mSJluOdc5t6hI1VsLn0QZEjQZMEOWr+wKSMCQQCC4kXJEsHAve77oP6HtG/IiEn7\n" + - "kpyUXRNvFsDE0czpJJBvL/aRFUJxuRK91jhjC68sA7NsKMGg5OXb5I5Jj36xAkEA\n" + - "gIT7aFOYBFwGgQAQkWNKLvySgKbAZRTeLBacpHMuQdl1DfdntvAyqpAZ0lY0RKmW\n" + - "G6aFKaqQfOXKCyWoUiVknQJAXrlgySFci/2ueKlIE1QqIiLSZ8V8OlpFLRnb1pzI\n" + - "7U1yQXnTAEFYM560yJlzUpOb1V4cScGd365tiSMvxLOvTA==\n" + - "-----END RSA PRIVATE KEY-----\n"; + PrivateKey privateKey = null; + PublicKey publicKey = null; @Before public void setup() { apiClient = new ApiClient(); pet = new Pet(); + try { + KeyPair keypair = KeyPairGenerator.getInstance("RSA").generateKeyPair(); + privateKey = keypair.getPrivate(); + publicKey = keypair.getPublic(); + } catch(NoSuchAlgorithmException e) { + fail("No such algorithm: " + e.toString()); + } } @Test @@ -63,17 +59,16 @@ public void testUpdateParamsForAuth() throws Exception { HttpSignatureAuth signatureAuth = new HttpSignatureAuth("some-key-1", SigningAlgorithm.HS2019, Algorithm.RSA_SHA512, null, null, Arrays.asList(new String[] { "(request-target)" }), 128L); - signatureAuth.setPrivateKey(PEM.readPrivateKey(new ByteArrayInputStream(privateKeyPem.getBytes()))); + signatureAuth.setPrivateKey(privateKey); authMap.put("http_signature_test", signatureAuth); ApiClient client = new ApiClient(authMap); client.updateParamsForAuth(authNames, queryParams, headerParams, null, null, "post", uri); - - // hard to test as expire will always be different - // ApiClientTest.testUpdateParamsForAuth:77 expected:<...-1",created=15954814[97,expires=1595481497.760],algorithm="hs2019",...> but was:<...-1",created=15954814[60,expires=1595481460.841],algorithm="hs2019",...> - //assertEquals(headerParams.get("Authorization"), "Signature keyId=\"some-key-1\",created=1595481460,expires=1595481460.841,algorithm=\"hs2019\",headers=\"(request-target)\",signature=\"eahPOLOTIH5AJyXbvpDyUIYBdYLAv6RbcAtGCEG9J1y6JyFWS+1IT/n/u4ZGMteiUvtoPm52dUXrhN3OMump+ivi+2JgMjHhd2G89zj7wcOVkZwaFfHjymHb8SwkVrda35GYsmXlnx01JRHCShk9yVHS7VYkY0CpQw171VaFWUc=\""); + Signature requestSignature = Signature.fromString(headerParams.get("Authorization"), Algorithm.RSA_SHA512); + Verifier verify = new Verifier(publicKey, requestSignature); + assert verify.verify("post", uri.toString(), headerParams); } @Test From dba14f5ac6a85e3074f2bf0c437836ed3bab9a86 Mon Sep 17 00:00:00 2001 From: QP Hou Date: Sun, 26 Jul 2020 00:36:19 -0700 Subject: [PATCH 071/129] [Go] support problem details HTTP API (#6793) Based on https://tools.ietf.org/html/draft-ietf-appsawg-http-problem-00, the content-type would be `application/problem+json` --- modules/openapi-generator/src/main/resources/go/client.mustache | 2 +- samples/client/petstore/go/go-petstore-withXml/client.go | 2 +- samples/client/petstore/go/go-petstore/client.go | 2 +- samples/openapi3/client/petstore/go/go-petstore/client.go | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/go/client.mustache b/modules/openapi-generator/src/main/resources/go/client.mustache index f760f3371133..8dcefae5f865 100644 --- a/modules/openapi-generator/src/main/resources/go/client.mustache +++ b/modules/openapi-generator/src/main/resources/go/client.mustache @@ -32,7 +32,7 @@ import ( ) var ( - jsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:vnd\.[^;]+\+)?json)`) + jsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:vnd\.[^;]+\+)?(?:problem\+)?json)`) xmlCheck = regexp.MustCompile(`(?i:(?:application|text)/xml)`) ) diff --git a/samples/client/petstore/go/go-petstore-withXml/client.go b/samples/client/petstore/go/go-petstore-withXml/client.go index 6fffa78f8ff9..00f4296fa6f0 100644 --- a/samples/client/petstore/go/go-petstore-withXml/client.go +++ b/samples/client/petstore/go/go-petstore-withXml/client.go @@ -37,7 +37,7 @@ import ( ) var ( - jsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:vnd\.[^;]+\+)?json)`) + jsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:vnd\.[^;]+\+)?(?:problem\+)?json)`) xmlCheck = regexp.MustCompile(`(?i:(?:application|text)/xml)`) ) diff --git a/samples/client/petstore/go/go-petstore/client.go b/samples/client/petstore/go/go-petstore/client.go index 19297c80fb8e..769e38acab3a 100644 --- a/samples/client/petstore/go/go-petstore/client.go +++ b/samples/client/petstore/go/go-petstore/client.go @@ -36,7 +36,7 @@ import ( ) var ( - jsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:vnd\.[^;]+\+)?json)`) + jsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:vnd\.[^;]+\+)?(?:problem\+)?json)`) xmlCheck = regexp.MustCompile(`(?i:(?:application|text)/xml)`) ) diff --git a/samples/openapi3/client/petstore/go/go-petstore/client.go b/samples/openapi3/client/petstore/go/go-petstore/client.go index c33a4967d824..838b6e9d0e0b 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/client.go +++ b/samples/openapi3/client/petstore/go/go-petstore/client.go @@ -36,7 +36,7 @@ import ( ) var ( - jsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:vnd\.[^;]+\+)?json)`) + jsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:vnd\.[^;]+\+)?(?:problem\+)?json)`) xmlCheck = regexp.MustCompile(`(?i:(?:application|text)/xml)`) ) From 9bfd9545cca9aa3b828a802b2d568d9ee42118dd Mon Sep 17 00:00:00 2001 From: Andrew Kehrig Date: Sun, 26 Jul 2020 05:10:06 -0400 Subject: [PATCH 072/129] Add empty checks using hasAuthMethods (#6983) * Add empty checks using hasAuthMethods * Add regenerated sample for kotlin multiplatform --- .../infrastructure/ApiClient.kt.mustache | 20 +++++++++++-------- .../client/infrastructure/ApiClient.kt | 15 +++++++------- 2 files changed, 19 insertions(+), 16 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/infrastructure/ApiClient.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/infrastructure/ApiClient.kt.mustache index 10aab1ba1b25..ae65921bb778 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/infrastructure/ApiClient.kt.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/infrastructure/ApiClient.kt.mustache @@ -46,7 +46,7 @@ import {{packageName}}.auth.* val clientConfig: (HttpClientConfig<*>) -> Unit = { it.install(JsonFeature, jsonConfig) } httpClientEngine?.let { HttpClient(it, clientConfig) } ?: HttpClient(clientConfig) } - + {{#hasAuthMethods}} private val authentications: kotlin.collections.Map by lazy { mapOf({{#authMethods}}{{#isBasic}}{{#isBasicBasic}} "{{name}}" to HttpBasicAuth(){{/isBasicBasic}}{{^isBasicBasic}} @@ -54,6 +54,10 @@ import {{packageName}}.auth.* "{{name}}" to ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{^isKeyInHeader}}"query"{{/isKeyInHeader}}, "{{keyParamName}}"){{/isApiKey}}{{#isOAuth}} "{{name}}" to OAuth(){{/isOAuth}}{{#hasMore}}, {{/hasMore}}{{/authMethods}}) } + {{/hasAuthMethods}} + {{^hasAuthMethods}} + private val authentications: kotlin.collections.Map? = null + {{/hasAuthMethods}} {{#nonPublicApi}}internal {{/nonPublicApi}}companion object { protected val UNSAFE_HEADERS = listOf(HttpHeaders.ContentType) @@ -74,7 +78,7 @@ import {{packageName}}.auth.* * @param username Username */ fun setUsername(username: String) { - val auth = authentications.values.firstOrNull { it is HttpBasicAuth } as HttpBasicAuth? + val auth = authentications?.values?.firstOrNull { it is HttpBasicAuth } as HttpBasicAuth? ?: throw Exception("No HTTP basic authentication configured") auth.username = username } @@ -85,7 +89,7 @@ import {{packageName}}.auth.* * @param password Password */ fun setPassword(password: String) { - val auth = authentications.values.firstOrNull { it is HttpBasicAuth } as HttpBasicAuth? + val auth = authentications?.values?.firstOrNull { it is HttpBasicAuth } as HttpBasicAuth? ?: throw Exception("No HTTP basic authentication configured") auth.password = password } @@ -97,7 +101,7 @@ import {{packageName}}.auth.* * @param paramName The name of the API key parameter, or null or set the first key. */ fun setApiKey(apiKey: String, paramName: String? = null) { - val auth = authentications.values.firstOrNull { it is ApiKeyAuth && (paramName == null || paramName == it.paramName)} as ApiKeyAuth? + val auth = authentications?.values?.firstOrNull { it is ApiKeyAuth && (paramName == null || paramName == it.paramName)} as ApiKeyAuth? ?: throw Exception("No API key authentication configured") auth.apiKey = apiKey } @@ -109,7 +113,7 @@ import {{packageName}}.auth.* * @param paramName The name of the API key parameter, or null or set the first key. */ fun setApiKeyPrefix(apiKeyPrefix: String, paramName: String? = null) { - val auth = authentications.values.firstOrNull { it is ApiKeyAuth && (paramName == null || paramName == it.paramName) } as ApiKeyAuth? + val auth = authentications?.values?.firstOrNull { it is ApiKeyAuth && (paramName == null || paramName == it.paramName) } as ApiKeyAuth? ?: throw Exception("No API key authentication configured") auth.apiKeyPrefix = apiKeyPrefix } @@ -120,7 +124,7 @@ import {{packageName}}.auth.* * @param accessToken Access token */ fun setAccessToken(accessToken: String) { - val auth = authentications.values.firstOrNull { it is OAuth } as OAuth? + val auth = authentications?.values?.firstOrNull { it is OAuth } as OAuth? ?: throw Exception("No OAuth2 authentication configured") auth.accessToken = accessToken } @@ -131,7 +135,7 @@ import {{packageName}}.auth.* * @param bearerToken The bearer token. */ fun setBearerToken(bearerToken: String) { - val auth = authentications.values.firstOrNull { it is HttpBearerAuth } as HttpBearerAuth? + val auth = authentications?.values?.firstOrNull { it is HttpBearerAuth } as HttpBearerAuth? ?: throw Exception("No Bearer authentication configured") auth.bearerToken = bearerToken } @@ -175,7 +179,7 @@ import {{packageName}}.auth.* private fun RequestConfig.updateForAuth(authNames: kotlin.collections.List) { for (authName in authNames) { - val auth = authentications[authName] ?: throw Exception("Authentication undefined: $authName") + val auth = authentications?.get(authName) ?: throw Exception("Authentication undefined: $authName") auth.apply(query, headers) } } diff --git a/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 2257d47739ce..fe8434be2100 100644 --- a/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -46,7 +46,6 @@ open class ApiClient( val clientConfig: (HttpClientConfig<*>) -> Unit = { it.install(JsonFeature, jsonConfig) } httpClientEngine?.let { HttpClient(it, clientConfig) } ?: HttpClient(clientConfig) } - private val authentications: kotlin.collections.Map by lazy { mapOf( "api_key" to ApiKeyAuth("header", "api_key"), @@ -79,7 +78,7 @@ open class ApiClient( * @param username Username */ fun setUsername(username: String) { - val auth = authentications.values.firstOrNull { it is HttpBasicAuth } as HttpBasicAuth? + val auth = authentications?.values?.firstOrNull { it is HttpBasicAuth } as HttpBasicAuth? ?: throw Exception("No HTTP basic authentication configured") auth.username = username } @@ -90,7 +89,7 @@ open class ApiClient( * @param password Password */ fun setPassword(password: String) { - val auth = authentications.values.firstOrNull { it is HttpBasicAuth } as HttpBasicAuth? + val auth = authentications?.values?.firstOrNull { it is HttpBasicAuth } as HttpBasicAuth? ?: throw Exception("No HTTP basic authentication configured") auth.password = password } @@ -102,7 +101,7 @@ open class ApiClient( * @param paramName The name of the API key parameter, or null or set the first key. */ fun setApiKey(apiKey: String, paramName: String? = null) { - val auth = authentications.values.firstOrNull { it is ApiKeyAuth && (paramName == null || paramName == it.paramName)} as ApiKeyAuth? + val auth = authentications?.values?.firstOrNull { it is ApiKeyAuth && (paramName == null || paramName == it.paramName)} as ApiKeyAuth? ?: throw Exception("No API key authentication configured") auth.apiKey = apiKey } @@ -114,7 +113,7 @@ open class ApiClient( * @param paramName The name of the API key parameter, or null or set the first key. */ fun setApiKeyPrefix(apiKeyPrefix: String, paramName: String? = null) { - val auth = authentications.values.firstOrNull { it is ApiKeyAuth && (paramName == null || paramName == it.paramName) } as ApiKeyAuth? + val auth = authentications?.values?.firstOrNull { it is ApiKeyAuth && (paramName == null || paramName == it.paramName) } as ApiKeyAuth? ?: throw Exception("No API key authentication configured") auth.apiKeyPrefix = apiKeyPrefix } @@ -125,7 +124,7 @@ open class ApiClient( * @param accessToken Access token */ fun setAccessToken(accessToken: String) { - val auth = authentications.values.firstOrNull { it is OAuth } as OAuth? + val auth = authentications?.values?.firstOrNull { it is OAuth } as OAuth? ?: throw Exception("No OAuth2 authentication configured") auth.accessToken = accessToken } @@ -136,7 +135,7 @@ open class ApiClient( * @param bearerToken The bearer token. */ fun setBearerToken(bearerToken: String) { - val auth = authentications.values.firstOrNull { it is HttpBearerAuth } as HttpBearerAuth? + val auth = authentications?.values?.firstOrNull { it is HttpBearerAuth } as HttpBearerAuth? ?: throw Exception("No Bearer authentication configured") auth.bearerToken = bearerToken } @@ -180,7 +179,7 @@ open class ApiClient( private fun RequestConfig.updateForAuth(authNames: kotlin.collections.List) { for (authName in authNames) { - val auth = authentications[authName] ?: throw Exception("Authentication undefined: $authName") + val auth = authentications?.get(authName) ?: throw Exception("Authentication undefined: $authName") auth.apply(query, headers) } } From 8d63f75966f307063428e48b811b6c102bcb4845 Mon Sep 17 00:00:00 2001 From: k0ral Date: Sun, 26 Jul 2020 11:25:35 +0200 Subject: [PATCH 073/129] [Protobuf] Make it possible to override field index using x-protobuf-index (#7002) --- .../codegen/languages/ProtobufSchemaCodegen.java | 10 ++++++---- .../src/main/resources/protobuf-schema/api.mustache | 2 +- .../src/main/resources/protobuf-schema/model.mustache | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ProtobufSchemaCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ProtobufSchemaCodegen.java index 6cefe264da5e..07bd07ae4253 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ProtobufSchemaCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ProtobufSchemaCodegen.java @@ -28,7 +28,6 @@ import org.openapitools.codegen.meta.features.DocumentationFeature; import org.openapitools.codegen.meta.features.SecurityFeature; import org.openapitools.codegen.meta.features.WireFormatFeature; -import org.openapitools.codegen.utils.ProcessUtils; import org.openapitools.codegen.utils.ModelUtils; import org.apache.commons.lang3.StringUtils; @@ -216,13 +215,12 @@ public String toOperationId(String operationId) { public Map postProcessModels(Map objs) { objs = postProcessModelsEnum(objs); List models = (List) objs.get("models"); - // add x-index to properties - ProcessUtils.addIndexToProperties(models, 1); for (Object _mo : models) { Map mo = (Map) _mo; CodegenModel cm = (CodegenModel) mo.get("model"); + int index = 1; for (CodegenProperty var : cm.vars) { // add x-protobuf-type: repeated if it's an array if (Boolean.TRUE.equals(var.isListContainer)) { @@ -247,6 +245,10 @@ public Map postProcessModels(Map objs) { enumIndex++; } } + + // Add x-protobuf-index, unless already specified + var.vendorExtensions.putIfAbsent("x-protobuf-index", index); + index++; } } return objs; @@ -422,7 +424,7 @@ public Map postProcessOperationsWithModels(Map o } } - p.vendorExtensions.put("x-index", index); + p.vendorExtensions.putIfAbsent("x-protobuf-index", index); index++; } diff --git a/modules/openapi-generator/src/main/resources/protobuf-schema/api.mustache b/modules/openapi-generator/src/main/resources/protobuf-schema/api.mustache index 3236d010ccd6..ccf06f93c6df 100644 --- a/modules/openapi-generator/src/main/resources/protobuf-schema/api.mustache +++ b/modules/openapi-generator/src/main/resources/protobuf-schema/api.mustache @@ -30,7 +30,7 @@ message {{operationId}}Request { {{#description}} // {{{.}}} {{/description}} - {{#vendorExtensions.x-protobuf-type}}{{.}} {{/vendorExtensions.x-protobuf-type}}{{vendorExtensions.x-protobuf-data-type}} {{paramName}} = {{vendorExtensions.x-index}}; + {{#vendorExtensions.x-protobuf-type}}{{.}} {{/vendorExtensions.x-protobuf-type}}{{vendorExtensions.x-protobuf-data-type}} {{paramName}} = {{vendorExtensions.x-protobuf-index}}; {{/allParams}} } diff --git a/modules/openapi-generator/src/main/resources/protobuf-schema/model.mustache b/modules/openapi-generator/src/main/resources/protobuf-schema/model.mustache index 5362485d3a55..069356b68032 100644 --- a/modules/openapi-generator/src/main/resources/protobuf-schema/model.mustache +++ b/modules/openapi-generator/src/main/resources/protobuf-schema/model.mustache @@ -18,7 +18,7 @@ message {{classname}} { // {{{.}}} {{/description}} {{^isEnum}} - {{#vendorExtensions.x-protobuf-type}}{{.}} {{/vendorExtensions.x-protobuf-type}}{{vendorExtensions.x-protobuf-data-type}} {{name}} = {{vendorExtensions.x-index}}{{#vendorExtensions.x-protobuf-packed}} [packed=true]{{/vendorExtensions.x-protobuf-packed}}; + {{#vendorExtensions.x-protobuf-type}}{{.}} {{/vendorExtensions.x-protobuf-type}}{{vendorExtensions.x-protobuf-data-type}} {{name}} = {{vendorExtensions.x-protobuf-index}}{{#vendorExtensions.x-protobuf-packed}} [packed=true]{{/vendorExtensions.x-protobuf-packed}}; {{/isEnum}} {{#isEnum}} enum {{name}} { From 08612d8e523105e8166912f7a0e20cc115854906 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Sun, 26 Jul 2020 23:14:28 +0800 Subject: [PATCH 074/129] fix string comparison in java pkmst generator (#7050) --- .../resources/java-pkmst/logging/httpLoggingFilter.mustache | 2 +- .../main/java/com/prokarma/pkmst/logging/HttpLoggingFilter.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/java-pkmst/logging/httpLoggingFilter.mustache b/modules/openapi-generator/src/main/resources/java-pkmst/logging/httpLoggingFilter.mustache index de21a130b463..28cd309952d6 100644 --- a/modules/openapi-generator/src/main/resources/java-pkmst/logging/httpLoggingFilter.mustache +++ b/modules/openapi-generator/src/main/resources/java-pkmst/logging/httpLoggingFilter.mustache @@ -70,7 +70,7 @@ public class HttpLoggingFilter implements Filter { chain.doFilter(bufferedRequest, bufferedResponse); long elapsedTime = System.currentTimeMillis() - start; String respContent = null; - if (bufferedResponse.getContent() == null || bufferedResponse.getContent() == "") { + if (bufferedResponse.getContent() == null || "".equals(bufferedResponse.getContent())) { respContent = "No data"; } else { respContent = bufferedResponse.getContent(); diff --git a/samples/server/petstore/java-pkmst/src/main/java/com/prokarma/pkmst/logging/HttpLoggingFilter.java b/samples/server/petstore/java-pkmst/src/main/java/com/prokarma/pkmst/logging/HttpLoggingFilter.java index d294d3cc258d..b3a9b8b5f897 100644 --- a/samples/server/petstore/java-pkmst/src/main/java/com/prokarma/pkmst/logging/HttpLoggingFilter.java +++ b/samples/server/petstore/java-pkmst/src/main/java/com/prokarma/pkmst/logging/HttpLoggingFilter.java @@ -70,7 +70,7 @@ public void doFilter(ServletRequest request, ServletResponse response,FilterChai chain.doFilter(bufferedRequest, bufferedResponse); long elapsedTime = System.currentTimeMillis() - start; String respContent = null; - if (bufferedResponse.getContent() == null || bufferedResponse.getContent() == "") { + if (bufferedResponse.getContent() == null || "".equals(bufferedResponse.getContent())) { respContent = "No data"; } else { respContent = bufferedResponse.getContent(); From 312082c168efe971d25829e5c334f5f7fd841201 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Mon, 27 Jul 2020 13:53:46 +0800 Subject: [PATCH 075/129] Add a link to Laracon EU presentation (#7055) * Add a link to Laracon EU presentation * add url --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 8461a0fdfbd6..caeb4c54e7bf 100644 --- a/README.md +++ b/README.md @@ -759,6 +759,7 @@ Here are some companies/projects (alphabetical order) using OpenAPI Generator in - 2020-05-19 - [Dead Simple APIs with Open API](https://www.youtube.com/watch?v=sIaXmR6xRAw) by [Chris Tankersley](https://github.com/dragonmantank) at [Nexmo](https://developer.nexmo.com/) - 2020-05-22 - [TypeScript REST API Client](https://dev.to/unhurried/typescript-rest-api-client-4in3) by ["unhurried"](https://dev.to/unhurried) - 2020-05-28 - [【使用 lotify + Swagger 建置可共用的 LINE Notify bot】 - #NiJia @ Chatbot Developer Taiwan 第 #19 小聚](https://www.youtube.com/watch?v=agYVz6dzh1I) by [Chatbot Developer Taiwan](https://www.youtube.com/channel/UCxeYUyZNnHmpX23YNF-ewvw) +- 2020-05-28 - [Building APIs with Laravel using OpenAPI](https://www.youtube.com/watch?v=xexLvQqAhiA) by [Chris Tankersley](https://github.com/dragonmantank) at [Laracon EU](https://laracon.eu/) - 2020-06-23 - [新規サーバーアプリケーションにTypeScriptを採用してみた](https://www.cam-inc.co.jp/news/20200623) at [CAM Tech Blog](https://www.cam-inc.co.jp/news/tech-blog/) - 2020-07-07 - [5 Best API Documentation Tools](https://blog.dreamfactory.com/5-best-api-documentation-tools/) by Susanna Bouse at [DreamFactory Blog](https://blog.dreamfactory.com/) - 2020-07-12 - [Open API 3.0の定義からgolangのサーバコードのスケルトンを作成する](https://qiita.com/professor/items/4cbd04ec084d13057bc2) by [@professor (Qiita Blog)](https://qiita.com/professor) From 39c4a123b3dbaeb4f377ef44763f1280faebc969 Mon Sep 17 00:00:00 2001 From: Moshe Elisha Date: Mon, 27 Jul 2020 17:54:00 +0300 Subject: [PATCH 076/129] #6715 - Use Resource interface instead of AbstractResource when useAbstractionForFiles=true. (#7051) --- .../Java/libraries/resttemplate/api.mustache | 4 ++-- .../Java/libraries/resttemplate/api_test.mustache | 2 +- .../codegen/java/JavaClientCodegenTest.java | 12 ++++++------ 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/api.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/api.mustache index 9c7a4fc703ca..c139c9b534ff 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/api.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/api.mustache @@ -73,7 +73,7 @@ public class {{classname}} { {{#isDeprecated}} @Deprecated {{/isDeprecated}} - public {{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#allParams}}{{#isFile}}{{#useAbstractionForFiles}}{{#collectionFormat}}java.util.Collection{{/collectionFormat}}{{^collectionFormat}}org.springframework.core.io.AbstractResource{{/collectionFormat}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{dataType}}}{{/useAbstractionForFiles}}{{/isFile}}{{^isFile}}{{{dataType}}}{{/isFile}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) throws RestClientException { + public {{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#allParams}}{{#isFile}}{{#useAbstractionForFiles}}{{#collectionFormat}}java.util.Collection{{/collectionFormat}}{{^collectionFormat}}org.springframework.core.io.Resource{{/collectionFormat}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{dataType}}}{{/useAbstractionForFiles}}{{/isFile}}{{^isFile}}{{{dataType}}}{{/isFile}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) throws RestClientException { {{#returnType}} return {{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}).getBody(); {{/returnType}} @@ -101,7 +101,7 @@ public class {{classname}} { {{#isDeprecated}} @Deprecated {{/isDeprecated}} - public ResponseEntity<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{#isFile}}{{#useAbstractionForFiles}}{{#collectionFormat}}java.util.Collection{{/collectionFormat}}{{^collectionFormat}}org.springframework.core.io.AbstractResource{{/collectionFormat}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{dataType}}}{{/useAbstractionForFiles}}{{/isFile}}{{^isFile}}{{{dataType}}}{{/isFile}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) throws RestClientException { + public ResponseEntity<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{#isFile}}{{#useAbstractionForFiles}}{{#collectionFormat}}java.util.Collection{{/collectionFormat}}{{^collectionFormat}}org.springframework.core.io.Resource{{/collectionFormat}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{dataType}}}{{/useAbstractionForFiles}}{{/isFile}}{{^isFile}}{{{dataType}}}{{/isFile}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) throws RestClientException { Object postBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}}; {{#allParams}}{{#required}} // verify the required parameter '{{paramName}}' is set diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/api_test.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/api_test.mustache index f69cf40ec3e1..a82e352f6fc8 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/api_test.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/api_test.mustache @@ -34,7 +34,7 @@ public class {{classname}}Test { @Test public void {{operationId}}Test() { {{#allParams}} - {{#isFile}}{{#useAbstractionForFiles}}{{#collectionFormat}}java.util.Collection{{/collectionFormat}}{{^collectionFormat}}org.springframework.core.io.AbstractResource{{/collectionFormat}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{dataType}}}{{/useAbstractionForFiles}}{{/isFile}}{{^isFile}}{{{dataType}}}{{/isFile}} {{paramName}} = null; + {{#isFile}}{{#useAbstractionForFiles}}{{#collectionFormat}}java.util.Collection{{/collectionFormat}}{{^collectionFormat}}org.springframework.core.io.Resource{{/collectionFormat}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{dataType}}}{{/useAbstractionForFiles}}{{/isFile}}{{^isFile}}{{{dataType}}}{{/isFile}} {{paramName}} = null; {{/allParams}} {{#returnType}}{{{returnType}}} response = {{/returnType}}api.{{operationId}}({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}); diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaClientCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaClientCodegenTest.java index 8c2d17792f5a..23d62fb8c556 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaClientCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaClientCodegenTest.java @@ -958,18 +958,18 @@ public void testRestTemplateWithUseAbstractionForFiles() throws IOException { 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)", + "multipartArray(java.util.Collection files)", + "multipartArrayWithHttpInfo(java.util.Collection files)", "formParams.put(\"files\", files.stream().collect(Collectors.toList()));", //mixed - "multipartMixed(org.springframework.core.io.AbstractResource file, MultipartMixedMarker marker)", - "multipartMixedWithHttpInfo(org.springframework.core.io.AbstractResource file, MultipartMixedMarker marker)", + "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.AbstractResource file)", - "multipartSingleWithHttpInfo(org.springframework.core.io.AbstractResource file)", + "multipartSingle(org.springframework.core.io.Resource file)", + "multipartSingleWithHttpInfo(org.springframework.core.io.Resource file)", "formParams.add(\"file\", file);" ); } From 2743242ef4363663e6aec6ba064e675ee8e3782f Mon Sep 17 00:00:00 2001 From: William Cheng Date: Mon, 27 Jul 2020 22:56:42 +0800 Subject: [PATCH 077/129] fix string comparison in fsharp test (#7052) --- .../codegen/fsharp/FSharpServerCodegenTest.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/fsharp/FSharpServerCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/fsharp/FSharpServerCodegenTest.java index 1f8357f3a4b2..585ec9188def 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/fsharp/FSharpServerCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/fsharp/FSharpServerCodegenTest.java @@ -66,9 +66,9 @@ public void testModelsAreSortedAccordingToDependencyOrder() throws Exception { Object[] keys = sorted.keySet().toArray(); - Assert.assertTrue(keys[0] == "wheel"); - Assert.assertTrue(keys[1] == "bike" || keys[1] == "car"); - Assert.assertTrue(keys[2] == "bike" || keys[2] == "car"); + Assert.assertTrue("wheel".equals(keys[0])); + Assert.assertTrue("bike".equals(keys[1]) || "car".equals(keys[1])); + Assert.assertTrue("bike".equals(keys[2]) || "car".equals(keys[2])); Assert.assertEquals(keys[3], "parent"); Assert.assertEquals(keys[4], "child"); From ee0686e13f58f1c7029f76bef5c87d547b68f7d5 Mon Sep 17 00:00:00 2001 From: Justin Black Date: Mon, 27 Jul 2020 18:35:41 -0700 Subject: [PATCH 078/129] Python-exp clean up model classnames (#7054) * Adds lazy_import, removes python-exp java class renaming code, partial removal of getPythonClassName call sites Fixes PythonClientExperimentalTest.java Python-exp smaples regeneration Revers makefile Reverst pom.xml Fixes model imports in models.__init__ Updates docstring, omits lazy import in additional properties if we dont need it Improves additional_properties_type assignment if None Removes getPythonClassName Fixes python-exp tests * Removes unused makefiles --- .../PythonClientExperimentalCodegen.java | 268 +++++------------- .../README_common.mustache | 2 +- .../__init__models.mustache | 2 +- .../python/python-experimental/model.mustache | 6 +- .../model_templates/classvars.mustache | 42 ++- .../model_templates/model_composed.mustache | 7 +- .../model_templates/model_normal.mustache | 2 +- .../model_templates/model_simple.mustache | 2 +- .../python-experimental/model_utils.mustache | 4 +- .../python/PythonClientExperimentalTest.java | 98 ++++--- .../petstore/python-experimental/README.md | 130 ++++----- .../docs/AdditionalPropertiesAnyType.md | 2 +- .../docs/AdditionalPropertiesArray.md | 2 +- .../docs/AdditionalPropertiesBoolean.md | 2 +- .../docs/AdditionalPropertiesClass.md | 2 +- .../docs/AdditionalPropertiesInteger.md | 2 +- .../docs/AdditionalPropertiesNumber.md | 2 +- .../docs/AdditionalPropertiesObject.md | 2 +- .../docs/AdditionalPropertiesString.md | 2 +- .../python-experimental/docs/Animal.md | 2 +- .../python-experimental/docs/AnimalFarm.md | 4 +- .../docs/AnotherFakeApi.md | 10 +- .../python-experimental/docs/ApiResponse.md | 2 +- .../docs/ArrayOfArrayOfNumberOnly.md | 2 +- .../docs/ArrayOfNumberOnly.md | 2 +- .../python-experimental/docs/ArrayTest.md | 4 +- .../docs/Capitalization.md | 2 +- .../petstore/python-experimental/docs/Cat.md | 2 +- .../python-experimental/docs/CatAllOf.md | 2 +- .../python-experimental/docs/Category.md | 2 +- .../python-experimental/docs/Child.md | 2 +- .../python-experimental/docs/ChildAllOf.md | 2 +- .../python-experimental/docs/ChildCat.md | 2 +- .../python-experimental/docs/ChildCatAllOf.md | 2 +- .../python-experimental/docs/ChildDog.md | 2 +- .../python-experimental/docs/ChildDogAllOf.md | 2 +- .../python-experimental/docs/ChildLizard.md | 2 +- .../docs/ChildLizardAllOf.md | 2 +- .../python-experimental/docs/ClassModel.md | 2 +- .../python-experimental/docs/Client.md | 2 +- .../petstore/python-experimental/docs/Dog.md | 2 +- .../python-experimental/docs/DogAllOf.md | 2 +- .../python-experimental/docs/EnumArrays.md | 2 +- .../python-experimental/docs/EnumClass.md | 2 +- .../python-experimental/docs/EnumTest.md | 4 +- .../python-experimental/docs/FakeApi.md | 68 ++--- .../docs/FakeClassnameTags123Api.md | 10 +- .../petstore/python-experimental/docs/File.md | 2 +- .../docs/FileSchemaTestClass.md | 6 +- .../python-experimental/docs/FormatTest.md | 2 +- .../python-experimental/docs/Grandparent.md | 2 +- .../docs/GrandparentAnimal.md | 2 +- .../docs/HasOnlyReadOnly.md | 2 +- .../petstore/python-experimental/docs/List.md | 2 +- .../python-experimental/docs/MapTest.md | 4 +- ...dPropertiesAndAdditionalPropertiesClass.md | 4 +- .../docs/Model200Response.md | 2 +- .../python-experimental/docs/ModelReturn.md | 2 +- .../petstore/python-experimental/docs/Name.md | 2 +- .../python-experimental/docs/NumberOnly.md | 2 +- .../docs/NumberWithValidations.md | 2 +- .../docs/ObjectModelWithRefProps.md | 4 +- .../python-experimental/docs/Order.md | 2 +- .../python-experimental/docs/Parent.md | 2 +- .../python-experimental/docs/ParentAllOf.md | 2 +- .../python-experimental/docs/ParentPet.md | 2 +- .../petstore/python-experimental/docs/Pet.md | 6 +- .../python-experimental/docs/PetApi.md | 42 +-- .../python-experimental/docs/Player.md | 2 +- .../python-experimental/docs/ReadOnlyFirst.md | 2 +- .../docs/SpecialModelName.md | 2 +- .../python-experimental/docs/StoreApi.md | 16 +- .../docs/StringBooleanMap.md | 2 +- .../python-experimental/docs/StringEnum.md | 2 +- .../petstore/python-experimental/docs/Tag.md | 2 +- .../docs/TypeHolderDefault.md | 2 +- .../docs/TypeHolderExample.md | 2 +- .../petstore/python-experimental/docs/User.md | 2 +- .../python-experimental/docs/UserApi.md | 30 +- .../python-experimental/docs/XmlItem.md | 2 +- .../petstore_api/api/another_fake_api.py | 10 +- .../petstore_api/api/fake_api.py | 68 ++--- .../api/fake_classname_tags_123_api.py | 10 +- .../petstore_api/api/pet_api.py | 32 +-- .../petstore_api/api/store_api.py | 14 +- .../petstore_api/api/user_api.py | 22 +- .../model/additional_properties_any_type.py | 15 +- .../model/additional_properties_array.py | 15 +- .../model/additional_properties_boolean.py | 15 +- .../model/additional_properties_class.py | 7 +- .../model/additional_properties_integer.py | 15 +- .../model/additional_properties_number.py | 15 +- .../model/additional_properties_object.py | 15 +- .../model/additional_properties_string.py | 15 +- .../petstore_api/model/animal.py | 28 +- .../petstore_api/model/animal_farm.py | 21 +- .../petstore_api/model/api_response.py | 7 +- .../model/array_of_array_of_number_only.py | 7 +- .../model/array_of_number_only.py | 7 +- .../petstore_api/model/array_test.py | 21 +- .../petstore_api/model/capitalization.py | 7 +- .../petstore_api/model/cat.py | 28 +- .../petstore_api/model/cat_all_of.py | 7 +- .../petstore_api/model/category.py | 7 +- .../petstore_api/model/child.py | 29 +- .../petstore_api/model/child_all_of.py | 7 +- .../petstore_api/model/child_cat.py | 28 +- .../petstore_api/model/child_cat_all_of.py | 7 +- .../petstore_api/model/child_dog.py | 28 +- .../petstore_api/model/child_dog_all_of.py | 7 +- .../petstore_api/model/child_lizard.py | 28 +- .../petstore_api/model/child_lizard_all_of.py | 7 +- .../petstore_api/model/class_model.py | 7 +- .../petstore_api/model/client.py | 7 +- .../petstore_api/model/dog.py | 28 +- .../petstore_api/model/dog_all_of.py | 7 +- .../petstore_api/model/enum_arrays.py | 7 +- .../petstore_api/model/enum_class.py | 7 +- .../petstore_api/model/enum_test.py | 21 +- .../petstore_api/model/file.py | 7 +- .../model/file_schema_test_class.py | 25 +- .../petstore_api/model/format_test.py | 7 +- .../petstore_api/model/grandparent.py | 7 +- .../petstore_api/model/grandparent_animal.py | 46 ++- .../petstore_api/model/has_only_read_only.py | 7 +- .../petstore_api/model/list.py | 7 +- .../petstore_api/model/map_test.py | 21 +- ...perties_and_additional_properties_class.py | 21 +- .../petstore_api/model/model200_response.py | 7 +- .../petstore_api/model/model_return.py | 7 +- .../petstore_api/model/name.py | 7 +- .../petstore_api/model/number_only.py | 7 +- .../model/number_with_validations.py | 7 +- .../model/object_model_with_ref_props.py | 21 +- .../petstore_api/model/order.py | 7 +- .../petstore_api/model/parent.py | 29 +- .../petstore_api/model/parent_all_of.py | 7 +- .../petstore_api/model/parent_pet.py | 47 ++- .../petstore_api/model/pet.py | 32 +-- .../petstore_api/model/player.py | 7 +- .../petstore_api/model/read_only_first.py | 7 +- .../petstore_api/model/special_model_name.py | 7 +- .../petstore_api/model/string_boolean_map.py | 15 +- .../petstore_api/model/string_enum.py | 7 +- .../petstore_api/model/tag.py | 7 +- .../petstore_api/model/type_holder_default.py | 7 +- .../petstore_api/model/type_holder_example.py | 7 +- .../petstore_api/model/user.py | 7 +- .../petstore_api/model/xml_item.py | 7 +- .../petstore_api/model_utils.py | 4 +- .../test_additional_properties_any_type.py | 1 + .../test/test_additional_properties_array.py | 1 + .../test_additional_properties_boolean.py | 1 + .../test/test_additional_properties_class.py | 1 + .../test_additional_properties_integer.py | 1 + .../test/test_additional_properties_number.py | 1 + .../test/test_additional_properties_object.py | 1 + .../test/test_additional_properties_string.py | 1 + .../python-experimental/test/test_animal.py | 1 + .../test/test_animal_farm.py | 1 + .../test/test_another_fake_api.py | 2 + .../test/test_api_response.py | 1 + .../test_array_of_array_of_number_only.py | 1 + .../test/test_array_of_number_only.py | 1 + .../test/test_array_test.py | 1 + .../test/test_capitalization.py | 1 + .../python-experimental/test/test_cat.py | 1 + .../test/test_cat_all_of.py | 1 + .../python-experimental/test/test_category.py | 1 + .../python-experimental/test/test_child.py | 1 + .../test/test_child_all_of.py | 1 + .../test/test_child_cat.py | 1 + .../test/test_child_cat_all_of.py | 1 + .../test/test_child_dog.py | 1 + .../test/test_child_dog_all_of.py | 1 + .../test/test_child_lizard.py | 1 + .../test/test_child_lizard_all_of.py | 1 + .../test/test_class_model.py | 1 + .../python-experimental/test/test_client.py | 1 + .../python-experimental/test/test_dog.py | 1 + .../test/test_dog_all_of.py | 1 + .../test/test_enum_arrays.py | 1 + .../test/test_enum_class.py | 1 + .../test/test_enum_test.py | 1 + .../python-experimental/test/test_fake_api.py | 8 +- .../test/test_fake_classname_tags_123_api.py | 2 + .../python-experimental/test/test_file.py | 1 + .../test/test_file_schema_test_class.py | 1 + .../test/test_format_test.py | 1 + .../test/test_grandparent.py | 1 + .../test/test_grandparent_animal.py | 1 + .../test/test_has_only_read_only.py | 1 + .../python-experimental/test/test_list.py | 1 + .../python-experimental/test/test_map_test.py | 1 + ...perties_and_additional_properties_class.py | 1 + .../test/test_model200_response.py | 1 + .../test/test_model_return.py | 1 + .../python-experimental/test/test_name.py | 1 + .../test/test_number_only.py | 1 + .../test/test_number_with_validations.py | 1 + .../test/test_object_model_with_ref_props.py | 5 +- .../python-experimental/test/test_order.py | 1 + .../python-experimental/test/test_parent.py | 1 + .../test/test_parent_all_of.py | 1 + .../test/test_parent_pet.py | 1 + .../python-experimental/test/test_pet.py | 1 + .../python-experimental/test/test_pet_api.py | 2 + .../python-experimental/test/test_player.py | 1 + .../test/test_read_only_first.py | 1 + .../test/test_special_model_name.py | 1 + .../test/test_store_api.py | 2 + .../test/test_string_boolean_map.py | 1 + .../test/test_string_enum.py | 1 + .../python-experimental/test/test_tag.py | 1 + .../test/test_type_holder_default.py | 1 + .../test/test_type_holder_example.py | 1 + .../python-experimental/test/test_user.py | 1 + .../python-experimental/test/test_user_api.py | 2 + .../python-experimental/test/test_xml_item.py | 1 + .../tests/test_api_exception.py | 1 + .../tests/test_deserialization.py | 7 +- .../python-experimental/tests/test_pet_api.py | 7 +- .../tests/test_serialization.py | 2 + .../x_auth_id_alias/model_utils.py | 4 +- .../dynamic_servers/model_utils.py | 4 +- .../petstore/python-experimental/README.md | 182 ++++++------ .../docs/AdditionalPropertiesClass.md | 2 +- .../AdditionalPropertiesWithArrayOfEnums.md | 4 +- .../python-experimental/docs/Address.md | 2 +- .../python-experimental/docs/Animal.md | 2 +- .../python-experimental/docs/AnimalFarm.md | 4 +- .../docs/AnotherFakeApi.md | 12 +- .../python-experimental/docs/ApiResponse.md | 2 +- .../python-experimental/docs/Apple.md | 2 +- .../python-experimental/docs/AppleReq.md | 2 +- .../docs/ArrayOfArrayOfNumberOnly.md | 2 +- .../python-experimental/docs/ArrayOfEnums.md | 4 +- .../docs/ArrayOfNumberOnly.md | 2 +- .../python-experimental/docs/ArrayTest.md | 4 +- .../python-experimental/docs/Banana.md | 2 +- .../python-experimental/docs/BananaReq.md | 2 +- .../python-experimental/docs/BasquePig.md | 2 +- .../docs/Capitalization.md | 2 +- .../petstore/python-experimental/docs/Cat.md | 2 +- .../python-experimental/docs/CatAllOf.md | 2 +- .../python-experimental/docs/Category.md | 2 +- .../python-experimental/docs/ChildCat.md | 2 +- .../python-experimental/docs/ChildCatAllOf.md | 2 +- .../python-experimental/docs/ClassModel.md | 2 +- .../python-experimental/docs/Client.md | 2 +- .../docs/ComplexQuadrilateral.md | 2 +- .../ComposedOneOfNumberWithValidations.md | 2 +- .../python-experimental/docs/DanishPig.md | 2 +- .../python-experimental/docs/DefaultApi.md | 6 +- .../petstore/python-experimental/docs/Dog.md | 2 +- .../python-experimental/docs/DogAllOf.md | 2 +- .../python-experimental/docs/Drawing.md | 12 +- .../python-experimental/docs/EnumArrays.md | 2 +- .../python-experimental/docs/EnumClass.md | 2 +- .../python-experimental/docs/EnumTest.md | 12 +- .../docs/EquilateralTriangle.md | 2 +- .../python-experimental/docs/FakeApi.md | 114 ++++---- .../docs/FakeClassnameTags123Api.md | 12 +- .../petstore/python-experimental/docs/File.md | 2 +- .../docs/FileSchemaTestClass.md | 6 +- .../petstore/python-experimental/docs/Foo.md | 2 +- .../python-experimental/docs/FormatTest.md | 2 +- .../python-experimental/docs/Fruit.md | 2 +- .../python-experimental/docs/FruitReq.md | 2 +- .../python-experimental/docs/GmFruit.md | 2 +- .../docs/GrandparentAnimal.md | 2 +- .../docs/HasOnlyReadOnly.md | 2 +- .../docs/HealthCheckResult.md | 2 +- .../python-experimental/docs/InlineObject.md | 2 +- .../python-experimental/docs/InlineObject1.md | 2 +- .../python-experimental/docs/InlineObject2.md | 2 +- .../python-experimental/docs/InlineObject3.md | 2 +- .../python-experimental/docs/InlineObject4.md | 2 +- .../python-experimental/docs/InlineObject5.md | 2 +- .../docs/InlineResponseDefault.md | 4 +- .../python-experimental/docs/IntegerEnum.md | 2 +- .../docs/IntegerEnumOneValue.md | 2 +- .../docs/IntegerEnumWithDefaultValue.md | 2 +- .../docs/IsoscelesTriangle.md | 2 +- .../petstore/python-experimental/docs/List.md | 2 +- .../python-experimental/docs/Mammal.md | 2 +- .../python-experimental/docs/MapTest.md | 4 +- ...dPropertiesAndAdditionalPropertiesClass.md | 4 +- .../docs/Model200Response.md | 2 +- .../python-experimental/docs/ModelReturn.md | 2 +- .../petstore/python-experimental/docs/Name.md | 2 +- .../python-experimental/docs/NullableClass.md | 2 +- .../python-experimental/docs/NullableShape.md | 2 +- .../python-experimental/docs/NumberOnly.md | 2 +- .../docs/NumberWithValidations.md | 2 +- .../docs/ObjectModelWithRefProps.md | 4 +- .../python-experimental/docs/Order.md | 2 +- .../python-experimental/docs/ParentPet.md | 2 +- .../petstore/python-experimental/docs/Pet.md | 6 +- .../python-experimental/docs/PetApi.md | 50 ++-- .../petstore/python-experimental/docs/Pig.md | 2 +- .../python-experimental/docs/Quadrilateral.md | 2 +- .../docs/QuadrilateralInterface.md | 2 +- .../python-experimental/docs/ReadOnlyFirst.md | 2 +- .../docs/ScaleneTriangle.md | 2 +- .../python-experimental/docs/Shape.md | 2 +- .../docs/ShapeInterface.md | 2 +- .../python-experimental/docs/ShapeOrNull.md | 2 +- .../docs/SimpleQuadrilateral.md | 2 +- .../docs/SpecialModelName.md | 2 +- .../python-experimental/docs/StoreApi.md | 18 +- .../docs/StringBooleanMap.md | 2 +- .../python-experimental/docs/StringEnum.md | 2 +- .../docs/StringEnumWithDefaultValue.md | 2 +- .../petstore/python-experimental/docs/Tag.md | 2 +- .../python-experimental/docs/Triangle.md | 2 +- .../docs/TriangleInterface.md | 2 +- .../petstore/python-experimental/docs/User.md | 2 +- .../python-experimental/docs/UserApi.md | 46 +-- .../python-experimental/docs/Whale.md | 2 +- .../python-experimental/docs/Zebra.md | 2 +- .../petstore_api/api/another_fake_api.py | 26 +- .../petstore_api/api/default_api.py | 6 +- .../petstore_api/api/fake_api.py | 164 +++++------ .../api/fake_classname_tags_123_api.py | 26 +- .../petstore_api/api/pet_api.py | 64 ++--- .../petstore_api/api/store_api.py | 30 +- .../petstore_api/api/user_api.py | 86 +++--- .../model/additional_properties_class.py | 7 +- ...ditional_properties_with_array_of_enums.py | 26 +- .../petstore_api/model/address.py | 15 +- .../petstore_api/model/animal.py | 28 +- .../petstore_api/model/animal_farm.py | 21 +- .../petstore_api/model/api_response.py | 7 +- .../petstore_api/model/apple.py | 7 +- .../petstore_api/model/apple_req.py | 7 +- .../model/array_of_array_of_number_only.py | 7 +- .../petstore_api/model/array_of_enums.py | 21 +- .../model/array_of_number_only.py | 7 +- .../petstore_api/model/array_test.py | 21 +- .../petstore_api/model/banana.py | 7 +- .../petstore_api/model/banana_req.py | 7 +- .../petstore_api/model/basque_pig.py | 7 +- .../petstore_api/model/capitalization.py | 7 +- .../petstore_api/model/cat.py | 46 +-- .../petstore_api/model/cat_all_of.py | 7 +- .../petstore_api/model/category.py | 7 +- .../petstore_api/model/child_cat.py | 37 +-- .../petstore_api/model/child_cat_all_of.py | 7 +- .../petstore_api/model/class_model.py | 7 +- .../petstore_api/model/client.py | 7 +- .../model/complex_quadrilateral.py | 38 +-- ...composed_one_of_number_with_validations.py | 38 +-- .../petstore_api/model/danish_pig.py | 7 +- .../petstore_api/model/dog.py | 37 +-- .../petstore_api/model/dog_all_of.py | 7 +- .../petstore_api/model/drawing.py | 63 ++-- .../petstore_api/model/enum_arrays.py | 7 +- .../petstore_api/model/enum_class.py | 7 +- .../petstore_api/model/enum_test.py | 65 ++--- .../model/equilateral_triangle.py | 38 +-- .../petstore_api/model/file.py | 7 +- .../model/file_schema_test_class.py | 25 +- .../petstore_api/model/foo.py | 7 +- .../petstore_api/model/format_test.py | 7 +- .../petstore_api/model/fruit.py | 29 +- .../petstore_api/model/fruit_req.py | 29 +- .../petstore_api/model/gm_fruit.py | 29 +- .../petstore_api/model/grandparent_animal.py | 28 +- .../petstore_api/model/has_only_read_only.py | 7 +- .../petstore_api/model/health_check_result.py | 7 +- .../petstore_api/model/inline_object.py | 7 +- .../petstore_api/model/inline_object1.py | 7 +- .../petstore_api/model/inline_object2.py | 7 +- .../petstore_api/model/inline_object3.py | 7 +- .../petstore_api/model/inline_object4.py | 7 +- .../petstore_api/model/inline_object5.py | 7 +- .../model/inline_response_default.py | 21 +- .../petstore_api/model/integer_enum.py | 7 +- .../model/integer_enum_one_value.py | 7 +- .../model/integer_enum_with_default_value.py | 7 +- .../petstore_api/model/isosceles_triangle.py | 29 +- .../petstore_api/model/list.py | 7 +- .../petstore_api/model/mammal.py | 53 ++-- .../petstore_api/model/map_test.py | 21 +- ...perties_and_additional_properties_class.py | 21 +- .../petstore_api/model/model200_response.py | 7 +- .../petstore_api/model/model_return.py | 7 +- .../petstore_api/model/name.py | 7 +- .../petstore_api/model/nullable_class.py | 15 +- .../petstore_api/model/nullable_shape.py | 42 +-- .../petstore_api/model/number_only.py | 7 +- .../model/number_with_validations.py | 7 +- .../model/object_model_with_ref_props.py | 21 +- .../petstore_api/model/order.py | 7 +- .../petstore_api/model/parent_pet.py | 38 +-- .../petstore_api/model/pet.py | 32 +-- .../petstore_api/model/pig.py | 42 +-- .../petstore_api/model/quadrilateral.py | 42 +-- .../model/quadrilateral_interface.py | 7 +- .../petstore_api/model/read_only_first.py | 7 +- .../petstore_api/model/scalene_triangle.py | 38 +-- .../petstore_api/model/shape.py | 42 +-- .../petstore_api/model/shape_interface.py | 7 +- .../petstore_api/model/shape_or_null.py | 42 +-- .../model/simple_quadrilateral.py | 38 +-- .../petstore_api/model/special_model_name.py | 7 +- .../petstore_api/model/string_boolean_map.py | 15 +- .../petstore_api/model/string_enum.py | 7 +- .../model/string_enum_with_default_value.py | 7 +- .../petstore_api/model/tag.py | 7 +- .../petstore_api/model/triangle.py | 53 ++-- .../petstore_api/model/triangle_interface.py | 7 +- .../petstore_api/model/user.py | 7 +- .../petstore_api/model/whale.py | 7 +- .../petstore_api/model/zebra.py | 15 +- .../petstore_api/model_utils.py | 4 +- .../python-experimental/test/test_fake_api.py | 8 +- .../test/test_object_model_with_ref_props.py | 4 +- 419 files changed, 2490 insertions(+), 2228 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientExperimentalCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientExperimentalCodegen.java index bf9789740337..ba74896a1eda 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientExperimentalCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientExperimentalCodegen.java @@ -329,134 +329,72 @@ public String toDefaultValue(Schema p) { @Override public String toModelImport(String name) { - // name looks like cat.Cat - String moduleName = name.split("\\.")[0]; - // https://exceptionshub.com/circular-or-cyclic-imports-in-python.html - return "from " + modelPackage() + " import "+ moduleName; - } - - private String robustImport(String name) { - // name looks like cat.Cat - String moduleName = name.split("\\.")[0]; - // https://exceptionshub.com/circular-or-cyclic-imports-in-python.html - String modelImport = "try:\n from " + modelPackage() + - " import " + moduleName+ "\nexcept ImportError:\n " + - moduleName + " = sys.modules[\n '" + modelPackage() + "." + moduleName + "']"; - return modelImport; - } - - private String getPythonClassName(String name) { - // name looks like cat.Cat or Cat - String[] pieces = name.split("\\."); - if (pieces.length == 1) { - return pieces[0]; - } - return pieces[1]; - } - - private void fixOperationImports(Set imports) { - if (imports.size() == 0) { - return; - } - String[] modelNames = imports.toArray(new String[0]); - imports.clear(); - // loops through imports and converts them all from 'module.Class' to 'from models.module import module' - for (String modelName : modelNames) { - // if a modelName lacks the module (Pet) then we convert it to pet.Pet - if (modelName.indexOf(".") == -1) { - modelName = toModelName(modelName); - } - imports.add(toModelImport(modelName)); - } + // name looks like Cat + return "from " + modelPackage() + "." + toModelFilename(name) + " import "+ name; } @Override @SuppressWarnings("static-method") public Map postProcessOperationsWithModels(Map 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' + HashMap val = (HashMap)objs.get("operations"); ArrayList operations = (ArrayList) val.get("operation"); ArrayList> imports = (ArrayList>)objs.get("imports"); - imports.clear(); for (CodegenOperation operation : operations) { - fixOperationImports(operation.imports); - for (String thisImport : operation.imports) { - HashMap higherImport = new HashMap(); - higherImport.put("import", thisImport); - if (!imports.contains(higherImport)) { - imports.add(higherImport); - } + 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)); } } return objs; } - private void fixModelImports(Set imports) { - // loops through imports and converts them all from 'module.Class' to 'import models.module as module' - if (imports.size() == 0) { - return; - } - String[] modelNames = imports.toArray(new String[0]); - imports.clear(); - for (String modelName : modelNames) { - imports.add(robustImport(modelName)); - } - } - /** * Override with special post-processing for all models. */ @SuppressWarnings({"static-method", "unchecked"}) public Map postProcessAllModels(Map objs) { + super.postProcessAllModels(objs); + // loop through all models and delete ones where type!=object and the model has no validations and enums // we will remove them because they are not needed Map modelSchemasToRemove = new HashMap(); - for (Map.Entry entry : objs.entrySet()) { - Map inner = (Map) entry.getValue(); - List> models = (List>) inner.get("models"); - for (Map mo : models) { - CodegenModel cm = (CodegenModel) mo.get("model"); - - // make sure discriminator models are included in imports - CodegenDiscriminator discriminator = cm.discriminator; - if (discriminator != null) { - Set mappedModels = discriminator.getMappedModels(); - for (CodegenDiscriminator.MappedModel mappedModel : mappedModels) { - String otherModelName = mappedModel.getModelName(); - cm.imports.add(otherModelName); - } - } - - // add imports for anyOf, allOf, oneOf - ArrayList> composedSchemaSets = new ArrayList>(); - composedSchemaSets.add(cm.allOf); - composedSchemaSets.add(cm.anyOf); - composedSchemaSets.add(cm.oneOf); - for (Set importSet : composedSchemaSets) { - for (String otherModelName : importSet) { - if (!languageSpecificPrimitives.contains(otherModelName)) { - cm.imports.add(otherModelName); - } - } - } - - Schema modelSchema = ModelUtils.getSchema(this.openAPI, cm.name); - CodegenProperty modelProperty = fromProperty("value", modelSchema); - // import complex type from additional properties - // TODO can I remove this? DOes it exist in defaultcodegen? - if (cm.additionalPropertiesType != null && modelProperty.items != null && modelProperty.items.complexType != null) { - cm.imports.add(modelProperty.items.complexType); - } - - // fix the imports that each model has, change them to absolute - fixModelImports(cm.imports); + for (Object objModel: objs.values()) { + HashMap hmModel = (HashMap) objModel; + List> models = (List>) hmModel.get("models"); + for (Map model : models) { + CodegenModel cm = (CodegenModel) model.get("model"); + // remove model if it is a primitive with no validations if (cm.isEnum || cm.isAlias) { + Schema modelSchema = ModelUtils.getSchema(this.openAPI, cm.name); + CodegenProperty modelProperty = fromProperty("_value", modelSchema); if (!modelProperty.isEnum && !modelProperty.hasValidation && !cm.isArrayModel) { // remove these models because they are aliases and do not have any enums or validations modelSchemasToRemove.put(cm.name, modelSchema); + continue; } } + + // fix model imports + if (cm.imports.size() == 0) { + continue; + } + String[] modelNames = cm.imports.toArray(new String[0]); + cm.imports.clear(); + for (String modelName : modelNames) { + cm.imports.add(toModelImport(modelName)); + String globalImportFixer = "globals()['" + modelName + "'] = " + modelName; + cm.imports.add(globalImportFixer); + } } } @@ -550,9 +488,7 @@ public CodegenParameter fromRequestBody(RequestBody body, Set imports, S if (modelProp.isPrimitiveType && (modelProp.hasValidation || modelProp.isEnum)) { String simpleDataType = result.dataType; result.dataType = toModelName(modelName); - result.baseType = getPythonClassName(result.dataType); - imports.remove(modelName); - imports.add(result.dataType); + result.baseType = result.dataType; // set the example value if (modelProp.isEnum) { String value = modelProp._enum.get(0).toString(); @@ -560,9 +496,6 @@ public CodegenParameter fromRequestBody(RequestBody body, Set imports, S } else { result.example = result.dataType + "(" + result.example + ")"; } - } else if (!result.isPrimitiveType) { - // fix the baseType for the api docs so the .md link to the class's documentation file is correct - result.baseType = getPythonClassName(result.baseType); } return result; } @@ -591,7 +524,7 @@ public CodegenResponse fromResponse(String responseCode, ApiResponse response) { if (responseSchema != null) { CodegenProperty cp = fromProperty("response", responseSchema); if (cp.complexType != null) { - String modelName = getPythonClassName(cp.complexType); + String modelName = cp.complexType; Schema modelSchema = ModelUtils.getSchema(this.openAPI, modelName); if (modelSchema != null && !"object".equals(modelSchema.getType())) { CodegenProperty modelProp = fromProperty("response", modelSchema); @@ -604,19 +537,16 @@ public CodegenResponse fromResponse(String responseCode, ApiResponse response) { if (cp.isEnum == true || cp.hasValidation == true) { // this model has validations and/or enums so we will generate it Schema sc = ModelUtils.getSchemaFromResponse(response); - newBaseType = ModelUtils.getSimpleRef(sc.get$ref()); + newBaseType = toModelName(ModelUtils.getSimpleRef(sc.get$ref())); } } } CodegenResponse result = super.fromResponse(responseCode, response); if (newBaseType != null) { - result.dataType = toModelName(newBaseType); + result.dataType = newBaseType; // baseType is used to set the link to the model .md documentation - result.baseType = getPythonClassName(newBaseType); - } else if (!result.primitiveType) { - // fix the baseType for the api docs so the .md link to the class's documentation file is correct - result.baseType = getPythonClassName(result.baseType); + result.baseType = newBaseType; } return result; @@ -734,28 +664,18 @@ public String toEnumValue(String value, String datatype) { public void postProcessModelProperty(CodegenModel model, CodegenProperty p) { postProcessPattern(p.pattern, p.vendorExtensions); // set property.complexType so the model docs will link to the ClassName.md - if (p.complexType != null && !languageSpecificPrimitives.contains(p.complexType)) { - p.complexType = getPythonClassName(p.complexType); - } else if (p.isListContainer && p.mostInnerItems.complexType != null && !languageSpecificPrimitives.contains(p.mostInnerItems.complexType)) { + if (p.complexType == null && p.isListContainer && p.mostInnerItems.complexType != null && !languageSpecificPrimitives.contains(p.mostInnerItems.complexType)) { // fix ListContainers - p.complexType = getPythonClassName(p.mostInnerItems.complexType); - } - // if a model has a property that is of type self, remove the module name from the dataType - if (p.complexType != null && p.dataType.contains(model.classname)) { - String classNameNoModule = getPythonClassName(model.classname); - p.dataType = p.dataType.replace(model.classname, classNameNoModule); + p.complexType = p.mostInnerItems.complexType; } } @Override public void postProcessParameter(CodegenParameter p) { postProcessPattern(p.pattern, p.vendorExtensions); - // set baseType to null so the api docs will not point to a model for languageSpecificPrimitives 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; - } else if (p.isListContainer && p.mostInnerItems.complexType != null && !languageSpecificPrimitives.contains(p.mostInnerItems.complexType)) { - // fix ListContainers - p.baseType = getPythonClassName(p.mostInnerItems.complexType); } } @@ -810,6 +730,18 @@ private void addNullDefaultToOneOfAnyOfReqProps(Schema schema, CodegenModel resu } } + /** + * 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); + } + /** * Convert OAS Model object to Codegen Model object * @@ -906,22 +838,11 @@ public CodegenModel fromModel(String name, Schema schema) { } } - // use this to store the model name like Cat - // we can't use result.name because that is used to lookup models in the spec - // we can't use result.classname because that stores cat.Cat - // we can't use result.classVarName because that stores the variable for making example instances - result.unescapedDescription = simpleModelName(name); - // this block handles models which have the python base class ModelSimple // which are responsible for storing validations, enums, and an unnamed value Schema modelSchema = ModelUtils.getSchema(this.openAPI, result.name); CodegenProperty modelProperty = fromProperty("_value", modelSchema); - // import complex type from additional properties - if (result.additionalPropertiesType != null && modelProperty.items != null && modelProperty.items.complexType != null) { - result.imports.add(modelProperty.items.complexType); - } - Boolean isPythonModelSimpleModel = (result.isEnum || result.isArrayModel || result.isAlias && modelProperty.hasValidation); if (isPythonModelSimpleModel) { // In python, classes which inherit from our ModelSimple class store one value, @@ -941,12 +862,6 @@ public CodegenModel fromModel(String name, Schema schema) { result.defaultValue = modelProperty.defaultValue; } } else { - if (result.isArrayModel && modelProperty.dataType != null && result.dataType == null) { - // needed for array models with complex types - result.dataType = modelProperty.dataType; - result.arrayModelType = getPythonClassName(result.arrayModelType); - } - if (result.defaultValue == null) { result.hasRequired = true; } @@ -973,7 +888,7 @@ public CodegenModel fromModel(String name, Schema schema) { } cp.isPrimitiveType = false; String modelName = propertyToModelName.get(cp.name); - cp.complexType = getPythonClassName(modelName); + cp.complexType = modelName; cp.dataType = modelName; cp.isEnum = false; cp.hasValidation = false; @@ -1061,6 +976,18 @@ public String getSimpleTypeDeclaration(Schema schema) { return oasType; } + public Boolean modelWillBeMade(Schema s) { + // only invoke this on $refed schemas + if (ModelUtils.isComposedSchema(s) || ModelUtils.isArraySchema(s) || ModelUtils.isObjectSchema(s)) { + return true; + } + CodegenProperty cp = fromProperty("_model", s); + if (cp.isEnum || cp.hasValidation) { + return true; + } + return false; + } + /** * 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 @@ -1091,12 +1018,12 @@ private String getTypeString(Schema p, String prefix, String suffix, List ModelReturn (after camelize) - } - - // model name starts with number - if (modelName.matches("^\\d.*")) { - LOGGER.warn(modelName + " (model name starts with number) cannot be used as model name. Renamed to " + camelize("model_" + modelName)); - modelName = "model_" + modelName; // e.g. 200Response => Model200Response (after camelize) - } - - if (!StringUtils.isEmpty(modelNamePrefix)) { - modelName = modelNamePrefix + "_" + modelName; - } - - if (!StringUtils.isEmpty(modelNameSuffix)) { - modelName = modelName + "_" + modelNameSuffix; - } - - // camelize the model name - // phone_number => PhoneNumber - return camelize(modelName); - } - - - @Override - public String toModelFilename(String name) { - // underscore the model file name - // PhoneNumber => phone_number - return underscore(dropDots(simpleModelName(name))); - } - - @Override - public String toModelName(String name) { - // we have a custom version of this function so we can support circular references in python 2 and 3 - return toModelFilename(name)+"."+simpleModelName(name); - } - - @Override - public String toModelDocFilename(String name) { - // this is used to generate the model's .md documentation file - return simpleModelName(name); - } } diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/README_common.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/README_common.mustache index b996e676d115..d3844fd15fac 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/README_common.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/README_common.mustache @@ -47,7 +47,7 @@ Class | Method | HTTP request | Description ## Documentation For Models -{{#models}}{{#model}} - [{{{classname}}}]({{modelDocPath}}{{{unescapedDescription}}}.md) +{{#models}}{{#model}} - [{{{classname}}}]({{modelDocPath}}{{{classname}}}.md) {{/model}}{{/models}} ## Documentation For Authorization diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/__init__models.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/__init__models.mustache index abe69dc03504..5a2f25f87548 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/__init__models.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/__init__models.mustache @@ -13,6 +13,6 @@ {{#models}} {{#model}} -from {{modelPackage}}.{{classFilename}} import {{unescapedDescription}} +from {{modelPackage}}.{{classFilename}} import {{classname}} {{/model}} {{/models}} diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/model.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/model.mustache index ad7d5ddb31b9..1a181b824d1e 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/model.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/model.mustache @@ -24,7 +24,11 @@ from {{packageName}}.model_utils import ( # noqa: F401 {{#models}} {{#model}} {{#imports}} -{{{.}}} +{{#-first}} + +def lazy_import(): +{{/-first}} + {{{.}}} {{/imports}} diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/classvars.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/classvars.mustache index 5186e6621fb3..ed121c5bfe8a 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/classvars.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/classvars.mustache @@ -64,20 +64,41 @@ {{/optionalVars}} } - additional_properties_type = {{#additionalPropertiesType}}({{{additionalPropertiesType}}},) # noqa: E501{{/additionalPropertiesType}}{{^additionalPropertiesType}}None{{/additionalPropertiesType}} +{{#additionalPropertiesType}} + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ +{{#imports}} +{{#-first}} + lazy_import() +{{/-first}} +{{/imports}} + return ({{{additionalPropertiesType}}},) # noqa: E501 +{{/additionalPropertiesType}} +{{^additionalPropertiesType}} + additional_properties_type = None +{{/additionalPropertiesType}} _nullable = {{#isNullable}}True{{/isNullable}}{{^isNullable}}False{{/isNullable}} @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name and the value is attribute type. """ +{{#imports}} +{{#-first}} + lazy_import() +{{/-first}} +{{/imports}} return { {{#isAlias}} 'value': ({{{dataType}}},), @@ -98,7 +119,20 @@ @cached_property def discriminator(): - {{^discriminator}}return None{{/discriminator}}{{#discriminator}}val = { +{{^discriminator}} + return None +{{/discriminator}} +{{#discriminator}} +{{#mappedModels}} +{{#-first}} +{{#imports}} +{{#-first}} + lazy_import() +{{/-first}} +{{/imports}} +{{/-first}} +{{/mappedModels}} + val = { {{#mappedModels}} '{{mappingName}}': {{{modelName}}}, {{/mappedModels}} diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/model_composed.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/model_composed.mustache index 7e9e86cbfc29..dd61b23c793c 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/model_composed.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/model_composed.mustache @@ -1,4 +1,4 @@ -class {{unescapedDescription}}(ModelComposed): +class {{classname}}(ModelComposed): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech @@ -35,6 +35,11 @@ class {{unescapedDescription}}(ModelComposed): # code would be run when this module is imported, and these composed # classes don't exist yet because their module has not finished # loading +{{#imports}} +{{#-first}} + lazy_import() +{{/-first}} +{{/imports}} return { 'anyOf': [ {{#anyOf}} diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/model_normal.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/model_normal.mustache index 21254c55d17f..af130c66a749 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/model_normal.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/model_normal.mustache @@ -1,4 +1,4 @@ -class {{unescapedDescription}}(ModelNormal): +class {{classname}}(ModelNormal): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/model_simple.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/model_simple.mustache index 1623ca5f6e06..0b7d1860ddfd 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/model_simple.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/model_simple.mustache @@ -1,4 +1,4 @@ -class {{unescapedDescription}}(ModelSimple): +class {{classname}}(ModelSimple): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/model_utils.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/model_utils.mustache index ab30c2dcb0f3..400cfe3509d5 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/model_utils.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/model_utils.mustache @@ -33,9 +33,9 @@ class cached_property(object): self._fn = fn def __get__(self, instance, cls=None): - try: + if self.result_key in vars(self): return vars(self)[self.result_key] - except KeyError: + else: result = self._fn() setattr(self, self.result_key, result) return result diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonClientExperimentalTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonClientExperimentalTest.java index c627add94243..6b04f30cb6e3 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonClientExperimentalTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonClientExperimentalTest.java @@ -40,19 +40,19 @@ public void modelTest() { codegen.setOpenAPI(openAPI); final CodegenModel simpleName = codegen.fromModel("v1beta3.Binding", openAPI.getComponents().getSchemas().get("v1beta3.Binding")); Assert.assertEquals(simpleName.name, "v1beta3.Binding"); - Assert.assertEquals(simpleName.classname, "v1beta3_binding.V1beta3Binding"); + Assert.assertEquals(simpleName.classname, "V1beta3Binding"); Assert.assertEquals(simpleName.classVarName, "v1beta3_binding"); codegen.setOpenAPI(openAPI); final CodegenModel compoundName = codegen.fromModel("v1beta3.ComponentStatus", openAPI.getComponents().getSchemas().get("v1beta3.ComponentStatus")); Assert.assertEquals(compoundName.name, "v1beta3.ComponentStatus"); - Assert.assertEquals(compoundName.classname, "v1beta3_component_status.V1beta3ComponentStatus"); + Assert.assertEquals(compoundName.classname, "V1beta3ComponentStatus"); Assert.assertEquals(compoundName.classVarName, "v1beta3_component_status"); final String path = "/api/v1beta3/namespaces/{namespaces}/bindings"; final Operation operation = openAPI.getPaths().get(path).getPost(); final CodegenOperation codegenOperation = codegen.fromOperation(path, "get", operation, null); - Assert.assertEquals(codegenOperation.returnType, "v1beta3_binding.V1beta3Binding"); + Assert.assertEquals(codegenOperation.returnType, "V1beta3Binding"); Assert.assertEquals(codegenOperation.returnBaseType, "V1beta3Binding"); } @@ -71,7 +71,7 @@ public void simpleModelTest() { final CodegenModel cm = codegen.fromModel("sample", schema); Assert.assertEquals(cm.name, "sample"); - Assert.assertEquals(cm.classname, "sample.Sample"); + Assert.assertEquals(cm.classname, "Sample"); Assert.assertEquals(cm.description, "a sample model"); Assert.assertEquals(cm.vars.size(), 3); @@ -119,7 +119,7 @@ public void listPropertyTest() { final CodegenModel cm = codegen.fromModel("sample", model); Assert.assertEquals(cm.name, "sample"); - Assert.assertEquals(cm.classname, "sample.Sample"); + Assert.assertEquals(cm.classname, "Sample"); Assert.assertEquals(cm.description, "a sample model"); Assert.assertEquals(cm.vars.size(), 2); @@ -159,7 +159,7 @@ public void mapPropertyTest() { final CodegenModel cm = codegen.fromModel("sample", model); Assert.assertEquals(cm.name, "sample"); - Assert.assertEquals(cm.classname, "sample.Sample"); + Assert.assertEquals(cm.classname, "Sample"); Assert.assertEquals(cm.description, "a sample model"); Assert.assertEquals(cm.vars.size(), 1); @@ -176,48 +176,60 @@ public void mapPropertyTest() { @Test(description = "convert a model with complex property") public void complexPropertyTest() { + final DefaultCodegen codegen = new PythonClientExperimentalCodegen(); + OpenAPI openAPI = TestUtils.createOpenAPI(); final Schema model = new Schema() .description("a sample model") - .addProperties("children", new Schema().$ref("#/definitions/Children")); - final DefaultCodegen codegen = new PythonClientExperimentalCodegen(); - OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", model); + .addProperties("children", new Schema().$ref("#/components/schemas/Children")); + final Schema children = new Schema() + .type("object") + .addProperties("number", new Schema().type("integer")); + openAPI.getComponents().addSchemas("sample", model); + openAPI.getComponents().addSchemas("Children", children); codegen.setOpenAPI(openAPI); + final CodegenModel cm = codegen.fromModel("sample", model); Assert.assertEquals(cm.name, "sample"); - Assert.assertEquals(cm.classname, "sample.Sample"); + Assert.assertEquals(cm.classname, "Sample"); Assert.assertEquals(cm.description, "a sample model"); Assert.assertEquals(cm.vars.size(), 1); final CodegenProperty property1 = cm.vars.get(0); Assert.assertEquals(property1.baseName, "children"); - Assert.assertEquals(property1.dataType, "children.Children"); + Assert.assertEquals(property1.dataType, "Children"); Assert.assertEquals(property1.name, "children"); - Assert.assertEquals(property1.baseType, "children.Children"); + Assert.assertEquals(property1.baseType, "Children"); Assert.assertFalse(property1.required); Assert.assertFalse(property1.isContainer); } @Test(description = "convert a model with complex list property") public void complexListPropertyTest() { + final DefaultCodegen codegen = new PythonClientExperimentalCodegen(); + OpenAPI openAPI = TestUtils.createOpenAPI(); final Schema model = new Schema() .description("a sample model") .addProperties("children", new ArraySchema() - .items(new Schema().$ref("#/definitions/Children"))); - final DefaultCodegen codegen = new PythonClientExperimentalCodegen(); - OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", model); + .items(new Schema().$ref("#/components/schemas/Children"))); + final Schema children = new Schema() + .type("object") + .addProperties("number", new Schema().type("integer")); + openAPI.getComponents().addSchemas("sample", model); + openAPI.getComponents().addSchemas("Children", children); codegen.setOpenAPI(openAPI); + final CodegenModel cm = codegen.fromModel("sample", model); Assert.assertEquals(cm.name, "sample"); - Assert.assertEquals(cm.classname, "sample.Sample"); + Assert.assertEquals(cm.classname, "Sample"); Assert.assertEquals(cm.description, "a sample model"); Assert.assertEquals(cm.vars.size(), 1); final CodegenProperty property1 = cm.vars.get(0); Assert.assertEquals(property1.baseName, "children"); Assert.assertEquals(property1.complexType, "Children"); - Assert.assertEquals(property1.dataType, "[children.Children]"); + Assert.assertEquals(property1.dataType, "[Children]"); Assert.assertEquals(property1.name, "children"); Assert.assertEquals(property1.baseType, "list"); Assert.assertEquals(property1.containerType, "array"); @@ -227,25 +239,31 @@ public void complexListPropertyTest() { @Test(description = "convert a model with complex map property") public void complexMapPropertyTest() { + final DefaultCodegen codegen = new PythonClientExperimentalCodegen(); + OpenAPI openAPI = TestUtils.createOpenAPI(); final Schema model = new Schema() .description("a sample model") .addProperties("children", new MapSchema() - .additionalProperties(new Schema().$ref("#/definitions/Children"))); - final DefaultCodegen codegen = new PythonClientExperimentalCodegen(); - OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", model); + .additionalProperties(new Schema().$ref("#/components/schemas/Children"))); + final Schema children = new Schema() + .type("object") + .addProperties("number", new Schema().type("integer")); + openAPI.getComponents().addSchemas("sample", model); + openAPI.getComponents().addSchemas("Children", children); codegen.setOpenAPI(openAPI); + final CodegenModel cm = codegen.fromModel("sample", model); Assert.assertEquals(cm.name, "sample"); - Assert.assertEquals(cm.classname, "sample.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("children.Children")).size(), 1); + Assert.assertEquals(Sets.intersection(cm.imports, Sets.newHashSet("Children")).size(), 1); final CodegenProperty property1 = cm.vars.get(0); Assert.assertEquals(property1.baseName, "children"); Assert.assertEquals(property1.complexType, "Children"); - Assert.assertEquals(property1.dataType, "{str: (children.Children,)}"); + Assert.assertEquals(property1.dataType, "{str: (Children,)}"); Assert.assertEquals(property1.name, "children"); Assert.assertEquals(property1.baseType, "dict"); Assert.assertEquals(property1.containerType, "map"); @@ -257,38 +275,48 @@ public void complexMapPropertyTest() { // should not start with 'null'. need help from the community to investigate further @Test(description = "convert an array model") public void arrayModelTest() { + final DefaultCodegen codegen = new PythonClientExperimentalCodegen(); + OpenAPI openAPI = TestUtils.createOpenAPI(); final Schema model = new ArraySchema() - //.description() - .items(new Schema().$ref("#/definitions/Children")) + .items(new Schema().$ref("#/components/schemas/Children")) .description("an array model"); - final DefaultCodegen codegen = new PythonClientExperimentalCodegen(); - OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", model); + final Schema children = new Schema() + .type("object") + .addProperties("number", new Schema().type("integer")); + openAPI.getComponents().addSchemas("sample", model); + openAPI.getComponents().addSchemas("Children", children); codegen.setOpenAPI(openAPI); + final CodegenModel cm = codegen.fromModel("sample", model); Assert.assertEquals(cm.name, "sample"); - Assert.assertEquals(cm.classname, "sample.Sample"); + Assert.assertEquals(cm.classname, "Sample"); Assert.assertEquals(cm.classVarName, "sample"); Assert.assertEquals(cm.description, "an array model"); Assert.assertEquals(cm.vars.size(), 0); // the array model has no vars Assert.assertEquals(cm.parent, "list"); Assert.assertEquals(cm.imports.size(), 1); - Assert.assertEquals(Sets.intersection(cm.imports, Sets.newHashSet("children.Children")).size(), 1); + Assert.assertEquals(Sets.intersection(cm.imports, Sets.newHashSet("Children")).size(), 1); } // should not start with 'null'. need help from the community to investigate further @Test(description = "convert a map model") public void mapModelTest() { - final Schema model = new Schema() - .description("a map model") - .additionalProperties(new Schema().$ref("#/definitions/Children")); final DefaultCodegen codegen = new PythonClientExperimentalCodegen(); - OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", model); + OpenAPI openAPI = TestUtils.createOpenAPI(); + final Schema sample = new Schema() + .description("a map model") + .additionalProperties(new Schema().$ref("#/components/schemas/Children")); + final Schema children = new Schema() + .type("object") + .addProperties("number", new Schema().type("integer")); + openAPI.getComponents().addSchemas("sample", sample); + openAPI.getComponents().addSchemas("Children", children); codegen.setOpenAPI(openAPI); - final CodegenModel cm = codegen.fromModel("sample", model); + final CodegenModel cm = codegen.fromModel("sample", sample); Assert.assertEquals(cm.name, "sample"); - Assert.assertEquals(cm.classname, "sample.Sample"); + Assert.assertEquals(cm.classname, "Sample"); Assert.assertEquals(cm.description, "a map model"); Assert.assertEquals(cm.vars.size(), 0); Assert.assertEquals(cm.parent, null); diff --git a/samples/client/petstore/python-experimental/README.md b/samples/client/petstore/python-experimental/README.md index c265bc3767bb..a935fc478b12 100644 --- a/samples/client/petstore/python-experimental/README.md +++ b/samples/client/petstore/python-experimental/README.md @@ -50,7 +50,7 @@ import time import petstore_api from pprint import pprint from petstore_api.api import another_fake_api -from petstore_api.model import client +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( @@ -63,7 +63,7 @@ configuration = petstore_api.Configuration( with petstore_api.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = another_fake_api.AnotherFakeApi(api_client) - body = client.Client() # client.Client | client model + body = Client() # Client | client model try: # To test special tags @@ -122,69 +122,69 @@ Class | Method | HTTP request | Description ## Documentation For Models - - [additional_properties_any_type.AdditionalPropertiesAnyType](docs/AdditionalPropertiesAnyType.md) - - [additional_properties_array.AdditionalPropertiesArray](docs/AdditionalPropertiesArray.md) - - [additional_properties_boolean.AdditionalPropertiesBoolean](docs/AdditionalPropertiesBoolean.md) - - [additional_properties_class.AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md) - - [additional_properties_integer.AdditionalPropertiesInteger](docs/AdditionalPropertiesInteger.md) - - [additional_properties_number.AdditionalPropertiesNumber](docs/AdditionalPropertiesNumber.md) - - [additional_properties_object.AdditionalPropertiesObject](docs/AdditionalPropertiesObject.md) - - [additional_properties_string.AdditionalPropertiesString](docs/AdditionalPropertiesString.md) - - [animal.Animal](docs/Animal.md) - - [animal_farm.AnimalFarm](docs/AnimalFarm.md) - - [api_response.ApiResponse](docs/ApiResponse.md) - - [array_of_array_of_number_only.ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) - - [array_of_number_only.ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) - - [array_test.ArrayTest](docs/ArrayTest.md) - - [capitalization.Capitalization](docs/Capitalization.md) - - [cat.Cat](docs/Cat.md) - - [cat_all_of.CatAllOf](docs/CatAllOf.md) - - [category.Category](docs/Category.md) - - [child.Child](docs/Child.md) - - [child_all_of.ChildAllOf](docs/ChildAllOf.md) - - [child_cat.ChildCat](docs/ChildCat.md) - - [child_cat_all_of.ChildCatAllOf](docs/ChildCatAllOf.md) - - [child_dog.ChildDog](docs/ChildDog.md) - - [child_dog_all_of.ChildDogAllOf](docs/ChildDogAllOf.md) - - [child_lizard.ChildLizard](docs/ChildLizard.md) - - [child_lizard_all_of.ChildLizardAllOf](docs/ChildLizardAllOf.md) - - [class_model.ClassModel](docs/ClassModel.md) - - [client.Client](docs/Client.md) - - [dog.Dog](docs/Dog.md) - - [dog_all_of.DogAllOf](docs/DogAllOf.md) - - [enum_arrays.EnumArrays](docs/EnumArrays.md) - - [enum_class.EnumClass](docs/EnumClass.md) - - [enum_test.EnumTest](docs/EnumTest.md) - - [file.File](docs/File.md) - - [file_schema_test_class.FileSchemaTestClass](docs/FileSchemaTestClass.md) - - [format_test.FormatTest](docs/FormatTest.md) - - [grandparent.Grandparent](docs/Grandparent.md) - - [grandparent_animal.GrandparentAnimal](docs/GrandparentAnimal.md) - - [has_only_read_only.HasOnlyReadOnly](docs/HasOnlyReadOnly.md) - - [list.List](docs/List.md) - - [map_test.MapTest](docs/MapTest.md) - - [mixed_properties_and_additional_properties_class.MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) - - [model200_response.Model200Response](docs/Model200Response.md) - - [model_return.ModelReturn](docs/ModelReturn.md) - - [name.Name](docs/Name.md) - - [number_only.NumberOnly](docs/NumberOnly.md) - - [number_with_validations.NumberWithValidations](docs/NumberWithValidations.md) - - [object_model_with_ref_props.ObjectModelWithRefProps](docs/ObjectModelWithRefProps.md) - - [order.Order](docs/Order.md) - - [parent.Parent](docs/Parent.md) - - [parent_all_of.ParentAllOf](docs/ParentAllOf.md) - - [parent_pet.ParentPet](docs/ParentPet.md) - - [pet.Pet](docs/Pet.md) - - [player.Player](docs/Player.md) - - [read_only_first.ReadOnlyFirst](docs/ReadOnlyFirst.md) - - [special_model_name.SpecialModelName](docs/SpecialModelName.md) - - [string_boolean_map.StringBooleanMap](docs/StringBooleanMap.md) - - [string_enum.StringEnum](docs/StringEnum.md) - - [tag.Tag](docs/Tag.md) - - [type_holder_default.TypeHolderDefault](docs/TypeHolderDefault.md) - - [type_holder_example.TypeHolderExample](docs/TypeHolderExample.md) - - [user.User](docs/User.md) - - [xml_item.XmlItem](docs/XmlItem.md) + - [AdditionalPropertiesAnyType](docs/AdditionalPropertiesAnyType.md) + - [AdditionalPropertiesArray](docs/AdditionalPropertiesArray.md) + - [AdditionalPropertiesBoolean](docs/AdditionalPropertiesBoolean.md) + - [AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md) + - [AdditionalPropertiesInteger](docs/AdditionalPropertiesInteger.md) + - [AdditionalPropertiesNumber](docs/AdditionalPropertiesNumber.md) + - [AdditionalPropertiesObject](docs/AdditionalPropertiesObject.md) + - [AdditionalPropertiesString](docs/AdditionalPropertiesString.md) + - [Animal](docs/Animal.md) + - [AnimalFarm](docs/AnimalFarm.md) + - [ApiResponse](docs/ApiResponse.md) + - [ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) + - [ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) + - [ArrayTest](docs/ArrayTest.md) + - [Capitalization](docs/Capitalization.md) + - [Cat](docs/Cat.md) + - [CatAllOf](docs/CatAllOf.md) + - [Category](docs/Category.md) + - [Child](docs/Child.md) + - [ChildAllOf](docs/ChildAllOf.md) + - [ChildCat](docs/ChildCat.md) + - [ChildCatAllOf](docs/ChildCatAllOf.md) + - [ChildDog](docs/ChildDog.md) + - [ChildDogAllOf](docs/ChildDogAllOf.md) + - [ChildLizard](docs/ChildLizard.md) + - [ChildLizardAllOf](docs/ChildLizardAllOf.md) + - [ClassModel](docs/ClassModel.md) + - [Client](docs/Client.md) + - [Dog](docs/Dog.md) + - [DogAllOf](docs/DogAllOf.md) + - [EnumArrays](docs/EnumArrays.md) + - [EnumClass](docs/EnumClass.md) + - [EnumTest](docs/EnumTest.md) + - [File](docs/File.md) + - [FileSchemaTestClass](docs/FileSchemaTestClass.md) + - [FormatTest](docs/FormatTest.md) + - [Grandparent](docs/Grandparent.md) + - [GrandparentAnimal](docs/GrandparentAnimal.md) + - [HasOnlyReadOnly](docs/HasOnlyReadOnly.md) + - [List](docs/List.md) + - [MapTest](docs/MapTest.md) + - [MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) + - [Model200Response](docs/Model200Response.md) + - [ModelReturn](docs/ModelReturn.md) + - [Name](docs/Name.md) + - [NumberOnly](docs/NumberOnly.md) + - [NumberWithValidations](docs/NumberWithValidations.md) + - [ObjectModelWithRefProps](docs/ObjectModelWithRefProps.md) + - [Order](docs/Order.md) + - [Parent](docs/Parent.md) + - [ParentAllOf](docs/ParentAllOf.md) + - [ParentPet](docs/ParentPet.md) + - [Pet](docs/Pet.md) + - [Player](docs/Player.md) + - [ReadOnlyFirst](docs/ReadOnlyFirst.md) + - [SpecialModelName](docs/SpecialModelName.md) + - [StringBooleanMap](docs/StringBooleanMap.md) + - [StringEnum](docs/StringEnum.md) + - [Tag](docs/Tag.md) + - [TypeHolderDefault](docs/TypeHolderDefault.md) + - [TypeHolderExample](docs/TypeHolderExample.md) + - [User](docs/User.md) + - [XmlItem](docs/XmlItem.md) ## Documentation For Authorization diff --git a/samples/client/petstore/python-experimental/docs/AdditionalPropertiesAnyType.md b/samples/client/petstore/python-experimental/docs/AdditionalPropertiesAnyType.md index d27928ab7527..754b2f3ada4c 100644 --- a/samples/client/petstore/python-experimental/docs/AdditionalPropertiesAnyType.md +++ b/samples/client/petstore/python-experimental/docs/AdditionalPropertiesAnyType.md @@ -1,4 +1,4 @@ -# additional_properties_any_type.AdditionalPropertiesAnyType +# AdditionalPropertiesAnyType ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/python-experimental/docs/AdditionalPropertiesArray.md b/samples/client/petstore/python-experimental/docs/AdditionalPropertiesArray.md index 6eac3ace2eca..61ac566c14d2 100644 --- a/samples/client/petstore/python-experimental/docs/AdditionalPropertiesArray.md +++ b/samples/client/petstore/python-experimental/docs/AdditionalPropertiesArray.md @@ -1,4 +1,4 @@ -# additional_properties_array.AdditionalPropertiesArray +# AdditionalPropertiesArray ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/python-experimental/docs/AdditionalPropertiesBoolean.md b/samples/client/petstore/python-experimental/docs/AdditionalPropertiesBoolean.md index b403323c5532..f2567f064cfd 100644 --- a/samples/client/petstore/python-experimental/docs/AdditionalPropertiesBoolean.md +++ b/samples/client/petstore/python-experimental/docs/AdditionalPropertiesBoolean.md @@ -1,4 +1,4 @@ -# additional_properties_boolean.AdditionalPropertiesBoolean +# AdditionalPropertiesBoolean ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/python-experimental/docs/AdditionalPropertiesClass.md b/samples/client/petstore/python-experimental/docs/AdditionalPropertiesClass.md index 4b232aa174af..4a9d1dd133ce 100644 --- a/samples/client/petstore/python-experimental/docs/AdditionalPropertiesClass.md +++ b/samples/client/petstore/python-experimental/docs/AdditionalPropertiesClass.md @@ -1,4 +1,4 @@ -# additional_properties_class.AdditionalPropertiesClass +# AdditionalPropertiesClass ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/python-experimental/docs/AdditionalPropertiesInteger.md b/samples/client/petstore/python-experimental/docs/AdditionalPropertiesInteger.md index 461419e03759..fe0ba709c8ef 100644 --- a/samples/client/petstore/python-experimental/docs/AdditionalPropertiesInteger.md +++ b/samples/client/petstore/python-experimental/docs/AdditionalPropertiesInteger.md @@ -1,4 +1,4 @@ -# additional_properties_integer.AdditionalPropertiesInteger +# AdditionalPropertiesInteger ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/python-experimental/docs/AdditionalPropertiesNumber.md b/samples/client/petstore/python-experimental/docs/AdditionalPropertiesNumber.md index e0e328aed8eb..bec81854b950 100644 --- a/samples/client/petstore/python-experimental/docs/AdditionalPropertiesNumber.md +++ b/samples/client/petstore/python-experimental/docs/AdditionalPropertiesNumber.md @@ -1,4 +1,4 @@ -# additional_properties_number.AdditionalPropertiesNumber +# AdditionalPropertiesNumber ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/python-experimental/docs/AdditionalPropertiesObject.md b/samples/client/petstore/python-experimental/docs/AdditionalPropertiesObject.md index 36026fe72f82..3fcf2c9299df 100644 --- a/samples/client/petstore/python-experimental/docs/AdditionalPropertiesObject.md +++ b/samples/client/petstore/python-experimental/docs/AdditionalPropertiesObject.md @@ -1,4 +1,4 @@ -# additional_properties_object.AdditionalPropertiesObject +# AdditionalPropertiesObject ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/python-experimental/docs/AdditionalPropertiesString.md b/samples/client/petstore/python-experimental/docs/AdditionalPropertiesString.md index 41594fd730d0..bbe0b1cbbbb9 100644 --- a/samples/client/petstore/python-experimental/docs/AdditionalPropertiesString.md +++ b/samples/client/petstore/python-experimental/docs/AdditionalPropertiesString.md @@ -1,4 +1,4 @@ -# additional_properties_string.AdditionalPropertiesString +# AdditionalPropertiesString ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/python-experimental/docs/Animal.md b/samples/client/petstore/python-experimental/docs/Animal.md index fda84ee28eea..e59166a62e83 100644 --- a/samples/client/petstore/python-experimental/docs/Animal.md +++ b/samples/client/petstore/python-experimental/docs/Animal.md @@ -1,4 +1,4 @@ -# animal.Animal +# Animal ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/python-experimental/docs/AnimalFarm.md b/samples/client/petstore/python-experimental/docs/AnimalFarm.md index c9976c7ddab9..0717b5d7df1f 100644 --- a/samples/client/petstore/python-experimental/docs/AnimalFarm.md +++ b/samples/client/petstore/python-experimental/docs/AnimalFarm.md @@ -1,9 +1,9 @@ -# animal_farm.AnimalFarm +# AnimalFarm ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**value** | [**[animal.Animal]**](Animal.md) | | +**value** | [**[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/client/petstore/python-experimental/docs/AnotherFakeApi.md b/samples/client/petstore/python-experimental/docs/AnotherFakeApi.md index 8b25ae168713..b476f17c965f 100644 --- a/samples/client/petstore/python-experimental/docs/AnotherFakeApi.md +++ b/samples/client/petstore/python-experimental/docs/AnotherFakeApi.md @@ -8,7 +8,7 @@ Method | HTTP request | Description # **call_123_test_special_tags** -> client.Client call_123_test_special_tags(body) +> Client call_123_test_special_tags(body) To test special tags @@ -20,7 +20,7 @@ To test special tags and operation ID starting with number import time import petstore_api from petstore_api.api import another_fake_api -from petstore_api.model import client +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. @@ -33,7 +33,7 @@ configuration = petstore_api.Configuration( with petstore_api.ApiClient() as api_client: # Create an instance of the API class api_instance = another_fake_api.AnotherFakeApi(api_client) - body = client.Client() # client.Client | client model + body = Client() # Client | client model # example passing only required values which don't have defaults set try: @@ -48,11 +48,11 @@ with petstore_api.ApiClient() as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**client.Client**](Client.md)| client model | + **body** | [**Client**](Client.md)| client model | ### Return type -[**client.Client**](Client.md) +[**Client**](Client.md) ### Authorization diff --git a/samples/client/petstore/python-experimental/docs/ApiResponse.md b/samples/client/petstore/python-experimental/docs/ApiResponse.md index 8f7ffa461340..8fc302305abe 100644 --- a/samples/client/petstore/python-experimental/docs/ApiResponse.md +++ b/samples/client/petstore/python-experimental/docs/ApiResponse.md @@ -1,4 +1,4 @@ -# api_response.ApiResponse +# ApiResponse ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/python-experimental/docs/ArrayOfArrayOfNumberOnly.md b/samples/client/petstore/python-experimental/docs/ArrayOfArrayOfNumberOnly.md index ab82c8c556d0..1a68df0090bb 100644 --- a/samples/client/petstore/python-experimental/docs/ArrayOfArrayOfNumberOnly.md +++ b/samples/client/petstore/python-experimental/docs/ArrayOfArrayOfNumberOnly.md @@ -1,4 +1,4 @@ -# array_of_array_of_number_only.ArrayOfArrayOfNumberOnly +# ArrayOfArrayOfNumberOnly ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/python-experimental/docs/ArrayOfNumberOnly.md b/samples/client/petstore/python-experimental/docs/ArrayOfNumberOnly.md index b8ffd843c8d8..b8a760f56dc2 100644 --- a/samples/client/petstore/python-experimental/docs/ArrayOfNumberOnly.md +++ b/samples/client/petstore/python-experimental/docs/ArrayOfNumberOnly.md @@ -1,4 +1,4 @@ -# array_of_number_only.ArrayOfNumberOnly +# ArrayOfNumberOnly ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/python-experimental/docs/ArrayTest.md b/samples/client/petstore/python-experimental/docs/ArrayTest.md index 22f198440e7b..b94f23fd2271 100644 --- a/samples/client/petstore/python-experimental/docs/ArrayTest.md +++ b/samples/client/petstore/python-experimental/docs/ArrayTest.md @@ -1,11 +1,11 @@ -# array_test.ArrayTest +# ArrayTest ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **array_of_string** | **[str]** | | [optional] **array_array_of_integer** | **[[int]]** | | [optional] -**array_array_of_model** | [**[[read_only_first.ReadOnlyFirst]]**](ReadOnlyFirst.md) | | [optional] +**array_array_of_model** | [**[[ReadOnlyFirst]]**](ReadOnlyFirst.md) | | [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/client/petstore/python-experimental/docs/Capitalization.md b/samples/client/petstore/python-experimental/docs/Capitalization.md index d402f2a571a8..85d88d239ee7 100644 --- a/samples/client/petstore/python-experimental/docs/Capitalization.md +++ b/samples/client/petstore/python-experimental/docs/Capitalization.md @@ -1,4 +1,4 @@ -# capitalization.Capitalization +# Capitalization ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/python-experimental/docs/Cat.md b/samples/client/petstore/python-experimental/docs/Cat.md index 1d7b5b26d715..8bdbf9b3bcca 100644 --- a/samples/client/petstore/python-experimental/docs/Cat.md +++ b/samples/client/petstore/python-experimental/docs/Cat.md @@ -1,4 +1,4 @@ -# cat.Cat +# Cat ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/python-experimental/docs/CatAllOf.md b/samples/client/petstore/python-experimental/docs/CatAllOf.md index 653bb0aa3538..35434374fc97 100644 --- a/samples/client/petstore/python-experimental/docs/CatAllOf.md +++ b/samples/client/petstore/python-experimental/docs/CatAllOf.md @@ -1,4 +1,4 @@ -# cat_all_of.CatAllOf +# CatAllOf ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/python-experimental/docs/Category.md b/samples/client/petstore/python-experimental/docs/Category.md index bb122d910fcd..33b2242d703f 100644 --- a/samples/client/petstore/python-experimental/docs/Category.md +++ b/samples/client/petstore/python-experimental/docs/Category.md @@ -1,4 +1,4 @@ -# category.Category +# Category ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/python-experimental/docs/Child.md b/samples/client/petstore/python-experimental/docs/Child.md index bc3c7f3922d3..28c29d3d761f 100644 --- a/samples/client/petstore/python-experimental/docs/Child.md +++ b/samples/client/petstore/python-experimental/docs/Child.md @@ -1,4 +1,4 @@ -# child.Child +# Child ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/python-experimental/docs/ChildAllOf.md b/samples/client/petstore/python-experimental/docs/ChildAllOf.md index 9d2e42e1894e..47774b92a66a 100644 --- a/samples/client/petstore/python-experimental/docs/ChildAllOf.md +++ b/samples/client/petstore/python-experimental/docs/ChildAllOf.md @@ -1,4 +1,4 @@ -# child_all_of.ChildAllOf +# ChildAllOf ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/python-experimental/docs/ChildCat.md b/samples/client/petstore/python-experimental/docs/ChildCat.md index 8f5ea4b2ced0..328b1b4b591d 100644 --- a/samples/client/petstore/python-experimental/docs/ChildCat.md +++ b/samples/client/petstore/python-experimental/docs/ChildCat.md @@ -1,4 +1,4 @@ -# child_cat.ChildCat +# ChildCat ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/python-experimental/docs/ChildCatAllOf.md b/samples/client/petstore/python-experimental/docs/ChildCatAllOf.md index 2e84f31081f9..f48345511c10 100644 --- a/samples/client/petstore/python-experimental/docs/ChildCatAllOf.md +++ b/samples/client/petstore/python-experimental/docs/ChildCatAllOf.md @@ -1,4 +1,4 @@ -# child_cat_all_of.ChildCatAllOf +# ChildCatAllOf ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/python-experimental/docs/ChildDog.md b/samples/client/petstore/python-experimental/docs/ChildDog.md index 2680d987a452..233f420409b1 100644 --- a/samples/client/petstore/python-experimental/docs/ChildDog.md +++ b/samples/client/petstore/python-experimental/docs/ChildDog.md @@ -1,4 +1,4 @@ -# child_dog.ChildDog +# ChildDog ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/python-experimental/docs/ChildDogAllOf.md b/samples/client/petstore/python-experimental/docs/ChildDogAllOf.md index c7dded9a6df1..a366fb735c0b 100644 --- a/samples/client/petstore/python-experimental/docs/ChildDogAllOf.md +++ b/samples/client/petstore/python-experimental/docs/ChildDogAllOf.md @@ -1,4 +1,4 @@ -# child_dog_all_of.ChildDogAllOf +# ChildDogAllOf ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/python-experimental/docs/ChildLizard.md b/samples/client/petstore/python-experimental/docs/ChildLizard.md index 97b8891a27e2..9a8b7524c9f9 100644 --- a/samples/client/petstore/python-experimental/docs/ChildLizard.md +++ b/samples/client/petstore/python-experimental/docs/ChildLizard.md @@ -1,4 +1,4 @@ -# child_lizard.ChildLizard +# ChildLizard ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/python-experimental/docs/ChildLizardAllOf.md b/samples/client/petstore/python-experimental/docs/ChildLizardAllOf.md index 517f1260b968..a9f166b9f56a 100644 --- a/samples/client/petstore/python-experimental/docs/ChildLizardAllOf.md +++ b/samples/client/petstore/python-experimental/docs/ChildLizardAllOf.md @@ -1,4 +1,4 @@ -# child_lizard_all_of.ChildLizardAllOf +# ChildLizardAllOf ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/python-experimental/docs/ClassModel.md b/samples/client/petstore/python-experimental/docs/ClassModel.md index 3f5d0075c1bb..657d51a944de 100644 --- a/samples/client/petstore/python-experimental/docs/ClassModel.md +++ b/samples/client/petstore/python-experimental/docs/ClassModel.md @@ -1,4 +1,4 @@ -# class_model.ClassModel +# ClassModel Model for testing model with \"_class\" property ## Properties diff --git a/samples/client/petstore/python-experimental/docs/Client.md b/samples/client/petstore/python-experimental/docs/Client.md index 4c7ce57f750f..88e99384f92c 100644 --- a/samples/client/petstore/python-experimental/docs/Client.md +++ b/samples/client/petstore/python-experimental/docs/Client.md @@ -1,4 +1,4 @@ -# client.Client +# Client ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/python-experimental/docs/Dog.md b/samples/client/petstore/python-experimental/docs/Dog.md index ec98b99dcec5..81de56780725 100644 --- a/samples/client/petstore/python-experimental/docs/Dog.md +++ b/samples/client/petstore/python-experimental/docs/Dog.md @@ -1,4 +1,4 @@ -# dog.Dog +# Dog ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/python-experimental/docs/DogAllOf.md b/samples/client/petstore/python-experimental/docs/DogAllOf.md index da3c29557df7..36d3216f7b35 100644 --- a/samples/client/petstore/python-experimental/docs/DogAllOf.md +++ b/samples/client/petstore/python-experimental/docs/DogAllOf.md @@ -1,4 +1,4 @@ -# dog_all_of.DogAllOf +# DogAllOf ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/python-experimental/docs/EnumArrays.md b/samples/client/petstore/python-experimental/docs/EnumArrays.md index c2f22d45047c..e0b5582e9d5b 100644 --- a/samples/client/petstore/python-experimental/docs/EnumArrays.md +++ b/samples/client/petstore/python-experimental/docs/EnumArrays.md @@ -1,4 +1,4 @@ -# enum_arrays.EnumArrays +# EnumArrays ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/python-experimental/docs/EnumClass.md b/samples/client/petstore/python-experimental/docs/EnumClass.md index 4a29732d861c..6e7ecf355ffc 100644 --- a/samples/client/petstore/python-experimental/docs/EnumClass.md +++ b/samples/client/petstore/python-experimental/docs/EnumClass.md @@ -1,4 +1,4 @@ -# enum_class.EnumClass +# EnumClass ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/python-experimental/docs/EnumTest.md b/samples/client/petstore/python-experimental/docs/EnumTest.md index 24b09db3344d..22dd3d5f48d8 100644 --- a/samples/client/petstore/python-experimental/docs/EnumTest.md +++ b/samples/client/petstore/python-experimental/docs/EnumTest.md @@ -1,4 +1,4 @@ -# enum_test.EnumTest +# EnumTest ## Properties Name | Type | Description | Notes @@ -7,7 +7,7 @@ Name | Type | Description | Notes **enum_string** | **str** | | [optional] **enum_integer** | **int** | | [optional] **enum_number** | **float** | | [optional] -**string_enum** | [**string_enum.StringEnum**](StringEnum.md) | | [optional] +**string_enum** | [**StringEnum**](StringEnum.md) | | [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/client/petstore/python-experimental/docs/FakeApi.md b/samples/client/petstore/python-experimental/docs/FakeApi.md index b50d11670aa1..804344787fc6 100644 --- a/samples/client/petstore/python-experimental/docs/FakeApi.md +++ b/samples/client/petstore/python-experimental/docs/FakeApi.md @@ -23,7 +23,7 @@ Method | HTTP request | Description # **array_model** -> animal_farm.AnimalFarm array_model() +> AnimalFarm array_model() @@ -35,7 +35,7 @@ Test serialization of ArrayModel import time import petstore_api from petstore_api.api import fake_api -from petstore_api.model import animal_farm +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. @@ -48,7 +48,7 @@ configuration = petstore_api.Configuration( with petstore_api.ApiClient() as api_client: # Create an instance of the API class api_instance = fake_api.FakeApi(api_client) - body = animal_farm.AnimalFarm() # animal_farm.AnimalFarm | Input model (optional) + body = AnimalFarm() # AnimalFarm | Input model (optional) # example passing only required values which don't have defaults set # and optional values @@ -63,11 +63,11 @@ with petstore_api.ApiClient() as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**animal_farm.AnimalFarm**](AnimalFarm.md)| Input model | [optional] + **body** | [**AnimalFarm**](AnimalFarm.md)| Input model | [optional] ### Return type -[**animal_farm.AnimalFarm**](AnimalFarm.md) +[**AnimalFarm**](AnimalFarm.md) ### Authorization @@ -160,7 +160,7 @@ this route creates an XmlItem import time import petstore_api from petstore_api.api import fake_api -from petstore_api.model import xml_item +from petstore_api.model.xml_item import XmlItem 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. @@ -173,7 +173,7 @@ configuration = petstore_api.Configuration( with petstore_api.ApiClient() as api_client: # Create an instance of the API class api_instance = fake_api.FakeApi(api_client) - xml_item = xml_item.XmlItem() # xml_item.XmlItem | XmlItem Body + xml_item = XmlItem() # XmlItem | XmlItem Body # example passing only required values which don't have defaults set try: @@ -187,7 +187,7 @@ with petstore_api.ApiClient() as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **xml_item** | [**xml_item.XmlItem**](XmlItem.md)| XmlItem Body | + **xml_item** | [**XmlItem**](XmlItem.md)| XmlItem Body | ### Return type @@ -210,7 +210,7 @@ No authorization required [[Back to top]](#) [[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** -> number_with_validations.NumberWithValidations number_with_validations() +> NumberWithValidations number_with_validations() @@ -222,7 +222,7 @@ Test serialization of outer number types import time import petstore_api from petstore_api.api import fake_api -from petstore_api.model import number_with_validations +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. @@ -235,7 +235,7 @@ configuration = petstore_api.Configuration( with petstore_api.ApiClient() as api_client: # Create an instance of the API class api_instance = fake_api.FakeApi(api_client) - body = number_with_validations.NumberWithValidations(3.4) # number_with_validations.NumberWithValidations | Input number as post body (optional) + body = NumberWithValidations(3.4) # NumberWithValidations | Input number as post body (optional) # example passing only required values which don't have defaults set # and optional values @@ -250,11 +250,11 @@ with petstore_api.ApiClient() as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**number_with_validations.NumberWithValidations**](NumberWithValidations.md)| Input number as post body | [optional] + **body** | [**NumberWithValidations**](NumberWithValidations.md)| Input number as post body | [optional] ### Return type -[**number_with_validations.NumberWithValidations**](NumberWithValidations.md) +[**NumberWithValidations**](NumberWithValidations.md) ### Authorization @@ -273,7 +273,7 @@ No authorization required [[Back to top]](#) [[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** -> object_model_with_ref_props.ObjectModelWithRefProps object_model_with_ref_props() +> ObjectModelWithRefProps object_model_with_ref_props() @@ -285,7 +285,7 @@ Test serialization of object with $refed properties import time import petstore_api from petstore_api.api import fake_api -from petstore_api.model import object_model_with_ref_props +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. @@ -298,7 +298,7 @@ configuration = petstore_api.Configuration( with petstore_api.ApiClient() as api_client: # Create an instance of the API class api_instance = fake_api.FakeApi(api_client) - body = object_model_with_ref_props.ObjectModelWithRefProps() # object_model_with_ref_props.ObjectModelWithRefProps | Input model (optional) + body = ObjectModelWithRefProps() # ObjectModelWithRefProps | Input model (optional) # example passing only required values which don't have defaults set # and optional values @@ -313,11 +313,11 @@ with petstore_api.ApiClient() as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**object_model_with_ref_props.ObjectModelWithRefProps**](ObjectModelWithRefProps.md)| Input model | [optional] + **body** | [**ObjectModelWithRefProps**](ObjectModelWithRefProps.md)| Input model | [optional] ### Return type -[**object_model_with_ref_props.ObjectModelWithRefProps**](ObjectModelWithRefProps.md) +[**ObjectModelWithRefProps**](ObjectModelWithRefProps.md) ### Authorization @@ -398,7 +398,7 @@ No authorization required [[Back to top]](#) [[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** -> string_enum.StringEnum string_enum() +> StringEnum string_enum() @@ -410,7 +410,7 @@ Test serialization of outer enum import time import petstore_api from petstore_api.api import fake_api -from petstore_api.model import string_enum +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. @@ -423,7 +423,7 @@ configuration = petstore_api.Configuration( with petstore_api.ApiClient() as api_client: # Create an instance of the API class api_instance = fake_api.FakeApi(api_client) - body = string_enum.StringEnum("placed") # string_enum.StringEnum | Input enum (optional) + body = StringEnum("placed") # StringEnum | Input enum (optional) # example passing only required values which don't have defaults set # and optional values @@ -438,11 +438,11 @@ with petstore_api.ApiClient() as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**string_enum.StringEnum**](StringEnum.md)| Input enum | [optional] + **body** | [**StringEnum**](StringEnum.md)| Input enum | [optional] ### Return type -[**string_enum.StringEnum**](StringEnum.md) +[**StringEnum**](StringEnum.md) ### Authorization @@ -473,7 +473,7 @@ For this test, the body for this request much reference a schema named `File`. import time import petstore_api from petstore_api.api import fake_api -from petstore_api.model import file_schema_test_class +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. @@ -486,7 +486,7 @@ configuration = petstore_api.Configuration( with petstore_api.ApiClient() as api_client: # Create an instance of the API class api_instance = fake_api.FakeApi(api_client) - body = file_schema_test_class.FileSchemaTestClass() # file_schema_test_class.FileSchemaTestClass | + body = FileSchemaTestClass() # FileSchemaTestClass | # example passing only required values which don't have defaults set try: @@ -499,7 +499,7 @@ with petstore_api.ApiClient() as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**file_schema_test_class.FileSchemaTestClass**](FileSchemaTestClass.md)| | + **body** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| | ### Return type @@ -532,7 +532,7 @@ No authorization required import time import petstore_api from petstore_api.api import fake_api -from petstore_api.model import user +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. @@ -546,7 +546,7 @@ with petstore_api.ApiClient() as api_client: # Create an instance of the API class api_instance = fake_api.FakeApi(api_client) query = 'query_example' # str | - body = user.User() # user.User | + body = User() # User | # example passing only required values which don't have defaults set try: @@ -560,7 +560,7 @@ with petstore_api.ApiClient() as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **query** | **str**| | - **body** | [**user.User**](User.md)| | + **body** | [**User**](User.md)| | ### Return type @@ -583,7 +583,7 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **test_client_model** -> client.Client test_client_model(body) +> Client test_client_model(body) To test \"client\" model @@ -595,7 +595,7 @@ To test \"client\" model import time import petstore_api from petstore_api.api import fake_api -from petstore_api.model import client +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. @@ -608,7 +608,7 @@ configuration = petstore_api.Configuration( with petstore_api.ApiClient() as api_client: # Create an instance of the API class api_instance = fake_api.FakeApi(api_client) - body = client.Client() # client.Client | client model + body = Client() # Client | client model # example passing only required values which don't have defaults set try: @@ -623,11 +623,11 @@ with petstore_api.ApiClient() as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**client.Client**](Client.md)| client model | + **body** | [**Client**](Client.md)| client model | ### Return type -[**client.Client**](Client.md) +[**Client**](Client.md) ### Authorization diff --git a/samples/client/petstore/python-experimental/docs/FakeClassnameTags123Api.md b/samples/client/petstore/python-experimental/docs/FakeClassnameTags123Api.md index aad73f70f5c1..134d05a959f2 100644 --- a/samples/client/petstore/python-experimental/docs/FakeClassnameTags123Api.md +++ b/samples/client/petstore/python-experimental/docs/FakeClassnameTags123Api.md @@ -8,7 +8,7 @@ Method | HTTP request | Description # **test_classname** -> client.Client test_classname(body) +> Client test_classname(body) To test class name in snake case @@ -21,7 +21,7 @@ To test class name in snake case import time import petstore_api from petstore_api.api import fake_classname_tags_123_api -from petstore_api.model import client +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. @@ -48,7 +48,7 @@ configuration = petstore_api.Configuration( with petstore_api.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = fake_classname_tags_123_api.FakeClassnameTags123Api(api_client) - body = client.Client() # client.Client | client model + body = Client() # Client | client model # example passing only required values which don't have defaults set try: @@ -63,11 +63,11 @@ with petstore_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**client.Client**](Client.md)| client model | + **body** | [**Client**](Client.md)| client model | ### Return type -[**client.Client**](Client.md) +[**Client**](Client.md) ### Authorization diff --git a/samples/client/petstore/python-experimental/docs/File.md b/samples/client/petstore/python-experimental/docs/File.md index 2847323a0989..f17ba0057d04 100644 --- a/samples/client/petstore/python-experimental/docs/File.md +++ b/samples/client/petstore/python-experimental/docs/File.md @@ -1,4 +1,4 @@ -# file.File +# File Must be named `File` for test. ## Properties diff --git a/samples/client/petstore/python-experimental/docs/FileSchemaTestClass.md b/samples/client/petstore/python-experimental/docs/FileSchemaTestClass.md index 807350c62f2c..d0a8bbaaba95 100644 --- a/samples/client/petstore/python-experimental/docs/FileSchemaTestClass.md +++ b/samples/client/petstore/python-experimental/docs/FileSchemaTestClass.md @@ -1,10 +1,10 @@ -# file_schema_test_class.FileSchemaTestClass +# FileSchemaTestClass ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**file** | [**file.File**](File.md) | | [optional] -**files** | [**[file.File]**](File.md) | | [optional] +**file** | [**File**](File.md) | | [optional] +**files** | [**[File]**](File.md) | | [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/client/petstore/python-experimental/docs/FormatTest.md b/samples/client/petstore/python-experimental/docs/FormatTest.md index 0f0e2f7cfe18..083b0bd4c98a 100644 --- a/samples/client/petstore/python-experimental/docs/FormatTest.md +++ b/samples/client/petstore/python-experimental/docs/FormatTest.md @@ -1,4 +1,4 @@ -# format_test.FormatTest +# FormatTest ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/python-experimental/docs/Grandparent.md b/samples/client/petstore/python-experimental/docs/Grandparent.md index 66f493338381..e98808ee5382 100644 --- a/samples/client/petstore/python-experimental/docs/Grandparent.md +++ b/samples/client/petstore/python-experimental/docs/Grandparent.md @@ -1,4 +1,4 @@ -# grandparent.Grandparent +# Grandparent ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/python-experimental/docs/GrandparentAnimal.md b/samples/client/petstore/python-experimental/docs/GrandparentAnimal.md index 8a6679f3895f..2a9d89c76d95 100644 --- a/samples/client/petstore/python-experimental/docs/GrandparentAnimal.md +++ b/samples/client/petstore/python-experimental/docs/GrandparentAnimal.md @@ -1,4 +1,4 @@ -# grandparent_animal.GrandparentAnimal +# GrandparentAnimal ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/python-experimental/docs/HasOnlyReadOnly.md b/samples/client/petstore/python-experimental/docs/HasOnlyReadOnly.md index f2194e269ed3..f731a42eab54 100644 --- a/samples/client/petstore/python-experimental/docs/HasOnlyReadOnly.md +++ b/samples/client/petstore/python-experimental/docs/HasOnlyReadOnly.md @@ -1,4 +1,4 @@ -# has_only_read_only.HasOnlyReadOnly +# HasOnlyReadOnly ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/python-experimental/docs/List.md b/samples/client/petstore/python-experimental/docs/List.md index 28e2ec05968c..11f4f3a05f32 100644 --- a/samples/client/petstore/python-experimental/docs/List.md +++ b/samples/client/petstore/python-experimental/docs/List.md @@ -1,4 +1,4 @@ -# list.List +# List ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/python-experimental/docs/MapTest.md b/samples/client/petstore/python-experimental/docs/MapTest.md index 9fc13abebdc0..ad561b7220bf 100644 --- a/samples/client/petstore/python-experimental/docs/MapTest.md +++ b/samples/client/petstore/python-experimental/docs/MapTest.md @@ -1,4 +1,4 @@ -# map_test.MapTest +# MapTest ## Properties Name | Type | Description | Notes @@ -6,7 +6,7 @@ Name | Type | Description | Notes **map_map_of_string** | **{str: ({str: (str,)},)}** | | [optional] **map_of_enum_string** | **{str: (str,)}** | | [optional] **direct_map** | **{str: (bool,)}** | | [optional] -**indirect_map** | [**string_boolean_map.StringBooleanMap**](StringBooleanMap.md) | | [optional] +**indirect_map** | [**StringBooleanMap**](StringBooleanMap.md) | | [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/client/petstore/python-experimental/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/python-experimental/docs/MixedPropertiesAndAdditionalPropertiesClass.md index 87cda996e769..1484c0638d83 100644 --- a/samples/client/petstore/python-experimental/docs/MixedPropertiesAndAdditionalPropertiesClass.md +++ b/samples/client/petstore/python-experimental/docs/MixedPropertiesAndAdditionalPropertiesClass.md @@ -1,11 +1,11 @@ -# mixed_properties_and_additional_properties_class.MixedPropertiesAndAdditionalPropertiesClass +# MixedPropertiesAndAdditionalPropertiesClass ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **uuid** | **str** | | [optional] **date_time** | **datetime** | | [optional] -**map** | [**{str: (animal.Animal,)}**](Animal.md) | | [optional] +**map** | [**{str: (Animal,)}**](Animal.md) | | [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/client/petstore/python-experimental/docs/Model200Response.md b/samples/client/petstore/python-experimental/docs/Model200Response.md index 90f5c2c025d8..40d0d7828e14 100644 --- a/samples/client/petstore/python-experimental/docs/Model200Response.md +++ b/samples/client/petstore/python-experimental/docs/Model200Response.md @@ -1,4 +1,4 @@ -# model200_response.Model200Response +# Model200Response Model for testing model name starting with number ## Properties diff --git a/samples/client/petstore/python-experimental/docs/ModelReturn.md b/samples/client/petstore/python-experimental/docs/ModelReturn.md index 3be9912b753e..65ec73ddae78 100644 --- a/samples/client/petstore/python-experimental/docs/ModelReturn.md +++ b/samples/client/petstore/python-experimental/docs/ModelReturn.md @@ -1,4 +1,4 @@ -# model_return.ModelReturn +# ModelReturn Model for testing reserved words ## Properties diff --git a/samples/client/petstore/python-experimental/docs/Name.md b/samples/client/petstore/python-experimental/docs/Name.md index 777b79a3d8bd..807b76afc6ee 100644 --- a/samples/client/petstore/python-experimental/docs/Name.md +++ b/samples/client/petstore/python-experimental/docs/Name.md @@ -1,4 +1,4 @@ -# name.Name +# Name Model for testing model name same as property name ## Properties diff --git a/samples/client/petstore/python-experimental/docs/NumberOnly.md b/samples/client/petstore/python-experimental/docs/NumberOnly.md index ea1a09d2934d..93a0fde7b931 100644 --- a/samples/client/petstore/python-experimental/docs/NumberOnly.md +++ b/samples/client/petstore/python-experimental/docs/NumberOnly.md @@ -1,4 +1,4 @@ -# number_only.NumberOnly +# NumberOnly ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/python-experimental/docs/NumberWithValidations.md b/samples/client/petstore/python-experimental/docs/NumberWithValidations.md index b6eb738a2a8d..402eb8325bc7 100644 --- a/samples/client/petstore/python-experimental/docs/NumberWithValidations.md +++ b/samples/client/petstore/python-experimental/docs/NumberWithValidations.md @@ -1,4 +1,4 @@ -# number_with_validations.NumberWithValidations +# NumberWithValidations ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/python-experimental/docs/ObjectModelWithRefProps.md b/samples/client/petstore/python-experimental/docs/ObjectModelWithRefProps.md index 6c308497b60b..9a94ef8f61cc 100644 --- a/samples/client/petstore/python-experimental/docs/ObjectModelWithRefProps.md +++ b/samples/client/petstore/python-experimental/docs/ObjectModelWithRefProps.md @@ -1,10 +1,10 @@ -# object_model_with_ref_props.ObjectModelWithRefProps +# ObjectModelWithRefProps a model that includes properties which should stay primitive (String + Boolean) and one which is defined as a class, NumberWithValidations ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**my_number** | [**number_with_validations.NumberWithValidations**](NumberWithValidations.md) | | [optional] +**my_number** | [**NumberWithValidations**](NumberWithValidations.md) | | [optional] **my_string** | **str** | | [optional] **my_boolean** | **bool** | | [optional] diff --git a/samples/client/petstore/python-experimental/docs/Order.md b/samples/client/petstore/python-experimental/docs/Order.md index 9569ea55e55c..c21210a3bd59 100644 --- a/samples/client/petstore/python-experimental/docs/Order.md +++ b/samples/client/petstore/python-experimental/docs/Order.md @@ -1,4 +1,4 @@ -# order.Order +# Order ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/python-experimental/docs/Parent.md b/samples/client/petstore/python-experimental/docs/Parent.md index 2437d3c81ac9..f4c237bb9890 100644 --- a/samples/client/petstore/python-experimental/docs/Parent.md +++ b/samples/client/petstore/python-experimental/docs/Parent.md @@ -1,4 +1,4 @@ -# parent.Parent +# Parent ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/python-experimental/docs/ParentAllOf.md b/samples/client/petstore/python-experimental/docs/ParentAllOf.md index 6a27f70d4ad5..c76c615cc355 100644 --- a/samples/client/petstore/python-experimental/docs/ParentAllOf.md +++ b/samples/client/petstore/python-experimental/docs/ParentAllOf.md @@ -1,4 +1,4 @@ -# parent_all_of.ParentAllOf +# ParentAllOf ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/python-experimental/docs/ParentPet.md b/samples/client/petstore/python-experimental/docs/ParentPet.md index 12bfa5c7fe5c..2c9775e7e16b 100644 --- a/samples/client/petstore/python-experimental/docs/ParentPet.md +++ b/samples/client/petstore/python-experimental/docs/ParentPet.md @@ -1,4 +1,4 @@ -# parent_pet.ParentPet +# ParentPet ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/python-experimental/docs/Pet.md b/samples/client/petstore/python-experimental/docs/Pet.md index a1ea5598e861..ce09d401c899 100644 --- a/samples/client/petstore/python-experimental/docs/Pet.md +++ b/samples/client/petstore/python-experimental/docs/Pet.md @@ -1,4 +1,4 @@ -# pet.Pet +# Pet ## Properties Name | Type | Description | Notes @@ -6,8 +6,8 @@ Name | Type | Description | Notes **name** | **str** | | **photo_urls** | **[str]** | | **id** | **int** | | [optional] -**category** | [**category.Category**](Category.md) | | [optional] -**tags** | [**[tag.Tag]**](Tag.md) | | [optional] +**category** | [**Category**](Category.md) | | [optional] +**tags** | [**[Tag]**](Tag.md) | | [optional] **status** | **str** | pet status in the store | [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/client/petstore/python-experimental/docs/PetApi.md b/samples/client/petstore/python-experimental/docs/PetApi.md index 287cbc2f7dc0..642615e5ab29 100644 --- a/samples/client/petstore/python-experimental/docs/PetApi.md +++ b/samples/client/petstore/python-experimental/docs/PetApi.md @@ -27,7 +27,7 @@ Add a new pet to the store import time import petstore_api from petstore_api.api import pet_api -from petstore_api.model import pet +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. @@ -50,7 +50,7 @@ configuration.access_token = 'YOUR_ACCESS_TOKEN' with petstore_api.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = pet_api.PetApi(api_client) - body = pet.Pet() # pet.Pet | Pet object that needs to be added to the store + body = Pet() # Pet | Pet object that needs to be added to the store # example passing only required values which don't have defaults set try: @@ -64,7 +64,7 @@ with petstore_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**pet.Pet**](Pet.md)| Pet object that needs to be added to the store | + **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | ### Return type @@ -169,7 +169,7 @@ void (empty response body) [[Back to top]](#) [[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.Pet] find_pets_by_status(status) +> [Pet] find_pets_by_status(status) Finds Pets by status @@ -182,7 +182,7 @@ Multiple status values can be provided with comma separated strings import time import petstore_api from petstore_api.api import pet_api -from petstore_api.model import pet +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. @@ -224,7 +224,7 @@ Name | Type | Description | Notes ### Return type -[**[pet.Pet]**](Pet.md) +[**[Pet]**](Pet.md) ### Authorization @@ -244,7 +244,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[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.Pet] find_pets_by_tags(tags) +> [Pet] find_pets_by_tags(tags) Finds Pets by tags @@ -257,7 +257,7 @@ Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 import time import petstore_api from petstore_api.api import pet_api -from petstore_api.model import pet +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. @@ -299,7 +299,7 @@ Name | Type | Description | Notes ### Return type -[**[pet.Pet]**](Pet.md) +[**[Pet]**](Pet.md) ### Authorization @@ -319,7 +319,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[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.Pet get_pet_by_id(pet_id) +> Pet get_pet_by_id(pet_id) Find pet by ID @@ -332,7 +332,7 @@ Returns a single pet import time import petstore_api from petstore_api.api import pet_api -from petstore_api.model import pet +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. @@ -378,7 +378,7 @@ Name | Type | Description | Notes ### Return type -[**pet.Pet**](Pet.md) +[**Pet**](Pet.md) ### Authorization @@ -410,7 +410,7 @@ Update an existing pet import time import petstore_api from petstore_api.api import pet_api -from petstore_api.model import pet +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. @@ -433,7 +433,7 @@ configuration.access_token = 'YOUR_ACCESS_TOKEN' with petstore_api.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = pet_api.PetApi(api_client) - body = pet.Pet() # pet.Pet | Pet object that needs to be added to the store + body = Pet() # Pet | Pet object that needs to be added to the store # example passing only required values which don't have defaults set try: @@ -447,7 +447,7 @@ with petstore_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**pet.Pet**](Pet.md)| Pet object that needs to be added to the store | + **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | ### Return type @@ -555,7 +555,7 @@ void (empty response body) [[Back to top]](#) [[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** -> api_response.ApiResponse upload_file(pet_id) +> ApiResponse upload_file(pet_id) uploads an image @@ -566,7 +566,7 @@ uploads an image import time import petstore_api from petstore_api.api import pet_api -from petstore_api.model import api_response +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. @@ -623,7 +623,7 @@ Name | Type | Description | Notes ### Return type -[**api_response.ApiResponse**](ApiResponse.md) +[**ApiResponse**](ApiResponse.md) ### Authorization @@ -642,7 +642,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[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** -> api_response.ApiResponse upload_file_with_required_file(pet_id, required_file) +> ApiResponse upload_file_with_required_file(pet_id, required_file) uploads an image (required) @@ -653,7 +653,7 @@ uploads an image (required) import time import petstore_api from petstore_api.api import pet_api -from petstore_api.model import api_response +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. @@ -708,7 +708,7 @@ Name | Type | Description | Notes ### Return type -[**api_response.ApiResponse**](ApiResponse.md) +[**ApiResponse**](ApiResponse.md) ### Authorization diff --git a/samples/client/petstore/python-experimental/docs/Player.md b/samples/client/petstore/python-experimental/docs/Player.md index 34adf5302a00..17ea34ab2040 100644 --- a/samples/client/petstore/python-experimental/docs/Player.md +++ b/samples/client/petstore/python-experimental/docs/Player.md @@ -1,4 +1,4 @@ -# player.Player +# Player ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/python-experimental/docs/ReadOnlyFirst.md b/samples/client/petstore/python-experimental/docs/ReadOnlyFirst.md index 252641787c3a..6bc1447c1d71 100644 --- a/samples/client/petstore/python-experimental/docs/ReadOnlyFirst.md +++ b/samples/client/petstore/python-experimental/docs/ReadOnlyFirst.md @@ -1,4 +1,4 @@ -# read_only_first.ReadOnlyFirst +# ReadOnlyFirst ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/python-experimental/docs/SpecialModelName.md b/samples/client/petstore/python-experimental/docs/SpecialModelName.md index 312539af45e3..022ee19169ce 100644 --- a/samples/client/petstore/python-experimental/docs/SpecialModelName.md +++ b/samples/client/petstore/python-experimental/docs/SpecialModelName.md @@ -1,4 +1,4 @@ -# special_model_name.SpecialModelName +# SpecialModelName ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/python-experimental/docs/StoreApi.md b/samples/client/petstore/python-experimental/docs/StoreApi.md index 33db4f14ee3c..c2780733ed5f 100644 --- a/samples/client/petstore/python-experimental/docs/StoreApi.md +++ b/samples/client/petstore/python-experimental/docs/StoreApi.md @@ -146,7 +146,7 @@ This endpoint does not need any parameter. [[Back to top]](#) [[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.Order get_order_by_id(order_id) +> Order get_order_by_id(order_id) Find purchase order by ID @@ -158,7 +158,7 @@ For valid response try integer IDs with value <= 5 or > 10. Other values will ge import time import petstore_api from petstore_api.api import store_api -from petstore_api.model import order +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. @@ -190,7 +190,7 @@ Name | Type | Description | Notes ### Return type -[**order.Order**](Order.md) +[**Order**](Order.md) ### Authorization @@ -211,7 +211,7 @@ No authorization required [[Back to top]](#) [[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.Order place_order(body) +> Order place_order(body) Place an order for a pet @@ -221,7 +221,7 @@ Place an order for a pet import time import petstore_api from petstore_api.api import store_api -from petstore_api.model import order +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. @@ -234,7 +234,7 @@ configuration = petstore_api.Configuration( with petstore_api.ApiClient() as api_client: # Create an instance of the API class api_instance = store_api.StoreApi(api_client) - body = order.Order() # order.Order | order placed for purchasing the pet + body = Order() # Order | order placed for purchasing the pet # example passing only required values which don't have defaults set try: @@ -249,11 +249,11 @@ with petstore_api.ApiClient() as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**order.Order**](Order.md)| order placed for purchasing the pet | + **body** | [**Order**](Order.md)| order placed for purchasing the pet | ### Return type -[**order.Order**](Order.md) +[**Order**](Order.md) ### Authorization diff --git a/samples/client/petstore/python-experimental/docs/StringBooleanMap.md b/samples/client/petstore/python-experimental/docs/StringBooleanMap.md index 2eb94fd9a73d..2fbf3b3767d0 100644 --- a/samples/client/petstore/python-experimental/docs/StringBooleanMap.md +++ b/samples/client/petstore/python-experimental/docs/StringBooleanMap.md @@ -1,4 +1,4 @@ -# string_boolean_map.StringBooleanMap +# StringBooleanMap ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/python-experimental/docs/StringEnum.md b/samples/client/petstore/python-experimental/docs/StringEnum.md index 7b720683b6e4..fbedcd04bce9 100644 --- a/samples/client/petstore/python-experimental/docs/StringEnum.md +++ b/samples/client/petstore/python-experimental/docs/StringEnum.md @@ -1,4 +1,4 @@ -# string_enum.StringEnum +# StringEnum ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/python-experimental/docs/Tag.md b/samples/client/petstore/python-experimental/docs/Tag.md index 827e9db83e35..fb8be02da161 100644 --- a/samples/client/petstore/python-experimental/docs/Tag.md +++ b/samples/client/petstore/python-experimental/docs/Tag.md @@ -1,4 +1,4 @@ -# tag.Tag +# Tag ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/python-experimental/docs/TypeHolderDefault.md b/samples/client/petstore/python-experimental/docs/TypeHolderDefault.md index 001509eba5f2..21d125a8e5f4 100644 --- a/samples/client/petstore/python-experimental/docs/TypeHolderDefault.md +++ b/samples/client/petstore/python-experimental/docs/TypeHolderDefault.md @@ -1,4 +1,4 @@ -# type_holder_default.TypeHolderDefault +# TypeHolderDefault a model to test optional properties with server defaults ## Properties diff --git a/samples/client/petstore/python-experimental/docs/TypeHolderExample.md b/samples/client/petstore/python-experimental/docs/TypeHolderExample.md index a681dc9440cd..b74c520d447a 100644 --- a/samples/client/petstore/python-experimental/docs/TypeHolderExample.md +++ b/samples/client/petstore/python-experimental/docs/TypeHolderExample.md @@ -1,4 +1,4 @@ -# type_holder_example.TypeHolderExample +# TypeHolderExample a model to test required properties with an example and length one enum ## Properties diff --git a/samples/client/petstore/python-experimental/docs/User.md b/samples/client/petstore/python-experimental/docs/User.md index 52ff07af2963..443ac123fdca 100644 --- a/samples/client/petstore/python-experimental/docs/User.md +++ b/samples/client/petstore/python-experimental/docs/User.md @@ -1,4 +1,4 @@ -# user.User +# User ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/python-experimental/docs/UserApi.md b/samples/client/petstore/python-experimental/docs/UserApi.md index db41065fafdd..912611a0cd35 100644 --- a/samples/client/petstore/python-experimental/docs/UserApi.md +++ b/samples/client/petstore/python-experimental/docs/UserApi.md @@ -27,7 +27,7 @@ This can only be done by the logged in user. import time import petstore_api from petstore_api.api import user_api -from petstore_api.model import user +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. @@ -40,7 +40,7 @@ configuration = petstore_api.Configuration( with petstore_api.ApiClient() as api_client: # Create an instance of the API class api_instance = user_api.UserApi(api_client) - body = user.User() # user.User | Created user object + body = User() # User | Created user object # example passing only required values which don't have defaults set try: @@ -54,7 +54,7 @@ with petstore_api.ApiClient() as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**user.User**](User.md)| Created user object | + **body** | [**User**](User.md)| Created user object | ### Return type @@ -87,7 +87,7 @@ Creates list of users with given input array import time import petstore_api from petstore_api.api import user_api -from petstore_api.model import user +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. @@ -100,7 +100,7 @@ configuration = petstore_api.Configuration( with petstore_api.ApiClient() as api_client: # Create an instance of the API class api_instance = user_api.UserApi(api_client) - body = [user.User()] # [user.User] | List of user object + body = [User()] # [User] | List of user object # example passing only required values which don't have defaults set try: @@ -114,7 +114,7 @@ with petstore_api.ApiClient() as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**[user.User]**](User.md)| List of user object | + **body** | [**[User]**](User.md)| List of user object | ### Return type @@ -147,7 +147,7 @@ Creates list of users with given input array import time import petstore_api from petstore_api.api import user_api -from petstore_api.model import user +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. @@ -160,7 +160,7 @@ configuration = petstore_api.Configuration( with petstore_api.ApiClient() as api_client: # Create an instance of the API class api_instance = user_api.UserApi(api_client) - body = [user.User()] # [user.User] | List of user object + body = [User()] # [User] | List of user object # example passing only required values which don't have defaults set try: @@ -174,7 +174,7 @@ with petstore_api.ApiClient() as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**[user.User]**](User.md)| List of user object | + **body** | [**[User]**](User.md)| List of user object | ### Return type @@ -259,7 +259,7 @@ No authorization required [[Back to top]](#) [[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.User get_user_by_name(username) +> User get_user_by_name(username) Get user by user name @@ -269,7 +269,7 @@ Get user by user name import time import petstore_api from petstore_api.api import user_api -from petstore_api.model import user +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. @@ -301,7 +301,7 @@ Name | Type | Description | Notes ### Return type -[**user.User**](User.md) +[**User**](User.md) ### Authorization @@ -452,7 +452,7 @@ This can only be done by the logged in user. import time import petstore_api from petstore_api.api import user_api -from petstore_api.model import user +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. @@ -466,7 +466,7 @@ with petstore_api.ApiClient() as api_client: # Create an instance of the API class api_instance = user_api.UserApi(api_client) username = 'username_example' # str | name that need to be deleted - body = user.User() # user.User | Updated user object + body = User() # User | Updated user object # example passing only required values which don't have defaults set try: @@ -481,7 +481,7 @@ with petstore_api.ApiClient() as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **username** | **str**| name that need to be deleted | - **body** | [**user.User**](User.md)| Updated user object | + **body** | [**User**](User.md)| Updated user object | ### Return type diff --git a/samples/client/petstore/python-experimental/docs/XmlItem.md b/samples/client/petstore/python-experimental/docs/XmlItem.md index 0228e238165d..d30ca4362293 100644 --- a/samples/client/petstore/python-experimental/docs/XmlItem.md +++ b/samples/client/petstore/python-experimental/docs/XmlItem.md @@ -1,4 +1,4 @@ -# xml_item.XmlItem +# XmlItem ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/python-experimental/petstore_api/api/another_fake_api.py b/samples/client/petstore/python-experimental/petstore_api/api/another_fake_api.py index 3afdf63dfacd..29cc147fd32d 100644 --- a/samples/client/petstore/python-experimental/petstore_api/api/another_fake_api.py +++ b/samples/client/petstore/python-experimental/petstore_api/api/another_fake_api.py @@ -23,7 +23,7 @@ none_type, validate_and_convert_types ) -from petstore_api.model import client +from petstore_api.model.client import Client class AnotherFakeApi(object): @@ -53,7 +53,7 @@ def __call_123_test_special_tags( >>> result = thread.get() Args: - body (client.Client): client model + body (Client): client model Keyword Args: _return_http_data_only (bool): response data without head status @@ -77,7 +77,7 @@ def __call_123_test_special_tags( async_req (bool): execute request asynchronously Returns: - client.Client + Client If the method is called asynchronously, returns the request thread. """ @@ -106,7 +106,7 @@ def __call_123_test_special_tags( self.call_123_test_special_tags = Endpoint( settings={ - 'response_type': (client.Client,), + 'response_type': (Client,), 'auth': [], 'endpoint_path': '/another-fake/dummy', 'operation_id': 'call_123_test_special_tags', @@ -134,7 +134,7 @@ def __call_123_test_special_tags( }, 'openapi_types': { 'body': - (client.Client,), + (Client,), }, 'attribute_map': { }, diff --git a/samples/client/petstore/python-experimental/petstore_api/api/fake_api.py b/samples/client/petstore/python-experimental/petstore_api/api/fake_api.py index 756329652dda..597af85596c2 100644 --- a/samples/client/petstore/python-experimental/petstore_api/api/fake_api.py +++ b/samples/client/petstore/python-experimental/petstore_api/api/fake_api.py @@ -23,14 +23,14 @@ none_type, validate_and_convert_types ) -from petstore_api.model import animal_farm -from petstore_api.model import xml_item -from petstore_api.model import number_with_validations -from petstore_api.model import object_model_with_ref_props -from petstore_api.model import string_enum -from petstore_api.model import file_schema_test_class -from petstore_api.model import user -from petstore_api.model import client +from petstore_api.model.animal_farm import AnimalFarm +from petstore_api.model.client import Client +from petstore_api.model.file_schema_test_class import FileSchemaTestClass +from petstore_api.model.number_with_validations import NumberWithValidations +from petstore_api.model.object_model_with_ref_props import ObjectModelWithRefProps +from petstore_api.model.string_enum import StringEnum +from petstore_api.model.user import User +from petstore_api.model.xml_item import XmlItem class FakeApi(object): @@ -60,7 +60,7 @@ def __array_model( Keyword Args: - body (animal_farm.AnimalFarm): Input model. [optional] + body (AnimalFarm): Input model. [optional] _return_http_data_only (bool): response data without head status code and headers. Default is True. _preload_content (bool): if False, the urllib3.HTTPResponse object @@ -82,7 +82,7 @@ def __array_model( async_req (bool): execute request asynchronously Returns: - animal_farm.AnimalFarm + AnimalFarm If the method is called asynchronously, returns the request thread. """ @@ -109,7 +109,7 @@ def __array_model( self.array_model = Endpoint( settings={ - 'response_type': (animal_farm.AnimalFarm,), + 'response_type': (AnimalFarm,), 'auth': [], 'endpoint_path': '/fake/refs/arraymodel', 'operation_id': 'array_model', @@ -135,7 +135,7 @@ def __array_model( }, 'openapi_types': { 'body': - (animal_farm.AnimalFarm,), + (AnimalFarm,), }, 'attribute_map': { }, @@ -280,7 +280,7 @@ def __create_xml_item( >>> result = thread.get() Args: - xml_item (xml_item.XmlItem): XmlItem Body + xml_item (XmlItem): XmlItem Body Keyword Args: _return_http_data_only (bool): response data without head status @@ -361,7 +361,7 @@ def __create_xml_item( }, 'openapi_types': { 'xml_item': - (xml_item.XmlItem,), + (XmlItem,), }, 'attribute_map': { }, @@ -401,7 +401,7 @@ def __number_with_validations( Keyword Args: - body (number_with_validations.NumberWithValidations): Input number as post body. [optional] + body (NumberWithValidations): Input number as post body. [optional] _return_http_data_only (bool): response data without head status code and headers. Default is True. _preload_content (bool): if False, the urllib3.HTTPResponse object @@ -423,7 +423,7 @@ def __number_with_validations( async_req (bool): execute request asynchronously Returns: - number_with_validations.NumberWithValidations + NumberWithValidations If the method is called asynchronously, returns the request thread. """ @@ -450,7 +450,7 @@ def __number_with_validations( self.number_with_validations = Endpoint( settings={ - 'response_type': (number_with_validations.NumberWithValidations,), + 'response_type': (NumberWithValidations,), 'auth': [], 'endpoint_path': '/fake/refs/number', 'operation_id': 'number_with_validations', @@ -476,7 +476,7 @@ def __number_with_validations( }, 'openapi_types': { 'body': - (number_with_validations.NumberWithValidations,), + (NumberWithValidations,), }, 'attribute_map': { }, @@ -511,7 +511,7 @@ def __object_model_with_ref_props( Keyword Args: - body (object_model_with_ref_props.ObjectModelWithRefProps): Input model. [optional] + body (ObjectModelWithRefProps): Input model. [optional] _return_http_data_only (bool): response data without head status code and headers. Default is True. _preload_content (bool): if False, the urllib3.HTTPResponse object @@ -533,7 +533,7 @@ def __object_model_with_ref_props( async_req (bool): execute request asynchronously Returns: - object_model_with_ref_props.ObjectModelWithRefProps + ObjectModelWithRefProps If the method is called asynchronously, returns the request thread. """ @@ -560,7 +560,7 @@ def __object_model_with_ref_props( self.object_model_with_ref_props = Endpoint( settings={ - 'response_type': (object_model_with_ref_props.ObjectModelWithRefProps,), + 'response_type': (ObjectModelWithRefProps,), 'auth': [], 'endpoint_path': '/fake/refs/object_model_with_ref_props', 'operation_id': 'object_model_with_ref_props', @@ -586,7 +586,7 @@ def __object_model_with_ref_props( }, 'openapi_types': { 'body': - (object_model_with_ref_props.ObjectModelWithRefProps,), + (ObjectModelWithRefProps,), }, 'attribute_map': { }, @@ -731,7 +731,7 @@ def __string_enum( Keyword Args: - body (string_enum.StringEnum): Input enum. [optional] + body (StringEnum): Input enum. [optional] _return_http_data_only (bool): response data without head status code and headers. Default is True. _preload_content (bool): if False, the urllib3.HTTPResponse object @@ -753,7 +753,7 @@ def __string_enum( async_req (bool): execute request asynchronously Returns: - string_enum.StringEnum + StringEnum If the method is called asynchronously, returns the request thread. """ @@ -780,7 +780,7 @@ def __string_enum( self.string_enum = Endpoint( settings={ - 'response_type': (string_enum.StringEnum,), + 'response_type': (StringEnum,), 'auth': [], 'endpoint_path': '/fake/refs/enum', 'operation_id': 'string_enum', @@ -806,7 +806,7 @@ def __string_enum( }, 'openapi_types': { 'body': - (string_enum.StringEnum,), + (StringEnum,), }, 'attribute_map': { }, @@ -841,7 +841,7 @@ def __test_body_with_file_schema( >>> result = thread.get() Args: - body (file_schema_test_class.FileSchemaTestClass): + body (FileSchemaTestClass): Keyword Args: _return_http_data_only (bool): response data without head status @@ -922,7 +922,7 @@ def __test_body_with_file_schema( }, 'openapi_types': { 'body': - (file_schema_test_class.FileSchemaTestClass,), + (FileSchemaTestClass,), }, 'attribute_map': { }, @@ -958,7 +958,7 @@ def __test_body_with_query_params( Args: query (str): - body (user.User): + body (User): Keyword Args: _return_http_data_only (bool): response data without head status @@ -1045,7 +1045,7 @@ def __test_body_with_query_params( 'query': (str,), 'body': - (user.User,), + (User,), }, 'attribute_map': { 'query': 'query', @@ -1082,7 +1082,7 @@ def __test_client_model( >>> result = thread.get() Args: - body (client.Client): client model + body (Client): client model Keyword Args: _return_http_data_only (bool): response data without head status @@ -1106,7 +1106,7 @@ def __test_client_model( async_req (bool): execute request asynchronously Returns: - client.Client + Client If the method is called asynchronously, returns the request thread. """ @@ -1135,7 +1135,7 @@ def __test_client_model( self.test_client_model = Endpoint( settings={ - 'response_type': (client.Client,), + 'response_type': (Client,), 'auth': [], 'endpoint_path': '/fake', 'operation_id': 'test_client_model', @@ -1163,7 +1163,7 @@ def __test_client_model( }, 'openapi_types': { 'body': - (client.Client,), + (Client,), }, 'attribute_map': { }, diff --git a/samples/client/petstore/python-experimental/petstore_api/api/fake_classname_tags_123_api.py b/samples/client/petstore/python-experimental/petstore_api/api/fake_classname_tags_123_api.py index c069a60b04f3..634f9f13103a 100644 --- a/samples/client/petstore/python-experimental/petstore_api/api/fake_classname_tags_123_api.py +++ b/samples/client/petstore/python-experimental/petstore_api/api/fake_classname_tags_123_api.py @@ -23,7 +23,7 @@ none_type, validate_and_convert_types ) -from petstore_api.model import client +from petstore_api.model.client import Client class FakeClassnameTags123Api(object): @@ -53,7 +53,7 @@ def __test_classname( >>> result = thread.get() Args: - body (client.Client): client model + body (Client): client model Keyword Args: _return_http_data_only (bool): response data without head status @@ -77,7 +77,7 @@ def __test_classname( async_req (bool): execute request asynchronously Returns: - client.Client + Client If the method is called asynchronously, returns the request thread. """ @@ -106,7 +106,7 @@ def __test_classname( self.test_classname = Endpoint( settings={ - 'response_type': (client.Client,), + 'response_type': (Client,), 'auth': [ 'api_key_query' ], @@ -136,7 +136,7 @@ def __test_classname( }, 'openapi_types': { 'body': - (client.Client,), + (Client,), }, 'attribute_map': { }, diff --git a/samples/client/petstore/python-experimental/petstore_api/api/pet_api.py b/samples/client/petstore/python-experimental/petstore_api/api/pet_api.py index 4ae5987ba009..66611a73f3ca 100644 --- a/samples/client/petstore/python-experimental/petstore_api/api/pet_api.py +++ b/samples/client/petstore/python-experimental/petstore_api/api/pet_api.py @@ -23,8 +23,8 @@ none_type, validate_and_convert_types ) -from petstore_api.model import pet -from petstore_api.model import api_response +from petstore_api.model.api_response import ApiResponse +from petstore_api.model.pet import Pet class PetApi(object): @@ -53,7 +53,7 @@ def __add_pet( >>> result = thread.get() Args: - body (pet.Pet): Pet object that needs to be added to the store + body (Pet): Pet object that needs to be added to the store Keyword Args: _return_http_data_only (bool): response data without head status @@ -136,7 +136,7 @@ def __add_pet( }, 'openapi_types': { 'body': - (pet.Pet,), + (Pet,), }, 'attribute_map': { }, @@ -318,7 +318,7 @@ def __find_pets_by_status( async_req (bool): execute request asynchronously Returns: - [pet.Pet] + [Pet] If the method is called asynchronously, returns the request thread. """ @@ -347,7 +347,7 @@ def __find_pets_by_status( self.find_pets_by_status = Endpoint( settings={ - 'response_type': ([pet.Pet],), + 'response_type': ([Pet],), 'auth': [ 'petstore_auth' ], @@ -446,7 +446,7 @@ def __find_pets_by_tags( async_req (bool): execute request asynchronously Returns: - [pet.Pet] + [Pet] If the method is called asynchronously, returns the request thread. """ @@ -475,7 +475,7 @@ def __find_pets_by_tags( self.find_pets_by_tags = Endpoint( settings={ - 'response_type': ([pet.Pet],), + 'response_type': ([Pet],), 'auth': [ 'petstore_auth' ], @@ -567,7 +567,7 @@ def __get_pet_by_id( async_req (bool): execute request asynchronously Returns: - pet.Pet + Pet If the method is called asynchronously, returns the request thread. """ @@ -596,7 +596,7 @@ def __get_pet_by_id( self.get_pet_by_id = Endpoint( settings={ - 'response_type': (pet.Pet,), + 'response_type': (Pet,), 'auth': [ 'api_key' ], @@ -662,7 +662,7 @@ def __update_pet( >>> result = thread.get() Args: - body (pet.Pet): Pet object that needs to be added to the store + body (Pet): Pet object that needs to be added to the store Keyword Args: _return_http_data_only (bool): response data without head status @@ -745,7 +745,7 @@ def __update_pet( }, 'openapi_types': { 'body': - (pet.Pet,), + (Pet,), }, 'attribute_map': { }, @@ -937,7 +937,7 @@ def __upload_file( async_req (bool): execute request asynchronously Returns: - api_response.ApiResponse + ApiResponse If the method is called asynchronously, returns the request thread. """ @@ -966,7 +966,7 @@ def __upload_file( self.upload_file = Endpoint( settings={ - 'response_type': (api_response.ApiResponse,), + 'response_type': (ApiResponse,), 'auth': [ 'petstore_auth' ], @@ -1076,7 +1076,7 @@ def __upload_file_with_required_file( async_req (bool): execute request asynchronously Returns: - api_response.ApiResponse + ApiResponse If the method is called asynchronously, returns the request thread. """ @@ -1107,7 +1107,7 @@ def __upload_file_with_required_file( self.upload_file_with_required_file = Endpoint( settings={ - 'response_type': (api_response.ApiResponse,), + 'response_type': (ApiResponse,), 'auth': [ 'petstore_auth' ], diff --git a/samples/client/petstore/python-experimental/petstore_api/api/store_api.py b/samples/client/petstore/python-experimental/petstore_api/api/store_api.py index cc86ddc91c33..7e6b6cba1c8c 100644 --- a/samples/client/petstore/python-experimental/petstore_api/api/store_api.py +++ b/samples/client/petstore/python-experimental/petstore_api/api/store_api.py @@ -23,7 +23,7 @@ none_type, validate_and_convert_types ) -from petstore_api.model import order +from petstore_api.model.order import Order class StoreApi(object): @@ -299,7 +299,7 @@ def __get_order_by_id( async_req (bool): execute request asynchronously Returns: - order.Order + Order If the method is called asynchronously, returns the request thread. """ @@ -328,7 +328,7 @@ def __get_order_by_id( self.get_order_by_id = Endpoint( settings={ - 'response_type': (order.Order,), + 'response_type': (Order,), 'auth': [], 'endpoint_path': '/store/order/{order_id}', 'operation_id': 'get_order_by_id', @@ -398,7 +398,7 @@ def __place_order( >>> result = thread.get() Args: - body (order.Order): order placed for purchasing the pet + body (Order): order placed for purchasing the pet Keyword Args: _return_http_data_only (bool): response data without head status @@ -422,7 +422,7 @@ def __place_order( async_req (bool): execute request asynchronously Returns: - order.Order + Order If the method is called asynchronously, returns the request thread. """ @@ -451,7 +451,7 @@ def __place_order( self.place_order = Endpoint( settings={ - 'response_type': (order.Order,), + 'response_type': (Order,), 'auth': [], 'endpoint_path': '/store/order', 'operation_id': 'place_order', @@ -479,7 +479,7 @@ def __place_order( }, 'openapi_types': { 'body': - (order.Order,), + (Order,), }, 'attribute_map': { }, diff --git a/samples/client/petstore/python-experimental/petstore_api/api/user_api.py b/samples/client/petstore/python-experimental/petstore_api/api/user_api.py index 51d595d3f39e..92dae02b424f 100644 --- a/samples/client/petstore/python-experimental/petstore_api/api/user_api.py +++ b/samples/client/petstore/python-experimental/petstore_api/api/user_api.py @@ -23,7 +23,7 @@ none_type, validate_and_convert_types ) -from petstore_api.model import user +from petstore_api.model.user import User class UserApi(object): @@ -53,7 +53,7 @@ def __create_user( >>> result = thread.get() Args: - body (user.User): Created user object + body (User): Created user object Keyword Args: _return_http_data_only (bool): response data without head status @@ -134,7 +134,7 @@ def __create_user( }, 'openapi_types': { 'body': - (user.User,), + (User,), }, 'attribute_map': { }, @@ -166,7 +166,7 @@ def __create_users_with_array_input( >>> result = thread.get() Args: - body ([user.User]): List of user object + body ([User]): List of user object Keyword Args: _return_http_data_only (bool): response data without head status @@ -247,7 +247,7 @@ def __create_users_with_array_input( }, 'openapi_types': { 'body': - ([user.User],), + ([User],), }, 'attribute_map': { }, @@ -279,7 +279,7 @@ def __create_users_with_list_input( >>> result = thread.get() Args: - body ([user.User]): List of user object + body ([User]): List of user object Keyword Args: _return_http_data_only (bool): response data without head status @@ -360,7 +360,7 @@ def __create_users_with_list_input( }, 'openapi_types': { 'body': - ([user.User],), + ([User],), }, 'attribute_map': { }, @@ -531,7 +531,7 @@ def __get_user_by_name( async_req (bool): execute request asynchronously Returns: - user.User + User If the method is called asynchronously, returns the request thread. """ @@ -560,7 +560,7 @@ def __get_user_by_name( self.get_user_by_name = Endpoint( settings={ - 'response_type': (user.User,), + 'response_type': (User,), 'auth': [], 'endpoint_path': '/user/{username}', 'operation_id': 'get_user_by_name', @@ -856,7 +856,7 @@ def __update_user( Args: username (str): name that need to be deleted - body (user.User): Updated user object + body (User): Updated user object Keyword Args: _return_http_data_only (bool): response data without head status @@ -943,7 +943,7 @@ def __update_user( 'username': (str,), 'body': - (user.User,), + (User,), }, 'attribute_map': { 'username': 'username', diff --git a/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_any_type.py b/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_any_type.py index ff57e565fa8c..b1f844846c76 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_any_type.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_any_type.py @@ -61,15 +61,21 @@ class AdditionalPropertiesAnyType(ModelNormal): validations = { } - additional_properties_type = (bool, date, datetime, dict, float, int, list, str,) # noqa: E501 + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str,) # noqa: E501 _nullable = False @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -83,6 +89,7 @@ def openapi_types(): def discriminator(): return None + attribute_map = { 'name': 'name', # noqa: E501 } @@ -100,7 +107,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """additional_properties_any_type.AdditionalPropertiesAnyType - a model defined in OpenAPI + """AdditionalPropertiesAnyType - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_array.py b/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_array.py index c42ce98aeeb2..ca203ae6269f 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_array.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_array.py @@ -61,15 +61,21 @@ class AdditionalPropertiesArray(ModelNormal): validations = { } - additional_properties_type = ([bool, date, datetime, dict, float, int, list, str],) # noqa: E501 + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ([bool, date, datetime, dict, float, int, list, str],) # noqa: E501 _nullable = False @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -83,6 +89,7 @@ def openapi_types(): def discriminator(): return None + attribute_map = { 'name': 'name', # noqa: E501 } @@ -100,7 +107,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """additional_properties_array.AdditionalPropertiesArray - a model defined in OpenAPI + """AdditionalPropertiesArray - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_boolean.py b/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_boolean.py index ff1f44523bd2..c5d5aadbc25d 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_boolean.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_boolean.py @@ -61,15 +61,21 @@ class AdditionalPropertiesBoolean(ModelNormal): validations = { } - additional_properties_type = (bool,) # noqa: E501 + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool,) # noqa: E501 _nullable = False @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -83,6 +89,7 @@ def openapi_types(): def discriminator(): return None + attribute_map = { 'name': 'name', # noqa: E501 } @@ -100,7 +107,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """additional_properties_boolean.AdditionalPropertiesBoolean - a model defined in OpenAPI + """AdditionalPropertiesBoolean - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_class.py b/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_class.py index c52c9dd3b83b..029cdcbb05f9 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_class.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_class.py @@ -68,8 +68,8 @@ class AdditionalPropertiesClass(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -93,6 +93,7 @@ def openapi_types(): def discriminator(): return None + attribute_map = { 'map_string': 'map_string', # noqa: E501 'map_number': 'map_number', # noqa: E501 @@ -120,7 +121,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """additional_properties_class.AdditionalPropertiesClass - a model defined in OpenAPI + """AdditionalPropertiesClass - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_integer.py b/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_integer.py index 31ab33a95b1f..e5e6fbd3f5b6 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_integer.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_integer.py @@ -61,15 +61,21 @@ class AdditionalPropertiesInteger(ModelNormal): validations = { } - additional_properties_type = (int,) # noqa: E501 + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (int,) # noqa: E501 _nullable = False @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -83,6 +89,7 @@ def openapi_types(): def discriminator(): return None + attribute_map = { 'name': 'name', # noqa: E501 } @@ -100,7 +107,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """additional_properties_integer.AdditionalPropertiesInteger - a model defined in OpenAPI + """AdditionalPropertiesInteger - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_number.py b/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_number.py index 8f8f580c7aa9..96e734260961 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_number.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_number.py @@ -61,15 +61,21 @@ class AdditionalPropertiesNumber(ModelNormal): validations = { } - additional_properties_type = (float,) # noqa: E501 + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (float,) # noqa: E501 _nullable = False @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -83,6 +89,7 @@ def openapi_types(): def discriminator(): return None + attribute_map = { 'name': 'name', # noqa: E501 } @@ -100,7 +107,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """additional_properties_number.AdditionalPropertiesNumber - a model defined in OpenAPI + """AdditionalPropertiesNumber - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_object.py b/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_object.py index 954b6b965787..e07853f983b3 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_object.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_object.py @@ -61,15 +61,21 @@ class AdditionalPropertiesObject(ModelNormal): validations = { } - additional_properties_type = ({str: (bool, date, datetime, dict, float, int, list, str,)},) # noqa: E501 + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ({str: (bool, date, datetime, dict, float, int, list, str,)},) # noqa: E501 _nullable = False @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -83,6 +89,7 @@ def openapi_types(): def discriminator(): return None + attribute_map = { 'name': 'name', # noqa: E501 } @@ -100,7 +107,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """additional_properties_object.AdditionalPropertiesObject - a model defined in OpenAPI + """AdditionalPropertiesObject - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_string.py b/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_string.py index 65a671990307..963b28c22801 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_string.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_string.py @@ -61,15 +61,21 @@ class AdditionalPropertiesString(ModelNormal): validations = { } - additional_properties_type = (str,) # noqa: E501 + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (str,) # noqa: E501 _nullable = False @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -83,6 +89,7 @@ def openapi_types(): def discriminator(): return None + attribute_map = { 'name': 'name', # noqa: E501 } @@ -100,7 +107,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """additional_properties_string.AdditionalPropertiesString - a model defined in OpenAPI + """AdditionalPropertiesString - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/client/petstore/python-experimental/petstore_api/model/animal.py b/samples/client/petstore/python-experimental/petstore_api/model/animal.py index 7f1257e2ab4f..39aaa93227c7 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/animal.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/animal.py @@ -29,16 +29,12 @@ none_type, validate_get_composed_info, ) -try: - from petstore_api.model import cat -except ImportError: - cat = sys.modules[ - 'petstore_api.model.cat'] -try: - from petstore_api.model import dog -except ImportError: - dog = sys.modules[ - 'petstore_api.model.dog'] + +def lazy_import(): + from petstore_api.model.cat import Cat + from petstore_api.model.dog import Dog + globals()['Cat'] = Cat + globals()['Dog'] = Dog class Animal(ModelNormal): @@ -78,13 +74,14 @@ class Animal(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name and the value is attribute type. """ + lazy_import() return { 'class_name': (str,), # noqa: E501 'color': (str,), # noqa: E501 @@ -92,9 +89,10 @@ def openapi_types(): @cached_property def discriminator(): + lazy_import() val = { - 'Cat': cat.Cat, - 'Dog': dog.Dog, + 'Cat': Cat, + 'Dog': Dog, } if not val: return None @@ -118,7 +116,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, class_name, *args, **kwargs): # noqa: E501 - """animal.Animal - a model defined in OpenAPI + """Animal - a model defined in OpenAPI Args: class_name (str): diff --git a/samples/client/petstore/python-experimental/petstore_api/model/animal_farm.py b/samples/client/petstore/python-experimental/petstore_api/model/animal_farm.py index 94d6d094d68d..dc35f9394e1c 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/animal_farm.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/animal_farm.py @@ -29,11 +29,10 @@ none_type, validate_get_composed_info, ) -try: - from petstore_api.model import animal -except ImportError: - animal = sys.modules[ - 'petstore_api.model.animal'] + +def lazy_import(): + from petstore_api.model.animal import Animal + globals()['Animal'] = Animal class AnimalFarm(ModelSimple): @@ -69,21 +68,23 @@ class AnimalFarm(ModelSimple): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name and the value is attribute type. """ + lazy_import() return { - 'value': ([animal.Animal],), + 'value': ([Animal],), } @cached_property def discriminator(): return None + attribute_map = {} _composed_schemas = None @@ -99,10 +100,10 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, value, *args, **kwargs): - """animal_farm.AnimalFarm - a model defined in OpenAPI + """AnimalFarm - a model defined in OpenAPI Args: - value ([animal.Animal]): # noqa: E501 + value ([Animal]): # noqa: E501 Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/client/petstore/python-experimental/petstore_api/model/api_response.py b/samples/client/petstore/python-experimental/petstore_api/model/api_response.py index 24a2e3d897a6..bce1291d1f65 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/api_response.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/api_response.py @@ -68,8 +68,8 @@ class ApiResponse(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -85,6 +85,7 @@ def openapi_types(): def discriminator(): return None + attribute_map = { 'code': 'code', # noqa: E501 'type': 'type', # noqa: E501 @@ -104,7 +105,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """api_response.ApiResponse - a model defined in OpenAPI + """ApiResponse - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/client/petstore/python-experimental/petstore_api/model/array_of_array_of_number_only.py b/samples/client/petstore/python-experimental/petstore_api/model/array_of_array_of_number_only.py index 014740ca0a6f..7c7c2743398f 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/array_of_array_of_number_only.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/array_of_array_of_number_only.py @@ -68,8 +68,8 @@ class ArrayOfArrayOfNumberOnly(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -83,6 +83,7 @@ def openapi_types(): def discriminator(): return None + attribute_map = { 'array_array_number': 'ArrayArrayNumber', # noqa: E501 } @@ -100,7 +101,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """array_of_array_of_number_only.ArrayOfArrayOfNumberOnly - a model defined in OpenAPI + """ArrayOfArrayOfNumberOnly - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/client/petstore/python-experimental/petstore_api/model/array_of_number_only.py b/samples/client/petstore/python-experimental/petstore_api/model/array_of_number_only.py index 00afce1fb4a1..4947154bb6ea 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/array_of_number_only.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/array_of_number_only.py @@ -68,8 +68,8 @@ class ArrayOfNumberOnly(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -83,6 +83,7 @@ def openapi_types(): def discriminator(): return None + attribute_map = { 'array_number': 'ArrayNumber', # noqa: E501 } @@ -100,7 +101,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """array_of_number_only.ArrayOfNumberOnly - a model defined in OpenAPI + """ArrayOfNumberOnly - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/client/petstore/python-experimental/petstore_api/model/array_test.py b/samples/client/petstore/python-experimental/petstore_api/model/array_test.py index e4478c5acdc8..7b4d47ace893 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/array_test.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/array_test.py @@ -29,11 +29,10 @@ none_type, validate_get_composed_info, ) -try: - from petstore_api.model import read_only_first -except ImportError: - read_only_first = sys.modules[ - 'petstore_api.model.read_only_first'] + +def lazy_import(): + from petstore_api.model.read_only_first import ReadOnlyFirst + globals()['ReadOnlyFirst'] = ReadOnlyFirst class ArrayTest(ModelNormal): @@ -73,23 +72,25 @@ class ArrayTest(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name and the value is attribute type. """ + lazy_import() return { 'array_of_string': ([str],), # noqa: E501 'array_array_of_integer': ([[int]],), # noqa: E501 - 'array_array_of_model': ([[read_only_first.ReadOnlyFirst]],), # noqa: E501 + 'array_array_of_model': ([[ReadOnlyFirst]],), # noqa: E501 } @cached_property def discriminator(): return None + attribute_map = { 'array_of_string': 'array_of_string', # noqa: E501 'array_array_of_integer': 'array_array_of_integer', # noqa: E501 @@ -109,7 +110,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """array_test.ArrayTest - a model defined in OpenAPI + """ArrayTest - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types @@ -144,7 +145,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 _visited_composed_classes = (Animal,) array_of_string ([str]): [optional] # noqa: E501 array_array_of_integer ([[int]]): [optional] # noqa: E501 - array_array_of_model ([[read_only_first.ReadOnlyFirst]]): [optional] # noqa: E501 + array_array_of_model ([[ReadOnlyFirst]]): [optional] # noqa: E501 """ _check_type = kwargs.pop('_check_type', True) diff --git a/samples/client/petstore/python-experimental/petstore_api/model/capitalization.py b/samples/client/petstore/python-experimental/petstore_api/model/capitalization.py index 18c5f54c06fe..3e0068ed6834 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/capitalization.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/capitalization.py @@ -68,8 +68,8 @@ class Capitalization(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -88,6 +88,7 @@ def openapi_types(): def discriminator(): return None + attribute_map = { 'small_camel': 'smallCamel', # noqa: E501 'capital_camel': 'CapitalCamel', # noqa: E501 @@ -110,7 +111,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """capitalization.Capitalization - a model defined in OpenAPI + """Capitalization - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/client/petstore/python-experimental/petstore_api/model/cat.py b/samples/client/petstore/python-experimental/petstore_api/model/cat.py index 335b05559d1d..7b34989c8c11 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/cat.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/cat.py @@ -29,16 +29,12 @@ none_type, validate_get_composed_info, ) -try: - from petstore_api.model import animal -except ImportError: - animal = sys.modules[ - 'petstore_api.model.animal'] -try: - from petstore_api.model import cat_all_of -except ImportError: - cat_all_of = sys.modules[ - 'petstore_api.model.cat_all_of'] + +def lazy_import(): + from petstore_api.model.animal import Animal + from petstore_api.model.cat_all_of import CatAllOf + globals()['Animal'] = Animal + globals()['CatAllOf'] = CatAllOf class Cat(ModelComposed): @@ -78,13 +74,14 @@ class Cat(ModelComposed): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name and the value is attribute type. """ + lazy_import() return { 'class_name': (str,), # noqa: E501 'declawed': (bool,), # noqa: E501 @@ -119,7 +116,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, class_name, *args, **kwargs): # noqa: E501 - """cat.Cat - a model defined in OpenAPI + """Cat - a model defined in OpenAPI Args: class_name (str): @@ -227,12 +224,13 @@ def _composed_schemas(): # code would be run when this module is imported, and these composed # classes don't exist yet because their module has not finished # loading + lazy_import() return { 'anyOf': [ ], 'allOf': [ - animal.Animal, - cat_all_of.CatAllOf, + Animal, + CatAllOf, ], 'oneOf': [ ], diff --git a/samples/client/petstore/python-experimental/petstore_api/model/cat_all_of.py b/samples/client/petstore/python-experimental/petstore_api/model/cat_all_of.py index c257813c1206..dadc71475721 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/cat_all_of.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/cat_all_of.py @@ -68,8 +68,8 @@ class CatAllOf(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -83,6 +83,7 @@ def openapi_types(): def discriminator(): return None + attribute_map = { 'declawed': 'declawed', # noqa: E501 } @@ -100,7 +101,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """cat_all_of.CatAllOf - a model defined in OpenAPI + """CatAllOf - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/client/petstore/python-experimental/petstore_api/model/category.py b/samples/client/petstore/python-experimental/petstore_api/model/category.py index e2be1802b1d5..a5af94f90ce2 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/category.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/category.py @@ -68,8 +68,8 @@ class Category(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -84,6 +84,7 @@ def openapi_types(): def discriminator(): return None + attribute_map = { 'name': 'name', # noqa: E501 'id': 'id', # noqa: E501 @@ -102,7 +103,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """category.Category - a model defined in OpenAPI + """Category - a model defined in OpenAPI Args: diff --git a/samples/client/petstore/python-experimental/petstore_api/model/child.py b/samples/client/petstore/python-experimental/petstore_api/model/child.py index 03b1839ccca7..c2280abb12fd 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/child.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/child.py @@ -29,16 +29,12 @@ none_type, validate_get_composed_info, ) -try: - from petstore_api.model import child_all_of -except ImportError: - child_all_of = sys.modules[ - 'petstore_api.model.child_all_of'] -try: - from petstore_api.model import parent -except ImportError: - parent = sys.modules[ - 'petstore_api.model.parent'] + +def lazy_import(): + from petstore_api.model.child_all_of import ChildAllOf + from petstore_api.model.parent import Parent + globals()['ChildAllOf'] = ChildAllOf + globals()['Parent'] = Parent class Child(ModelComposed): @@ -78,13 +74,14 @@ class Child(ModelComposed): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name and the value is attribute type. """ + lazy_import() return { 'radio_waves': (bool,), # noqa: E501 'tele_vision': (bool,), # noqa: E501 @@ -95,6 +92,7 @@ def openapi_types(): def discriminator(): return None + attribute_map = { 'radio_waves': 'radioWaves', # noqa: E501 'tele_vision': 'teleVision', # noqa: E501 @@ -115,7 +113,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """child.Child - a model defined in OpenAPI + """Child - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types @@ -220,12 +218,13 @@ def _composed_schemas(): # code would be run when this module is imported, and these composed # classes don't exist yet because their module has not finished # loading + lazy_import() return { 'anyOf': [ ], 'allOf': [ - child_all_of.ChildAllOf, - parent.Parent, + ChildAllOf, + Parent, ], 'oneOf': [ ], diff --git a/samples/client/petstore/python-experimental/petstore_api/model/child_all_of.py b/samples/client/petstore/python-experimental/petstore_api/model/child_all_of.py index 0aaf9f258b45..8a3f615d3c2b 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/child_all_of.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/child_all_of.py @@ -68,8 +68,8 @@ class ChildAllOf(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -83,6 +83,7 @@ def openapi_types(): def discriminator(): return None + attribute_map = { 'inter_net': 'interNet', # noqa: E501 } @@ -100,7 +101,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """child_all_of.ChildAllOf - a model defined in OpenAPI + """ChildAllOf - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/client/petstore/python-experimental/petstore_api/model/child_cat.py b/samples/client/petstore/python-experimental/petstore_api/model/child_cat.py index 998f062d677d..e608bb0fb478 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/child_cat.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/child_cat.py @@ -29,16 +29,12 @@ none_type, validate_get_composed_info, ) -try: - from petstore_api.model import child_cat_all_of -except ImportError: - child_cat_all_of = sys.modules[ - 'petstore_api.model.child_cat_all_of'] -try: - from petstore_api.model import parent_pet -except ImportError: - parent_pet = sys.modules[ - 'petstore_api.model.parent_pet'] + +def lazy_import(): + from petstore_api.model.child_cat_all_of import ChildCatAllOf + from petstore_api.model.parent_pet import ParentPet + globals()['ChildCatAllOf'] = ChildCatAllOf + globals()['ParentPet'] = ParentPet class ChildCat(ModelComposed): @@ -78,13 +74,14 @@ class ChildCat(ModelComposed): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name and the value is attribute type. """ + lazy_import() return { 'pet_type': (str,), # noqa: E501 'name': (str,), # noqa: E501 @@ -117,7 +114,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, pet_type, *args, **kwargs): # noqa: E501 - """child_cat.ChildCat - a model defined in OpenAPI + """ChildCat - a model defined in OpenAPI Args: pet_type (str): @@ -224,12 +221,13 @@ def _composed_schemas(): # code would be run when this module is imported, and these composed # classes don't exist yet because their module has not finished # loading + lazy_import() return { 'anyOf': [ ], 'allOf': [ - child_cat_all_of.ChildCatAllOf, - parent_pet.ParentPet, + ChildCatAllOf, + ParentPet, ], 'oneOf': [ ], diff --git a/samples/client/petstore/python-experimental/petstore_api/model/child_cat_all_of.py b/samples/client/petstore/python-experimental/petstore_api/model/child_cat_all_of.py index cc67b70c8748..d9c453ba4d67 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/child_cat_all_of.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/child_cat_all_of.py @@ -68,8 +68,8 @@ class ChildCatAllOf(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -83,6 +83,7 @@ def openapi_types(): def discriminator(): return None + attribute_map = { 'name': 'name', # noqa: E501 } @@ -100,7 +101,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """child_cat_all_of.ChildCatAllOf - a model defined in OpenAPI + """ChildCatAllOf - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/client/petstore/python-experimental/petstore_api/model/child_dog.py b/samples/client/petstore/python-experimental/petstore_api/model/child_dog.py index 4fea9fbfe0df..e1847bccd351 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/child_dog.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/child_dog.py @@ -29,16 +29,12 @@ none_type, validate_get_composed_info, ) -try: - from petstore_api.model import child_dog_all_of -except ImportError: - child_dog_all_of = sys.modules[ - 'petstore_api.model.child_dog_all_of'] -try: - from petstore_api.model import parent_pet -except ImportError: - parent_pet = sys.modules[ - 'petstore_api.model.parent_pet'] + +def lazy_import(): + from petstore_api.model.child_dog_all_of import ChildDogAllOf + from petstore_api.model.parent_pet import ParentPet + globals()['ChildDogAllOf'] = ChildDogAllOf + globals()['ParentPet'] = ParentPet class ChildDog(ModelComposed): @@ -78,13 +74,14 @@ class ChildDog(ModelComposed): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name and the value is attribute type. """ + lazy_import() return { 'pet_type': (str,), # noqa: E501 'bark': (str,), # noqa: E501 @@ -117,7 +114,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, pet_type, *args, **kwargs): # noqa: E501 - """child_dog.ChildDog - a model defined in OpenAPI + """ChildDog - a model defined in OpenAPI Args: pet_type (str): @@ -224,12 +221,13 @@ def _composed_schemas(): # code would be run when this module is imported, and these composed # classes don't exist yet because their module has not finished # loading + lazy_import() return { 'anyOf': [ ], 'allOf': [ - child_dog_all_of.ChildDogAllOf, - parent_pet.ParentPet, + ChildDogAllOf, + ParentPet, ], 'oneOf': [ ], diff --git a/samples/client/petstore/python-experimental/petstore_api/model/child_dog_all_of.py b/samples/client/petstore/python-experimental/petstore_api/model/child_dog_all_of.py index 6e3e49d360ac..b4e625e874f6 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/child_dog_all_of.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/child_dog_all_of.py @@ -68,8 +68,8 @@ class ChildDogAllOf(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -83,6 +83,7 @@ def openapi_types(): def discriminator(): return None + attribute_map = { 'bark': 'bark', # noqa: E501 } @@ -100,7 +101,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """child_dog_all_of.ChildDogAllOf - a model defined in OpenAPI + """ChildDogAllOf - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/client/petstore/python-experimental/petstore_api/model/child_lizard.py b/samples/client/petstore/python-experimental/petstore_api/model/child_lizard.py index 741ef17af1a6..cfae6eaf04b3 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/child_lizard.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/child_lizard.py @@ -29,16 +29,12 @@ none_type, validate_get_composed_info, ) -try: - from petstore_api.model import child_lizard_all_of -except ImportError: - child_lizard_all_of = sys.modules[ - 'petstore_api.model.child_lizard_all_of'] -try: - from petstore_api.model import parent_pet -except ImportError: - parent_pet = sys.modules[ - 'petstore_api.model.parent_pet'] + +def lazy_import(): + from petstore_api.model.child_lizard_all_of import ChildLizardAllOf + from petstore_api.model.parent_pet import ParentPet + globals()['ChildLizardAllOf'] = ChildLizardAllOf + globals()['ParentPet'] = ParentPet class ChildLizard(ModelComposed): @@ -78,13 +74,14 @@ class ChildLizard(ModelComposed): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name and the value is attribute type. """ + lazy_import() return { 'pet_type': (str,), # noqa: E501 'loves_rocks': (bool,), # noqa: E501 @@ -117,7 +114,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, pet_type, *args, **kwargs): # noqa: E501 - """child_lizard.ChildLizard - a model defined in OpenAPI + """ChildLizard - a model defined in OpenAPI Args: pet_type (str): @@ -224,12 +221,13 @@ def _composed_schemas(): # code would be run when this module is imported, and these composed # classes don't exist yet because their module has not finished # loading + lazy_import() return { 'anyOf': [ ], 'allOf': [ - child_lizard_all_of.ChildLizardAllOf, - parent_pet.ParentPet, + ChildLizardAllOf, + ParentPet, ], 'oneOf': [ ], diff --git a/samples/client/petstore/python-experimental/petstore_api/model/child_lizard_all_of.py b/samples/client/petstore/python-experimental/petstore_api/model/child_lizard_all_of.py index 31976b59fac4..3dafa3318008 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/child_lizard_all_of.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/child_lizard_all_of.py @@ -68,8 +68,8 @@ class ChildLizardAllOf(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -83,6 +83,7 @@ def openapi_types(): def discriminator(): return None + attribute_map = { 'loves_rocks': 'lovesRocks', # noqa: E501 } @@ -100,7 +101,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """child_lizard_all_of.ChildLizardAllOf - a model defined in OpenAPI + """ChildLizardAllOf - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/client/petstore/python-experimental/petstore_api/model/class_model.py b/samples/client/petstore/python-experimental/petstore_api/model/class_model.py index d80e4ef3671f..a1d4959a985e 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/class_model.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/class_model.py @@ -68,8 +68,8 @@ class ClassModel(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -83,6 +83,7 @@ def openapi_types(): def discriminator(): return None + attribute_map = { '_class': '_class', # noqa: E501 } @@ -100,7 +101,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """class_model.ClassModel - a model defined in OpenAPI + """ClassModel - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/client/petstore/python-experimental/petstore_api/model/client.py b/samples/client/petstore/python-experimental/petstore_api/model/client.py index 2ea3b4aadd4a..114dab427f4f 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/client.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/client.py @@ -68,8 +68,8 @@ class Client(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -83,6 +83,7 @@ def openapi_types(): def discriminator(): return None + attribute_map = { 'client': 'client', # noqa: E501 } @@ -100,7 +101,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """client.Client - a model defined in OpenAPI + """Client - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/client/petstore/python-experimental/petstore_api/model/dog.py b/samples/client/petstore/python-experimental/petstore_api/model/dog.py index 02d6f0344396..24f8a468895b 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/dog.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/dog.py @@ -29,16 +29,12 @@ none_type, validate_get_composed_info, ) -try: - from petstore_api.model import animal -except ImportError: - animal = sys.modules[ - 'petstore_api.model.animal'] -try: - from petstore_api.model import dog_all_of -except ImportError: - dog_all_of = sys.modules[ - 'petstore_api.model.dog_all_of'] + +def lazy_import(): + from petstore_api.model.animal import Animal + from petstore_api.model.dog_all_of import DogAllOf + globals()['Animal'] = Animal + globals()['DogAllOf'] = DogAllOf class Dog(ModelComposed): @@ -78,13 +74,14 @@ class Dog(ModelComposed): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name and the value is attribute type. """ + lazy_import() return { 'class_name': (str,), # noqa: E501 'breed': (str,), # noqa: E501 @@ -119,7 +116,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, class_name, *args, **kwargs): # noqa: E501 - """dog.Dog - a model defined in OpenAPI + """Dog - a model defined in OpenAPI Args: class_name (str): @@ -227,12 +224,13 @@ def _composed_schemas(): # code would be run when this module is imported, and these composed # classes don't exist yet because their module has not finished # loading + lazy_import() return { 'anyOf': [ ], 'allOf': [ - animal.Animal, - dog_all_of.DogAllOf, + Animal, + DogAllOf, ], 'oneOf': [ ], diff --git a/samples/client/petstore/python-experimental/petstore_api/model/dog_all_of.py b/samples/client/petstore/python-experimental/petstore_api/model/dog_all_of.py index 299a4d956bc9..c27b3bbc053b 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/dog_all_of.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/dog_all_of.py @@ -68,8 +68,8 @@ class DogAllOf(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -83,6 +83,7 @@ def openapi_types(): def discriminator(): return None + attribute_map = { 'breed': 'breed', # noqa: E501 } @@ -100,7 +101,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """dog_all_of.DogAllOf - a model defined in OpenAPI + """DogAllOf - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/client/petstore/python-experimental/petstore_api/model/enum_arrays.py b/samples/client/petstore/python-experimental/petstore_api/model/enum_arrays.py index 161ddd5c1d1e..4b04cd104018 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/enum_arrays.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/enum_arrays.py @@ -76,8 +76,8 @@ class EnumArrays(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -92,6 +92,7 @@ def openapi_types(): def discriminator(): return None + attribute_map = { 'just_symbol': 'just_symbol', # noqa: E501 'array_enum': 'array_enum', # noqa: E501 @@ -110,7 +111,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """enum_arrays.EnumArrays - a model defined in OpenAPI + """EnumArrays - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/client/petstore/python-experimental/petstore_api/model/enum_class.py b/samples/client/petstore/python-experimental/petstore_api/model/enum_class.py index dac3ee37d032..5c9799cce105 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/enum_class.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/enum_class.py @@ -69,8 +69,8 @@ class EnumClass(ModelSimple): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -84,6 +84,7 @@ def openapi_types(): def discriminator(): return None + attribute_map = {} _composed_schemas = None @@ -99,7 +100,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, value, *args, **kwargs): - """enum_class.EnumClass - a model defined in OpenAPI + """EnumClass - a model defined in OpenAPI Args: value (str): if omitted the server will use the default value of '-efg', must be one of ["_abc", "-efg", "(xyz)", ] # noqa: E501 diff --git a/samples/client/petstore/python-experimental/petstore_api/model/enum_test.py b/samples/client/petstore/python-experimental/petstore_api/model/enum_test.py index c53f054242e8..0e4dd0da2ea6 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/enum_test.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/enum_test.py @@ -29,11 +29,10 @@ none_type, validate_get_composed_info, ) -try: - from petstore_api.model import string_enum -except ImportError: - string_enum = sys.modules[ - 'petstore_api.model.string_enum'] + +def lazy_import(): + from petstore_api.model.string_enum import StringEnum + globals()['StringEnum'] = StringEnum class EnumTest(ModelNormal): @@ -91,25 +90,27 @@ class EnumTest(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name and the value is attribute type. """ + lazy_import() return { 'enum_string_required': (str,), # noqa: E501 'enum_string': (str,), # noqa: E501 'enum_integer': (int,), # noqa: E501 'enum_number': (float,), # noqa: E501 - 'string_enum': (string_enum.StringEnum,), # noqa: E501 + 'string_enum': (StringEnum,), # noqa: E501 } @cached_property def discriminator(): return None + attribute_map = { 'enum_string_required': 'enum_string_required', # noqa: E501 'enum_string': 'enum_string', # noqa: E501 @@ -131,7 +132,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, enum_string_required, *args, **kwargs): # noqa: E501 - """enum_test.EnumTest - a model defined in OpenAPI + """EnumTest - a model defined in OpenAPI Args: enum_string_required (str): @@ -170,7 +171,7 @@ def __init__(self, enum_string_required, *args, **kwargs): # noqa: E501 enum_string (str): [optional] # noqa: E501 enum_integer (int): [optional] # noqa: E501 enum_number (float): [optional] # noqa: E501 - string_enum (string_enum.StringEnum): [optional] # noqa: E501 + string_enum (StringEnum): [optional] # noqa: E501 """ _check_type = kwargs.pop('_check_type', True) diff --git a/samples/client/petstore/python-experimental/petstore_api/model/file.py b/samples/client/petstore/python-experimental/petstore_api/model/file.py index f7cdcb4fdf8b..2dc360144d60 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/file.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/file.py @@ -68,8 +68,8 @@ class File(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -83,6 +83,7 @@ def openapi_types(): def discriminator(): return None + attribute_map = { 'source_uri': 'sourceURI', # noqa: E501 } @@ -100,7 +101,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """file.File - a model defined in OpenAPI + """File - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/client/petstore/python-experimental/petstore_api/model/file_schema_test_class.py b/samples/client/petstore/python-experimental/petstore_api/model/file_schema_test_class.py index 3c1d880d3585..dc1405e1fe91 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/file_schema_test_class.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/file_schema_test_class.py @@ -29,11 +29,10 @@ none_type, validate_get_composed_info, ) -try: - from petstore_api.model import file -except ImportError: - file = sys.modules[ - 'petstore_api.model.file'] + +def lazy_import(): + from petstore_api.model.file import File + globals()['File'] = File class FileSchemaTestClass(ModelNormal): @@ -73,22 +72,24 @@ class FileSchemaTestClass(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name and the value is attribute type. """ + lazy_import() return { - 'file': (file.File,), # noqa: E501 - 'files': ([file.File],), # noqa: E501 + 'file': (File,), # noqa: E501 + 'files': ([File],), # noqa: E501 } @cached_property def discriminator(): return None + attribute_map = { 'file': 'file', # noqa: E501 'files': 'files', # noqa: E501 @@ -107,7 +108,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """file_schema_test_class.FileSchemaTestClass - a model defined in OpenAPI + """FileSchemaTestClass - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types @@ -140,8 +141,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 Animal class but this time we won't travel through its discriminator because we passed in _visited_composed_classes = (Animal,) - file (file.File): [optional] # noqa: E501 - files ([file.File]): [optional] # noqa: E501 + file (File): [optional] # noqa: E501 + files ([File]): [optional] # noqa: E501 """ _check_type = kwargs.pop('_check_type', True) diff --git a/samples/client/petstore/python-experimental/petstore_api/model/format_test.py b/samples/client/petstore/python-experimental/petstore_api/model/format_test.py index 1955422e7a86..d338a41ef976 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/format_test.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/format_test.py @@ -103,8 +103,8 @@ class FormatTest(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -130,6 +130,7 @@ def openapi_types(): def discriminator(): return None + attribute_map = { 'number': 'number', # noqa: E501 'byte': 'byte', # noqa: E501 @@ -159,7 +160,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, number, byte, date, password, *args, **kwargs): # noqa: E501 - """format_test.FormatTest - a model defined in OpenAPI + """FormatTest - a model defined in OpenAPI Args: number (float): diff --git a/samples/client/petstore/python-experimental/petstore_api/model/grandparent.py b/samples/client/petstore/python-experimental/petstore_api/model/grandparent.py index 7d607a4f392e..ca3b8391aebd 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/grandparent.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/grandparent.py @@ -68,8 +68,8 @@ class Grandparent(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -83,6 +83,7 @@ def openapi_types(): def discriminator(): return None + attribute_map = { 'radio_waves': 'radioWaves', # noqa: E501 } @@ -100,7 +101,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """grandparent.Grandparent - a model defined in OpenAPI + """Grandparent - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/client/petstore/python-experimental/petstore_api/model/grandparent_animal.py b/samples/client/petstore/python-experimental/petstore_api/model/grandparent_animal.py index 2dc2658ef13d..62b2c875bff2 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/grandparent_animal.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/grandparent_animal.py @@ -29,26 +29,16 @@ none_type, validate_get_composed_info, ) -try: - from petstore_api.model import child_cat -except ImportError: - child_cat = sys.modules[ - 'petstore_api.model.child_cat'] -try: - from petstore_api.model import child_dog -except ImportError: - child_dog = sys.modules[ - 'petstore_api.model.child_dog'] -try: - from petstore_api.model import child_lizard -except ImportError: - child_lizard = sys.modules[ - 'petstore_api.model.child_lizard'] -try: - from petstore_api.model import parent_pet -except ImportError: - parent_pet = sys.modules[ - 'petstore_api.model.parent_pet'] + +def lazy_import(): + from petstore_api.model.child_cat import ChildCat + from petstore_api.model.child_dog import ChildDog + from petstore_api.model.child_lizard import ChildLizard + from petstore_api.model.parent_pet import ParentPet + globals()['ChildCat'] = ChildCat + globals()['ChildDog'] = ChildDog + globals()['ChildLizard'] = ChildLizard + globals()['ParentPet'] = ParentPet class GrandparentAnimal(ModelNormal): @@ -88,24 +78,26 @@ class GrandparentAnimal(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name and the value is attribute type. """ + lazy_import() return { 'pet_type': (str,), # noqa: E501 } @cached_property def discriminator(): + lazy_import() val = { - 'ChildCat': child_cat.ChildCat, - 'ChildDog': child_dog.ChildDog, - 'ChildLizard': child_lizard.ChildLizard, - 'ParentPet': parent_pet.ParentPet, + 'ChildCat': ChildCat, + 'ChildDog': ChildDog, + 'ChildLizard': ChildLizard, + 'ParentPet': ParentPet, } if not val: return None @@ -128,7 +120,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, pet_type, *args, **kwargs): # noqa: E501 - """grandparent_animal.GrandparentAnimal - a model defined in OpenAPI + """GrandparentAnimal - a model defined in OpenAPI Args: pet_type (str): diff --git a/samples/client/petstore/python-experimental/petstore_api/model/has_only_read_only.py b/samples/client/petstore/python-experimental/petstore_api/model/has_only_read_only.py index 7a722ee9c78c..a89269f087df 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/has_only_read_only.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/has_only_read_only.py @@ -68,8 +68,8 @@ class HasOnlyReadOnly(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -84,6 +84,7 @@ def openapi_types(): def discriminator(): return None + attribute_map = { 'bar': 'bar', # noqa: E501 'foo': 'foo', # noqa: E501 @@ -102,7 +103,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """has_only_read_only.HasOnlyReadOnly - a model defined in OpenAPI + """HasOnlyReadOnly - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/client/petstore/python-experimental/petstore_api/model/list.py b/samples/client/petstore/python-experimental/petstore_api/model/list.py index 77bd4d0565dc..48a4934b3c36 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/list.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/list.py @@ -68,8 +68,8 @@ class List(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -83,6 +83,7 @@ def openapi_types(): def discriminator(): return None + attribute_map = { '_123_list': '123-list', # noqa: E501 } @@ -100,7 +101,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """list.List - a model defined in OpenAPI + """List - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/client/petstore/python-experimental/petstore_api/model/map_test.py b/samples/client/petstore/python-experimental/petstore_api/model/map_test.py index 5bafea48a041..b08a5c9d66d5 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/map_test.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/map_test.py @@ -29,11 +29,10 @@ none_type, validate_get_composed_info, ) -try: - from petstore_api.model import string_boolean_map -except ImportError: - string_boolean_map = sys.modules[ - 'petstore_api.model.string_boolean_map'] + +def lazy_import(): + from petstore_api.model.string_boolean_map import StringBooleanMap + globals()['StringBooleanMap'] = StringBooleanMap class MapTest(ModelNormal): @@ -77,24 +76,26 @@ class MapTest(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name and the value is attribute type. """ + lazy_import() return { 'map_map_of_string': ({str: ({str: (str,)},)},), # noqa: E501 'map_of_enum_string': ({str: (str,)},), # noqa: E501 'direct_map': ({str: (bool,)},), # noqa: E501 - 'indirect_map': (string_boolean_map.StringBooleanMap,), # noqa: E501 + 'indirect_map': (StringBooleanMap,), # noqa: E501 } @cached_property def discriminator(): return None + attribute_map = { 'map_map_of_string': 'map_map_of_string', # noqa: E501 'map_of_enum_string': 'map_of_enum_string', # noqa: E501 @@ -115,7 +116,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """map_test.MapTest - a model defined in OpenAPI + """MapTest - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types @@ -151,7 +152,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 map_map_of_string ({str: ({str: (str,)},)}): [optional] # noqa: E501 map_of_enum_string ({str: (str,)}): [optional] # noqa: E501 direct_map ({str: (bool,)}): [optional] # noqa: E501 - indirect_map (string_boolean_map.StringBooleanMap): [optional] # noqa: E501 + indirect_map (StringBooleanMap): [optional] # noqa: E501 """ _check_type = kwargs.pop('_check_type', True) diff --git a/samples/client/petstore/python-experimental/petstore_api/model/mixed_properties_and_additional_properties_class.py b/samples/client/petstore/python-experimental/petstore_api/model/mixed_properties_and_additional_properties_class.py index 12cda6cf9ae9..58a190e9a22f 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/mixed_properties_and_additional_properties_class.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/mixed_properties_and_additional_properties_class.py @@ -29,11 +29,10 @@ none_type, validate_get_composed_info, ) -try: - from petstore_api.model import animal -except ImportError: - animal = sys.modules[ - 'petstore_api.model.animal'] + +def lazy_import(): + from petstore_api.model.animal import Animal + globals()['Animal'] = Animal class MixedPropertiesAndAdditionalPropertiesClass(ModelNormal): @@ -73,23 +72,25 @@ class MixedPropertiesAndAdditionalPropertiesClass(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name and the value is attribute type. """ + lazy_import() return { 'uuid': (str,), # noqa: E501 'date_time': (datetime,), # noqa: E501 - 'map': ({str: (animal.Animal,)},), # noqa: E501 + 'map': ({str: (Animal,)},), # noqa: E501 } @cached_property def discriminator(): return None + attribute_map = { 'uuid': 'uuid', # noqa: E501 'date_time': 'dateTime', # noqa: E501 @@ -109,7 +110,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """mixed_properties_and_additional_properties_class.MixedPropertiesAndAdditionalPropertiesClass - a model defined in OpenAPI + """MixedPropertiesAndAdditionalPropertiesClass - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types @@ -144,7 +145,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 _visited_composed_classes = (Animal,) uuid (str): [optional] # noqa: E501 date_time (datetime): [optional] # noqa: E501 - map ({str: (animal.Animal,)}): [optional] # noqa: E501 + map ({str: (Animal,)}): [optional] # noqa: E501 """ _check_type = kwargs.pop('_check_type', True) diff --git a/samples/client/petstore/python-experimental/petstore_api/model/model200_response.py b/samples/client/petstore/python-experimental/petstore_api/model/model200_response.py index ea4df21be49e..0b331cb4292c 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/model200_response.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/model200_response.py @@ -68,8 +68,8 @@ class Model200Response(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -84,6 +84,7 @@ def openapi_types(): def discriminator(): return None + attribute_map = { 'name': 'name', # noqa: E501 '_class': 'class', # noqa: E501 @@ -102,7 +103,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """model200_response.Model200Response - a model defined in OpenAPI + """Model200Response - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/client/petstore/python-experimental/petstore_api/model/model_return.py b/samples/client/petstore/python-experimental/petstore_api/model/model_return.py index 535657ebbcf0..5905af9cc4fc 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/model_return.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/model_return.py @@ -68,8 +68,8 @@ class ModelReturn(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -83,6 +83,7 @@ def openapi_types(): def discriminator(): return None + attribute_map = { '_return': 'return', # noqa: E501 } @@ -100,7 +101,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """model_return.ModelReturn - a model defined in OpenAPI + """ModelReturn - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/client/petstore/python-experimental/petstore_api/model/name.py b/samples/client/petstore/python-experimental/petstore_api/model/name.py index 95f197a7a595..1627f3381b09 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/name.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/name.py @@ -68,8 +68,8 @@ class Name(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -86,6 +86,7 @@ def openapi_types(): def discriminator(): return None + attribute_map = { 'name': 'name', # noqa: E501 'snake_case': 'snake_case', # noqa: E501 @@ -106,7 +107,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, name, *args, **kwargs): # noqa: E501 - """name.Name - a model defined in OpenAPI + """Name - a model defined in OpenAPI Args: name (int): diff --git a/samples/client/petstore/python-experimental/petstore_api/model/number_only.py b/samples/client/petstore/python-experimental/petstore_api/model/number_only.py index d16ea3765fcb..421b4d51a8b6 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/number_only.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/number_only.py @@ -68,8 +68,8 @@ class NumberOnly(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -83,6 +83,7 @@ def openapi_types(): def discriminator(): return None + attribute_map = { 'just_number': 'JustNumber', # noqa: E501 } @@ -100,7 +101,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """number_only.NumberOnly - a model defined in OpenAPI + """NumberOnly - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/client/petstore/python-experimental/petstore_api/model/number_with_validations.py b/samples/client/petstore/python-experimental/petstore_api/model/number_with_validations.py index 1cb824ca0b4b..00656ce8bcf7 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/number_with_validations.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/number_with_validations.py @@ -68,8 +68,8 @@ class NumberWithValidations(ModelSimple): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -83,6 +83,7 @@ def openapi_types(): def discriminator(): return None + attribute_map = {} _composed_schemas = None @@ -98,7 +99,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, value, *args, **kwargs): - """number_with_validations.NumberWithValidations - a model defined in OpenAPI + """NumberWithValidations - a model defined in OpenAPI Args: value (float): # noqa: E501 diff --git a/samples/client/petstore/python-experimental/petstore_api/model/object_model_with_ref_props.py b/samples/client/petstore/python-experimental/petstore_api/model/object_model_with_ref_props.py index 15ccc61db3f9..8858e25aa53b 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/object_model_with_ref_props.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/object_model_with_ref_props.py @@ -29,11 +29,10 @@ none_type, validate_get_composed_info, ) -try: - from petstore_api.model import number_with_validations -except ImportError: - number_with_validations = sys.modules[ - 'petstore_api.model.number_with_validations'] + +def lazy_import(): + from petstore_api.model.number_with_validations import NumberWithValidations + globals()['NumberWithValidations'] = NumberWithValidations class ObjectModelWithRefProps(ModelNormal): @@ -73,15 +72,16 @@ class ObjectModelWithRefProps(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name and the value is attribute type. """ + lazy_import() return { - 'my_number': (number_with_validations.NumberWithValidations,), # noqa: E501 + 'my_number': (NumberWithValidations,), # noqa: E501 'my_string': (str,), # noqa: E501 'my_boolean': (bool,), # noqa: E501 } @@ -90,6 +90,7 @@ def openapi_types(): def discriminator(): return None + attribute_map = { 'my_number': 'my_number', # noqa: E501 'my_string': 'my_string', # noqa: E501 @@ -109,7 +110,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """object_model_with_ref_props.ObjectModelWithRefProps - a model defined in OpenAPI + """ObjectModelWithRefProps - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types @@ -142,7 +143,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 Animal class but this time we won't travel through its discriminator because we passed in _visited_composed_classes = (Animal,) - my_number (number_with_validations.NumberWithValidations): [optional] # noqa: E501 + my_number (NumberWithValidations): [optional] # noqa: E501 my_string (str): [optional] # noqa: E501 my_boolean (bool): [optional] # noqa: E501 """ diff --git a/samples/client/petstore/python-experimental/petstore_api/model/order.py b/samples/client/petstore/python-experimental/petstore_api/model/order.py index b21543df95f5..08ce05074ae0 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/order.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/order.py @@ -73,8 +73,8 @@ class Order(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -93,6 +93,7 @@ def openapi_types(): def discriminator(): return None + attribute_map = { 'id': 'id', # noqa: E501 'pet_id': 'petId', # noqa: E501 @@ -115,7 +116,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """order.Order - a model defined in OpenAPI + """Order - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/client/petstore/python-experimental/petstore_api/model/parent.py b/samples/client/petstore/python-experimental/petstore_api/model/parent.py index e304790e4a6a..4d0aeb96a9d8 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/parent.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/parent.py @@ -29,16 +29,12 @@ none_type, validate_get_composed_info, ) -try: - from petstore_api.model import grandparent -except ImportError: - grandparent = sys.modules[ - 'petstore_api.model.grandparent'] -try: - from petstore_api.model import parent_all_of -except ImportError: - parent_all_of = sys.modules[ - 'petstore_api.model.parent_all_of'] + +def lazy_import(): + from petstore_api.model.grandparent import Grandparent + from petstore_api.model.parent_all_of import ParentAllOf + globals()['Grandparent'] = Grandparent + globals()['ParentAllOf'] = ParentAllOf class Parent(ModelComposed): @@ -78,13 +74,14 @@ class Parent(ModelComposed): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name and the value is attribute type. """ + lazy_import() return { 'radio_waves': (bool,), # noqa: E501 'tele_vision': (bool,), # noqa: E501 @@ -94,6 +91,7 @@ def openapi_types(): def discriminator(): return None + attribute_map = { 'radio_waves': 'radioWaves', # noqa: E501 'tele_vision': 'teleVision', # noqa: E501 @@ -113,7 +111,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """parent.Parent - a model defined in OpenAPI + """Parent - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types @@ -217,12 +215,13 @@ def _composed_schemas(): # code would be run when this module is imported, and these composed # classes don't exist yet because their module has not finished # loading + lazy_import() return { 'anyOf': [ ], 'allOf': [ - grandparent.Grandparent, - parent_all_of.ParentAllOf, + Grandparent, + ParentAllOf, ], 'oneOf': [ ], diff --git a/samples/client/petstore/python-experimental/petstore_api/model/parent_all_of.py b/samples/client/petstore/python-experimental/petstore_api/model/parent_all_of.py index 7c93bfa53044..a026b9b9c6d5 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/parent_all_of.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/parent_all_of.py @@ -68,8 +68,8 @@ class ParentAllOf(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -83,6 +83,7 @@ def openapi_types(): def discriminator(): return None + attribute_map = { 'tele_vision': 'teleVision', # noqa: E501 } @@ -100,7 +101,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """parent_all_of.ParentAllOf - a model defined in OpenAPI + """ParentAllOf - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/client/petstore/python-experimental/petstore_api/model/parent_pet.py b/samples/client/petstore/python-experimental/petstore_api/model/parent_pet.py index be19773d591f..d529f23e4427 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/parent_pet.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/parent_pet.py @@ -29,26 +29,16 @@ none_type, validate_get_composed_info, ) -try: - from petstore_api.model import child_cat -except ImportError: - child_cat = sys.modules[ - 'petstore_api.model.child_cat'] -try: - from petstore_api.model import child_dog -except ImportError: - child_dog = sys.modules[ - 'petstore_api.model.child_dog'] -try: - from petstore_api.model import child_lizard -except ImportError: - child_lizard = sys.modules[ - 'petstore_api.model.child_lizard'] -try: - from petstore_api.model import grandparent_animal -except ImportError: - grandparent_animal = sys.modules[ - 'petstore_api.model.grandparent_animal'] + +def lazy_import(): + from petstore_api.model.child_cat import ChildCat + from petstore_api.model.child_dog import ChildDog + from petstore_api.model.child_lizard import ChildLizard + from petstore_api.model.grandparent_animal import GrandparentAnimal + globals()['ChildCat'] = ChildCat + globals()['ChildDog'] = ChildDog + globals()['ChildLizard'] = ChildLizard + globals()['GrandparentAnimal'] = GrandparentAnimal class ParentPet(ModelComposed): @@ -88,23 +78,25 @@ class ParentPet(ModelComposed): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name and the value is attribute type. """ + lazy_import() return { 'pet_type': (str,), # noqa: E501 } @cached_property def discriminator(): + lazy_import() val = { - 'ChildCat': child_cat.ChildCat, - 'ChildDog': child_dog.ChildDog, - 'ChildLizard': child_lizard.ChildLizard, + 'ChildCat': ChildCat, + 'ChildDog': ChildDog, + 'ChildLizard': ChildLizard, } if not val: return None @@ -128,7 +120,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, pet_type, *args, **kwargs): # noqa: E501 - """parent_pet.ParentPet - a model defined in OpenAPI + """ParentPet - a model defined in OpenAPI Args: pet_type (str): @@ -234,11 +226,12 @@ def _composed_schemas(): # code would be run when this module is imported, and these composed # classes don't exist yet because their module has not finished # loading + lazy_import() return { 'anyOf': [ ], 'allOf': [ - grandparent_animal.GrandparentAnimal, + GrandparentAnimal, ], 'oneOf': [ ], diff --git a/samples/client/petstore/python-experimental/petstore_api/model/pet.py b/samples/client/petstore/python-experimental/petstore_api/model/pet.py index 5837810f22e9..77f5d3bb1ee4 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/pet.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/pet.py @@ -29,16 +29,12 @@ none_type, validate_get_composed_info, ) -try: - from petstore_api.model import category -except ImportError: - category = sys.modules[ - 'petstore_api.model.category'] -try: - from petstore_api.model import tag -except ImportError: - tag = sys.modules[ - 'petstore_api.model.tag'] + +def lazy_import(): + from petstore_api.model.category import Category + from petstore_api.model.tag import Tag + globals()['Category'] = Category + globals()['Tag'] = Tag class Pet(ModelNormal): @@ -83,19 +79,20 @@ class Pet(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name and the value is attribute type. """ + lazy_import() return { 'name': (str,), # noqa: E501 'photo_urls': ([str],), # noqa: E501 'id': (int,), # noqa: E501 - 'category': (category.Category,), # noqa: E501 - 'tags': ([tag.Tag],), # noqa: E501 + 'category': (Category,), # noqa: E501 + 'tags': ([Tag],), # noqa: E501 'status': (str,), # noqa: E501 } @@ -103,6 +100,7 @@ def openapi_types(): def discriminator(): return None + attribute_map = { 'name': 'name', # noqa: E501 'photo_urls': 'photoUrls', # noqa: E501 @@ -125,7 +123,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, name, photo_urls, *args, **kwargs): # noqa: E501 - """pet.Pet - a model defined in OpenAPI + """Pet - a model defined in OpenAPI Args: name (str): @@ -163,8 +161,8 @@ def __init__(self, name, photo_urls, *args, **kwargs): # noqa: E501 through its discriminator because we passed in _visited_composed_classes = (Animal,) id (int): [optional] # noqa: E501 - category (category.Category): [optional] # noqa: E501 - tags ([tag.Tag]): [optional] # noqa: E501 + category (Category): [optional] # noqa: E501 + tags ([Tag]): [optional] # noqa: E501 status (str): pet status in the store. [optional] # noqa: E501 """ diff --git a/samples/client/petstore/python-experimental/petstore_api/model/player.py b/samples/client/petstore/python-experimental/petstore_api/model/player.py index b24471bd4c82..76caf4dce33e 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/player.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/player.py @@ -68,8 +68,8 @@ class Player(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -84,6 +84,7 @@ def openapi_types(): def discriminator(): return None + attribute_map = { 'name': 'name', # noqa: E501 'enemy_player': 'enemyPlayer', # noqa: E501 @@ -102,7 +103,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, name, *args, **kwargs): # noqa: E501 - """player.Player - a model defined in OpenAPI + """Player - a model defined in OpenAPI Args: name (str): diff --git a/samples/client/petstore/python-experimental/petstore_api/model/read_only_first.py b/samples/client/petstore/python-experimental/petstore_api/model/read_only_first.py index b53aa4db398e..f9fea19495d0 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/read_only_first.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/read_only_first.py @@ -68,8 +68,8 @@ class ReadOnlyFirst(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -84,6 +84,7 @@ def openapi_types(): def discriminator(): return None + attribute_map = { 'bar': 'bar', # noqa: E501 'baz': 'baz', # noqa: E501 @@ -102,7 +103,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """read_only_first.ReadOnlyFirst - a model defined in OpenAPI + """ReadOnlyFirst - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/client/petstore/python-experimental/petstore_api/model/special_model_name.py b/samples/client/petstore/python-experimental/petstore_api/model/special_model_name.py index 75df4a577a3c..e4df8f8e89d8 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/special_model_name.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/special_model_name.py @@ -68,8 +68,8 @@ class SpecialModelName(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -83,6 +83,7 @@ def openapi_types(): def discriminator(): return None + attribute_map = { 'special_property_name': '$special[property.name]', # noqa: E501 } @@ -100,7 +101,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """special_model_name.SpecialModelName - a model defined in OpenAPI + """SpecialModelName - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/client/petstore/python-experimental/petstore_api/model/string_boolean_map.py b/samples/client/petstore/python-experimental/petstore_api/model/string_boolean_map.py index b1fb64321118..0f4bc65afde5 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/string_boolean_map.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/string_boolean_map.py @@ -61,15 +61,21 @@ class StringBooleanMap(ModelNormal): validations = { } - additional_properties_type = (bool,) # noqa: E501 + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool,) # noqa: E501 _nullable = False @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -82,6 +88,7 @@ def openapi_types(): def discriminator(): return None + attribute_map = { } @@ -98,7 +105,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """string_boolean_map.StringBooleanMap - a model defined in OpenAPI + """StringBooleanMap - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/client/petstore/python-experimental/petstore_api/model/string_enum.py b/samples/client/petstore/python-experimental/petstore_api/model/string_enum.py index 6f45c19a4cc7..1fd2b6746989 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/string_enum.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/string_enum.py @@ -69,8 +69,8 @@ class StringEnum(ModelSimple): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -84,6 +84,7 @@ def openapi_types(): def discriminator(): return None + attribute_map = {} _composed_schemas = None @@ -99,7 +100,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, value, *args, **kwargs): - """string_enum.StringEnum - a model defined in OpenAPI + """StringEnum - a model defined in OpenAPI Args: value (str):, must be one of ["placed", "approved", "delivered", ] # noqa: E501 diff --git a/samples/client/petstore/python-experimental/petstore_api/model/tag.py b/samples/client/petstore/python-experimental/petstore_api/model/tag.py index 480e1e60322e..dae4bee68a5b 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/tag.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/tag.py @@ -68,8 +68,8 @@ class Tag(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -85,6 +85,7 @@ def openapi_types(): def discriminator(): return None + attribute_map = { 'id': 'id', # noqa: E501 'name': 'name', # noqa: E501 @@ -104,7 +105,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """tag.Tag - a model defined in OpenAPI + """Tag - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/client/petstore/python-experimental/petstore_api/model/type_holder_default.py b/samples/client/petstore/python-experimental/petstore_api/model/type_holder_default.py index 4eb7092ef86c..812384aa9940 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/type_holder_default.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/type_holder_default.py @@ -68,8 +68,8 @@ class TypeHolderDefault(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -89,6 +89,7 @@ def openapi_types(): def discriminator(): return None + attribute_map = { 'string_item': 'string_item', # noqa: E501 'number_item': 'number_item', # noqa: E501 @@ -112,7 +113,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, array_item, *args, **kwargs): # noqa: E501 - """type_holder_default.TypeHolderDefault - a model defined in OpenAPI + """TypeHolderDefault - a model defined in OpenAPI Args: array_item ([int]): diff --git a/samples/client/petstore/python-experimental/petstore_api/model/type_holder_example.py b/samples/client/petstore/python-experimental/petstore_api/model/type_holder_example.py index 6e3cd4280b01..1f796982cde0 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/type_holder_example.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/type_holder_example.py @@ -77,8 +77,8 @@ class TypeHolderExample(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -96,6 +96,7 @@ def openapi_types(): def discriminator(): return None + attribute_map = { 'string_item': 'string_item', # noqa: E501 'number_item': 'number_item', # noqa: E501 @@ -117,7 +118,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, bool_item, array_item, *args, **kwargs): # noqa: E501 - """type_holder_example.TypeHolderExample - a model defined in OpenAPI + """TypeHolderExample - a model defined in OpenAPI Args: bool_item (bool): diff --git a/samples/client/petstore/python-experimental/petstore_api/model/user.py b/samples/client/petstore/python-experimental/petstore_api/model/user.py index 95fd0683d741..b58ede5e5fdd 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/user.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/user.py @@ -68,8 +68,8 @@ class User(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -90,6 +90,7 @@ def openapi_types(): def discriminator(): return None + attribute_map = { 'id': 'id', # noqa: E501 'username': 'username', # noqa: E501 @@ -114,7 +115,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """user.User - a model defined in OpenAPI + """User - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/client/petstore/python-experimental/petstore_api/model/xml_item.py b/samples/client/petstore/python-experimental/petstore_api/model/xml_item.py index 961fb0f55525..c52a02acfc08 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/xml_item.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/xml_item.py @@ -68,8 +68,8 @@ class XmlItem(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -111,6 +111,7 @@ def openapi_types(): def discriminator(): return None + attribute_map = { 'attribute_string': 'attribute_string', # noqa: E501 'attribute_number': 'attribute_number', # noqa: E501 @@ -156,7 +157,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """xml_item.XmlItem - a model defined in OpenAPI + """XmlItem - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/client/petstore/python-experimental/petstore_api/model_utils.py b/samples/client/petstore/python-experimental/petstore_api/model_utils.py index ff378aa1e157..de9fc5c3a272 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model_utils.py +++ b/samples/client/petstore/python-experimental/petstore_api/model_utils.py @@ -41,9 +41,9 @@ def __init__(self, fn): self._fn = fn def __get__(self, instance, cls=None): - try: + if self.result_key in vars(self): return vars(self)[self.result_key] - except KeyError: + else: result = self._fn() setattr(self, self.result_key, result) return result diff --git a/samples/client/petstore/python-experimental/test/test_additional_properties_any_type.py b/samples/client/petstore/python-experimental/test/test_additional_properties_any_type.py index e87caa28bc19..ce985f76ed9e 100644 --- a/samples/client/petstore/python-experimental/test/test_additional_properties_any_type.py +++ b/samples/client/petstore/python-experimental/test/test_additional_properties_any_type.py @@ -10,6 +10,7 @@ """ +from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_additional_properties_array.py b/samples/client/petstore/python-experimental/test/test_additional_properties_array.py index 503b4952a207..f63ca82f6c22 100644 --- a/samples/client/petstore/python-experimental/test/test_additional_properties_array.py +++ b/samples/client/petstore/python-experimental/test/test_additional_properties_array.py @@ -10,6 +10,7 @@ """ +from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_additional_properties_boolean.py b/samples/client/petstore/python-experimental/test/test_additional_properties_boolean.py index da5dc1546917..e5a13891c098 100644 --- a/samples/client/petstore/python-experimental/test/test_additional_properties_boolean.py +++ b/samples/client/petstore/python-experimental/test/test_additional_properties_boolean.py @@ -10,6 +10,7 @@ """ +from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_additional_properties_class.py b/samples/client/petstore/python-experimental/test/test_additional_properties_class.py index 42fdf1948736..befc14455da2 100644 --- a/samples/client/petstore/python-experimental/test/test_additional_properties_class.py +++ b/samples/client/petstore/python-experimental/test/test_additional_properties_class.py @@ -10,6 +10,7 @@ """ +from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_additional_properties_integer.py b/samples/client/petstore/python-experimental/test/test_additional_properties_integer.py index e594f8207df9..0e08b8f87706 100644 --- a/samples/client/petstore/python-experimental/test/test_additional_properties_integer.py +++ b/samples/client/petstore/python-experimental/test/test_additional_properties_integer.py @@ -10,6 +10,7 @@ """ +from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_additional_properties_number.py b/samples/client/petstore/python-experimental/test/test_additional_properties_number.py index d678ad4d6586..90f4429e989f 100644 --- a/samples/client/petstore/python-experimental/test/test_additional_properties_number.py +++ b/samples/client/petstore/python-experimental/test/test_additional_properties_number.py @@ -10,6 +10,7 @@ """ +from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_additional_properties_object.py b/samples/client/petstore/python-experimental/test/test_additional_properties_object.py index 9088632e9f56..ded4a8e8a124 100644 --- a/samples/client/petstore/python-experimental/test/test_additional_properties_object.py +++ b/samples/client/petstore/python-experimental/test/test_additional_properties_object.py @@ -10,6 +10,7 @@ """ +from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_additional_properties_string.py b/samples/client/petstore/python-experimental/test/test_additional_properties_string.py index 29c09806c15f..cff2c31921fe 100644 --- a/samples/client/petstore/python-experimental/test/test_additional_properties_string.py +++ b/samples/client/petstore/python-experimental/test/test_additional_properties_string.py @@ -10,6 +10,7 @@ """ +from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_animal.py b/samples/client/petstore/python-experimental/test/test_animal.py index 0e1f8507373c..958f303f13e3 100644 --- a/samples/client/petstore/python-experimental/test/test_animal.py +++ b/samples/client/petstore/python-experimental/test/test_animal.py @@ -10,6 +10,7 @@ """ +from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_animal_farm.py b/samples/client/petstore/python-experimental/test/test_animal_farm.py index f473c465d731..7117d42b430e 100644 --- a/samples/client/petstore/python-experimental/test/test_animal_farm.py +++ b/samples/client/petstore/python-experimental/test/test_animal_farm.py @@ -10,6 +10,7 @@ """ +from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_another_fake_api.py b/samples/client/petstore/python-experimental/test/test_another_fake_api.py index c58dfa6202bc..f79966a26961 100644 --- a/samples/client/petstore/python-experimental/test/test_another_fake_api.py +++ b/samples/client/petstore/python-experimental/test/test_another_fake_api.py @@ -10,6 +10,8 @@ """ +from __future__ import absolute_import + import unittest import petstore_api diff --git a/samples/client/petstore/python-experimental/test/test_api_response.py b/samples/client/petstore/python-experimental/test/test_api_response.py index a9a900c29cfa..9db92633f626 100644 --- a/samples/client/petstore/python-experimental/test/test_api_response.py +++ b/samples/client/petstore/python-experimental/test/test_api_response.py @@ -10,6 +10,7 @@ """ +from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_array_of_array_of_number_only.py b/samples/client/petstore/python-experimental/test/test_array_of_array_of_number_only.py index 39f8874a4e81..4980ad17afb5 100644 --- a/samples/client/petstore/python-experimental/test/test_array_of_array_of_number_only.py +++ b/samples/client/petstore/python-experimental/test/test_array_of_array_of_number_only.py @@ -10,6 +10,7 @@ """ +from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_array_of_number_only.py b/samples/client/petstore/python-experimental/test/test_array_of_number_only.py index c4abfd068614..479c537cada7 100644 --- a/samples/client/petstore/python-experimental/test/test_array_of_number_only.py +++ b/samples/client/petstore/python-experimental/test/test_array_of_number_only.py @@ -10,6 +10,7 @@ """ +from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_array_test.py b/samples/client/petstore/python-experimental/test/test_array_test.py index f966f4c0d854..2426b27b7e46 100644 --- a/samples/client/petstore/python-experimental/test/test_array_test.py +++ b/samples/client/petstore/python-experimental/test/test_array_test.py @@ -10,6 +10,7 @@ """ +from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_capitalization.py b/samples/client/petstore/python-experimental/test/test_capitalization.py index 5f47ddb4db09..20d2649c01eb 100644 --- a/samples/client/petstore/python-experimental/test/test_capitalization.py +++ b/samples/client/petstore/python-experimental/test/test_capitalization.py @@ -10,6 +10,7 @@ """ +from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_cat.py b/samples/client/petstore/python-experimental/test/test_cat.py index 5f6eba3f8478..64b525aaf118 100644 --- a/samples/client/petstore/python-experimental/test/test_cat.py +++ b/samples/client/petstore/python-experimental/test/test_cat.py @@ -10,6 +10,7 @@ """ +from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_cat_all_of.py b/samples/client/petstore/python-experimental/test/test_cat_all_of.py index 3d5a33d9907b..a5bb91ac864e 100644 --- a/samples/client/petstore/python-experimental/test/test_cat_all_of.py +++ b/samples/client/petstore/python-experimental/test/test_cat_all_of.py @@ -10,6 +10,7 @@ """ +from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_category.py b/samples/client/petstore/python-experimental/test/test_category.py index 29490e0dbdb1..59b64e5924a8 100644 --- a/samples/client/petstore/python-experimental/test/test_category.py +++ b/samples/client/petstore/python-experimental/test/test_category.py @@ -10,6 +10,7 @@ """ +from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_child.py b/samples/client/petstore/python-experimental/test/test_child.py index 7739901bd818..3b49febd9532 100644 --- a/samples/client/petstore/python-experimental/test/test_child.py +++ b/samples/client/petstore/python-experimental/test/test_child.py @@ -10,6 +10,7 @@ """ +from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_child_all_of.py b/samples/client/petstore/python-experimental/test/test_child_all_of.py index b216908b0a64..96e479cf0796 100644 --- a/samples/client/petstore/python-experimental/test/test_child_all_of.py +++ b/samples/client/petstore/python-experimental/test/test_child_all_of.py @@ -10,6 +10,7 @@ """ +from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_child_cat.py b/samples/client/petstore/python-experimental/test/test_child_cat.py index ba3c16543d8e..34c085515a80 100644 --- a/samples/client/petstore/python-experimental/test/test_child_cat.py +++ b/samples/client/petstore/python-experimental/test/test_child_cat.py @@ -10,6 +10,7 @@ """ +from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_child_cat_all_of.py b/samples/client/petstore/python-experimental/test/test_child_cat_all_of.py index 2a0b6b8c220c..2a7aab100fbf 100644 --- a/samples/client/petstore/python-experimental/test/test_child_cat_all_of.py +++ b/samples/client/petstore/python-experimental/test/test_child_cat_all_of.py @@ -10,6 +10,7 @@ """ +from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_child_dog.py b/samples/client/petstore/python-experimental/test/test_child_dog.py index 5a726e612444..dfb09213e40c 100644 --- a/samples/client/petstore/python-experimental/test/test_child_dog.py +++ b/samples/client/petstore/python-experimental/test/test_child_dog.py @@ -10,6 +10,7 @@ """ +from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_child_dog_all_of.py b/samples/client/petstore/python-experimental/test/test_child_dog_all_of.py index eec5e355674f..ca75000c650e 100644 --- a/samples/client/petstore/python-experimental/test/test_child_dog_all_of.py +++ b/samples/client/petstore/python-experimental/test/test_child_dog_all_of.py @@ -10,6 +10,7 @@ """ +from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_child_lizard.py b/samples/client/petstore/python-experimental/test/test_child_lizard.py index 0b2bc17c1433..975dc1612a9f 100644 --- a/samples/client/petstore/python-experimental/test/test_child_lizard.py +++ b/samples/client/petstore/python-experimental/test/test_child_lizard.py @@ -10,6 +10,7 @@ """ +from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_child_lizard_all_of.py b/samples/client/petstore/python-experimental/test/test_child_lizard_all_of.py index 7f1ae842e66c..1b3bf4dba943 100644 --- a/samples/client/petstore/python-experimental/test/test_child_lizard_all_of.py +++ b/samples/client/petstore/python-experimental/test/test_child_lizard_all_of.py @@ -10,6 +10,7 @@ """ +from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_class_model.py b/samples/client/petstore/python-experimental/test/test_class_model.py index 6dc2a6928321..060df39e4b5e 100644 --- a/samples/client/petstore/python-experimental/test/test_class_model.py +++ b/samples/client/petstore/python-experimental/test/test_class_model.py @@ -10,6 +10,7 @@ """ +from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_client.py b/samples/client/petstore/python-experimental/test/test_client.py index caf85a24aa27..ab5e3a80d377 100644 --- a/samples/client/petstore/python-experimental/test/test_client.py +++ b/samples/client/petstore/python-experimental/test/test_client.py @@ -10,6 +10,7 @@ """ +from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_dog.py b/samples/client/petstore/python-experimental/test/test_dog.py index 0bdb477f8648..0b95c0a4c83a 100644 --- a/samples/client/petstore/python-experimental/test/test_dog.py +++ b/samples/client/petstore/python-experimental/test/test_dog.py @@ -10,6 +10,7 @@ """ +from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_dog_all_of.py b/samples/client/petstore/python-experimental/test/test_dog_all_of.py index 9f5075b7ed71..7ab4e8ae79d8 100644 --- a/samples/client/petstore/python-experimental/test/test_dog_all_of.py +++ b/samples/client/petstore/python-experimental/test/test_dog_all_of.py @@ -10,6 +10,7 @@ """ +from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_enum_arrays.py b/samples/client/petstore/python-experimental/test/test_enum_arrays.py index b1d0394df85d..64ad5fd7dc08 100644 --- a/samples/client/petstore/python-experimental/test/test_enum_arrays.py +++ b/samples/client/petstore/python-experimental/test/test_enum_arrays.py @@ -10,6 +10,7 @@ """ +from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_enum_class.py b/samples/client/petstore/python-experimental/test/test_enum_class.py index ed19c7985d4e..f910231c9d02 100644 --- a/samples/client/petstore/python-experimental/test/test_enum_class.py +++ b/samples/client/petstore/python-experimental/test/test_enum_class.py @@ -10,6 +10,7 @@ """ +from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_enum_test.py b/samples/client/petstore/python-experimental/test/test_enum_test.py index b79127a39855..7b4c1b6b66ac 100644 --- a/samples/client/petstore/python-experimental/test/test_enum_test.py +++ b/samples/client/petstore/python-experimental/test/test_enum_test.py @@ -10,6 +10,7 @@ """ +from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_fake_api.py b/samples/client/petstore/python-experimental/test/test_fake_api.py index 6e3c87bc70ae..34d207f3c71d 100644 --- a/samples/client/petstore/python-experimental/test/test_fake_api.py +++ b/samples/client/petstore/python-experimental/test/test_fake_api.py @@ -10,6 +10,8 @@ """ +from __future__ import absolute_import + import unittest import petstore_api @@ -109,7 +111,11 @@ def test_test_endpoint_enums_length_one(self): """ # when we omit the required enums of length one, they are still set endpoint = self.api.test_endpoint_enums_length_one - from unittest.mock import patch + import six + if six.PY3: + from unittest.mock import patch + else: + from mock import patch with patch.object(endpoint, 'call_with_http_info') as call_with_http_info: endpoint() call_with_http_info.assert_called_with( diff --git a/samples/client/petstore/python-experimental/test/test_fake_classname_tags_123_api.py b/samples/client/petstore/python-experimental/test/test_fake_classname_tags_123_api.py index b7724aaed7d1..1ade31405a62 100644 --- a/samples/client/petstore/python-experimental/test/test_fake_classname_tags_123_api.py +++ b/samples/client/petstore/python-experimental/test/test_fake_classname_tags_123_api.py @@ -10,6 +10,8 @@ """ +from __future__ import absolute_import +import sys import unittest import petstore_api diff --git a/samples/client/petstore/python-experimental/test/test_file.py b/samples/client/petstore/python-experimental/test/test_file.py index 438482f39525..8d60f64e01cc 100644 --- a/samples/client/petstore/python-experimental/test/test_file.py +++ b/samples/client/petstore/python-experimental/test/test_file.py @@ -10,6 +10,7 @@ """ +from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_file_schema_test_class.py b/samples/client/petstore/python-experimental/test/test_file_schema_test_class.py index ec38c523c7df..9a4f6d38dfef 100644 --- a/samples/client/petstore/python-experimental/test/test_file_schema_test_class.py +++ b/samples/client/petstore/python-experimental/test/test_file_schema_test_class.py @@ -10,6 +10,7 @@ """ +from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_format_test.py b/samples/client/petstore/python-experimental/test/test_format_test.py index ec2c8d0cbe33..ca37b005fd96 100644 --- a/samples/client/petstore/python-experimental/test/test_format_test.py +++ b/samples/client/petstore/python-experimental/test/test_format_test.py @@ -10,6 +10,7 @@ """ +from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_grandparent.py b/samples/client/petstore/python-experimental/test/test_grandparent.py index bf2455a5ca08..2972d01161cd 100644 --- a/samples/client/petstore/python-experimental/test/test_grandparent.py +++ b/samples/client/petstore/python-experimental/test/test_grandparent.py @@ -10,6 +10,7 @@ """ +from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_grandparent_animal.py b/samples/client/petstore/python-experimental/test/test_grandparent_animal.py index 42b1f0f716be..cabe4d81f98e 100644 --- a/samples/client/petstore/python-experimental/test/test_grandparent_animal.py +++ b/samples/client/petstore/python-experimental/test/test_grandparent_animal.py @@ -10,6 +10,7 @@ """ +from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_has_only_read_only.py b/samples/client/petstore/python-experimental/test/test_has_only_read_only.py index c9bf4c28658a..9ebd7683b398 100644 --- a/samples/client/petstore/python-experimental/test/test_has_only_read_only.py +++ b/samples/client/petstore/python-experimental/test/test_has_only_read_only.py @@ -10,6 +10,7 @@ """ +from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_list.py b/samples/client/petstore/python-experimental/test/test_list.py index 77611c300dc8..52156adfed2e 100644 --- a/samples/client/petstore/python-experimental/test/test_list.py +++ b/samples/client/petstore/python-experimental/test/test_list.py @@ -10,6 +10,7 @@ """ +from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_map_test.py b/samples/client/petstore/python-experimental/test/test_map_test.py index f905d7e919c2..3feda0f688df 100644 --- a/samples/client/petstore/python-experimental/test/test_map_test.py +++ b/samples/client/petstore/python-experimental/test/test_map_test.py @@ -10,6 +10,7 @@ """ +from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_mixed_properties_and_additional_properties_class.py b/samples/client/petstore/python-experimental/test/test_mixed_properties_and_additional_properties_class.py index 7de400b004fc..4dcb5ad4268c 100644 --- a/samples/client/petstore/python-experimental/test/test_mixed_properties_and_additional_properties_class.py +++ b/samples/client/petstore/python-experimental/test/test_mixed_properties_and_additional_properties_class.py @@ -10,6 +10,7 @@ """ +from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_model200_response.py b/samples/client/petstore/python-experimental/test/test_model200_response.py index 8ff474d5dde3..4012eaae3362 100644 --- a/samples/client/petstore/python-experimental/test/test_model200_response.py +++ b/samples/client/petstore/python-experimental/test/test_model200_response.py @@ -10,6 +10,7 @@ """ +from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_model_return.py b/samples/client/petstore/python-experimental/test/test_model_return.py index f856d3d76206..54c98b33cd66 100644 --- a/samples/client/petstore/python-experimental/test/test_model_return.py +++ b/samples/client/petstore/python-experimental/test/test_model_return.py @@ -10,6 +10,7 @@ """ +from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_name.py b/samples/client/petstore/python-experimental/test/test_name.py index b3841ca0304f..6a9be99d1a57 100644 --- a/samples/client/petstore/python-experimental/test/test_name.py +++ b/samples/client/petstore/python-experimental/test/test_name.py @@ -10,6 +10,7 @@ """ +from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_number_only.py b/samples/client/petstore/python-experimental/test/test_number_only.py index b7205f5fe029..07aab1d78af7 100644 --- a/samples/client/petstore/python-experimental/test/test_number_only.py +++ b/samples/client/petstore/python-experimental/test/test_number_only.py @@ -10,6 +10,7 @@ """ +from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_number_with_validations.py b/samples/client/petstore/python-experimental/test/test_number_with_validations.py index 98dc2930d3b0..3f0b78835d4b 100644 --- a/samples/client/petstore/python-experimental/test/test_number_with_validations.py +++ b/samples/client/petstore/python-experimental/test/test_number_with_validations.py @@ -10,6 +10,7 @@ """ +from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_object_model_with_ref_props.py b/samples/client/petstore/python-experimental/test/test_object_model_with_ref_props.py index cdf42fcd6620..35bd3b6d8ec7 100644 --- a/samples/client/petstore/python-experimental/test/test_object_model_with_ref_props.py +++ b/samples/client/petstore/python-experimental/test/test_object_model_with_ref_props.py @@ -10,6 +10,7 @@ """ +from __future__ import absolute_import import sys import unittest @@ -33,11 +34,11 @@ def tearDown(self): def testObjectModelWithRefProps(self): """Test ObjectModelWithRefProps""" - from petstore_api.model.object_model_with_ref_props import number_with_validations + from petstore_api.model.number_with_validations import NumberWithValidations self.assertEqual( ObjectModelWithRefProps.openapi_types, { - 'my_number': (number_with_validations.NumberWithValidations,), + 'my_number': (NumberWithValidations,), 'my_string': (str,), 'my_boolean': (bool,), } diff --git a/samples/client/petstore/python-experimental/test/test_order.py b/samples/client/petstore/python-experimental/test/test_order.py index 03f633d353f8..ee6988e28ccd 100644 --- a/samples/client/petstore/python-experimental/test/test_order.py +++ b/samples/client/petstore/python-experimental/test/test_order.py @@ -10,6 +10,7 @@ """ +from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_parent.py b/samples/client/petstore/python-experimental/test/test_parent.py index 385c66d2a698..20282dfb41ea 100644 --- a/samples/client/petstore/python-experimental/test/test_parent.py +++ b/samples/client/petstore/python-experimental/test/test_parent.py @@ -10,6 +10,7 @@ """ +from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_parent_all_of.py b/samples/client/petstore/python-experimental/test/test_parent_all_of.py index f6485ac3cc38..ca87189bba50 100644 --- a/samples/client/petstore/python-experimental/test/test_parent_all_of.py +++ b/samples/client/petstore/python-experimental/test/test_parent_all_of.py @@ -10,6 +10,7 @@ """ +from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_parent_pet.py b/samples/client/petstore/python-experimental/test/test_parent_pet.py index 4a69d88eb787..17a4d60e75dc 100644 --- a/samples/client/petstore/python-experimental/test/test_parent_pet.py +++ b/samples/client/petstore/python-experimental/test/test_parent_pet.py @@ -10,6 +10,7 @@ """ +from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_pet.py b/samples/client/petstore/python-experimental/test/test_pet.py index 9edf385aa26a..b072cff5e9ad 100644 --- a/samples/client/petstore/python-experimental/test/test_pet.py +++ b/samples/client/petstore/python-experimental/test/test_pet.py @@ -10,6 +10,7 @@ """ +from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_pet_api.py b/samples/client/petstore/python-experimental/test/test_pet_api.py index d545f497297a..091b30cf8ac0 100644 --- a/samples/client/petstore/python-experimental/test/test_pet_api.py +++ b/samples/client/petstore/python-experimental/test/test_pet_api.py @@ -10,6 +10,8 @@ """ +from __future__ import absolute_import +import sys import unittest import petstore_api diff --git a/samples/client/petstore/python-experimental/test/test_player.py b/samples/client/petstore/python-experimental/test/test_player.py index 6dc813787278..ee7b95a677f1 100644 --- a/samples/client/petstore/python-experimental/test/test_player.py +++ b/samples/client/petstore/python-experimental/test/test_player.py @@ -10,6 +10,7 @@ """ +from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_read_only_first.py b/samples/client/petstore/python-experimental/test/test_read_only_first.py index a07676e9c2de..c2dcde240e77 100644 --- a/samples/client/petstore/python-experimental/test/test_read_only_first.py +++ b/samples/client/petstore/python-experimental/test/test_read_only_first.py @@ -10,6 +10,7 @@ """ +from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_special_model_name.py b/samples/client/petstore/python-experimental/test/test_special_model_name.py index 4c525d99be5b..6124525f5170 100644 --- a/samples/client/petstore/python-experimental/test/test_special_model_name.py +++ b/samples/client/petstore/python-experimental/test/test_special_model_name.py @@ -10,6 +10,7 @@ """ +from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_store_api.py b/samples/client/petstore/python-experimental/test/test_store_api.py index 3680a34b42a0..0d9cc3dd36ea 100644 --- a/samples/client/petstore/python-experimental/test/test_store_api.py +++ b/samples/client/petstore/python-experimental/test/test_store_api.py @@ -10,6 +10,8 @@ """ +from __future__ import absolute_import + import unittest import petstore_api diff --git a/samples/client/petstore/python-experimental/test/test_string_boolean_map.py b/samples/client/petstore/python-experimental/test/test_string_boolean_map.py index e4e795cca2a9..e2e9d8b420b8 100644 --- a/samples/client/petstore/python-experimental/test/test_string_boolean_map.py +++ b/samples/client/petstore/python-experimental/test/test_string_boolean_map.py @@ -10,6 +10,7 @@ """ +from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_string_enum.py b/samples/client/petstore/python-experimental/test/test_string_enum.py index c7f463c444a1..5eed0ad6f0e9 100644 --- a/samples/client/petstore/python-experimental/test/test_string_enum.py +++ b/samples/client/petstore/python-experimental/test/test_string_enum.py @@ -10,6 +10,7 @@ """ +from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_tag.py b/samples/client/petstore/python-experimental/test/test_tag.py index 0ce1c0a87f1d..68a3b9046bf4 100644 --- a/samples/client/petstore/python-experimental/test/test_tag.py +++ b/samples/client/petstore/python-experimental/test/test_tag.py @@ -10,6 +10,7 @@ """ +from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_type_holder_default.py b/samples/client/petstore/python-experimental/test/test_type_holder_default.py index 4a517b305b68..f9c050b81a82 100644 --- a/samples/client/petstore/python-experimental/test/test_type_holder_default.py +++ b/samples/client/petstore/python-experimental/test/test_type_holder_default.py @@ -10,6 +10,7 @@ """ +from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_type_holder_example.py b/samples/client/petstore/python-experimental/test/test_type_holder_example.py index 8d3c5c745dfe..e1ee7c368628 100644 --- a/samples/client/petstore/python-experimental/test/test_type_holder_example.py +++ b/samples/client/petstore/python-experimental/test/test_type_holder_example.py @@ -10,6 +10,7 @@ """ +from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_user.py b/samples/client/petstore/python-experimental/test/test_user.py index df3d2fff6532..7241bb589c52 100644 --- a/samples/client/petstore/python-experimental/test/test_user.py +++ b/samples/client/petstore/python-experimental/test/test_user.py @@ -10,6 +10,7 @@ """ +from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_user_api.py b/samples/client/petstore/python-experimental/test/test_user_api.py index abf57b0733da..df306da07761 100644 --- a/samples/client/petstore/python-experimental/test/test_user_api.py +++ b/samples/client/petstore/python-experimental/test/test_user_api.py @@ -10,6 +10,8 @@ """ +from __future__ import absolute_import + import unittest import petstore_api diff --git a/samples/client/petstore/python-experimental/test/test_xml_item.py b/samples/client/petstore/python-experimental/test/test_xml_item.py index 04322addc2a7..4354664815ff 100644 --- a/samples/client/petstore/python-experimental/test/test_xml_item.py +++ b/samples/client/petstore/python-experimental/test/test_xml_item.py @@ -10,6 +10,7 @@ """ +from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/tests/test_api_exception.py b/samples/client/petstore/python-experimental/tests/test_api_exception.py index 3c415e2ad7b6..0d0771b57850 100644 --- a/samples/client/petstore/python-experimental/tests/test_api_exception.py +++ b/samples/client/petstore/python-experimental/tests/test_api_exception.py @@ -10,6 +10,7 @@ """ import os +import six import sys import unittest diff --git a/samples/client/petstore/python-experimental/tests/test_deserialization.py b/samples/client/petstore/python-experimental/tests/test_deserialization.py index a5b1a66e7a49..e9ef8951fa2d 100644 --- a/samples/client/petstore/python-experimental/tests/test_deserialization.py +++ b/samples/client/petstore/python-experimental/tests/test_deserialization.py @@ -15,6 +15,8 @@ import unittest import datetime +import six + import petstore_api from petstore_api.exceptions import ( @@ -377,7 +379,8 @@ def get_header(name, default=None): file_path = file_object.name self.assertFalse(file_object.closed) file_object.close() - file_data = file_data.encode('utf-8') + if six.PY3: + file_data = file_data.encode('utf-8') with open(file_path, 'rb') as other_file_object: self.assertEqual(other_file_object.read(), file_data) finally: @@ -402,7 +405,7 @@ def get_header(name, default=None): http_response = HTTPResponse( status=200, reason='OK', - data=json.dumps(data).encode("utf-8"), + data=json.dumps(data).encode("utf-8") if six.PY3 else json.dumps(data), getheaders=get_headers, getheader=get_header ) diff --git a/samples/client/petstore/python-experimental/tests/test_pet_api.py b/samples/client/petstore/python-experimental/tests/test_pet_api.py index 0a66b49c1d78..38d7a1cc0b82 100644 --- a/samples/client/petstore/python-experimental/tests/test_pet_api.py +++ b/samples/client/petstore/python-experimental/tests/test_pet_api.py @@ -23,6 +23,8 @@ RESTResponse ) +import six + from petstore_api.exceptions import ( ApiException, ApiValueError, @@ -34,7 +36,10 @@ import urllib3 -from unittest.mock import patch +if six.PY3: + from unittest.mock import patch +else: + from mock import patch HOST = 'http://localhost/v2' diff --git a/samples/client/petstore/python-experimental/tests/test_serialization.py b/samples/client/petstore/python-experimental/tests/test_serialization.py index 6f7166ee563b..1f718ecca6b5 100644 --- a/samples/client/petstore/python-experimental/tests/test_serialization.py +++ b/samples/client/petstore/python-experimental/tests/test_serialization.py @@ -15,6 +15,8 @@ import unittest import datetime +import six + import petstore_api from petstore_api.exceptions import ( diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/x_auth_id_alias/model_utils.py b/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/x_auth_id_alias/model_utils.py index 4bbe813f3694..6be24a8fc54a 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/x_auth_id_alias/model_utils.py +++ b/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/x_auth_id_alias/model_utils.py @@ -41,9 +41,9 @@ def __init__(self, fn): self._fn = fn def __get__(self, instance, cls=None): - try: + if self.result_key in vars(self): return vars(self)[self.result_key] - except KeyError: + else: result = self._fn() setattr(self, self.result_key, result) return result diff --git a/samples/openapi3/client/features/dynamic-servers/python-experimental/dynamic_servers/model_utils.py b/samples/openapi3/client/features/dynamic-servers/python-experimental/dynamic_servers/model_utils.py index c35b5a8531c8..685b622e6f0a 100644 --- a/samples/openapi3/client/features/dynamic-servers/python-experimental/dynamic_servers/model_utils.py +++ b/samples/openapi3/client/features/dynamic-servers/python-experimental/dynamic_servers/model_utils.py @@ -41,9 +41,9 @@ def __init__(self, fn): self._fn = fn def __get__(self, instance, cls=None): - try: + if self.result_key in vars(self): return vars(self)[self.result_key] - except KeyError: + else: result = self._fn() setattr(self, self.result_key, result) return result diff --git a/samples/openapi3/client/petstore/python-experimental/README.md b/samples/openapi3/client/petstore/python-experimental/README.md index c1f2770b3cc4..291496d24951 100644 --- a/samples/openapi3/client/petstore/python-experimental/README.md +++ b/samples/openapi3/client/petstore/python-experimental/README.md @@ -50,7 +50,7 @@ import time import petstore_api from pprint import pprint from petstore_api.api import another_fake_api -from petstore_api.model import client +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( @@ -63,11 +63,11 @@ configuration = petstore_api.Configuration( with petstore_api.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = another_fake_api.AnotherFakeApi(api_client) - client_client = client.Client() # client.Client | client model + client = Client() # Client | client model try: # To test special tags - api_response = api_instance.call_123_test_special_tags(client_client) + api_response = api_instance.call_123_test_special_tags(client) pprint(api_response) except petstore_api.ApiException as e: print("Exception when calling AnotherFakeApi->call_123_test_special_tags: %s\n" % e) @@ -126,94 +126,94 @@ Class | Method | HTTP request | Description ## Documentation For Models - - [additional_properties_class.AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md) - - [additional_properties_with_array_of_enums.AdditionalPropertiesWithArrayOfEnums](docs/AdditionalPropertiesWithArrayOfEnums.md) - - [address.Address](docs/Address.md) - - [animal.Animal](docs/Animal.md) - - [animal_farm.AnimalFarm](docs/AnimalFarm.md) - - [api_response.ApiResponse](docs/ApiResponse.md) - - [apple.Apple](docs/Apple.md) - - [apple_req.AppleReq](docs/AppleReq.md) - - [array_of_array_of_number_only.ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) - - [array_of_enums.ArrayOfEnums](docs/ArrayOfEnums.md) - - [array_of_number_only.ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) - - [array_test.ArrayTest](docs/ArrayTest.md) - - [banana.Banana](docs/Banana.md) - - [banana_req.BananaReq](docs/BananaReq.md) - - [basque_pig.BasquePig](docs/BasquePig.md) - - [capitalization.Capitalization](docs/Capitalization.md) - - [cat.Cat](docs/Cat.md) - - [cat_all_of.CatAllOf](docs/CatAllOf.md) - - [category.Category](docs/Category.md) - - [child_cat.ChildCat](docs/ChildCat.md) - - [child_cat_all_of.ChildCatAllOf](docs/ChildCatAllOf.md) - - [class_model.ClassModel](docs/ClassModel.md) - - [client.Client](docs/Client.md) - - [complex_quadrilateral.ComplexQuadrilateral](docs/ComplexQuadrilateral.md) - - [composed_one_of_number_with_validations.ComposedOneOfNumberWithValidations](docs/ComposedOneOfNumberWithValidations.md) - - [danish_pig.DanishPig](docs/DanishPig.md) - - [dog.Dog](docs/Dog.md) - - [dog_all_of.DogAllOf](docs/DogAllOf.md) - - [drawing.Drawing](docs/Drawing.md) - - [enum_arrays.EnumArrays](docs/EnumArrays.md) - - [enum_class.EnumClass](docs/EnumClass.md) - - [enum_test.EnumTest](docs/EnumTest.md) - - [equilateral_triangle.EquilateralTriangle](docs/EquilateralTriangle.md) - - [file.File](docs/File.md) - - [file_schema_test_class.FileSchemaTestClass](docs/FileSchemaTestClass.md) - - [foo.Foo](docs/Foo.md) - - [format_test.FormatTest](docs/FormatTest.md) - - [fruit.Fruit](docs/Fruit.md) - - [fruit_req.FruitReq](docs/FruitReq.md) - - [gm_fruit.GmFruit](docs/GmFruit.md) - - [grandparent_animal.GrandparentAnimal](docs/GrandparentAnimal.md) - - [has_only_read_only.HasOnlyReadOnly](docs/HasOnlyReadOnly.md) - - [health_check_result.HealthCheckResult](docs/HealthCheckResult.md) - - [inline_object.InlineObject](docs/InlineObject.md) - - [inline_object1.InlineObject1](docs/InlineObject1.md) - - [inline_object2.InlineObject2](docs/InlineObject2.md) - - [inline_object3.InlineObject3](docs/InlineObject3.md) - - [inline_object4.InlineObject4](docs/InlineObject4.md) - - [inline_object5.InlineObject5](docs/InlineObject5.md) - - [inline_response_default.InlineResponseDefault](docs/InlineResponseDefault.md) - - [integer_enum.IntegerEnum](docs/IntegerEnum.md) - - [integer_enum_one_value.IntegerEnumOneValue](docs/IntegerEnumOneValue.md) - - [integer_enum_with_default_value.IntegerEnumWithDefaultValue](docs/IntegerEnumWithDefaultValue.md) - - [isosceles_triangle.IsoscelesTriangle](docs/IsoscelesTriangle.md) - - [list.List](docs/List.md) - - [mammal.Mammal](docs/Mammal.md) - - [map_test.MapTest](docs/MapTest.md) - - [mixed_properties_and_additional_properties_class.MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) - - [model200_response.Model200Response](docs/Model200Response.md) - - [model_return.ModelReturn](docs/ModelReturn.md) - - [name.Name](docs/Name.md) - - [nullable_class.NullableClass](docs/NullableClass.md) - - [nullable_shape.NullableShape](docs/NullableShape.md) - - [number_only.NumberOnly](docs/NumberOnly.md) - - [number_with_validations.NumberWithValidations](docs/NumberWithValidations.md) - - [object_model_with_ref_props.ObjectModelWithRefProps](docs/ObjectModelWithRefProps.md) - - [order.Order](docs/Order.md) - - [parent_pet.ParentPet](docs/ParentPet.md) - - [pet.Pet](docs/Pet.md) - - [pig.Pig](docs/Pig.md) - - [quadrilateral.Quadrilateral](docs/Quadrilateral.md) - - [quadrilateral_interface.QuadrilateralInterface](docs/QuadrilateralInterface.md) - - [read_only_first.ReadOnlyFirst](docs/ReadOnlyFirst.md) - - [scalene_triangle.ScaleneTriangle](docs/ScaleneTriangle.md) - - [shape.Shape](docs/Shape.md) - - [shape_interface.ShapeInterface](docs/ShapeInterface.md) - - [shape_or_null.ShapeOrNull](docs/ShapeOrNull.md) - - [simple_quadrilateral.SimpleQuadrilateral](docs/SimpleQuadrilateral.md) - - [special_model_name.SpecialModelName](docs/SpecialModelName.md) - - [string_boolean_map.StringBooleanMap](docs/StringBooleanMap.md) - - [string_enum.StringEnum](docs/StringEnum.md) - - [string_enum_with_default_value.StringEnumWithDefaultValue](docs/StringEnumWithDefaultValue.md) - - [tag.Tag](docs/Tag.md) - - [triangle.Triangle](docs/Triangle.md) - - [triangle_interface.TriangleInterface](docs/TriangleInterface.md) - - [user.User](docs/User.md) - - [whale.Whale](docs/Whale.md) - - [zebra.Zebra](docs/Zebra.md) + - [AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md) + - [AdditionalPropertiesWithArrayOfEnums](docs/AdditionalPropertiesWithArrayOfEnums.md) + - [Address](docs/Address.md) + - [Animal](docs/Animal.md) + - [AnimalFarm](docs/AnimalFarm.md) + - [ApiResponse](docs/ApiResponse.md) + - [Apple](docs/Apple.md) + - [AppleReq](docs/AppleReq.md) + - [ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) + - [ArrayOfEnums](docs/ArrayOfEnums.md) + - [ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) + - [ArrayTest](docs/ArrayTest.md) + - [Banana](docs/Banana.md) + - [BananaReq](docs/BananaReq.md) + - [BasquePig](docs/BasquePig.md) + - [Capitalization](docs/Capitalization.md) + - [Cat](docs/Cat.md) + - [CatAllOf](docs/CatAllOf.md) + - [Category](docs/Category.md) + - [ChildCat](docs/ChildCat.md) + - [ChildCatAllOf](docs/ChildCatAllOf.md) + - [ClassModel](docs/ClassModel.md) + - [Client](docs/Client.md) + - [ComplexQuadrilateral](docs/ComplexQuadrilateral.md) + - [ComposedOneOfNumberWithValidations](docs/ComposedOneOfNumberWithValidations.md) + - [DanishPig](docs/DanishPig.md) + - [Dog](docs/Dog.md) + - [DogAllOf](docs/DogAllOf.md) + - [Drawing](docs/Drawing.md) + - [EnumArrays](docs/EnumArrays.md) + - [EnumClass](docs/EnumClass.md) + - [EnumTest](docs/EnumTest.md) + - [EquilateralTriangle](docs/EquilateralTriangle.md) + - [File](docs/File.md) + - [FileSchemaTestClass](docs/FileSchemaTestClass.md) + - [Foo](docs/Foo.md) + - [FormatTest](docs/FormatTest.md) + - [Fruit](docs/Fruit.md) + - [FruitReq](docs/FruitReq.md) + - [GmFruit](docs/GmFruit.md) + - [GrandparentAnimal](docs/GrandparentAnimal.md) + - [HasOnlyReadOnly](docs/HasOnlyReadOnly.md) + - [HealthCheckResult](docs/HealthCheckResult.md) + - [InlineObject](docs/InlineObject.md) + - [InlineObject1](docs/InlineObject1.md) + - [InlineObject2](docs/InlineObject2.md) + - [InlineObject3](docs/InlineObject3.md) + - [InlineObject4](docs/InlineObject4.md) + - [InlineObject5](docs/InlineObject5.md) + - [InlineResponseDefault](docs/InlineResponseDefault.md) + - [IntegerEnum](docs/IntegerEnum.md) + - [IntegerEnumOneValue](docs/IntegerEnumOneValue.md) + - [IntegerEnumWithDefaultValue](docs/IntegerEnumWithDefaultValue.md) + - [IsoscelesTriangle](docs/IsoscelesTriangle.md) + - [List](docs/List.md) + - [Mammal](docs/Mammal.md) + - [MapTest](docs/MapTest.md) + - [MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) + - [Model200Response](docs/Model200Response.md) + - [ModelReturn](docs/ModelReturn.md) + - [Name](docs/Name.md) + - [NullableClass](docs/NullableClass.md) + - [NullableShape](docs/NullableShape.md) + - [NumberOnly](docs/NumberOnly.md) + - [NumberWithValidations](docs/NumberWithValidations.md) + - [ObjectModelWithRefProps](docs/ObjectModelWithRefProps.md) + - [Order](docs/Order.md) + - [ParentPet](docs/ParentPet.md) + - [Pet](docs/Pet.md) + - [Pig](docs/Pig.md) + - [Quadrilateral](docs/Quadrilateral.md) + - [QuadrilateralInterface](docs/QuadrilateralInterface.md) + - [ReadOnlyFirst](docs/ReadOnlyFirst.md) + - [ScaleneTriangle](docs/ScaleneTriangle.md) + - [Shape](docs/Shape.md) + - [ShapeInterface](docs/ShapeInterface.md) + - [ShapeOrNull](docs/ShapeOrNull.md) + - [SimpleQuadrilateral](docs/SimpleQuadrilateral.md) + - [SpecialModelName](docs/SpecialModelName.md) + - [StringBooleanMap](docs/StringBooleanMap.md) + - [StringEnum](docs/StringEnum.md) + - [StringEnumWithDefaultValue](docs/StringEnumWithDefaultValue.md) + - [Tag](docs/Tag.md) + - [Triangle](docs/Triangle.md) + - [TriangleInterface](docs/TriangleInterface.md) + - [User](docs/User.md) + - [Whale](docs/Whale.md) + - [Zebra](docs/Zebra.md) ## Documentation For Authorization diff --git a/samples/openapi3/client/petstore/python-experimental/docs/AdditionalPropertiesClass.md b/samples/openapi3/client/petstore/python-experimental/docs/AdditionalPropertiesClass.md index 042d7c437d60..e54a02329f1b 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/AdditionalPropertiesClass.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/AdditionalPropertiesClass.md @@ -1,4 +1,4 @@ -# additional_properties_class.AdditionalPropertiesClass +# AdditionalPropertiesClass ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/AdditionalPropertiesWithArrayOfEnums.md b/samples/openapi3/client/petstore/python-experimental/docs/AdditionalPropertiesWithArrayOfEnums.md index 10ab1cf5b344..124de21cf330 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/AdditionalPropertiesWithArrayOfEnums.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/AdditionalPropertiesWithArrayOfEnums.md @@ -1,9 +1,9 @@ -# additional_properties_with_array_of_enums.AdditionalPropertiesWithArrayOfEnums +# AdditionalPropertiesWithArrayOfEnums ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**any string name** | **[enum_class.EnumClass]** | any string name can be used but the value must be the correct type | [optional] +**any string name** | **[EnumClass]** | 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-experimental/docs/Address.md b/samples/openapi3/client/petstore/python-experimental/docs/Address.md index 23a2f2b1aeca..f0699983eb7d 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/Address.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/Address.md @@ -1,4 +1,4 @@ -# address.Address +# Address ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Animal.md b/samples/openapi3/client/petstore/python-experimental/docs/Animal.md index fda84ee28eea..e59166a62e83 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/Animal.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/Animal.md @@ -1,4 +1,4 @@ -# animal.Animal +# Animal ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/AnimalFarm.md b/samples/openapi3/client/petstore/python-experimental/docs/AnimalFarm.md index c9976c7ddab9..0717b5d7df1f 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/AnimalFarm.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/AnimalFarm.md @@ -1,9 +1,9 @@ -# animal_farm.AnimalFarm +# AnimalFarm ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**value** | [**[animal.Animal]**](Animal.md) | | +**value** | [**[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-experimental/docs/AnotherFakeApi.md b/samples/openapi3/client/petstore/python-experimental/docs/AnotherFakeApi.md index b4f0834b1212..c0b203732c31 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/AnotherFakeApi.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/AnotherFakeApi.md @@ -8,7 +8,7 @@ Method | HTTP request | Description # **call_123_test_special_tags** -> client.Client call_123_test_special_tags(client_client) +> Client call_123_test_special_tags(client) To test special tags @@ -20,7 +20,7 @@ To test special tags and operation ID starting with number import time import petstore_api from petstore_api.api import another_fake_api -from petstore_api.model import client +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. @@ -33,12 +33,12 @@ configuration = petstore_api.Configuration( with petstore_api.ApiClient() as api_client: # Create an instance of the API class api_instance = another_fake_api.AnotherFakeApi(api_client) - client_client = client.Client() # client.Client | client model + client = Client() # Client | client model # example passing only required values which don't have defaults set try: # To test special tags - api_response = api_instance.call_123_test_special_tags(client_client) + api_response = api_instance.call_123_test_special_tags(client) pprint(api_response) except petstore_api.ApiException as e: print("Exception when calling AnotherFakeApi->call_123_test_special_tags: %s\n" % e) @@ -48,11 +48,11 @@ with petstore_api.ApiClient() as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **client_client** | [**client.Client**](Client.md)| client model | + **client** | [**Client**](Client.md)| client model | ### Return type -[**client.Client**](Client.md) +[**Client**](Client.md) ### Authorization diff --git a/samples/openapi3/client/petstore/python-experimental/docs/ApiResponse.md b/samples/openapi3/client/petstore/python-experimental/docs/ApiResponse.md index 8f7ffa461340..8fc302305abe 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/ApiResponse.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/ApiResponse.md @@ -1,4 +1,4 @@ -# api_response.ApiResponse +# ApiResponse ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Apple.md b/samples/openapi3/client/petstore/python-experimental/docs/Apple.md index bd9818b89778..bf729dc74527 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/Apple.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/Apple.md @@ -1,4 +1,4 @@ -# apple.Apple +# Apple ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/AppleReq.md b/samples/openapi3/client/petstore/python-experimental/docs/AppleReq.md index 3d6717ebd60c..03370bdb9685 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/AppleReq.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/AppleReq.md @@ -1,4 +1,4 @@ -# apple_req.AppleReq +# AppleReq ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/ArrayOfArrayOfNumberOnly.md b/samples/openapi3/client/petstore/python-experimental/docs/ArrayOfArrayOfNumberOnly.md index ab82c8c556d0..1a68df0090bb 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/ArrayOfArrayOfNumberOnly.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/ArrayOfArrayOfNumberOnly.md @@ -1,4 +1,4 @@ -# array_of_array_of_number_only.ArrayOfArrayOfNumberOnly +# ArrayOfArrayOfNumberOnly ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/ArrayOfEnums.md b/samples/openapi3/client/petstore/python-experimental/docs/ArrayOfEnums.md index e12fa68b8e97..8a1dfca693ae 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/ArrayOfEnums.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/ArrayOfEnums.md @@ -1,9 +1,9 @@ -# array_of_enums.ArrayOfEnums +# ArrayOfEnums ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**value** | [**[string_enum.StringEnum, none_type]**](StringEnum.md) | | +**value** | [**[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-experimental/docs/ArrayOfNumberOnly.md b/samples/openapi3/client/petstore/python-experimental/docs/ArrayOfNumberOnly.md index b8ffd843c8d8..b8a760f56dc2 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/ArrayOfNumberOnly.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/ArrayOfNumberOnly.md @@ -1,4 +1,4 @@ -# array_of_number_only.ArrayOfNumberOnly +# ArrayOfNumberOnly ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/ArrayTest.md b/samples/openapi3/client/petstore/python-experimental/docs/ArrayTest.md index 22f198440e7b..b94f23fd2271 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/ArrayTest.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/ArrayTest.md @@ -1,11 +1,11 @@ -# array_test.ArrayTest +# ArrayTest ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **array_of_string** | **[str]** | | [optional] **array_array_of_integer** | **[[int]]** | | [optional] -**array_array_of_model** | [**[[read_only_first.ReadOnlyFirst]]**](ReadOnlyFirst.md) | | [optional] +**array_array_of_model** | [**[[ReadOnlyFirst]]**](ReadOnlyFirst.md) | | [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-experimental/docs/Banana.md b/samples/openapi3/client/petstore/python-experimental/docs/Banana.md index ec8b3b902cc4..5a5364538baf 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/Banana.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/Banana.md @@ -1,4 +1,4 @@ -# banana.Banana +# Banana ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/BananaReq.md b/samples/openapi3/client/petstore/python-experimental/docs/BananaReq.md index 5cfe53ec741f..804f9f11eb0b 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/BananaReq.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/BananaReq.md @@ -1,4 +1,4 @@ -# banana_req.BananaReq +# BananaReq ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/BasquePig.md b/samples/openapi3/client/petstore/python-experimental/docs/BasquePig.md index 0e8f8bb27fba..5c8a32525299 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/BasquePig.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/BasquePig.md @@ -1,4 +1,4 @@ -# basque_pig.BasquePig +# BasquePig ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Capitalization.md b/samples/openapi3/client/petstore/python-experimental/docs/Capitalization.md index d402f2a571a8..85d88d239ee7 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/Capitalization.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/Capitalization.md @@ -1,4 +1,4 @@ -# capitalization.Capitalization +# Capitalization ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Cat.md b/samples/openapi3/client/petstore/python-experimental/docs/Cat.md index 846a97c82a84..d01b2effd044 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/Cat.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/Cat.md @@ -1,4 +1,4 @@ -# cat.Cat +# Cat ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/CatAllOf.md b/samples/openapi3/client/petstore/python-experimental/docs/CatAllOf.md index 653bb0aa3538..35434374fc97 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/CatAllOf.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/CatAllOf.md @@ -1,4 +1,4 @@ -# cat_all_of.CatAllOf +# CatAllOf ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Category.md b/samples/openapi3/client/petstore/python-experimental/docs/Category.md index bb122d910fcd..33b2242d703f 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/Category.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/Category.md @@ -1,4 +1,4 @@ -# category.Category +# Category ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/ChildCat.md b/samples/openapi3/client/petstore/python-experimental/docs/ChildCat.md index bee23082474c..d39ee461163f 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/ChildCat.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/ChildCat.md @@ -1,4 +1,4 @@ -# child_cat.ChildCat +# ChildCat ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/ChildCatAllOf.md b/samples/openapi3/client/petstore/python-experimental/docs/ChildCatAllOf.md index 2e84f31081f9..f48345511c10 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/ChildCatAllOf.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/ChildCatAllOf.md @@ -1,4 +1,4 @@ -# child_cat_all_of.ChildCatAllOf +# ChildCatAllOf ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/ClassModel.md b/samples/openapi3/client/petstore/python-experimental/docs/ClassModel.md index 3f5d0075c1bb..657d51a944de 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/ClassModel.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/ClassModel.md @@ -1,4 +1,4 @@ -# class_model.ClassModel +# ClassModel Model for testing model with \"_class\" property ## Properties diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Client.md b/samples/openapi3/client/petstore/python-experimental/docs/Client.md index 4c7ce57f750f..88e99384f92c 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/Client.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/Client.md @@ -1,4 +1,4 @@ -# client.Client +# Client ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/ComplexQuadrilateral.md b/samples/openapi3/client/petstore/python-experimental/docs/ComplexQuadrilateral.md index 4230b57b1262..672d5c2acb03 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/ComplexQuadrilateral.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/ComplexQuadrilateral.md @@ -1,4 +1,4 @@ -# complex_quadrilateral.ComplexQuadrilateral +# ComplexQuadrilateral ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/ComposedOneOfNumberWithValidations.md b/samples/openapi3/client/petstore/python-experimental/docs/ComposedOneOfNumberWithValidations.md index 1274b58a506f..453d1a4d5b1c 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/ComposedOneOfNumberWithValidations.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/ComposedOneOfNumberWithValidations.md @@ -1,4 +1,4 @@ -# composed_one_of_number_with_validations.ComposedOneOfNumberWithValidations +# ComposedOneOfNumberWithValidations this is a model that allows payloads of type object or number ## Properties diff --git a/samples/openapi3/client/petstore/python-experimental/docs/DanishPig.md b/samples/openapi3/client/petstore/python-experimental/docs/DanishPig.md index 65058d86e049..5501dc6b7c5a 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/DanishPig.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/DanishPig.md @@ -1,4 +1,4 @@ -# danish_pig.DanishPig +# DanishPig ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/DefaultApi.md b/samples/openapi3/client/petstore/python-experimental/docs/DefaultApi.md index 45617a26a759..3331aea8a25a 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/DefaultApi.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/DefaultApi.md @@ -8,7 +8,7 @@ Method | HTTP request | Description # **foo_get** -> inline_response_default.InlineResponseDefault foo_get() +> InlineResponseDefault foo_get() @@ -18,7 +18,7 @@ Method | HTTP request | Description import time import petstore_api from petstore_api.api import default_api -from petstore_api.model import inline_response_default +from petstore_api.model.inline_response_default import InlineResponseDefault 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. @@ -45,7 +45,7 @@ This endpoint does not need any parameter. ### Return type -[**inline_response_default.InlineResponseDefault**](InlineResponseDefault.md) +[**InlineResponseDefault**](InlineResponseDefault.md) ### Authorization diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Dog.md b/samples/openapi3/client/petstore/python-experimental/docs/Dog.md index 4c0497d67698..f2044b25341b 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/Dog.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/Dog.md @@ -1,4 +1,4 @@ -# dog.Dog +# Dog ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/DogAllOf.md b/samples/openapi3/client/petstore/python-experimental/docs/DogAllOf.md index da3c29557df7..36d3216f7b35 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/DogAllOf.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/DogAllOf.md @@ -1,4 +1,4 @@ -# dog_all_of.DogAllOf +# DogAllOf ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Drawing.md b/samples/openapi3/client/petstore/python-experimental/docs/Drawing.md index 1583a1dea01d..73500bc0c5d3 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/Drawing.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/Drawing.md @@ -1,13 +1,13 @@ -# drawing.Drawing +# Drawing ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**main_shape** | [**shape.Shape**](Shape.md) | | [optional] -**shape_or_null** | [**shape_or_null.ShapeOrNull**](ShapeOrNull.md) | | [optional] -**nullable_shape** | [**nullable_shape.NullableShape**](NullableShape.md) | | [optional] -**shapes** | [**[shape.Shape]**](Shape.md) | | [optional] -**any string name** | **fruit.Fruit** | any string name can be used but the value must be the correct type | [optional] +**main_shape** | [**Shape**](Shape.md) | | [optional] +**shape_or_null** | [**ShapeOrNull**](ShapeOrNull.md) | | [optional] +**nullable_shape** | [**NullableShape**](NullableShape.md) | | [optional] +**shapes** | [**[Shape]**](Shape.md) | | [optional] +**any string name** | **Fruit** | 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-experimental/docs/EnumArrays.md b/samples/openapi3/client/petstore/python-experimental/docs/EnumArrays.md index c2f22d45047c..e0b5582e9d5b 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/EnumArrays.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/EnumArrays.md @@ -1,4 +1,4 @@ -# enum_arrays.EnumArrays +# EnumArrays ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/EnumClass.md b/samples/openapi3/client/petstore/python-experimental/docs/EnumClass.md index 4a29732d861c..6e7ecf355ffc 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/EnumClass.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/EnumClass.md @@ -1,4 +1,4 @@ -# enum_class.EnumClass +# EnumClass ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/EnumTest.md b/samples/openapi3/client/petstore/python-experimental/docs/EnumTest.md index da6c24407081..70969239ca25 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/EnumTest.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/EnumTest.md @@ -1,4 +1,4 @@ -# enum_test.EnumTest +# EnumTest ## Properties Name | Type | Description | Notes @@ -7,11 +7,11 @@ Name | Type | Description | Notes **enum_string** | **str** | | [optional] **enum_integer** | **int** | | [optional] **enum_number** | **float** | | [optional] -**string_enum** | [**string_enum.StringEnum, none_type**](StringEnum.md) | | [optional] -**integer_enum** | [**integer_enum.IntegerEnum**](IntegerEnum.md) | | [optional] -**string_enum_with_default_value** | [**string_enum_with_default_value.StringEnumWithDefaultValue**](StringEnumWithDefaultValue.md) | | [optional] -**integer_enum_with_default_value** | [**integer_enum_with_default_value.IntegerEnumWithDefaultValue**](IntegerEnumWithDefaultValue.md) | | [optional] -**integer_enum_one_value** | [**integer_enum_one_value.IntegerEnumOneValue**](IntegerEnumOneValue.md) | | [optional] +**string_enum** | [**StringEnum**](StringEnum.md) | | [optional] +**integer_enum** | [**IntegerEnum**](IntegerEnum.md) | | [optional] +**string_enum_with_default_value** | [**StringEnumWithDefaultValue**](StringEnumWithDefaultValue.md) | | [optional] +**integer_enum_with_default_value** | [**IntegerEnumWithDefaultValue**](IntegerEnumWithDefaultValue.md) | | [optional] +**integer_enum_one_value** | [**IntegerEnumOneValue**](IntegerEnumOneValue.md) | | [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-experimental/docs/EquilateralTriangle.md b/samples/openapi3/client/petstore/python-experimental/docs/EquilateralTriangle.md index 2263b96b258f..e73229ddc462 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/EquilateralTriangle.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/EquilateralTriangle.md @@ -1,4 +1,4 @@ -# equilateral_triangle.EquilateralTriangle +# EquilateralTriangle ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/FakeApi.md b/samples/openapi3/client/petstore/python-experimental/docs/FakeApi.md index a9a8e6ca1151..47c7f50f3ecb 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/FakeApi.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/FakeApi.md @@ -26,7 +26,7 @@ Method | HTTP request | Description # **additional_properties_with_array_of_enums** -> additional_properties_with_array_of_enums.AdditionalPropertiesWithArrayOfEnums additional_properties_with_array_of_enums() +> AdditionalPropertiesWithArrayOfEnums additional_properties_with_array_of_enums() Additional Properties with Array of Enums @@ -36,7 +36,7 @@ Additional Properties with Array of Enums import time import petstore_api from petstore_api.api import fake_api -from petstore_api.model import additional_properties_with_array_of_enums +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. @@ -49,13 +49,13 @@ configuration = petstore_api.Configuration( with petstore_api.ApiClient() as api_client: # Create an instance of the API class api_instance = fake_api.FakeApi(api_client) - additional_properties_with_array_of_enums_additional_properties_with_array_of_enums = additional_properties_with_array_of_enums.AdditionalPropertiesWithArrayOfEnums() # additional_properties_with_array_of_enums.AdditionalPropertiesWithArrayOfEnums | Input enum (optional) + additional_properties_with_array_of_enums = AdditionalPropertiesWithArrayOfEnums() # AdditionalPropertiesWithArrayOfEnums | Input enum (optional) # example passing only required values which don't have defaults set # and optional values try: # Additional Properties with Array of Enums - api_response = api_instance.additional_properties_with_array_of_enums(additional_properties_with_array_of_enums_additional_properties_with_array_of_enums=additional_properties_with_array_of_enums_additional_properties_with_array_of_enums) + api_response = api_instance.additional_properties_with_array_of_enums(additional_properties_with_array_of_enums=additional_properties_with_array_of_enums) pprint(api_response) except petstore_api.ApiException as e: print("Exception when calling FakeApi->additional_properties_with_array_of_enums: %s\n" % e) @@ -65,11 +65,11 @@ with petstore_api.ApiClient() as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **additional_properties_with_array_of_enums_additional_properties_with_array_of_enums** | [**additional_properties_with_array_of_enums.AdditionalPropertiesWithArrayOfEnums**](AdditionalPropertiesWithArrayOfEnums.md)| Input enum | [optional] + **additional_properties_with_array_of_enums** | [**AdditionalPropertiesWithArrayOfEnums**](AdditionalPropertiesWithArrayOfEnums.md)| Input enum | [optional] ### Return type -[**additional_properties_with_array_of_enums.AdditionalPropertiesWithArrayOfEnums**](AdditionalPropertiesWithArrayOfEnums.md) +[**AdditionalPropertiesWithArrayOfEnums**](AdditionalPropertiesWithArrayOfEnums.md) ### Authorization @@ -88,7 +88,7 @@ No authorization required [[Back to top]](#) [[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** -> animal_farm.AnimalFarm array_model() +> AnimalFarm array_model() @@ -100,7 +100,7 @@ Test serialization of ArrayModel import time import petstore_api from petstore_api.api import fake_api -from petstore_api.model import animal_farm +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. @@ -113,7 +113,7 @@ configuration = petstore_api.Configuration( with petstore_api.ApiClient() as api_client: # Create an instance of the API class api_instance = fake_api.FakeApi(api_client) - body = animal_farm.AnimalFarm() # animal_farm.AnimalFarm | Input model (optional) + body = AnimalFarm() # AnimalFarm | Input model (optional) # example passing only required values which don't have defaults set # and optional values @@ -128,11 +128,11 @@ with petstore_api.ApiClient() as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**animal_farm.AnimalFarm**](AnimalFarm.md)| Input model | [optional] + **body** | [**AnimalFarm**](AnimalFarm.md)| Input model | [optional] ### Return type -[**animal_farm.AnimalFarm**](AnimalFarm.md) +[**AnimalFarm**](AnimalFarm.md) ### Authorization @@ -151,7 +151,7 @@ No authorization required [[Back to top]](#) [[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** -> array_of_enums.ArrayOfEnums array_of_enums() +> ArrayOfEnums array_of_enums() Array of Enums @@ -161,7 +161,7 @@ Array of Enums import time import petstore_api from petstore_api.api import fake_api -from petstore_api.model import array_of_enums +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. @@ -174,13 +174,13 @@ configuration = petstore_api.Configuration( with petstore_api.ApiClient() as api_client: # Create an instance of the API class api_instance = fake_api.FakeApi(api_client) - array_of_enums_array_of_enums = array_of_enums.ArrayOfEnums() # array_of_enums.ArrayOfEnums | Input enum (optional) + array_of_enums = ArrayOfEnums() # ArrayOfEnums | Input enum (optional) # example passing only required values which don't have defaults set # and optional values try: # Array of Enums - api_response = api_instance.array_of_enums(array_of_enums_array_of_enums=array_of_enums_array_of_enums) + api_response = api_instance.array_of_enums(array_of_enums=array_of_enums) pprint(api_response) except petstore_api.ApiException as e: print("Exception when calling FakeApi->array_of_enums: %s\n" % e) @@ -190,11 +190,11 @@ with petstore_api.ApiClient() as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **array_of_enums_array_of_enums** | [**array_of_enums.ArrayOfEnums**](ArrayOfEnums.md)| Input enum | [optional] + **array_of_enums** | [**ArrayOfEnums**](ArrayOfEnums.md)| Input enum | [optional] ### Return type -[**array_of_enums.ArrayOfEnums**](ArrayOfEnums.md) +[**ArrayOfEnums**](ArrayOfEnums.md) ### Authorization @@ -275,7 +275,7 @@ No authorization required [[Back to top]](#) [[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_number_with_validations** -> composed_one_of_number_with_validations.ComposedOneOfNumberWithValidations composed_one_of_number_with_validations() +> ComposedOneOfNumberWithValidations composed_one_of_number_with_validations() @@ -287,7 +287,7 @@ Test serialization of object with $refed properties import time import petstore_api from petstore_api.api import fake_api -from petstore_api.model import composed_one_of_number_with_validations +from petstore_api.model.composed_one_of_number_with_validations import ComposedOneOfNumberWithValidations 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. @@ -300,12 +300,12 @@ configuration = petstore_api.Configuration( with petstore_api.ApiClient() as api_client: # Create an instance of the API class api_instance = fake_api.FakeApi(api_client) - composed_one_of_number_with_validations_composed_one_of_number_with_validations = composed_one_of_number_with_validations.ComposedOneOfNumberWithValidations() # composed_one_of_number_with_validations.ComposedOneOfNumberWithValidations | Input model (optional) + composed_one_of_number_with_validations = ComposedOneOfNumberWithValidations() # ComposedOneOfNumberWithValidations | Input model (optional) # example passing only required values which don't have defaults set # and optional values try: - api_response = api_instance.composed_one_of_number_with_validations(composed_one_of_number_with_validations_composed_one_of_number_with_validations=composed_one_of_number_with_validations_composed_one_of_number_with_validations) + api_response = api_instance.composed_one_of_number_with_validations(composed_one_of_number_with_validations=composed_one_of_number_with_validations) pprint(api_response) except petstore_api.ApiException as e: print("Exception when calling FakeApi->composed_one_of_number_with_validations: %s\n" % e) @@ -315,11 +315,11 @@ with petstore_api.ApiClient() as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **composed_one_of_number_with_validations_composed_one_of_number_with_validations** | [**composed_one_of_number_with_validations.ComposedOneOfNumberWithValidations**](ComposedOneOfNumberWithValidations.md)| Input model | [optional] + **composed_one_of_number_with_validations** | [**ComposedOneOfNumberWithValidations**](ComposedOneOfNumberWithValidations.md)| Input model | [optional] ### Return type -[**composed_one_of_number_with_validations.ComposedOneOfNumberWithValidations**](ComposedOneOfNumberWithValidations.md) +[**ComposedOneOfNumberWithValidations**](ComposedOneOfNumberWithValidations.md) ### Authorization @@ -338,7 +338,7 @@ No authorization required [[Back to top]](#) [[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** -> health_check_result.HealthCheckResult fake_health_get() +> HealthCheckResult fake_health_get() Health check endpoint @@ -348,7 +348,7 @@ Health check endpoint import time import petstore_api from petstore_api.api import fake_api -from petstore_api.model import health_check_result +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. @@ -376,7 +376,7 @@ This endpoint does not need any parameter. ### Return type -[**health_check_result.HealthCheckResult**](HealthCheckResult.md) +[**HealthCheckResult**](HealthCheckResult.md) ### Authorization @@ -395,7 +395,7 @@ No authorization required [[Back to top]](#) [[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** -> number_with_validations.NumberWithValidations number_with_validations() +> NumberWithValidations number_with_validations() @@ -407,7 +407,7 @@ Test serialization of outer number types import time import petstore_api from petstore_api.api import fake_api -from petstore_api.model import number_with_validations +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. @@ -420,7 +420,7 @@ configuration = petstore_api.Configuration( with petstore_api.ApiClient() as api_client: # Create an instance of the API class api_instance = fake_api.FakeApi(api_client) - body = number_with_validations.NumberWithValidations(3.4) # number_with_validations.NumberWithValidations | Input number as post body (optional) + body = NumberWithValidations(3.4) # NumberWithValidations | Input number as post body (optional) # example passing only required values which don't have defaults set # and optional values @@ -435,11 +435,11 @@ with petstore_api.ApiClient() as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**number_with_validations.NumberWithValidations**](NumberWithValidations.md)| Input number as post body | [optional] + **body** | [**NumberWithValidations**](NumberWithValidations.md)| Input number as post body | [optional] ### Return type -[**number_with_validations.NumberWithValidations**](NumberWithValidations.md) +[**NumberWithValidations**](NumberWithValidations.md) ### Authorization @@ -458,7 +458,7 @@ No authorization required [[Back to top]](#) [[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** -> object_model_with_ref_props.ObjectModelWithRefProps object_model_with_ref_props() +> ObjectModelWithRefProps object_model_with_ref_props() @@ -470,7 +470,7 @@ Test serialization of object with $refed properties import time import petstore_api from petstore_api.api import fake_api -from petstore_api.model import object_model_with_ref_props +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. @@ -483,7 +483,7 @@ configuration = petstore_api.Configuration( with petstore_api.ApiClient() as api_client: # Create an instance of the API class api_instance = fake_api.FakeApi(api_client) - body = object_model_with_ref_props.ObjectModelWithRefProps() # object_model_with_ref_props.ObjectModelWithRefProps | Input model (optional) + body = ObjectModelWithRefProps() # ObjectModelWithRefProps | Input model (optional) # example passing only required values which don't have defaults set # and optional values @@ -498,11 +498,11 @@ with petstore_api.ApiClient() as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**object_model_with_ref_props.ObjectModelWithRefProps**](ObjectModelWithRefProps.md)| Input model | [optional] + **body** | [**ObjectModelWithRefProps**](ObjectModelWithRefProps.md)| Input model | [optional] ### Return type -[**object_model_with_ref_props.ObjectModelWithRefProps**](ObjectModelWithRefProps.md) +[**ObjectModelWithRefProps**](ObjectModelWithRefProps.md) ### Authorization @@ -583,7 +583,7 @@ No authorization required [[Back to top]](#) [[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** -> string_enum.StringEnum string_enum() +> StringEnum string_enum() @@ -595,7 +595,7 @@ Test serialization of outer enum import time import petstore_api from petstore_api.api import fake_api -from petstore_api.model import string_enum +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. @@ -608,7 +608,7 @@ configuration = petstore_api.Configuration( with petstore_api.ApiClient() as api_client: # Create an instance of the API class api_instance = fake_api.FakeApi(api_client) - body = string_enum.StringEnum("placed") # string_enum.StringEnum | Input enum (optional) + body = StringEnum("placed") # StringEnum | Input enum (optional) # example passing only required values which don't have defaults set # and optional values @@ -623,11 +623,11 @@ with petstore_api.ApiClient() as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**string_enum.StringEnum**](StringEnum.md)| Input enum | [optional] + **body** | [**StringEnum**](StringEnum.md)| Input enum | [optional] ### Return type -[**string_enum.StringEnum**](StringEnum.md) +[**StringEnum**](StringEnum.md) ### Authorization @@ -646,7 +646,7 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **test_body_with_file_schema** -> test_body_with_file_schema(file_schema_test_class_file_schema_test_class) +> test_body_with_file_schema(file_schema_test_class) @@ -658,7 +658,7 @@ For this test, the body for this request much reference a schema named `File`. import time import petstore_api from petstore_api.api import fake_api -from petstore_api.model import file_schema_test_class +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. @@ -671,11 +671,11 @@ configuration = petstore_api.Configuration( with petstore_api.ApiClient() as api_client: # Create an instance of the API class api_instance = fake_api.FakeApi(api_client) - file_schema_test_class_file_schema_test_class = file_schema_test_class.FileSchemaTestClass() # file_schema_test_class.FileSchemaTestClass | + file_schema_test_class = FileSchemaTestClass() # FileSchemaTestClass | # example passing only required values which don't have defaults set try: - api_instance.test_body_with_file_schema(file_schema_test_class_file_schema_test_class) + api_instance.test_body_with_file_schema(file_schema_test_class) except petstore_api.ApiException as e: print("Exception when calling FakeApi->test_body_with_file_schema: %s\n" % e) ``` @@ -684,7 +684,7 @@ with petstore_api.ApiClient() as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **file_schema_test_class_file_schema_test_class** | [**file_schema_test_class.FileSchemaTestClass**](FileSchemaTestClass.md)| | + **file_schema_test_class** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| | ### Return type @@ -707,7 +707,7 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **test_body_with_query_params** -> test_body_with_query_params(query, user_user) +> test_body_with_query_params(query, user) @@ -717,7 +717,7 @@ No authorization required import time import petstore_api from petstore_api.api import fake_api -from petstore_api.model import user +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. @@ -731,11 +731,11 @@ with petstore_api.ApiClient() as api_client: # Create an instance of the API class api_instance = fake_api.FakeApi(api_client) query = 'query_example' # str | - user_user = user.User() # user.User | + user = User() # User | # example passing only required values which don't have defaults set try: - api_instance.test_body_with_query_params(query, user_user) + api_instance.test_body_with_query_params(query, user) except petstore_api.ApiException as e: print("Exception when calling FakeApi->test_body_with_query_params: %s\n" % e) ``` @@ -745,7 +745,7 @@ with petstore_api.ApiClient() as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **query** | **str**| | - **user_user** | [**user.User**](User.md)| | + **user** | [**User**](User.md)| | ### Return type @@ -768,7 +768,7 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **test_client_model** -> client.Client test_client_model(client_client) +> Client test_client_model(client) To test \"client\" model @@ -780,7 +780,7 @@ To test \"client\" model import time import petstore_api from petstore_api.api import fake_api -from petstore_api.model import client +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. @@ -793,12 +793,12 @@ configuration = petstore_api.Configuration( with petstore_api.ApiClient() as api_client: # Create an instance of the API class api_instance = fake_api.FakeApi(api_client) - client_client = client.Client() # client.Client | client model + client = Client() # Client | client model # example passing only required values which don't have defaults set try: # To test \"client\" model - api_response = api_instance.test_client_model(client_client) + api_response = api_instance.test_client_model(client) pprint(api_response) except petstore_api.ApiException as e: print("Exception when calling FakeApi->test_client_model: %s\n" % e) @@ -808,11 +808,11 @@ with petstore_api.ApiClient() as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **client_client** | [**client.Client**](Client.md)| client model | + **client** | [**Client**](Client.md)| client model | ### Return type -[**client.Client**](Client.md) +[**Client**](Client.md) ### Authorization diff --git a/samples/openapi3/client/petstore/python-experimental/docs/FakeClassnameTags123Api.md b/samples/openapi3/client/petstore/python-experimental/docs/FakeClassnameTags123Api.md index 713737dfb51d..fa046d30ddb1 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/FakeClassnameTags123Api.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/FakeClassnameTags123Api.md @@ -8,7 +8,7 @@ Method | HTTP request | Description # **test_classname** -> client.Client test_classname(client_client) +> Client test_classname(client) To test class name in snake case @@ -21,7 +21,7 @@ To test class name in snake case import time import petstore_api from petstore_api.api import fake_classname_tags_123_api -from petstore_api.model import client +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. @@ -48,12 +48,12 @@ configuration = petstore_api.Configuration( with petstore_api.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = fake_classname_tags_123_api.FakeClassnameTags123Api(api_client) - client_client = client.Client() # client.Client | client model + client = Client() # Client | client model # example passing only required values which don't have defaults set try: # To test class name in snake case - api_response = api_instance.test_classname(client_client) + api_response = api_instance.test_classname(client) pprint(api_response) except petstore_api.ApiException as e: print("Exception when calling FakeClassnameTags123Api->test_classname: %s\n" % e) @@ -63,11 +63,11 @@ with petstore_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **client_client** | [**client.Client**](Client.md)| client model | + **client** | [**Client**](Client.md)| client model | ### Return type -[**client.Client**](Client.md) +[**Client**](Client.md) ### Authorization diff --git a/samples/openapi3/client/petstore/python-experimental/docs/File.md b/samples/openapi3/client/petstore/python-experimental/docs/File.md index 2847323a0989..f17ba0057d04 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/File.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/File.md @@ -1,4 +1,4 @@ -# file.File +# File Must be named `File` for test. ## Properties diff --git a/samples/openapi3/client/petstore/python-experimental/docs/FileSchemaTestClass.md b/samples/openapi3/client/petstore/python-experimental/docs/FileSchemaTestClass.md index 807350c62f2c..d0a8bbaaba95 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/FileSchemaTestClass.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/FileSchemaTestClass.md @@ -1,10 +1,10 @@ -# file_schema_test_class.FileSchemaTestClass +# FileSchemaTestClass ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**file** | [**file.File**](File.md) | | [optional] -**files** | [**[file.File]**](File.md) | | [optional] +**file** | [**File**](File.md) | | [optional] +**files** | [**[File]**](File.md) | | [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-experimental/docs/Foo.md b/samples/openapi3/client/petstore/python-experimental/docs/Foo.md index 570d1dac0930..5b281fa08de7 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/Foo.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/Foo.md @@ -1,4 +1,4 @@ -# foo.Foo +# Foo ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/FormatTest.md b/samples/openapi3/client/petstore/python-experimental/docs/FormatTest.md index cb7e31877a70..2ac0ffb36d33 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/FormatTest.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/FormatTest.md @@ -1,4 +1,4 @@ -# format_test.FormatTest +# FormatTest ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Fruit.md b/samples/openapi3/client/petstore/python-experimental/docs/Fruit.md index 787699f2eb3a..9a15349d34b5 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/Fruit.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/Fruit.md @@ -1,4 +1,4 @@ -# fruit.Fruit +# Fruit ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/FruitReq.md b/samples/openapi3/client/petstore/python-experimental/docs/FruitReq.md index 22eeb37f1cc3..b192b0caeb42 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/FruitReq.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/FruitReq.md @@ -1,4 +1,4 @@ -# fruit_req.FruitReq +# FruitReq ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/GmFruit.md b/samples/openapi3/client/petstore/python-experimental/docs/GmFruit.md index ea21af6ad1f8..b5ec2fba3a04 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/GmFruit.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/GmFruit.md @@ -1,4 +1,4 @@ -# gm_fruit.GmFruit +# GmFruit ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/GrandparentAnimal.md b/samples/openapi3/client/petstore/python-experimental/docs/GrandparentAnimal.md index 8a6679f3895f..2a9d89c76d95 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/GrandparentAnimal.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/GrandparentAnimal.md @@ -1,4 +1,4 @@ -# grandparent_animal.GrandparentAnimal +# GrandparentAnimal ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/HasOnlyReadOnly.md b/samples/openapi3/client/petstore/python-experimental/docs/HasOnlyReadOnly.md index f2194e269ed3..f731a42eab54 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/HasOnlyReadOnly.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/HasOnlyReadOnly.md @@ -1,4 +1,4 @@ -# has_only_read_only.HasOnlyReadOnly +# HasOnlyReadOnly ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/HealthCheckResult.md b/samples/openapi3/client/petstore/python-experimental/docs/HealthCheckResult.md index 280ddc2eaf31..50cf84f69133 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/HealthCheckResult.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/HealthCheckResult.md @@ -1,4 +1,4 @@ -# health_check_result.HealthCheckResult +# HealthCheckResult Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. ## Properties diff --git a/samples/openapi3/client/petstore/python-experimental/docs/InlineObject.md b/samples/openapi3/client/petstore/python-experimental/docs/InlineObject.md index 362cc36d1f03..f567ea188ce0 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/InlineObject.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/InlineObject.md @@ -1,4 +1,4 @@ -# inline_object.InlineObject +# InlineObject ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/InlineObject1.md b/samples/openapi3/client/petstore/python-experimental/docs/InlineObject1.md index 3090ff26994a..4349ad73e3b7 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/InlineObject1.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/InlineObject1.md @@ -1,4 +1,4 @@ -# inline_object1.InlineObject1 +# InlineObject1 ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/InlineObject2.md b/samples/openapi3/client/petstore/python-experimental/docs/InlineObject2.md index f8ea923f4e06..106488e8598e 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/InlineObject2.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/InlineObject2.md @@ -1,4 +1,4 @@ -# inline_object2.InlineObject2 +# InlineObject2 ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/InlineObject3.md b/samples/openapi3/client/petstore/python-experimental/docs/InlineObject3.md index 69815c5e63c0..34d5eb478457 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/InlineObject3.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/InlineObject3.md @@ -1,4 +1,4 @@ -# inline_object3.InlineObject3 +# InlineObject3 ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/InlineObject4.md b/samples/openapi3/client/petstore/python-experimental/docs/InlineObject4.md index 30ee0475e799..07574d0d0769 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/InlineObject4.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/InlineObject4.md @@ -1,4 +1,4 @@ -# inline_object4.InlineObject4 +# InlineObject4 ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/InlineObject5.md b/samples/openapi3/client/petstore/python-experimental/docs/InlineObject5.md index 56d245f16831..8f8662c434db 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/InlineObject5.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/InlineObject5.md @@ -1,4 +1,4 @@ -# inline_object5.InlineObject5 +# InlineObject5 ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/InlineResponseDefault.md b/samples/openapi3/client/petstore/python-experimental/docs/InlineResponseDefault.md index 295326496d7d..9c754420f24a 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/InlineResponseDefault.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/InlineResponseDefault.md @@ -1,9 +1,9 @@ -# inline_response_default.InlineResponseDefault +# InlineResponseDefault ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**string** | [**foo.Foo**](Foo.md) | | [optional] +**string** | [**Foo**](Foo.md) | | [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-experimental/docs/IntegerEnum.md b/samples/openapi3/client/petstore/python-experimental/docs/IntegerEnum.md index cd3a799f2f57..9ef38c07047b 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/IntegerEnum.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/IntegerEnum.md @@ -1,4 +1,4 @@ -# integer_enum.IntegerEnum +# IntegerEnum ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/IntegerEnumOneValue.md b/samples/openapi3/client/petstore/python-experimental/docs/IntegerEnumOneValue.md index e70e4b28e15f..dda321694f53 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/IntegerEnumOneValue.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/IntegerEnumOneValue.md @@ -1,4 +1,4 @@ -# integer_enum_one_value.IntegerEnumOneValue +# IntegerEnumOneValue ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/IntegerEnumWithDefaultValue.md b/samples/openapi3/client/petstore/python-experimental/docs/IntegerEnumWithDefaultValue.md index b921f8217e9a..b2ae7cef0d36 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/IntegerEnumWithDefaultValue.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/IntegerEnumWithDefaultValue.md @@ -1,4 +1,4 @@ -# integer_enum_with_default_value.IntegerEnumWithDefaultValue +# IntegerEnumWithDefaultValue ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/IsoscelesTriangle.md b/samples/openapi3/client/petstore/python-experimental/docs/IsoscelesTriangle.md index 335edad8c0fe..e80ec0983a55 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/IsoscelesTriangle.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/IsoscelesTriangle.md @@ -1,4 +1,4 @@ -# isosceles_triangle.IsoscelesTriangle +# IsoscelesTriangle ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/List.md b/samples/openapi3/client/petstore/python-experimental/docs/List.md index 28e2ec05968c..11f4f3a05f32 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/List.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/List.md @@ -1,4 +1,4 @@ -# list.List +# List ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Mammal.md b/samples/openapi3/client/petstore/python-experimental/docs/Mammal.md index 8aadf030d29b..3ad5538e6e7e 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/Mammal.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/Mammal.md @@ -1,4 +1,4 @@ -# mammal.Mammal +# Mammal ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/MapTest.md b/samples/openapi3/client/petstore/python-experimental/docs/MapTest.md index 9fc13abebdc0..ad561b7220bf 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/MapTest.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/MapTest.md @@ -1,4 +1,4 @@ -# map_test.MapTest +# MapTest ## Properties Name | Type | Description | Notes @@ -6,7 +6,7 @@ Name | Type | Description | Notes **map_map_of_string** | **{str: ({str: (str,)},)}** | | [optional] **map_of_enum_string** | **{str: (str,)}** | | [optional] **direct_map** | **{str: (bool,)}** | | [optional] -**indirect_map** | [**string_boolean_map.StringBooleanMap**](StringBooleanMap.md) | | [optional] +**indirect_map** | [**StringBooleanMap**](StringBooleanMap.md) | | [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-experimental/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/openapi3/client/petstore/python-experimental/docs/MixedPropertiesAndAdditionalPropertiesClass.md index 87cda996e769..1484c0638d83 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/MixedPropertiesAndAdditionalPropertiesClass.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/MixedPropertiesAndAdditionalPropertiesClass.md @@ -1,11 +1,11 @@ -# mixed_properties_and_additional_properties_class.MixedPropertiesAndAdditionalPropertiesClass +# MixedPropertiesAndAdditionalPropertiesClass ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **uuid** | **str** | | [optional] **date_time** | **datetime** | | [optional] -**map** | [**{str: (animal.Animal,)}**](Animal.md) | | [optional] +**map** | [**{str: (Animal,)}**](Animal.md) | | [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-experimental/docs/Model200Response.md b/samples/openapi3/client/petstore/python-experimental/docs/Model200Response.md index 90f5c2c025d8..40d0d7828e14 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/Model200Response.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/Model200Response.md @@ -1,4 +1,4 @@ -# model200_response.Model200Response +# Model200Response Model for testing model name starting with number ## Properties diff --git a/samples/openapi3/client/petstore/python-experimental/docs/ModelReturn.md b/samples/openapi3/client/petstore/python-experimental/docs/ModelReturn.md index 3be9912b753e..65ec73ddae78 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/ModelReturn.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/ModelReturn.md @@ -1,4 +1,4 @@ -# model_return.ModelReturn +# ModelReturn Model for testing reserved words ## Properties diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Name.md b/samples/openapi3/client/petstore/python-experimental/docs/Name.md index 777b79a3d8bd..807b76afc6ee 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/Name.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/Name.md @@ -1,4 +1,4 @@ -# name.Name +# Name Model for testing model name same as property name ## Properties diff --git a/samples/openapi3/client/petstore/python-experimental/docs/NullableClass.md b/samples/openapi3/client/petstore/python-experimental/docs/NullableClass.md index 00037cf35fa2..0789eb8ad1a4 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/NullableClass.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/NullableClass.md @@ -1,4 +1,4 @@ -# nullable_class.NullableClass +# NullableClass ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/NullableShape.md b/samples/openapi3/client/petstore/python-experimental/docs/NullableShape.md index 82b0d9494066..3ebce34d8f80 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/NullableShape.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/NullableShape.md @@ -1,4 +1,4 @@ -# nullable_shape.NullableShape +# NullableShape The value may be a shape or the 'null' value. The 'nullable' attribute was introduced in OAS schema >= 3.0 and has been deprecated in OAS schema >= 3.1. ## Properties diff --git a/samples/openapi3/client/petstore/python-experimental/docs/NumberOnly.md b/samples/openapi3/client/petstore/python-experimental/docs/NumberOnly.md index ea1a09d2934d..93a0fde7b931 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/NumberOnly.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/NumberOnly.md @@ -1,4 +1,4 @@ -# number_only.NumberOnly +# NumberOnly ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/NumberWithValidations.md b/samples/openapi3/client/petstore/python-experimental/docs/NumberWithValidations.md index b6eb738a2a8d..402eb8325bc7 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/NumberWithValidations.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/NumberWithValidations.md @@ -1,4 +1,4 @@ -# number_with_validations.NumberWithValidations +# NumberWithValidations ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/ObjectModelWithRefProps.md b/samples/openapi3/client/petstore/python-experimental/docs/ObjectModelWithRefProps.md index 6c308497b60b..9a94ef8f61cc 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/ObjectModelWithRefProps.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/ObjectModelWithRefProps.md @@ -1,10 +1,10 @@ -# object_model_with_ref_props.ObjectModelWithRefProps +# ObjectModelWithRefProps a model that includes properties which should stay primitive (String + Boolean) and one which is defined as a class, NumberWithValidations ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**my_number** | [**number_with_validations.NumberWithValidations**](NumberWithValidations.md) | | [optional] +**my_number** | [**NumberWithValidations**](NumberWithValidations.md) | | [optional] **my_string** | **str** | | [optional] **my_boolean** | **bool** | | [optional] diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Order.md b/samples/openapi3/client/petstore/python-experimental/docs/Order.md index 9569ea55e55c..c21210a3bd59 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/Order.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/Order.md @@ -1,4 +1,4 @@ -# order.Order +# Order ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/ParentPet.md b/samples/openapi3/client/petstore/python-experimental/docs/ParentPet.md index 78693cf8f0e6..6e2571150d04 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/ParentPet.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/ParentPet.md @@ -1,4 +1,4 @@ -# parent_pet.ParentPet +# ParentPet ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Pet.md b/samples/openapi3/client/petstore/python-experimental/docs/Pet.md index a1ea5598e861..ce09d401c899 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/Pet.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/Pet.md @@ -1,4 +1,4 @@ -# pet.Pet +# Pet ## Properties Name | Type | Description | Notes @@ -6,8 +6,8 @@ Name | Type | Description | Notes **name** | **str** | | **photo_urls** | **[str]** | | **id** | **int** | | [optional] -**category** | [**category.Category**](Category.md) | | [optional] -**tags** | [**[tag.Tag]**](Tag.md) | | [optional] +**category** | [**Category**](Category.md) | | [optional] +**tags** | [**[Tag]**](Tag.md) | | [optional] **status** | **str** | pet status in the store | [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-experimental/docs/PetApi.md b/samples/openapi3/client/petstore/python-experimental/docs/PetApi.md index a29af68a4c14..94c9629a8c23 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/PetApi.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/PetApi.md @@ -16,7 +16,7 @@ Method | HTTP request | Description # **add_pet** -> add_pet(pet_pet) +> add_pet(pet) Add a new pet to the store @@ -27,7 +27,7 @@ Add a new pet to the store import time import petstore_api from petstore_api.api import pet_api -from petstore_api.model import pet +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. @@ -110,12 +110,12 @@ configuration.access_token = 'YOUR_ACCESS_TOKEN' with petstore_api.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = pet_api.PetApi(api_client) - pet_pet = pet.Pet() # pet.Pet | Pet object that needs to be added to the store + pet = Pet() # Pet | Pet object that needs to be added to the store # example passing only required values which don't have defaults set try: # Add a new pet to the store - api_instance.add_pet(pet_pet) + api_instance.add_pet(pet) except petstore_api.ApiException as e: print("Exception when calling PetApi->add_pet: %s\n" % e) ``` @@ -124,7 +124,7 @@ with petstore_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **pet_pet** | [**pet.Pet**](Pet.md)| Pet object that needs to be added to the store | + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | ### Return type @@ -227,7 +227,7 @@ void (empty response body) [[Back to top]](#) [[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.Pet] find_pets_by_status(status) +> [Pet] find_pets_by_status(status) Finds Pets by status @@ -240,7 +240,7 @@ Multiple status values can be provided with comma separated strings import time import petstore_api from petstore_api.api import pet_api -from petstore_api.model import pet +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. @@ -342,7 +342,7 @@ Name | Type | Description | Notes ### Return type -[**[pet.Pet]**](Pet.md) +[**[Pet]**](Pet.md) ### Authorization @@ -362,7 +362,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[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.Pet] find_pets_by_tags(tags) +> [Pet] find_pets_by_tags(tags) Finds Pets by tags @@ -375,7 +375,7 @@ Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 import time import petstore_api from petstore_api.api import pet_api -from petstore_api.model import pet +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. @@ -477,7 +477,7 @@ Name | Type | Description | Notes ### Return type -[**[pet.Pet]**](Pet.md) +[**[Pet]**](Pet.md) ### Authorization @@ -497,7 +497,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[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.Pet get_pet_by_id(pet_id) +> Pet get_pet_by_id(pet_id) Find pet by ID @@ -510,7 +510,7 @@ Returns a single pet import time import petstore_api from petstore_api.api import pet_api -from petstore_api.model import pet +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. @@ -556,7 +556,7 @@ Name | Type | Description | Notes ### Return type -[**pet.Pet**](Pet.md) +[**Pet**](Pet.md) ### Authorization @@ -577,7 +577,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[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_pet) +> update_pet(pet) Update an existing pet @@ -588,7 +588,7 @@ Update an existing pet import time import petstore_api from petstore_api.api import pet_api -from petstore_api.model import pet +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. @@ -671,12 +671,12 @@ configuration.access_token = 'YOUR_ACCESS_TOKEN' with petstore_api.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = pet_api.PetApi(api_client) - pet_pet = pet.Pet() # pet.Pet | Pet object that needs to be added to the store + pet = Pet() # Pet | Pet object that needs to be added to the store # example passing only required values which don't have defaults set try: # Update an existing pet - api_instance.update_pet(pet_pet) + api_instance.update_pet(pet) except petstore_api.ApiException as e: print("Exception when calling PetApi->update_pet: %s\n" % e) ``` @@ -685,7 +685,7 @@ with petstore_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **pet_pet** | [**pet.Pet**](Pet.md)| Pet object that needs to be added to the store | + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | ### Return type @@ -792,7 +792,7 @@ void (empty response body) [[Back to top]](#) [[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** -> api_response.ApiResponse upload_file(pet_id) +> ApiResponse upload_file(pet_id) uploads an image @@ -803,7 +803,7 @@ uploads an image import time import petstore_api from petstore_api.api import pet_api -from petstore_api.model import api_response +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. @@ -858,7 +858,7 @@ Name | Type | Description | Notes ### Return type -[**api_response.ApiResponse**](ApiResponse.md) +[**ApiResponse**](ApiResponse.md) ### Authorization @@ -877,7 +877,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[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** -> api_response.ApiResponse upload_file_with_required_file(pet_id, required_file) +> ApiResponse upload_file_with_required_file(pet_id, required_file) uploads an image (required) @@ -888,7 +888,7 @@ uploads an image (required) import time import petstore_api from petstore_api.api import pet_api -from petstore_api.model import api_response +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. @@ -943,7 +943,7 @@ Name | Type | Description | Notes ### Return type -[**api_response.ApiResponse**](ApiResponse.md) +[**ApiResponse**](ApiResponse.md) ### Authorization diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Pig.md b/samples/openapi3/client/petstore/python-experimental/docs/Pig.md index 0ca689c073e7..bebdd38f9011 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/Pig.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/Pig.md @@ -1,4 +1,4 @@ -# pig.Pig +# Pig ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Quadrilateral.md b/samples/openapi3/client/petstore/python-experimental/docs/Quadrilateral.md index 5d0a4a075fec..20e5742c1348 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/Quadrilateral.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/Quadrilateral.md @@ -1,4 +1,4 @@ -# quadrilateral.Quadrilateral +# Quadrilateral ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/QuadrilateralInterface.md b/samples/openapi3/client/petstore/python-experimental/docs/QuadrilateralInterface.md index d3600c6c5ba7..25d744665176 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/QuadrilateralInterface.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/QuadrilateralInterface.md @@ -1,4 +1,4 @@ -# quadrilateral_interface.QuadrilateralInterface +# QuadrilateralInterface ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/ReadOnlyFirst.md b/samples/openapi3/client/petstore/python-experimental/docs/ReadOnlyFirst.md index 252641787c3a..6bc1447c1d71 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/ReadOnlyFirst.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/ReadOnlyFirst.md @@ -1,4 +1,4 @@ -# read_only_first.ReadOnlyFirst +# ReadOnlyFirst ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/ScaleneTriangle.md b/samples/openapi3/client/petstore/python-experimental/docs/ScaleneTriangle.md index 6e4dc3c9af87..8b5b5ff85589 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/ScaleneTriangle.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/ScaleneTriangle.md @@ -1,4 +1,4 @@ -# scalene_triangle.ScaleneTriangle +# ScaleneTriangle ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Shape.md b/samples/openapi3/client/petstore/python-experimental/docs/Shape.md index 793225bc517f..90138dc6d365 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/Shape.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/Shape.md @@ -1,4 +1,4 @@ -# shape.Shape +# Shape ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/ShapeInterface.md b/samples/openapi3/client/petstore/python-experimental/docs/ShapeInterface.md index adb207397a49..224a2faa1dd4 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/ShapeInterface.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/ShapeInterface.md @@ -1,4 +1,4 @@ -# shape_interface.ShapeInterface +# ShapeInterface ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/ShapeOrNull.md b/samples/openapi3/client/petstore/python-experimental/docs/ShapeOrNull.md index 0f52dcbd3168..a82540d19eae 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/ShapeOrNull.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/ShapeOrNull.md @@ -1,4 +1,4 @@ -# shape_or_null.ShapeOrNull +# ShapeOrNull The value may be a shape or the 'null' value. This is introduced in OAS schema >= 3.1. ## Properties diff --git a/samples/openapi3/client/petstore/python-experimental/docs/SimpleQuadrilateral.md b/samples/openapi3/client/petstore/python-experimental/docs/SimpleQuadrilateral.md index 14789a06f915..ec38088e781f 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/SimpleQuadrilateral.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/SimpleQuadrilateral.md @@ -1,4 +1,4 @@ -# simple_quadrilateral.SimpleQuadrilateral +# SimpleQuadrilateral ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/SpecialModelName.md b/samples/openapi3/client/petstore/python-experimental/docs/SpecialModelName.md index 312539af45e3..022ee19169ce 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/SpecialModelName.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/SpecialModelName.md @@ -1,4 +1,4 @@ -# special_model_name.SpecialModelName +# SpecialModelName ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/StoreApi.md b/samples/openapi3/client/petstore/python-experimental/docs/StoreApi.md index cb973190ab39..eb126eda51d9 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/StoreApi.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/StoreApi.md @@ -146,7 +146,7 @@ This endpoint does not need any parameter. [[Back to top]](#) [[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.Order get_order_by_id(order_id) +> Order get_order_by_id(order_id) Find purchase order by ID @@ -158,7 +158,7 @@ For valid response try integer IDs with value <= 5 or > 10. Other values will ge import time import petstore_api from petstore_api.api import store_api -from petstore_api.model import order +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. @@ -190,7 +190,7 @@ Name | Type | Description | Notes ### Return type -[**order.Order**](Order.md) +[**Order**](Order.md) ### Authorization @@ -211,7 +211,7 @@ No authorization required [[Back to top]](#) [[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.Order place_order(order_order) +> Order place_order(order) Place an order for a pet @@ -221,7 +221,7 @@ Place an order for a pet import time import petstore_api from petstore_api.api import store_api -from petstore_api.model import order +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. @@ -234,12 +234,12 @@ configuration = petstore_api.Configuration( with petstore_api.ApiClient() as api_client: # Create an instance of the API class api_instance = store_api.StoreApi(api_client) - order_order = order.Order() # order.Order | order placed for purchasing the pet + order = Order() # Order | order placed for purchasing the pet # example passing only required values which don't have defaults set try: # Place an order for a pet - api_response = api_instance.place_order(order_order) + api_response = api_instance.place_order(order) pprint(api_response) except petstore_api.ApiException as e: print("Exception when calling StoreApi->place_order: %s\n" % e) @@ -249,11 +249,11 @@ with petstore_api.ApiClient() as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **order_order** | [**order.Order**](Order.md)| order placed for purchasing the pet | + **order** | [**Order**](Order.md)| order placed for purchasing the pet | ### Return type -[**order.Order**](Order.md) +[**Order**](Order.md) ### Authorization diff --git a/samples/openapi3/client/petstore/python-experimental/docs/StringBooleanMap.md b/samples/openapi3/client/petstore/python-experimental/docs/StringBooleanMap.md index 2eb94fd9a73d..2fbf3b3767d0 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/StringBooleanMap.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/StringBooleanMap.md @@ -1,4 +1,4 @@ -# string_boolean_map.StringBooleanMap +# StringBooleanMap ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/StringEnum.md b/samples/openapi3/client/petstore/python-experimental/docs/StringEnum.md index 7b720683b6e4..fbedcd04bce9 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/StringEnum.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/StringEnum.md @@ -1,4 +1,4 @@ -# string_enum.StringEnum +# StringEnum ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/StringEnumWithDefaultValue.md b/samples/openapi3/client/petstore/python-experimental/docs/StringEnumWithDefaultValue.md index b0f8d1be2680..62111d72dbed 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/StringEnumWithDefaultValue.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/StringEnumWithDefaultValue.md @@ -1,4 +1,4 @@ -# string_enum_with_default_value.StringEnumWithDefaultValue +# StringEnumWithDefaultValue ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Tag.md b/samples/openapi3/client/petstore/python-experimental/docs/Tag.md index 66f75c28fe4f..243cd98eda69 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/Tag.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/Tag.md @@ -1,4 +1,4 @@ -# tag.Tag +# Tag ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Triangle.md b/samples/openapi3/client/petstore/python-experimental/docs/Triangle.md index f066c080aad2..7c96d050bfe5 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/Triangle.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/Triangle.md @@ -1,4 +1,4 @@ -# triangle.Triangle +# Triangle ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/TriangleInterface.md b/samples/openapi3/client/petstore/python-experimental/docs/TriangleInterface.md index 7a32b8572145..901553d663a8 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/TriangleInterface.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/TriangleInterface.md @@ -1,4 +1,4 @@ -# triangle_interface.TriangleInterface +# TriangleInterface ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/User.md b/samples/openapi3/client/petstore/python-experimental/docs/User.md index 1b1ec5fb6cc9..5fc54dce871b 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/User.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/User.md @@ -1,4 +1,4 @@ -# user.User +# User ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/UserApi.md b/samples/openapi3/client/petstore/python-experimental/docs/UserApi.md index 435713374e5f..d7f0c3f8fa94 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/UserApi.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/UserApi.md @@ -15,7 +15,7 @@ Method | HTTP request | Description # **create_user** -> create_user(user_user) +> create_user(user) Create user @@ -27,7 +27,7 @@ This can only be done by the logged in user. import time import petstore_api from petstore_api.api import user_api -from petstore_api.model import user +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. @@ -40,12 +40,12 @@ configuration = petstore_api.Configuration( with petstore_api.ApiClient() as api_client: # Create an instance of the API class api_instance = user_api.UserApi(api_client) - user_user = user.User() # user.User | Created user object + user = User() # User | Created user object # example passing only required values which don't have defaults set try: # Create user - api_instance.create_user(user_user) + api_instance.create_user(user) except petstore_api.ApiException as e: print("Exception when calling UserApi->create_user: %s\n" % e) ``` @@ -54,7 +54,7 @@ with petstore_api.ApiClient() as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **user_user** | [**user.User**](User.md)| Created user object | + **user** | [**User**](User.md)| Created user object | ### Return type @@ -77,7 +77,7 @@ No authorization required [[Back to top]](#) [[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_user) +> create_users_with_array_input(user) Creates list of users with given input array @@ -87,7 +87,7 @@ Creates list of users with given input array import time import petstore_api from petstore_api.api import user_api -from petstore_api.model import user +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. @@ -100,12 +100,12 @@ configuration = petstore_api.Configuration( with petstore_api.ApiClient() as api_client: # Create an instance of the API class api_instance = user_api.UserApi(api_client) - user_user = [user.User()] # [user.User] | List of user object + user = [User()] # [User] | List of user object # example passing only required values which don't have defaults set try: # Creates list of users with given input array - api_instance.create_users_with_array_input(user_user) + api_instance.create_users_with_array_input(user) except petstore_api.ApiException as e: print("Exception when calling UserApi->create_users_with_array_input: %s\n" % e) ``` @@ -114,7 +114,7 @@ with petstore_api.ApiClient() as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **user_user** | [**[user.User]**](User.md)| List of user object | + **user** | [**[User]**](User.md)| List of user object | ### Return type @@ -137,7 +137,7 @@ No authorization required [[Back to top]](#) [[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_user) +> create_users_with_list_input(user) Creates list of users with given input array @@ -147,7 +147,7 @@ Creates list of users with given input array import time import petstore_api from petstore_api.api import user_api -from petstore_api.model import user +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. @@ -160,12 +160,12 @@ configuration = petstore_api.Configuration( with petstore_api.ApiClient() as api_client: # Create an instance of the API class api_instance = user_api.UserApi(api_client) - user_user = [user.User()] # [user.User] | List of user object + user = [User()] # [User] | List of user object # example passing only required values which don't have defaults set try: # Creates list of users with given input array - api_instance.create_users_with_list_input(user_user) + api_instance.create_users_with_list_input(user) except petstore_api.ApiException as e: print("Exception when calling UserApi->create_users_with_list_input: %s\n" % e) ``` @@ -174,7 +174,7 @@ with petstore_api.ApiClient() as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **user_user** | [**[user.User]**](User.md)| List of user object | + **user** | [**[User]**](User.md)| List of user object | ### Return type @@ -259,7 +259,7 @@ No authorization required [[Back to top]](#) [[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.User get_user_by_name(username) +> User get_user_by_name(username) Get user by user name @@ -269,7 +269,7 @@ Get user by user name import time import petstore_api from petstore_api.api import user_api -from petstore_api.model import user +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. @@ -301,7 +301,7 @@ Name | Type | Description | Notes ### Return type -[**user.User**](User.md) +[**User**](User.md) ### Authorization @@ -440,7 +440,7 @@ No authorization required [[Back to top]](#) [[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(username, user_user) +> update_user(username, user) Updated user @@ -452,7 +452,7 @@ This can only be done by the logged in user. import time import petstore_api from petstore_api.api import user_api -from petstore_api.model import user +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. @@ -466,12 +466,12 @@ with petstore_api.ApiClient() as api_client: # Create an instance of the API class api_instance = user_api.UserApi(api_client) username = 'username_example' # str | name that need to be deleted - user_user = user.User() # user.User | Updated user object + user = User() # User | Updated user object # example passing only required values which don't have defaults set try: # Updated user - api_instance.update_user(username, user_user) + api_instance.update_user(username, user) except petstore_api.ApiException as e: print("Exception when calling UserApi->update_user: %s\n" % e) ``` @@ -481,7 +481,7 @@ with petstore_api.ApiClient() as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **username** | **str**| name that need to be deleted | - **user_user** | [**user.User**](User.md)| Updated user object | + **user** | [**User**](User.md)| Updated user object | ### Return type diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Whale.md b/samples/openapi3/client/petstore/python-experimental/docs/Whale.md index 4a19e88c5553..693dacb158b7 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/Whale.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/Whale.md @@ -1,4 +1,4 @@ -# whale.Whale +# Whale ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Zebra.md b/samples/openapi3/client/petstore/python-experimental/docs/Zebra.md index 05a4dbfd6baf..7681f694685a 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/Zebra.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/Zebra.md @@ -1,4 +1,4 @@ -# zebra.Zebra +# Zebra ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/another_fake_api.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/another_fake_api.py index 40ca75cb253b..af80014fe0cf 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/another_fake_api.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/another_fake_api.py @@ -23,7 +23,7 @@ none_type, validate_and_convert_types ) -from petstore_api.model import client +from petstore_api.model.client import Client class AnotherFakeApi(object): @@ -40,7 +40,7 @@ def __init__(self, api_client=None): def __call_123_test_special_tags( self, - client_client, + client, **kwargs ): """To test special tags # noqa: E501 @@ -49,11 +49,11 @@ def __call_123_test_special_tags( This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.call_123_test_special_tags(client_client, async_req=True) + >>> thread = api.call_123_test_special_tags(client, async_req=True) >>> result = thread.get() Args: - client_client (client.Client): client model + client (Client): client model Keyword Args: _return_http_data_only (bool): response data without head status @@ -77,7 +77,7 @@ def __call_123_test_special_tags( async_req (bool): execute request asynchronously Returns: - client.Client + Client If the method is called asynchronously, returns the request thread. """ @@ -100,13 +100,13 @@ def __call_123_test_special_tags( '_check_return_type', True ) kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['client_client'] = \ - client_client + kwargs['client'] = \ + client return self.call_with_http_info(**kwargs) self.call_123_test_special_tags = Endpoint( settings={ - 'response_type': (client.Client,), + 'response_type': (Client,), 'auth': [], 'endpoint_path': '/another-fake/dummy', 'operation_id': 'call_123_test_special_tags', @@ -115,10 +115,10 @@ def __call_123_test_special_tags( }, params_map={ 'all': [ - 'client_client', + 'client', ], 'required': [ - 'client_client', + 'client', ], 'nullable': [ ], @@ -133,13 +133,13 @@ def __call_123_test_special_tags( 'allowed_values': { }, 'openapi_types': { - 'client_client': - (client.Client,), + 'client': + (Client,), }, 'attribute_map': { }, 'location_map': { - 'client_client': 'body', + 'client': 'body', }, 'collection_format_map': { } diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/default_api.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/default_api.py index c6bf00fdc40e..c64ea731eba0 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/default_api.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/default_api.py @@ -23,7 +23,7 @@ none_type, validate_and_convert_types ) -from petstore_api.model import inline_response_default +from petstore_api.model.inline_response_default import InlineResponseDefault class DefaultApi(object): @@ -73,7 +73,7 @@ def __foo_get( async_req (bool): execute request asynchronously Returns: - inline_response_default.InlineResponseDefault + InlineResponseDefault If the method is called asynchronously, returns the request thread. """ @@ -100,7 +100,7 @@ def __foo_get( self.foo_get = Endpoint( settings={ - 'response_type': (inline_response_default.InlineResponseDefault,), + 'response_type': (InlineResponseDefault,), 'auth': [], 'endpoint_path': '/foo', 'operation_id': 'foo_get', diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api.py index b294bfc8e79c..40f7ef9a8267 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api.py @@ -23,17 +23,17 @@ none_type, validate_and_convert_types ) -from petstore_api.model import additional_properties_with_array_of_enums -from petstore_api.model import animal_farm -from petstore_api.model import array_of_enums -from petstore_api.model import composed_one_of_number_with_validations -from petstore_api.model import health_check_result -from petstore_api.model import number_with_validations -from petstore_api.model import object_model_with_ref_props -from petstore_api.model import string_enum -from petstore_api.model import file_schema_test_class -from petstore_api.model import user -from petstore_api.model import client +from petstore_api.model.additional_properties_with_array_of_enums import AdditionalPropertiesWithArrayOfEnums +from petstore_api.model.animal_farm import AnimalFarm +from petstore_api.model.array_of_enums import ArrayOfEnums +from petstore_api.model.client import Client +from petstore_api.model.composed_one_of_number_with_validations import ComposedOneOfNumberWithValidations +from petstore_api.model.file_schema_test_class import FileSchemaTestClass +from petstore_api.model.health_check_result import HealthCheckResult +from petstore_api.model.number_with_validations import NumberWithValidations +from petstore_api.model.object_model_with_ref_props import ObjectModelWithRefProps +from petstore_api.model.string_enum import StringEnum +from petstore_api.model.user import User class FakeApi(object): @@ -62,7 +62,7 @@ def __additional_properties_with_array_of_enums( Keyword Args: - additional_properties_with_array_of_enums_additional_properties_with_array_of_enums (additional_properties_with_array_of_enums.AdditionalPropertiesWithArrayOfEnums): Input enum. [optional] + additional_properties_with_array_of_enums (AdditionalPropertiesWithArrayOfEnums): Input enum. [optional] _return_http_data_only (bool): response data without head status code and headers. Default is True. _preload_content (bool): if False, the urllib3.HTTPResponse object @@ -84,7 +84,7 @@ def __additional_properties_with_array_of_enums( async_req (bool): execute request asynchronously Returns: - additional_properties_with_array_of_enums.AdditionalPropertiesWithArrayOfEnums + AdditionalPropertiesWithArrayOfEnums If the method is called asynchronously, returns the request thread. """ @@ -111,7 +111,7 @@ def __additional_properties_with_array_of_enums( self.additional_properties_with_array_of_enums = Endpoint( settings={ - 'response_type': (additional_properties_with_array_of_enums.AdditionalPropertiesWithArrayOfEnums,), + 'response_type': (AdditionalPropertiesWithArrayOfEnums,), 'auth': [], 'endpoint_path': '/fake/additional-properties-with-array-of-enums', 'operation_id': 'additional_properties_with_array_of_enums', @@ -120,7 +120,7 @@ def __additional_properties_with_array_of_enums( }, params_map={ 'all': [ - 'additional_properties_with_array_of_enums_additional_properties_with_array_of_enums', + 'additional_properties_with_array_of_enums', ], 'required': [], 'nullable': [ @@ -136,13 +136,13 @@ def __additional_properties_with_array_of_enums( 'allowed_values': { }, 'openapi_types': { - 'additional_properties_with_array_of_enums_additional_properties_with_array_of_enums': - (additional_properties_with_array_of_enums.AdditionalPropertiesWithArrayOfEnums,), + 'additional_properties_with_array_of_enums': + (AdditionalPropertiesWithArrayOfEnums,), }, 'attribute_map': { }, 'location_map': { - 'additional_properties_with_array_of_enums_additional_properties_with_array_of_enums': 'body', + 'additional_properties_with_array_of_enums': 'body', }, 'collection_format_map': { } @@ -174,7 +174,7 @@ def __array_model( Keyword Args: - body (animal_farm.AnimalFarm): Input model. [optional] + body (AnimalFarm): Input model. [optional] _return_http_data_only (bool): response data without head status code and headers. Default is True. _preload_content (bool): if False, the urllib3.HTTPResponse object @@ -196,7 +196,7 @@ def __array_model( async_req (bool): execute request asynchronously Returns: - animal_farm.AnimalFarm + AnimalFarm If the method is called asynchronously, returns the request thread. """ @@ -223,7 +223,7 @@ def __array_model( self.array_model = Endpoint( settings={ - 'response_type': (animal_farm.AnimalFarm,), + 'response_type': (AnimalFarm,), 'auth': [], 'endpoint_path': '/fake/refs/arraymodel', 'operation_id': 'array_model', @@ -249,7 +249,7 @@ def __array_model( }, 'openapi_types': { 'body': - (animal_farm.AnimalFarm,), + (AnimalFarm,), }, 'attribute_map': { }, @@ -285,7 +285,7 @@ def __array_of_enums( Keyword Args: - array_of_enums_array_of_enums (array_of_enums.ArrayOfEnums): Input enum. [optional] + array_of_enums (ArrayOfEnums): Input enum. [optional] _return_http_data_only (bool): response data without head status code and headers. Default is True. _preload_content (bool): if False, the urllib3.HTTPResponse object @@ -307,7 +307,7 @@ def __array_of_enums( async_req (bool): execute request asynchronously Returns: - array_of_enums.ArrayOfEnums + ArrayOfEnums If the method is called asynchronously, returns the request thread. """ @@ -334,7 +334,7 @@ def __array_of_enums( self.array_of_enums = Endpoint( settings={ - 'response_type': (array_of_enums.ArrayOfEnums,), + 'response_type': (ArrayOfEnums,), 'auth': [], 'endpoint_path': '/fake/refs/array-of-enums', 'operation_id': 'array_of_enums', @@ -343,7 +343,7 @@ def __array_of_enums( }, params_map={ 'all': [ - 'array_of_enums_array_of_enums', + 'array_of_enums', ], 'required': [], 'nullable': [ @@ -359,13 +359,13 @@ def __array_of_enums( 'allowed_values': { }, 'openapi_types': { - 'array_of_enums_array_of_enums': - (array_of_enums.ArrayOfEnums,), + 'array_of_enums': + (ArrayOfEnums,), }, 'attribute_map': { }, 'location_map': { - 'array_of_enums_array_of_enums': 'body', + 'array_of_enums': 'body', }, 'collection_format_map': { } @@ -509,7 +509,7 @@ def __composed_one_of_number_with_validations( Keyword Args: - composed_one_of_number_with_validations_composed_one_of_number_with_validations (composed_one_of_number_with_validations.ComposedOneOfNumberWithValidations): Input model. [optional] + composed_one_of_number_with_validations (ComposedOneOfNumberWithValidations): Input model. [optional] _return_http_data_only (bool): response data without head status code and headers. Default is True. _preload_content (bool): if False, the urllib3.HTTPResponse object @@ -531,7 +531,7 @@ def __composed_one_of_number_with_validations( async_req (bool): execute request asynchronously Returns: - composed_one_of_number_with_validations.ComposedOneOfNumberWithValidations + ComposedOneOfNumberWithValidations If the method is called asynchronously, returns the request thread. """ @@ -558,7 +558,7 @@ def __composed_one_of_number_with_validations( self.composed_one_of_number_with_validations = Endpoint( settings={ - 'response_type': (composed_one_of_number_with_validations.ComposedOneOfNumberWithValidations,), + 'response_type': (ComposedOneOfNumberWithValidations,), 'auth': [], 'endpoint_path': '/fake/refs/composed_one_of_number_with_validations', 'operation_id': 'composed_one_of_number_with_validations', @@ -567,7 +567,7 @@ def __composed_one_of_number_with_validations( }, params_map={ 'all': [ - 'composed_one_of_number_with_validations_composed_one_of_number_with_validations', + 'composed_one_of_number_with_validations', ], 'required': [], 'nullable': [ @@ -583,13 +583,13 @@ def __composed_one_of_number_with_validations( 'allowed_values': { }, 'openapi_types': { - 'composed_one_of_number_with_validations_composed_one_of_number_with_validations': - (composed_one_of_number_with_validations.ComposedOneOfNumberWithValidations,), + 'composed_one_of_number_with_validations': + (ComposedOneOfNumberWithValidations,), }, 'attribute_map': { }, 'location_map': { - 'composed_one_of_number_with_validations_composed_one_of_number_with_validations': 'body', + 'composed_one_of_number_with_validations': 'body', }, 'collection_format_map': { } @@ -641,7 +641,7 @@ def __fake_health_get( async_req (bool): execute request asynchronously Returns: - health_check_result.HealthCheckResult + HealthCheckResult If the method is called asynchronously, returns the request thread. """ @@ -668,7 +668,7 @@ def __fake_health_get( self.fake_health_get = Endpoint( settings={ - 'response_type': (health_check_result.HealthCheckResult,), + 'response_type': (HealthCheckResult,), 'auth': [], 'endpoint_path': '/fake/health', 'operation_id': 'fake_health_get', @@ -725,7 +725,7 @@ def __number_with_validations( Keyword Args: - body (number_with_validations.NumberWithValidations): Input number as post body. [optional] + body (NumberWithValidations): Input number as post body. [optional] _return_http_data_only (bool): response data without head status code and headers. Default is True. _preload_content (bool): if False, the urllib3.HTTPResponse object @@ -747,7 +747,7 @@ def __number_with_validations( async_req (bool): execute request asynchronously Returns: - number_with_validations.NumberWithValidations + NumberWithValidations If the method is called asynchronously, returns the request thread. """ @@ -774,7 +774,7 @@ def __number_with_validations( self.number_with_validations = Endpoint( settings={ - 'response_type': (number_with_validations.NumberWithValidations,), + 'response_type': (NumberWithValidations,), 'auth': [], 'endpoint_path': '/fake/refs/number', 'operation_id': 'number_with_validations', @@ -800,7 +800,7 @@ def __number_with_validations( }, 'openapi_types': { 'body': - (number_with_validations.NumberWithValidations,), + (NumberWithValidations,), }, 'attribute_map': { }, @@ -837,7 +837,7 @@ def __object_model_with_ref_props( Keyword Args: - body (object_model_with_ref_props.ObjectModelWithRefProps): Input model. [optional] + body (ObjectModelWithRefProps): Input model. [optional] _return_http_data_only (bool): response data without head status code and headers. Default is True. _preload_content (bool): if False, the urllib3.HTTPResponse object @@ -859,7 +859,7 @@ def __object_model_with_ref_props( async_req (bool): execute request asynchronously Returns: - object_model_with_ref_props.ObjectModelWithRefProps + ObjectModelWithRefProps If the method is called asynchronously, returns the request thread. """ @@ -886,7 +886,7 @@ def __object_model_with_ref_props( self.object_model_with_ref_props = Endpoint( settings={ - 'response_type': (object_model_with_ref_props.ObjectModelWithRefProps,), + 'response_type': (ObjectModelWithRefProps,), 'auth': [], 'endpoint_path': '/fake/refs/object_model_with_ref_props', 'operation_id': 'object_model_with_ref_props', @@ -912,7 +912,7 @@ def __object_model_with_ref_props( }, 'openapi_types': { 'body': - (object_model_with_ref_props.ObjectModelWithRefProps,), + (ObjectModelWithRefProps,), }, 'attribute_map': { }, @@ -1061,7 +1061,7 @@ def __string_enum( Keyword Args: - body (string_enum.StringEnum): Input enum. [optional] + body (StringEnum): Input enum. [optional] _return_http_data_only (bool): response data without head status code and headers. Default is True. _preload_content (bool): if False, the urllib3.HTTPResponse object @@ -1083,7 +1083,7 @@ def __string_enum( async_req (bool): execute request asynchronously Returns: - string_enum.StringEnum + StringEnum If the method is called asynchronously, returns the request thread. """ @@ -1110,7 +1110,7 @@ def __string_enum( self.string_enum = Endpoint( settings={ - 'response_type': (string_enum.StringEnum,), + 'response_type': (StringEnum,), 'auth': [], 'endpoint_path': '/fake/refs/enum', 'operation_id': 'string_enum', @@ -1137,7 +1137,7 @@ def __string_enum( }, 'openapi_types': { 'body': - (string_enum.StringEnum,), + (StringEnum,), }, 'attribute_map': { }, @@ -1161,7 +1161,7 @@ def __string_enum( def __test_body_with_file_schema( self, - file_schema_test_class_file_schema_test_class, + file_schema_test_class, **kwargs ): """test_body_with_file_schema # noqa: E501 @@ -1170,11 +1170,11 @@ def __test_body_with_file_schema( This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.test_body_with_file_schema(file_schema_test_class_file_schema_test_class, async_req=True) + >>> thread = api.test_body_with_file_schema(file_schema_test_class, async_req=True) >>> result = thread.get() Args: - file_schema_test_class_file_schema_test_class (file_schema_test_class.FileSchemaTestClass): + file_schema_test_class (FileSchemaTestClass): Keyword Args: _return_http_data_only (bool): response data without head status @@ -1221,8 +1221,8 @@ def __test_body_with_file_schema( '_check_return_type', True ) kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['file_schema_test_class_file_schema_test_class'] = \ - file_schema_test_class_file_schema_test_class + kwargs['file_schema_test_class'] = \ + file_schema_test_class return self.call_with_http_info(**kwargs) self.test_body_with_file_schema = Endpoint( @@ -1236,10 +1236,10 @@ def __test_body_with_file_schema( }, params_map={ 'all': [ - 'file_schema_test_class_file_schema_test_class', + 'file_schema_test_class', ], 'required': [ - 'file_schema_test_class_file_schema_test_class', + 'file_schema_test_class', ], 'nullable': [ ], @@ -1254,13 +1254,13 @@ def __test_body_with_file_schema( 'allowed_values': { }, 'openapi_types': { - 'file_schema_test_class_file_schema_test_class': - (file_schema_test_class.FileSchemaTestClass,), + 'file_schema_test_class': + (FileSchemaTestClass,), }, 'attribute_map': { }, 'location_map': { - 'file_schema_test_class_file_schema_test_class': 'body', + 'file_schema_test_class': 'body', }, 'collection_format_map': { } @@ -1278,7 +1278,7 @@ def __test_body_with_file_schema( def __test_body_with_query_params( self, query, - user_user, + user, **kwargs ): """test_body_with_query_params # noqa: E501 @@ -1286,12 +1286,12 @@ def __test_body_with_query_params( This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.test_body_with_query_params(query, user_user, async_req=True) + >>> thread = api.test_body_with_query_params(query, user, async_req=True) >>> result = thread.get() Args: query (str): - user_user (user.User): + user (User): Keyword Args: _return_http_data_only (bool): response data without head status @@ -1340,8 +1340,8 @@ def __test_body_with_query_params( kwargs['_host_index'] = kwargs.get('_host_index') kwargs['query'] = \ query - kwargs['user_user'] = \ - user_user + kwargs['user'] = \ + user return self.call_with_http_info(**kwargs) self.test_body_with_query_params = Endpoint( @@ -1356,11 +1356,11 @@ def __test_body_with_query_params( params_map={ 'all': [ 'query', - 'user_user', + 'user', ], 'required': [ 'query', - 'user_user', + 'user', ], 'nullable': [ ], @@ -1377,15 +1377,15 @@ def __test_body_with_query_params( 'openapi_types': { 'query': (str,), - 'user_user': - (user.User,), + 'user': + (User,), }, 'attribute_map': { 'query': 'query', }, 'location_map': { 'query': 'query', - 'user_user': 'body', + 'user': 'body', }, 'collection_format_map': { } @@ -1402,7 +1402,7 @@ def __test_body_with_query_params( def __test_client_model( self, - client_client, + client, **kwargs ): """To test \"client\" model # noqa: E501 @@ -1411,11 +1411,11 @@ def __test_client_model( This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.test_client_model(client_client, async_req=True) + >>> thread = api.test_client_model(client, async_req=True) >>> result = thread.get() Args: - client_client (client.Client): client model + client (Client): client model Keyword Args: _return_http_data_only (bool): response data without head status @@ -1439,7 +1439,7 @@ def __test_client_model( async_req (bool): execute request asynchronously Returns: - client.Client + Client If the method is called asynchronously, returns the request thread. """ @@ -1462,13 +1462,13 @@ def __test_client_model( '_check_return_type', True ) kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['client_client'] = \ - client_client + kwargs['client'] = \ + client return self.call_with_http_info(**kwargs) self.test_client_model = Endpoint( settings={ - 'response_type': (client.Client,), + 'response_type': (Client,), 'auth': [], 'endpoint_path': '/fake', 'operation_id': 'test_client_model', @@ -1477,10 +1477,10 @@ def __test_client_model( }, params_map={ 'all': [ - 'client_client', + 'client', ], 'required': [ - 'client_client', + 'client', ], 'nullable': [ ], @@ -1495,13 +1495,13 @@ def __test_client_model( 'allowed_values': { }, 'openapi_types': { - 'client_client': - (client.Client,), + 'client': + (Client,), }, 'attribute_map': { }, 'location_map': { - 'client_client': 'body', + 'client': 'body', }, 'collection_format_map': { } diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_classname_tags_123_api.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_classname_tags_123_api.py index 067e5a91f50f..40f8039b3cb1 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_classname_tags_123_api.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_classname_tags_123_api.py @@ -23,7 +23,7 @@ none_type, validate_and_convert_types ) -from petstore_api.model import client +from petstore_api.model.client import Client class FakeClassnameTags123Api(object): @@ -40,7 +40,7 @@ def __init__(self, api_client=None): def __test_classname( self, - client_client, + client, **kwargs ): """To test class name in snake case # noqa: E501 @@ -49,11 +49,11 @@ def __test_classname( This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.test_classname(client_client, async_req=True) + >>> thread = api.test_classname(client, async_req=True) >>> result = thread.get() Args: - client_client (client.Client): client model + client (Client): client model Keyword Args: _return_http_data_only (bool): response data without head status @@ -77,7 +77,7 @@ def __test_classname( async_req (bool): execute request asynchronously Returns: - client.Client + Client If the method is called asynchronously, returns the request thread. """ @@ -100,13 +100,13 @@ def __test_classname( '_check_return_type', True ) kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['client_client'] = \ - client_client + kwargs['client'] = \ + client return self.call_with_http_info(**kwargs) self.test_classname = Endpoint( settings={ - 'response_type': (client.Client,), + 'response_type': (Client,), 'auth': [ 'api_key_query' ], @@ -117,10 +117,10 @@ def __test_classname( }, params_map={ 'all': [ - 'client_client', + 'client', ], 'required': [ - 'client_client', + 'client', ], 'nullable': [ ], @@ -135,13 +135,13 @@ def __test_classname( 'allowed_values': { }, 'openapi_types': { - 'client_client': - (client.Client,), + 'client': + (Client,), }, 'attribute_map': { }, 'location_map': { - 'client_client': 'body', + 'client': 'body', }, 'collection_format_map': { } diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api.py index 0a018863df49..3a20006d3929 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api.py @@ -23,8 +23,8 @@ none_type, validate_and_convert_types ) -from petstore_api.model import pet -from petstore_api.model import api_response +from petstore_api.model.api_response import ApiResponse +from petstore_api.model.pet import Pet class PetApi(object): @@ -41,7 +41,7 @@ def __init__(self, api_client=None): def __add_pet( self, - pet_pet, + pet, **kwargs ): """Add a new pet to the store # noqa: E501 @@ -49,11 +49,11 @@ def __add_pet( This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.add_pet(pet_pet, async_req=True) + >>> thread = api.add_pet(pet, async_req=True) >>> result = thread.get() Args: - pet_pet (pet.Pet): Pet object that needs to be added to the store + pet (Pet): Pet object that needs to be added to the store Keyword Args: _return_http_data_only (bool): response data without head status @@ -100,8 +100,8 @@ def __add_pet( '_check_return_type', True ) kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['pet_pet'] = \ - pet_pet + kwargs['pet'] = \ + pet return self.call_with_http_info(**kwargs) self.add_pet = Endpoint( @@ -127,10 +127,10 @@ def __add_pet( }, params_map={ 'all': [ - 'pet_pet', + 'pet', ], 'required': [ - 'pet_pet', + 'pet', ], 'nullable': [ ], @@ -145,13 +145,13 @@ def __add_pet( 'allowed_values': { }, 'openapi_types': { - 'pet_pet': - (pet.Pet,), + 'pet': + (Pet,), }, 'attribute_map': { }, 'location_map': { - 'pet_pet': 'body', + 'pet': 'body', }, 'collection_format_map': { } @@ -328,7 +328,7 @@ def __find_pets_by_status( async_req (bool): execute request asynchronously Returns: - [pet.Pet] + [Pet] If the method is called asynchronously, returns the request thread. """ @@ -357,7 +357,7 @@ def __find_pets_by_status( self.find_pets_by_status = Endpoint( settings={ - 'response_type': ([pet.Pet],), + 'response_type': ([Pet],), 'auth': [ 'http_signature_test', 'petstore_auth' @@ -457,7 +457,7 @@ def __find_pets_by_tags( async_req (bool): execute request asynchronously Returns: - [pet.Pet] + [Pet] If the method is called asynchronously, returns the request thread. """ @@ -486,7 +486,7 @@ def __find_pets_by_tags( self.find_pets_by_tags = Endpoint( settings={ - 'response_type': ([pet.Pet],), + 'response_type': ([Pet],), 'auth': [ 'http_signature_test', 'petstore_auth' @@ -579,7 +579,7 @@ def __get_pet_by_id( async_req (bool): execute request asynchronously Returns: - pet.Pet + Pet If the method is called asynchronously, returns the request thread. """ @@ -608,7 +608,7 @@ def __get_pet_by_id( self.get_pet_by_id = Endpoint( settings={ - 'response_type': (pet.Pet,), + 'response_type': (Pet,), 'auth': [ 'api_key' ], @@ -662,7 +662,7 @@ def __get_pet_by_id( def __update_pet( self, - pet_pet, + pet, **kwargs ): """Update an existing pet # noqa: E501 @@ -670,11 +670,11 @@ def __update_pet( This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.update_pet(pet_pet, async_req=True) + >>> thread = api.update_pet(pet, async_req=True) >>> result = thread.get() Args: - pet_pet (pet.Pet): Pet object that needs to be added to the store + pet (Pet): Pet object that needs to be added to the store Keyword Args: _return_http_data_only (bool): response data without head status @@ -721,8 +721,8 @@ def __update_pet( '_check_return_type', True ) kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['pet_pet'] = \ - pet_pet + kwargs['pet'] = \ + pet return self.call_with_http_info(**kwargs) self.update_pet = Endpoint( @@ -748,10 +748,10 @@ def __update_pet( }, params_map={ 'all': [ - 'pet_pet', + 'pet', ], 'required': [ - 'pet_pet', + 'pet', ], 'nullable': [ ], @@ -766,13 +766,13 @@ def __update_pet( 'allowed_values': { }, 'openapi_types': { - 'pet_pet': - (pet.Pet,), + 'pet': + (Pet,), }, 'attribute_map': { }, 'location_map': { - 'pet_pet': 'body', + 'pet': 'body', }, 'collection_format_map': { } @@ -958,7 +958,7 @@ def __upload_file( async_req (bool): execute request asynchronously Returns: - api_response.ApiResponse + ApiResponse If the method is called asynchronously, returns the request thread. """ @@ -987,7 +987,7 @@ def __upload_file( self.upload_file = Endpoint( settings={ - 'response_type': (api_response.ApiResponse,), + 'response_type': (ApiResponse,), 'auth': [ 'petstore_auth' ], @@ -1091,7 +1091,7 @@ def __upload_file_with_required_file( async_req (bool): execute request asynchronously Returns: - api_response.ApiResponse + ApiResponse If the method is called asynchronously, returns the request thread. """ @@ -1122,7 +1122,7 @@ def __upload_file_with_required_file( self.upload_file_with_required_file = Endpoint( settings={ - 'response_type': (api_response.ApiResponse,), + 'response_type': (ApiResponse,), 'auth': [ 'petstore_auth' ], diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/store_api.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/store_api.py index 9c608eb31370..5aa2d27623a8 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/store_api.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/store_api.py @@ -23,7 +23,7 @@ none_type, validate_and_convert_types ) -from petstore_api.model import order +from petstore_api.model.order import Order class StoreApi(object): @@ -299,7 +299,7 @@ def __get_order_by_id( async_req (bool): execute request asynchronously Returns: - order.Order + Order If the method is called asynchronously, returns the request thread. """ @@ -328,7 +328,7 @@ def __get_order_by_id( self.get_order_by_id = Endpoint( settings={ - 'response_type': (order.Order,), + 'response_type': (Order,), 'auth': [], 'endpoint_path': '/store/order/{order_id}', 'operation_id': 'get_order_by_id', @@ -386,7 +386,7 @@ def __get_order_by_id( def __place_order( self, - order_order, + order, **kwargs ): """Place an order for a pet # noqa: E501 @@ -394,11 +394,11 @@ def __place_order( This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.place_order(order_order, async_req=True) + >>> thread = api.place_order(order, async_req=True) >>> result = thread.get() Args: - order_order (order.Order): order placed for purchasing the pet + order (Order): order placed for purchasing the pet Keyword Args: _return_http_data_only (bool): response data without head status @@ -422,7 +422,7 @@ def __place_order( async_req (bool): execute request asynchronously Returns: - order.Order + Order If the method is called asynchronously, returns the request thread. """ @@ -445,13 +445,13 @@ def __place_order( '_check_return_type', True ) kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['order_order'] = \ - order_order + kwargs['order'] = \ + order return self.call_with_http_info(**kwargs) self.place_order = Endpoint( settings={ - 'response_type': (order.Order,), + 'response_type': (Order,), 'auth': [], 'endpoint_path': '/store/order', 'operation_id': 'place_order', @@ -460,10 +460,10 @@ def __place_order( }, params_map={ 'all': [ - 'order_order', + 'order', ], 'required': [ - 'order_order', + 'order', ], 'nullable': [ ], @@ -478,13 +478,13 @@ def __place_order( 'allowed_values': { }, 'openapi_types': { - 'order_order': - (order.Order,), + 'order': + (Order,), }, 'attribute_map': { }, 'location_map': { - 'order_order': 'body', + 'order': 'body', }, 'collection_format_map': { } diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api.py index 5e3276985d08..ee0468ec9286 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api.py @@ -23,7 +23,7 @@ none_type, validate_and_convert_types ) -from petstore_api.model import user +from petstore_api.model.user import User class UserApi(object): @@ -40,7 +40,7 @@ def __init__(self, api_client=None): def __create_user( self, - user_user, + user, **kwargs ): """Create user # noqa: E501 @@ -49,11 +49,11 @@ def __create_user( This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_user(user_user, async_req=True) + >>> thread = api.create_user(user, async_req=True) >>> result = thread.get() Args: - user_user (user.User): Created user object + user (User): Created user object Keyword Args: _return_http_data_only (bool): response data without head status @@ -100,8 +100,8 @@ def __create_user( '_check_return_type', True ) kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['user_user'] = \ - user_user + kwargs['user'] = \ + user return self.call_with_http_info(**kwargs) self.create_user = Endpoint( @@ -115,10 +115,10 @@ def __create_user( }, params_map={ 'all': [ - 'user_user', + 'user', ], 'required': [ - 'user_user', + 'user', ], 'nullable': [ ], @@ -133,13 +133,13 @@ def __create_user( 'allowed_values': { }, 'openapi_types': { - 'user_user': - (user.User,), + 'user': + (User,), }, 'attribute_map': { }, 'location_map': { - 'user_user': 'body', + 'user': 'body', }, 'collection_format_map': { } @@ -156,7 +156,7 @@ def __create_user( def __create_users_with_array_input( self, - user_user, + user, **kwargs ): """Creates list of users with given input array # noqa: E501 @@ -164,11 +164,11 @@ def __create_users_with_array_input( This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_users_with_array_input(user_user, async_req=True) + >>> thread = api.create_users_with_array_input(user, async_req=True) >>> result = thread.get() Args: - user_user ([user.User]): List of user object + user ([User]): List of user object Keyword Args: _return_http_data_only (bool): response data without head status @@ -215,8 +215,8 @@ def __create_users_with_array_input( '_check_return_type', True ) kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['user_user'] = \ - user_user + kwargs['user'] = \ + user return self.call_with_http_info(**kwargs) self.create_users_with_array_input = Endpoint( @@ -230,10 +230,10 @@ def __create_users_with_array_input( }, params_map={ 'all': [ - 'user_user', + 'user', ], 'required': [ - 'user_user', + 'user', ], 'nullable': [ ], @@ -248,13 +248,13 @@ def __create_users_with_array_input( 'allowed_values': { }, 'openapi_types': { - 'user_user': - ([user.User],), + 'user': + ([User],), }, 'attribute_map': { }, 'location_map': { - 'user_user': 'body', + 'user': 'body', }, 'collection_format_map': { } @@ -271,7 +271,7 @@ def __create_users_with_array_input( def __create_users_with_list_input( self, - user_user, + user, **kwargs ): """Creates list of users with given input array # noqa: E501 @@ -279,11 +279,11 @@ def __create_users_with_list_input( This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_users_with_list_input(user_user, async_req=True) + >>> thread = api.create_users_with_list_input(user, async_req=True) >>> result = thread.get() Args: - user_user ([user.User]): List of user object + user ([User]): List of user object Keyword Args: _return_http_data_only (bool): response data without head status @@ -330,8 +330,8 @@ def __create_users_with_list_input( '_check_return_type', True ) kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['user_user'] = \ - user_user + kwargs['user'] = \ + user return self.call_with_http_info(**kwargs) self.create_users_with_list_input = Endpoint( @@ -345,10 +345,10 @@ def __create_users_with_list_input( }, params_map={ 'all': [ - 'user_user', + 'user', ], 'required': [ - 'user_user', + 'user', ], 'nullable': [ ], @@ -363,13 +363,13 @@ def __create_users_with_list_input( 'allowed_values': { }, 'openapi_types': { - 'user_user': - ([user.User],), + 'user': + ([User],), }, 'attribute_map': { }, 'location_map': { - 'user_user': 'body', + 'user': 'body', }, 'collection_format_map': { } @@ -537,7 +537,7 @@ def __get_user_by_name( async_req (bool): execute request asynchronously Returns: - user.User + User If the method is called asynchronously, returns the request thread. """ @@ -566,7 +566,7 @@ def __get_user_by_name( self.get_user_by_name = Endpoint( settings={ - 'response_type': (user.User,), + 'response_type': (User,), 'auth': [], 'endpoint_path': '/user/{username}', 'operation_id': 'get_user_by_name', @@ -848,7 +848,7 @@ def __logout_user( def __update_user( self, username, - user_user, + user, **kwargs ): """Updated user # noqa: E501 @@ -857,12 +857,12 @@ def __update_user( This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.update_user(username, user_user, async_req=True) + >>> thread = api.update_user(username, user, async_req=True) >>> result = thread.get() Args: username (str): name that need to be deleted - user_user (user.User): Updated user object + user (User): Updated user object Keyword Args: _return_http_data_only (bool): response data without head status @@ -911,8 +911,8 @@ def __update_user( kwargs['_host_index'] = kwargs.get('_host_index') kwargs['username'] = \ username - kwargs['user_user'] = \ - user_user + kwargs['user'] = \ + user return self.call_with_http_info(**kwargs) self.update_user = Endpoint( @@ -927,11 +927,11 @@ def __update_user( params_map={ 'all': [ 'username', - 'user_user', + 'user', ], 'required': [ 'username', - 'user_user', + 'user', ], 'nullable': [ ], @@ -948,15 +948,15 @@ def __update_user( 'openapi_types': { 'username': (str,), - 'user_user': - (user.User,), + 'user': + (User,), }, 'attribute_map': { 'username': 'username', }, 'location_map': { 'username': 'path', - 'user_user': 'body', + 'user': 'body', }, 'collection_format_map': { } diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/additional_properties_class.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/additional_properties_class.py index bc7591c4eb5a..7c3910ca119f 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/additional_properties_class.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/additional_properties_class.py @@ -68,8 +68,8 @@ class AdditionalPropertiesClass(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -90,6 +90,7 @@ def openapi_types(): def discriminator(): return None + attribute_map = { 'map_property': 'map_property', # noqa: E501 'map_of_map_property': 'map_of_map_property', # noqa: E501 @@ -114,7 +115,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """additional_properties_class.AdditionalPropertiesClass - a model defined in OpenAPI + """AdditionalPropertiesClass - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/additional_properties_with_array_of_enums.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/additional_properties_with_array_of_enums.py index 006e258d72da..b48dee9bd04a 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/additional_properties_with_array_of_enums.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/additional_properties_with_array_of_enums.py @@ -29,11 +29,10 @@ none_type, validate_get_composed_info, ) -try: - from petstore_api.model import enum_class -except ImportError: - enum_class = sys.modules[ - 'petstore_api.model.enum_class'] + +def lazy_import(): + from petstore_api.model.enum_class import EnumClass + globals()['EnumClass'] = EnumClass class AdditionalPropertiesWithArrayOfEnums(ModelNormal): @@ -66,20 +65,28 @@ class AdditionalPropertiesWithArrayOfEnums(ModelNormal): validations = { } - additional_properties_type = ([enum_class.EnumClass],) # noqa: E501 + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ([EnumClass],) # noqa: E501 _nullable = False @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name and the value is attribute type. """ + lazy_import() return { } @@ -87,6 +94,7 @@ def openapi_types(): def discriminator(): return None + attribute_map = { } @@ -103,7 +111,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """additional_properties_with_array_of_enums.AdditionalPropertiesWithArrayOfEnums - a model defined in OpenAPI + """AdditionalPropertiesWithArrayOfEnums - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/address.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/address.py index 7c16f2ba3b5a..b8d829ccae36 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/address.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/address.py @@ -61,15 +61,21 @@ class Address(ModelNormal): validations = { } - additional_properties_type = (int,) # noqa: E501 + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (int,) # noqa: E501 _nullable = False @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -82,6 +88,7 @@ def openapi_types(): def discriminator(): return None + attribute_map = { } @@ -98,7 +105,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """address.Address - a model defined in OpenAPI + """Address - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/animal.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/animal.py index 7f1257e2ab4f..39aaa93227c7 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/animal.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/animal.py @@ -29,16 +29,12 @@ none_type, validate_get_composed_info, ) -try: - from petstore_api.model import cat -except ImportError: - cat = sys.modules[ - 'petstore_api.model.cat'] -try: - from petstore_api.model import dog -except ImportError: - dog = sys.modules[ - 'petstore_api.model.dog'] + +def lazy_import(): + from petstore_api.model.cat import Cat + from petstore_api.model.dog import Dog + globals()['Cat'] = Cat + globals()['Dog'] = Dog class Animal(ModelNormal): @@ -78,13 +74,14 @@ class Animal(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name and the value is attribute type. """ + lazy_import() return { 'class_name': (str,), # noqa: E501 'color': (str,), # noqa: E501 @@ -92,9 +89,10 @@ def openapi_types(): @cached_property def discriminator(): + lazy_import() val = { - 'Cat': cat.Cat, - 'Dog': dog.Dog, + 'Cat': Cat, + 'Dog': Dog, } if not val: return None @@ -118,7 +116,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, class_name, *args, **kwargs): # noqa: E501 - """animal.Animal - a model defined in OpenAPI + """Animal - a model defined in OpenAPI Args: class_name (str): diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/animal_farm.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/animal_farm.py index 94d6d094d68d..dc35f9394e1c 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/animal_farm.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/animal_farm.py @@ -29,11 +29,10 @@ none_type, validate_get_composed_info, ) -try: - from petstore_api.model import animal -except ImportError: - animal = sys.modules[ - 'petstore_api.model.animal'] + +def lazy_import(): + from petstore_api.model.animal import Animal + globals()['Animal'] = Animal class AnimalFarm(ModelSimple): @@ -69,21 +68,23 @@ class AnimalFarm(ModelSimple): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name and the value is attribute type. """ + lazy_import() return { - 'value': ([animal.Animal],), + 'value': ([Animal],), } @cached_property def discriminator(): return None + attribute_map = {} _composed_schemas = None @@ -99,10 +100,10 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, value, *args, **kwargs): - """animal_farm.AnimalFarm - a model defined in OpenAPI + """AnimalFarm - a model defined in OpenAPI Args: - value ([animal.Animal]): # noqa: E501 + value ([Animal]): # noqa: E501 Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/api_response.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/api_response.py index 24a2e3d897a6..bce1291d1f65 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/api_response.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/api_response.py @@ -68,8 +68,8 @@ class ApiResponse(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -85,6 +85,7 @@ def openapi_types(): def discriminator(): return None + attribute_map = { 'code': 'code', # noqa: E501 'type': 'type', # noqa: E501 @@ -104,7 +105,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """api_response.ApiResponse - a model defined in OpenAPI + """ApiResponse - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/apple.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/apple.py index a87374c4407b..dffec26c89fb 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/apple.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/apple.py @@ -79,8 +79,8 @@ class Apple(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -95,6 +95,7 @@ def openapi_types(): def discriminator(): return None + attribute_map = { 'cultivar': 'cultivar', # noqa: E501 'origin': 'origin', # noqa: E501 @@ -113,7 +114,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """apple.Apple - a model defined in OpenAPI + """Apple - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/apple_req.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/apple_req.py index 16ef4bcac8af..99beef5e9146 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/apple_req.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/apple_req.py @@ -68,8 +68,8 @@ class AppleReq(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -84,6 +84,7 @@ def openapi_types(): def discriminator(): return None + attribute_map = { 'cultivar': 'cultivar', # noqa: E501 'mealy': 'mealy', # noqa: E501 @@ -102,7 +103,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, cultivar, *args, **kwargs): # noqa: E501 - """apple_req.AppleReq - a model defined in OpenAPI + """AppleReq - a model defined in OpenAPI Args: cultivar (str): diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_array_of_number_only.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_array_of_number_only.py index 014740ca0a6f..7c7c2743398f 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_array_of_number_only.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_array_of_number_only.py @@ -68,8 +68,8 @@ class ArrayOfArrayOfNumberOnly(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -83,6 +83,7 @@ def openapi_types(): def discriminator(): return None + attribute_map = { 'array_array_number': 'ArrayArrayNumber', # noqa: E501 } @@ -100,7 +101,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """array_of_array_of_number_only.ArrayOfArrayOfNumberOnly - a model defined in OpenAPI + """ArrayOfArrayOfNumberOnly - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_enums.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_enums.py index dbde502ccd9e..7de4cae7f1eb 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_enums.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_enums.py @@ -29,11 +29,10 @@ none_type, validate_get_composed_info, ) -try: - from petstore_api.model import string_enum -except ImportError: - string_enum = sys.modules[ - 'petstore_api.model.string_enum'] + +def lazy_import(): + from petstore_api.model.string_enum import StringEnum + globals()['StringEnum'] = StringEnum class ArrayOfEnums(ModelSimple): @@ -69,21 +68,23 @@ class ArrayOfEnums(ModelSimple): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name and the value is attribute type. """ + lazy_import() return { - 'value': ([string_enum.StringEnum, none_type],), + 'value': ([StringEnum],), } @cached_property def discriminator(): return None + attribute_map = {} _composed_schemas = None @@ -99,10 +100,10 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, value, *args, **kwargs): - """array_of_enums.ArrayOfEnums - a model defined in OpenAPI + """ArrayOfEnums - a model defined in OpenAPI Args: - value ([string_enum.StringEnum, none_type]): # noqa: E501 + value ([StringEnum]): # noqa: E501 Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_number_only.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_number_only.py index 00afce1fb4a1..4947154bb6ea 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_number_only.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_number_only.py @@ -68,8 +68,8 @@ class ArrayOfNumberOnly(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -83,6 +83,7 @@ def openapi_types(): def discriminator(): return None + attribute_map = { 'array_number': 'ArrayNumber', # noqa: E501 } @@ -100,7 +101,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """array_of_number_only.ArrayOfNumberOnly - a model defined in OpenAPI + """ArrayOfNumberOnly - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_test.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_test.py index e4478c5acdc8..7b4d47ace893 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_test.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_test.py @@ -29,11 +29,10 @@ none_type, validate_get_composed_info, ) -try: - from petstore_api.model import read_only_first -except ImportError: - read_only_first = sys.modules[ - 'petstore_api.model.read_only_first'] + +def lazy_import(): + from petstore_api.model.read_only_first import ReadOnlyFirst + globals()['ReadOnlyFirst'] = ReadOnlyFirst class ArrayTest(ModelNormal): @@ -73,23 +72,25 @@ class ArrayTest(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name and the value is attribute type. """ + lazy_import() return { 'array_of_string': ([str],), # noqa: E501 'array_array_of_integer': ([[int]],), # noqa: E501 - 'array_array_of_model': ([[read_only_first.ReadOnlyFirst]],), # noqa: E501 + 'array_array_of_model': ([[ReadOnlyFirst]],), # noqa: E501 } @cached_property def discriminator(): return None + attribute_map = { 'array_of_string': 'array_of_string', # noqa: E501 'array_array_of_integer': 'array_array_of_integer', # noqa: E501 @@ -109,7 +110,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """array_test.ArrayTest - a model defined in OpenAPI + """ArrayTest - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types @@ -144,7 +145,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 _visited_composed_classes = (Animal,) array_of_string ([str]): [optional] # noqa: E501 array_array_of_integer ([[int]]): [optional] # noqa: E501 - array_array_of_model ([[read_only_first.ReadOnlyFirst]]): [optional] # noqa: E501 + array_array_of_model ([[ReadOnlyFirst]]): [optional] # noqa: E501 """ _check_type = kwargs.pop('_check_type', True) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/banana.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/banana.py index 13725068e7ee..ffbcdbd27fa6 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/banana.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/banana.py @@ -68,8 +68,8 @@ class Banana(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -83,6 +83,7 @@ def openapi_types(): def discriminator(): return None + attribute_map = { 'length_cm': 'lengthCm', # noqa: E501 } @@ -100,7 +101,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """banana.Banana - a model defined in OpenAPI + """Banana - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/banana_req.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/banana_req.py index 2675290a9c46..c69498698454 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/banana_req.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/banana_req.py @@ -68,8 +68,8 @@ class BananaReq(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -84,6 +84,7 @@ def openapi_types(): def discriminator(): return None + attribute_map = { 'length_cm': 'lengthCm', # noqa: E501 'sweet': 'sweet', # noqa: E501 @@ -102,7 +103,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, length_cm, *args, **kwargs): # noqa: E501 - """banana_req.BananaReq - a model defined in OpenAPI + """BananaReq - a model defined in OpenAPI Args: length_cm (float): diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/basque_pig.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/basque_pig.py index 2766647c867d..68532b82acc9 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/basque_pig.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/basque_pig.py @@ -68,8 +68,8 @@ class BasquePig(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -83,6 +83,7 @@ def openapi_types(): def discriminator(): return None + attribute_map = { 'class_name': 'className', # noqa: E501 } @@ -100,7 +101,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, class_name, *args, **kwargs): # noqa: E501 - """basque_pig.BasquePig - a model defined in OpenAPI + """BasquePig - a model defined in OpenAPI Args: class_name (str): diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/capitalization.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/capitalization.py index 18c5f54c06fe..3e0068ed6834 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/capitalization.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/capitalization.py @@ -68,8 +68,8 @@ class Capitalization(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -88,6 +88,7 @@ def openapi_types(): def discriminator(): return None + attribute_map = { 'small_camel': 'smallCamel', # noqa: E501 'capital_camel': 'CapitalCamel', # noqa: E501 @@ -110,7 +111,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """capitalization.Capitalization - a model defined in OpenAPI + """Capitalization - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/cat.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/cat.py index 32966359277d..79cb4253383a 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/cat.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/cat.py @@ -29,21 +29,14 @@ none_type, validate_get_composed_info, ) -try: - from petstore_api.model import address -except ImportError: - address = sys.modules[ - 'petstore_api.model.address'] -try: - from petstore_api.model import animal -except ImportError: - animal = sys.modules[ - 'petstore_api.model.animal'] -try: - from petstore_api.model import cat_all_of -except ImportError: - cat_all_of = sys.modules[ - 'petstore_api.model.cat_all_of'] + +def lazy_import(): + from petstore_api.model.address import Address + from petstore_api.model.animal import Animal + from petstore_api.model.cat_all_of import CatAllOf + globals()['Address'] = Address + globals()['Animal'] = Animal + globals()['CatAllOf'] = CatAllOf class Cat(ModelComposed): @@ -76,20 +69,28 @@ class Cat(ModelComposed): validations = { } - additional_properties_type = (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name and the value is attribute type. """ + lazy_import() return { 'class_name': (str,), # noqa: E501 'declawed': (bool,), # noqa: E501 @@ -124,7 +125,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, class_name, *args, **kwargs): # noqa: E501 - """cat.Cat - a model defined in OpenAPI + """Cat - a model defined in OpenAPI Args: class_name (str): @@ -232,13 +233,14 @@ def _composed_schemas(): # code would be run when this module is imported, and these composed # classes don't exist yet because their module has not finished # loading + lazy_import() return { 'anyOf': [ ], 'allOf': [ - address.Address, - animal.Animal, - cat_all_of.CatAllOf, + Address, + Animal, + CatAllOf, ], 'oneOf': [ ], diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/cat_all_of.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/cat_all_of.py index c257813c1206..dadc71475721 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/cat_all_of.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/cat_all_of.py @@ -68,8 +68,8 @@ class CatAllOf(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -83,6 +83,7 @@ def openapi_types(): def discriminator(): return None + attribute_map = { 'declawed': 'declawed', # noqa: E501 } @@ -100,7 +101,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """cat_all_of.CatAllOf - a model defined in OpenAPI + """CatAllOf - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/category.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/category.py index e2be1802b1d5..a5af94f90ce2 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/category.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/category.py @@ -68,8 +68,8 @@ class Category(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -84,6 +84,7 @@ def openapi_types(): def discriminator(): return None + attribute_map = { 'name': 'name', # noqa: E501 'id': 'id', # noqa: E501 @@ -102,7 +103,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """category.Category - a model defined in OpenAPI + """Category - a model defined in OpenAPI Args: diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/child_cat.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/child_cat.py index 0710d1523d69..dfeab37c441e 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/child_cat.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/child_cat.py @@ -29,16 +29,12 @@ none_type, validate_get_composed_info, ) -try: - from petstore_api.model import child_cat_all_of -except ImportError: - child_cat_all_of = sys.modules[ - 'petstore_api.model.child_cat_all_of'] -try: - from petstore_api.model import parent_pet -except ImportError: - parent_pet = sys.modules[ - 'petstore_api.model.parent_pet'] + +def lazy_import(): + from petstore_api.model.child_cat_all_of import ChildCatAllOf + from petstore_api.model.parent_pet import ParentPet + globals()['ChildCatAllOf'] = ChildCatAllOf + globals()['ParentPet'] = ParentPet class ChildCat(ModelComposed): @@ -71,20 +67,28 @@ class ChildCat(ModelComposed): validations = { } - additional_properties_type = (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name and the value is attribute type. """ + lazy_import() return { 'pet_type': (str,), # noqa: E501 'name': (str,), # noqa: E501 @@ -117,7 +121,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, pet_type, *args, **kwargs): # noqa: E501 - """child_cat.ChildCat - a model defined in OpenAPI + """ChildCat - a model defined in OpenAPI Args: pet_type (str): @@ -224,12 +228,13 @@ def _composed_schemas(): # code would be run when this module is imported, and these composed # classes don't exist yet because their module has not finished # loading + lazy_import() return { 'anyOf': [ ], 'allOf': [ - child_cat_all_of.ChildCatAllOf, - parent_pet.ParentPet, + ChildCatAllOf, + ParentPet, ], 'oneOf': [ ], diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/child_cat_all_of.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/child_cat_all_of.py index cc67b70c8748..d9c453ba4d67 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/child_cat_all_of.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/child_cat_all_of.py @@ -68,8 +68,8 @@ class ChildCatAllOf(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -83,6 +83,7 @@ def openapi_types(): def discriminator(): return None + attribute_map = { 'name': 'name', # noqa: E501 } @@ -100,7 +101,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """child_cat_all_of.ChildCatAllOf - a model defined in OpenAPI + """ChildCatAllOf - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/class_model.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/class_model.py index d80e4ef3671f..a1d4959a985e 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/class_model.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/class_model.py @@ -68,8 +68,8 @@ class ClassModel(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -83,6 +83,7 @@ def openapi_types(): def discriminator(): return None + attribute_map = { '_class': '_class', # noqa: E501 } @@ -100,7 +101,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """class_model.ClassModel - a model defined in OpenAPI + """ClassModel - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/client.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/client.py index 2ea3b4aadd4a..114dab427f4f 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/client.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/client.py @@ -68,8 +68,8 @@ class Client(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -83,6 +83,7 @@ def openapi_types(): def discriminator(): return None + attribute_map = { 'client': 'client', # noqa: E501 } @@ -100,7 +101,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """client.Client - a model defined in OpenAPI + """Client - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/complex_quadrilateral.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/complex_quadrilateral.py index 768104df4cc9..b1826e361b0e 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/complex_quadrilateral.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/complex_quadrilateral.py @@ -29,16 +29,12 @@ none_type, validate_get_composed_info, ) -try: - from petstore_api.model import quadrilateral_interface -except ImportError: - quadrilateral_interface = sys.modules[ - 'petstore_api.model.quadrilateral_interface'] -try: - from petstore_api.model import shape_interface -except ImportError: - shape_interface = sys.modules[ - 'petstore_api.model.shape_interface'] + +def lazy_import(): + from petstore_api.model.quadrilateral_interface import QuadrilateralInterface + from petstore_api.model.shape_interface import ShapeInterface + globals()['QuadrilateralInterface'] = QuadrilateralInterface + globals()['ShapeInterface'] = ShapeInterface class ComplexQuadrilateral(ModelComposed): @@ -71,20 +67,28 @@ class ComplexQuadrilateral(ModelComposed): validations = { } - additional_properties_type = (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name and the value is attribute type. """ + lazy_import() return { 'shape_type': (str,), # noqa: E501 'quadrilateral_type': (str,), # noqa: E501 @@ -94,6 +98,7 @@ def openapi_types(): def discriminator(): return None + attribute_map = { 'shape_type': 'shapeType', # noqa: E501 'quadrilateral_type': 'quadrilateralType', # noqa: E501 @@ -113,7 +118,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, shape_type, quadrilateral_type, *args, **kwargs): # noqa: E501 - """complex_quadrilateral.ComplexQuadrilateral - a model defined in OpenAPI + """ComplexQuadrilateral - a model defined in OpenAPI Args: shape_type (str): @@ -221,12 +226,13 @@ def _composed_schemas(): # code would be run when this module is imported, and these composed # classes don't exist yet because their module has not finished # loading + lazy_import() return { 'anyOf': [ ], 'allOf': [ - quadrilateral_interface.QuadrilateralInterface, - shape_interface.ShapeInterface, + QuadrilateralInterface, + ShapeInterface, ], 'oneOf': [ ], diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_one_of_number_with_validations.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_one_of_number_with_validations.py index b513cd1039a9..b94be08717f7 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_one_of_number_with_validations.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_one_of_number_with_validations.py @@ -29,16 +29,12 @@ none_type, validate_get_composed_info, ) -try: - from petstore_api.model import animal -except ImportError: - animal = sys.modules[ - 'petstore_api.model.animal'] -try: - from petstore_api.model import number_with_validations -except ImportError: - number_with_validations = sys.modules[ - 'petstore_api.model.number_with_validations'] + +def lazy_import(): + from petstore_api.model.animal import Animal + from petstore_api.model.number_with_validations import NumberWithValidations + globals()['Animal'] = Animal + globals()['NumberWithValidations'] = NumberWithValidations class ComposedOneOfNumberWithValidations(ModelComposed): @@ -71,20 +67,28 @@ class ComposedOneOfNumberWithValidations(ModelComposed): validations = { } - additional_properties_type = (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name and the value is attribute type. """ + lazy_import() return { 'class_name': (str,), # noqa: E501 'color': (str,), # noqa: E501 @@ -94,6 +98,7 @@ def openapi_types(): def discriminator(): return None + attribute_map = { 'class_name': 'className', # noqa: E501 'color': 'color', # noqa: E501 @@ -113,7 +118,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """composed_one_of_number_with_validations.ComposedOneOfNumberWithValidations - a model defined in OpenAPI + """ComposedOneOfNumberWithValidations - a model defined in OpenAPI Args: @@ -221,15 +226,16 @@ def _composed_schemas(): # code would be run when this module is imported, and these composed # classes don't exist yet because their module has not finished # loading + lazy_import() return { 'anyOf': [ ], 'allOf': [ ], 'oneOf': [ - animal.Animal, + Animal, + NumberWithValidations, date, none_type, - number_with_validations.NumberWithValidations, ], } diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/danish_pig.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/danish_pig.py index 768a47bdc72a..ab547146c57b 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/danish_pig.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/danish_pig.py @@ -68,8 +68,8 @@ class DanishPig(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -83,6 +83,7 @@ def openapi_types(): def discriminator(): return None + attribute_map = { 'class_name': 'className', # noqa: E501 } @@ -100,7 +101,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, class_name, *args, **kwargs): # noqa: E501 - """danish_pig.DanishPig - a model defined in OpenAPI + """DanishPig - a model defined in OpenAPI Args: class_name (str): diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/dog.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/dog.py index 836d19b484ad..9dcfb59d09ca 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/dog.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/dog.py @@ -29,16 +29,12 @@ none_type, validate_get_composed_info, ) -try: - from petstore_api.model import animal -except ImportError: - animal = sys.modules[ - 'petstore_api.model.animal'] -try: - from petstore_api.model import dog_all_of -except ImportError: - dog_all_of = sys.modules[ - 'petstore_api.model.dog_all_of'] + +def lazy_import(): + from petstore_api.model.animal import Animal + from petstore_api.model.dog_all_of import DogAllOf + globals()['Animal'] = Animal + globals()['DogAllOf'] = DogAllOf class Dog(ModelComposed): @@ -71,20 +67,28 @@ class Dog(ModelComposed): validations = { } - additional_properties_type = (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name and the value is attribute type. """ + lazy_import() return { 'class_name': (str,), # noqa: E501 'breed': (str,), # noqa: E501 @@ -119,7 +123,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, class_name, *args, **kwargs): # noqa: E501 - """dog.Dog - a model defined in OpenAPI + """Dog - a model defined in OpenAPI Args: class_name (str): @@ -227,12 +231,13 @@ def _composed_schemas(): # code would be run when this module is imported, and these composed # classes don't exist yet because their module has not finished # loading + lazy_import() return { 'anyOf': [ ], 'allOf': [ - animal.Animal, - dog_all_of.DogAllOf, + Animal, + DogAllOf, ], 'oneOf': [ ], diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/dog_all_of.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/dog_all_of.py index 299a4d956bc9..c27b3bbc053b 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/dog_all_of.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/dog_all_of.py @@ -68,8 +68,8 @@ class DogAllOf(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -83,6 +83,7 @@ def openapi_types(): def discriminator(): return None + attribute_map = { 'breed': 'breed', # noqa: E501 } @@ -100,7 +101,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """dog_all_of.DogAllOf - a model defined in OpenAPI + """DogAllOf - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/drawing.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/drawing.py index ea6422a10222..21b5ef5054be 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/drawing.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/drawing.py @@ -29,26 +29,16 @@ none_type, validate_get_composed_info, ) -try: - from petstore_api.model import fruit -except ImportError: - fruit = sys.modules[ - 'petstore_api.model.fruit'] -try: - from petstore_api.model import nullable_shape -except ImportError: - nullable_shape = sys.modules[ - 'petstore_api.model.nullable_shape'] -try: - from petstore_api.model import shape -except ImportError: - shape = sys.modules[ - 'petstore_api.model.shape'] -try: - from petstore_api.model import shape_or_null -except ImportError: - shape_or_null = sys.modules[ - 'petstore_api.model.shape_or_null'] + +def lazy_import(): + 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 + globals()['Fruit'] = Fruit + globals()['NullableShape'] = NullableShape + globals()['Shape'] = Shape + globals()['ShapeOrNull'] = ShapeOrNull class Drawing(ModelNormal): @@ -81,31 +71,40 @@ class Drawing(ModelNormal): validations = { } - additional_properties_type = (fruit.Fruit,) # noqa: E501 + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (Fruit,) # noqa: E501 _nullable = False @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name and the value is attribute type. """ + lazy_import() return { - 'main_shape': (shape.Shape,), # noqa: E501 - 'shape_or_null': (shape_or_null.ShapeOrNull,), # noqa: E501 - 'nullable_shape': (nullable_shape.NullableShape,), # noqa: E501 - 'shapes': ([shape.Shape],), # noqa: E501 + 'main_shape': (Shape,), # noqa: E501 + 'shape_or_null': (ShapeOrNull,), # noqa: E501 + 'nullable_shape': (NullableShape,), # noqa: E501 + 'shapes': ([Shape],), # noqa: E501 } @cached_property def discriminator(): return None + attribute_map = { 'main_shape': 'mainShape', # noqa: E501 'shape_or_null': 'shapeOrNull', # noqa: E501 @@ -126,7 +125,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """drawing.Drawing - a model defined in OpenAPI + """Drawing - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types @@ -159,10 +158,10 @@ def __init__(self, *args, **kwargs): # noqa: E501 Animal class but this time we won't travel through its discriminator because we passed in _visited_composed_classes = (Animal,) - main_shape (shape.Shape): [optional] # noqa: E501 - shape_or_null (shape_or_null.ShapeOrNull): [optional] # noqa: E501 - nullable_shape (nullable_shape.NullableShape): [optional] # noqa: E501 - shapes ([shape.Shape]): [optional] # noqa: E501 + main_shape (Shape): [optional] # noqa: E501 + shape_or_null (ShapeOrNull): [optional] # noqa: E501 + nullable_shape (NullableShape): [optional] # noqa: E501 + shapes ([Shape]): [optional] # noqa: E501 """ _check_type = kwargs.pop('_check_type', True) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_arrays.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_arrays.py index 161ddd5c1d1e..4b04cd104018 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_arrays.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_arrays.py @@ -76,8 +76,8 @@ class EnumArrays(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -92,6 +92,7 @@ def openapi_types(): def discriminator(): return None + attribute_map = { 'just_symbol': 'just_symbol', # noqa: E501 'array_enum': 'array_enum', # noqa: E501 @@ -110,7 +111,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """enum_arrays.EnumArrays - a model defined in OpenAPI + """EnumArrays - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_class.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_class.py index dac3ee37d032..5c9799cce105 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_class.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_class.py @@ -69,8 +69,8 @@ class EnumClass(ModelSimple): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -84,6 +84,7 @@ def openapi_types(): def discriminator(): return None + attribute_map = {} _composed_schemas = None @@ -99,7 +100,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, value, *args, **kwargs): - """enum_class.EnumClass - a model defined in OpenAPI + """EnumClass - a model defined in OpenAPI Args: value (str): if omitted the server will use the default value of '-efg', must be one of ["_abc", "-efg", "(xyz)", ] # noqa: E501 diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_test.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_test.py index 120cb1b3da97..633a0b5ecd24 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_test.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_test.py @@ -29,31 +29,18 @@ none_type, validate_get_composed_info, ) -try: - from petstore_api.model import integer_enum -except ImportError: - integer_enum = sys.modules[ - 'petstore_api.model.integer_enum'] -try: - from petstore_api.model import integer_enum_one_value -except ImportError: - integer_enum_one_value = sys.modules[ - 'petstore_api.model.integer_enum_one_value'] -try: - from petstore_api.model import integer_enum_with_default_value -except ImportError: - integer_enum_with_default_value = sys.modules[ - 'petstore_api.model.integer_enum_with_default_value'] -try: - from petstore_api.model import string_enum -except ImportError: - string_enum = sys.modules[ - 'petstore_api.model.string_enum'] -try: - from petstore_api.model import string_enum_with_default_value -except ImportError: - string_enum_with_default_value = sys.modules[ - 'petstore_api.model.string_enum_with_default_value'] + +def lazy_import(): + 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 + globals()['IntegerEnum'] = IntegerEnum + globals()['IntegerEnumOneValue'] = IntegerEnumOneValue + globals()['IntegerEnumWithDefaultValue'] = IntegerEnumWithDefaultValue + globals()['StringEnum'] = StringEnum + globals()['StringEnumWithDefaultValue'] = StringEnumWithDefaultValue class EnumTest(ModelNormal): @@ -111,29 +98,31 @@ class EnumTest(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name and the value is attribute type. """ + lazy_import() return { 'enum_string_required': (str,), # noqa: E501 'enum_string': (str,), # noqa: E501 'enum_integer': (int,), # noqa: E501 'enum_number': (float,), # noqa: E501 - 'string_enum': (string_enum.StringEnum, none_type,), # noqa: E501 - 'integer_enum': (integer_enum.IntegerEnum,), # noqa: E501 - 'string_enum_with_default_value': (string_enum_with_default_value.StringEnumWithDefaultValue,), # noqa: E501 - 'integer_enum_with_default_value': (integer_enum_with_default_value.IntegerEnumWithDefaultValue,), # noqa: E501 - 'integer_enum_one_value': (integer_enum_one_value.IntegerEnumOneValue,), # noqa: E501 + 'string_enum': (StringEnum,), # noqa: E501 + 'integer_enum': (IntegerEnum,), # noqa: E501 + 'string_enum_with_default_value': (StringEnumWithDefaultValue,), # noqa: E501 + 'integer_enum_with_default_value': (IntegerEnumWithDefaultValue,), # noqa: E501 + 'integer_enum_one_value': (IntegerEnumOneValue,), # noqa: E501 } @cached_property def discriminator(): return None + attribute_map = { 'enum_string_required': 'enum_string_required', # noqa: E501 'enum_string': 'enum_string', # noqa: E501 @@ -159,7 +148,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, enum_string_required, *args, **kwargs): # noqa: E501 - """enum_test.EnumTest - a model defined in OpenAPI + """EnumTest - a model defined in OpenAPI Args: enum_string_required (str): @@ -198,11 +187,11 @@ def __init__(self, enum_string_required, *args, **kwargs): # noqa: E501 enum_string (str): [optional] # noqa: E501 enum_integer (int): [optional] # noqa: E501 enum_number (float): [optional] # noqa: E501 - string_enum (string_enum.StringEnum, none_type): [optional] # noqa: E501 - integer_enum (integer_enum.IntegerEnum): [optional] # noqa: E501 - string_enum_with_default_value (string_enum_with_default_value.StringEnumWithDefaultValue): [optional] # noqa: E501 - integer_enum_with_default_value (integer_enum_with_default_value.IntegerEnumWithDefaultValue): [optional] # noqa: E501 - integer_enum_one_value (integer_enum_one_value.IntegerEnumOneValue): [optional] # noqa: E501 + string_enum (StringEnum): [optional] # noqa: E501 + integer_enum (IntegerEnum): [optional] # noqa: E501 + string_enum_with_default_value (StringEnumWithDefaultValue): [optional] # noqa: E501 + integer_enum_with_default_value (IntegerEnumWithDefaultValue): [optional] # noqa: E501 + integer_enum_one_value (IntegerEnumOneValue): [optional] # noqa: E501 """ _check_type = kwargs.pop('_check_type', True) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/equilateral_triangle.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/equilateral_triangle.py index e3a3507fa7f3..214e84d760d1 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/equilateral_triangle.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/equilateral_triangle.py @@ -29,16 +29,12 @@ none_type, validate_get_composed_info, ) -try: - from petstore_api.model import shape_interface -except ImportError: - shape_interface = sys.modules[ - 'petstore_api.model.shape_interface'] -try: - from petstore_api.model import triangle_interface -except ImportError: - triangle_interface = sys.modules[ - 'petstore_api.model.triangle_interface'] + +def lazy_import(): + from petstore_api.model.shape_interface import ShapeInterface + from petstore_api.model.triangle_interface import TriangleInterface + globals()['ShapeInterface'] = ShapeInterface + globals()['TriangleInterface'] = TriangleInterface class EquilateralTriangle(ModelComposed): @@ -71,20 +67,28 @@ class EquilateralTriangle(ModelComposed): validations = { } - additional_properties_type = (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name and the value is attribute type. """ + lazy_import() return { 'shape_type': (str,), # noqa: E501 'triangle_type': (str,), # noqa: E501 @@ -94,6 +98,7 @@ def openapi_types(): def discriminator(): return None + attribute_map = { 'shape_type': 'shapeType', # noqa: E501 'triangle_type': 'triangleType', # noqa: E501 @@ -113,7 +118,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, shape_type, triangle_type, *args, **kwargs): # noqa: E501 - """equilateral_triangle.EquilateralTriangle - a model defined in OpenAPI + """EquilateralTriangle - a model defined in OpenAPI Args: shape_type (str): @@ -221,12 +226,13 @@ def _composed_schemas(): # code would be run when this module is imported, and these composed # classes don't exist yet because their module has not finished # loading + lazy_import() return { 'anyOf': [ ], 'allOf': [ - shape_interface.ShapeInterface, - triangle_interface.TriangleInterface, + ShapeInterface, + TriangleInterface, ], 'oneOf': [ ], diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/file.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/file.py index f7cdcb4fdf8b..2dc360144d60 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/file.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/file.py @@ -68,8 +68,8 @@ class File(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -83,6 +83,7 @@ def openapi_types(): def discriminator(): return None + attribute_map = { 'source_uri': 'sourceURI', # noqa: E501 } @@ -100,7 +101,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """file.File - a model defined in OpenAPI + """File - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/file_schema_test_class.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/file_schema_test_class.py index 3c1d880d3585..dc1405e1fe91 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/file_schema_test_class.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/file_schema_test_class.py @@ -29,11 +29,10 @@ none_type, validate_get_composed_info, ) -try: - from petstore_api.model import file -except ImportError: - file = sys.modules[ - 'petstore_api.model.file'] + +def lazy_import(): + from petstore_api.model.file import File + globals()['File'] = File class FileSchemaTestClass(ModelNormal): @@ -73,22 +72,24 @@ class FileSchemaTestClass(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name and the value is attribute type. """ + lazy_import() return { - 'file': (file.File,), # noqa: E501 - 'files': ([file.File],), # noqa: E501 + 'file': (File,), # noqa: E501 + 'files': ([File],), # noqa: E501 } @cached_property def discriminator(): return None + attribute_map = { 'file': 'file', # noqa: E501 'files': 'files', # noqa: E501 @@ -107,7 +108,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """file_schema_test_class.FileSchemaTestClass - a model defined in OpenAPI + """FileSchemaTestClass - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types @@ -140,8 +141,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 Animal class but this time we won't travel through its discriminator because we passed in _visited_composed_classes = (Animal,) - file (file.File): [optional] # noqa: E501 - files ([file.File]): [optional] # noqa: E501 + file (File): [optional] # noqa: E501 + files ([File]): [optional] # noqa: E501 """ _check_type = kwargs.pop('_check_type', True) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/foo.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/foo.py index 5bb23de0783b..2947adf7dcb8 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/foo.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/foo.py @@ -68,8 +68,8 @@ class Foo(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -83,6 +83,7 @@ def openapi_types(): def discriminator(): return None + attribute_map = { 'bar': 'bar', # noqa: E501 } @@ -100,7 +101,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """foo.Foo - a model defined in OpenAPI + """Foo - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/format_test.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/format_test.py index 929b5abb69ae..309609987992 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/format_test.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/format_test.py @@ -111,8 +111,8 @@ class FormatTest(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -140,6 +140,7 @@ def openapi_types(): def discriminator(): return None + attribute_map = { 'number': 'number', # noqa: E501 'byte': 'byte', # noqa: E501 @@ -171,7 +172,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, number, byte, date, password, *args, **kwargs): # noqa: E501 - """format_test.FormatTest - a model defined in OpenAPI + """FormatTest - a model defined in OpenAPI Args: number (float): diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/fruit.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/fruit.py index 61f95c056a9d..4da9bf18dc22 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/fruit.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/fruit.py @@ -29,16 +29,12 @@ none_type, validate_get_composed_info, ) -try: - from petstore_api.model import apple -except ImportError: - apple = sys.modules[ - 'petstore_api.model.apple'] -try: - from petstore_api.model import banana -except ImportError: - banana = sys.modules[ - 'petstore_api.model.banana'] + +def lazy_import(): + from petstore_api.model.apple import Apple + from petstore_api.model.banana import Banana + globals()['Apple'] = Apple + globals()['Banana'] = Banana class Fruit(ModelComposed): @@ -89,13 +85,14 @@ class Fruit(ModelComposed): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name and the value is attribute type. """ + lazy_import() return { 'color': (str,), # noqa: E501 'cultivar': (str,), # noqa: E501 @@ -107,6 +104,7 @@ def openapi_types(): def discriminator(): return None + attribute_map = { 'color': 'color', # noqa: E501 'cultivar': 'cultivar', # noqa: E501 @@ -128,7 +126,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """fruit.Fruit - a model defined in OpenAPI + """Fruit - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types @@ -234,13 +232,14 @@ def _composed_schemas(): # code would be run when this module is imported, and these composed # classes don't exist yet because their module has not finished # loading + lazy_import() return { 'anyOf': [ ], 'allOf': [ ], 'oneOf': [ - apple.Apple, - banana.Banana, + Apple, + Banana, ], } diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/fruit_req.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/fruit_req.py index 88ace981c69b..83d0b29e8501 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/fruit_req.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/fruit_req.py @@ -29,16 +29,12 @@ none_type, validate_get_composed_info, ) -try: - from petstore_api.model import apple_req -except ImportError: - apple_req = sys.modules[ - 'petstore_api.model.apple_req'] -try: - from petstore_api.model import banana_req -except ImportError: - banana_req = sys.modules[ - 'petstore_api.model.banana_req'] + +def lazy_import(): + from petstore_api.model.apple_req import AppleReq + from petstore_api.model.banana_req import BananaReq + globals()['AppleReq'] = AppleReq + globals()['BananaReq'] = BananaReq class FruitReq(ModelComposed): @@ -78,13 +74,14 @@ class FruitReq(ModelComposed): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name and the value is attribute type. """ + lazy_import() return { 'cultivar': (str,), # noqa: E501 'length_cm': (float,), # noqa: E501 @@ -96,6 +93,7 @@ def openapi_types(): def discriminator(): return None + attribute_map = { 'cultivar': 'cultivar', # noqa: E501 'length_cm': 'lengthCm', # noqa: E501 @@ -117,7 +115,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """fruit_req.FruitReq - a model defined in OpenAPI + """FruitReq - a model defined in OpenAPI Args: @@ -229,14 +227,15 @@ def _composed_schemas(): # code would be run when this module is imported, and these composed # classes don't exist yet because their module has not finished # loading + lazy_import() return { 'anyOf': [ ], 'allOf': [ ], 'oneOf': [ - apple_req.AppleReq, - banana_req.BananaReq, + AppleReq, + BananaReq, none_type, ], } diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/gm_fruit.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/gm_fruit.py index 9e063a029081..51a6ab77f10a 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/gm_fruit.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/gm_fruit.py @@ -29,16 +29,12 @@ none_type, validate_get_composed_info, ) -try: - from petstore_api.model import apple -except ImportError: - apple = sys.modules[ - 'petstore_api.model.apple'] -try: - from petstore_api.model import banana -except ImportError: - banana = sys.modules[ - 'petstore_api.model.banana'] + +def lazy_import(): + from petstore_api.model.apple import Apple + from petstore_api.model.banana import Banana + globals()['Apple'] = Apple + globals()['Banana'] = Banana class GmFruit(ModelComposed): @@ -89,13 +85,14 @@ class GmFruit(ModelComposed): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name and the value is attribute type. """ + lazy_import() return { 'color': (str,), # noqa: E501 'cultivar': (str,), # noqa: E501 @@ -107,6 +104,7 @@ def openapi_types(): def discriminator(): return None + attribute_map = { 'color': 'color', # noqa: E501 'cultivar': 'cultivar', # noqa: E501 @@ -128,7 +126,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """gm_fruit.GmFruit - a model defined in OpenAPI + """GmFruit - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types @@ -234,10 +232,11 @@ def _composed_schemas(): # code would be run when this module is imported, and these composed # classes don't exist yet because their module has not finished # loading + lazy_import() return { 'anyOf': [ - apple.Apple, - banana.Banana, + Apple, + Banana, ], 'allOf': [ ], diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/grandparent_animal.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/grandparent_animal.py index 3f847bc715dd..631e6c636aae 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/grandparent_animal.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/grandparent_animal.py @@ -29,16 +29,12 @@ none_type, validate_get_composed_info, ) -try: - from petstore_api.model import child_cat -except ImportError: - child_cat = sys.modules[ - 'petstore_api.model.child_cat'] -try: - from petstore_api.model import parent_pet -except ImportError: - parent_pet = sys.modules[ - 'petstore_api.model.parent_pet'] + +def lazy_import(): + from petstore_api.model.child_cat import ChildCat + from petstore_api.model.parent_pet import ParentPet + globals()['ChildCat'] = ChildCat + globals()['ParentPet'] = ParentPet class GrandparentAnimal(ModelNormal): @@ -78,22 +74,24 @@ class GrandparentAnimal(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name and the value is attribute type. """ + lazy_import() return { 'pet_type': (str,), # noqa: E501 } @cached_property def discriminator(): + lazy_import() val = { - 'ChildCat': child_cat.ChildCat, - 'ParentPet': parent_pet.ParentPet, + 'ChildCat': ChildCat, + 'ParentPet': ParentPet, } if not val: return None @@ -116,7 +114,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, pet_type, *args, **kwargs): # noqa: E501 - """grandparent_animal.GrandparentAnimal - a model defined in OpenAPI + """GrandparentAnimal - a model defined in OpenAPI Args: pet_type (str): diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/has_only_read_only.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/has_only_read_only.py index 7a722ee9c78c..a89269f087df 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/has_only_read_only.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/has_only_read_only.py @@ -68,8 +68,8 @@ class HasOnlyReadOnly(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -84,6 +84,7 @@ def openapi_types(): def discriminator(): return None + attribute_map = { 'bar': 'bar', # noqa: E501 'foo': 'foo', # noqa: E501 @@ -102,7 +103,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """has_only_read_only.HasOnlyReadOnly - a model defined in OpenAPI + """HasOnlyReadOnly - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/health_check_result.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/health_check_result.py index 4c56f5022423..a664172b8db9 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/health_check_result.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/health_check_result.py @@ -68,8 +68,8 @@ class HealthCheckResult(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -83,6 +83,7 @@ def openapi_types(): def discriminator(): return None + attribute_map = { 'nullable_message': 'NullableMessage', # noqa: E501 } @@ -100,7 +101,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """health_check_result.HealthCheckResult - a model defined in OpenAPI + """HealthCheckResult - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_object.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_object.py index 062e58320122..0e409d5ca3f3 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_object.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_object.py @@ -68,8 +68,8 @@ class InlineObject(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -84,6 +84,7 @@ def openapi_types(): def discriminator(): return None + attribute_map = { 'name': 'name', # noqa: E501 'status': 'status', # noqa: E501 @@ -102,7 +103,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """inline_object.InlineObject - a model defined in OpenAPI + """InlineObject - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_object1.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_object1.py index 7cfd107cc18e..3969643b7c00 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_object1.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_object1.py @@ -68,8 +68,8 @@ class InlineObject1(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -84,6 +84,7 @@ def openapi_types(): def discriminator(): return None + attribute_map = { 'additional_metadata': 'additionalMetadata', # noqa: E501 'file': 'file', # noqa: E501 @@ -102,7 +103,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """inline_object1.InlineObject1 - a model defined in OpenAPI + """InlineObject1 - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_object2.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_object2.py index adde4e38e9fa..cb8a3b1758db 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_object2.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_object2.py @@ -77,8 +77,8 @@ class InlineObject2(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -93,6 +93,7 @@ def openapi_types(): def discriminator(): return None + attribute_map = { 'enum_form_string_array': 'enum_form_string_array', # noqa: E501 'enum_form_string': 'enum_form_string', # noqa: E501 @@ -111,7 +112,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """inline_object2.InlineObject2 - a model defined in OpenAPI + """InlineObject2 - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_object3.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_object3.py index 1cadbd05785c..b6d93037c335 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_object3.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_object3.py @@ -102,8 +102,8 @@ class InlineObject3(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -130,6 +130,7 @@ def openapi_types(): def discriminator(): return None + attribute_map = { 'number': 'number', # noqa: E501 'double': 'double', # noqa: E501 @@ -160,7 +161,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, number, double, pattern_without_delimiter, byte, *args, **kwargs): # noqa: E501 - """inline_object3.InlineObject3 - a model defined in OpenAPI + """InlineObject3 - a model defined in OpenAPI Args: number (float): None diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_object4.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_object4.py index 1625fed11416..b7e0f469efdb 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_object4.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_object4.py @@ -68,8 +68,8 @@ class InlineObject4(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -84,6 +84,7 @@ def openapi_types(): def discriminator(): return None + attribute_map = { 'param': 'param', # noqa: E501 'param2': 'param2', # noqa: E501 @@ -102,7 +103,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, param, param2, *args, **kwargs): # noqa: E501 - """inline_object4.InlineObject4 - a model defined in OpenAPI + """InlineObject4 - a model defined in OpenAPI Args: param (str): field1 diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_object5.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_object5.py index 57d0e6f2c86c..041699c0da6f 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_object5.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_object5.py @@ -68,8 +68,8 @@ class InlineObject5(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -84,6 +84,7 @@ def openapi_types(): def discriminator(): return None + attribute_map = { 'required_file': 'requiredFile', # noqa: E501 'additional_metadata': 'additionalMetadata', # noqa: E501 @@ -102,7 +103,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, required_file, *args, **kwargs): # noqa: E501 - """inline_object5.InlineObject5 - a model defined in OpenAPI + """InlineObject5 - a model defined in OpenAPI Args: required_file (file_type): file to upload diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_response_default.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_response_default.py index a80abc389710..3535bcb83e77 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_response_default.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_response_default.py @@ -29,11 +29,10 @@ none_type, validate_get_composed_info, ) -try: - from petstore_api.model import foo -except ImportError: - foo = sys.modules[ - 'petstore_api.model.foo'] + +def lazy_import(): + from petstore_api.model.foo import Foo + globals()['Foo'] = Foo class InlineResponseDefault(ModelNormal): @@ -73,21 +72,23 @@ class InlineResponseDefault(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name and the value is attribute type. """ + lazy_import() return { - 'string': (foo.Foo,), # noqa: E501 + 'string': (Foo,), # noqa: E501 } @cached_property def discriminator(): return None + attribute_map = { 'string': 'string', # noqa: E501 } @@ -105,7 +106,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """inline_response_default.InlineResponseDefault - a model defined in OpenAPI + """InlineResponseDefault - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types @@ -138,7 +139,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 Animal class but this time we won't travel through its discriminator because we passed in _visited_composed_classes = (Animal,) - string (foo.Foo): [optional] # noqa: E501 + string (Foo): [optional] # noqa: E501 """ _check_type = kwargs.pop('_check_type', True) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum.py index 9f68ce79be7c..67d924c427c0 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum.py @@ -69,8 +69,8 @@ class IntegerEnum(ModelSimple): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -84,6 +84,7 @@ def openapi_types(): def discriminator(): return None + attribute_map = {} _composed_schemas = None @@ -99,7 +100,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, value, *args, **kwargs): - """integer_enum.IntegerEnum - a model defined in OpenAPI + """IntegerEnum - a model defined in OpenAPI Args: value (int):, must be one of [0, 1, 2, ] # noqa: E501 diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_one_value.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_one_value.py index ee0ef6db55c4..2ce011ae21dd 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_one_value.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_one_value.py @@ -67,8 +67,8 @@ class IntegerEnumOneValue(ModelSimple): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -82,6 +82,7 @@ def openapi_types(): def discriminator(): return None + attribute_map = {} _composed_schemas = None @@ -97,7 +98,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): - """integer_enum_one_value.IntegerEnumOneValue - a model defined in OpenAPI + """IntegerEnumOneValue - a model defined in OpenAPI Keyword Args: value (int): defaults to 0, must be one of [0, ] # noqa: E501 diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_with_default_value.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_with_default_value.py index 73211d171cec..04884c5dfdc3 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_with_default_value.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_with_default_value.py @@ -69,8 +69,8 @@ class IntegerEnumWithDefaultValue(ModelSimple): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -84,6 +84,7 @@ def openapi_types(): def discriminator(): return None + attribute_map = {} _composed_schemas = None @@ -99,7 +100,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, value, *args, **kwargs): - """integer_enum_with_default_value.IntegerEnumWithDefaultValue - a model defined in OpenAPI + """IntegerEnumWithDefaultValue - a model defined in OpenAPI Args: value (int): if omitted the server will use the default value of 0, must be one of [0, 1, 2, ] # noqa: E501 diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/isosceles_triangle.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/isosceles_triangle.py index a608fe9b7235..2e3108154fd2 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/isosceles_triangle.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/isosceles_triangle.py @@ -29,16 +29,12 @@ none_type, validate_get_composed_info, ) -try: - from petstore_api.model import shape_interface -except ImportError: - shape_interface = sys.modules[ - 'petstore_api.model.shape_interface'] -try: - from petstore_api.model import triangle_interface -except ImportError: - triangle_interface = sys.modules[ - 'petstore_api.model.triangle_interface'] + +def lazy_import(): + from petstore_api.model.shape_interface import ShapeInterface + from petstore_api.model.triangle_interface import TriangleInterface + globals()['ShapeInterface'] = ShapeInterface + globals()['TriangleInterface'] = TriangleInterface class IsoscelesTriangle(ModelComposed): @@ -78,13 +74,14 @@ class IsoscelesTriangle(ModelComposed): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name and the value is attribute type. """ + lazy_import() return { 'shape_type': (str,), # noqa: E501 'triangle_type': (str,), # noqa: E501 @@ -94,6 +91,7 @@ def openapi_types(): def discriminator(): return None + attribute_map = { 'shape_type': 'shapeType', # noqa: E501 'triangle_type': 'triangleType', # noqa: E501 @@ -113,7 +111,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, shape_type, triangle_type, *args, **kwargs): # noqa: E501 - """isosceles_triangle.IsoscelesTriangle - a model defined in OpenAPI + """IsoscelesTriangle - a model defined in OpenAPI Args: shape_type (str): @@ -221,12 +219,13 @@ def _composed_schemas(): # code would be run when this module is imported, and these composed # classes don't exist yet because their module has not finished # loading + lazy_import() return { 'anyOf': [ ], 'allOf': [ - shape_interface.ShapeInterface, - triangle_interface.TriangleInterface, + ShapeInterface, + TriangleInterface, ], 'oneOf': [ ], diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/list.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/list.py index 77bd4d0565dc..48a4934b3c36 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/list.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/list.py @@ -68,8 +68,8 @@ class List(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -83,6 +83,7 @@ def openapi_types(): def discriminator(): return None + attribute_map = { '_123_list': '123-list', # noqa: E501 } @@ -100,7 +101,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """list.List - a model defined in OpenAPI + """List - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/mammal.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/mammal.py index f6c274287fd8..965b2387f661 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/mammal.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/mammal.py @@ -29,21 +29,14 @@ none_type, validate_get_composed_info, ) -try: - from petstore_api.model import pig -except ImportError: - pig = sys.modules[ - 'petstore_api.model.pig'] -try: - from petstore_api.model import whale -except ImportError: - whale = sys.modules[ - 'petstore_api.model.whale'] -try: - from petstore_api.model import zebra -except ImportError: - zebra = sys.modules[ - 'petstore_api.model.zebra'] + +def lazy_import(): + from petstore_api.model.pig import Pig + from petstore_api.model.whale import Whale + from petstore_api.model.zebra import Zebra + globals()['Pig'] = Pig + globals()['Whale'] = Whale + globals()['Zebra'] = Zebra class Mammal(ModelComposed): @@ -81,20 +74,28 @@ class Mammal(ModelComposed): validations = { } - additional_properties_type = (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name and the value is attribute type. """ + lazy_import() return { 'class_name': (str,), # noqa: E501 'has_baleen': (bool,), # noqa: E501 @@ -104,10 +105,11 @@ def openapi_types(): @cached_property def discriminator(): + lazy_import() val = { - 'Pig': pig.Pig, - 'whale': whale.Whale, - 'zebra': zebra.Zebra, + 'Pig': Pig, + 'whale': Whale, + 'zebra': Zebra, } if not val: return None @@ -134,7 +136,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, class_name, *args, **kwargs): # noqa: E501 - """mammal.Mammal - a model defined in OpenAPI + """Mammal - a model defined in OpenAPI Args: class_name (str): @@ -243,14 +245,15 @@ def _composed_schemas(): # code would be run when this module is imported, and these composed # classes don't exist yet because their module has not finished # loading + lazy_import() return { 'anyOf': [ ], 'allOf': [ ], 'oneOf': [ - pig.Pig, - whale.Whale, - zebra.Zebra, + Pig, + Whale, + Zebra, ], } diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/map_test.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/map_test.py index 5bafea48a041..b08a5c9d66d5 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/map_test.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/map_test.py @@ -29,11 +29,10 @@ none_type, validate_get_composed_info, ) -try: - from petstore_api.model import string_boolean_map -except ImportError: - string_boolean_map = sys.modules[ - 'petstore_api.model.string_boolean_map'] + +def lazy_import(): + from petstore_api.model.string_boolean_map import StringBooleanMap + globals()['StringBooleanMap'] = StringBooleanMap class MapTest(ModelNormal): @@ -77,24 +76,26 @@ class MapTest(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name and the value is attribute type. """ + lazy_import() return { 'map_map_of_string': ({str: ({str: (str,)},)},), # noqa: E501 'map_of_enum_string': ({str: (str,)},), # noqa: E501 'direct_map': ({str: (bool,)},), # noqa: E501 - 'indirect_map': (string_boolean_map.StringBooleanMap,), # noqa: E501 + 'indirect_map': (StringBooleanMap,), # noqa: E501 } @cached_property def discriminator(): return None + attribute_map = { 'map_map_of_string': 'map_map_of_string', # noqa: E501 'map_of_enum_string': 'map_of_enum_string', # noqa: E501 @@ -115,7 +116,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """map_test.MapTest - a model defined in OpenAPI + """MapTest - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types @@ -151,7 +152,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 map_map_of_string ({str: ({str: (str,)},)}): [optional] # noqa: E501 map_of_enum_string ({str: (str,)}): [optional] # noqa: E501 direct_map ({str: (bool,)}): [optional] # noqa: E501 - indirect_map (string_boolean_map.StringBooleanMap): [optional] # noqa: E501 + indirect_map (StringBooleanMap): [optional] # noqa: E501 """ _check_type = kwargs.pop('_check_type', True) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/mixed_properties_and_additional_properties_class.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/mixed_properties_and_additional_properties_class.py index 12cda6cf9ae9..58a190e9a22f 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/mixed_properties_and_additional_properties_class.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/mixed_properties_and_additional_properties_class.py @@ -29,11 +29,10 @@ none_type, validate_get_composed_info, ) -try: - from petstore_api.model import animal -except ImportError: - animal = sys.modules[ - 'petstore_api.model.animal'] + +def lazy_import(): + from petstore_api.model.animal import Animal + globals()['Animal'] = Animal class MixedPropertiesAndAdditionalPropertiesClass(ModelNormal): @@ -73,23 +72,25 @@ class MixedPropertiesAndAdditionalPropertiesClass(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name and the value is attribute type. """ + lazy_import() return { 'uuid': (str,), # noqa: E501 'date_time': (datetime,), # noqa: E501 - 'map': ({str: (animal.Animal,)},), # noqa: E501 + 'map': ({str: (Animal,)},), # noqa: E501 } @cached_property def discriminator(): return None + attribute_map = { 'uuid': 'uuid', # noqa: E501 'date_time': 'dateTime', # noqa: E501 @@ -109,7 +110,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """mixed_properties_and_additional_properties_class.MixedPropertiesAndAdditionalPropertiesClass - a model defined in OpenAPI + """MixedPropertiesAndAdditionalPropertiesClass - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types @@ -144,7 +145,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 _visited_composed_classes = (Animal,) uuid (str): [optional] # noqa: E501 date_time (datetime): [optional] # noqa: E501 - map ({str: (animal.Animal,)}): [optional] # noqa: E501 + map ({str: (Animal,)}): [optional] # noqa: E501 """ _check_type = kwargs.pop('_check_type', True) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/model200_response.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/model200_response.py index ea4df21be49e..0b331cb4292c 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/model200_response.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/model200_response.py @@ -68,8 +68,8 @@ class Model200Response(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -84,6 +84,7 @@ def openapi_types(): def discriminator(): return None + attribute_map = { 'name': 'name', # noqa: E501 '_class': 'class', # noqa: E501 @@ -102,7 +103,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """model200_response.Model200Response - a model defined in OpenAPI + """Model200Response - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/model_return.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/model_return.py index 535657ebbcf0..5905af9cc4fc 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/model_return.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/model_return.py @@ -68,8 +68,8 @@ class ModelReturn(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -83,6 +83,7 @@ def openapi_types(): def discriminator(): return None + attribute_map = { '_return': 'return', # noqa: E501 } @@ -100,7 +101,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """model_return.ModelReturn - a model defined in OpenAPI + """ModelReturn - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/name.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/name.py index 95f197a7a595..1627f3381b09 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/name.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/name.py @@ -68,8 +68,8 @@ class Name(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -86,6 +86,7 @@ def openapi_types(): def discriminator(): return None + attribute_map = { 'name': 'name', # noqa: E501 'snake_case': 'snake_case', # noqa: E501 @@ -106,7 +107,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, name, *args, **kwargs): # noqa: E501 - """name.Name - a model defined in OpenAPI + """Name - a model defined in OpenAPI Args: name (int): diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_class.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_class.py index 878266d85d3a..a8bc03b4d53d 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_class.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_class.py @@ -61,15 +61,21 @@ class NullableClass(ModelNormal): validations = { } - additional_properties_type = ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type,) # noqa: E501 + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type,) # noqa: E501 _nullable = False @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -94,6 +100,7 @@ def openapi_types(): def discriminator(): return None + attribute_map = { 'integer_prop': 'integer_prop', # noqa: E501 'number_prop': 'number_prop', # noqa: E501 @@ -122,7 +129,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """nullable_class.NullableClass - a model defined in OpenAPI + """NullableClass - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_shape.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_shape.py index a2979d1b6703..83a1cb5bad2c 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_shape.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_shape.py @@ -29,16 +29,12 @@ none_type, validate_get_composed_info, ) -try: - from petstore_api.model import quadrilateral -except ImportError: - quadrilateral = sys.modules[ - 'petstore_api.model.quadrilateral'] -try: - from petstore_api.model import triangle -except ImportError: - triangle = sys.modules[ - 'petstore_api.model.triangle'] + +def lazy_import(): + from petstore_api.model.quadrilateral import Quadrilateral + from petstore_api.model.triangle import Triangle + globals()['Quadrilateral'] = Quadrilateral + globals()['Triangle'] = Triangle class NullableShape(ModelComposed): @@ -71,20 +67,28 @@ class NullableShape(ModelComposed): validations = { } - additional_properties_type = (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = True @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name and the value is attribute type. """ + lazy_import() return { 'shape_type': (str,), # noqa: E501 'quadrilateral_type': (str,), # noqa: E501 @@ -93,9 +97,10 @@ def openapi_types(): @cached_property def discriminator(): + lazy_import() val = { - 'Quadrilateral': quadrilateral.Quadrilateral, - 'Triangle': triangle.Triangle, + 'Quadrilateral': Quadrilateral, + 'Triangle': Triangle, } if not val: return None @@ -121,7 +126,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, shape_type, *args, **kwargs): # noqa: E501 - """nullable_shape.NullableShape - a model defined in OpenAPI + """NullableShape - a model defined in OpenAPI Args: shape_type (str): @@ -233,13 +238,14 @@ def _composed_schemas(): # code would be run when this module is imported, and these composed # classes don't exist yet because their module has not finished # loading + lazy_import() return { 'anyOf': [ ], 'allOf': [ ], 'oneOf': [ - quadrilateral.Quadrilateral, - triangle.Triangle, + Quadrilateral, + Triangle, ], } diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/number_only.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/number_only.py index d16ea3765fcb..421b4d51a8b6 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/number_only.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/number_only.py @@ -68,8 +68,8 @@ class NumberOnly(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -83,6 +83,7 @@ def openapi_types(): def discriminator(): return None + attribute_map = { 'just_number': 'JustNumber', # noqa: E501 } @@ -100,7 +101,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """number_only.NumberOnly - a model defined in OpenAPI + """NumberOnly - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/number_with_validations.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/number_with_validations.py index dcd182e3401e..dac4ec635b81 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/number_with_validations.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/number_with_validations.py @@ -68,8 +68,8 @@ class NumberWithValidations(ModelSimple): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -83,6 +83,7 @@ def openapi_types(): def discriminator(): return None + attribute_map = {} _composed_schemas = None @@ -98,7 +99,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, value, *args, **kwargs): - """number_with_validations.NumberWithValidations - a model defined in OpenAPI + """NumberWithValidations - a model defined in OpenAPI Args: value (float): # noqa: E501 diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_model_with_ref_props.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_model_with_ref_props.py index 15ccc61db3f9..8858e25aa53b 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_model_with_ref_props.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_model_with_ref_props.py @@ -29,11 +29,10 @@ none_type, validate_get_composed_info, ) -try: - from petstore_api.model import number_with_validations -except ImportError: - number_with_validations = sys.modules[ - 'petstore_api.model.number_with_validations'] + +def lazy_import(): + from petstore_api.model.number_with_validations import NumberWithValidations + globals()['NumberWithValidations'] = NumberWithValidations class ObjectModelWithRefProps(ModelNormal): @@ -73,15 +72,16 @@ class ObjectModelWithRefProps(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name and the value is attribute type. """ + lazy_import() return { - 'my_number': (number_with_validations.NumberWithValidations,), # noqa: E501 + 'my_number': (NumberWithValidations,), # noqa: E501 'my_string': (str,), # noqa: E501 'my_boolean': (bool,), # noqa: E501 } @@ -90,6 +90,7 @@ def openapi_types(): def discriminator(): return None + attribute_map = { 'my_number': 'my_number', # noqa: E501 'my_string': 'my_string', # noqa: E501 @@ -109,7 +110,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """object_model_with_ref_props.ObjectModelWithRefProps - a model defined in OpenAPI + """ObjectModelWithRefProps - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types @@ -142,7 +143,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 Animal class but this time we won't travel through its discriminator because we passed in _visited_composed_classes = (Animal,) - my_number (number_with_validations.NumberWithValidations): [optional] # noqa: E501 + my_number (NumberWithValidations): [optional] # noqa: E501 my_string (str): [optional] # noqa: E501 my_boolean (bool): [optional] # noqa: E501 """ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/order.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/order.py index b21543df95f5..08ce05074ae0 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/order.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/order.py @@ -73,8 +73,8 @@ class Order(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -93,6 +93,7 @@ def openapi_types(): def discriminator(): return None + attribute_map = { 'id': 'id', # noqa: E501 'pet_id': 'petId', # noqa: E501 @@ -115,7 +116,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """order.Order - a model defined in OpenAPI + """Order - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/parent_pet.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/parent_pet.py index f8faa308d6fd..b7102569a14f 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/parent_pet.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/parent_pet.py @@ -29,16 +29,12 @@ none_type, validate_get_composed_info, ) -try: - from petstore_api.model import child_cat -except ImportError: - child_cat = sys.modules[ - 'petstore_api.model.child_cat'] -try: - from petstore_api.model import grandparent_animal -except ImportError: - grandparent_animal = sys.modules[ - 'petstore_api.model.grandparent_animal'] + +def lazy_import(): + from petstore_api.model.child_cat import ChildCat + from petstore_api.model.grandparent_animal import GrandparentAnimal + globals()['ChildCat'] = ChildCat + globals()['GrandparentAnimal'] = GrandparentAnimal class ParentPet(ModelComposed): @@ -71,28 +67,37 @@ class ParentPet(ModelComposed): validations = { } - additional_properties_type = (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name and the value is attribute type. """ + lazy_import() return { 'pet_type': (str,), # noqa: E501 } @cached_property def discriminator(): + lazy_import() val = { - 'ChildCat': child_cat.ChildCat, + 'ChildCat': ChildCat, } if not val: return None @@ -116,7 +121,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, pet_type, *args, **kwargs): # noqa: E501 - """parent_pet.ParentPet - a model defined in OpenAPI + """ParentPet - a model defined in OpenAPI Args: pet_type (str): @@ -222,11 +227,12 @@ def _composed_schemas(): # code would be run when this module is imported, and these composed # classes don't exist yet because their module has not finished # loading + lazy_import() return { 'anyOf': [ ], 'allOf': [ - grandparent_animal.GrandparentAnimal, + GrandparentAnimal, ], 'oneOf': [ ], diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/pet.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/pet.py index 5837810f22e9..77f5d3bb1ee4 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/pet.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/pet.py @@ -29,16 +29,12 @@ none_type, validate_get_composed_info, ) -try: - from petstore_api.model import category -except ImportError: - category = sys.modules[ - 'petstore_api.model.category'] -try: - from petstore_api.model import tag -except ImportError: - tag = sys.modules[ - 'petstore_api.model.tag'] + +def lazy_import(): + from petstore_api.model.category import Category + from petstore_api.model.tag import Tag + globals()['Category'] = Category + globals()['Tag'] = Tag class Pet(ModelNormal): @@ -83,19 +79,20 @@ class Pet(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name and the value is attribute type. """ + lazy_import() return { 'name': (str,), # noqa: E501 'photo_urls': ([str],), # noqa: E501 'id': (int,), # noqa: E501 - 'category': (category.Category,), # noqa: E501 - 'tags': ([tag.Tag],), # noqa: E501 + 'category': (Category,), # noqa: E501 + 'tags': ([Tag],), # noqa: E501 'status': (str,), # noqa: E501 } @@ -103,6 +100,7 @@ def openapi_types(): def discriminator(): return None + attribute_map = { 'name': 'name', # noqa: E501 'photo_urls': 'photoUrls', # noqa: E501 @@ -125,7 +123,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, name, photo_urls, *args, **kwargs): # noqa: E501 - """pet.Pet - a model defined in OpenAPI + """Pet - a model defined in OpenAPI Args: name (str): @@ -163,8 +161,8 @@ def __init__(self, name, photo_urls, *args, **kwargs): # noqa: E501 through its discriminator because we passed in _visited_composed_classes = (Animal,) id (int): [optional] # noqa: E501 - category (category.Category): [optional] # noqa: E501 - tags ([tag.Tag]): [optional] # noqa: E501 + category (Category): [optional] # noqa: E501 + tags ([Tag]): [optional] # noqa: E501 status (str): pet status in the store. [optional] # noqa: E501 """ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/pig.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/pig.py index f64d88bfeb19..e9e2fef97c2d 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/pig.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/pig.py @@ -29,16 +29,12 @@ none_type, validate_get_composed_info, ) -try: - from petstore_api.model import basque_pig -except ImportError: - basque_pig = sys.modules[ - 'petstore_api.model.basque_pig'] -try: - from petstore_api.model import danish_pig -except ImportError: - danish_pig = sys.modules[ - 'petstore_api.model.danish_pig'] + +def lazy_import(): + from petstore_api.model.basque_pig import BasquePig + from petstore_api.model.danish_pig import DanishPig + globals()['BasquePig'] = BasquePig + globals()['DanishPig'] = DanishPig class Pig(ModelComposed): @@ -71,29 +67,38 @@ class Pig(ModelComposed): validations = { } - additional_properties_type = (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name and the value is attribute type. """ + lazy_import() return { 'class_name': (str,), # noqa: E501 } @cached_property def discriminator(): + lazy_import() val = { - 'BasquePig': basque_pig.BasquePig, - 'DanishPig': danish_pig.DanishPig, + 'BasquePig': BasquePig, + 'DanishPig': DanishPig, } if not val: return None @@ -117,7 +122,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, class_name, *args, **kwargs): # noqa: E501 - """pig.Pig - a model defined in OpenAPI + """Pig - a model defined in OpenAPI Args: class_name (str): @@ -223,13 +228,14 @@ def _composed_schemas(): # code would be run when this module is imported, and these composed # classes don't exist yet because their module has not finished # loading + lazy_import() return { 'anyOf': [ ], 'allOf': [ ], 'oneOf': [ - basque_pig.BasquePig, - danish_pig.DanishPig, + BasquePig, + DanishPig, ], } diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/quadrilateral.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/quadrilateral.py index ca871a544fb5..4dac65fa113f 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/quadrilateral.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/quadrilateral.py @@ -29,16 +29,12 @@ none_type, validate_get_composed_info, ) -try: - from petstore_api.model import complex_quadrilateral -except ImportError: - complex_quadrilateral = sys.modules[ - 'petstore_api.model.complex_quadrilateral'] -try: - from petstore_api.model import simple_quadrilateral -except ImportError: - simple_quadrilateral = sys.modules[ - 'petstore_api.model.simple_quadrilateral'] + +def lazy_import(): + from petstore_api.model.complex_quadrilateral import ComplexQuadrilateral + from petstore_api.model.simple_quadrilateral import SimpleQuadrilateral + globals()['ComplexQuadrilateral'] = ComplexQuadrilateral + globals()['SimpleQuadrilateral'] = SimpleQuadrilateral class Quadrilateral(ModelComposed): @@ -71,20 +67,28 @@ class Quadrilateral(ModelComposed): validations = { } - additional_properties_type = (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name and the value is attribute type. """ + lazy_import() return { 'shape_type': (str,), # noqa: E501 'quadrilateral_type': (str,), # noqa: E501 @@ -92,9 +96,10 @@ def openapi_types(): @cached_property def discriminator(): + lazy_import() val = { - 'ComplexQuadrilateral': complex_quadrilateral.ComplexQuadrilateral, - 'SimpleQuadrilateral': simple_quadrilateral.SimpleQuadrilateral, + 'ComplexQuadrilateral': ComplexQuadrilateral, + 'SimpleQuadrilateral': SimpleQuadrilateral, } if not val: return None @@ -119,7 +124,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, quadrilateral_type, *args, **kwargs): # noqa: E501 - """quadrilateral.Quadrilateral - a model defined in OpenAPI + """Quadrilateral - a model defined in OpenAPI Args: quadrilateral_type (str): @@ -228,13 +233,14 @@ def _composed_schemas(): # code would be run when this module is imported, and these composed # classes don't exist yet because their module has not finished # loading + lazy_import() return { 'anyOf': [ ], 'allOf': [ ], 'oneOf': [ - complex_quadrilateral.ComplexQuadrilateral, - simple_quadrilateral.SimpleQuadrilateral, + ComplexQuadrilateral, + SimpleQuadrilateral, ], } diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/quadrilateral_interface.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/quadrilateral_interface.py index e76a7e0a9c0e..72274eb9c2c8 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/quadrilateral_interface.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/quadrilateral_interface.py @@ -68,8 +68,8 @@ class QuadrilateralInterface(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -83,6 +83,7 @@ def openapi_types(): def discriminator(): return None + attribute_map = { 'quadrilateral_type': 'quadrilateralType', # noqa: E501 } @@ -100,7 +101,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, quadrilateral_type, *args, **kwargs): # noqa: E501 - """quadrilateral_interface.QuadrilateralInterface - a model defined in OpenAPI + """QuadrilateralInterface - a model defined in OpenAPI Args: quadrilateral_type (str): diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/read_only_first.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/read_only_first.py index b53aa4db398e..f9fea19495d0 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/read_only_first.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/read_only_first.py @@ -68,8 +68,8 @@ class ReadOnlyFirst(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -84,6 +84,7 @@ def openapi_types(): def discriminator(): return None + attribute_map = { 'bar': 'bar', # noqa: E501 'baz': 'baz', # noqa: E501 @@ -102,7 +103,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """read_only_first.ReadOnlyFirst - a model defined in OpenAPI + """ReadOnlyFirst - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/scalene_triangle.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/scalene_triangle.py index 55defdec4871..c3c5f0c50208 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/scalene_triangle.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/scalene_triangle.py @@ -29,16 +29,12 @@ none_type, validate_get_composed_info, ) -try: - from petstore_api.model import shape_interface -except ImportError: - shape_interface = sys.modules[ - 'petstore_api.model.shape_interface'] -try: - from petstore_api.model import triangle_interface -except ImportError: - triangle_interface = sys.modules[ - 'petstore_api.model.triangle_interface'] + +def lazy_import(): + from petstore_api.model.shape_interface import ShapeInterface + from petstore_api.model.triangle_interface import TriangleInterface + globals()['ShapeInterface'] = ShapeInterface + globals()['TriangleInterface'] = TriangleInterface class ScaleneTriangle(ModelComposed): @@ -71,20 +67,28 @@ class ScaleneTriangle(ModelComposed): validations = { } - additional_properties_type = (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name and the value is attribute type. """ + lazy_import() return { 'shape_type': (str,), # noqa: E501 'triangle_type': (str,), # noqa: E501 @@ -94,6 +98,7 @@ def openapi_types(): def discriminator(): return None + attribute_map = { 'shape_type': 'shapeType', # noqa: E501 'triangle_type': 'triangleType', # noqa: E501 @@ -113,7 +118,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, shape_type, triangle_type, *args, **kwargs): # noqa: E501 - """scalene_triangle.ScaleneTriangle - a model defined in OpenAPI + """ScaleneTriangle - a model defined in OpenAPI Args: shape_type (str): @@ -221,12 +226,13 @@ def _composed_schemas(): # code would be run when this module is imported, and these composed # classes don't exist yet because their module has not finished # loading + lazy_import() return { 'anyOf': [ ], 'allOf': [ - shape_interface.ShapeInterface, - triangle_interface.TriangleInterface, + ShapeInterface, + TriangleInterface, ], 'oneOf': [ ], diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape.py index 457d5743b5c9..6168869f2c5f 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape.py @@ -29,16 +29,12 @@ none_type, validate_get_composed_info, ) -try: - from petstore_api.model import quadrilateral -except ImportError: - quadrilateral = sys.modules[ - 'petstore_api.model.quadrilateral'] -try: - from petstore_api.model import triangle -except ImportError: - triangle = sys.modules[ - 'petstore_api.model.triangle'] + +def lazy_import(): + from petstore_api.model.quadrilateral import Quadrilateral + from petstore_api.model.triangle import Triangle + globals()['Quadrilateral'] = Quadrilateral + globals()['Triangle'] = Triangle class Shape(ModelComposed): @@ -71,20 +67,28 @@ class Shape(ModelComposed): validations = { } - additional_properties_type = (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name and the value is attribute type. """ + lazy_import() return { 'shape_type': (str,), # noqa: E501 'quadrilateral_type': (str,), # noqa: E501 @@ -93,9 +97,10 @@ def openapi_types(): @cached_property def discriminator(): + lazy_import() val = { - 'Quadrilateral': quadrilateral.Quadrilateral, - 'Triangle': triangle.Triangle, + 'Quadrilateral': Quadrilateral, + 'Triangle': Triangle, } if not val: return None @@ -121,7 +126,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, shape_type, *args, **kwargs): # noqa: E501 - """shape.Shape - a model defined in OpenAPI + """Shape - a model defined in OpenAPI Args: shape_type (str): @@ -233,13 +238,14 @@ def _composed_schemas(): # code would be run when this module is imported, and these composed # classes don't exist yet because their module has not finished # loading + lazy_import() return { 'anyOf': [ ], 'allOf': [ ], 'oneOf': [ - quadrilateral.Quadrilateral, - triangle.Triangle, + Quadrilateral, + Triangle, ], } diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape_interface.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape_interface.py index 1db0ffe70ce5..07c271fe2e6b 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape_interface.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape_interface.py @@ -68,8 +68,8 @@ class ShapeInterface(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -83,6 +83,7 @@ def openapi_types(): def discriminator(): return None + attribute_map = { 'shape_type': 'shapeType', # noqa: E501 } @@ -100,7 +101,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, shape_type, *args, **kwargs): # noqa: E501 - """shape_interface.ShapeInterface - a model defined in OpenAPI + """ShapeInterface - a model defined in OpenAPI Args: shape_type (str): diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape_or_null.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape_or_null.py index 17027a5bc55b..613055b9feb3 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape_or_null.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape_or_null.py @@ -29,16 +29,12 @@ none_type, validate_get_composed_info, ) -try: - from petstore_api.model import quadrilateral -except ImportError: - quadrilateral = sys.modules[ - 'petstore_api.model.quadrilateral'] -try: - from petstore_api.model import triangle -except ImportError: - triangle = sys.modules[ - 'petstore_api.model.triangle'] + +def lazy_import(): + from petstore_api.model.quadrilateral import Quadrilateral + from petstore_api.model.triangle import Triangle + globals()['Quadrilateral'] = Quadrilateral + globals()['Triangle'] = Triangle class ShapeOrNull(ModelComposed): @@ -71,20 +67,28 @@ class ShapeOrNull(ModelComposed): validations = { } - additional_properties_type = (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name and the value is attribute type. """ + lazy_import() return { 'shape_type': (str,), # noqa: E501 'quadrilateral_type': (str,), # noqa: E501 @@ -93,9 +97,10 @@ def openapi_types(): @cached_property def discriminator(): + lazy_import() val = { - 'Quadrilateral': quadrilateral.Quadrilateral, - 'Triangle': triangle.Triangle, + 'Quadrilateral': Quadrilateral, + 'Triangle': Triangle, } if not val: return None @@ -121,7 +126,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, shape_type, *args, **kwargs): # noqa: E501 - """shape_or_null.ShapeOrNull - a model defined in OpenAPI + """ShapeOrNull - a model defined in OpenAPI Args: shape_type (str): @@ -233,14 +238,15 @@ def _composed_schemas(): # code would be run when this module is imported, and these composed # classes don't exist yet because their module has not finished # loading + lazy_import() return { 'anyOf': [ ], 'allOf': [ ], 'oneOf': [ + Quadrilateral, + Triangle, none_type, - quadrilateral.Quadrilateral, - triangle.Triangle, ], } diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/simple_quadrilateral.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/simple_quadrilateral.py index 330cb8458138..de8c1cf2116e 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/simple_quadrilateral.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/simple_quadrilateral.py @@ -29,16 +29,12 @@ none_type, validate_get_composed_info, ) -try: - from petstore_api.model import quadrilateral_interface -except ImportError: - quadrilateral_interface = sys.modules[ - 'petstore_api.model.quadrilateral_interface'] -try: - from petstore_api.model import shape_interface -except ImportError: - shape_interface = sys.modules[ - 'petstore_api.model.shape_interface'] + +def lazy_import(): + from petstore_api.model.quadrilateral_interface import QuadrilateralInterface + from petstore_api.model.shape_interface import ShapeInterface + globals()['QuadrilateralInterface'] = QuadrilateralInterface + globals()['ShapeInterface'] = ShapeInterface class SimpleQuadrilateral(ModelComposed): @@ -71,20 +67,28 @@ class SimpleQuadrilateral(ModelComposed): validations = { } - additional_properties_type = (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name and the value is attribute type. """ + lazy_import() return { 'shape_type': (str,), # noqa: E501 'quadrilateral_type': (str,), # noqa: E501 @@ -94,6 +98,7 @@ def openapi_types(): def discriminator(): return None + attribute_map = { 'shape_type': 'shapeType', # noqa: E501 'quadrilateral_type': 'quadrilateralType', # noqa: E501 @@ -113,7 +118,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, shape_type, quadrilateral_type, *args, **kwargs): # noqa: E501 - """simple_quadrilateral.SimpleQuadrilateral - a model defined in OpenAPI + """SimpleQuadrilateral - a model defined in OpenAPI Args: shape_type (str): @@ -221,12 +226,13 @@ def _composed_schemas(): # code would be run when this module is imported, and these composed # classes don't exist yet because their module has not finished # loading + lazy_import() return { 'anyOf': [ ], 'allOf': [ - quadrilateral_interface.QuadrilateralInterface, - shape_interface.ShapeInterface, + QuadrilateralInterface, + ShapeInterface, ], 'oneOf': [ ], diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/special_model_name.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/special_model_name.py index 75df4a577a3c..e4df8f8e89d8 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/special_model_name.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/special_model_name.py @@ -68,8 +68,8 @@ class SpecialModelName(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -83,6 +83,7 @@ def openapi_types(): def discriminator(): return None + attribute_map = { 'special_property_name': '$special[property.name]', # noqa: E501 } @@ -100,7 +101,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """special_model_name.SpecialModelName - a model defined in OpenAPI + """SpecialModelName - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_boolean_map.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_boolean_map.py index b1fb64321118..0f4bc65afde5 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_boolean_map.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_boolean_map.py @@ -61,15 +61,21 @@ class StringBooleanMap(ModelNormal): validations = { } - additional_properties_type = (bool,) # noqa: E501 + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool,) # noqa: E501 _nullable = False @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -82,6 +88,7 @@ def openapi_types(): def discriminator(): return None + attribute_map = { } @@ -98,7 +105,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """string_boolean_map.StringBooleanMap - a model defined in OpenAPI + """StringBooleanMap - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_enum.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_enum.py index 3de705cdcc90..d76bf700a8a8 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_enum.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_enum.py @@ -70,8 +70,8 @@ class StringEnum(ModelSimple): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -85,6 +85,7 @@ def openapi_types(): def discriminator(): return None + attribute_map = {} _composed_schemas = None @@ -100,7 +101,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, value, *args, **kwargs): - """string_enum.StringEnum - a model defined in OpenAPI + """StringEnum - a model defined in OpenAPI Args: value (str):, must be one of ["placed", "approved", "delivered", ] # noqa: E501 diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_enum_with_default_value.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_enum_with_default_value.py index 1598bc68430e..fd425751def7 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_enum_with_default_value.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_enum_with_default_value.py @@ -69,8 +69,8 @@ class StringEnumWithDefaultValue(ModelSimple): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -84,6 +84,7 @@ def openapi_types(): def discriminator(): return None + attribute_map = {} _composed_schemas = None @@ -99,7 +100,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, value, *args, **kwargs): - """string_enum_with_default_value.StringEnumWithDefaultValue - a model defined in OpenAPI + """StringEnumWithDefaultValue - a model defined in OpenAPI Args: value (str): if omitted the server will use the default value of 'placed', must be one of ["placed", "approved", "delivered", ] # noqa: E501 diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/tag.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/tag.py index cdf9c9d26335..d1f0c9aa6d92 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/tag.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/tag.py @@ -68,8 +68,8 @@ class Tag(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -84,6 +84,7 @@ def openapi_types(): def discriminator(): return None + attribute_map = { 'id': 'id', # noqa: E501 'name': 'name', # noqa: E501 @@ -102,7 +103,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """tag.Tag - a model defined in OpenAPI + """Tag - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/triangle.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/triangle.py index b08f0d1025fc..2b83c4c08815 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/triangle.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/triangle.py @@ -29,21 +29,14 @@ none_type, validate_get_composed_info, ) -try: - from petstore_api.model import equilateral_triangle -except ImportError: - equilateral_triangle = sys.modules[ - 'petstore_api.model.equilateral_triangle'] -try: - from petstore_api.model import isosceles_triangle -except ImportError: - isosceles_triangle = sys.modules[ - 'petstore_api.model.isosceles_triangle'] -try: - from petstore_api.model import scalene_triangle -except ImportError: - scalene_triangle = sys.modules[ - 'petstore_api.model.scalene_triangle'] + +def lazy_import(): + from petstore_api.model.equilateral_triangle import EquilateralTriangle + from petstore_api.model.isosceles_triangle import IsoscelesTriangle + from petstore_api.model.scalene_triangle import ScaleneTriangle + globals()['EquilateralTriangle'] = EquilateralTriangle + globals()['IsoscelesTriangle'] = IsoscelesTriangle + globals()['ScaleneTriangle'] = ScaleneTriangle class Triangle(ModelComposed): @@ -76,20 +69,28 @@ class Triangle(ModelComposed): validations = { } - additional_properties_type = (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name and the value is attribute type. """ + lazy_import() return { 'shape_type': (str,), # noqa: E501 'triangle_type': (str,), # noqa: E501 @@ -97,10 +98,11 @@ def openapi_types(): @cached_property def discriminator(): + lazy_import() val = { - 'EquilateralTriangle': equilateral_triangle.EquilateralTriangle, - 'IsoscelesTriangle': isosceles_triangle.IsoscelesTriangle, - 'ScaleneTriangle': scalene_triangle.ScaleneTriangle, + 'EquilateralTriangle': EquilateralTriangle, + 'IsoscelesTriangle': IsoscelesTriangle, + 'ScaleneTriangle': ScaleneTriangle, } if not val: return None @@ -125,7 +127,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, triangle_type, *args, **kwargs): # noqa: E501 - """triangle.Triangle - a model defined in OpenAPI + """Triangle - a model defined in OpenAPI Args: triangle_type (str): @@ -234,14 +236,15 @@ def _composed_schemas(): # code would be run when this module is imported, and these composed # classes don't exist yet because their module has not finished # loading + lazy_import() return { 'anyOf': [ ], 'allOf': [ ], 'oneOf': [ - equilateral_triangle.EquilateralTriangle, - isosceles_triangle.IsoscelesTriangle, - scalene_triangle.ScaleneTriangle, + EquilateralTriangle, + IsoscelesTriangle, + ScaleneTriangle, ], } diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/triangle_interface.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/triangle_interface.py index 5b3ff330c779..d7454cfad8e9 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/triangle_interface.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/triangle_interface.py @@ -68,8 +68,8 @@ class TriangleInterface(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -83,6 +83,7 @@ def openapi_types(): def discriminator(): return None + attribute_map = { 'triangle_type': 'triangleType', # noqa: E501 } @@ -100,7 +101,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, triangle_type, *args, **kwargs): # noqa: E501 - """triangle_interface.TriangleInterface - a model defined in OpenAPI + """TriangleInterface - a model defined in OpenAPI Args: triangle_type (str): diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/user.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/user.py index 6813e0eb0953..5f26153652df 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/user.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/user.py @@ -68,8 +68,8 @@ class User(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -94,6 +94,7 @@ def openapi_types(): def discriminator(): return None + attribute_map = { 'id': 'id', # noqa: E501 'username': 'username', # noqa: E501 @@ -122,7 +123,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """user.User - a model defined in OpenAPI + """User - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/whale.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/whale.py index 586c6efa0251..6efac18c4f7f 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/whale.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/whale.py @@ -68,8 +68,8 @@ class Whale(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -85,6 +85,7 @@ def openapi_types(): def discriminator(): return None + attribute_map = { 'class_name': 'className', # noqa: E501 'has_baleen': 'hasBaleen', # noqa: E501 @@ -104,7 +105,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, class_name, *args, **kwargs): # noqa: E501 - """whale.Whale - a model defined in OpenAPI + """Whale - a model defined in OpenAPI Args: class_name (str): diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/zebra.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/zebra.py index c90032e7671d..6abcf271313a 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/zebra.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/zebra.py @@ -66,15 +66,21 @@ class Zebra(ModelNormal): validations = { } - additional_properties_type = (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -89,6 +95,7 @@ def openapi_types(): def discriminator(): return None + attribute_map = { 'class_name': 'className', # noqa: E501 'type': 'type', # noqa: E501 @@ -107,7 +114,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, class_name, *args, **kwargs): # noqa: E501 - """zebra.Zebra - a model defined in OpenAPI + """Zebra - a model defined in OpenAPI Args: class_name (str): diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model_utils.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model_utils.py index ff378aa1e157..de9fc5c3a272 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model_utils.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model_utils.py @@ -41,9 +41,9 @@ def __init__(self, fn): self._fn = fn def __get__(self, instance, cls=None): - try: + if self.result_key in vars(self): return vars(self)[self.result_key] - except KeyError: + else: result = self._fn() setattr(self, self.result_key, result) return result diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_fake_api.py b/samples/openapi3/client/petstore/python-experimental/test/test_fake_api.py index 8b89752b364a..60dcbd549df9 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_fake_api.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_fake_api.py @@ -119,7 +119,7 @@ def test_array_of_enums(self): """ from petstore_api.model import array_of_enums, string_enum endpoint = self.api.array_of_enums - assert endpoint.openapi_types['array_of_enums_array_of_enums'] == (array_of_enums.ArrayOfEnums,) + assert endpoint.openapi_types['array_of_enums'] == (array_of_enums.ArrayOfEnums,) assert endpoint.settings['response_type'] == (array_of_enums.ArrayOfEnums,) # serialization + deserialization works @@ -129,7 +129,7 @@ def test_array_of_enums(self): value_simple = ["placed"] mock_method.return_value = self.mock_response(value_simple) - response = endpoint(array_of_enums_array_of_enums=body) + response = endpoint(array_of_enums=body) self.assert_request_called_with(mock_method, 'http://petstore.swagger.io:80/v2/fake/refs/array-of-enums', value_simple) assert isinstance(response, array_of_enums.ArrayOfEnums) @@ -171,7 +171,7 @@ def test_composed_one_of_number_with_validations(self): """ from petstore_api.model import animal, composed_one_of_number_with_validations, number_with_validations endpoint = self.api.composed_one_of_number_with_validations - assert endpoint.openapi_types['composed_one_of_number_with_validations_composed_one_of_number_with_validations'] == ( + assert endpoint.openapi_types['composed_one_of_number_with_validations'] == ( composed_one_of_number_with_validations.ComposedOneOfNumberWithValidations,) assert endpoint.settings['response_type'] == ( composed_one_of_number_with_validations.ComposedOneOfNumberWithValidations,) @@ -193,7 +193,7 @@ def test_composed_one_of_number_with_validations(self): with patch.object(RESTClientObject, 'request') as mock_method: mock_method.return_value = self.mock_response(value_simple) - response = endpoint(composed_one_of_number_with_validations_composed_one_of_number_with_validations=body) + response = endpoint(composed_one_of_number_with_validations=body) self.assert_request_called_with( mock_method, 'http://petstore.swagger.io:80/v2/fake/refs/composed_one_of_number_with_validations', diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_object_model_with_ref_props.py b/samples/openapi3/client/petstore/python-experimental/test/test_object_model_with_ref_props.py index cdf42fcd6620..9ce55c75bb87 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_object_model_with_ref_props.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_object_model_with_ref_props.py @@ -33,11 +33,11 @@ def tearDown(self): def testObjectModelWithRefProps(self): """Test ObjectModelWithRefProps""" - from petstore_api.model.object_model_with_ref_props import number_with_validations + from petstore_api.model.number_with_validations import NumberWithValidations self.assertEqual( ObjectModelWithRefProps.openapi_types, { - 'my_number': (number_with_validations.NumberWithValidations,), + 'my_number': (NumberWithValidations,), 'my_string': (str,), 'my_boolean': (bool,), } From 321ad3c8204b9541ac89a06f729cab200a369220 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Tue, 28 Jul 2020 10:15:46 +0800 Subject: [PATCH 079/129] fix string comparison in cpp ue4 generator (#7029) --- .../languages/CppUE4ClientCodegen.java | 2 +- .../petstore/cpp-ue4/.openapi-generator/FILES | 60 +++++++++---------- .../Private/OpenAPIPetApiOperations.cpp | 4 -- .../Private/OpenAPIStoreApiOperations.cpp | 3 - .../Private/OpenAPIUserApiOperations.cpp | 2 - 5 files changed, 31 insertions(+), 40 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppUE4ClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppUE4ClientCodegen.java index dd71b9008f7a..c0a1175bb647 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppUE4ClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppUE4ClientCodegen.java @@ -335,7 +335,7 @@ public String apiFileFolder() { public String modelFilename(String templateName, String modelName) { String suffix = modelTemplateFiles().get(templateName); String folder = privateFolder; - if (suffix == ".h") { + if (".h".equals(suffix)) { folder = publicFolder; } diff --git a/samples/client/petstore/cpp-ue4/.openapi-generator/FILES b/samples/client/petstore/cpp-ue4/.openapi-generator/FILES index 23079276740b..86943c2aa9b6 100644 --- a/samples/client/petstore/cpp-ue4/.openapi-generator/FILES +++ b/samples/client/petstore/cpp-ue4/.openapi-generator/FILES @@ -1,31 +1,31 @@ OpenAPI.Build.cs -Private\OpenAPIApiResponse.cpp -Private\OpenAPIBaseModel.cpp -Private\OpenAPICategory.cpp -Private\OpenAPIHelpers.cpp -Private\OpenAPIModule.cpp -Private\OpenAPIModule.h -Private\OpenAPIOrder.cpp -Private\OpenAPIPet.cpp -Private\OpenAPIPetApi.cpp -Private\OpenAPIPetApiOperations.cpp -Private\OpenAPIStoreApi.cpp -Private\OpenAPIStoreApiOperations.cpp -Private\OpenAPITag.cpp -Private\OpenAPIUser.cpp -Private\OpenAPIUserApi.cpp -Private\OpenAPIUserApiOperations.cpp -Public\OpenAPIApiResponse.h -Public\OpenAPIBaseModel.h -Public\OpenAPICategory.h -Public\OpenAPIHelpers.h -Public\OpenAPIOrder.h -Public\OpenAPIPet.h -Public\OpenAPIPetApi.h -Public\OpenAPIPetApiOperations.h -Public\OpenAPIStoreApi.h -Public\OpenAPIStoreApiOperations.h -Public\OpenAPITag.h -Public\OpenAPIUser.h -Public\OpenAPIUserApi.h -Public\OpenAPIUserApiOperations.h +Private/OpenAPIApiResponse.cpp +Private/OpenAPIBaseModel.cpp +Private/OpenAPICategory.cpp +Private/OpenAPIHelpers.cpp +Private/OpenAPIModule.cpp +Private/OpenAPIModule.h +Private/OpenAPIOrder.cpp +Private/OpenAPIPet.cpp +Private/OpenAPIPetApi.cpp +Private/OpenAPIPetApiOperations.cpp +Private/OpenAPIStoreApi.cpp +Private/OpenAPIStoreApiOperations.cpp +Private/OpenAPITag.cpp +Private/OpenAPIUser.cpp +Private/OpenAPIUserApi.cpp +Private/OpenAPIUserApiOperations.cpp +Public/OpenAPIApiResponse.h +Public/OpenAPIBaseModel.h +Public/OpenAPICategory.h +Public/OpenAPIHelpers.h +Public/OpenAPIOrder.h +Public/OpenAPIPet.h +Public/OpenAPIPetApi.h +Public/OpenAPIPetApiOperations.h +Public/OpenAPIStoreApi.h +Public/OpenAPIStoreApiOperations.h +Public/OpenAPITag.h +Public/OpenAPIUser.h +Public/OpenAPIUserApi.h +Public/OpenAPIUserApiOperations.h diff --git a/samples/client/petstore/cpp-ue4/Private/OpenAPIPetApiOperations.cpp b/samples/client/petstore/cpp-ue4/Private/OpenAPIPetApiOperations.cpp index 4df6f9160880..988a9496b146 100644 --- a/samples/client/petstore/cpp-ue4/Private/OpenAPIPetApiOperations.cpp +++ b/samples/client/petstore/cpp-ue4/Private/OpenAPIPetApiOperations.cpp @@ -220,7 +220,6 @@ void OpenAPIPetApi::FindPetsByStatusResponse::SetHttpResponseCode(EHttpResponseC switch ((int)InHttpResponseCode) { case 200: - default: SetResponseString(TEXT("successful operation")); break; case 400: @@ -274,7 +273,6 @@ void OpenAPIPetApi::FindPetsByTagsResponse::SetHttpResponseCode(EHttpResponseCod switch ((int)InHttpResponseCode) { case 200: - default: SetResponseString(TEXT("successful operation")); break; case 400: @@ -327,7 +325,6 @@ void OpenAPIPetApi::GetPetByIdResponse::SetHttpResponseCode(EHttpResponseCodes:: switch ((int)InHttpResponseCode) { case 200: - default: SetResponseString(TEXT("successful operation")); break; case 400: @@ -541,7 +538,6 @@ void OpenAPIPetApi::UploadFileResponse::SetHttpResponseCode(EHttpResponseCodes:: switch ((int)InHttpResponseCode) { case 200: - default: SetResponseString(TEXT("successful operation")); break; } diff --git a/samples/client/petstore/cpp-ue4/Private/OpenAPIStoreApiOperations.cpp b/samples/client/petstore/cpp-ue4/Private/OpenAPIStoreApiOperations.cpp index 6146ed8b9616..9f3c059d9232 100644 --- a/samples/client/petstore/cpp-ue4/Private/OpenAPIStoreApiOperations.cpp +++ b/samples/client/petstore/cpp-ue4/Private/OpenAPIStoreApiOperations.cpp @@ -110,7 +110,6 @@ void OpenAPIStoreApi::GetInventoryResponse::SetHttpResponseCode(EHttpResponseCod switch ((int)InHttpResponseCode) { case 200: - default: SetResponseString(TEXT("successful operation")); break; } @@ -160,7 +159,6 @@ void OpenAPIStoreApi::GetOrderByIdResponse::SetHttpResponseCode(EHttpResponseCod switch ((int)InHttpResponseCode) { case 200: - default: SetResponseString(TEXT("successful operation")); break; case 400: @@ -223,7 +221,6 @@ void OpenAPIStoreApi::PlaceOrderResponse::SetHttpResponseCode(EHttpResponseCodes switch ((int)InHttpResponseCode) { case 200: - default: SetResponseString(TEXT("successful operation")); break; case 400: diff --git a/samples/client/petstore/cpp-ue4/Private/OpenAPIUserApiOperations.cpp b/samples/client/petstore/cpp-ue4/Private/OpenAPIUserApiOperations.cpp index 97562911f703..5a698d4fa5c3 100644 --- a/samples/client/petstore/cpp-ue4/Private/OpenAPIUserApiOperations.cpp +++ b/samples/client/petstore/cpp-ue4/Private/OpenAPIUserApiOperations.cpp @@ -285,7 +285,6 @@ void OpenAPIUserApi::GetUserByNameResponse::SetHttpResponseCode(EHttpResponseCod switch ((int)InHttpResponseCode) { case 200: - default: SetResponseString(TEXT("successful operation")); break; case 400: @@ -343,7 +342,6 @@ void OpenAPIUserApi::LoginUserResponse::SetHttpResponseCode(EHttpResponseCodes:: switch ((int)InHttpResponseCode) { case 200: - default: SetResponseString(TEXT("successful operation")); break; case 400: From 1cb34be8fe782cb7e640d681c5ca14e1ddbc5345 Mon Sep 17 00:00:00 2001 From: Benjamin Seiller Date: Tue, 28 Jul 2020 04:22:46 +0200 Subject: [PATCH 080/129] [Java][okhttp-gson] prevent UnsupportedOperationException by removal from ImmutableList on setDebugging(false) (#7024) * fix https://github.com/OpenAPITools/openapi-generator/issues/6934 * fix https://github.com/OpenAPITools/openapi-generator/issues/6934 * update samples Co-authored-by: William Cheng --- .../resources/Java/libraries/okhttp-gson/ApiClient.mustache | 4 +++- .../src/main/java/org/openapitools/client/ApiClient.java | 4 +++- .../src/main/java/org/openapitools/client/ApiClient.java | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/ApiClient.mustache index 0b74114ac5e5..087a4a54edb9 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/ApiClient.mustache @@ -530,7 +530,9 @@ public class ApiClient { loggingInterceptor.setLevel(Level.BODY); httpClient = httpClient.newBuilder().addInterceptor(loggingInterceptor).build(); } else { - httpClient.interceptors().remove(loggingInterceptor); + final OkHttpClient.Builder builder = httpClient.newBuilder(); + builder.interceptors().remove(loggingInterceptor); + httpClient = builder.build(); loggingInterceptor = null; } } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/ApiClient.java index bc4e2bdbe0a0..7d82303d8b48 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/ApiClient.java @@ -497,7 +497,9 @@ public ApiClient setDebugging(boolean debugging) { loggingInterceptor.setLevel(Level.BODY); httpClient = httpClient.newBuilder().addInterceptor(loggingInterceptor).build(); } else { - httpClient.interceptors().remove(loggingInterceptor); + final OkHttpClient.Builder builder = httpClient.newBuilder(); + builder.interceptors().remove(loggingInterceptor); + httpClient = builder.build(); loggingInterceptor = null; } } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/ApiClient.java index bc4e2bdbe0a0..7d82303d8b48 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/ApiClient.java @@ -497,7 +497,9 @@ public ApiClient setDebugging(boolean debugging) { loggingInterceptor.setLevel(Level.BODY); httpClient = httpClient.newBuilder().addInterceptor(loggingInterceptor).build(); } else { - httpClient.interceptors().remove(loggingInterceptor); + final OkHttpClient.Builder builder = httpClient.newBuilder(); + builder.interceptors().remove(loggingInterceptor); + httpClient = builder.build(); loggingInterceptor = null; } } From 86eb1b9112bc41b6a95c191a1968bc74f28ac634 Mon Sep 17 00:00:00 2001 From: Dragos CIULICA Date: Tue, 28 Jul 2020 10:02:08 +0200 Subject: [PATCH 081/129] Bugfix/5.0.0 beta/6853 fixed reactor conditions in template (#6993) * fixed flux generation * updated petstore samples * fixed flux generation * updated petstore samples * update samples Co-authored-by: Dragos CIULICA Co-authored-by: William Cheng --- .../src/main/resources/JavaSpring/api.mustache | 3 ++- .../src/main/resources/JavaSpring/apiDelegate.mustache | 3 ++- .../src/main/resources/JavaSpring/formParams.mustache | 2 +- .../JavaSpring/libraries/spring-cloud/formParams.mustache | 2 +- .../src/main/java/org/openapitools/api/AnotherFakeApi.java | 1 + .../java/org/openapitools/api/AnotherFakeApiDelegate.java | 1 + .../src/main/java/org/openapitools/api/FakeApi.java | 5 +++-- .../src/main/java/org/openapitools/api/FakeApiDelegate.java | 5 +++-- .../main/java/org/openapitools/api/FakeClassnameTestApi.java | 1 + .../org/openapitools/api/FakeClassnameTestApiDelegate.java | 1 + .../src/main/java/org/openapitools/api/PetApi.java | 3 ++- .../src/main/java/org/openapitools/api/PetApiDelegate.java | 3 ++- .../src/main/java/org/openapitools/api/StoreApi.java | 1 + .../src/main/java/org/openapitools/api/StoreApiDelegate.java | 1 + .../src/main/java/org/openapitools/api/UserApi.java | 1 + .../src/main/java/org/openapitools/api/UserApiDelegate.java | 1 + 16 files changed, 24 insertions(+), 10 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/api.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/api.mustache index a5457e2a9c10..0f42c448ee60 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/api.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/api.mustache @@ -38,6 +38,7 @@ import org.springframework.web.multipart.MultipartFile; import org.springframework.web.server.ServerWebExchange; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; +import org.springframework.http.codec.multipart.Part; {{/reactive}} {{#useBeanValidation}} @@ -135,7 +136,7 @@ public interface {{classname}} { } // Override this method - {{#jdk8-default-interface}}default {{/jdk8-default-interface}} {{#responseWrapper}}{{.}}<{{/responseWrapper}}ResponseEntity<{{>returnTypes}}>{{#responseWrapper}}>{{/responseWrapper}} {{operationId}}({{#allParams}}{{^isFile}}{{^isBodyParam}}{{>optionalDataType}}{{/isBodyParam}}{{#isBodyParam}}{{^reactive}}{{{dataType}}}{{/reactive}}{{#reactive}}{{^isListContainer}}Mono{{/isListContainer}}{{#isListContainer}}Flux{{/isListContainer}}<{{{baseType}}}>{{/reactive}}{{/isBodyParam}}{{/isFile}}{{#isFile}}MultipartFile{{/isFile}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}{{#reactive}}{{#hasParams}}, {{/hasParams}}ServerWebExchange exchange{{/reactive}}){{#unhandledException}} throws Exception{{/unhandledException}} { + {{#jdk8-default-interface}}default {{/jdk8-default-interface}} {{#responseWrapper}}{{.}}<{{/responseWrapper}}ResponseEntity<{{>returnTypes}}>{{#responseWrapper}}>{{/responseWrapper}} {{operationId}}({{#allParams}}{{^isFile}}{{^isBodyParam}}{{>optionalDataType}}{{/isBodyParam}}{{#isBodyParam}}{{^reactive}}{{{dataType}}}{{/reactive}}{{#reactive}}{{^isListContainer}}Mono{{/isListContainer}}{{#isListContainer}}Flux{{/isListContainer}}<{{{baseType}}}>{{/reactive}}{{/isBodyParam}}{{/isFile}}{{#isFile}}{{#reactive}}Flux{{/reactive}}{{^reactive}}MultipartFile{{/reactive}}{{/isFile}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}{{#reactive}}{{#hasParams}}, {{/hasParams}}ServerWebExchange exchange{{/reactive}}){{#unhandledException}} throws Exception{{/unhandledException}} { {{/delegate-method}} {{^isDelegate}} {{>methodBody}} diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/apiDelegate.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/apiDelegate.mustache index e93ba0a69d33..993750af6279 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/apiDelegate.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/apiDelegate.mustache @@ -16,6 +16,7 @@ import org.springframework.web.multipart.MultipartFile; import org.springframework.web.server.ServerWebExchange; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; +import org.springframework.http.codec.multipart.Part; {{/reactive}} import java.util.List; @@ -67,7 +68,7 @@ public interface {{classname}}Delegate { {{/externalDocs}} * @see {{classname}}#{{operationId}} */ - {{#jdk8-default-interface}}default {{/jdk8-default-interface}}{{#responseWrapper}}{{.}}<{{/responseWrapper}}ResponseEntity<{{>returnTypes}}>{{#responseWrapper}}>{{/responseWrapper}} {{operationId}}({{#allParams}}{{^isFile}}{{^isBodyParam}}{{>optionalDataType}}{{/isBodyParam}}{{#isBodyParam}}{{^reactive}}{{{dataType}}}{{/reactive}}{{#reactive}}{{^isListContainer}}Mono{{/isListContainer}}{{#isListContainer}}Flux{{/isListContainer}}<{{{baseType}}}>{{/reactive}}{{/isBodyParam}}{{/isFile}}{{#isFile}}{{#isListContainer}}List<{{/isListContainer}}MultipartFile{{#isListContainer}}>{{/isListContainer}}{{/isFile}} {{paramName}}{{#hasMore}}, + {{#jdk8-default-interface}}default {{/jdk8-default-interface}}{{#responseWrapper}}{{.}}<{{/responseWrapper}}ResponseEntity<{{>returnTypes}}>{{#responseWrapper}}>{{/responseWrapper}} {{operationId}}({{#allParams}}{{^isFile}}{{^isBodyParam}}{{>optionalDataType}}{{/isBodyParam}}{{#isBodyParam}}{{^reactive}}{{{dataType}}}{{/reactive}}{{#reactive}}{{^isListContainer}}Mono{{/isListContainer}}{{#isListContainer}}Flux{{/isListContainer}}<{{{baseType}}}>{{/reactive}}{{/isBodyParam}}{{/isFile}}{{#isFile}}{{#isListContainer}}List<{{/isListContainer}}{{#reactive}}Flux{{/reactive}}{{^reactive}}MultipartFile{{/reactive}}{{#isListContainer}}>{{/isListContainer}}{{/isFile}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}{{#reactive}}{{#hasParams}}, {{/hasParams}}ServerWebExchange exchange{{/reactive}}){{#unhandledException}} throws Exception{{/unhandledException}}{{^jdk8-default-interface}};{{/jdk8-default-interface}}{{#jdk8-default-interface}} { {{>methodBody}} diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/formParams.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/formParams.mustache index cb794f9f381f..a97688aa95ca 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/formParams.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/formParams.mustache @@ -1 +1 @@ -{{#isFormParam}}{{^isFile}}@ApiParam(value = "{{{description}}}"{{#required}}, required=true{{/required}}{{#allowableValues}}, allowableValues="{{#values}}{{{.}}}{{^-last}}, {{/-last}}{{#-last}}{{/-last}}{{/values}}"{{/allowableValues}}{{^isContainer}}{{#defaultValue}}, defaultValue={{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}{{{defaultValue}}}{{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}{{/defaultValue}}{{/isContainer}}) {{#useBeanValidation}}@Valid{{/useBeanValidation}} @RequestPart(value = "{{baseName}}"{{#required}}, required = true{{/required}}{{^required}}, required = false{{/required}}) {{{dataType}}} {{paramName}}{{/isFile}}{{#isFile}}@ApiParam(value = "{{{description}}}") {{#useBeanValidation}}@Valid{{/useBeanValidation}} @RequestPart(value = "{{baseName}}"{{#required}}, required = true{{/required}}{{^required}}, required = false{{/required}}) {{#isListContainer}}List<{{/isListContainer}}MultipartFile{{#isListContainer}}>{{/isListContainer}} {{baseName}}{{/isFile}}{{/isFormParam}} \ No newline at end of file +{{#isFormParam}}{{^isFile}}@ApiParam(value = "{{{description}}}"{{#required}}, required=true{{/required}}{{#allowableValues}}, allowableValues="{{#values}}{{{.}}}{{^-last}}, {{/-last}}{{#-last}}{{/-last}}{{/values}}"{{/allowableValues}}{{^isContainer}}{{#defaultValue}}, defaultValue={{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}{{{defaultValue}}}{{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}{{/defaultValue}}{{/isContainer}}) {{#useBeanValidation}}@Valid{{/useBeanValidation}} @RequestPart(value = "{{baseName}}"{{#required}}, required = true{{/required}}{{^required}}, required = false{{/required}}) {{{dataType}}} {{paramName}}{{/isFile}}{{#isFile}}@ApiParam(value = "{{{description}}}") {{#useBeanValidation}}@Valid{{/useBeanValidation}} @RequestPart(value = "{{baseName}}"{{#required}}, required = true{{/required}}{{^required}}, required = false{{/required}}) {{#isListContainer}}List<{{/isListContainer}}{{#reactive}}Flux{{/reactive}}{{^reactive}}MultipartFile{{/reactive}}{{#isListContainer}}>{{/isListContainer}} {{baseName}}{{/isFile}}{{/isFormParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-cloud/formParams.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-cloud/formParams.mustache index 13a6e56e14b5..cd13f6320854 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-cloud/formParams.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-cloud/formParams.mustache @@ -1 +1 @@ -{{#isFormParam}}{{^isFile}}@ApiParam(value = "{{{description}}}"{{#required}}, required=true{{/required}} {{#allowableValues}}, allowableValues="{{{allowableValues}}}"{{/allowableValues}}{{^isContainer}}{{#defaultValue}}, defaultValue={{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}{{{defaultValue}}}{{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}{{/defaultValue}}{{/isContainer}}) @RequestParam(value="{{baseName}}"{{#required}}, required=true{{/required}}{{^required}}, required=false{{/required}}) {{{dataType}}} {{paramName}}{{/isFile}}{{#isFile}}@ApiParam(value = "{{{description}}}") @RequestParam("{{baseName}}") {{#isListContainer}}List<{{/isListContainer}}MultipartFile{{#isListContainer}}>{{/isListContainer}} {{paramName}}{{/isFile}}{{/isFormParam}} \ No newline at end of file +{{#isFormParam}}{{^isFile}}@ApiParam(value = "{{{description}}}"{{#required}}, required=true{{/required}} {{#allowableValues}}, allowableValues="{{{allowableValues}}}"{{/allowableValues}}{{^isContainer}}{{#defaultValue}}, defaultValue={{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}{{{defaultValue}}}{{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}{{/defaultValue}}{{/isContainer}}) @RequestParam(value="{{baseName}}"{{#required}}, required=true{{/required}}{{^required}}, required=false{{/required}}) {{{dataType}}} {{paramName}}{{/isFile}}{{#isFile}}@ApiParam(value = "{{{description}}}") @RequestParam("{{baseName}}") {{#isListContainer}}List<{{/isListContainer}}{{#reactive}}Flux{{/reactive}}{{^reactive}}MultipartFile{{/reactive}}{{#isListContainer}}>{{/isListContainer}} {{paramName}}{{/isFile}}{{/isFormParam}} \ No newline at end of file diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApi.java index a7c9567e168d..bd4902862f59 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -21,6 +21,7 @@ import org.springframework.web.server.ServerWebExchange; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; +import org.springframework.http.codec.multipart.Part; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java index bc51a545ff54..1cff47f7cfea 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java @@ -10,6 +10,7 @@ import org.springframework.web.server.ServerWebExchange; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; +import org.springframework.http.codec.multipart.Part; import java.util.List; import java.util.Map; diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApi.java index 203c4720538e..2b5c3369e1c8 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApi.java @@ -31,6 +31,7 @@ import org.springframework.web.server.ServerWebExchange; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; +import org.springframework.http.codec.multipart.Part; import javax.validation.Valid; import javax.validation.constraints.*; @@ -220,7 +221,7 @@ default Mono> testClientModel(@ApiParam(value = "client m @RequestMapping(value = "/fake", consumes = { "application/x-www-form-urlencoded" }, method = RequestMethod.POST) - default Mono> testEndpointParameters(@ApiParam(value = "None", required=true) @Valid @RequestPart(value = "number", required = true) BigDecimal number,@ApiParam(value = "None", required=true) @Valid @RequestPart(value = "double", required = true) Double _double,@ApiParam(value = "None", required=true) @Valid @RequestPart(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter,@ApiParam(value = "None", required=true) @Valid @RequestPart(value = "byte", required = true) byte[] _byte,@ApiParam(value = "None") @Valid @RequestPart(value = "integer", required = false) Integer integer,@ApiParam(value = "None") @Valid @RequestPart(value = "int32", required = false) Integer int32,@ApiParam(value = "None") @Valid @RequestPart(value = "int64", required = false) Long int64,@ApiParam(value = "None") @Valid @RequestPart(value = "float", required = false) Float _float,@ApiParam(value = "None") @Valid @RequestPart(value = "string", required = false) String string,@ApiParam(value = "None") @Valid @RequestPart(value = "binary", required = false) MultipartFile binary,@ApiParam(value = "None") @Valid @RequestPart(value = "date", required = false) LocalDate date,@ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) OffsetDateTime dateTime,@ApiParam(value = "None") @Valid @RequestPart(value = "password", required = false) String password,@ApiParam(value = "None") @Valid @RequestPart(value = "callback", required = false) String paramCallback, ServerWebExchange exchange) { + default Mono> testEndpointParameters(@ApiParam(value = "None", required=true) @Valid @RequestPart(value = "number", required = true) BigDecimal number,@ApiParam(value = "None", required=true) @Valid @RequestPart(value = "double", required = true) Double _double,@ApiParam(value = "None", required=true) @Valid @RequestPart(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter,@ApiParam(value = "None", required=true) @Valid @RequestPart(value = "byte", required = true) byte[] _byte,@ApiParam(value = "None") @Valid @RequestPart(value = "integer", required = false) Integer integer,@ApiParam(value = "None") @Valid @RequestPart(value = "int32", required = false) Integer int32,@ApiParam(value = "None") @Valid @RequestPart(value = "int64", required = false) Long int64,@ApiParam(value = "None") @Valid @RequestPart(value = "float", required = false) Float _float,@ApiParam(value = "None") @Valid @RequestPart(value = "string", required = false) String string,@ApiParam(value = "None") @Valid @RequestPart(value = "binary", required = false) Flux binary,@ApiParam(value = "None") @Valid @RequestPart(value = "date", required = false) LocalDate date,@ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) OffsetDateTime dateTime,@ApiParam(value = "None") @Valid @RequestPart(value = "password", required = false) String password,@ApiParam(value = "None") @Valid @RequestPart(value = "callback", required = false) String paramCallback, ServerWebExchange exchange) { return getDelegate().testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback, exchange); } @@ -350,7 +351,7 @@ default Mono> testQueryParameterCollectionFormat(@NotNull @ produces = { "application/json" }, consumes = { "multipart/form-data" }, method = RequestMethod.POST) - default Mono> uploadFileWithRequiredFile(@ApiParam(value = "ID of pet to update",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "file to upload") @Valid @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile,@ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata, ServerWebExchange exchange) { + default Mono> uploadFileWithRequiredFile(@ApiParam(value = "ID of pet to update",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "file to upload") @Valid @RequestPart(value = "requiredFile", required = true) Flux requiredFile,@ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata, ServerWebExchange exchange) { return getDelegate().uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata, exchange); } diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApiDelegate.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApiDelegate.java index e3bf18868356..b834a844fcf6 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApiDelegate.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApiDelegate.java @@ -20,6 +20,7 @@ import org.springframework.web.server.ServerWebExchange; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; +import org.springframework.http.codec.multipart.Part; import java.util.List; import java.util.Map; @@ -210,7 +211,7 @@ default Mono> testEndpointParameters(BigDecimal number, Long int64, Float _float, String string, - MultipartFile binary, + Flux binary, LocalDate date, OffsetDateTime dateTime, String password, @@ -345,7 +346,7 @@ default Mono> testQueryParameterCollectionFormat(List> uploadFileWithRequiredFile(Long petId, - MultipartFile requiredFile, + Flux requiredFile, String additionalMetadata, ServerWebExchange exchange) { Mono result = Mono.empty(); diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index c3b92d8b54b2..20d312afdb6d 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -21,6 +21,7 @@ import org.springframework.web.server.ServerWebExchange; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; +import org.springframework.http.codec.multipart.Part; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java index ea6c1aec4b82..de22e9252564 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java @@ -10,6 +10,7 @@ import org.springframework.web.server.ServerWebExchange; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; +import org.springframework.http.codec.multipart.Part; import java.util.List; import java.util.Map; diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApi.java index 1eb822dea268..c9bd79cf350c 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApi.java @@ -24,6 +24,7 @@ import org.springframework.web.server.ServerWebExchange; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; +import org.springframework.http.codec.multipart.Part; import javax.validation.Valid; import javax.validation.constraints.*; @@ -233,7 +234,7 @@ default Mono> updatePetWithForm(@ApiParam(value = "ID of pe produces = { "application/json" }, consumes = { "multipart/form-data" }, method = RequestMethod.POST) - default Mono> uploadFile(@ApiParam(value = "ID of pet to update",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata,@ApiParam(value = "file to upload") @Valid @RequestPart(value = "file", required = false) MultipartFile file, ServerWebExchange exchange) { + default Mono> uploadFile(@ApiParam(value = "ID of pet to update",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata,@ApiParam(value = "file to upload") @Valid @RequestPart(value = "file", required = false) Flux file, ServerWebExchange exchange) { return getDelegate().uploadFile(petId, additionalMetadata, file, exchange); } diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApiDelegate.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApiDelegate.java index f8c2b92e9989..19b3ed454094 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApiDelegate.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApiDelegate.java @@ -13,6 +13,7 @@ import org.springframework.web.server.ServerWebExchange; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; +import org.springframework.http.codec.multipart.Part; import java.util.List; import java.util.Map; @@ -200,7 +201,7 @@ default Mono> updatePetWithForm(Long petId, */ default Mono> uploadFile(Long petId, String additionalMetadata, - MultipartFile file, + Flux file, ServerWebExchange exchange) { Mono result = Mono.empty(); exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApi.java index 68b06d86791b..9eadfe25b2bc 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApi.java @@ -22,6 +22,7 @@ import org.springframework.web.server.ServerWebExchange; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; +import org.springframework.http.codec.multipart.Part; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApiDelegate.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApiDelegate.java index 37457faadcd1..cf7b723ae561 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApiDelegate.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApiDelegate.java @@ -11,6 +11,7 @@ import org.springframework.web.server.ServerWebExchange; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; +import org.springframework.http.codec.multipart.Part; import java.util.List; import java.util.Map; diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApi.java index 8a580c56cdac..3fdc4e8197d6 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApi.java @@ -22,6 +22,7 @@ import org.springframework.web.server.ServerWebExchange; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; +import org.springframework.http.codec.multipart.Part; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApiDelegate.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApiDelegate.java index 1f80fee7bf99..b40ebabc5cde 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApiDelegate.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApiDelegate.java @@ -11,6 +11,7 @@ import org.springframework.web.server.ServerWebExchange; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; +import org.springframework.http.codec.multipart.Part; import java.util.List; import java.util.Map; From fa75469828fdfe6b43487b7826655e1d15432d7a Mon Sep 17 00:00:00 2001 From: Calvin Young Date: Tue, 28 Jul 2020 01:54:52 -0700 Subject: [PATCH 082/129] Export models package when using withSeparateModelsAndApi flag (#6873) * Export models package when using withSeparateModelsAndApi flag * Update typescript-axios samples * Revert "Update typescript-axios samples" This reverts commit ac0db6ba940bb78d37b41a5655918cbef9bc2f26. * Update typescript-axios samples * update samples Co-authored-by: William Cheng --- .../src/main/resources/typescript-axios/index.mustache | 1 + .../petstore/typescript-axios/builds/composed-schemas/index.ts | 1 + samples/client/petstore/typescript-axios/builds/default/index.ts | 1 + .../client/petstore/typescript-axios/builds/es6-target/index.ts | 1 + .../typescript-axios/builds/with-complex-headers/index.ts | 1 + .../petstore/typescript-axios/builds/with-interfaces/index.ts | 1 + .../builds/with-npm-version-and-separate-models-and-api/index.ts | 1 + .../petstore/typescript-axios/builds/with-npm-version/index.ts | 1 + .../builds/with-single-request-parameters/index.ts | 1 + 9 files changed, 9 insertions(+) diff --git a/modules/openapi-generator/src/main/resources/typescript-axios/index.mustache b/modules/openapi-generator/src/main/resources/typescript-axios/index.mustache index b96435d71a77..b8e9eb606e63 100644 --- a/modules/openapi-generator/src/main/resources/typescript-axios/index.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-axios/index.mustache @@ -4,3 +4,4 @@ export * from "./api"; export * from "./configuration"; +{{#withSeparateModelsAndApi}}export * from "./{{tsModelPackage}}";{{/withSeparateModelsAndApi}} diff --git a/samples/client/petstore/typescript-axios/builds/composed-schemas/index.ts b/samples/client/petstore/typescript-axios/builds/composed-schemas/index.ts index 9f1fc0aca1a7..a94bbea12432 100644 --- a/samples/client/petstore/typescript-axios/builds/composed-schemas/index.ts +++ b/samples/client/petstore/typescript-axios/builds/composed-schemas/index.ts @@ -15,3 +15,4 @@ export * from "./api"; export * from "./configuration"; + diff --git a/samples/client/petstore/typescript-axios/builds/default/index.ts b/samples/client/petstore/typescript-axios/builds/default/index.ts index efc3ab5be819..ed3d348fdfec 100644 --- a/samples/client/petstore/typescript-axios/builds/default/index.ts +++ b/samples/client/petstore/typescript-axios/builds/default/index.ts @@ -15,3 +15,4 @@ export * from "./api"; export * from "./configuration"; + diff --git a/samples/client/petstore/typescript-axios/builds/es6-target/index.ts b/samples/client/petstore/typescript-axios/builds/es6-target/index.ts index efc3ab5be819..ed3d348fdfec 100644 --- a/samples/client/petstore/typescript-axios/builds/es6-target/index.ts +++ b/samples/client/petstore/typescript-axios/builds/es6-target/index.ts @@ -15,3 +15,4 @@ export * from "./api"; export * from "./configuration"; + diff --git a/samples/client/petstore/typescript-axios/builds/with-complex-headers/index.ts b/samples/client/petstore/typescript-axios/builds/with-complex-headers/index.ts index efc3ab5be819..ed3d348fdfec 100644 --- a/samples/client/petstore/typescript-axios/builds/with-complex-headers/index.ts +++ b/samples/client/petstore/typescript-axios/builds/with-complex-headers/index.ts @@ -15,3 +15,4 @@ export * from "./api"; export * from "./configuration"; + diff --git a/samples/client/petstore/typescript-axios/builds/with-interfaces/index.ts b/samples/client/petstore/typescript-axios/builds/with-interfaces/index.ts index efc3ab5be819..ed3d348fdfec 100644 --- a/samples/client/petstore/typescript-axios/builds/with-interfaces/index.ts +++ b/samples/client/petstore/typescript-axios/builds/with-interfaces/index.ts @@ -15,3 +15,4 @@ export * from "./api"; export * from "./configuration"; + diff --git a/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/index.ts b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/index.ts index efc3ab5be819..f0e6924d5d98 100644 --- a/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/index.ts +++ b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/index.ts @@ -15,3 +15,4 @@ export * from "./api"; export * from "./configuration"; +export * from "./model/some/levels/deep"; diff --git a/samples/client/petstore/typescript-axios/builds/with-npm-version/index.ts b/samples/client/petstore/typescript-axios/builds/with-npm-version/index.ts index efc3ab5be819..ed3d348fdfec 100644 --- a/samples/client/petstore/typescript-axios/builds/with-npm-version/index.ts +++ b/samples/client/petstore/typescript-axios/builds/with-npm-version/index.ts @@ -15,3 +15,4 @@ export * from "./api"; export * from "./configuration"; + diff --git a/samples/client/petstore/typescript-axios/builds/with-single-request-parameters/index.ts b/samples/client/petstore/typescript-axios/builds/with-single-request-parameters/index.ts index efc3ab5be819..ed3d348fdfec 100644 --- a/samples/client/petstore/typescript-axios/builds/with-single-request-parameters/index.ts +++ b/samples/client/petstore/typescript-axios/builds/with-single-request-parameters/index.ts @@ -15,3 +15,4 @@ export * from "./api"; export * from "./configuration"; + From 798ad2f87dc92f962132c62e4de18e2138bce6a4 Mon Sep 17 00:00:00 2001 From: Justin Black Date: Tue, 28 Jul 2020 08:16:19 -0700 Subject: [PATCH 083/129] [python-experimental] simplifies json serialization (#7061) * Requires python >= 3.5, adds type hints to call_api method * Adds type hints to files_parameters and __call_api * Adds and uses a new json encoded to prepare data before it is sent * Removes nose name from gitlab testing invocations * Also updates travis to py>=3.5 * Collapses encoder back into sanitize_for_serialization --- .../python-experimental/README.mustache | 2 +- .../README_onlypackage.mustache | 2 +- .../python-experimental/api_client.mustache | 97 +++++++++++-------- .../python-experimental/gitlab-ci.mustache | 24 ++--- .../python/python-experimental/setup.mustache | 2 +- .../python-experimental/travis.mustache | 3 - .../python-experimental/.gitlab-ci.yml | 24 ++--- .../petstore/python-experimental/.travis.yml | 3 - .../petstore/python-experimental/README.md | 2 +- .../petstore_api/api_client.py | 97 +++++++++++-------- .../petstore/python-experimental/setup.py | 2 +- .../python-experimental/.gitlab-ci.yml | 24 ++--- .../python-experimental/.travis.yml | 3 - .../python-experimental/README.md | 2 +- .../python-experimental/setup.py | 2 +- .../x_auth_id_alias/api_client.py | 97 +++++++++++-------- .../python-experimental/.gitlab-ci.yml | 24 ++--- .../python-experimental/.travis.yml | 3 - .../python-experimental/README.md | 2 +- .../dynamic_servers/api_client.py | 97 +++++++++++-------- .../python-experimental/setup.py | 2 +- .../python-experimental/.gitlab-ci.yml | 24 ++--- .../petstore/python-experimental/.travis.yml | 3 - .../petstore/python-experimental/README.md | 2 +- .../petstore_api/api_client.py | 97 +++++++++++-------- .../petstore/python-experimental/setup.py | 2 +- 26 files changed, 331 insertions(+), 311 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/README.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/README.mustache index 3fb507c5748a..7368913ef8ea 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/README.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/README.mustache @@ -17,7 +17,7 @@ For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}}) ## Requirements. -Python 3.4+ +Python >= 3.5 ## Installation & Usage ### pip install diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/README_onlypackage.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/README_onlypackage.mustache index ee90ce7903ef..3ef048b67a38 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/README_onlypackage.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/README_onlypackage.mustache @@ -17,7 +17,7 @@ For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}}) ## Requirements. -Python 2.7 and 3.4+ +Python >= 3.5 ## Installation & Usage diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache index b7112d202b98..de4e2d478e07 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache @@ -5,8 +5,10 @@ import json import atexit import mimetypes from multiprocessing.pool import ThreadPool +import io import os import re +import typing from urllib.parse import quote {{#tornado}} @@ -54,9 +56,6 @@ class ApiClient(object): to the API. More threads means more concurrent API requests. """ - PRIMITIVE_TYPES = ( - float, bool, bytes, str, int - ) _pool = None def __init__(self, configuration=None, header_name=None, header_value=None, @@ -114,12 +113,24 @@ class ApiClient(object): @tornado.gen.coroutine {{/tornado}} {{#asyncio}}async {{/asyncio}}def __call_api( - self, resource_path, method, path_params=None, - query_params=None, header_params=None, body=None, post_params=None, - files=None, response_type=None, auth_settings=None, - _return_http_data_only=None, collection_formats=None, - _preload_content=True, _request_timeout=None, _host=None, - _check_type=None): + self, + resource_path: str, + method: str, + path_params: typing.Optional[typing.Dict[str, typing.Any]] = None, + query_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None, + header_params: typing.Optional[typing.Dict[str, typing.Any]] = None, + body: typing.Optional[typing.Any] = None, + post_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None, + files: typing.Optional[typing.Dict[str, typing.List[io.IOBase]]] = None, + response_type: typing.Optional[typing.Tuple[typing.Any]] = None, + auth_settings: typing.Optional[typing.List[str]] = None, + _return_http_data_only: typing.Optional[bool] = None, + collection_formats: typing.Optional[typing.Dict[str, str]] = None, + _preload_content: bool = True, + _request_timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + _host: typing.Optional[str] = None, + _check_type: typing.Optional[bool] = None + ): config = self.configuration @@ -232,9 +243,9 @@ class ApiClient(object): response_data.getheaders())) {{/tornado}} - def sanitize_for_serialization(self, obj): + @classmethod + def sanitize_for_serialization(cls, obj): """Builds a JSON POST object. - If obj is None, return None. If obj is str, int, long, float, bool, return directly. If obj is datetime.datetime, datetime.date @@ -242,35 +253,24 @@ class ApiClient(object): If obj is list, sanitize each element in the list. If obj is dict, return the dict. If obj is OpenAPI model, return the properties dict. - :param obj: The data to serialize. :return: The serialized form of data. """ - if obj is None: - return None - elif isinstance(obj, self.PRIMITIVE_TYPES): + if isinstance(obj, (ModelNormal, ModelComposed)): + return { + key: cls.sanitize_for_serialization(val) for key, val in model_to_dict(obj, serialize=True).items() + } + elif isinstance(obj, (str, int, float, none_type, bool)): return obj - elif isinstance(obj, list): - return [self.sanitize_for_serialization(sub_obj) - for sub_obj in obj] - elif isinstance(obj, tuple): - return tuple(self.sanitize_for_serialization(sub_obj) - for sub_obj in obj) elif isinstance(obj, (datetime, date)): return obj.isoformat() - - if isinstance(obj, dict): - obj_dict = obj - elif isinstance(obj, ModelNormal) or isinstance(obj, ModelComposed): - # Convert model obj to dict - # Convert attribute name to json key in - # model definition for request - obj_dict = model_to_dict(obj, serialize=True) elif isinstance(obj, ModelSimple): - return self.sanitize_for_serialization(obj.value) - - return {key: self.sanitize_for_serialization(val) - for key, val in obj_dict.items()} + return cls.sanitize_for_serialization(obj.value) + elif isinstance(obj, (list, tuple)): + return [cls.sanitize_for_serialization(item) for item in obj] + if isinstance(obj, dict): + return {key: cls.sanitize_for_serialization(val) for key, val in obj.items()} + raise ApiValueError('Unable to prepare type {} for serialization'.format(obj.__class__.__name__)) def deserialize(self, response, response_type, _check_type): """Deserializes response into an object. @@ -317,13 +317,26 @@ class ApiClient(object): ) return deserialized_data - def call_api(self, resource_path, method, - path_params=None, query_params=None, header_params=None, - body=None, post_params=None, files=None, - response_type=None, auth_settings=None, async_req=None, - _return_http_data_only=None, collection_formats=None, - _preload_content=True, _request_timeout=None, _host=None, - _check_type=None): + def call_api( + self, + resource_path: str, + method: str, + path_params: typing.Optional[typing.Dict[str, typing.Any]] = None, + query_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None, + header_params: typing.Optional[typing.Dict[str, typing.Any]] = None, + body: typing.Optional[typing.Any] = None, + post_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None, + files: typing.Optional[typing.Dict[str, typing.List[io.IOBase]]] = None, + response_type: typing.Optional[typing.Tuple[typing.Any]] = None, + auth_settings: typing.Optional[typing.List[str]] = None, + async_req: typing.Optional[bool] = None, + _return_http_data_only: typing.Optional[bool] = None, + collection_formats: typing.Optional[typing.Dict[str, str]] = None, + _preload_content: bool = True, + _request_timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + _host: typing.Optional[str] = None, + _check_type: typing.Optional[bool] = None + ): """Makes the HTTP request (synchronous) and returns deserialized data. To make an async_req request, set the async_req parameter. @@ -490,7 +503,7 @@ class ApiClient(object): new_params.append((k, v)) return new_params - def files_parameters(self, files=None): + def files_parameters(self, files: typing.Optional[typing.Dict[str, typing.List[io.IOBase]]] = None): """Builds form parameters. :param files: None or a dict with key=param_name and @@ -566,7 +579,7 @@ class ApiClient(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 sanitize_for_serialization(). + The object type is the return value of _encoder.default(). """ if not auth_settings: return diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/gitlab-ci.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/gitlab-ci.mustache index a626e9c08403..60c4b3789335 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/gitlab-ci.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/gitlab-ci.mustache @@ -3,7 +3,7 @@ stages: - test -.nosetest: +.tests: stage: test script: - pip install -r requirements.txt @@ -15,21 +15,15 @@ stages: - pytest --cov={{{packageName}}} {{/useNose}} -nosetest-3.3: - extends: .nosetest - image: python:3.3-alpine -nosetest-3.4: - extends: .nosetest - image: python:3.4-alpine -nosetest-3.5: - extends: .nosetest +test-3.5: + extends: .tests image: python:3.5-alpine -nosetest-3.6: - extends: .nosetest +test-3.6: + extends: .tests image: python:3.6-alpine -nosetest-3.7: - extends: .nosetest +test-3.7: + extends: .tests image: python:3.7-alpine -nosetest-3.8: - extends: .nosetest +test-3.8: + extends: .tests image: python:3.8-alpine diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/setup.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/setup.mustache index b3c89f621e59..4c3e32ef7db8 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/setup.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/setup.mustache @@ -41,7 +41,7 @@ setup( author_email="{{#infoEmail}}{{infoEmail}}{{/infoEmail}}{{^infoEmail}}team@openapitools.org{{/infoEmail}}", url="{{packageUrl}}", keywords=["OpenAPI", "OpenAPI-Generator", "{{{appName}}}"], - python_requires=">=3.3", + python_requires=">=3.5", install_requires=REQUIRES, packages=find_packages(exclude=["test", "tests"]), include_package_data=True, diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/travis.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/travis.mustache index 77f7289f972a..3c255f64e991 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/travis.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/travis.mustache @@ -1,9 +1,6 @@ # ref: https://docs.travis-ci.com/user/languages/python language: python python: - - "3.2" - - "3.3" - - "3.4" - "3.5" - "3.6" - "3.7" diff --git a/samples/client/petstore/python-experimental/.gitlab-ci.yml b/samples/client/petstore/python-experimental/.gitlab-ci.yml index 9703213bb062..611e425676ee 100644 --- a/samples/client/petstore/python-experimental/.gitlab-ci.yml +++ b/samples/client/petstore/python-experimental/.gitlab-ci.yml @@ -3,28 +3,22 @@ stages: - test -.nosetest: +.tests: stage: test script: - pip install -r requirements.txt - pip install -r test-requirements.txt - pytest --cov=petstore_api -nosetest-3.3: - extends: .nosetest - image: python:3.3-alpine -nosetest-3.4: - extends: .nosetest - image: python:3.4-alpine -nosetest-3.5: - extends: .nosetest +test-3.5: + extends: .tests image: python:3.5-alpine -nosetest-3.6: - extends: .nosetest +test-3.6: + extends: .tests image: python:3.6-alpine -nosetest-3.7: - extends: .nosetest +test-3.7: + extends: .tests image: python:3.7-alpine -nosetest-3.8: - extends: .nosetest +test-3.8: + extends: .tests image: python:3.8-alpine diff --git a/samples/client/petstore/python-experimental/.travis.yml b/samples/client/petstore/python-experimental/.travis.yml index 3aa7c047e1e2..f931f0f74b96 100644 --- a/samples/client/petstore/python-experimental/.travis.yml +++ b/samples/client/petstore/python-experimental/.travis.yml @@ -1,9 +1,6 @@ # ref: https://docs.travis-ci.com/user/languages/python language: python python: - - "3.2" - - "3.3" - - "3.4" - "3.5" - "3.6" - "3.7" diff --git a/samples/client/petstore/python-experimental/README.md b/samples/client/petstore/python-experimental/README.md index a935fc478b12..6c6a64d9899e 100644 --- a/samples/client/petstore/python-experimental/README.md +++ b/samples/client/petstore/python-experimental/README.md @@ -9,7 +9,7 @@ This Python package is automatically generated by the [OpenAPI Generator](https: ## Requirements. -Python 3.4+ +Python >= 3.5 ## Installation & Usage ### pip install diff --git a/samples/client/petstore/python-experimental/petstore_api/api_client.py b/samples/client/petstore/python-experimental/petstore_api/api_client.py index 0f7571e183d8..d8d39c50433b 100644 --- a/samples/client/petstore/python-experimental/petstore_api/api_client.py +++ b/samples/client/petstore/python-experimental/petstore_api/api_client.py @@ -13,8 +13,10 @@ import atexit import mimetypes from multiprocessing.pool import ThreadPool +import io import os import re +import typing from urllib.parse import quote @@ -59,9 +61,6 @@ class ApiClient(object): to the API. More threads means more concurrent API requests. """ - PRIMITIVE_TYPES = ( - float, bool, bytes, str, int - ) _pool = None def __init__(self, configuration=None, header_name=None, header_value=None, @@ -116,12 +115,24 @@ def set_default_header(self, header_name, header_value): self.default_headers[header_name] = header_value def __call_api( - self, resource_path, method, path_params=None, - query_params=None, header_params=None, body=None, post_params=None, - files=None, response_type=None, auth_settings=None, - _return_http_data_only=None, collection_formats=None, - _preload_content=True, _request_timeout=None, _host=None, - _check_type=None): + self, + resource_path: str, + method: str, + path_params: typing.Optional[typing.Dict[str, typing.Any]] = None, + query_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None, + header_params: typing.Optional[typing.Dict[str, typing.Any]] = None, + body: typing.Optional[typing.Any] = None, + post_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None, + files: typing.Optional[typing.Dict[str, typing.List[io.IOBase]]] = None, + response_type: typing.Optional[typing.Tuple[typing.Any]] = None, + auth_settings: typing.Optional[typing.List[str]] = None, + _return_http_data_only: typing.Optional[bool] = None, + collection_formats: typing.Optional[typing.Dict[str, str]] = None, + _preload_content: bool = True, + _request_timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + _host: typing.Optional[str] = None, + _check_type: typing.Optional[bool] = None + ): config = self.configuration @@ -220,9 +231,9 @@ def __call_api( return (return_data, response_data.status, response_data.getheaders()) - def sanitize_for_serialization(self, obj): + @classmethod + def sanitize_for_serialization(cls, obj): """Builds a JSON POST object. - If obj is None, return None. If obj is str, int, long, float, bool, return directly. If obj is datetime.datetime, datetime.date @@ -230,35 +241,24 @@ def sanitize_for_serialization(self, obj): If obj is list, sanitize each element in the list. If obj is dict, return the dict. If obj is OpenAPI model, return the properties dict. - :param obj: The data to serialize. :return: The serialized form of data. """ - if obj is None: - return None - elif isinstance(obj, self.PRIMITIVE_TYPES): + if isinstance(obj, (ModelNormal, ModelComposed)): + return { + key: cls.sanitize_for_serialization(val) for key, val in model_to_dict(obj, serialize=True).items() + } + elif isinstance(obj, (str, int, float, none_type, bool)): return obj - elif isinstance(obj, list): - return [self.sanitize_for_serialization(sub_obj) - for sub_obj in obj] - elif isinstance(obj, tuple): - return tuple(self.sanitize_for_serialization(sub_obj) - for sub_obj in obj) elif isinstance(obj, (datetime, date)): return obj.isoformat() - - if isinstance(obj, dict): - obj_dict = obj - elif isinstance(obj, ModelNormal) or isinstance(obj, ModelComposed): - # Convert model obj to dict - # Convert attribute name to json key in - # model definition for request - obj_dict = model_to_dict(obj, serialize=True) elif isinstance(obj, ModelSimple): - return self.sanitize_for_serialization(obj.value) - - return {key: self.sanitize_for_serialization(val) - for key, val in obj_dict.items()} + return cls.sanitize_for_serialization(obj.value) + elif isinstance(obj, (list, tuple)): + return [cls.sanitize_for_serialization(item) for item in obj] + if isinstance(obj, dict): + return {key: cls.sanitize_for_serialization(val) for key, val in obj.items()} + raise ApiValueError('Unable to prepare type {} for serialization'.format(obj.__class__.__name__)) def deserialize(self, response, response_type, _check_type): """Deserializes response into an object. @@ -305,13 +305,26 @@ def deserialize(self, response, response_type, _check_type): ) return deserialized_data - def call_api(self, resource_path, method, - path_params=None, query_params=None, header_params=None, - body=None, post_params=None, files=None, - response_type=None, auth_settings=None, async_req=None, - _return_http_data_only=None, collection_formats=None, - _preload_content=True, _request_timeout=None, _host=None, - _check_type=None): + def call_api( + self, + resource_path: str, + method: str, + path_params: typing.Optional[typing.Dict[str, typing.Any]] = None, + query_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None, + header_params: typing.Optional[typing.Dict[str, typing.Any]] = None, + body: typing.Optional[typing.Any] = None, + post_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None, + files: typing.Optional[typing.Dict[str, typing.List[io.IOBase]]] = None, + response_type: typing.Optional[typing.Tuple[typing.Any]] = None, + auth_settings: typing.Optional[typing.List[str]] = None, + async_req: typing.Optional[bool] = None, + _return_http_data_only: typing.Optional[bool] = None, + collection_formats: typing.Optional[typing.Dict[str, str]] = None, + _preload_content: bool = True, + _request_timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + _host: typing.Optional[str] = None, + _check_type: typing.Optional[bool] = None + ): """Makes the HTTP request (synchronous) and returns deserialized data. To make an async_req request, set the async_req parameter. @@ -478,7 +491,7 @@ def parameters_to_tuples(self, params, collection_formats): new_params.append((k, v)) return new_params - def files_parameters(self, files=None): + def files_parameters(self, files: typing.Optional[typing.Dict[str, typing.List[io.IOBase]]] = None): """Builds form parameters. :param files: None or a dict with key=param_name and @@ -554,7 +567,7 @@ def update_params_for_auth(self, headers, querys, auth_settings, :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 sanitize_for_serialization(). + The object type is the return value of _encoder.default(). """ if not auth_settings: return diff --git a/samples/client/petstore/python-experimental/setup.py b/samples/client/petstore/python-experimental/setup.py index eba01f249e05..56811ec079bd 100644 --- a/samples/client/petstore/python-experimental/setup.py +++ b/samples/client/petstore/python-experimental/setup.py @@ -36,7 +36,7 @@ author_email="team@openapitools.org", url="", keywords=["OpenAPI", "OpenAPI-Generator", "OpenAPI Petstore"], - python_requires=">=3.3", + python_requires=">=3.5", install_requires=REQUIRES, packages=find_packages(exclude=["test", "tests"]), include_package_data=True, diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/.gitlab-ci.yml b/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/.gitlab-ci.yml index c0bcd3bec24f..9b7c7da75e91 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/.gitlab-ci.yml +++ b/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/.gitlab-ci.yml @@ -3,28 +3,22 @@ stages: - test -.nosetest: +.tests: stage: test script: - pip install -r requirements.txt - pip install -r test-requirements.txt - pytest --cov=x_auth_id_alias -nosetest-3.3: - extends: .nosetest - image: python:3.3-alpine -nosetest-3.4: - extends: .nosetest - image: python:3.4-alpine -nosetest-3.5: - extends: .nosetest +test-3.5: + extends: .tests image: python:3.5-alpine -nosetest-3.6: - extends: .nosetest +test-3.6: + extends: .tests image: python:3.6-alpine -nosetest-3.7: - extends: .nosetest +test-3.7: + extends: .tests image: python:3.7-alpine -nosetest-3.8: - extends: .nosetest +test-3.8: + extends: .tests image: python:3.8-alpine diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/.travis.yml b/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/.travis.yml index dbcba3d8b95e..c125a8fb1b17 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/.travis.yml +++ b/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/.travis.yml @@ -1,9 +1,6 @@ # ref: https://docs.travis-ci.com/user/languages/python language: python python: - - "3.2" - - "3.3" - - "3.4" - "3.5" - "3.6" - "3.7" diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/README.md b/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/README.md index b70a7bfcb472..26830bc74677 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/README.md +++ b/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/README.md @@ -9,7 +9,7 @@ This Python package is automatically generated by the [OpenAPI Generator](https: ## Requirements. -Python 3.4+ +Python >= 3.5 ## Installation & Usage ### pip install diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/setup.py b/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/setup.py index 6283d1ff49df..d06d8678f6ba 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/setup.py +++ b/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/setup.py @@ -36,7 +36,7 @@ author_email="team@openapitools.org", url="", keywords=["OpenAPI", "OpenAPI-Generator", "OpenAPI Extension x-auth-id-alias"], - python_requires=">=3.3", + python_requires=">=3.5", install_requires=REQUIRES, packages=find_packages(exclude=["test", "tests"]), include_package_data=True, diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/x_auth_id_alias/api_client.py b/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/x_auth_id_alias/api_client.py index be9cef4ff3cd..9f3792c96b77 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/x_auth_id_alias/api_client.py +++ b/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/x_auth_id_alias/api_client.py @@ -13,8 +13,10 @@ import atexit import mimetypes from multiprocessing.pool import ThreadPool +import io import os import re +import typing from urllib.parse import quote @@ -59,9 +61,6 @@ class ApiClient(object): to the API. More threads means more concurrent API requests. """ - PRIMITIVE_TYPES = ( - float, bool, bytes, str, int - ) _pool = None def __init__(self, configuration=None, header_name=None, header_value=None, @@ -116,12 +115,24 @@ def set_default_header(self, header_name, header_value): self.default_headers[header_name] = header_value def __call_api( - self, resource_path, method, path_params=None, - query_params=None, header_params=None, body=None, post_params=None, - files=None, response_type=None, auth_settings=None, - _return_http_data_only=None, collection_formats=None, - _preload_content=True, _request_timeout=None, _host=None, - _check_type=None): + self, + resource_path: str, + method: str, + path_params: typing.Optional[typing.Dict[str, typing.Any]] = None, + query_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None, + header_params: typing.Optional[typing.Dict[str, typing.Any]] = None, + body: typing.Optional[typing.Any] = None, + post_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None, + files: typing.Optional[typing.Dict[str, typing.List[io.IOBase]]] = None, + response_type: typing.Optional[typing.Tuple[typing.Any]] = None, + auth_settings: typing.Optional[typing.List[str]] = None, + _return_http_data_only: typing.Optional[bool] = None, + collection_formats: typing.Optional[typing.Dict[str, str]] = None, + _preload_content: bool = True, + _request_timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + _host: typing.Optional[str] = None, + _check_type: typing.Optional[bool] = None + ): config = self.configuration @@ -220,9 +231,9 @@ def __call_api( return (return_data, response_data.status, response_data.getheaders()) - def sanitize_for_serialization(self, obj): + @classmethod + def sanitize_for_serialization(cls, obj): """Builds a JSON POST object. - If obj is None, return None. If obj is str, int, long, float, bool, return directly. If obj is datetime.datetime, datetime.date @@ -230,35 +241,24 @@ def sanitize_for_serialization(self, obj): If obj is list, sanitize each element in the list. If obj is dict, return the dict. If obj is OpenAPI model, return the properties dict. - :param obj: The data to serialize. :return: The serialized form of data. """ - if obj is None: - return None - elif isinstance(obj, self.PRIMITIVE_TYPES): + if isinstance(obj, (ModelNormal, ModelComposed)): + return { + key: cls.sanitize_for_serialization(val) for key, val in model_to_dict(obj, serialize=True).items() + } + elif isinstance(obj, (str, int, float, none_type, bool)): return obj - elif isinstance(obj, list): - return [self.sanitize_for_serialization(sub_obj) - for sub_obj in obj] - elif isinstance(obj, tuple): - return tuple(self.sanitize_for_serialization(sub_obj) - for sub_obj in obj) elif isinstance(obj, (datetime, date)): return obj.isoformat() - - if isinstance(obj, dict): - obj_dict = obj - elif isinstance(obj, ModelNormal) or isinstance(obj, ModelComposed): - # Convert model obj to dict - # Convert attribute name to json key in - # model definition for request - obj_dict = model_to_dict(obj, serialize=True) elif isinstance(obj, ModelSimple): - return self.sanitize_for_serialization(obj.value) - - return {key: self.sanitize_for_serialization(val) - for key, val in obj_dict.items()} + return cls.sanitize_for_serialization(obj.value) + elif isinstance(obj, (list, tuple)): + return [cls.sanitize_for_serialization(item) for item in obj] + if isinstance(obj, dict): + return {key: cls.sanitize_for_serialization(val) for key, val in obj.items()} + raise ApiValueError('Unable to prepare type {} for serialization'.format(obj.__class__.__name__)) def deserialize(self, response, response_type, _check_type): """Deserializes response into an object. @@ -305,13 +305,26 @@ def deserialize(self, response, response_type, _check_type): ) return deserialized_data - def call_api(self, resource_path, method, - path_params=None, query_params=None, header_params=None, - body=None, post_params=None, files=None, - response_type=None, auth_settings=None, async_req=None, - _return_http_data_only=None, collection_formats=None, - _preload_content=True, _request_timeout=None, _host=None, - _check_type=None): + def call_api( + self, + resource_path: str, + method: str, + path_params: typing.Optional[typing.Dict[str, typing.Any]] = None, + query_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None, + header_params: typing.Optional[typing.Dict[str, typing.Any]] = None, + body: typing.Optional[typing.Any] = None, + post_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None, + files: typing.Optional[typing.Dict[str, typing.List[io.IOBase]]] = None, + response_type: typing.Optional[typing.Tuple[typing.Any]] = None, + auth_settings: typing.Optional[typing.List[str]] = None, + async_req: typing.Optional[bool] = None, + _return_http_data_only: typing.Optional[bool] = None, + collection_formats: typing.Optional[typing.Dict[str, str]] = None, + _preload_content: bool = True, + _request_timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + _host: typing.Optional[str] = None, + _check_type: typing.Optional[bool] = None + ): """Makes the HTTP request (synchronous) and returns deserialized data. To make an async_req request, set the async_req parameter. @@ -478,7 +491,7 @@ def parameters_to_tuples(self, params, collection_formats): new_params.append((k, v)) return new_params - def files_parameters(self, files=None): + def files_parameters(self, files: typing.Optional[typing.Dict[str, typing.List[io.IOBase]]] = None): """Builds form parameters. :param files: None or a dict with key=param_name and @@ -554,7 +567,7 @@ def update_params_for_auth(self, headers, querys, auth_settings, :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 sanitize_for_serialization(). + The object type is the return value of _encoder.default(). """ if not auth_settings: return diff --git a/samples/openapi3/client/features/dynamic-servers/python-experimental/.gitlab-ci.yml b/samples/openapi3/client/features/dynamic-servers/python-experimental/.gitlab-ci.yml index c568a94e1d53..3d7864a76721 100644 --- a/samples/openapi3/client/features/dynamic-servers/python-experimental/.gitlab-ci.yml +++ b/samples/openapi3/client/features/dynamic-servers/python-experimental/.gitlab-ci.yml @@ -3,28 +3,22 @@ stages: - test -.nosetest: +.tests: stage: test script: - pip install -r requirements.txt - pip install -r test-requirements.txt - pytest --cov=dynamic_servers -nosetest-3.3: - extends: .nosetest - image: python:3.3-alpine -nosetest-3.4: - extends: .nosetest - image: python:3.4-alpine -nosetest-3.5: - extends: .nosetest +test-3.5: + extends: .tests image: python:3.5-alpine -nosetest-3.6: - extends: .nosetest +test-3.6: + extends: .tests image: python:3.6-alpine -nosetest-3.7: - extends: .nosetest +test-3.7: + extends: .tests image: python:3.7-alpine -nosetest-3.8: - extends: .nosetest +test-3.8: + extends: .tests image: python:3.8-alpine diff --git a/samples/openapi3/client/features/dynamic-servers/python-experimental/.travis.yml b/samples/openapi3/client/features/dynamic-servers/python-experimental/.travis.yml index 830b855ce62e..2ed01c997380 100644 --- a/samples/openapi3/client/features/dynamic-servers/python-experimental/.travis.yml +++ b/samples/openapi3/client/features/dynamic-servers/python-experimental/.travis.yml @@ -1,9 +1,6 @@ # ref: https://docs.travis-ci.com/user/languages/python language: python python: - - "3.2" - - "3.3" - - "3.4" - "3.5" - "3.6" - "3.7" diff --git a/samples/openapi3/client/features/dynamic-servers/python-experimental/README.md b/samples/openapi3/client/features/dynamic-servers/python-experimental/README.md index f85d06bd96c9..0d9236bd2203 100644 --- a/samples/openapi3/client/features/dynamic-servers/python-experimental/README.md +++ b/samples/openapi3/client/features/dynamic-servers/python-experimental/README.md @@ -9,7 +9,7 @@ This Python package is automatically generated by the [OpenAPI Generator](https: ## Requirements. -Python 3.4+ +Python >= 3.5 ## Installation & Usage ### pip install diff --git a/samples/openapi3/client/features/dynamic-servers/python-experimental/dynamic_servers/api_client.py b/samples/openapi3/client/features/dynamic-servers/python-experimental/dynamic_servers/api_client.py index cbbaa8c0b2b1..c7a8c3070aa4 100644 --- a/samples/openapi3/client/features/dynamic-servers/python-experimental/dynamic_servers/api_client.py +++ b/samples/openapi3/client/features/dynamic-servers/python-experimental/dynamic_servers/api_client.py @@ -13,8 +13,10 @@ import atexit import mimetypes from multiprocessing.pool import ThreadPool +import io import os import re +import typing from urllib.parse import quote @@ -59,9 +61,6 @@ class ApiClient(object): to the API. More threads means more concurrent API requests. """ - PRIMITIVE_TYPES = ( - float, bool, bytes, str, int - ) _pool = None def __init__(self, configuration=None, header_name=None, header_value=None, @@ -116,12 +115,24 @@ def set_default_header(self, header_name, header_value): self.default_headers[header_name] = header_value def __call_api( - self, resource_path, method, path_params=None, - query_params=None, header_params=None, body=None, post_params=None, - files=None, response_type=None, auth_settings=None, - _return_http_data_only=None, collection_formats=None, - _preload_content=True, _request_timeout=None, _host=None, - _check_type=None): + self, + resource_path: str, + method: str, + path_params: typing.Optional[typing.Dict[str, typing.Any]] = None, + query_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None, + header_params: typing.Optional[typing.Dict[str, typing.Any]] = None, + body: typing.Optional[typing.Any] = None, + post_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None, + files: typing.Optional[typing.Dict[str, typing.List[io.IOBase]]] = None, + response_type: typing.Optional[typing.Tuple[typing.Any]] = None, + auth_settings: typing.Optional[typing.List[str]] = None, + _return_http_data_only: typing.Optional[bool] = None, + collection_formats: typing.Optional[typing.Dict[str, str]] = None, + _preload_content: bool = True, + _request_timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + _host: typing.Optional[str] = None, + _check_type: typing.Optional[bool] = None + ): config = self.configuration @@ -220,9 +231,9 @@ def __call_api( return (return_data, response_data.status, response_data.getheaders()) - def sanitize_for_serialization(self, obj): + @classmethod + def sanitize_for_serialization(cls, obj): """Builds a JSON POST object. - If obj is None, return None. If obj is str, int, long, float, bool, return directly. If obj is datetime.datetime, datetime.date @@ -230,35 +241,24 @@ def sanitize_for_serialization(self, obj): If obj is list, sanitize each element in the list. If obj is dict, return the dict. If obj is OpenAPI model, return the properties dict. - :param obj: The data to serialize. :return: The serialized form of data. """ - if obj is None: - return None - elif isinstance(obj, self.PRIMITIVE_TYPES): + if isinstance(obj, (ModelNormal, ModelComposed)): + return { + key: cls.sanitize_for_serialization(val) for key, val in model_to_dict(obj, serialize=True).items() + } + elif isinstance(obj, (str, int, float, none_type, bool)): return obj - elif isinstance(obj, list): - return [self.sanitize_for_serialization(sub_obj) - for sub_obj in obj] - elif isinstance(obj, tuple): - return tuple(self.sanitize_for_serialization(sub_obj) - for sub_obj in obj) elif isinstance(obj, (datetime, date)): return obj.isoformat() - - if isinstance(obj, dict): - obj_dict = obj - elif isinstance(obj, ModelNormal) or isinstance(obj, ModelComposed): - # Convert model obj to dict - # Convert attribute name to json key in - # model definition for request - obj_dict = model_to_dict(obj, serialize=True) elif isinstance(obj, ModelSimple): - return self.sanitize_for_serialization(obj.value) - - return {key: self.sanitize_for_serialization(val) - for key, val in obj_dict.items()} + return cls.sanitize_for_serialization(obj.value) + elif isinstance(obj, (list, tuple)): + return [cls.sanitize_for_serialization(item) for item in obj] + if isinstance(obj, dict): + return {key: cls.sanitize_for_serialization(val) for key, val in obj.items()} + raise ApiValueError('Unable to prepare type {} for serialization'.format(obj.__class__.__name__)) def deserialize(self, response, response_type, _check_type): """Deserializes response into an object. @@ -305,13 +305,26 @@ def deserialize(self, response, response_type, _check_type): ) return deserialized_data - def call_api(self, resource_path, method, - path_params=None, query_params=None, header_params=None, - body=None, post_params=None, files=None, - response_type=None, auth_settings=None, async_req=None, - _return_http_data_only=None, collection_formats=None, - _preload_content=True, _request_timeout=None, _host=None, - _check_type=None): + def call_api( + self, + resource_path: str, + method: str, + path_params: typing.Optional[typing.Dict[str, typing.Any]] = None, + query_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None, + header_params: typing.Optional[typing.Dict[str, typing.Any]] = None, + body: typing.Optional[typing.Any] = None, + post_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None, + files: typing.Optional[typing.Dict[str, typing.List[io.IOBase]]] = None, + response_type: typing.Optional[typing.Tuple[typing.Any]] = None, + auth_settings: typing.Optional[typing.List[str]] = None, + async_req: typing.Optional[bool] = None, + _return_http_data_only: typing.Optional[bool] = None, + collection_formats: typing.Optional[typing.Dict[str, str]] = None, + _preload_content: bool = True, + _request_timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + _host: typing.Optional[str] = None, + _check_type: typing.Optional[bool] = None + ): """Makes the HTTP request (synchronous) and returns deserialized data. To make an async_req request, set the async_req parameter. @@ -478,7 +491,7 @@ def parameters_to_tuples(self, params, collection_formats): new_params.append((k, v)) return new_params - def files_parameters(self, files=None): + def files_parameters(self, files: typing.Optional[typing.Dict[str, typing.List[io.IOBase]]] = None): """Builds form parameters. :param files: None or a dict with key=param_name and @@ -554,7 +567,7 @@ def update_params_for_auth(self, headers, querys, auth_settings, :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 sanitize_for_serialization(). + The object type is the return value of _encoder.default(). """ if not auth_settings: return diff --git a/samples/openapi3/client/features/dynamic-servers/python-experimental/setup.py b/samples/openapi3/client/features/dynamic-servers/python-experimental/setup.py index e14ab67ede49..aea4b7b422ea 100644 --- a/samples/openapi3/client/features/dynamic-servers/python-experimental/setup.py +++ b/samples/openapi3/client/features/dynamic-servers/python-experimental/setup.py @@ -36,7 +36,7 @@ author_email="team@openapitools.org", url="", keywords=["OpenAPI", "OpenAPI-Generator", "OpenAPI Extension with dynamic servers"], - python_requires=">=3.3", + python_requires=">=3.5", install_requires=REQUIRES, packages=find_packages(exclude=["test", "tests"]), include_package_data=True, diff --git a/samples/openapi3/client/petstore/python-experimental/.gitlab-ci.yml b/samples/openapi3/client/petstore/python-experimental/.gitlab-ci.yml index 9703213bb062..611e425676ee 100644 --- a/samples/openapi3/client/petstore/python-experimental/.gitlab-ci.yml +++ b/samples/openapi3/client/petstore/python-experimental/.gitlab-ci.yml @@ -3,28 +3,22 @@ stages: - test -.nosetest: +.tests: stage: test script: - pip install -r requirements.txt - pip install -r test-requirements.txt - pytest --cov=petstore_api -nosetest-3.3: - extends: .nosetest - image: python:3.3-alpine -nosetest-3.4: - extends: .nosetest - image: python:3.4-alpine -nosetest-3.5: - extends: .nosetest +test-3.5: + extends: .tests image: python:3.5-alpine -nosetest-3.6: - extends: .nosetest +test-3.6: + extends: .tests image: python:3.6-alpine -nosetest-3.7: - extends: .nosetest +test-3.7: + extends: .tests image: python:3.7-alpine -nosetest-3.8: - extends: .nosetest +test-3.8: + extends: .tests image: python:3.8-alpine diff --git a/samples/openapi3/client/petstore/python-experimental/.travis.yml b/samples/openapi3/client/petstore/python-experimental/.travis.yml index 3aa7c047e1e2..f931f0f74b96 100644 --- a/samples/openapi3/client/petstore/python-experimental/.travis.yml +++ b/samples/openapi3/client/petstore/python-experimental/.travis.yml @@ -1,9 +1,6 @@ # ref: https://docs.travis-ci.com/user/languages/python language: python python: - - "3.2" - - "3.3" - - "3.4" - "3.5" - "3.6" - "3.7" diff --git a/samples/openapi3/client/petstore/python-experimental/README.md b/samples/openapi3/client/petstore/python-experimental/README.md index 291496d24951..3a6d461eaa73 100644 --- a/samples/openapi3/client/petstore/python-experimental/README.md +++ b/samples/openapi3/client/petstore/python-experimental/README.md @@ -9,7 +9,7 @@ This Python package is automatically generated by the [OpenAPI Generator](https: ## Requirements. -Python 3.4+ +Python >= 3.5 ## Installation & Usage ### pip install diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api_client.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api_client.py index e31d5c5e4ac7..543569a3afd2 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api_client.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api_client.py @@ -13,8 +13,10 @@ import atexit import mimetypes from multiprocessing.pool import ThreadPool +import io import os import re +import typing from urllib.parse import quote @@ -59,9 +61,6 @@ class ApiClient(object): to the API. More threads means more concurrent API requests. """ - PRIMITIVE_TYPES = ( - float, bool, bytes, str, int - ) _pool = None def __init__(self, configuration=None, header_name=None, header_value=None, @@ -116,12 +115,24 @@ def set_default_header(self, header_name, header_value): self.default_headers[header_name] = header_value def __call_api( - self, resource_path, method, path_params=None, - query_params=None, header_params=None, body=None, post_params=None, - files=None, response_type=None, auth_settings=None, - _return_http_data_only=None, collection_formats=None, - _preload_content=True, _request_timeout=None, _host=None, - _check_type=None): + self, + resource_path: str, + method: str, + path_params: typing.Optional[typing.Dict[str, typing.Any]] = None, + query_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None, + header_params: typing.Optional[typing.Dict[str, typing.Any]] = None, + body: typing.Optional[typing.Any] = None, + post_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None, + files: typing.Optional[typing.Dict[str, typing.List[io.IOBase]]] = None, + response_type: typing.Optional[typing.Tuple[typing.Any]] = None, + auth_settings: typing.Optional[typing.List[str]] = None, + _return_http_data_only: typing.Optional[bool] = None, + collection_formats: typing.Optional[typing.Dict[str, str]] = None, + _preload_content: bool = True, + _request_timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + _host: typing.Optional[str] = None, + _check_type: typing.Optional[bool] = None + ): config = self.configuration @@ -220,9 +231,9 @@ def __call_api( return (return_data, response_data.status, response_data.getheaders()) - def sanitize_for_serialization(self, obj): + @classmethod + def sanitize_for_serialization(cls, obj): """Builds a JSON POST object. - If obj is None, return None. If obj is str, int, long, float, bool, return directly. If obj is datetime.datetime, datetime.date @@ -230,35 +241,24 @@ def sanitize_for_serialization(self, obj): If obj is list, sanitize each element in the list. If obj is dict, return the dict. If obj is OpenAPI model, return the properties dict. - :param obj: The data to serialize. :return: The serialized form of data. """ - if obj is None: - return None - elif isinstance(obj, self.PRIMITIVE_TYPES): + if isinstance(obj, (ModelNormal, ModelComposed)): + return { + key: cls.sanitize_for_serialization(val) for key, val in model_to_dict(obj, serialize=True).items() + } + elif isinstance(obj, (str, int, float, none_type, bool)): return obj - elif isinstance(obj, list): - return [self.sanitize_for_serialization(sub_obj) - for sub_obj in obj] - elif isinstance(obj, tuple): - return tuple(self.sanitize_for_serialization(sub_obj) - for sub_obj in obj) elif isinstance(obj, (datetime, date)): return obj.isoformat() - - if isinstance(obj, dict): - obj_dict = obj - elif isinstance(obj, ModelNormal) or isinstance(obj, ModelComposed): - # Convert model obj to dict - # Convert attribute name to json key in - # model definition for request - obj_dict = model_to_dict(obj, serialize=True) elif isinstance(obj, ModelSimple): - return self.sanitize_for_serialization(obj.value) - - return {key: self.sanitize_for_serialization(val) - for key, val in obj_dict.items()} + return cls.sanitize_for_serialization(obj.value) + elif isinstance(obj, (list, tuple)): + return [cls.sanitize_for_serialization(item) for item in obj] + if isinstance(obj, dict): + return {key: cls.sanitize_for_serialization(val) for key, val in obj.items()} + raise ApiValueError('Unable to prepare type {} for serialization'.format(obj.__class__.__name__)) def deserialize(self, response, response_type, _check_type): """Deserializes response into an object. @@ -305,13 +305,26 @@ def deserialize(self, response, response_type, _check_type): ) return deserialized_data - def call_api(self, resource_path, method, - path_params=None, query_params=None, header_params=None, - body=None, post_params=None, files=None, - response_type=None, auth_settings=None, async_req=None, - _return_http_data_only=None, collection_formats=None, - _preload_content=True, _request_timeout=None, _host=None, - _check_type=None): + def call_api( + self, + resource_path: str, + method: str, + path_params: typing.Optional[typing.Dict[str, typing.Any]] = None, + query_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None, + header_params: typing.Optional[typing.Dict[str, typing.Any]] = None, + body: typing.Optional[typing.Any] = None, + post_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None, + files: typing.Optional[typing.Dict[str, typing.List[io.IOBase]]] = None, + response_type: typing.Optional[typing.Tuple[typing.Any]] = None, + auth_settings: typing.Optional[typing.List[str]] = None, + async_req: typing.Optional[bool] = None, + _return_http_data_only: typing.Optional[bool] = None, + collection_formats: typing.Optional[typing.Dict[str, str]] = None, + _preload_content: bool = True, + _request_timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + _host: typing.Optional[str] = None, + _check_type: typing.Optional[bool] = None + ): """Makes the HTTP request (synchronous) and returns deserialized data. To make an async_req request, set the async_req parameter. @@ -478,7 +491,7 @@ def parameters_to_tuples(self, params, collection_formats): new_params.append((k, v)) return new_params - def files_parameters(self, files=None): + def files_parameters(self, files: typing.Optional[typing.Dict[str, typing.List[io.IOBase]]] = None): """Builds form parameters. :param files: None or a dict with key=param_name and @@ -554,7 +567,7 @@ def update_params_for_auth(self, headers, querys, auth_settings, :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 sanitize_for_serialization(). + The object type is the return value of _encoder.default(). """ if not auth_settings: return diff --git a/samples/openapi3/client/petstore/python-experimental/setup.py b/samples/openapi3/client/petstore/python-experimental/setup.py index 2aa2823003dd..71641535bf53 100644 --- a/samples/openapi3/client/petstore/python-experimental/setup.py +++ b/samples/openapi3/client/petstore/python-experimental/setup.py @@ -38,7 +38,7 @@ author_email="team@openapitools.org", url="", keywords=["OpenAPI", "OpenAPI-Generator", "OpenAPI Petstore"], - python_requires=">=3.3", + python_requires=">=3.5", install_requires=REQUIRES, packages=find_packages(exclude=["test", "tests"]), include_package_data=True, From adc3fef247da638ef87132d17d83ef3570c704f0 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Wed, 29 Jul 2020 09:56:11 +0800 Subject: [PATCH 084/129] improve travis in R client (#7063) --- bin/configs/{r-R.yaml => r-client.yaml} | 0 modules/openapi-generator/src/main/resources/r/.travis.yml | 2 ++ samples/client/petstore/R/.travis.yml | 2 ++ 3 files changed, 4 insertions(+) rename bin/configs/{r-R.yaml => r-client.yaml} (100%) diff --git a/bin/configs/r-R.yaml b/bin/configs/r-client.yaml similarity index 100% rename from bin/configs/r-R.yaml rename to bin/configs/r-client.yaml diff --git a/modules/openapi-generator/src/main/resources/r/.travis.yml b/modules/openapi-generator/src/main/resources/r/.travis.yml index c38097b84e9a..543bf1463d3a 100644 --- a/modules/openapi-generator/src/main/resources/r/.travis.yml +++ b/modules/openapi-generator/src/main/resources/r/.travis.yml @@ -13,3 +13,5 @@ script: - R CMD build . - R CMD check *tar.gz - R CMD INSTALL *tar.gz +after_failure: +- cat ${TRAVIS_BUILD_DIR}/namsor.Rcheck/tests/testthat.Rout.fail diff --git a/samples/client/petstore/R/.travis.yml b/samples/client/petstore/R/.travis.yml index c38097b84e9a..543bf1463d3a 100644 --- a/samples/client/petstore/R/.travis.yml +++ b/samples/client/petstore/R/.travis.yml @@ -13,3 +13,5 @@ script: - R CMD build . - R CMD check *tar.gz - R CMD INSTALL *tar.gz +after_failure: +- cat ${TRAVIS_BUILD_DIR}/namsor.Rcheck/tests/testthat.Rout.fail From fdc0b5b0e20c828a2757498730d3111da27d4581 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Wed, 29 Jul 2020 15:07:51 +0800 Subject: [PATCH 085/129] [PHP] Fix sending array of files with multipart/form-data in PHP template (#7067) * Fix sending array of files with multipart/form-data in PHP template * update php samples Co-authored-by: Aleh Tanasiuk --- .../src/main/resources/php/api.mustache | 20 +- .../lib/Api/AnotherFakeApi.php | 11 +- .../OpenAPIClient-php/lib/Api/DefaultApi.php | 11 +- .../php/OpenAPIClient-php/lib/Api/FakeApi.php | 174 ++++++++++++------ .../lib/Api/FakeClassnameTags123Api.php | 11 +- .../php/OpenAPIClient-php/lib/Api/PetApi.php | 117 ++++++++---- .../OpenAPIClient-php/lib/Api/StoreApi.php | 44 +++-- .../php/OpenAPIClient-php/lib/Api/UserApi.php | 88 +++++---- 8 files changed, 312 insertions(+), 164 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/php/api.mustache b/modules/openapi-generator/src/main/resources/php/api.mustache index 1f83befded22..9ec54edeb0d4 100644 --- a/modules/openapi-generator/src/main/resources/php/api.mustache +++ b/modules/openapi-generator/src/main/resources/php/api.mustache @@ -533,7 +533,14 @@ use {{invokerPackage}}\ObjectSerializer; if (${{paramName}} !== null) { {{#isFile}} $multipart = true; - $formParams['{{baseName}}'] = \GuzzleHttp\Psr7\try_fopen(ObjectSerializer::toFormValue(${{paramName}}), 'rb'); + $formParams['{{baseName}}'] = []; + $paramFiles = is_array(${{paramName}}) ? ${{paramName}} : [${{paramName}}]; + foreach ($paramFiles as $paramFile) { + $formParams['{{baseName}}'][] = \GuzzleHttp\Psr7\try_fopen( + ObjectSerializer::toFormValue($paramFile), + 'rb' + ); + } {{/isFile}} {{^isFile}} $formParams['{{baseName}}'] = ObjectSerializer::toFormValue(${{paramName}}); @@ -571,10 +578,13 @@ use {{invokerPackage}}\ObjectSerializer; if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/AnotherFakeApi.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/AnotherFakeApi.php index ecceb4cdc12a..dd8f5426398c 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/AnotherFakeApi.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/AnotherFakeApi.php @@ -345,10 +345,13 @@ protected function call123TestSpecialTagsRequest($client) if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/DefaultApi.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/DefaultApi.php index 04841a98d9d9..033120cc5573 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/DefaultApi.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/DefaultApi.php @@ -327,10 +327,13 @@ protected function fooGetRequest() if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php index 5c6d9819d6d9..026ce251fcec 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php @@ -331,10 +331,13 @@ protected function fakeHealthGetRequest() if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -576,10 +579,13 @@ protected function fakeHttpSignatureTestRequest($pet, $query_1 = null, $header_1 if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -834,10 +840,13 @@ protected function fakeOuterBooleanSerializeRequest($body = null) if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -1092,10 +1101,13 @@ protected function fakeOuterCompositeSerializeRequest($outer_composite = null) if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -1350,10 +1362,13 @@ protected function fakeOuterNumberSerializeRequest($body = null) if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -1608,10 +1623,13 @@ protected function fakeOuterStringSerializeRequest($body = null) if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -1824,10 +1842,13 @@ protected function testBodyWithFileSchemaRequest($file_schema_test_class) if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -2062,10 +2083,13 @@ protected function testBodyWithQueryParamsRequest($query, $user) if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -2330,10 +2354,13 @@ protected function testClientModelRequest($client) if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -2690,7 +2717,14 @@ protected function testEndpointParametersRequest($number, $double, $pattern_with // form params if ($binary !== null) { $multipart = true; - $formParams['binary'] = \GuzzleHttp\Psr7\try_fopen(ObjectSerializer::toFormValue($binary), 'rb'); + $formParams['binary'] = []; + $paramFiles = is_array($binary) ? $binary : [$binary]; + foreach ($paramFiles as $paramFile) { + $formParams['binary'][] = \GuzzleHttp\Psr7\try_fopen( + ObjectSerializer::toFormValue($paramFile), + 'rb' + ); + } } // form params if ($date !== null) { @@ -2734,10 +2768,13 @@ protected function testEndpointParametersRequest($number, $double, $pattern_with if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -3047,10 +3084,13 @@ protected function testEnumParametersRequest($enum_header_string_array = null, $ if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -3371,10 +3411,13 @@ protected function testGroupParametersRequest($associative_array) if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -3595,10 +3638,13 @@ protected function testInlineAdditionalPropertiesRequest($request_body) if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -3831,10 +3877,13 @@ protected function testJsonFormDataRequest($param, $param2) if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -4131,10 +4180,13 @@ protected function testQueryParameterCollectionFormatRequest($pipe, $ioutil, $ht if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeClassnameTags123Api.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeClassnameTags123Api.php index cc37aa252bce..a17dc5fd6729 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeClassnameTags123Api.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeClassnameTags123Api.php @@ -345,10 +345,13 @@ protected function testClassnameRequest($client) if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php index de4bc86849f6..6d8554cce908 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php @@ -317,10 +317,13 @@ protected function addPetRequest($pet) if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -561,10 +564,13 @@ protected function deletePetRequest($pet_id, $api_key = null) if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -837,10 +843,13 @@ protected function findPetsByStatusRequest($status) if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -1113,10 +1122,13 @@ protected function findPetsByTagsRequest($tags) if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -1390,10 +1402,13 @@ protected function getPetByIdRequest($pet_id) if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -1635,10 +1650,13 @@ protected function updatePetRequest($pet) if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -1888,10 +1906,13 @@ protected function updatePetWithFormRequest($pet_id, $name = null, $status = nul if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -2156,7 +2177,14 @@ protected function uploadFileRequest($pet_id, $additional_metadata = null, $file // form params if ($file !== null) { $multipart = true; - $formParams['file'] = \GuzzleHttp\Psr7\try_fopen(ObjectSerializer::toFormValue($file), 'rb'); + $formParams['file'] = []; + $paramFiles = is_array($file) ? $file : [$file]; + foreach ($paramFiles as $paramFile) { + $formParams['file'][] = \GuzzleHttp\Psr7\try_fopen( + ObjectSerializer::toFormValue($paramFile), + 'rb' + ); + } } // body params $_tempBody = null; @@ -2184,10 +2212,13 @@ protected function uploadFileRequest($pet_id, $additional_metadata = null, $file if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -2458,7 +2489,14 @@ protected function uploadFileWithRequiredFileRequest($pet_id, $required_file, $a // form params if ($required_file !== null) { $multipart = true; - $formParams['requiredFile'] = \GuzzleHttp\Psr7\try_fopen(ObjectSerializer::toFormValue($required_file), 'rb'); + $formParams['requiredFile'] = []; + $paramFiles = is_array($required_file) ? $required_file : [$required_file]; + foreach ($paramFiles as $paramFile) { + $formParams['requiredFile'][] = \GuzzleHttp\Psr7\try_fopen( + ObjectSerializer::toFormValue($paramFile), + 'rb' + ); + } } // body params $_tempBody = null; @@ -2486,10 +2524,13 @@ protected function uploadFileWithRequiredFileRequest($pet_id, $required_file, $a if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/StoreApi.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/StoreApi.php index 92a019106984..d05718f74946 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/StoreApi.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/StoreApi.php @@ -302,10 +302,13 @@ protected function deleteOrderRequest($order_id) if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -556,10 +559,13 @@ protected function getInventoryRequest() if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -841,10 +847,13 @@ protected function getOrderByIdRequest($order_id) if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -1109,10 +1118,13 @@ protected function placeOrderRequest($order) if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/UserApi.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/UserApi.php index 9c5ff0a76102..a9fede94b862 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/UserApi.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/UserApi.php @@ -297,10 +297,13 @@ protected function createUserRequest($user) if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -517,10 +520,13 @@ protected function createUsersWithArrayInputRequest($user) if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -737,10 +743,13 @@ protected function createUsersWithListInputRequest($user) if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -962,10 +971,13 @@ protected function deleteUserRequest($username) if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -1235,10 +1247,13 @@ protected function getUserByNameRequest($username) if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -1533,10 +1548,13 @@ protected function loginUserRequest($username, $password) if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -1739,10 +1757,13 @@ protected function logoutUserRequest() if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -1978,10 +1999,13 @@ protected function updateUserRequest($username, $user) if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); From 0c173fb5195e7ea0d0809f2e7bab6f8bbe0d80f7 Mon Sep 17 00:00:00 2001 From: Marcus Berndt Date: Wed, 29 Jul 2020 09:35:30 +0200 Subject: [PATCH 086/129] typescript-axios: add Set as language primitive (#6931) * fix(typescript-axios): add Set as language primitive * fix(typemapping): added lowercased set as primitive type * fix(samples): regenerated ts samples and added Set as language primitive to ts docs --- docs/generators/typescript-angular.md | 1 + docs/generators/typescript-angularjs-deprecated.md | 1 + docs/generators/typescript-angularjs.md | 1 + docs/generators/typescript-aurelia.md | 1 + docs/generators/typescript-axios.md | 1 + docs/generators/typescript-fetch.md | 1 + docs/generators/typescript-inversify.md | 1 + docs/generators/typescript-jquery.md | 1 + docs/generators/typescript-node.md | 1 + docs/generators/typescript-redux-query.md | 1 + docs/generators/typescript-rxjs.md | 1 + docs/generators/typescript.md | 1 + .../languages/AbstractTypeScriptClientCodegen.java | 5 ++++- .../builds/default/.openapi-generator/FILES | 12 ++++++------ .../builds/with-npm/.openapi-generator/FILES | 12 ++++++------ .../builds/default/.openapi-generator/FILES | 12 ++++++------ .../builds/with-npm/.openapi-generator/FILES | 12 ++++++------ .../builds/default/.openapi-generator/FILES | 12 ++++++------ .../builds/with-npm/.openapi-generator/FILES | 12 ++++++------ .../builds/default/.openapi-generator/FILES | 12 ++++++------ .../builds/with-npm/.openapi-generator/FILES | 12 ++++++------ .../.openapi-generator/FILES | 12 ++++++------ .../builds/with-npm/.openapi-generator/FILES | 12 ++++++------ .../.openapi-generator/FILES | 12 ++++++------ .../typescript-node/default/.openapi-generator/FILES | 12 ++++++------ .../typescript-node/npm/.openapi-generator/FILES | 12 ++++++------ 26 files changed, 94 insertions(+), 79 deletions(-) diff --git a/docs/generators/typescript-angular.md b/docs/generators/typescript-angular.md index 9af8d25825ec..97588cff63fc 100644 --- a/docs/generators/typescript-angular.md +++ b/docs/generators/typescript-angular.md @@ -65,6 +65,7 @@ sidebar_label: typescript-angular
  • Object
  • ReadonlyArray
  • String
  • +
  • Set
  • any
  • boolean
  • number
  • diff --git a/docs/generators/typescript-angularjs-deprecated.md b/docs/generators/typescript-angularjs-deprecated.md index 3bf8dbc394f6..4562623a5107 100644 --- a/docs/generators/typescript-angularjs-deprecated.md +++ b/docs/generators/typescript-angularjs-deprecated.md @@ -47,6 +47,7 @@ sidebar_label: typescript-angularjs-deprecated
  • Object
  • ReadonlyArray
  • String
  • +
  • Set
  • any
  • boolean
  • number
  • diff --git a/docs/generators/typescript-angularjs.md b/docs/generators/typescript-angularjs.md index 1e6de0a46d03..f34182d78e61 100644 --- a/docs/generators/typescript-angularjs.md +++ b/docs/generators/typescript-angularjs.md @@ -47,6 +47,7 @@ sidebar_label: typescript-angularjs
  • Object
  • ReadonlyArray
  • String
  • +
  • Set
  • any
  • boolean
  • number
  • diff --git a/docs/generators/typescript-aurelia.md b/docs/generators/typescript-aurelia.md index 6bf94c6acfbc..210df33dde70 100644 --- a/docs/generators/typescript-aurelia.md +++ b/docs/generators/typescript-aurelia.md @@ -50,6 +50,7 @@ sidebar_label: typescript-aurelia
  • Object
  • ReadonlyArray
  • String
  • +
  • Set
  • any
  • boolean
  • number
  • diff --git a/docs/generators/typescript-axios.md b/docs/generators/typescript-axios.md index 7036e91d117c..d45e7d5db391 100644 --- a/docs/generators/typescript-axios.md +++ b/docs/generators/typescript-axios.md @@ -55,6 +55,7 @@ sidebar_label: typescript-axios
  • Object
  • ReadonlyArray
  • String
  • +
  • Set
  • any
  • boolean
  • number
  • diff --git a/docs/generators/typescript-fetch.md b/docs/generators/typescript-fetch.md index 5b20ae554619..1345718927d8 100644 --- a/docs/generators/typescript-fetch.md +++ b/docs/generators/typescript-fetch.md @@ -55,6 +55,7 @@ sidebar_label: typescript-fetch
  • Object
  • ReadonlyArray
  • String
  • +
  • Set
  • any
  • boolean
  • number
  • diff --git a/docs/generators/typescript-inversify.md b/docs/generators/typescript-inversify.md index 4707989205f7..ceff69cfc52c 100644 --- a/docs/generators/typescript-inversify.md +++ b/docs/generators/typescript-inversify.md @@ -56,6 +56,7 @@ sidebar_label: typescript-inversify
  • Object
  • ReadonlyArray
  • String
  • +
  • Set
  • any
  • boolean
  • number
  • diff --git a/docs/generators/typescript-jquery.md b/docs/generators/typescript-jquery.md index ecb243d4b6d2..51aa7eaadad3 100644 --- a/docs/generators/typescript-jquery.md +++ b/docs/generators/typescript-jquery.md @@ -52,6 +52,7 @@ sidebar_label: typescript-jquery
  • Object
  • ReadonlyArray
  • String
  • +
  • Set
  • any
  • boolean
  • number
  • diff --git a/docs/generators/typescript-node.md b/docs/generators/typescript-node.md index cf72f020c45d..a460647e0661 100644 --- a/docs/generators/typescript-node.md +++ b/docs/generators/typescript-node.md @@ -55,6 +55,7 @@ sidebar_label: typescript-node
  • RequestDetailedFile
  • RequestFile
  • String
  • +
  • Set
  • any
  • boolean
  • number
  • diff --git a/docs/generators/typescript-redux-query.md b/docs/generators/typescript-redux-query.md index 8d8e54e0c8e1..67900a2fb845 100644 --- a/docs/generators/typescript-redux-query.md +++ b/docs/generators/typescript-redux-query.md @@ -53,6 +53,7 @@ sidebar_label: typescript-redux-query
  • Object
  • ReadonlyArray
  • String
  • +
  • Set
  • any
  • boolean
  • number
  • diff --git a/docs/generators/typescript-rxjs.md b/docs/generators/typescript-rxjs.md index 82ff8d19cecf..b1501cbeaf7b 100644 --- a/docs/generators/typescript-rxjs.md +++ b/docs/generators/typescript-rxjs.md @@ -53,6 +53,7 @@ sidebar_label: typescript-rxjs
  • Object
  • ReadonlyArray
  • String
  • +
  • Set
  • any
  • boolean
  • number
  • diff --git a/docs/generators/typescript.md b/docs/generators/typescript.md index db106fdb773d..ce2c34628d51 100644 --- a/docs/generators/typescript.md +++ b/docs/generators/typescript.md @@ -53,6 +53,7 @@ sidebar_label: typescript
  • Map
  • Object
  • String
  • +
  • Set
  • any
  • boolean
  • number
  • diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractTypeScriptClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractTypeScriptClientCodegen.java index c4a34d2ca32e..bbc8e459fe3a 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractTypeScriptClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractTypeScriptClientCodegen.java @@ -130,7 +130,8 @@ public AbstractTypeScriptClientCodegen() { "File", "Error", "Map", - "object" + "object", + "Set" )); languageGenericTypes = new HashSet<>(Collections.singletonList( @@ -140,6 +141,8 @@ public AbstractTypeScriptClientCodegen() { instantiationTypes.put("array", "Array"); typeMapping = new HashMap(); + typeMapping.put("Set", "Set"); + typeMapping.put("set", "Set"); typeMapping.put("Array", "Array"); typeMapping.put("array", "Array"); typeMapping.put("boolean", "boolean"); diff --git a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/.openapi-generator/FILES b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/.openapi-generator/FILES index bc66e2a3865f..7f11560dda7f 100644 --- a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/.openapi-generator/FILES +++ b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/.openapi-generator/FILES @@ -9,11 +9,11 @@ configuration.ts encoder.ts git_push.sh index.ts -model/./apiResponse.ts -model/./category.ts -model/./order.ts -model/./pet.ts -model/./tag.ts -model/./user.ts +model/apiResponse.ts +model/category.ts +model/order.ts +model/pet.ts +model/tag.ts +model/user.ts model/models.ts variables.ts diff --git a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/.openapi-generator/FILES b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/.openapi-generator/FILES index a2650d9db088..d85eeefc6f26 100644 --- a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/.openapi-generator/FILES +++ b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/.openapi-generator/FILES @@ -9,12 +9,12 @@ configuration.ts encoder.ts git_push.sh index.ts -model/./apiResponse.ts -model/./category.ts -model/./order.ts -model/./pet.ts -model/./tag.ts -model/./user.ts +model/apiResponse.ts +model/category.ts +model/order.ts +model/pet.ts +model/tag.ts +model/user.ts model/models.ts ng-package.json package.json diff --git a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/.openapi-generator/FILES b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/.openapi-generator/FILES index bc66e2a3865f..7f11560dda7f 100644 --- a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/.openapi-generator/FILES +++ b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/.openapi-generator/FILES @@ -9,11 +9,11 @@ configuration.ts encoder.ts git_push.sh index.ts -model/./apiResponse.ts -model/./category.ts -model/./order.ts -model/./pet.ts -model/./tag.ts -model/./user.ts +model/apiResponse.ts +model/category.ts +model/order.ts +model/pet.ts +model/tag.ts +model/user.ts model/models.ts variables.ts diff --git a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/.openapi-generator/FILES b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/.openapi-generator/FILES index a2650d9db088..d85eeefc6f26 100644 --- a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/.openapi-generator/FILES +++ b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/.openapi-generator/FILES @@ -9,12 +9,12 @@ configuration.ts encoder.ts git_push.sh index.ts -model/./apiResponse.ts -model/./category.ts -model/./order.ts -model/./pet.ts -model/./tag.ts -model/./user.ts +model/apiResponse.ts +model/category.ts +model/order.ts +model/pet.ts +model/tag.ts +model/user.ts model/models.ts ng-package.json package.json diff --git a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/.openapi-generator/FILES b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/.openapi-generator/FILES index bc66e2a3865f..7f11560dda7f 100644 --- a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/.openapi-generator/FILES +++ b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/.openapi-generator/FILES @@ -9,11 +9,11 @@ configuration.ts encoder.ts git_push.sh index.ts -model/./apiResponse.ts -model/./category.ts -model/./order.ts -model/./pet.ts -model/./tag.ts -model/./user.ts +model/apiResponse.ts +model/category.ts +model/order.ts +model/pet.ts +model/tag.ts +model/user.ts model/models.ts variables.ts diff --git a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/.openapi-generator/FILES b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/.openapi-generator/FILES index a2650d9db088..d85eeefc6f26 100644 --- a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/.openapi-generator/FILES +++ b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/.openapi-generator/FILES @@ -9,12 +9,12 @@ configuration.ts encoder.ts git_push.sh index.ts -model/./apiResponse.ts -model/./category.ts -model/./order.ts -model/./pet.ts -model/./tag.ts -model/./user.ts +model/apiResponse.ts +model/category.ts +model/order.ts +model/pet.ts +model/tag.ts +model/user.ts model/models.ts ng-package.json package.json diff --git a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/.openapi-generator/FILES b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/.openapi-generator/FILES index bc66e2a3865f..7f11560dda7f 100644 --- a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/.openapi-generator/FILES +++ b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/.openapi-generator/FILES @@ -9,11 +9,11 @@ configuration.ts encoder.ts git_push.sh index.ts -model/./apiResponse.ts -model/./category.ts -model/./order.ts -model/./pet.ts -model/./tag.ts -model/./user.ts +model/apiResponse.ts +model/category.ts +model/order.ts +model/pet.ts +model/tag.ts +model/user.ts model/models.ts variables.ts diff --git a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/.openapi-generator/FILES b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/.openapi-generator/FILES index a2650d9db088..d85eeefc6f26 100644 --- a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/.openapi-generator/FILES +++ b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/.openapi-generator/FILES @@ -9,12 +9,12 @@ configuration.ts encoder.ts git_push.sh index.ts -model/./apiResponse.ts -model/./category.ts -model/./order.ts -model/./pet.ts -model/./tag.ts -model/./user.ts +model/apiResponse.ts +model/category.ts +model/order.ts +model/pet.ts +model/tag.ts +model/user.ts model/models.ts ng-package.json package.json diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/.openapi-generator/FILES b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/.openapi-generator/FILES index a2650d9db088..d85eeefc6f26 100644 --- a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/.openapi-generator/FILES +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/.openapi-generator/FILES @@ -9,12 +9,12 @@ configuration.ts encoder.ts git_push.sh index.ts -model/./apiResponse.ts -model/./category.ts -model/./order.ts -model/./pet.ts -model/./tag.ts -model/./user.ts +model/apiResponse.ts +model/category.ts +model/order.ts +model/pet.ts +model/tag.ts +model/user.ts model/models.ts ng-package.json package.json diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/.openapi-generator/FILES b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/.openapi-generator/FILES index a2650d9db088..d85eeefc6f26 100644 --- a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/.openapi-generator/FILES +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/.openapi-generator/FILES @@ -9,12 +9,12 @@ configuration.ts encoder.ts git_push.sh index.ts -model/./apiResponse.ts -model/./category.ts -model/./order.ts -model/./pet.ts -model/./tag.ts -model/./user.ts +model/apiResponse.ts +model/category.ts +model/order.ts +model/pet.ts +model/tag.ts +model/user.ts model/models.ts ng-package.json package.json diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/.openapi-generator/FILES b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/.openapi-generator/FILES index a2650d9db088..d85eeefc6f26 100644 --- a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/.openapi-generator/FILES +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/.openapi-generator/FILES @@ -9,12 +9,12 @@ configuration.ts encoder.ts git_push.sh index.ts -model/./apiResponse.ts -model/./category.ts -model/./order.ts -model/./pet.ts -model/./tag.ts -model/./user.ts +model/apiResponse.ts +model/category.ts +model/order.ts +model/pet.ts +model/tag.ts +model/user.ts model/models.ts ng-package.json package.json diff --git a/samples/client/petstore/typescript-node/default/.openapi-generator/FILES b/samples/client/petstore/typescript-node/default/.openapi-generator/FILES index c4f1df469e4b..ff52c7c5b2b8 100644 --- a/samples/client/petstore/typescript-node/default/.openapi-generator/FILES +++ b/samples/client/petstore/typescript-node/default/.openapi-generator/FILES @@ -5,10 +5,10 @@ api/petApi.ts api/storeApi.ts api/userApi.ts git_push.sh -model/./apiResponse.ts -model/./category.ts -model/./order.ts -model/./pet.ts -model/./tag.ts -model/./user.ts +model/apiResponse.ts +model/category.ts +model/order.ts +model/pet.ts +model/tag.ts +model/user.ts model/models.ts diff --git a/samples/client/petstore/typescript-node/npm/.openapi-generator/FILES b/samples/client/petstore/typescript-node/npm/.openapi-generator/FILES index 914f5ced854a..d24a1934784b 100644 --- a/samples/client/petstore/typescript-node/npm/.openapi-generator/FILES +++ b/samples/client/petstore/typescript-node/npm/.openapi-generator/FILES @@ -5,12 +5,12 @@ api/petApi.ts api/storeApi.ts api/userApi.ts git_push.sh -model/./apiResponse.ts -model/./category.ts -model/./order.ts -model/./pet.ts -model/./tag.ts -model/./user.ts +model/apiResponse.ts +model/category.ts +model/order.ts +model/pet.ts +model/tag.ts +model/user.ts model/models.ts package.json tsconfig.json From 789b158cd4ff3b994b895c557c0da6f44735bec2 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Wed, 29 Jul 2020 15:41:19 +0800 Subject: [PATCH 087/129] Add "Allow edits from maintainers" tips to the doc (#7068) Add "Allow edits from maintainers" tips to the doc --- CONTRIBUTING.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f84bf3a3e60d..f4daf0ea070e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -110,7 +110,8 @@ See [OpenAPI Tools wiki](https://github.com/OpenAPITools/openapi-generator/wiki/ - Add test case(s) to cover the change - Document the fix in the code to make the code more readable - Make sure test cases passed after the change (one way is to leverage https://travis-ci.org/ to run the CI tests) -- File a PR with meaningful title, description and commit messages. +- File a PR with meaningful title, description and commit messages +- Make sure the option "Allow edits from maintainers" in the PR is selected so that the maintainers can update your PRs with minor fixes, if needed. - Recommended git settings - `git config core.autocrlf input` to tell Git convert CRLF to LF on commit but not the other way around - To close an issue (e.g. issue 1542) automatically after a PR is merged, use keywords "fix", "close", "resolve" in the PR description, e.g. `fix #1542`. (Ref: [closing issues using keywords](https://help.github.com/articles/closing-issues-using-keywords/)) From f64a4d1a4f6cce575d358bf428a22c5c257b3770 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Wed, 29 Jul 2020 15:44:28 +0800 Subject: [PATCH 088/129] update samples --- .../builds/default/.openapi-generator/FILES | 12 ++++++------ .../builds/with-npm/.openapi-generator/FILES | 12 ++++++------ .../builds/default/.openapi-generator/FILES | 12 ++++++------ .../builds/with-npm/.openapi-generator/FILES | 12 ++++++------ .../builds/default/.openapi-generator/FILES | 12 ++++++------ .../builds/with-npm/.openapi-generator/FILES | 12 ++++++------ .../builds/default/.openapi-generator/FILES | 12 ++++++------ .../builds/with-npm/.openapi-generator/FILES | 12 ++++++------ .../.openapi-generator/FILES | 12 ++++++------ .../builds/with-npm/.openapi-generator/FILES | 12 ++++++------ .../.openapi-generator/FILES | 12 ++++++------ .../typescript-node/default/.openapi-generator/FILES | 12 ++++++------ .../typescript-node/npm/.openapi-generator/FILES | 12 ++++++------ 13 files changed, 78 insertions(+), 78 deletions(-) diff --git a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/.openapi-generator/FILES b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/.openapi-generator/FILES index 7f11560dda7f..bc66e2a3865f 100644 --- a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/.openapi-generator/FILES +++ b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/.openapi-generator/FILES @@ -9,11 +9,11 @@ configuration.ts encoder.ts git_push.sh index.ts -model/apiResponse.ts -model/category.ts -model/order.ts -model/pet.ts -model/tag.ts -model/user.ts +model/./apiResponse.ts +model/./category.ts +model/./order.ts +model/./pet.ts +model/./tag.ts +model/./user.ts model/models.ts variables.ts diff --git a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/.openapi-generator/FILES b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/.openapi-generator/FILES index d85eeefc6f26..a2650d9db088 100644 --- a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/.openapi-generator/FILES +++ b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/.openapi-generator/FILES @@ -9,12 +9,12 @@ configuration.ts encoder.ts git_push.sh index.ts -model/apiResponse.ts -model/category.ts -model/order.ts -model/pet.ts -model/tag.ts -model/user.ts +model/./apiResponse.ts +model/./category.ts +model/./order.ts +model/./pet.ts +model/./tag.ts +model/./user.ts model/models.ts ng-package.json package.json diff --git a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/.openapi-generator/FILES b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/.openapi-generator/FILES index 7f11560dda7f..bc66e2a3865f 100644 --- a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/.openapi-generator/FILES +++ b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/.openapi-generator/FILES @@ -9,11 +9,11 @@ configuration.ts encoder.ts git_push.sh index.ts -model/apiResponse.ts -model/category.ts -model/order.ts -model/pet.ts -model/tag.ts -model/user.ts +model/./apiResponse.ts +model/./category.ts +model/./order.ts +model/./pet.ts +model/./tag.ts +model/./user.ts model/models.ts variables.ts diff --git a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/.openapi-generator/FILES b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/.openapi-generator/FILES index d85eeefc6f26..a2650d9db088 100644 --- a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/.openapi-generator/FILES +++ b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/.openapi-generator/FILES @@ -9,12 +9,12 @@ configuration.ts encoder.ts git_push.sh index.ts -model/apiResponse.ts -model/category.ts -model/order.ts -model/pet.ts -model/tag.ts -model/user.ts +model/./apiResponse.ts +model/./category.ts +model/./order.ts +model/./pet.ts +model/./tag.ts +model/./user.ts model/models.ts ng-package.json package.json diff --git a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/.openapi-generator/FILES b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/.openapi-generator/FILES index 7f11560dda7f..bc66e2a3865f 100644 --- a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/.openapi-generator/FILES +++ b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/.openapi-generator/FILES @@ -9,11 +9,11 @@ configuration.ts encoder.ts git_push.sh index.ts -model/apiResponse.ts -model/category.ts -model/order.ts -model/pet.ts -model/tag.ts -model/user.ts +model/./apiResponse.ts +model/./category.ts +model/./order.ts +model/./pet.ts +model/./tag.ts +model/./user.ts model/models.ts variables.ts diff --git a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/.openapi-generator/FILES b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/.openapi-generator/FILES index d85eeefc6f26..a2650d9db088 100644 --- a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/.openapi-generator/FILES +++ b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/.openapi-generator/FILES @@ -9,12 +9,12 @@ configuration.ts encoder.ts git_push.sh index.ts -model/apiResponse.ts -model/category.ts -model/order.ts -model/pet.ts -model/tag.ts -model/user.ts +model/./apiResponse.ts +model/./category.ts +model/./order.ts +model/./pet.ts +model/./tag.ts +model/./user.ts model/models.ts ng-package.json package.json diff --git a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/.openapi-generator/FILES b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/.openapi-generator/FILES index 7f11560dda7f..bc66e2a3865f 100644 --- a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/.openapi-generator/FILES +++ b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/.openapi-generator/FILES @@ -9,11 +9,11 @@ configuration.ts encoder.ts git_push.sh index.ts -model/apiResponse.ts -model/category.ts -model/order.ts -model/pet.ts -model/tag.ts -model/user.ts +model/./apiResponse.ts +model/./category.ts +model/./order.ts +model/./pet.ts +model/./tag.ts +model/./user.ts model/models.ts variables.ts diff --git a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/.openapi-generator/FILES b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/.openapi-generator/FILES index d85eeefc6f26..a2650d9db088 100644 --- a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/.openapi-generator/FILES +++ b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/.openapi-generator/FILES @@ -9,12 +9,12 @@ configuration.ts encoder.ts git_push.sh index.ts -model/apiResponse.ts -model/category.ts -model/order.ts -model/pet.ts -model/tag.ts -model/user.ts +model/./apiResponse.ts +model/./category.ts +model/./order.ts +model/./pet.ts +model/./tag.ts +model/./user.ts model/models.ts ng-package.json package.json diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/.openapi-generator/FILES b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/.openapi-generator/FILES index d85eeefc6f26..a2650d9db088 100644 --- a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/.openapi-generator/FILES +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/.openapi-generator/FILES @@ -9,12 +9,12 @@ configuration.ts encoder.ts git_push.sh index.ts -model/apiResponse.ts -model/category.ts -model/order.ts -model/pet.ts -model/tag.ts -model/user.ts +model/./apiResponse.ts +model/./category.ts +model/./order.ts +model/./pet.ts +model/./tag.ts +model/./user.ts model/models.ts ng-package.json package.json diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/.openapi-generator/FILES b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/.openapi-generator/FILES index d85eeefc6f26..a2650d9db088 100644 --- a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/.openapi-generator/FILES +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/.openapi-generator/FILES @@ -9,12 +9,12 @@ configuration.ts encoder.ts git_push.sh index.ts -model/apiResponse.ts -model/category.ts -model/order.ts -model/pet.ts -model/tag.ts -model/user.ts +model/./apiResponse.ts +model/./category.ts +model/./order.ts +model/./pet.ts +model/./tag.ts +model/./user.ts model/models.ts ng-package.json package.json diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/.openapi-generator/FILES b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/.openapi-generator/FILES index d85eeefc6f26..a2650d9db088 100644 --- a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/.openapi-generator/FILES +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/.openapi-generator/FILES @@ -9,12 +9,12 @@ configuration.ts encoder.ts git_push.sh index.ts -model/apiResponse.ts -model/category.ts -model/order.ts -model/pet.ts -model/tag.ts -model/user.ts +model/./apiResponse.ts +model/./category.ts +model/./order.ts +model/./pet.ts +model/./tag.ts +model/./user.ts model/models.ts ng-package.json package.json diff --git a/samples/client/petstore/typescript-node/default/.openapi-generator/FILES b/samples/client/petstore/typescript-node/default/.openapi-generator/FILES index ff52c7c5b2b8..c4f1df469e4b 100644 --- a/samples/client/petstore/typescript-node/default/.openapi-generator/FILES +++ b/samples/client/petstore/typescript-node/default/.openapi-generator/FILES @@ -5,10 +5,10 @@ api/petApi.ts api/storeApi.ts api/userApi.ts git_push.sh -model/apiResponse.ts -model/category.ts -model/order.ts -model/pet.ts -model/tag.ts -model/user.ts +model/./apiResponse.ts +model/./category.ts +model/./order.ts +model/./pet.ts +model/./tag.ts +model/./user.ts model/models.ts diff --git a/samples/client/petstore/typescript-node/npm/.openapi-generator/FILES b/samples/client/petstore/typescript-node/npm/.openapi-generator/FILES index d24a1934784b..914f5ced854a 100644 --- a/samples/client/petstore/typescript-node/npm/.openapi-generator/FILES +++ b/samples/client/petstore/typescript-node/npm/.openapi-generator/FILES @@ -5,12 +5,12 @@ api/petApi.ts api/storeApi.ts api/userApi.ts git_push.sh -model/apiResponse.ts -model/category.ts -model/order.ts -model/pet.ts -model/tag.ts -model/user.ts +model/./apiResponse.ts +model/./category.ts +model/./order.ts +model/./pet.ts +model/./tag.ts +model/./user.ts model/models.ts package.json tsconfig.json From 8a3994e000b1891e41288fe09d41218724e0f507 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Wed, 29 Jul 2020 16:56:08 +0800 Subject: [PATCH 089/129] update doc --- docs/contributing.md | 3 ++- docs/generators/typescript-angular.md | 2 +- docs/generators/typescript-angularjs-deprecated.md | 2 +- docs/generators/typescript-aurelia.md | 2 +- docs/generators/typescript-axios.md | 2 +- docs/generators/typescript-fetch.md | 2 +- docs/generators/typescript-inversify.md | 2 +- docs/generators/typescript-jquery.md | 2 +- docs/generators/typescript-node.md | 2 +- docs/generators/typescript-redux-query.md | 2 +- docs/generators/typescript-rxjs.md | 2 +- docs/generators/typescript.md | 1 - 12 files changed, 12 insertions(+), 12 deletions(-) diff --git a/docs/contributing.md b/docs/contributing.md index 496391bd9dd1..171682dac06e 100644 --- a/docs/contributing.md +++ b/docs/contributing.md @@ -114,7 +114,8 @@ See [OpenAPI Tools wiki](https://github.com/OpenAPITools/openapi-generator/wiki/ - Add test case(s) to cover the change - Document the fix in the code to make the code more readable - Make sure test cases passed after the change (one way is to leverage https://travis-ci.org/ to run the CI tests) -- File a PR with meaningful title, description and commit messages. +- File a PR with meaningful title, description and commit messages +- Make sure the option "Allow edits from maintainers" in the PR is selected so that the maintainers can update your PRs with minor fixes, if needed. - Recommended git settings - `git config core.autocrlf input` to tell Git convert CRLF to LF on commit but not the other way around - To close an issue (e.g. issue 1542) automatically after a PR is merged, use keywords "fix", "close", "resolve" in the PR description, e.g. `fix #1542`. (Ref: [closing issues using keywords](https://help.github.com/articles/closing-issues-using-keywords/)) diff --git a/docs/generators/typescript-angular.md b/docs/generators/typescript-angular.md index 97588cff63fc..64014fe7238e 100644 --- a/docs/generators/typescript-angular.md +++ b/docs/generators/typescript-angular.md @@ -64,8 +64,8 @@ sidebar_label: typescript-angular
  • Map
  • Object
  • ReadonlyArray
  • -
  • String
  • Set
  • +
  • String
  • any
  • boolean
  • number
  • diff --git a/docs/generators/typescript-angularjs-deprecated.md b/docs/generators/typescript-angularjs-deprecated.md index 4562623a5107..ad2c7aea207e 100644 --- a/docs/generators/typescript-angularjs-deprecated.md +++ b/docs/generators/typescript-angularjs-deprecated.md @@ -46,8 +46,8 @@ sidebar_label: typescript-angularjs-deprecated
  • Map
  • Object
  • ReadonlyArray
  • -
  • String
  • Set
  • +
  • String
  • any
  • boolean
  • number
  • diff --git a/docs/generators/typescript-aurelia.md b/docs/generators/typescript-aurelia.md index 210df33dde70..571c512b3672 100644 --- a/docs/generators/typescript-aurelia.md +++ b/docs/generators/typescript-aurelia.md @@ -49,8 +49,8 @@ sidebar_label: typescript-aurelia
  • Map
  • Object
  • ReadonlyArray
  • -
  • String
  • Set
  • +
  • String
  • any
  • boolean
  • number
  • diff --git a/docs/generators/typescript-axios.md b/docs/generators/typescript-axios.md index d45e7d5db391..320764ccf6dd 100644 --- a/docs/generators/typescript-axios.md +++ b/docs/generators/typescript-axios.md @@ -54,8 +54,8 @@ sidebar_label: typescript-axios
  • Map
  • Object
  • ReadonlyArray
  • -
  • String
  • Set
  • +
  • String
  • any
  • boolean
  • number
  • diff --git a/docs/generators/typescript-fetch.md b/docs/generators/typescript-fetch.md index 1345718927d8..a39310fbc28c 100644 --- a/docs/generators/typescript-fetch.md +++ b/docs/generators/typescript-fetch.md @@ -54,8 +54,8 @@ sidebar_label: typescript-fetch
  • Map
  • Object
  • ReadonlyArray
  • -
  • String
  • Set
  • +
  • String
  • any
  • boolean
  • number
  • diff --git a/docs/generators/typescript-inversify.md b/docs/generators/typescript-inversify.md index ceff69cfc52c..68f0508b7336 100644 --- a/docs/generators/typescript-inversify.md +++ b/docs/generators/typescript-inversify.md @@ -55,8 +55,8 @@ sidebar_label: typescript-inversify
  • Map
  • Object
  • ReadonlyArray
  • -
  • String
  • Set
  • +
  • String
  • any
  • boolean
  • number
  • diff --git a/docs/generators/typescript-jquery.md b/docs/generators/typescript-jquery.md index 51aa7eaadad3..db0393ca006c 100644 --- a/docs/generators/typescript-jquery.md +++ b/docs/generators/typescript-jquery.md @@ -51,8 +51,8 @@ sidebar_label: typescript-jquery
  • Map
  • Object
  • ReadonlyArray
  • -
  • String
  • Set
  • +
  • String
  • any
  • boolean
  • number
  • diff --git a/docs/generators/typescript-node.md b/docs/generators/typescript-node.md index a460647e0661..64f6010a3e46 100644 --- a/docs/generators/typescript-node.md +++ b/docs/generators/typescript-node.md @@ -54,8 +54,8 @@ sidebar_label: typescript-node
  • ReadonlyArray
  • RequestDetailedFile
  • RequestFile
  • -
  • String
  • Set
  • +
  • String
  • any
  • boolean
  • number
  • diff --git a/docs/generators/typescript-redux-query.md b/docs/generators/typescript-redux-query.md index 67900a2fb845..01f970e73115 100644 --- a/docs/generators/typescript-redux-query.md +++ b/docs/generators/typescript-redux-query.md @@ -52,8 +52,8 @@ sidebar_label: typescript-redux-query
  • Map
  • Object
  • ReadonlyArray
  • -
  • String
  • Set
  • +
  • String
  • any
  • boolean
  • number
  • diff --git a/docs/generators/typescript-rxjs.md b/docs/generators/typescript-rxjs.md index b1501cbeaf7b..ce2adb8289f4 100644 --- a/docs/generators/typescript-rxjs.md +++ b/docs/generators/typescript-rxjs.md @@ -52,8 +52,8 @@ sidebar_label: typescript-rxjs
  • Map
  • Object
  • ReadonlyArray
  • -
  • String
  • Set
  • +
  • String
  • any
  • boolean
  • number
  • diff --git a/docs/generators/typescript.md b/docs/generators/typescript.md index ce2c34628d51..db106fdb773d 100644 --- a/docs/generators/typescript.md +++ b/docs/generators/typescript.md @@ -53,7 +53,6 @@ sidebar_label: typescript
  • Map
  • Object
  • String
  • -
  • Set
  • any
  • boolean
  • number
  • From 720f864b6493608d6cbdadde653cbaf963eba000 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Wed, 29 Jul 2020 19:01:26 +0800 Subject: [PATCH 090/129] surpress warnings in plantuml generator (#7071) --- .../languages/PlantumlDocumentationCodegen.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PlantumlDocumentationCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PlantumlDocumentationCodegen.java index 70edb0a92753..19b237fc10ec 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PlantumlDocumentationCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PlantumlDocumentationCodegen.java @@ -203,4 +203,16 @@ private String removeSuffix(final String value, final String suffix) { return value; } + + @Override + public String escapeQuotationMark(String input) { + // to surpress the warning message + return input; + } + + @Override + public String escapeUnsafeCharacters(String input) { + // to surpress the warning message + return input; + } } From 472ff9c657f88de6bf906e5f9afe95e013aec453 Mon Sep 17 00:00:00 2001 From: sbu <64100880+sbu-WBT@users.noreply.github.com> Date: Thu, 30 Jul 2020 04:19:43 +0200 Subject: [PATCH 091/129] Fix 2d list generation for dart (#6913) --- .../src/main/resources/dart2/class.mustache | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/modules/openapi-generator/src/main/resources/dart2/class.mustache b/modules/openapi-generator/src/main/resources/dart2/class.mustache index 2dca6c790514..95359385297a 100644 --- a/modules/openapi-generator/src/main/resources/dart2/class.mustache +++ b/modules/openapi-generator/src/main/resources/dart2/class.mustache @@ -41,7 +41,20 @@ class {{classname}} { {{#isListContainer}} {{name}} = (json['{{baseName}}'] == null) ? null : + {{#items.isListContainer}} + (json['{{baseName}}'] as List).map( + (e) => e == null ? null : + {{#items.complexType}} + {{items.complexType}}.listFromJson(json['{{baseName}}']) + {{/items.complexType}} + {{^items.complexType}} + (e as List).cast<{{items.items.dataType}}>() + {{/items.complexType}} + ).toList(); + {{/items.isListContainer}} + {{^items.isListContainer}} {{complexType}}.listFromJson(json['{{baseName}}']); + {{/items.isListContainer}} {{/isListContainer}} {{^isListContainer}} {{#isMapContainer}} From 0494d27f737e7faa7807aba460027f4d9b8aaada Mon Sep 17 00:00:00 2001 From: k0ral Date: Thu, 30 Jul 2020 05:22:32 +0200 Subject: [PATCH 092/129] [Protobuf] Generate enum fields (#7073) --- .../src/main/resources/protobuf-schema/model.mustache | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/openapi-generator/src/main/resources/protobuf-schema/model.mustache b/modules/openapi-generator/src/main/resources/protobuf-schema/model.mustache index 069356b68032..af82041a5c5b 100644 --- a/modules/openapi-generator/src/main/resources/protobuf-schema/model.mustache +++ b/modules/openapi-generator/src/main/resources/protobuf-schema/model.mustache @@ -21,13 +21,15 @@ message {{classname}} { {{#vendorExtensions.x-protobuf-type}}{{.}} {{/vendorExtensions.x-protobuf-type}}{{vendorExtensions.x-protobuf-data-type}} {{name}} = {{vendorExtensions.x-protobuf-index}}{{#vendorExtensions.x-protobuf-packed}} [packed=true]{{/vendorExtensions.x-protobuf-packed}}; {{/isEnum}} {{#isEnum}} - enum {{name}} { + enum {{enumName}} { {{#allowableValues}} {{#enumVars}} {{{name}}} = {{{protobuf-enum-index}}}; {{/enumVars}} {{/allowableValues}} } + + {{enumName}} {{name}} = {{vendorExtensions.x-protobuf-index}}; {{/isEnum}} {{/vars}} From 6621f46d70472830c031314d923781191ca97019 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Thu, 30 Jul 2020 11:30:29 +0800 Subject: [PATCH 093/129] update protobuf samples --- samples/config/petstore/protobuf-schema/models/order.proto | 4 +++- samples/config/petstore/protobuf-schema/models/pet.proto | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/samples/config/petstore/protobuf-schema/models/order.proto b/samples/config/petstore/protobuf-schema/models/order.proto index 58f1458c63ac..f1e3ba80a133 100644 --- a/samples/config/petstore/protobuf-schema/models/order.proto +++ b/samples/config/petstore/protobuf-schema/models/order.proto @@ -24,12 +24,14 @@ message Order { string shipDate = 4; // Order Status - enum status { + enum StatusEnum { PLACED = 0; APPROVED = 1; DELIVERED = 2; } + StatusEnum status = 5; + bool complete = 6; } diff --git a/samples/config/petstore/protobuf-schema/models/pet.proto b/samples/config/petstore/protobuf-schema/models/pet.proto index 8cff62e9f5a2..148ce9a02fe9 100644 --- a/samples/config/petstore/protobuf-schema/models/pet.proto +++ b/samples/config/petstore/protobuf-schema/models/pet.proto @@ -28,10 +28,12 @@ message Pet { repeated Tag tags = 5; // pet status in the store - enum status { + enum StatusEnum { AVAILABLE = 0; PENDING = 1; SOLD = 2; } + StatusEnum status = 6; + } From e12009907e3d46d3a62170a3a78efd52e98dd673 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Thu, 30 Jul 2020 22:55:52 +0800 Subject: [PATCH 094/129] migrate typescript.sh to new config format (#7078) --- bin/configs/typescript-consolidated-deno.yaml | 6 +++ .../typescript-consolidated-inversify.yaml | 7 +++ .../typescript-consolidated-jquery.yaml | 6 +++ ...t-consolidated-node-object-parameters.yaml | 7 +++ bin/configs/typescript-consolidated-node.yaml | 6 +++ bin/typescript.sh | 51 ------------------- 6 files changed, 32 insertions(+), 51 deletions(-) create mode 100644 bin/configs/typescript-consolidated-deno.yaml create mode 100644 bin/configs/typescript-consolidated-inversify.yaml create mode 100644 bin/configs/typescript-consolidated-jquery.yaml create mode 100644 bin/configs/typescript-consolidated-node-object-parameters.yaml create mode 100644 bin/configs/typescript-consolidated-node.yaml delete mode 100755 bin/typescript.sh diff --git a/bin/configs/typescript-consolidated-deno.yaml b/bin/configs/typescript-consolidated-deno.yaml new file mode 100644 index 000000000000..67fdb69573d5 --- /dev/null +++ b/bin/configs/typescript-consolidated-deno.yaml @@ -0,0 +1,6 @@ +generatorName: typescript +outputDir: samples/openapi3/client/petstore/typescript/builds/deno +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml +additionalProperties: + platform: deno + npmName: ts-petstore-client diff --git a/bin/configs/typescript-consolidated-inversify.yaml b/bin/configs/typescript-consolidated-inversify.yaml new file mode 100644 index 000000000000..70277c6e7ad0 --- /dev/null +++ b/bin/configs/typescript-consolidated-inversify.yaml @@ -0,0 +1,7 @@ +generatorName: typescript +outputDir: samples/openapi3/client/petstore/typescript/builds/inversify +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml +additionalProperties: + platform: node + npmName: ts-petstore-client + useInversify: true diff --git a/bin/configs/typescript-consolidated-jquery.yaml b/bin/configs/typescript-consolidated-jquery.yaml new file mode 100644 index 000000000000..2a9e79af1b2e --- /dev/null +++ b/bin/configs/typescript-consolidated-jquery.yaml @@ -0,0 +1,6 @@ +generatorName: typescript +outputDir: samples/openapi3/client/petstore/typescript/builds/jquery +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml +additionalProperties: + framework: jquery + npmName: ts-petstore-client diff --git a/bin/configs/typescript-consolidated-node-object-parameters.yaml b/bin/configs/typescript-consolidated-node-object-parameters.yaml new file mode 100644 index 000000000000..40171df194d7 --- /dev/null +++ b/bin/configs/typescript-consolidated-node-object-parameters.yaml @@ -0,0 +1,7 @@ +generatorName: typescript +outputDir: samples/openapi3/client/petstore/typescript/builds/object_params +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml +additionalProperties: + platform: node + npmName: ts-petstore-client + useObjectParameters: true diff --git a/bin/configs/typescript-consolidated-node.yaml b/bin/configs/typescript-consolidated-node.yaml new file mode 100644 index 000000000000..137a5242ed96 --- /dev/null +++ b/bin/configs/typescript-consolidated-node.yaml @@ -0,0 +1,6 @@ +generatorName: typescript +outputDir: samples/openapi3/client/petstore/typescript/builds/default +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml +additionalProperties: + platform: node + npmName: ts-petstore-client diff --git a/bin/typescript.sh b/bin/typescript.sh deleted file mode 100755 index c9c07a7b01aa..000000000000 --- a/bin/typescript.sh +++ /dev/null @@ -1,51 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" -common_args="generate -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g typescript" -samples="samples/openapi3/client/petstore/typescript/builds" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties" - -printf "\033[32m## Creating default (fetch) client!\033[0m\n" -args="-o $samples/default --additional-properties=platform=node,npmName=ts-petstore-client $@" -java $JAVA_OPTS -jar $executable $common_args $args - -printf "\033[32m## Creating jquery client!\033[0m\n" -args="-o $samples/jquery --additional-properties=framework=jquery,npmName=ts-petstore-client $@" -java $JAVA_OPTS -jar $executable $common_args $args - -printf "\033[32m## Creating fetch object client!\033[0m\n" -args="-o $samples/object_params --additional-properties=platform=node,npmName=ts-petstore-client,useObjectParameters=true $@" -java $JAVA_OPTS -jar $executable $common_args $args - -printf "\033[32m## Creating fetch client with InversifyJS support!\033[0m\n" -args="-o $samples/inversify --additional-properties=platform=node,npmName=ts-petstore-client,useInversify=true $@" -java $JAVA_OPTS -jar $executable $common_args $args - -printf "\033[32m## Creating Deno (fetch) client!\033[0m\n" -args="-o $samples/deno --additional-properties=platform=deno $@" -java $JAVA_OPTS -jar $executable $common_args $args From b2293cc36363aac066a0519d67feb24889f44bc3 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Fri, 31 Jul 2020 10:42:44 +0800 Subject: [PATCH 095/129] Add a link to the blog post at qiita (#7084) --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index caeb4c54e7bf..e03b333f4a51 100644 --- a/README.md +++ b/README.md @@ -765,6 +765,7 @@ Here are some companies/projects (alphabetical order) using OpenAPI Generator in - 2020-07-12 - [Open API 3.0の定義からgolangのサーバコードのスケルトンを作成する](https://qiita.com/professor/items/4cbd04ec084d13057bc2) by [@professor (Qiita Blog)](https://qiita.com/professor) - 2020-07-20 - [Datadog API client libraries now available for Java and Go](https://www.datadoghq.com/blog/java-go-libraries/) by Jordan Obey at [Datadog Blog](https://www.datadoghq.com/blog) - 2020-07-23 - [Generate Client SDK for .NET Core using Open Api](https://dev.to/no0law1/generate-client-sdk-for-net-core-using-open-api-2dgh) by [Nuno Reis](https://dev.to/no0law1) +- 2020-07-26 - [Dartのhttp_interceptorライブラリを使うと配列のクエリパラメータが消えてしまう件の応急処置](https://qiita.com/gyamoto/items/eeeff81b6770487319ed) by [@gyamoto](https://qiita.com/gyamoto) ## [6 - About Us](#table-of-contents) From c93fcd751497919caa574edcd11032423b57da7f Mon Sep 17 00:00:00 2001 From: William Cheng Date: Fri, 31 Jul 2020 11:19:51 +0800 Subject: [PATCH 096/129] Add a link to conference paper (#7086) --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index e03b333f4a51..78f02af2d1b4 100644 --- a/README.md +++ b/README.md @@ -761,6 +761,7 @@ Here are some companies/projects (alphabetical order) using OpenAPI Generator in - 2020-05-28 - [【使用 lotify + Swagger 建置可共用的 LINE Notify bot】 - #NiJia @ Chatbot Developer Taiwan 第 #19 小聚](https://www.youtube.com/watch?v=agYVz6dzh1I) by [Chatbot Developer Taiwan](https://www.youtube.com/channel/UCxeYUyZNnHmpX23YNF-ewvw) - 2020-05-28 - [Building APIs with Laravel using OpenAPI](https://www.youtube.com/watch?v=xexLvQqAhiA) by [Chris Tankersley](https://github.com/dragonmantank) at [Laracon EU](https://laracon.eu/) - 2020-06-23 - [新規サーバーアプリケーションにTypeScriptを採用してみた](https://www.cam-inc.co.jp/news/20200623) at [CAM Tech Blog](https://www.cam-inc.co.jp/news/tech-blog/) +- 2020-06-29 - [Artifact Abstract: Deployment of APIs on Android Mobile Devices and Microcontrollers](https://ieeexplore.ieee.org/document/9127353) by [Sergio Laso ; Marino Linaje ; Jose Garcia-Alonso ; Juan M. Murillo ; Javier Berrocal](https://ieeexplore.ieee.org/document/9127353/authors#authors) at [2020 IEEE International Conference on Pervasive Computing and Communications (PerCom)](https://ieeexplore.ieee.org/xpl/conhome/9125449/proceeding) - 2020-07-07 - [5 Best API Documentation Tools](https://blog.dreamfactory.com/5-best-api-documentation-tools/) by Susanna Bouse at [DreamFactory Blog](https://blog.dreamfactory.com/) - 2020-07-12 - [Open API 3.0の定義からgolangのサーバコードのスケルトンを作成する](https://qiita.com/professor/items/4cbd04ec084d13057bc2) by [@professor (Qiita Blog)](https://qiita.com/professor) - 2020-07-20 - [Datadog API client libraries now available for Java and Go](https://www.datadoghq.com/blog/java-go-libraries/) by Jordan Obey at [Datadog Blog](https://www.datadoghq.com/blog) From 0f3edb13f51101aa2e7ba4d8f36ab308e679ce33 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Fri, 31 Jul 2020 15:29:02 +0800 Subject: [PATCH 097/129] commented out perl, bash tests to reduce build time --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 0ae557cecbe0..b42c1be3bb2e 100644 --- a/pom.xml +++ b/pom.xml @@ -1184,9 +1184,9 @@ samples/server/petstore/php-laravel samples/server/petstore/rust-server - samples/client/petstore/perl + samples/client/petstore/ruby - samples/client/petstore/bash samples/client/petstore/c samples/client/petstore/cpp-qt5 samples/client/petstore/rust From b838e1885fe80dee263f6a46644909a900eb3f14 Mon Sep 17 00:00:00 2001 From: Daniel Ludwig Date: Fri, 31 Jul 2020 11:58:43 +0200 Subject: [PATCH 098/129] typescript-node: clean up require and import (#6947) * Fix for issue 4656 typescript-node generate invalid require statement instead of import statement * Fixed broken link under testing templates * Result of run generate-samples.sh / typescript-node* * import stmt depending on flag supportsES6 * Update petstore sample for typescript-node * import ... from stmt for http/request module * update samples * update doc Co-authored-by: William Cheng --- CONTRIBUTING.md | 3 +-- docs/contributing.md | 3 +-- .../src/main/resources/typescript-node/api-single.mustache | 5 +++-- .../src/main/resources/typescript-node/models.mustache | 2 +- .../src/main/resources/typescript-node/tsconfig.mustache | 2 ++ .../client/petstore/typescript-node/default/api/petApi.ts | 5 +++-- .../client/petstore/typescript-node/default/api/storeApi.ts | 5 +++-- .../client/petstore/typescript-node/default/api/userApi.ts | 5 +++-- .../client/petstore/typescript-node/default/model/models.ts | 2 +- samples/client/petstore/typescript-node/npm/api/petApi.ts | 5 +++-- samples/client/petstore/typescript-node/npm/api/storeApi.ts | 5 +++-- samples/client/petstore/typescript-node/npm/api/userApi.ts | 5 +++-- samples/client/petstore/typescript-node/npm/model/models.ts | 2 +- samples/client/petstore/typescript-node/npm/tsconfig.json | 2 ++ 14 files changed, 30 insertions(+), 21 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f4daf0ea070e..8fedced7329a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -87,8 +87,7 @@ To add test cases (optional) covering the change in the code generator, please r 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/t -ree/master/samples). For Windows, please install [GIT bash](https://gitforwindows.org/). (If you find that there are new files g +/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 g enerated or unexpected changes as a result of the update, that's not unusual as the test cases are added to the OpenAPI spec fro m 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`. diff --git a/docs/contributing.md b/docs/contributing.md index 171682dac06e..8fcb22b9eab1 100644 --- a/docs/contributing.md +++ b/docs/contributing.md @@ -91,8 +91,7 @@ To add test cases (optional) covering the change in the code generator, please r 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/t -ree/master/samples). For Windows, please install [GIT bash](https://gitforwindows.org/). (If you find that there are new files g +/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 g enerated or unexpected changes as a result of the update, that's not unusual as the test cases are added to the OpenAPI spec fro m 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`. diff --git a/modules/openapi-generator/src/main/resources/typescript-node/api-single.mustache b/modules/openapi-generator/src/main/resources/typescript-node/api-single.mustache index d54c5bd341bf..e8a6cc5bf360 100644 --- a/modules/openapi-generator/src/main/resources/typescript-node/api-single.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-node/api-single.mustache @@ -1,6 +1,7 @@ {{>licenseInfo}} -import localVarRequest = require('request'); -import http = require('http'); + +import localVarRequest from 'request'; +import http from 'http'; /* tslint:disable:no-unused-locals */ {{#imports}} diff --git a/modules/openapi-generator/src/main/resources/typescript-node/models.mustache b/modules/openapi-generator/src/main/resources/typescript-node/models.mustache index f129eb63e785..41bf1422eab8 100644 --- a/modules/openapi-generator/src/main/resources/typescript-node/models.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-node/models.mustache @@ -4,7 +4,7 @@ export * from '{{{ classFilename }}}'; {{/model}} {{/models}} -import localVarRequest = require('request'); +import localVarRequest from 'request'; {{#models}} {{#model}} diff --git a/modules/openapi-generator/src/main/resources/typescript-node/tsconfig.mustache b/modules/openapi-generator/src/main/resources/typescript-node/tsconfig.mustache index 160a99593a7d..de78697d22a3 100644 --- a/modules/openapi-generator/src/main/resources/typescript-node/tsconfig.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-node/tsconfig.mustache @@ -4,6 +4,8 @@ "noImplicitAny": false, "suppressImplicitAnyIndexErrors": true, "target": "{{#supportsES6}}ES6{{/supportsES6}}{{^supportsES6}}ES5{{/supportsES6}}", + "allowSyntheticDefaultImports": true, + "esModuleInterop": true, "strict": true, "moduleResolution": "node", "removeComments": true, diff --git a/samples/client/petstore/typescript-node/default/api/petApi.ts b/samples/client/petstore/typescript-node/default/api/petApi.ts index 610dafca441c..f9bc6cfb93d7 100644 --- a/samples/client/petstore/typescript-node/default/api/petApi.ts +++ b/samples/client/petstore/typescript-node/default/api/petApi.ts @@ -10,8 +10,9 @@ * Do not edit the class manually. */ -import localVarRequest = require('request'); -import http = require('http'); + +import localVarRequest from 'request'; +import http from 'http'; /* tslint:disable:no-unused-locals */ import { ApiResponse } from '../model/apiResponse'; diff --git a/samples/client/petstore/typescript-node/default/api/storeApi.ts b/samples/client/petstore/typescript-node/default/api/storeApi.ts index 42ca3f345af6..075dc6126fb3 100644 --- a/samples/client/petstore/typescript-node/default/api/storeApi.ts +++ b/samples/client/petstore/typescript-node/default/api/storeApi.ts @@ -10,8 +10,9 @@ * Do not edit the class manually. */ -import localVarRequest = require('request'); -import http = require('http'); + +import localVarRequest from 'request'; +import http from 'http'; /* tslint:disable:no-unused-locals */ import { Order } from '../model/order'; diff --git a/samples/client/petstore/typescript-node/default/api/userApi.ts b/samples/client/petstore/typescript-node/default/api/userApi.ts index d22eedd21f86..6122ed4221e6 100644 --- a/samples/client/petstore/typescript-node/default/api/userApi.ts +++ b/samples/client/petstore/typescript-node/default/api/userApi.ts @@ -10,8 +10,9 @@ * Do not edit the class manually. */ -import localVarRequest = require('request'); -import http = require('http'); + +import localVarRequest from 'request'; +import http from 'http'; /* tslint:disable:no-unused-locals */ import { User } from '../model/user'; diff --git a/samples/client/petstore/typescript-node/default/model/models.ts b/samples/client/petstore/typescript-node/default/model/models.ts index faf72498f767..1da13addd120 100644 --- a/samples/client/petstore/typescript-node/default/model/models.ts +++ b/samples/client/petstore/typescript-node/default/model/models.ts @@ -5,7 +5,7 @@ export * from './pet'; export * from './tag'; export * from './user'; -import localVarRequest = require('request'); +import localVarRequest from 'request'; import { ApiResponse } from './apiResponse'; import { Category } from './category'; diff --git a/samples/client/petstore/typescript-node/npm/api/petApi.ts b/samples/client/petstore/typescript-node/npm/api/petApi.ts index 610dafca441c..f9bc6cfb93d7 100644 --- a/samples/client/petstore/typescript-node/npm/api/petApi.ts +++ b/samples/client/petstore/typescript-node/npm/api/petApi.ts @@ -10,8 +10,9 @@ * Do not edit the class manually. */ -import localVarRequest = require('request'); -import http = require('http'); + +import localVarRequest from 'request'; +import http from 'http'; /* tslint:disable:no-unused-locals */ import { ApiResponse } from '../model/apiResponse'; diff --git a/samples/client/petstore/typescript-node/npm/api/storeApi.ts b/samples/client/petstore/typescript-node/npm/api/storeApi.ts index 42ca3f345af6..075dc6126fb3 100644 --- a/samples/client/petstore/typescript-node/npm/api/storeApi.ts +++ b/samples/client/petstore/typescript-node/npm/api/storeApi.ts @@ -10,8 +10,9 @@ * Do not edit the class manually. */ -import localVarRequest = require('request'); -import http = require('http'); + +import localVarRequest from 'request'; +import http from 'http'; /* tslint:disable:no-unused-locals */ import { Order } from '../model/order'; diff --git a/samples/client/petstore/typescript-node/npm/api/userApi.ts b/samples/client/petstore/typescript-node/npm/api/userApi.ts index d22eedd21f86..6122ed4221e6 100644 --- a/samples/client/petstore/typescript-node/npm/api/userApi.ts +++ b/samples/client/petstore/typescript-node/npm/api/userApi.ts @@ -10,8 +10,9 @@ * Do not edit the class manually. */ -import localVarRequest = require('request'); -import http = require('http'); + +import localVarRequest from 'request'; +import http from 'http'; /* tslint:disable:no-unused-locals */ import { User } from '../model/user'; diff --git a/samples/client/petstore/typescript-node/npm/model/models.ts b/samples/client/petstore/typescript-node/npm/model/models.ts index faf72498f767..1da13addd120 100644 --- a/samples/client/petstore/typescript-node/npm/model/models.ts +++ b/samples/client/petstore/typescript-node/npm/model/models.ts @@ -5,7 +5,7 @@ export * from './pet'; export * from './tag'; export * from './user'; -import localVarRequest = require('request'); +import localVarRequest from 'request'; import { ApiResponse } from './apiResponse'; import { Category } from './category'; diff --git a/samples/client/petstore/typescript-node/npm/tsconfig.json b/samples/client/petstore/typescript-node/npm/tsconfig.json index d6a89cb7a455..afce3b7abd4a 100644 --- a/samples/client/petstore/typescript-node/npm/tsconfig.json +++ b/samples/client/petstore/typescript-node/npm/tsconfig.json @@ -4,6 +4,8 @@ "noImplicitAny": false, "suppressImplicitAnyIndexErrors": true, "target": "ES5", + "allowSyntheticDefaultImports": true, + "esModuleInterop": true, "strict": true, "moduleResolution": "node", "removeComments": true, From f49ab2a7ed98bfc03b7db3f67236d3bba38f5ff1 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Sat, 1 Aug 2020 09:30:36 +0800 Subject: [PATCH 099/129] Fix Shippable CI (#7097) * disable elixir tests due to shippable ci issue * comment out kotlin test --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index b42c1be3bb2e..d4fdeae7fe5a 100644 --- a/pom.xml +++ b/pom.xml @@ -1354,11 +1354,11 @@ samples/openapi3/client/elm - samples/client/petstore/elixir + samples/client/petstore/erlang-client samples/client/petstore/erlang-proper samples/client/petstore/kotlin-multiplatform - samples/client/petstore/kotlin/ + samples/client/petstore/kotlin-jackson/ samples/client/petstore/kotlin-gson/ samples/client/petstore/kotlin-nonpublic/ From a7ccc4addd95de3505c946dfdc0d51f281975f38 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Sat, 1 Aug 2020 10:12:28 +0800 Subject: [PATCH 100/129] [Go][Exp] better code format (#7088) * go-exp-format * replace spaces with tabs --- .../resources/go-experimental/api.mustache | 20 ++- .../go-experimental/model_anyof.mustache | 4 +- .../go-experimental/signing.mustache | 4 +- .../go-petstore/api_another_fake.go | 5 +- .../go-experimental/go-petstore/api_fake.go | 121 ++---------------- .../go-petstore/api_fake_classname_tags123.go | 5 +- .../go-experimental/go-petstore/api_pet.go | 56 ++------ .../go-experimental/go-petstore/api_store.go | 16 +-- .../go-experimental/go-petstore/api_user.go | 39 +----- .../go-petstore/api_another_fake.go | 5 +- .../go-petstore/api_default.go | 3 +- .../go-experimental/go-petstore/api_fake.go | 119 ++--------------- .../go-petstore/api_fake_classname_tags123.go | 5 +- .../go-experimental/go-petstore/api_pet.go | 56 ++------ .../go-experimental/go-petstore/api_store.go | 16 +-- .../go-experimental/go-petstore/api_user.go | 39 +----- .../go-experimental/go-petstore/signing.go | 4 +- 17 files changed, 78 insertions(+), 439 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/go-experimental/api.mustache b/modules/openapi-generator/src/main/resources/go-experimental/api.mustache index 18a3e1139581..fb2553be562a 100644 --- a/modules/openapi-generator/src/main/resources/go-experimental/api.mustache +++ b/modules/openapi-generator/src/main/resources/go-experimental/api.mustache @@ -26,12 +26,14 @@ type api{{operationId}}Request struct { {{paramName}} {{^isPathParam}}*{{/isPathParam}}{{{dataType}}}{{/allParams}} } -{{#allParams}}{{^isPathParam}} +{{#allParams}} +{{^isPathParam}} func (r api{{operationId}}Request) {{vendorExtensions.x-export-param-name}}({{paramName}} {{{dataType}}}) api{{operationId}}Request { r.{{paramName}} = &{{paramName}} return r } -{{/isPathParam}}{{/allParams}} +{{/isPathParam}} +{{/allParams}} /* {{operationId}}{{#summary}} {{{.}}}{{/summary}}{{^summary}} Method for {{operationId}}{{/summary}} {{#notes}} @@ -51,7 +53,9 @@ func (a *{{{classname}}}Service) {{{nickname}}}(ctx _context.Context{{#pathParam /* Execute executes the request -{{#returnType}} @return {{{.}}}{{/returnType}} +{{#returnType}} +@return {{{.}}} +{{/returnType}} */ func (r api{{operationId}}Request) Execute() ({{#returnType}}{{{.}}}, {{/returnType}}*_nethttp.Response, error) { var ( @@ -60,7 +64,9 @@ func (r api{{operationId}}Request) Execute() ({{#returnType}}{{{.}}}, {{/returnT localVarFormFileName string localVarFileName string localVarFileBytes []byte - {{#returnType}}localVarReturnValue {{{.}}}{{/returnType}} + {{#returnType}} + localVarReturnValue {{{.}}} + {{/returnType}} ) localBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, "{{{classname}}}Service.{{{nickname}}}") @@ -75,10 +81,12 @@ func (r api{{operationId}}Request) Execute() ({{#returnType}}{{{.}}}, {{/returnT localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} {{#allParams}} - {{#required}}{{^isPathParam}} + {{#required}} + {{^isPathParam}} if r.{{paramName}} == nil { return {{#returnType}}localVarReturnValue, {{/returnType}}nil, reportError("{{paramName}} is required and must be specified") - }{{/isPathParam}} + } + {{/isPathParam}} {{#minItems}} if len({{^isPathParam}}*{{/isPathParam}}r.{{paramName}}) < {{minItems}} { return {{#returnType}}localVarReturnValue, {{/returnType}}nil, reportError("{{paramName}} must have at least {{minItems}} elements") diff --git a/modules/openapi-generator/src/main/resources/go-experimental/model_anyof.mustache b/modules/openapi-generator/src/main/resources/go-experimental/model_anyof.mustache index dcf8c9f8df1b..5dfa75302f13 100644 --- a/modules/openapi-generator/src/main/resources/go-experimental/model_anyof.mustache +++ b/modules/openapi-generator/src/main/resources/go-experimental/model_anyof.mustache @@ -17,7 +17,7 @@ func (dst *{{classname}}) UnmarshalJSON(data []byte) error { {{/isNullable}} {{#discriminator}} {{#mappedModels}} - {{#-first}} + {{#-first}} // use discriminator value to speed up the lookup var jsonDict map[string]interface{} err := json.Unmarshal(data, &jsonDict) @@ -25,7 +25,7 @@ func (dst *{{classname}}) UnmarshalJSON(data []byte) error { return fmt.Errorf("Failed to unmarshal JSON into map for the discrimintor lookup.") } - {{/-first}} + {{/-first}} // check if the discriminator value is '{{{mappingName}}}' if jsonDict["{{{propertyBaseName}}}"] == "{{{mappingName}}}" { // try to unmarshal JSON data into {{{modelName}}} diff --git a/modules/openapi-generator/src/main/resources/go-experimental/signing.mustache b/modules/openapi-generator/src/main/resources/go-experimental/signing.mustache index df11e4006ab2..db486a16b207 100644 --- a/modules/openapi-generator/src/main/resources/go-experimental/signing.mustache +++ b/modules/openapi-generator/src/main/resources/go-experimental/signing.mustache @@ -40,7 +40,7 @@ const ( // The 'Host' header, as defined in RFC 2616, section 14.23. HttpHeaderHost string = "Host" // The 'Date' header. - HttpHeaderDate string = "Date" + HttpHeaderDate string = "Date" // The digest header, as defined in RFC 3230, section 4.3.2. HttpHeaderDigest string = "Digest" // The HTTP Authorization header, as defined in RFC 7235, section 4.2. @@ -106,7 +106,7 @@ type HttpSignatureAuth struct { SigningScheme string // The signature scheme, when signing HTTP requests. Supported value is 'hs2019'. // The signature algorithm, when signing HTTP requests. // Supported values are RSASSA-PKCS1-v1_5, RSASSA-PSS. - SigningAlgorithm string + SigningAlgorithm string SignedHeaders []string // A list of HTTP headers included when generating the signature for the message. // SignatureMaxValidity specifies the maximum duration of the signature validity. // The value is used to set the '(expires)' signature parameter in the HTTP request. diff --git a/samples/client/petstore/go-experimental/go-petstore/api_another_fake.go b/samples/client/petstore/go-experimental/go-petstore/api_another_fake.go index 486ec52d3e3b..cbcbcd620d28 100644 --- a/samples/client/petstore/go-experimental/go-petstore/api_another_fake.go +++ b/samples/client/petstore/go-experimental/go-petstore/api_another_fake.go @@ -30,12 +30,10 @@ type apiCall123TestSpecialTagsRequest struct { body *Client } - func (r apiCall123TestSpecialTagsRequest) Body(body Client) apiCall123TestSpecialTagsRequest { r.body = &body return r } - /* Call123TestSpecialTags To test special tags To test special tags and operation ID starting with number @@ -51,7 +49,7 @@ func (a *AnotherFakeApiService) Call123TestSpecialTags(ctx _context.Context) api /* Execute executes the request - @return Client +@return Client */ func (r apiCall123TestSpecialTagsRequest) Execute() (Client, *_nethttp.Response, error) { var ( @@ -73,7 +71,6 @@ func (r apiCall123TestSpecialTagsRequest) Execute() (Client, *_nethttp.Response, localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - if r.body == nil { return localVarReturnValue, nil, reportError("body is required and must be specified") } diff --git a/samples/client/petstore/go-experimental/go-petstore/api_fake.go b/samples/client/petstore/go-experimental/go-petstore/api_fake.go index 59903c214eec..773eb594fbf6 100644 --- a/samples/client/petstore/go-experimental/go-petstore/api_fake.go +++ b/samples/client/petstore/go-experimental/go-petstore/api_fake.go @@ -33,12 +33,10 @@ type apiCreateXmlItemRequest struct { xmlItem *XmlItem } - func (r apiCreateXmlItemRequest) XmlItem(xmlItem XmlItem) apiCreateXmlItemRequest { r.xmlItem = &xmlItem return r } - /* CreateXmlItem creates an XmlItem this route creates an XmlItem @@ -54,7 +52,6 @@ func (a *FakeApiService) CreateXmlItem(ctx _context.Context) apiCreateXmlItemReq /* Execute executes the request - */ func (r apiCreateXmlItemRequest) Execute() (*_nethttp.Response, error) { var ( @@ -63,7 +60,6 @@ func (r apiCreateXmlItemRequest) Execute() (*_nethttp.Response, error) { localVarFormFileName string localVarFileName string localVarFileBytes []byte - ) localBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.CreateXmlItem") @@ -76,7 +72,6 @@ func (r apiCreateXmlItemRequest) Execute() (*_nethttp.Response, error) { localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - if r.xmlItem == nil { return nil, reportError("xmlItem is required and must be specified") } @@ -132,12 +127,10 @@ type apiFakeOuterBooleanSerializeRequest struct { body *bool } - func (r apiFakeOuterBooleanSerializeRequest) Body(body bool) apiFakeOuterBooleanSerializeRequest { r.body = &body return r } - /* FakeOuterBooleanSerialize Method for FakeOuterBooleanSerialize Test serialization of outer boolean types @@ -153,7 +146,7 @@ func (a *FakeApiService) FakeOuterBooleanSerialize(ctx _context.Context) apiFake /* Execute executes the request - @return bool +@return bool */ func (r apiFakeOuterBooleanSerializeRequest) Execute() (bool, *_nethttp.Response, error) { var ( @@ -175,7 +168,7 @@ func (r apiFakeOuterBooleanSerializeRequest) Execute() (bool, *_nethttp.Response localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - + // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -236,12 +229,10 @@ type apiFakeOuterCompositeSerializeRequest struct { body *OuterComposite } - func (r apiFakeOuterCompositeSerializeRequest) Body(body OuterComposite) apiFakeOuterCompositeSerializeRequest { r.body = &body return r } - /* FakeOuterCompositeSerialize Method for FakeOuterCompositeSerialize Test serialization of object with outer number type @@ -257,7 +248,7 @@ func (a *FakeApiService) FakeOuterCompositeSerialize(ctx _context.Context) apiFa /* Execute executes the request - @return OuterComposite +@return OuterComposite */ func (r apiFakeOuterCompositeSerializeRequest) Execute() (OuterComposite, *_nethttp.Response, error) { var ( @@ -279,7 +270,7 @@ func (r apiFakeOuterCompositeSerializeRequest) Execute() (OuterComposite, *_neth localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - + // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -340,12 +331,10 @@ type apiFakeOuterNumberSerializeRequest struct { body *float32 } - func (r apiFakeOuterNumberSerializeRequest) Body(body float32) apiFakeOuterNumberSerializeRequest { r.body = &body return r } - /* FakeOuterNumberSerialize Method for FakeOuterNumberSerialize Test serialization of outer number types @@ -361,7 +350,7 @@ func (a *FakeApiService) FakeOuterNumberSerialize(ctx _context.Context) apiFakeO /* Execute executes the request - @return float32 +@return float32 */ func (r apiFakeOuterNumberSerializeRequest) Execute() (float32, *_nethttp.Response, error) { var ( @@ -383,7 +372,7 @@ func (r apiFakeOuterNumberSerializeRequest) Execute() (float32, *_nethttp.Respon localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - + // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -444,12 +433,10 @@ type apiFakeOuterStringSerializeRequest struct { body *string } - func (r apiFakeOuterStringSerializeRequest) Body(body string) apiFakeOuterStringSerializeRequest { r.body = &body return r } - /* FakeOuterStringSerialize Method for FakeOuterStringSerialize Test serialization of outer string types @@ -465,7 +452,7 @@ func (a *FakeApiService) FakeOuterStringSerialize(ctx _context.Context) apiFakeO /* Execute executes the request - @return string +@return string */ func (r apiFakeOuterStringSerializeRequest) Execute() (string, *_nethttp.Response, error) { var ( @@ -487,7 +474,7 @@ func (r apiFakeOuterStringSerializeRequest) Execute() (string, *_nethttp.Respons localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - + // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -548,12 +535,10 @@ type apiTestBodyWithFileSchemaRequest struct { body *FileSchemaTestClass } - func (r apiTestBodyWithFileSchemaRequest) Body(body FileSchemaTestClass) apiTestBodyWithFileSchemaRequest { r.body = &body return r } - /* TestBodyWithFileSchema Method for TestBodyWithFileSchema For this test, the body for this request much reference a schema named `File`. @@ -569,7 +554,6 @@ func (a *FakeApiService) TestBodyWithFileSchema(ctx _context.Context) apiTestBod /* Execute executes the request - */ func (r apiTestBodyWithFileSchemaRequest) Execute() (*_nethttp.Response, error) { var ( @@ -578,7 +562,6 @@ func (r apiTestBodyWithFileSchemaRequest) Execute() (*_nethttp.Response, error) localVarFormFileName string localVarFileName string localVarFileBytes []byte - ) localBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestBodyWithFileSchema") @@ -591,7 +574,6 @@ func (r apiTestBodyWithFileSchemaRequest) Execute() (*_nethttp.Response, error) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - if r.body == nil { return nil, reportError("body is required and must be specified") } @@ -648,17 +630,14 @@ type apiTestBodyWithQueryParamsRequest struct { body *User } - func (r apiTestBodyWithQueryParamsRequest) Query(query string) apiTestBodyWithQueryParamsRequest { r.query = &query return r } - func (r apiTestBodyWithQueryParamsRequest) Body(body User) apiTestBodyWithQueryParamsRequest { r.body = &body return r } - /* TestBodyWithQueryParams Method for TestBodyWithQueryParams * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -673,7 +652,6 @@ func (a *FakeApiService) TestBodyWithQueryParams(ctx _context.Context) apiTestBo /* Execute executes the request - */ func (r apiTestBodyWithQueryParamsRequest) Execute() (*_nethttp.Response, error) { var ( @@ -682,7 +660,6 @@ func (r apiTestBodyWithQueryParamsRequest) Execute() (*_nethttp.Response, error) localVarFormFileName string localVarFileName string localVarFileBytes []byte - ) localBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestBodyWithQueryParams") @@ -695,11 +672,9 @@ func (r apiTestBodyWithQueryParamsRequest) Execute() (*_nethttp.Response, error) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - if r.query == nil { return nil, reportError("query is required and must be specified") } - if r.body == nil { return nil, reportError("body is required and must be specified") } @@ -756,12 +731,10 @@ type apiTestClientModelRequest struct { body *Client } - func (r apiTestClientModelRequest) Body(body Client) apiTestClientModelRequest { r.body = &body return r } - /* TestClientModel To test \"client\" model To test "client" model @@ -777,7 +750,7 @@ func (a *FakeApiService) TestClientModel(ctx _context.Context) apiTestClientMode /* Execute executes the request - @return Client +@return Client */ func (r apiTestClientModelRequest) Execute() (Client, *_nethttp.Response, error) { var ( @@ -799,7 +772,6 @@ func (r apiTestClientModelRequest) Execute() (Client, *_nethttp.Response, error) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - if r.body == nil { return localVarReturnValue, nil, reportError("body is required and must be specified") } @@ -877,77 +849,62 @@ type apiTestEndpointParametersRequest struct { callback *string } - func (r apiTestEndpointParametersRequest) Number(number float32) apiTestEndpointParametersRequest { r.number = &number return r } - func (r apiTestEndpointParametersRequest) Double(double float64) apiTestEndpointParametersRequest { r.double = &double return r } - func (r apiTestEndpointParametersRequest) PatternWithoutDelimiter(patternWithoutDelimiter string) apiTestEndpointParametersRequest { r.patternWithoutDelimiter = &patternWithoutDelimiter return r } - func (r apiTestEndpointParametersRequest) Byte_(byte_ string) apiTestEndpointParametersRequest { r.byte_ = &byte_ return r } - func (r apiTestEndpointParametersRequest) Integer(integer int32) apiTestEndpointParametersRequest { r.integer = &integer return r } - func (r apiTestEndpointParametersRequest) Int32_(int32_ int32) apiTestEndpointParametersRequest { r.int32_ = &int32_ return r } - func (r apiTestEndpointParametersRequest) Int64_(int64_ int64) apiTestEndpointParametersRequest { r.int64_ = &int64_ return r } - func (r apiTestEndpointParametersRequest) Float(float float32) apiTestEndpointParametersRequest { r.float = &float return r } - func (r apiTestEndpointParametersRequest) String_(string_ string) apiTestEndpointParametersRequest { r.string_ = &string_ return r } - func (r apiTestEndpointParametersRequest) Binary(binary *os.File) apiTestEndpointParametersRequest { r.binary = &binary return r } - func (r apiTestEndpointParametersRequest) Date(date string) apiTestEndpointParametersRequest { r.date = &date return r } - func (r apiTestEndpointParametersRequest) DateTime(dateTime time.Time) apiTestEndpointParametersRequest { r.dateTime = &dateTime return r } - func (r apiTestEndpointParametersRequest) Password(password string) apiTestEndpointParametersRequest { r.password = &password return r } - func (r apiTestEndpointParametersRequest) Callback(callback string) apiTestEndpointParametersRequest { r.callback = &callback return r } - /* TestEndpointParameters Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 Fake endpoint for testing various parameters @@ -966,7 +923,6 @@ func (a *FakeApiService) TestEndpointParameters(ctx _context.Context) apiTestEnd /* Execute executes the request - */ func (r apiTestEndpointParametersRequest) Execute() (*_nethttp.Response, error) { var ( @@ -975,7 +931,6 @@ func (r apiTestEndpointParametersRequest) Execute() (*_nethttp.Response, error) localVarFormFileName string localVarFileName string localVarFileBytes []byte - ) localBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestEndpointParameters") @@ -988,7 +943,6 @@ func (r apiTestEndpointParametersRequest) Execute() (*_nethttp.Response, error) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - if r.number == nil { return nil, reportError("number is required and must be specified") } @@ -998,7 +952,6 @@ func (r apiTestEndpointParametersRequest) Execute() (*_nethttp.Response, error) if *r.number > 543.2 { return nil, reportError("number must be less than 543.2") } - if r.double == nil { return nil, reportError("double is required and must be specified") } @@ -1008,15 +961,13 @@ func (r apiTestEndpointParametersRequest) Execute() (*_nethttp.Response, error) if *r.double > 123.4 { return nil, reportError("double must be less than 123.4") } - if r.patternWithoutDelimiter == nil { return nil, reportError("patternWithoutDelimiter is required and must be specified") } - if r.byte_ == nil { return nil, reportError("byte_ is required and must be specified") } - + // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/x-www-form-urlencoded"} @@ -1115,47 +1066,38 @@ type apiTestEnumParametersRequest struct { enumFormString *string } - func (r apiTestEnumParametersRequest) EnumHeaderStringArray(enumHeaderStringArray []string) apiTestEnumParametersRequest { r.enumHeaderStringArray = &enumHeaderStringArray return r } - func (r apiTestEnumParametersRequest) EnumHeaderString(enumHeaderString string) apiTestEnumParametersRequest { r.enumHeaderString = &enumHeaderString return r } - func (r apiTestEnumParametersRequest) EnumQueryStringArray(enumQueryStringArray []string) apiTestEnumParametersRequest { r.enumQueryStringArray = &enumQueryStringArray return r } - func (r apiTestEnumParametersRequest) EnumQueryString(enumQueryString string) apiTestEnumParametersRequest { r.enumQueryString = &enumQueryString return r } - func (r apiTestEnumParametersRequest) EnumQueryInteger(enumQueryInteger int32) apiTestEnumParametersRequest { r.enumQueryInteger = &enumQueryInteger return r } - func (r apiTestEnumParametersRequest) EnumQueryDouble(enumQueryDouble float64) apiTestEnumParametersRequest { r.enumQueryDouble = &enumQueryDouble return r } - func (r apiTestEnumParametersRequest) EnumFormStringArray(enumFormStringArray []string) apiTestEnumParametersRequest { r.enumFormStringArray = &enumFormStringArray return r } - func (r apiTestEnumParametersRequest) EnumFormString(enumFormString string) apiTestEnumParametersRequest { r.enumFormString = &enumFormString return r } - /* TestEnumParameters To test enum parameters To test enum parameters @@ -1171,7 +1113,6 @@ func (a *FakeApiService) TestEnumParameters(ctx _context.Context) apiTestEnumPar /* Execute executes the request - */ func (r apiTestEnumParametersRequest) Execute() (*_nethttp.Response, error) { var ( @@ -1180,7 +1121,6 @@ func (r apiTestEnumParametersRequest) Execute() (*_nethttp.Response, error) { localVarFormFileName string localVarFileName string localVarFileBytes []byte - ) localBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestEnumParameters") @@ -1193,7 +1133,7 @@ func (r apiTestEnumParametersRequest) Execute() (*_nethttp.Response, error) { localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - + if r.enumQueryStringArray != nil { localVarQueryParams.Add("enum_query_string_array", parameterToString(*r.enumQueryStringArray, "csv")) } @@ -1272,37 +1212,30 @@ type apiTestGroupParametersRequest struct { int64Group *int64 } - func (r apiTestGroupParametersRequest) RequiredStringGroup(requiredStringGroup int32) apiTestGroupParametersRequest { r.requiredStringGroup = &requiredStringGroup return r } - func (r apiTestGroupParametersRequest) RequiredBooleanGroup(requiredBooleanGroup bool) apiTestGroupParametersRequest { r.requiredBooleanGroup = &requiredBooleanGroup return r } - func (r apiTestGroupParametersRequest) RequiredInt64Group(requiredInt64Group int64) apiTestGroupParametersRequest { r.requiredInt64Group = &requiredInt64Group return r } - func (r apiTestGroupParametersRequest) StringGroup(stringGroup int32) apiTestGroupParametersRequest { r.stringGroup = &stringGroup return r } - func (r apiTestGroupParametersRequest) BooleanGroup(booleanGroup bool) apiTestGroupParametersRequest { r.booleanGroup = &booleanGroup return r } - func (r apiTestGroupParametersRequest) Int64Group(int64Group int64) apiTestGroupParametersRequest { r.int64Group = &int64Group return r } - /* TestGroupParameters Fake endpoint to test group parameters (optional) Fake endpoint to test group parameters (optional) @@ -1318,7 +1251,6 @@ func (a *FakeApiService) TestGroupParameters(ctx _context.Context) apiTestGroupP /* Execute executes the request - */ func (r apiTestGroupParametersRequest) Execute() (*_nethttp.Response, error) { var ( @@ -1327,7 +1259,6 @@ func (r apiTestGroupParametersRequest) Execute() (*_nethttp.Response, error) { localVarFormFileName string localVarFileName string localVarFileBytes []byte - ) localBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestGroupParameters") @@ -1340,19 +1271,16 @@ func (r apiTestGroupParametersRequest) Execute() (*_nethttp.Response, error) { localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - if r.requiredStringGroup == nil { return nil, reportError("requiredStringGroup is required and must be specified") } - if r.requiredBooleanGroup == nil { return nil, reportError("requiredBooleanGroup is required and must be specified") } - if r.requiredInt64Group == nil { return nil, reportError("requiredInt64Group is required and must be specified") } - + localVarQueryParams.Add("required_string_group", parameterToString(*r.requiredStringGroup, "")) localVarQueryParams.Add("required_int64_group", parameterToString(*r.requiredInt64Group, "")) if r.stringGroup != nil { @@ -1414,12 +1342,10 @@ type apiTestInlineAdditionalPropertiesRequest struct { param *map[string]string } - func (r apiTestInlineAdditionalPropertiesRequest) Param(param map[string]string) apiTestInlineAdditionalPropertiesRequest { r.param = ¶m return r } - /* TestInlineAdditionalProperties test inline additionalProperties * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -1434,7 +1360,6 @@ func (a *FakeApiService) TestInlineAdditionalProperties(ctx _context.Context) ap /* Execute executes the request - */ func (r apiTestInlineAdditionalPropertiesRequest) Execute() (*_nethttp.Response, error) { var ( @@ -1443,7 +1368,6 @@ func (r apiTestInlineAdditionalPropertiesRequest) Execute() (*_nethttp.Response, localVarFormFileName string localVarFileName string localVarFileBytes []byte - ) localBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestInlineAdditionalProperties") @@ -1456,7 +1380,6 @@ func (r apiTestInlineAdditionalPropertiesRequest) Execute() (*_nethttp.Response, localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - if r.param == nil { return nil, reportError("param is required and must be specified") } @@ -1513,17 +1436,14 @@ type apiTestJsonFormDataRequest struct { param2 *string } - func (r apiTestJsonFormDataRequest) Param(param string) apiTestJsonFormDataRequest { r.param = ¶m return r } - func (r apiTestJsonFormDataRequest) Param2(param2 string) apiTestJsonFormDataRequest { r.param2 = ¶m2 return r } - /* TestJsonFormData test json serialization of form data * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -1538,7 +1458,6 @@ func (a *FakeApiService) TestJsonFormData(ctx _context.Context) apiTestJsonFormD /* Execute executes the request - */ func (r apiTestJsonFormDataRequest) Execute() (*_nethttp.Response, error) { var ( @@ -1547,7 +1466,6 @@ func (r apiTestJsonFormDataRequest) Execute() (*_nethttp.Response, error) { localVarFormFileName string localVarFileName string localVarFileBytes []byte - ) localBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestJsonFormData") @@ -1560,11 +1478,9 @@ func (r apiTestJsonFormDataRequest) Execute() (*_nethttp.Response, error) { localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - if r.param == nil { return nil, reportError("param is required and must be specified") } - if r.param2 == nil { return nil, reportError("param2 is required and must be specified") } @@ -1624,32 +1540,26 @@ type apiTestQueryParameterCollectionFormatRequest struct { context *[]string } - func (r apiTestQueryParameterCollectionFormatRequest) Pipe(pipe []string) apiTestQueryParameterCollectionFormatRequest { r.pipe = &pipe return r } - func (r apiTestQueryParameterCollectionFormatRequest) Ioutil(ioutil []string) apiTestQueryParameterCollectionFormatRequest { r.ioutil = &ioutil return r } - func (r apiTestQueryParameterCollectionFormatRequest) Http(http []string) apiTestQueryParameterCollectionFormatRequest { r.http = &http return r } - func (r apiTestQueryParameterCollectionFormatRequest) Url(url []string) apiTestQueryParameterCollectionFormatRequest { r.url = &url return r } - func (r apiTestQueryParameterCollectionFormatRequest) Context(context []string) apiTestQueryParameterCollectionFormatRequest { r.context = &context return r } - /* TestQueryParameterCollectionFormat Method for TestQueryParameterCollectionFormat To test the collection format in query parameters @@ -1665,7 +1575,6 @@ func (a *FakeApiService) TestQueryParameterCollectionFormat(ctx _context.Context /* Execute executes the request - */ func (r apiTestQueryParameterCollectionFormatRequest) Execute() (*_nethttp.Response, error) { var ( @@ -1674,7 +1583,6 @@ func (r apiTestQueryParameterCollectionFormatRequest) Execute() (*_nethttp.Respo localVarFormFileName string localVarFileName string localVarFileBytes []byte - ) localBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestQueryParameterCollectionFormat") @@ -1687,23 +1595,18 @@ func (r apiTestQueryParameterCollectionFormatRequest) Execute() (*_nethttp.Respo localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - if r.pipe == nil { return nil, reportError("pipe is required and must be specified") } - if r.ioutil == nil { return nil, reportError("ioutil is required and must be specified") } - if r.http == nil { return nil, reportError("http is required and must be specified") } - if r.url == nil { return nil, reportError("url is required and must be specified") } - if r.context == nil { return nil, reportError("context is required and must be specified") } diff --git a/samples/client/petstore/go-experimental/go-petstore/api_fake_classname_tags123.go b/samples/client/petstore/go-experimental/go-petstore/api_fake_classname_tags123.go index 070e9c3294f5..d126ee0bd33e 100644 --- a/samples/client/petstore/go-experimental/go-petstore/api_fake_classname_tags123.go +++ b/samples/client/petstore/go-experimental/go-petstore/api_fake_classname_tags123.go @@ -30,12 +30,10 @@ type apiTestClassnameRequest struct { body *Client } - func (r apiTestClassnameRequest) Body(body Client) apiTestClassnameRequest { r.body = &body return r } - /* TestClassname To test class name in snake case To test class name in snake case @@ -51,7 +49,7 @@ func (a *FakeClassnameTags123ApiService) TestClassname(ctx _context.Context) api /* Execute executes the request - @return Client +@return Client */ func (r apiTestClassnameRequest) Execute() (Client, *_nethttp.Response, error) { var ( @@ -73,7 +71,6 @@ func (r apiTestClassnameRequest) Execute() (Client, *_nethttp.Response, error) { localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - if r.body == nil { return localVarReturnValue, nil, reportError("body is required and must be specified") } diff --git a/samples/client/petstore/go-experimental/go-petstore/api_pet.go b/samples/client/petstore/go-experimental/go-petstore/api_pet.go index ca72aa94e251..7bdcc03c6bff 100644 --- a/samples/client/petstore/go-experimental/go-petstore/api_pet.go +++ b/samples/client/petstore/go-experimental/go-petstore/api_pet.go @@ -32,12 +32,10 @@ type apiAddPetRequest struct { body *Pet } - func (r apiAddPetRequest) Body(body Pet) apiAddPetRequest { r.body = &body return r } - /* AddPet Add a new pet to the store * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -52,7 +50,6 @@ func (a *PetApiService) AddPet(ctx _context.Context) apiAddPetRequest { /* Execute executes the request - */ func (r apiAddPetRequest) Execute() (*_nethttp.Response, error) { var ( @@ -61,7 +58,6 @@ func (r apiAddPetRequest) Execute() (*_nethttp.Response, error) { localVarFormFileName string localVarFileName string localVarFileBytes []byte - ) localBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.AddPet") @@ -74,7 +70,6 @@ func (r apiAddPetRequest) Execute() (*_nethttp.Response, error) { localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - if r.body == nil { return nil, reportError("body is required and must be specified") } @@ -131,12 +126,10 @@ type apiDeletePetRequest struct { apiKey *string } - func (r apiDeletePetRequest) ApiKey(apiKey string) apiDeletePetRequest { r.apiKey = &apiKey return r } - /* DeletePet Deletes a pet * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -153,7 +146,6 @@ func (a *PetApiService) DeletePet(ctx _context.Context, petId int64) apiDeletePe /* Execute executes the request - */ func (r apiDeletePetRequest) Execute() (*_nethttp.Response, error) { var ( @@ -162,7 +154,6 @@ func (r apiDeletePetRequest) Execute() (*_nethttp.Response, error) { localVarFormFileName string localVarFileName string localVarFileBytes []byte - ) localBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.DeletePet") @@ -176,8 +167,7 @@ func (r apiDeletePetRequest) Execute() (*_nethttp.Response, error) { localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - - + // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -230,12 +220,10 @@ type apiFindPetsByStatusRequest struct { status *[]string } - func (r apiFindPetsByStatusRequest) Status(status []string) apiFindPetsByStatusRequest { r.status = &status return r } - /* FindPetsByStatus Finds Pets by status Multiple status values can be provided with comma separated strings @@ -251,7 +239,7 @@ func (a *PetApiService) FindPetsByStatus(ctx _context.Context) apiFindPetsByStat /* Execute executes the request - @return []Pet +@return []Pet */ func (r apiFindPetsByStatusRequest) Execute() ([]Pet, *_nethttp.Response, error) { var ( @@ -273,7 +261,6 @@ func (r apiFindPetsByStatusRequest) Execute() ([]Pet, *_nethttp.Response, error) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - if r.status == nil { return localVarReturnValue, nil, reportError("status is required and must be specified") } @@ -337,12 +324,10 @@ type apiFindPetsByTagsRequest struct { tags *[]string } - func (r apiFindPetsByTagsRequest) Tags(tags []string) apiFindPetsByTagsRequest { r.tags = &tags return r } - /* FindPetsByTags Finds Pets by tags Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. @@ -358,7 +343,7 @@ func (a *PetApiService) FindPetsByTags(ctx _context.Context) apiFindPetsByTagsRe /* Execute executes the request - @return []Pet +@return []Pet */ func (r apiFindPetsByTagsRequest) Execute() ([]Pet, *_nethttp.Response, error) { var ( @@ -380,7 +365,6 @@ func (r apiFindPetsByTagsRequest) Execute() ([]Pet, *_nethttp.Response, error) { localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - if r.tags == nil { return localVarReturnValue, nil, reportError("tags is required and must be specified") } @@ -444,7 +428,6 @@ type apiGetPetByIdRequest struct { petId int64 } - /* GetPetById Find pet by ID Returns a single pet @@ -462,7 +445,7 @@ func (a *PetApiService) GetPetById(ctx _context.Context, petId int64) apiGetPetB /* Execute executes the request - @return Pet +@return Pet */ func (r apiGetPetByIdRequest) Execute() (Pet, *_nethttp.Response, error) { var ( @@ -485,7 +468,6 @@ func (r apiGetPetByIdRequest) Execute() (Pet, *_nethttp.Response, error) { localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -559,12 +541,10 @@ type apiUpdatePetRequest struct { body *Pet } - func (r apiUpdatePetRequest) Body(body Pet) apiUpdatePetRequest { r.body = &body return r } - /* UpdatePet Update an existing pet * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -579,7 +559,6 @@ func (a *PetApiService) UpdatePet(ctx _context.Context) apiUpdatePetRequest { /* Execute executes the request - */ func (r apiUpdatePetRequest) Execute() (*_nethttp.Response, error) { var ( @@ -588,7 +567,6 @@ func (r apiUpdatePetRequest) Execute() (*_nethttp.Response, error) { localVarFormFileName string localVarFileName string localVarFileBytes []byte - ) localBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.UpdatePet") @@ -601,7 +579,6 @@ func (r apiUpdatePetRequest) Execute() (*_nethttp.Response, error) { localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - if r.body == nil { return nil, reportError("body is required and must be specified") } @@ -659,17 +636,14 @@ type apiUpdatePetWithFormRequest struct { status *string } - func (r apiUpdatePetWithFormRequest) Name(name string) apiUpdatePetWithFormRequest { r.name = &name return r } - func (r apiUpdatePetWithFormRequest) Status(status string) apiUpdatePetWithFormRequest { r.status = &status return r } - /* UpdatePetWithForm Updates a pet in the store with form data * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -686,7 +660,6 @@ func (a *PetApiService) UpdatePetWithForm(ctx _context.Context, petId int64) api /* Execute executes the request - */ func (r apiUpdatePetWithFormRequest) Execute() (*_nethttp.Response, error) { var ( @@ -695,7 +668,6 @@ func (r apiUpdatePetWithFormRequest) Execute() (*_nethttp.Response, error) { localVarFormFileName string localVarFileName string localVarFileBytes []byte - ) localBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.UpdatePetWithForm") @@ -709,8 +681,7 @@ func (r apiUpdatePetWithFormRequest) Execute() (*_nethttp.Response, error) { localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - - + // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/x-www-form-urlencoded"} @@ -768,17 +739,14 @@ type apiUploadFileRequest struct { file **os.File } - func (r apiUploadFileRequest) AdditionalMetadata(additionalMetadata string) apiUploadFileRequest { r.additionalMetadata = &additionalMetadata return r } - func (r apiUploadFileRequest) File(file *os.File) apiUploadFileRequest { r.file = &file return r } - /* UploadFile uploads an image * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -795,7 +763,7 @@ func (a *PetApiService) UploadFile(ctx _context.Context, petId int64) apiUploadF /* Execute executes the request - @return ApiResponse +@return ApiResponse */ func (r apiUploadFileRequest) Execute() (ApiResponse, *_nethttp.Response, error) { var ( @@ -818,8 +786,7 @@ func (r apiUploadFileRequest) Execute() (ApiResponse, *_nethttp.Response, error) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - - + // to determine the Content-Type header localVarHTTPContentTypes := []string{"multipart/form-data"} @@ -894,17 +861,14 @@ type apiUploadFileWithRequiredFileRequest struct { additionalMetadata *string } - func (r apiUploadFileWithRequiredFileRequest) RequiredFile(requiredFile *os.File) apiUploadFileWithRequiredFileRequest { r.requiredFile = &requiredFile return r } - func (r apiUploadFileWithRequiredFileRequest) AdditionalMetadata(additionalMetadata string) apiUploadFileWithRequiredFileRequest { r.additionalMetadata = &additionalMetadata return r } - /* UploadFileWithRequiredFile uploads an image (required) * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -921,7 +885,7 @@ func (a *PetApiService) UploadFileWithRequiredFile(ctx _context.Context, petId i /* Execute executes the request - @return ApiResponse +@return ApiResponse */ func (r apiUploadFileWithRequiredFileRequest) Execute() (ApiResponse, *_nethttp.Response, error) { var ( @@ -944,12 +908,10 @@ func (r apiUploadFileWithRequiredFileRequest) Execute() (ApiResponse, *_nethttp. localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - - if r.requiredFile == nil { return localVarReturnValue, nil, reportError("requiredFile is required and must be specified") } - + // to determine the Content-Type header localVarHTTPContentTypes := []string{"multipart/form-data"} diff --git a/samples/client/petstore/go-experimental/go-petstore/api_store.go b/samples/client/petstore/go-experimental/go-petstore/api_store.go index 62a33bb3543e..8d81867701cf 100644 --- a/samples/client/petstore/go-experimental/go-petstore/api_store.go +++ b/samples/client/petstore/go-experimental/go-petstore/api_store.go @@ -31,7 +31,6 @@ type apiDeleteOrderRequest struct { orderId string } - /* DeleteOrder Delete purchase order by ID For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors @@ -49,7 +48,6 @@ func (a *StoreApiService) DeleteOrder(ctx _context.Context, orderId string) apiD /* Execute executes the request - */ func (r apiDeleteOrderRequest) Execute() (*_nethttp.Response, error) { var ( @@ -58,7 +56,6 @@ func (r apiDeleteOrderRequest) Execute() (*_nethttp.Response, error) { localVarFormFileName string localVarFileName string localVarFileBytes []byte - ) localBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, "StoreApiService.DeleteOrder") @@ -72,7 +69,6 @@ func (r apiDeleteOrderRequest) Execute() (*_nethttp.Response, error) { localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -122,7 +118,6 @@ type apiGetInventoryRequest struct { apiService *StoreApiService } - /* GetInventory Returns pet inventories by status Returns a map of status codes to quantities @@ -138,7 +133,7 @@ func (a *StoreApiService) GetInventory(ctx _context.Context) apiGetInventoryRequ /* Execute executes the request - @return map[string]int32 +@return map[string]int32 */ func (r apiGetInventoryRequest) Execute() (map[string]int32, *_nethttp.Response, error) { var ( @@ -233,7 +228,6 @@ type apiGetOrderByIdRequest struct { orderId int64 } - /* GetOrderById Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions @@ -251,7 +245,7 @@ func (a *StoreApiService) GetOrderById(ctx _context.Context, orderId int64) apiG /* Execute executes the request - @return Order +@return Order */ func (r apiGetOrderByIdRequest) Execute() (Order, *_nethttp.Response, error) { var ( @@ -274,7 +268,6 @@ func (r apiGetOrderByIdRequest) Execute() (Order, *_nethttp.Response, error) { localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - if r.orderId < 1 { return localVarReturnValue, nil, reportError("orderId must be greater than 1") } @@ -340,12 +333,10 @@ type apiPlaceOrderRequest struct { body *Order } - func (r apiPlaceOrderRequest) Body(body Order) apiPlaceOrderRequest { r.body = &body return r } - /* PlaceOrder Place an order for a pet * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -360,7 +351,7 @@ func (a *StoreApiService) PlaceOrder(ctx _context.Context) apiPlaceOrderRequest /* Execute executes the request - @return Order +@return Order */ func (r apiPlaceOrderRequest) Execute() (Order, *_nethttp.Response, error) { var ( @@ -382,7 +373,6 @@ func (r apiPlaceOrderRequest) Execute() (Order, *_nethttp.Response, error) { localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - if r.body == nil { return localVarReturnValue, nil, reportError("body is required and must be specified") } diff --git a/samples/client/petstore/go-experimental/go-petstore/api_user.go b/samples/client/petstore/go-experimental/go-petstore/api_user.go index e3f19d8850dc..6bee2f19b7e8 100644 --- a/samples/client/petstore/go-experimental/go-petstore/api_user.go +++ b/samples/client/petstore/go-experimental/go-petstore/api_user.go @@ -31,12 +31,10 @@ type apiCreateUserRequest struct { body *User } - func (r apiCreateUserRequest) Body(body User) apiCreateUserRequest { r.body = &body return r } - /* CreateUser Create user This can only be done by the logged in user. @@ -52,7 +50,6 @@ func (a *UserApiService) CreateUser(ctx _context.Context) apiCreateUserRequest { /* Execute executes the request - */ func (r apiCreateUserRequest) Execute() (*_nethttp.Response, error) { var ( @@ -61,7 +58,6 @@ func (r apiCreateUserRequest) Execute() (*_nethttp.Response, error) { localVarFormFileName string localVarFileName string localVarFileBytes []byte - ) localBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.CreateUser") @@ -74,7 +70,6 @@ func (r apiCreateUserRequest) Execute() (*_nethttp.Response, error) { localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - if r.body == nil { return nil, reportError("body is required and must be specified") } @@ -130,12 +125,10 @@ type apiCreateUsersWithArrayInputRequest struct { body *[]User } - func (r apiCreateUsersWithArrayInputRequest) Body(body []User) apiCreateUsersWithArrayInputRequest { r.body = &body return r } - /* CreateUsersWithArrayInput Creates list of users with given input array * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -150,7 +143,6 @@ func (a *UserApiService) CreateUsersWithArrayInput(ctx _context.Context) apiCrea /* Execute executes the request - */ func (r apiCreateUsersWithArrayInputRequest) Execute() (*_nethttp.Response, error) { var ( @@ -159,7 +151,6 @@ func (r apiCreateUsersWithArrayInputRequest) Execute() (*_nethttp.Response, erro localVarFormFileName string localVarFileName string localVarFileBytes []byte - ) localBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.CreateUsersWithArrayInput") @@ -172,7 +163,6 @@ func (r apiCreateUsersWithArrayInputRequest) Execute() (*_nethttp.Response, erro localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - if r.body == nil { return nil, reportError("body is required and must be specified") } @@ -228,12 +218,10 @@ type apiCreateUsersWithListInputRequest struct { body *[]User } - func (r apiCreateUsersWithListInputRequest) Body(body []User) apiCreateUsersWithListInputRequest { r.body = &body return r } - /* CreateUsersWithListInput Creates list of users with given input array * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -248,7 +236,6 @@ func (a *UserApiService) CreateUsersWithListInput(ctx _context.Context) apiCreat /* Execute executes the request - */ func (r apiCreateUsersWithListInputRequest) Execute() (*_nethttp.Response, error) { var ( @@ -257,7 +244,6 @@ func (r apiCreateUsersWithListInputRequest) Execute() (*_nethttp.Response, error localVarFormFileName string localVarFileName string localVarFileBytes []byte - ) localBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.CreateUsersWithListInput") @@ -270,7 +256,6 @@ func (r apiCreateUsersWithListInputRequest) Execute() (*_nethttp.Response, error localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - if r.body == nil { return nil, reportError("body is required and must be specified") } @@ -326,7 +311,6 @@ type apiDeleteUserRequest struct { username string } - /* DeleteUser Delete user This can only be done by the logged in user. @@ -344,7 +328,6 @@ func (a *UserApiService) DeleteUser(ctx _context.Context, username string) apiDe /* Execute executes the request - */ func (r apiDeleteUserRequest) Execute() (*_nethttp.Response, error) { var ( @@ -353,7 +336,6 @@ func (r apiDeleteUserRequest) Execute() (*_nethttp.Response, error) { localVarFormFileName string localVarFileName string localVarFileBytes []byte - ) localBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.DeleteUser") @@ -367,7 +349,6 @@ func (r apiDeleteUserRequest) Execute() (*_nethttp.Response, error) { localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -418,7 +399,6 @@ type apiGetUserByNameRequest struct { username string } - /* GetUserByName Get user by user name * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -435,7 +415,7 @@ func (a *UserApiService) GetUserByName(ctx _context.Context, username string) ap /* Execute executes the request - @return User +@return User */ func (r apiGetUserByNameRequest) Execute() (User, *_nethttp.Response, error) { var ( @@ -458,7 +438,6 @@ func (r apiGetUserByNameRequest) Execute() (User, *_nethttp.Response, error) { localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -519,17 +498,14 @@ type apiLoginUserRequest struct { password *string } - func (r apiLoginUserRequest) Username(username string) apiLoginUserRequest { r.username = &username return r } - func (r apiLoginUserRequest) Password(password string) apiLoginUserRequest { r.password = &password return r } - /* LoginUser Logs user into the system * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -544,7 +520,7 @@ func (a *UserApiService) LoginUser(ctx _context.Context) apiLoginUserRequest { /* Execute executes the request - @return string +@return string */ func (r apiLoginUserRequest) Execute() (string, *_nethttp.Response, error) { var ( @@ -566,11 +542,9 @@ func (r apiLoginUserRequest) Execute() (string, *_nethttp.Response, error) { localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - if r.username == nil { return localVarReturnValue, nil, reportError("username is required and must be specified") } - if r.password == nil { return localVarReturnValue, nil, reportError("password is required and must be specified") } @@ -634,7 +608,6 @@ type apiLogoutUserRequest struct { apiService *UserApiService } - /* LogoutUser Logs out current logged in user session * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -649,7 +622,6 @@ func (a *UserApiService) LogoutUser(ctx _context.Context) apiLogoutUserRequest { /* Execute executes the request - */ func (r apiLogoutUserRequest) Execute() (*_nethttp.Response, error) { var ( @@ -658,7 +630,6 @@ func (r apiLogoutUserRequest) Execute() (*_nethttp.Response, error) { localVarFormFileName string localVarFileName string localVarFileBytes []byte - ) localBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.LogoutUser") @@ -722,12 +693,10 @@ type apiUpdateUserRequest struct { body *User } - func (r apiUpdateUserRequest) Body(body User) apiUpdateUserRequest { r.body = &body return r } - /* UpdateUser Updated user This can only be done by the logged in user. @@ -745,7 +714,6 @@ func (a *UserApiService) UpdateUser(ctx _context.Context, username string) apiUp /* Execute executes the request - */ func (r apiUpdateUserRequest) Execute() (*_nethttp.Response, error) { var ( @@ -754,7 +722,6 @@ func (r apiUpdateUserRequest) Execute() (*_nethttp.Response, error) { localVarFormFileName string localVarFileName string localVarFileBytes []byte - ) localBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.UpdateUser") @@ -768,8 +735,6 @@ func (r apiUpdateUserRequest) Execute() (*_nethttp.Response, error) { localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - - if r.body == nil { return nil, reportError("body is required and must be specified") } diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/api_another_fake.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/api_another_fake.go index 23be2a656db9..4aed6e7c47c5 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/api_another_fake.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/api_another_fake.go @@ -30,12 +30,10 @@ type apiCall123TestSpecialTagsRequest struct { client *Client } - func (r apiCall123TestSpecialTagsRequest) Client(client Client) apiCall123TestSpecialTagsRequest { r.client = &client return r } - /* Call123TestSpecialTags To test special tags To test special tags and operation ID starting with number @@ -51,7 +49,7 @@ func (a *AnotherFakeApiService) Call123TestSpecialTags(ctx _context.Context) api /* Execute executes the request - @return Client +@return Client */ func (r apiCall123TestSpecialTagsRequest) Execute() (Client, *_nethttp.Response, error) { var ( @@ -73,7 +71,6 @@ func (r apiCall123TestSpecialTagsRequest) Execute() (Client, *_nethttp.Response, localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - if r.client == nil { return localVarReturnValue, nil, reportError("client is required and must be specified") } diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/api_default.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/api_default.go index 68147dc17826..85cfd5a1b4e7 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/api_default.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/api_default.go @@ -29,7 +29,6 @@ type apiFooGetRequest struct { apiService *DefaultApiService } - /* FooGet Method for FooGet * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -44,7 +43,7 @@ func (a *DefaultApiService) FooGet(ctx _context.Context) apiFooGetRequest { /* Execute executes the request - @return InlineResponseDefault +@return InlineResponseDefault */ func (r apiFooGetRequest) Execute() (InlineResponseDefault, *_nethttp.Response, error) { var ( diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/api_fake.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/api_fake.go index de1429aecf29..4743dcc145ae 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/api_fake.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/api_fake.go @@ -32,7 +32,6 @@ type apiFakeHealthGetRequest struct { apiService *FakeApiService } - /* FakeHealthGet Health check endpoint * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -47,7 +46,7 @@ func (a *FakeApiService) FakeHealthGet(ctx _context.Context) apiFakeHealthGetReq /* Execute executes the request - @return HealthCheckResult +@return HealthCheckResult */ func (r apiFakeHealthGetRequest) Execute() (HealthCheckResult, *_nethttp.Response, error) { var ( @@ -128,12 +127,10 @@ type apiFakeOuterBooleanSerializeRequest struct { body *bool } - func (r apiFakeOuterBooleanSerializeRequest) Body(body bool) apiFakeOuterBooleanSerializeRequest { r.body = &body return r } - /* FakeOuterBooleanSerialize Method for FakeOuterBooleanSerialize Test serialization of outer boolean types @@ -149,7 +146,7 @@ func (a *FakeApiService) FakeOuterBooleanSerialize(ctx _context.Context) apiFake /* Execute executes the request - @return bool +@return bool */ func (r apiFakeOuterBooleanSerializeRequest) Execute() (bool, *_nethttp.Response, error) { var ( @@ -171,7 +168,7 @@ func (r apiFakeOuterBooleanSerializeRequest) Execute() (bool, *_nethttp.Response localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - + // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json"} @@ -232,12 +229,10 @@ type apiFakeOuterCompositeSerializeRequest struct { outerComposite *OuterComposite } - func (r apiFakeOuterCompositeSerializeRequest) OuterComposite(outerComposite OuterComposite) apiFakeOuterCompositeSerializeRequest { r.outerComposite = &outerComposite return r } - /* FakeOuterCompositeSerialize Method for FakeOuterCompositeSerialize Test serialization of object with outer number type @@ -253,7 +248,7 @@ func (a *FakeApiService) FakeOuterCompositeSerialize(ctx _context.Context) apiFa /* Execute executes the request - @return OuterComposite +@return OuterComposite */ func (r apiFakeOuterCompositeSerializeRequest) Execute() (OuterComposite, *_nethttp.Response, error) { var ( @@ -275,7 +270,7 @@ func (r apiFakeOuterCompositeSerializeRequest) Execute() (OuterComposite, *_neth localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - + // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json"} @@ -336,12 +331,10 @@ type apiFakeOuterNumberSerializeRequest struct { body *float32 } - func (r apiFakeOuterNumberSerializeRequest) Body(body float32) apiFakeOuterNumberSerializeRequest { r.body = &body return r } - /* FakeOuterNumberSerialize Method for FakeOuterNumberSerialize Test serialization of outer number types @@ -357,7 +350,7 @@ func (a *FakeApiService) FakeOuterNumberSerialize(ctx _context.Context) apiFakeO /* Execute executes the request - @return float32 +@return float32 */ func (r apiFakeOuterNumberSerializeRequest) Execute() (float32, *_nethttp.Response, error) { var ( @@ -379,7 +372,7 @@ func (r apiFakeOuterNumberSerializeRequest) Execute() (float32, *_nethttp.Respon localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - + // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json"} @@ -440,12 +433,10 @@ type apiFakeOuterStringSerializeRequest struct { body *string } - func (r apiFakeOuterStringSerializeRequest) Body(body string) apiFakeOuterStringSerializeRequest { r.body = &body return r } - /* FakeOuterStringSerialize Method for FakeOuterStringSerialize Test serialization of outer string types @@ -461,7 +452,7 @@ func (a *FakeApiService) FakeOuterStringSerialize(ctx _context.Context) apiFakeO /* Execute executes the request - @return string +@return string */ func (r apiFakeOuterStringSerializeRequest) Execute() (string, *_nethttp.Response, error) { var ( @@ -483,7 +474,7 @@ func (r apiFakeOuterStringSerializeRequest) Execute() (string, *_nethttp.Respons localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - + // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json"} @@ -544,12 +535,10 @@ type apiTestBodyWithFileSchemaRequest struct { fileSchemaTestClass *FileSchemaTestClass } - func (r apiTestBodyWithFileSchemaRequest) FileSchemaTestClass(fileSchemaTestClass FileSchemaTestClass) apiTestBodyWithFileSchemaRequest { r.fileSchemaTestClass = &fileSchemaTestClass return r } - /* TestBodyWithFileSchema Method for TestBodyWithFileSchema For this test, the body for this request much reference a schema named `File`. @@ -565,7 +554,6 @@ func (a *FakeApiService) TestBodyWithFileSchema(ctx _context.Context) apiTestBod /* Execute executes the request - */ func (r apiTestBodyWithFileSchemaRequest) Execute() (*_nethttp.Response, error) { var ( @@ -574,7 +562,6 @@ func (r apiTestBodyWithFileSchemaRequest) Execute() (*_nethttp.Response, error) localVarFormFileName string localVarFileName string localVarFileBytes []byte - ) localBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestBodyWithFileSchema") @@ -587,7 +574,6 @@ func (r apiTestBodyWithFileSchemaRequest) Execute() (*_nethttp.Response, error) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - if r.fileSchemaTestClass == nil { return nil, reportError("fileSchemaTestClass is required and must be specified") } @@ -644,17 +630,14 @@ type apiTestBodyWithQueryParamsRequest struct { user *User } - func (r apiTestBodyWithQueryParamsRequest) Query(query string) apiTestBodyWithQueryParamsRequest { r.query = &query return r } - func (r apiTestBodyWithQueryParamsRequest) User(user User) apiTestBodyWithQueryParamsRequest { r.user = &user return r } - /* TestBodyWithQueryParams Method for TestBodyWithQueryParams * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -669,7 +652,6 @@ func (a *FakeApiService) TestBodyWithQueryParams(ctx _context.Context) apiTestBo /* Execute executes the request - */ func (r apiTestBodyWithQueryParamsRequest) Execute() (*_nethttp.Response, error) { var ( @@ -678,7 +660,6 @@ func (r apiTestBodyWithQueryParamsRequest) Execute() (*_nethttp.Response, error) localVarFormFileName string localVarFileName string localVarFileBytes []byte - ) localBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestBodyWithQueryParams") @@ -691,11 +672,9 @@ func (r apiTestBodyWithQueryParamsRequest) Execute() (*_nethttp.Response, error) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - if r.query == nil { return nil, reportError("query is required and must be specified") } - if r.user == nil { return nil, reportError("user is required and must be specified") } @@ -752,12 +731,10 @@ type apiTestClientModelRequest struct { client *Client } - func (r apiTestClientModelRequest) Client(client Client) apiTestClientModelRequest { r.client = &client return r } - /* TestClientModel To test \"client\" model To test "client" model @@ -773,7 +750,7 @@ func (a *FakeApiService) TestClientModel(ctx _context.Context) apiTestClientMode /* Execute executes the request - @return Client +@return Client */ func (r apiTestClientModelRequest) Execute() (Client, *_nethttp.Response, error) { var ( @@ -795,7 +772,6 @@ func (r apiTestClientModelRequest) Execute() (Client, *_nethttp.Response, error) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - if r.client == nil { return localVarReturnValue, nil, reportError("client is required and must be specified") } @@ -873,77 +849,62 @@ type apiTestEndpointParametersRequest struct { callback *string } - func (r apiTestEndpointParametersRequest) Number(number float32) apiTestEndpointParametersRequest { r.number = &number return r } - func (r apiTestEndpointParametersRequest) Double(double float64) apiTestEndpointParametersRequest { r.double = &double return r } - func (r apiTestEndpointParametersRequest) PatternWithoutDelimiter(patternWithoutDelimiter string) apiTestEndpointParametersRequest { r.patternWithoutDelimiter = &patternWithoutDelimiter return r } - func (r apiTestEndpointParametersRequest) Byte_(byte_ string) apiTestEndpointParametersRequest { r.byte_ = &byte_ return r } - func (r apiTestEndpointParametersRequest) Integer(integer int32) apiTestEndpointParametersRequest { r.integer = &integer return r } - func (r apiTestEndpointParametersRequest) Int32_(int32_ int32) apiTestEndpointParametersRequest { r.int32_ = &int32_ return r } - func (r apiTestEndpointParametersRequest) Int64_(int64_ int64) apiTestEndpointParametersRequest { r.int64_ = &int64_ return r } - func (r apiTestEndpointParametersRequest) Float(float float32) apiTestEndpointParametersRequest { r.float = &float return r } - func (r apiTestEndpointParametersRequest) String_(string_ string) apiTestEndpointParametersRequest { r.string_ = &string_ return r } - func (r apiTestEndpointParametersRequest) Binary(binary *os.File) apiTestEndpointParametersRequest { r.binary = &binary return r } - func (r apiTestEndpointParametersRequest) Date(date string) apiTestEndpointParametersRequest { r.date = &date return r } - func (r apiTestEndpointParametersRequest) DateTime(dateTime time.Time) apiTestEndpointParametersRequest { r.dateTime = &dateTime return r } - func (r apiTestEndpointParametersRequest) Password(password string) apiTestEndpointParametersRequest { r.password = &password return r } - func (r apiTestEndpointParametersRequest) Callback(callback string) apiTestEndpointParametersRequest { r.callback = &callback return r } - /* TestEndpointParameters Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 Fake endpoint for testing various parameters @@ -963,7 +924,6 @@ func (a *FakeApiService) TestEndpointParameters(ctx _context.Context) apiTestEnd /* Execute executes the request - */ func (r apiTestEndpointParametersRequest) Execute() (*_nethttp.Response, error) { var ( @@ -972,7 +932,6 @@ func (r apiTestEndpointParametersRequest) Execute() (*_nethttp.Response, error) localVarFormFileName string localVarFileName string localVarFileBytes []byte - ) localBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestEndpointParameters") @@ -985,7 +944,6 @@ func (r apiTestEndpointParametersRequest) Execute() (*_nethttp.Response, error) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - if r.number == nil { return nil, reportError("number is required and must be specified") } @@ -995,7 +953,6 @@ func (r apiTestEndpointParametersRequest) Execute() (*_nethttp.Response, error) if *r.number > 543.2 { return nil, reportError("number must be less than 543.2") } - if r.double == nil { return nil, reportError("double is required and must be specified") } @@ -1005,15 +962,13 @@ func (r apiTestEndpointParametersRequest) Execute() (*_nethttp.Response, error) if *r.double > 123.4 { return nil, reportError("double must be less than 123.4") } - if r.patternWithoutDelimiter == nil { return nil, reportError("patternWithoutDelimiter is required and must be specified") } - if r.byte_ == nil { return nil, reportError("byte_ is required and must be specified") } - + // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/x-www-form-urlencoded"} @@ -1112,47 +1067,38 @@ type apiTestEnumParametersRequest struct { enumFormString *string } - func (r apiTestEnumParametersRequest) EnumHeaderStringArray(enumHeaderStringArray []string) apiTestEnumParametersRequest { r.enumHeaderStringArray = &enumHeaderStringArray return r } - func (r apiTestEnumParametersRequest) EnumHeaderString(enumHeaderString string) apiTestEnumParametersRequest { r.enumHeaderString = &enumHeaderString return r } - func (r apiTestEnumParametersRequest) EnumQueryStringArray(enumQueryStringArray []string) apiTestEnumParametersRequest { r.enumQueryStringArray = &enumQueryStringArray return r } - func (r apiTestEnumParametersRequest) EnumQueryString(enumQueryString string) apiTestEnumParametersRequest { r.enumQueryString = &enumQueryString return r } - func (r apiTestEnumParametersRequest) EnumQueryInteger(enumQueryInteger int32) apiTestEnumParametersRequest { r.enumQueryInteger = &enumQueryInteger return r } - func (r apiTestEnumParametersRequest) EnumQueryDouble(enumQueryDouble float64) apiTestEnumParametersRequest { r.enumQueryDouble = &enumQueryDouble return r } - func (r apiTestEnumParametersRequest) EnumFormStringArray(enumFormStringArray []string) apiTestEnumParametersRequest { r.enumFormStringArray = &enumFormStringArray return r } - func (r apiTestEnumParametersRequest) EnumFormString(enumFormString string) apiTestEnumParametersRequest { r.enumFormString = &enumFormString return r } - /* TestEnumParameters To test enum parameters To test enum parameters @@ -1168,7 +1114,6 @@ func (a *FakeApiService) TestEnumParameters(ctx _context.Context) apiTestEnumPar /* Execute executes the request - */ func (r apiTestEnumParametersRequest) Execute() (*_nethttp.Response, error) { var ( @@ -1177,7 +1122,6 @@ func (r apiTestEnumParametersRequest) Execute() (*_nethttp.Response, error) { localVarFormFileName string localVarFileName string localVarFileBytes []byte - ) localBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestEnumParameters") @@ -1190,7 +1134,7 @@ func (r apiTestEnumParametersRequest) Execute() (*_nethttp.Response, error) { localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - + if r.enumQueryStringArray != nil { t := *r.enumQueryStringArray if reflect.TypeOf(t).Kind() == reflect.Slice { @@ -1277,37 +1221,30 @@ type apiTestGroupParametersRequest struct { int64Group *int64 } - func (r apiTestGroupParametersRequest) RequiredStringGroup(requiredStringGroup int32) apiTestGroupParametersRequest { r.requiredStringGroup = &requiredStringGroup return r } - func (r apiTestGroupParametersRequest) RequiredBooleanGroup(requiredBooleanGroup bool) apiTestGroupParametersRequest { r.requiredBooleanGroup = &requiredBooleanGroup return r } - func (r apiTestGroupParametersRequest) RequiredInt64Group(requiredInt64Group int64) apiTestGroupParametersRequest { r.requiredInt64Group = &requiredInt64Group return r } - func (r apiTestGroupParametersRequest) StringGroup(stringGroup int32) apiTestGroupParametersRequest { r.stringGroup = &stringGroup return r } - func (r apiTestGroupParametersRequest) BooleanGroup(booleanGroup bool) apiTestGroupParametersRequest { r.booleanGroup = &booleanGroup return r } - func (r apiTestGroupParametersRequest) Int64Group(int64Group int64) apiTestGroupParametersRequest { r.int64Group = &int64Group return r } - /* TestGroupParameters Fake endpoint to test group parameters (optional) Fake endpoint to test group parameters (optional) @@ -1323,7 +1260,6 @@ func (a *FakeApiService) TestGroupParameters(ctx _context.Context) apiTestGroupP /* Execute executes the request - */ func (r apiTestGroupParametersRequest) Execute() (*_nethttp.Response, error) { var ( @@ -1332,7 +1268,6 @@ func (r apiTestGroupParametersRequest) Execute() (*_nethttp.Response, error) { localVarFormFileName string localVarFileName string localVarFileBytes []byte - ) localBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestGroupParameters") @@ -1345,19 +1280,16 @@ func (r apiTestGroupParametersRequest) Execute() (*_nethttp.Response, error) { localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - if r.requiredStringGroup == nil { return nil, reportError("requiredStringGroup is required and must be specified") } - if r.requiredBooleanGroup == nil { return nil, reportError("requiredBooleanGroup is required and must be specified") } - if r.requiredInt64Group == nil { return nil, reportError("requiredInt64Group is required and must be specified") } - + localVarQueryParams.Add("required_string_group", parameterToString(*r.requiredStringGroup, "")) localVarQueryParams.Add("required_int64_group", parameterToString(*r.requiredInt64Group, "")) if r.stringGroup != nil { @@ -1419,12 +1351,10 @@ type apiTestInlineAdditionalPropertiesRequest struct { requestBody *map[string]string } - func (r apiTestInlineAdditionalPropertiesRequest) RequestBody(requestBody map[string]string) apiTestInlineAdditionalPropertiesRequest { r.requestBody = &requestBody return r } - /* TestInlineAdditionalProperties test inline additionalProperties * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -1439,7 +1369,6 @@ func (a *FakeApiService) TestInlineAdditionalProperties(ctx _context.Context) ap /* Execute executes the request - */ func (r apiTestInlineAdditionalPropertiesRequest) Execute() (*_nethttp.Response, error) { var ( @@ -1448,7 +1377,6 @@ func (r apiTestInlineAdditionalPropertiesRequest) Execute() (*_nethttp.Response, localVarFormFileName string localVarFileName string localVarFileBytes []byte - ) localBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestInlineAdditionalProperties") @@ -1461,7 +1389,6 @@ func (r apiTestInlineAdditionalPropertiesRequest) Execute() (*_nethttp.Response, localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - if r.requestBody == nil { return nil, reportError("requestBody is required and must be specified") } @@ -1518,17 +1445,14 @@ type apiTestJsonFormDataRequest struct { param2 *string } - func (r apiTestJsonFormDataRequest) Param(param string) apiTestJsonFormDataRequest { r.param = ¶m return r } - func (r apiTestJsonFormDataRequest) Param2(param2 string) apiTestJsonFormDataRequest { r.param2 = ¶m2 return r } - /* TestJsonFormData test json serialization of form data * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -1543,7 +1467,6 @@ func (a *FakeApiService) TestJsonFormData(ctx _context.Context) apiTestJsonFormD /* Execute executes the request - */ func (r apiTestJsonFormDataRequest) Execute() (*_nethttp.Response, error) { var ( @@ -1552,7 +1475,6 @@ func (r apiTestJsonFormDataRequest) Execute() (*_nethttp.Response, error) { localVarFormFileName string localVarFileName string localVarFileBytes []byte - ) localBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestJsonFormData") @@ -1565,11 +1487,9 @@ func (r apiTestJsonFormDataRequest) Execute() (*_nethttp.Response, error) { localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - if r.param == nil { return nil, reportError("param is required and must be specified") } - if r.param2 == nil { return nil, reportError("param2 is required and must be specified") } @@ -1629,32 +1549,26 @@ type apiTestQueryParameterCollectionFormatRequest struct { context *[]string } - func (r apiTestQueryParameterCollectionFormatRequest) Pipe(pipe []string) apiTestQueryParameterCollectionFormatRequest { r.pipe = &pipe return r } - func (r apiTestQueryParameterCollectionFormatRequest) Ioutil(ioutil []string) apiTestQueryParameterCollectionFormatRequest { r.ioutil = &ioutil return r } - func (r apiTestQueryParameterCollectionFormatRequest) Http(http []string) apiTestQueryParameterCollectionFormatRequest { r.http = &http return r } - func (r apiTestQueryParameterCollectionFormatRequest) Url(url []string) apiTestQueryParameterCollectionFormatRequest { r.url = &url return r } - func (r apiTestQueryParameterCollectionFormatRequest) Context(context []string) apiTestQueryParameterCollectionFormatRequest { r.context = &context return r } - /* TestQueryParameterCollectionFormat Method for TestQueryParameterCollectionFormat To test the collection format in query parameters @@ -1670,7 +1584,6 @@ func (a *FakeApiService) TestQueryParameterCollectionFormat(ctx _context.Context /* Execute executes the request - */ func (r apiTestQueryParameterCollectionFormatRequest) Execute() (*_nethttp.Response, error) { var ( @@ -1679,7 +1592,6 @@ func (r apiTestQueryParameterCollectionFormatRequest) Execute() (*_nethttp.Respo localVarFormFileName string localVarFileName string localVarFileBytes []byte - ) localBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestQueryParameterCollectionFormat") @@ -1692,23 +1604,18 @@ func (r apiTestQueryParameterCollectionFormatRequest) Execute() (*_nethttp.Respo localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - if r.pipe == nil { return nil, reportError("pipe is required and must be specified") } - if r.ioutil == nil { return nil, reportError("ioutil is required and must be specified") } - if r.http == nil { return nil, reportError("http is required and must be specified") } - if r.url == nil { return nil, reportError("url is required and must be specified") } - if r.context == nil { return nil, reportError("context is required and must be specified") } diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/api_fake_classname_tags123.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/api_fake_classname_tags123.go index 04ba7468f354..4456d5af6e73 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/api_fake_classname_tags123.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/api_fake_classname_tags123.go @@ -30,12 +30,10 @@ type apiTestClassnameRequest struct { client *Client } - func (r apiTestClassnameRequest) Client(client Client) apiTestClassnameRequest { r.client = &client return r } - /* TestClassname To test class name in snake case To test class name in snake case @@ -51,7 +49,7 @@ func (a *FakeClassnameTags123ApiService) TestClassname(ctx _context.Context) api /* Execute executes the request - @return Client +@return Client */ func (r apiTestClassnameRequest) Execute() (Client, *_nethttp.Response, error) { var ( @@ -73,7 +71,6 @@ func (r apiTestClassnameRequest) Execute() (Client, *_nethttp.Response, error) { localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - if r.client == nil { return localVarReturnValue, nil, reportError("client is required and must be specified") } diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/api_pet.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/api_pet.go index 66c99d700564..31bdd2c3cf87 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/api_pet.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/api_pet.go @@ -32,12 +32,10 @@ type apiAddPetRequest struct { pet *Pet } - func (r apiAddPetRequest) Pet(pet Pet) apiAddPetRequest { r.pet = &pet return r } - /* AddPet Add a new pet to the store * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -52,7 +50,6 @@ func (a *PetApiService) AddPet(ctx _context.Context) apiAddPetRequest { /* Execute executes the request - */ func (r apiAddPetRequest) Execute() (*_nethttp.Response, error) { var ( @@ -61,7 +58,6 @@ func (r apiAddPetRequest) Execute() (*_nethttp.Response, error) { localVarFormFileName string localVarFileName string localVarFileBytes []byte - ) localBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.AddPet") @@ -74,7 +70,6 @@ func (r apiAddPetRequest) Execute() (*_nethttp.Response, error) { localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - if r.pet == nil { return nil, reportError("pet is required and must be specified") } @@ -131,12 +126,10 @@ type apiDeletePetRequest struct { apiKey *string } - func (r apiDeletePetRequest) ApiKey(apiKey string) apiDeletePetRequest { r.apiKey = &apiKey return r } - /* DeletePet Deletes a pet * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -153,7 +146,6 @@ func (a *PetApiService) DeletePet(ctx _context.Context, petId int64) apiDeletePe /* Execute executes the request - */ func (r apiDeletePetRequest) Execute() (*_nethttp.Response, error) { var ( @@ -162,7 +154,6 @@ func (r apiDeletePetRequest) Execute() (*_nethttp.Response, error) { localVarFormFileName string localVarFileName string localVarFileBytes []byte - ) localBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.DeletePet") @@ -176,8 +167,7 @@ func (r apiDeletePetRequest) Execute() (*_nethttp.Response, error) { localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - - + // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -230,12 +220,10 @@ type apiFindPetsByStatusRequest struct { status *[]string } - func (r apiFindPetsByStatusRequest) Status(status []string) apiFindPetsByStatusRequest { r.status = &status return r } - /* FindPetsByStatus Finds Pets by status Multiple status values can be provided with comma separated strings @@ -251,7 +239,7 @@ func (a *PetApiService) FindPetsByStatus(ctx _context.Context) apiFindPetsByStat /* Execute executes the request - @return []Pet +@return []Pet */ func (r apiFindPetsByStatusRequest) Execute() ([]Pet, *_nethttp.Response, error) { var ( @@ -273,7 +261,6 @@ func (r apiFindPetsByStatusRequest) Execute() ([]Pet, *_nethttp.Response, error) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - if r.status == nil { return localVarReturnValue, nil, reportError("status is required and must be specified") } @@ -337,12 +324,10 @@ type apiFindPetsByTagsRequest struct { tags *[]string } - func (r apiFindPetsByTagsRequest) Tags(tags []string) apiFindPetsByTagsRequest { r.tags = &tags return r } - /* FindPetsByTags Finds Pets by tags Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. @@ -358,7 +343,7 @@ func (a *PetApiService) FindPetsByTags(ctx _context.Context) apiFindPetsByTagsRe /* Execute executes the request - @return []Pet +@return []Pet */ func (r apiFindPetsByTagsRequest) Execute() ([]Pet, *_nethttp.Response, error) { var ( @@ -380,7 +365,6 @@ func (r apiFindPetsByTagsRequest) Execute() ([]Pet, *_nethttp.Response, error) { localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - if r.tags == nil { return localVarReturnValue, nil, reportError("tags is required and must be specified") } @@ -444,7 +428,6 @@ type apiGetPetByIdRequest struct { petId int64 } - /* GetPetById Find pet by ID Returns a single pet @@ -462,7 +445,7 @@ func (a *PetApiService) GetPetById(ctx _context.Context, petId int64) apiGetPetB /* Execute executes the request - @return Pet +@return Pet */ func (r apiGetPetByIdRequest) Execute() (Pet, *_nethttp.Response, error) { var ( @@ -485,7 +468,6 @@ func (r apiGetPetByIdRequest) Execute() (Pet, *_nethttp.Response, error) { localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -559,12 +541,10 @@ type apiUpdatePetRequest struct { pet *Pet } - func (r apiUpdatePetRequest) Pet(pet Pet) apiUpdatePetRequest { r.pet = &pet return r } - /* UpdatePet Update an existing pet * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -579,7 +559,6 @@ func (a *PetApiService) UpdatePet(ctx _context.Context) apiUpdatePetRequest { /* Execute executes the request - */ func (r apiUpdatePetRequest) Execute() (*_nethttp.Response, error) { var ( @@ -588,7 +567,6 @@ func (r apiUpdatePetRequest) Execute() (*_nethttp.Response, error) { localVarFormFileName string localVarFileName string localVarFileBytes []byte - ) localBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.UpdatePet") @@ -601,7 +579,6 @@ func (r apiUpdatePetRequest) Execute() (*_nethttp.Response, error) { localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - if r.pet == nil { return nil, reportError("pet is required and must be specified") } @@ -659,17 +636,14 @@ type apiUpdatePetWithFormRequest struct { status *string } - func (r apiUpdatePetWithFormRequest) Name(name string) apiUpdatePetWithFormRequest { r.name = &name return r } - func (r apiUpdatePetWithFormRequest) Status(status string) apiUpdatePetWithFormRequest { r.status = &status return r } - /* UpdatePetWithForm Updates a pet in the store with form data * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -686,7 +660,6 @@ func (a *PetApiService) UpdatePetWithForm(ctx _context.Context, petId int64) api /* Execute executes the request - */ func (r apiUpdatePetWithFormRequest) Execute() (*_nethttp.Response, error) { var ( @@ -695,7 +668,6 @@ func (r apiUpdatePetWithFormRequest) Execute() (*_nethttp.Response, error) { localVarFormFileName string localVarFileName string localVarFileBytes []byte - ) localBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.UpdatePetWithForm") @@ -709,8 +681,7 @@ func (r apiUpdatePetWithFormRequest) Execute() (*_nethttp.Response, error) { localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - - + // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/x-www-form-urlencoded"} @@ -768,17 +739,14 @@ type apiUploadFileRequest struct { file **os.File } - func (r apiUploadFileRequest) AdditionalMetadata(additionalMetadata string) apiUploadFileRequest { r.additionalMetadata = &additionalMetadata return r } - func (r apiUploadFileRequest) File(file *os.File) apiUploadFileRequest { r.file = &file return r } - /* UploadFile uploads an image * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -795,7 +763,7 @@ func (a *PetApiService) UploadFile(ctx _context.Context, petId int64) apiUploadF /* Execute executes the request - @return ApiResponse +@return ApiResponse */ func (r apiUploadFileRequest) Execute() (ApiResponse, *_nethttp.Response, error) { var ( @@ -818,8 +786,7 @@ func (r apiUploadFileRequest) Execute() (ApiResponse, *_nethttp.Response, error) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - - + // to determine the Content-Type header localVarHTTPContentTypes := []string{"multipart/form-data"} @@ -894,17 +861,14 @@ type apiUploadFileWithRequiredFileRequest struct { additionalMetadata *string } - func (r apiUploadFileWithRequiredFileRequest) RequiredFile(requiredFile *os.File) apiUploadFileWithRequiredFileRequest { r.requiredFile = &requiredFile return r } - func (r apiUploadFileWithRequiredFileRequest) AdditionalMetadata(additionalMetadata string) apiUploadFileWithRequiredFileRequest { r.additionalMetadata = &additionalMetadata return r } - /* UploadFileWithRequiredFile uploads an image (required) * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -921,7 +885,7 @@ func (a *PetApiService) UploadFileWithRequiredFile(ctx _context.Context, petId i /* Execute executes the request - @return ApiResponse +@return ApiResponse */ func (r apiUploadFileWithRequiredFileRequest) Execute() (ApiResponse, *_nethttp.Response, error) { var ( @@ -944,12 +908,10 @@ func (r apiUploadFileWithRequiredFileRequest) Execute() (ApiResponse, *_nethttp. localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - - if r.requiredFile == nil { return localVarReturnValue, nil, reportError("requiredFile is required and must be specified") } - + // to determine the Content-Type header localVarHTTPContentTypes := []string{"multipart/form-data"} diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/api_store.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/api_store.go index a4bdc3009ea9..6d48bf45defb 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/api_store.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/api_store.go @@ -31,7 +31,6 @@ type apiDeleteOrderRequest struct { orderId string } - /* DeleteOrder Delete purchase order by ID For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors @@ -49,7 +48,6 @@ func (a *StoreApiService) DeleteOrder(ctx _context.Context, orderId string) apiD /* Execute executes the request - */ func (r apiDeleteOrderRequest) Execute() (*_nethttp.Response, error) { var ( @@ -58,7 +56,6 @@ func (r apiDeleteOrderRequest) Execute() (*_nethttp.Response, error) { localVarFormFileName string localVarFileName string localVarFileBytes []byte - ) localBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, "StoreApiService.DeleteOrder") @@ -72,7 +69,6 @@ func (r apiDeleteOrderRequest) Execute() (*_nethttp.Response, error) { localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -122,7 +118,6 @@ type apiGetInventoryRequest struct { apiService *StoreApiService } - /* GetInventory Returns pet inventories by status Returns a map of status codes to quantities @@ -138,7 +133,7 @@ func (a *StoreApiService) GetInventory(ctx _context.Context) apiGetInventoryRequ /* Execute executes the request - @return map[string]int32 +@return map[string]int32 */ func (r apiGetInventoryRequest) Execute() (map[string]int32, *_nethttp.Response, error) { var ( @@ -233,7 +228,6 @@ type apiGetOrderByIdRequest struct { orderId int64 } - /* GetOrderById Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions @@ -251,7 +245,7 @@ func (a *StoreApiService) GetOrderById(ctx _context.Context, orderId int64) apiG /* Execute executes the request - @return Order +@return Order */ func (r apiGetOrderByIdRequest) Execute() (Order, *_nethttp.Response, error) { var ( @@ -274,7 +268,6 @@ func (r apiGetOrderByIdRequest) Execute() (Order, *_nethttp.Response, error) { localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - if r.orderId < 1 { return localVarReturnValue, nil, reportError("orderId must be greater than 1") } @@ -340,12 +333,10 @@ type apiPlaceOrderRequest struct { order *Order } - func (r apiPlaceOrderRequest) Order(order Order) apiPlaceOrderRequest { r.order = &order return r } - /* PlaceOrder Place an order for a pet * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -360,7 +351,7 @@ func (a *StoreApiService) PlaceOrder(ctx _context.Context) apiPlaceOrderRequest /* Execute executes the request - @return Order +@return Order */ func (r apiPlaceOrderRequest) Execute() (Order, *_nethttp.Response, error) { var ( @@ -382,7 +373,6 @@ func (r apiPlaceOrderRequest) Execute() (Order, *_nethttp.Response, error) { localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - if r.order == nil { return localVarReturnValue, nil, reportError("order is required and must be specified") } diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/api_user.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/api_user.go index 09570f58d9fb..4a8a6ac10c53 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/api_user.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/api_user.go @@ -31,12 +31,10 @@ type apiCreateUserRequest struct { user *User } - func (r apiCreateUserRequest) User(user User) apiCreateUserRequest { r.user = &user return r } - /* CreateUser Create user This can only be done by the logged in user. @@ -52,7 +50,6 @@ func (a *UserApiService) CreateUser(ctx _context.Context) apiCreateUserRequest { /* Execute executes the request - */ func (r apiCreateUserRequest) Execute() (*_nethttp.Response, error) { var ( @@ -61,7 +58,6 @@ func (r apiCreateUserRequest) Execute() (*_nethttp.Response, error) { localVarFormFileName string localVarFileName string localVarFileBytes []byte - ) localBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.CreateUser") @@ -74,7 +70,6 @@ func (r apiCreateUserRequest) Execute() (*_nethttp.Response, error) { localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - if r.user == nil { return nil, reportError("user is required and must be specified") } @@ -130,12 +125,10 @@ type apiCreateUsersWithArrayInputRequest struct { user *[]User } - func (r apiCreateUsersWithArrayInputRequest) User(user []User) apiCreateUsersWithArrayInputRequest { r.user = &user return r } - /* CreateUsersWithArrayInput Creates list of users with given input array * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -150,7 +143,6 @@ func (a *UserApiService) CreateUsersWithArrayInput(ctx _context.Context) apiCrea /* Execute executes the request - */ func (r apiCreateUsersWithArrayInputRequest) Execute() (*_nethttp.Response, error) { var ( @@ -159,7 +151,6 @@ func (r apiCreateUsersWithArrayInputRequest) Execute() (*_nethttp.Response, erro localVarFormFileName string localVarFileName string localVarFileBytes []byte - ) localBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.CreateUsersWithArrayInput") @@ -172,7 +163,6 @@ func (r apiCreateUsersWithArrayInputRequest) Execute() (*_nethttp.Response, erro localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - if r.user == nil { return nil, reportError("user is required and must be specified") } @@ -228,12 +218,10 @@ type apiCreateUsersWithListInputRequest struct { user *[]User } - func (r apiCreateUsersWithListInputRequest) User(user []User) apiCreateUsersWithListInputRequest { r.user = &user return r } - /* CreateUsersWithListInput Creates list of users with given input array * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -248,7 +236,6 @@ func (a *UserApiService) CreateUsersWithListInput(ctx _context.Context) apiCreat /* Execute executes the request - */ func (r apiCreateUsersWithListInputRequest) Execute() (*_nethttp.Response, error) { var ( @@ -257,7 +244,6 @@ func (r apiCreateUsersWithListInputRequest) Execute() (*_nethttp.Response, error localVarFormFileName string localVarFileName string localVarFileBytes []byte - ) localBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.CreateUsersWithListInput") @@ -270,7 +256,6 @@ func (r apiCreateUsersWithListInputRequest) Execute() (*_nethttp.Response, error localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - if r.user == nil { return nil, reportError("user is required and must be specified") } @@ -326,7 +311,6 @@ type apiDeleteUserRequest struct { username string } - /* DeleteUser Delete user This can only be done by the logged in user. @@ -344,7 +328,6 @@ func (a *UserApiService) DeleteUser(ctx _context.Context, username string) apiDe /* Execute executes the request - */ func (r apiDeleteUserRequest) Execute() (*_nethttp.Response, error) { var ( @@ -353,7 +336,6 @@ func (r apiDeleteUserRequest) Execute() (*_nethttp.Response, error) { localVarFormFileName string localVarFileName string localVarFileBytes []byte - ) localBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.DeleteUser") @@ -367,7 +349,6 @@ func (r apiDeleteUserRequest) Execute() (*_nethttp.Response, error) { localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -418,7 +399,6 @@ type apiGetUserByNameRequest struct { username string } - /* GetUserByName Get user by user name * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -435,7 +415,7 @@ func (a *UserApiService) GetUserByName(ctx _context.Context, username string) ap /* Execute executes the request - @return User +@return User */ func (r apiGetUserByNameRequest) Execute() (User, *_nethttp.Response, error) { var ( @@ -458,7 +438,6 @@ func (r apiGetUserByNameRequest) Execute() (User, *_nethttp.Response, error) { localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -519,17 +498,14 @@ type apiLoginUserRequest struct { password *string } - func (r apiLoginUserRequest) Username(username string) apiLoginUserRequest { r.username = &username return r } - func (r apiLoginUserRequest) Password(password string) apiLoginUserRequest { r.password = &password return r } - /* LoginUser Logs user into the system * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -544,7 +520,7 @@ func (a *UserApiService) LoginUser(ctx _context.Context) apiLoginUserRequest { /* Execute executes the request - @return string +@return string */ func (r apiLoginUserRequest) Execute() (string, *_nethttp.Response, error) { var ( @@ -566,11 +542,9 @@ func (r apiLoginUserRequest) Execute() (string, *_nethttp.Response, error) { localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - if r.username == nil { return localVarReturnValue, nil, reportError("username is required and must be specified") } - if r.password == nil { return localVarReturnValue, nil, reportError("password is required and must be specified") } @@ -634,7 +608,6 @@ type apiLogoutUserRequest struct { apiService *UserApiService } - /* LogoutUser Logs out current logged in user session * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -649,7 +622,6 @@ func (a *UserApiService) LogoutUser(ctx _context.Context) apiLogoutUserRequest { /* Execute executes the request - */ func (r apiLogoutUserRequest) Execute() (*_nethttp.Response, error) { var ( @@ -658,7 +630,6 @@ func (r apiLogoutUserRequest) Execute() (*_nethttp.Response, error) { localVarFormFileName string localVarFileName string localVarFileBytes []byte - ) localBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.LogoutUser") @@ -722,12 +693,10 @@ type apiUpdateUserRequest struct { user *User } - func (r apiUpdateUserRequest) User(user User) apiUpdateUserRequest { r.user = &user return r } - /* UpdateUser Updated user This can only be done by the logged in user. @@ -745,7 +714,6 @@ func (a *UserApiService) UpdateUser(ctx _context.Context, username string) apiUp /* Execute executes the request - */ func (r apiUpdateUserRequest) Execute() (*_nethttp.Response, error) { var ( @@ -754,7 +722,6 @@ func (r apiUpdateUserRequest) Execute() (*_nethttp.Response, error) { localVarFormFileName string localVarFileName string localVarFileBytes []byte - ) localBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.UpdateUser") @@ -768,8 +735,6 @@ func (r apiUpdateUserRequest) Execute() (*_nethttp.Response, error) { localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - - if r.user == nil { return nil, reportError("user is required and must be specified") } diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/signing.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/signing.go index 07209028266d..2adb5e276763 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/signing.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/signing.go @@ -48,7 +48,7 @@ const ( // The 'Host' header, as defined in RFC 2616, section 14.23. HttpHeaderHost string = "Host" // The 'Date' header. - HttpHeaderDate string = "Date" + HttpHeaderDate string = "Date" // The digest header, as defined in RFC 3230, section 4.3.2. HttpHeaderDigest string = "Digest" // The HTTP Authorization header, as defined in RFC 7235, section 4.2. @@ -114,7 +114,7 @@ type HttpSignatureAuth struct { SigningScheme string // The signature scheme, when signing HTTP requests. Supported value is 'hs2019'. // The signature algorithm, when signing HTTP requests. // Supported values are RSASSA-PKCS1-v1_5, RSASSA-PSS. - SigningAlgorithm string + SigningAlgorithm string SignedHeaders []string // A list of HTTP headers included when generating the signature for the message. // SignatureMaxValidity specifies the maximum duration of the signature validity. // The value is used to set the '(expires)' signature parameter in the HTTP request. From d143f8db5c9f94285307b40d7e24e0ef79a91687 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Sat, 1 Aug 2020 10:45:25 +0800 Subject: [PATCH 101/129] skip some installations to shorten build time --- .travis.yml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index f8cb2a06187a..fe85897c6d8e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -77,11 +77,13 @@ before_install: - 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 + # -- 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 + #- 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 @@ -93,9 +95,6 @@ before_install: - phpenv versions - phpenv global 7.2.15 - php -v - # install perl module - #- cpanm --local-lib=~/perl5 local::lib && eval $(perl -I ~/perl5/lib/perl5/ -Mlocal::lib) - #- cpanm Test::Exception Test::More Log::Any LWP::UserAgent JSON URI:Query Module::Runtime DateTime Module::Find Moose::Role # 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). @@ -107,9 +106,11 @@ before_install: # install Qt5 - sudo apt install -y --no-install-recommends qt5-default - cmake --version + # -- skip perl test to shorten build time # 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 "Igorned failure from cpanm" + # -- skip perl test end # show host table to confirm petstore.swagger.io is mapped to localhost - cat /etc/hosts # show java version From 62e5950799c68fa0637cf4d7b8979a4aa76c380f Mon Sep 17 00:00:00 2001 From: Jim Schubert Date: Sat, 1 Aug 2020 06:35:55 -0400 Subject: [PATCH 102/129] [online] Fix for version conflicts with springfox/boot (#7102) --- modules/openapi-generator-online/pom.xml | 14 +++++++++----- .../codegen/online/OpenAPI2SpringBoot.java | 6 ++++++ .../codegen/online/api/GenApiControllerTest.java | 14 +++++++------- 3 files changed, 22 insertions(+), 12 deletions(-) diff --git a/modules/openapi-generator-online/pom.xml b/modules/openapi-generator-online/pom.xml index c158dd879f34..08f9c33febc1 100644 --- a/modules/openapi-generator-online/pom.xml +++ b/modules/openapi-generator-online/pom.xml @@ -15,8 +15,8 @@ 1.8 ${java.version} ${java.version} - 2.0.7.RELEASE - 2.8.0 + 2.2.9.RELEASE + 3.0.0 4.13 2.10.2 @@ -105,13 +105,17 @@ ${springfox-version} - io.swagger - swagger-annotations - + io.swagger + swagger-annotations + io.swagger swagger-models + + com.google.guava + guava + diff --git a/modules/openapi-generator-online/src/main/java/org/openapitools/codegen/online/OpenAPI2SpringBoot.java b/modules/openapi-generator-online/src/main/java/org/openapitools/codegen/online/OpenAPI2SpringBoot.java index f3d367e22489..91fb6c32fd3b 100644 --- a/modules/openapi-generator-online/src/main/java/org/openapitools/codegen/online/OpenAPI2SpringBoot.java +++ b/modules/openapi-generator-online/src/main/java/org/openapitools/codegen/online/OpenAPI2SpringBoot.java @@ -23,6 +23,7 @@ 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; @@ -60,4 +61,9 @@ public void addCorsMappings(CorsRegistry registry) { } }; } + + @Bean + ForwardedHeaderFilter forwardedHeaderFilter() { + return new ForwardedHeaderFilter(); + } } diff --git a/modules/openapi-generator-online/src/test/java/org/openapitools/codegen/online/api/GenApiControllerTest.java b/modules/openapi-generator-online/src/test/java/org/openapitools/codegen/online/api/GenApiControllerTest.java index db55abdc3bcf..14254c446a3b 100644 --- a/modules/openapi-generator-online/src/test/java/org/openapitools/codegen/online/api/GenApiControllerTest.java +++ b/modules/openapi-generator-online/src/test/java/org/openapitools/codegen/online/api/GenApiControllerTest.java @@ -22,7 +22,7 @@ @WebMvcTest(GenApiController.class) public class GenApiControllerTest { - private static final String OPENAPI_URL = "http://petstore.swagger.io/v2/swagger.json"; + 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 @@ -43,7 +43,7 @@ public void serverFrameworks() throws Exception { public void getLanguages(String type, String expected) throws Exception { mockMvc.perform(get("/api/gen/" + type)) .andExpect(status().isOk()) - .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8)) + .andExpect(content().contentType(MediaType.APPLICATION_JSON)) .andExpect(jsonPath("$.[*]").value(hasItem(expected))); } @@ -72,7 +72,7 @@ public void serverOptionsUnknown() throws Exception { 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_UTF8)) + .andExpect(content().contentType(MediaType.APPLICATION_JSON)) .andExpect(jsonPath("$.sortParamsByRequiredFlag.opt").value("sortParamsByRequiredFlag")); } @@ -88,10 +88,10 @@ public void generateServer() throws Exception { 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_UTF8) + .contentType(MediaType.APPLICATION_JSON) .content("{\"openAPIUrl\": \"" + OPENAPI_URL + "\"}")) .andExpect(status().isOk()) - .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8)) + .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(); @@ -107,13 +107,13 @@ private void generateAndDownload(String type, String name) throws Exception { @Test public void generateWIthForwardedHeaders() throws Exception { String result = mockMvc.perform(post("http://test.com:1234/api/gen/clients/java") - .contentType(MediaType.APPLICATION_JSON_UTF8) + .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_UTF8)) + .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(); From 5b22d08d411bf05080a2aec2e5ba72b353599818 Mon Sep 17 00:00:00 2001 From: Valentin Valchev Date: Sat, 1 Aug 2020 15:51:02 +0300 Subject: [PATCH 103/129] [BUG] Multi-Part content type in response ignores properties of composed schema (allOf/oneOf) (#6073) --- .../openapitools/codegen/DefaultCodegen.java | 7 +- .../codegen/DefaultCodegenTest.java | 69 +++++++++++++++++++ 2 files changed, 74 insertions(+), 2 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java index e8ec89556643..92a3f76b7600 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java @@ -5653,8 +5653,11 @@ public List fromRequestBodyToFormParameters(RequestBody body, LOGGER.debug("debugging fromRequestBodyToFormParameters= " + body); Schema schema = ModelUtils.getSchemaFromRequestBody(body); schema = ModelUtils.getReferencedSchema(this.openAPI, schema); - if (schema.getProperties() != null && !schema.getProperties().isEmpty()) { - Map properties = schema.getProperties(); + List allRequired = new ArrayList(); + Map properties = new LinkedHashMap<>(); + addProperties(properties, allRequired, schema); + + if (!properties.isEmpty()) { for (Map.Entry entry : properties.entrySet()) { CodegenParameter codegenParameter = CodegenModelFactory.newInstance(CodegenModelType.PARAMETER); // key => property name diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/DefaultCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/DefaultCodegenTest.java index de2690860067..472ee64f586a 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/DefaultCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/DefaultCodegenTest.java @@ -2162,4 +2162,73 @@ public void testUseOneOfInterfaces() { Schema items = ((ArraySchema) openAPI.getComponents().getSchemas().get("CustomOneOfArraySchema")).getItems(); Assert.assertEquals(items.getExtensions().get("x-one-of-name"), "CustomOneOfArraySchemaOneOf"); } + + @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")); + } } From 828bdebdac9a0c24df3003810861a2693128f32e Mon Sep 17 00:00:00 2001 From: Tetiana Servirog <64489476+TetianaServirog@users.noreply.github.com> Date: Sun, 2 Aug 2020 00:21:18 +0300 Subject: [PATCH 104/129] [MARKDOWN] Fix issue 6089 with property and parameter names (#6105) Co-authored-by: Jim Schubert --- .../MarkdownDocumentationCodegen.java | 52 +++++++++++++++---- .../markdown/.openapi-generator/FILES | 12 +++++ samples/documentation/markdown/Apis/PetApi.md | 12 ++--- .../documentation/markdown/Apis/StoreApi.md | 4 +- .../documentation/markdown/Apis/UserApi.md | 28 +++++----- samples/documentation/markdown/README.md | 7 --- 6 files changed, 75 insertions(+), 40 deletions(-) create mode 100644 samples/documentation/markdown/.openapi-generator/FILES diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/MarkdownDocumentationCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/MarkdownDocumentationCodegen.java index d09853970429..1d76b22cbda7 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/MarkdownDocumentationCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/MarkdownDocumentationCodegen.java @@ -1,21 +1,18 @@ package org.openapitools.codegen.languages; -import org.openapitools.codegen.*; -import io.swagger.models.properties.ArrayProperty; -import io.swagger.models.properties.MapProperty; -import io.swagger.models.properties.Property; -import io.swagger.models.parameters.Parameter; - -import java.io.File; -import java.util.*; - -import org.apache.commons.lang3.StringUtils; - +import org.openapitools.codegen.CodegenConfig; +import org.openapitools.codegen.CodegenType; +import org.openapitools.codegen.DefaultCodegen; +import org.openapitools.codegen.SupportingFile; import org.openapitools.codegen.meta.GeneratorMetadata; import org.openapitools.codegen.meta.Stability; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.io.File; + +import static org.openapitools.codegen.utils.StringUtils.escape; + public class MarkdownDocumentationCodegen extends DefaultCodegen implements CodegenConfig { public static final String PROJECT_NAME = "projectName"; @@ -49,4 +46,37 @@ public MarkdownDocumentationCodegen() { supportingFiles.add(new SupportingFile("README.mustache", "", "README.md")); // TODO: Fill this out. } + + @Override + protected void initalizeSpecialCharacterMapping() { + // escape only those symbols that can mess up markdown + specialCharReplacements.put("\\", "\\\\"); + specialCharReplacements.put("/", "\\/"); + specialCharReplacements.put("`", "\\`"); + specialCharReplacements.put("*", "\\*"); + specialCharReplacements.put("_", "\\_"); + specialCharReplacements.put("[", "\\["); + specialCharReplacements.put("]", "\\]"); + + // todo Current markdown api and model mustache templates display properties and parameters in tables. Pipe + // symbol in a table can be commonly escaped with a backslash (e.g. GFM supports this). However, in some cases + // it may be necessary to choose a different approach. + specialCharReplacements.put("|", "\\|"); + } + + /** + * Works identically to {@link DefaultCodegen#toParamName(String)} but doesn't camelize. + * + * @param name Codegen property object + * @return the sanitized parameter name + */ + @Override + public String toParamName(String name) { + if (reservedWords.contains(name)) { + return escapeReservedWord(name); + } else if (((CharSequence) name).chars().anyMatch(character -> specialCharReplacements.keySet().contains("" + ((char) character)))) { + return escape(name, specialCharReplacements, null, null); + } + return name; + } } diff --git a/samples/documentation/markdown/.openapi-generator/FILES b/samples/documentation/markdown/.openapi-generator/FILES new file mode 100644 index 000000000000..53bf49ac0cf1 --- /dev/null +++ b/samples/documentation/markdown/.openapi-generator/FILES @@ -0,0 +1,12 @@ +Apis/PetApi.md +Apis/StoreApi.md +Apis/UserApi.md +Models/ApiResponse.md +Models/Category.md +Models/InlineObject.md +Models/InlineObject1.md +Models/Order.md +Models/Pet.md +Models/Tag.md +Models/User.md +README.md diff --git a/samples/documentation/markdown/Apis/PetApi.md b/samples/documentation/markdown/Apis/PetApi.md index 18e6055274f1..956077f32eea 100644 --- a/samples/documentation/markdown/Apis/PetApi.md +++ b/samples/documentation/markdown/Apis/PetApi.md @@ -16,7 +16,7 @@ Method | HTTP request | Description # **addPet** -> Pet addPet(pet) +> Pet addPet(Pet) Add a new pet to the store @@ -24,7 +24,7 @@ Add a new pet to the store Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **pet** | [**Pet**](..//Models/Pet.md)| Pet object that needs to be added to the store | + **Pet** | [**Pet**](..//Models/Pet.md)| Pet object that needs to be added to the store | ### Return type @@ -41,7 +41,7 @@ Name | Type | Description | Notes # **deletePet** -> deletePet(petId, apiKey) +> deletePet(petId, api\_key) Deletes a pet @@ -50,7 +50,7 @@ Deletes a pet Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **petId** | **Long**| Pet id to delete | [default to null] - **apiKey** | **String**| | [optional] [default to null] + **api\_key** | **String**| | [optional] [default to null] ### Return type @@ -148,7 +148,7 @@ Name | Type | Description | Notes # **updatePet** -> Pet updatePet(pet) +> Pet updatePet(Pet) Update an existing pet @@ -156,7 +156,7 @@ Update an existing pet Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **pet** | [**Pet**](..//Models/Pet.md)| Pet object that needs to be added to the store | + **Pet** | [**Pet**](..//Models/Pet.md)| Pet object that needs to be added to the store | ### Return type diff --git a/samples/documentation/markdown/Apis/StoreApi.md b/samples/documentation/markdown/Apis/StoreApi.md index b6d71962894c..9c1dd2b588e1 100644 --- a/samples/documentation/markdown/Apis/StoreApi.md +++ b/samples/documentation/markdown/Apis/StoreApi.md @@ -90,7 +90,7 @@ No authorization required # **placeOrder** -> Order placeOrder(order) +> Order placeOrder(Order) Place an order for a pet @@ -98,7 +98,7 @@ Place an order for a pet Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **order** | [**Order**](..//Models/Order.md)| order placed for purchasing the pet | + **Order** | [**Order**](..//Models/Order.md)| order placed for purchasing the pet | ### Return type diff --git a/samples/documentation/markdown/Apis/UserApi.md b/samples/documentation/markdown/Apis/UserApi.md index 071091c7416d..01aaf35f4f4b 100644 --- a/samples/documentation/markdown/Apis/UserApi.md +++ b/samples/documentation/markdown/Apis/UserApi.md @@ -16,7 +16,7 @@ Method | HTTP request | Description # **createUser** -> createUser(user) +> createUser(User) Create user @@ -26,7 +26,7 @@ Create user Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **user** | [**User**](..//Models/User.md)| Created user object | + **User** | [**User**](..//Models/User.md)| Created user object | ### Return type @@ -34,7 +34,7 @@ null (empty response body) ### Authorization -[auth_cookie](../README.md#auth_cookie) +[api_key](../README.md#api_key) ### HTTP request headers @@ -43,7 +43,7 @@ null (empty response body) # **createUsersWithArrayInput** -> createUsersWithArrayInput(user) +> createUsersWithArrayInput(User) Creates list of users with given input array @@ -51,7 +51,7 @@ Creates list of users with given input array Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **user** | [**List**](..//Models/User.md)| List of user object | + **User** | [**List**](..//Models/User.md)| List of user object | ### Return type @@ -59,7 +59,7 @@ null (empty response body) ### Authorization -[auth_cookie](../README.md#auth_cookie) +[api_key](../README.md#api_key) ### HTTP request headers @@ -68,7 +68,7 @@ null (empty response body) # **createUsersWithListInput** -> createUsersWithListInput(user) +> createUsersWithListInput(User) Creates list of users with given input array @@ -76,7 +76,7 @@ Creates list of users with given input array Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **user** | [**List**](..//Models/User.md)| List of user object | + **User** | [**List**](..//Models/User.md)| List of user object | ### Return type @@ -84,7 +84,7 @@ null (empty response body) ### Authorization -[auth_cookie](../README.md#auth_cookie) +[api_key](../README.md#api_key) ### HTTP request headers @@ -111,7 +111,7 @@ null (empty response body) ### Authorization -[auth_cookie](../README.md#auth_cookie) +[api_key](../README.md#api_key) ### HTTP request headers @@ -184,7 +184,7 @@ null (empty response body) ### Authorization -[auth_cookie](../README.md#auth_cookie) +[api_key](../README.md#api_key) ### HTTP request headers @@ -193,7 +193,7 @@ null (empty response body) # **updateUser** -> updateUser(username, user) +> updateUser(username, User) Updated user @@ -204,7 +204,7 @@ Updated user Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **username** | **String**| name that need to be deleted | [default to null] - **user** | [**User**](..//Models/User.md)| Updated user object | + **User** | [**User**](..//Models/User.md)| Updated user object | ### Return type @@ -212,7 +212,7 @@ null (empty response body) ### Authorization -[auth_cookie](../README.md#auth_cookie) +[api_key](../README.md#api_key) ### HTTP request headers diff --git a/samples/documentation/markdown/README.md b/samples/documentation/markdown/README.md index 0ceb7bae32d0..b40f7e919cd5 100644 --- a/samples/documentation/markdown/README.md +++ b/samples/documentation/markdown/README.md @@ -52,13 +52,6 @@ Class | Method | HTTP request | Description - **API key parameter name**: api_key - **Location**: HTTP header - -### auth_cookie - -- **Type**: API key -- **API key parameter name**: AUTH_KEY -- **Location**: - ### petstore_auth From 44726ef47164c8341d1d0bdccc3c6c4f763e2d20 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Sun, 2 Aug 2020 13:32:28 +0800 Subject: [PATCH 105/129] move maven,gradle tests to shipppable ci (#7108) --- .travis.yml | 8 -------- shippable.yml | 9 +++++++++ 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index fe85897c6d8e..bd9b72cb470f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -150,14 +150,6 @@ script: # WARN: Travis will timeout after 10 minutes of no stdout/stderr activity, which is problematic with mvn --quiet. - mvn --no-snapshot-updates --quiet --batch-mode --show-version clean install -Dorg.slf4j.simpleLogger.defaultLogLevel=error - mvn --no-snapshot-updates --quiet --batch-mode --show-version verify -Psamples -Dorg.slf4j.simpleLogger.defaultLogLevel=error - # test maven plugin - - mvn --no-snapshot-updates --quiet clean compile -f modules/openapi-generator-maven-plugin/examples/java-client.xml -Dorg.slf4j.simpleLogger.defaultLogLevel=error - - mvn --no-snapshot-updates --quiet clean compile -f modules/openapi-generator-maven-plugin/examples/multi-module/pom.xml -Dorg.slf4j.simpleLogger.defaultLogLevel=error - - mvn --no-snapshot-updates --quiet clean compile -f modules/openapi-generator-maven-plugin/examples/kotlin.xml -Dorg.slf4j.simpleLogger.defaultLogLevel=error - - mvn --no-snapshot-updates --quiet clean compile -f modules/openapi-generator-maven-plugin/examples/spring.xml -Dorg.slf4j.simpleLogger.defaultLogLevel=error - # test gradle plugin - - (cd modules/openapi-generator-gradle-plugin/samples/local-spec && ./gradlew buildGoSdk) - - (cd modules/openapi-generator-gradle-plugin/samples/local-spec && ./gradlew openApiGenerate) after_success: # push to maven repo - if [ $SONATYPE_USERNAME ] && [ "$TRAVIS_PULL_REQUEST" == "false" ]; then diff --git a/shippable.yml b/shippable.yml index a5288e70b91b..2612e0262d6d 100644 --- a/shippable.yml +++ b/shippable.yml @@ -43,3 +43,12 @@ build: - mix --version # test samples defined in pom.xml - mvn --no-snapshot-updates --quiet verify -P samples.shippable -Dmaven.javadoc.skip=true + # test maven plugin + - mvn --no-snapshot-updates --quiet clean compile -f modules/openapi-generator-maven-plugin/examples/java-client.xml -Dorg.slf4j.simpleLogger.defaultLogLevel=error + - mvn --no-snapshot-updates --quiet clean compile -f modules/openapi-generator-maven-plugin/examples/multi-module/pom.xml -Dorg.slf4j.simpleLogger.defaultLogLevel=error + - mvn --no-snapshot-updates --quiet clean compile -f modules/openapi-generator-maven-plugin/examples/kotlin.xml -Dorg.slf4j.simpleLogger.defaultLogLevel=error + - mvn --no-snapshot-updates --quiet clean compile -f modules/openapi-generator-maven-plugin/examples/spring.xml -Dorg.slf4j.simpleLogger.defaultLogLevel=error + # test gradle plugin + - (cd modules/openapi-generator-gradle-plugin/samples/local-spec && ./gradlew buildGoSdk) + - (cd modules/openapi-generator-gradle-plugin/samples/local-spec && ./gradlew openApiGenerate) + From 800d9453a48a3fe0ffffe8e86b6ae4675542bc08 Mon Sep 17 00:00:00 2001 From: TIm Clark Date: Sun, 2 Aug 2020 04:18:44 -0400 Subject: [PATCH 106/129] [Java][jersey2]Fix gradle HttpSignatureAuth dependencies (#7096) * Corrects tag for including HttpSignatureAuth in gradle builds * Updates version of org.tomitribe:tomitribe-http-signatures in gradle template to match version from maven template * Updates samples --- .../Java/libraries/jersey2/build.gradle.mustache | 10 +++++----- .../client/petstore/java/jersey2-java8/build.gradle | 2 -- .../client/petstore/java/jersey2-java8/build.gradle | 2 +- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/build.gradle.mustache index fa00d428c3fd..b2f37d720e9a 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/build.gradle.mustache @@ -137,9 +137,9 @@ ext { {{#hasOAuthMethods}} scribejava_apis_version = "6.9.0" {{/hasOAuthMethods}} - {{#hasHttpBasicMethods}} - tomitribe_http_signatures_version = "1.3" - {{/hasHttpBasicMethods}} + {{#hasHttpSignatureMethods}} + tomitribe_http_signatures_version = "1.5" + {{/hasHttpSignatureMethods}} } dependencies { @@ -161,9 +161,9 @@ dependencies { {{#hasOAuthMethods}} compile "com.github.scribejava:scribejava-apis:$scribejava_apis_version" {{/hasOAuthMethods}} - {{#hasHttpBasicMethods}} + {{#hasHttpSignatureMethods}} compile "org.tomitribe:tomitribe-http-signatures:$tomitribe_http_signatures_version" - {{/hasHttpBasicMethods}} + {{/hasHttpSignatureMethods}} {{#supportJava6}} compile "commons-io:commons-io:$commons_io_version" compile "org.apache.commons:commons-lang3:$commons_lang3_version" diff --git a/samples/client/petstore/java/jersey2-java8/build.gradle b/samples/client/petstore/java/jersey2-java8/build.gradle index 9fd264d4f8b6..ce0818364e37 100644 --- a/samples/client/petstore/java/jersey2-java8/build.gradle +++ b/samples/client/petstore/java/jersey2-java8/build.gradle @@ -101,7 +101,6 @@ ext { jersey_version = "2.27" junit_version = "4.13" scribejava_apis_version = "6.9.0" - tomitribe_http_signatures_version = "1.3" } dependencies { @@ -116,7 +115,6 @@ dependencies { compile "org.openapitools:jackson-databind-nullable:$jackson_databind_nullable_version" compile "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" compile "com.github.scribejava:scribejava-apis:$scribejava_apis_version" - compile "org.tomitribe:tomitribe-http-signatures:$tomitribe_http_signatures_version" compile 'javax.annotation:javax.annotation-api:1.3.2' testCompile "junit:junit:$junit_version" } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/build.gradle b/samples/openapi3/client/petstore/java/jersey2-java8/build.gradle index 621ae35ce3a9..f100f9868637 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/build.gradle +++ b/samples/openapi3/client/petstore/java/jersey2-java8/build.gradle @@ -101,7 +101,7 @@ ext { jersey_version = "2.27" junit_version = "4.13" scribejava_apis_version = "6.9.0" - tomitribe_http_signatures_version = "1.3" + tomitribe_http_signatures_version = "1.5" } dependencies { From 647d253ac8803c3d330923916149560c9ca4c9cc Mon Sep 17 00:00:00 2001 From: sbu <64100880+sbu-WBT@users.noreply.github.com> Date: Sun, 2 Aug 2020 10:46:50 +0200 Subject: [PATCH 107/129] [Dart] Treat float as double (#6924) * [Dart] Treat float as double * [Dart] Treat float as double in mustache with isNumber --- .../src/main/resources/dart2/class.mustache | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/dart2/class.mustache b/modules/openapi-generator/src/main/resources/dart2/class.mustache index 95359385297a..5fb4f82cfb1a 100644 --- a/modules/openapi-generator/src/main/resources/dart2/class.mustache +++ b/modules/openapi-generator/src/main/resources/dart2/class.mustache @@ -89,19 +89,19 @@ class {{classname}} { (json['{{baseName}}'] as Map).cast(); {{/isMapContainer}} {{^isMapContainer}} - {{#isDouble}} + {{#isNumber}} {{name}} = (json['{{baseName}}'] == null) ? null : json['{{baseName}}'].toDouble(); - {{/isDouble}} - {{^isDouble}} + {{/isNumber}} + {{^isNumber}} {{^isEnum}} {{name}} = json['{{baseName}}']; {{/isEnum}} {{#isEnum}} {{name}} = {{classname}}{{{enumName}}}.fromJson(json['{{baseName}}']); {{/isEnum}} - {{/isDouble}} + {{/isNumber}} {{/isMapContainer}} {{/isListContainer}} {{/complexType}} From 43471bacbc9f4b0b525cd8fa4108b7e14b57f500 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Sun, 2 Aug 2020 16:57:40 +0800 Subject: [PATCH 108/129] [PS] Allow CI to publish the module (#7091) * better code format in powershell code * add code to publish ps module --- .../powershell/Org.OpenAPITools.psm1.mustache | 2 +- .../about_Org.OpenAPITools.help.txt.mustache | 2 +- .../resources/powershell/appveyor.mustache | 7 ++ .../powershell/configuration.mustache | 14 +-- .../powershell/http_signature_auth.mustache | 114 +++++++----------- .../powershell/rsa_provider.mustache | 6 +- .../client/petstore/powershell/appveyor.yml | 7 ++ .../src/PSPetstore/Client/PSConfiguration.ps1 | 14 +-- .../powershell/src/PSPetstore/PSPetstore.psm1 | 2 +- .../Private/PSHttpSignatureAuth.ps1 | 114 +++++++----------- .../Private/PSRSAEncryptionProvider.cs | 6 +- .../en-US/about_PSPetstore.help.txt | 2 +- 12 files changed, 130 insertions(+), 160 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/powershell/Org.OpenAPITools.psm1.mustache b/modules/openapi-generator/src/main/resources/powershell/Org.OpenAPITools.psm1.mustache index ce575233bb86..7714f348b49f 100644 --- a/modules/openapi-generator/src/main/resources/powershell/Org.OpenAPITools.psm1.mustache +++ b/modules/openapi-generator/src/main/resources/powershell/Org.OpenAPITools.psm1.mustache @@ -4,7 +4,7 @@ # set $ErrorActionPreference to 'Stop' globally $ErrorActionPreference = 'Stop' -# store the API client's configuration +# store the API client's configuration $Script:Configuration = [System.Collections.HashTable]@{} $Script:CmdletBindingParameters = @('Verbose','Debug','ErrorAction','WarningAction','InformationAction','ErrorVariable','WarningVariable','InformationVariable','OutVariable','OutBuffer','PipelineVariable') diff --git a/modules/openapi-generator/src/main/resources/powershell/about_Org.OpenAPITools.help.txt.mustache b/modules/openapi-generator/src/main/resources/powershell/about_Org.OpenAPITools.help.txt.mustache index 10b226f136e9..a6a43671ace8 100644 --- a/modules/openapi-generator/src/main/resources/powershell/about_Org.OpenAPITools.help.txt.mustache +++ b/modules/openapi-generator/src/main/resources/powershell/about_Org.OpenAPITools.help.txt.mustache @@ -23,5 +23,5 @@ LONG DESCRIPTION Frameworks supported: - * PowerShell 3.0+ + * PowerShell {{{powershellVersion}}} or later * .NET 4.0 or later diff --git a/modules/openapi-generator/src/main/resources/powershell/appveyor.mustache b/modules/openapi-generator/src/main/resources/powershell/appveyor.mustache index 46e6d61028bd..f337f619ba0c 100644 --- a/modules/openapi-generator/src/main/resources/powershell/appveyor.mustache +++ b/modules/openapi-generator/src/main/resources/powershell/appveyor.mustache @@ -15,3 +15,10 @@ test_script: $host.SetShouldExit($Result.FailedCount) exit $Result.FailedCount } + - ps: | + if ($env:APPVEYOR_REPO_TAG -eq $true -and $env:NuGetApiKey -ne $null) + { + choco install NuGet.CommandLine + Install-PackageProvider -Name NuGet -Force + Publish-Module -NuGetApiKey $env:NuGetApiKey -Path .\ -Confirm:$False -Verbose + } diff --git a/modules/openapi-generator/src/main/resources/powershell/configuration.mustache b/modules/openapi-generator/src/main/resources/powershell/configuration.mustache index 622bce2b65ae..499a39bf3eb2 100644 --- a/modules/openapi-generator/src/main/resources/powershell/configuration.mustache +++ b/modules/openapi-generator/src/main/resources/powershell/configuration.mustache @@ -388,7 +388,7 @@ a key. The 'Authorization' header is added to outbound HTTP requests. Ref: https://openapi-generator.tech .PARAMETER KeyId -KeyId for HTTP signing +KeyId for HTTP signing .PARAMETER KeyFilePath KeyFilePath for HTTP signing @@ -397,7 +397,7 @@ KeyFilePath for HTTP signing KeyPassPhrase, if the HTTP signing key is protected .PARAMETER HttpSigningHeader -HttpSigningHeader list of HTTP headers used to calculate the signature. The two special signature headers '(request-target)' and '(created)' +HttpSigningHeader list of HTTP headers used to calculate the signature. The two special signature headers '(request-target)' and '(created)' SHOULD be included. The '(created)' header expresses when the signature was created. The '(request-target)' header is a concatenation of the lowercased :method, an @@ -408,11 +408,11 @@ If no headers are specified then '(created)' sets as default. HashAlgrithm to calculate the hash, Supported values are "sha256" and "sha512" .PARAMETER SigningAlgorithm -SigningAlgorithm specifies the signature algorithm, supported values are "RSASSA-PKCS1-v1_5" and "RSASSA-PSS" +SigningAlgorithm specifies the signature algorithm, supported values are "RSASSA-PKCS1-v1_5" and "RSASSA-PSS" RSA key : Supported values "RSASSA-PKCS1-v1_5" and "RSASSA-PSS", for ECDSA key this parameter is not applicable .PARAMETER SignatureValidityPeriod -SignatureValidityPeriod specifies the signature maximum validity time in seconds. It accepts integer value +SignatureValidityPeriod specifies the signature maximum validity time in seconds. It accepts integer value .OUTPUTS @@ -459,11 +459,11 @@ function Set-{{{apiNamePrefix}}}ConfigurationHttpSigning { } } - if ($keyType -eq "RSA" -and + if ($keyType -eq "RSA" -and ($SigningAlgorithm -ne "RSASSA-PKCS1-v1_5" -and $SigningAlgorithm -ne "RSASSA-PSS" )) { throw "Provided Key and SigningAlgorithm : $SigningAlgorithm is not compatible." } - + if ($HttpSigningHeader -contains "(expires)" -and $SignatureValidityPeriod -le 0) { throw "SignatureValidityPeriod must be greater than 0 seconds." } @@ -486,7 +486,7 @@ function Set-{{{apiNamePrefix}}}ConfigurationHttpSigning { if ($null -ne $KeyPassPhrase) { $httpSignatureConfiguration["KeyPassPhrase"] = $KeyPassPhrase } - + $Script:Configuration["HttpSigning"] = New-Object -TypeName PSCustomObject -Property $httpSignatureConfiguration } } diff --git a/modules/openapi-generator/src/main/resources/powershell/http_signature_auth.mustache b/modules/openapi-generator/src/main/resources/powershell/http_signature_auth.mustache index 69ab0b43bb10..fe6a3dc8ec6f 100644 --- a/modules/openapi-generator/src/main/resources/powershell/http_signature_auth.mustache +++ b/modules/openapi-generator/src/main/resources/powershell/http_signature_auth.mustache @@ -3,9 +3,9 @@ .SYNOPSIS Gets the headers for HTTP signature. .DESCRIPTION - Gets the headers for the http sigature. + Gets the headers for the http sigature. .PARAMETER Method - HTTP method + HTTP method .PARAMETER UriBuilder UriBuilder for url and query parameter .PARAMETER Body @@ -44,49 +44,43 @@ function Get-{{{apiNamePrefix}}}HttpSignedHeader { $TargetHost = $UriBuilder.Host $httpSigningConfiguration = Get-{{{apiNamePrefix}}}ConfigurationHttpSigning $Digest = $null - + #get the body digest $bodyHash = Get-{{{apiNamePrefix}}}StringHash -String $Body -HashName $httpSigningConfiguration.HashAlgorithm if ($httpSigningConfiguration.HashAlgorithm -eq "SHA256") { $Digest = [String]::Format("SHA-256={0}", [Convert]::ToBase64String($bodyHash)) - } - elseif ($httpSigningConfiguration.HashAlgorithm -eq "SHA512") { + } elseif ($httpSigningConfiguration.HashAlgorithm -eq "SHA512") { $Digest = [String]::Format("SHA-512={0}", [Convert]::ToBase64String($bodyHash)) } - + $dateTime = Get-Date #get the date in UTC $currentDate = $dateTime.ToUniversalTime().ToString("r") foreach ($headerItem in $httpSigningConfiguration.HttpSigningHeader) { - - if ($headerItem -eq $HEADER_REQUEST_TARGET) { + + if ($headerItem -eq $HEADER_REQUEST_TARGET) { $requestTargetPath = [string]::Format("{0} {1}{2}", $Method.ToLower(), $UriBuilder.Path, $UriBuilder.Query) $HttpSignatureHeader.Add($HEADER_REQUEST_TARGET, $requestTargetPath) - } - elseif ($headerItem -eq $HEADER_CREATED) { + } elseif ($headerItem -eq $HEADER_CREATED) { $created = Get-{{{apiNamePrefix}}}UnixTime -Date $dateTime -TotalTime TotalSeconds $HttpSignatureHeader.Add($HEADER_CREATED, $created) - } - elseif ($headerItem -eq $HEADER_EXPIRES) { + } elseif ($headerItem -eq $HEADER_EXPIRES) { $expire = $dateTime.AddSeconds($httpSigningConfiguration.SignatureValidityPeriod) $expireEpocTime = Get-{{{apiNamePrefix}}}UnixTime -Date $expire -TotalTime TotalSeconds $HttpSignatureHeader.Add($HEADER_EXPIRES, $expireEpocTime) - } - elseif ($headerItem -eq $HEADER_HOST) { + } elseif ($headerItem -eq $HEADER_HOST) { $HttpSignedRequestHeader[$HEADER_HOST] = $TargetHost $HttpSignatureHeader.Add($HEADER_HOST.ToLower(), $TargetHost) - } - elseif ($headerItem -eq $HEADER_DATE) { + } elseif ($headerItem -eq $HEADER_DATE) { $HttpSignedRequestHeader[$HEADER_DATE] = $currentDate $HttpSignatureHeader.Add($HEADER_DATE.ToLower(), $currentDate) - } - elseif ($headerItem -eq $HEADER_DIGEST) { + } elseif ($headerItem -eq $HEADER_DIGEST) { $HttpSignedRequestHeader[$HEADER_DIGEST] = $Digest $HttpSignatureHeader.Add($HEADER_DIGEST.ToLower(), $Digest) - }elseif($RequestHeader.ContainsKey($headerItem)){ + } elseif($RequestHeader.ContainsKey($headerItem)) { $HttpSignatureHeader.Add($headerItem.ToLower(), $RequestHeader[$headerItem]) - }else{ + } else { throw "Cannot sign HTTP request. Request does not contain the $headerItem header." } } @@ -99,7 +93,7 @@ function Get-{{{apiNamePrefix}}}HttpSignedHeader { } #Concatinate headers value separated by new line $headerValuesString = $headerValuesList -join "`n" - + #Gets the hash of the headers value $signatureHashString = Get-{{{apiNamePrefix}}}StringHash -String $headerValuesString -HashName $httpSigningConfiguration.HashAlgorithm @@ -112,8 +106,7 @@ function Get-{{{apiNamePrefix}}}HttpSignedHeader { -HashAlgorithmName $httpSigningConfiguration.HashAlgorithm ` -KeyPassPhrase $httpSigningConfiguration.KeyPassPhrase ` -SigningAlgorithm $httpSigningConfiguration.SigningAlgorithm - } - elseif ($KeyType -eq "EC") { + } elseif ($KeyType -eq "EC") { $headerSignatureStr = Get-{{{apiNamePrefix}}}ECDSASignature -ECKeyFilePath $httpSigningConfiguration.KeyFilePath ` -DataToSign $signatureHashString ` -HashAlgorithmName $httpSigningConfiguration.HashAlgorithm ` @@ -134,10 +127,10 @@ function Get-{{{apiNamePrefix}}}HttpSignedHeader { if ($HttpSignatureHeader.ContainsKey($HEADER_EXPIRES)) { $authorizationHeaderValue += [string]::Format(",expires={0}", $HttpSignatureHeader[$HEADER_EXPIRES]) } - - $authorizationHeaderValue += [string]::Format(",headers=""{0}"",signature=""{1}""", + + $authorizationHeaderValue += [string]::Format(",headers=""{0}"",signature=""{1}""", $headersKeysString , $headerSignatureStr) - + $HttpSignedRequestHeader[$HEADER_AUTHORIZATION] = $authorizationHeaderValue return $HttpSignedRequestHeader } @@ -147,7 +140,7 @@ function Get-{{{apiNamePrefix}}}HttpSignedHeader { Gets the RSA signature .DESCRIPTION - Gets the RSA signature for the http signing + Gets the RSA signature for the http signing .PARAMETER PrivateKeyFilePath Specify the API key file path .PARAMETER DataToSign @@ -168,11 +161,10 @@ function Get-{{{apiNamePrefix}}}RSASignature { [securestring]$KeyPassPhrase ) try { - + if ($hashAlgorithmName -eq "sha256") { $hashAlgo = [System.Security.Cryptography.HashAlgorithmName]::SHA256 - } - elseif ($hashAlgorithmName -eq "sha512") { + } elseif ($hashAlgorithmName -eq "sha512") { $hashAlgo = [System.Security.Cryptography.HashAlgorithmName]::SHA512 } @@ -188,31 +180,26 @@ function Get-{{{apiNamePrefix}}}RSASignature { if ($SigningAlgorithm -eq "RSASSA-PSS") { $signedBytes = $rsa.SignHash($DataToSign, $hashAlgo, [System.Security.Cryptography.RSASignaturePadding]::Pss) - } - else { + } else { $signedBytes = $rsa.SignHash($DataToSign, $hashAlgo, [System.Security.Cryptography.RSASignaturePadding]::Pkcs1) } - } - else { + } else { $rsa_provider_path = Join-Path -Path $PSScriptRoot -ChildPath "{{{apiNamePrefix}}}RSAEncryptionProvider.cs" $rsa_provider_sourceCode = Get-Content -Path $rsa_provider_path -Raw - Add-Type -TypeDefinition $rsa_provider_sourceCode - + Add-Type -TypeDefinition $rsa_provider_sourceCode + [System.Security.Cryptography.RSA]$rsa = [RSAEncryption.RSAEncryptionProvider]::GetRSAProviderFromPemFile($PrivateKeyFilePath, $KeyPassPhrase) - + if ($SigningAlgorithm -eq "RSASSA-PSS") { throw "$SigningAlgorithm is not supported on $($PSVersionTable.PSVersion)" - } - else { + } else { $signedBytes = $rsa.SignHash($DataToSign, $hashAlgo, [System.Security.Cryptography.RSASignaturePadding]::Pkcs1) } - } $signedString = [Convert]::ToBase64String($signedBytes) return $signedString - } - catch { + } catch { throw $_ } } @@ -222,7 +209,7 @@ function Get-{{{apiNamePrefix}}}RSASignature { Gets the ECDSA signature .DESCRIPTION - Gets the ECDSA signature for the http signing + Gets the ECDSA signature for the http signing .PARAMETER PrivateKeyFilePath Specify the API key file path .PARAMETER DataToSign @@ -249,7 +236,7 @@ function Get-{{{apiNamePrefix}}}ECDSASignature { throw "key file path does not exist." } - if($PSVersionTable.PSVersion.Major -lt 7){ + if ($PSVersionTable.PSVersion.Major -lt 7) { throw "ECDSA key is not supported on $($PSVersionTable.PSVersion), Use PSVersion 7.0 and above" } @@ -263,27 +250,23 @@ function Get-{{{apiNamePrefix}}}ECDSASignature { #$ecdsa = [System.Security.Cryptography.ECDsaCng]::New($cngKey) $ecdsa = [System.Security.Cryptography.ECDsaCng]::New() [int]$bytCount =0 - if(![string]::IsNullOrEmpty($KeyPassPhrase)){ + if (![string]::IsNullOrEmpty($KeyPassPhrase)) { $ecdsa.ImportEncryptedPkcs8PrivateKey($KeyPassPhrase,$keyBytes,[ref]$bytCount) + } else { + $ecdsa.ImportPkcs8PrivateKey($keyBytes,[ref]$bytCount) } - else{ - $ecdsa.ImportPkcs8PrivateKey($keyBytes,[ref]$bytCount) - } - + if ($HashAlgorithmName -eq "sha512") { $ecdsa.HashAlgorithm = [System.Security.Cryptography.CngAlgorithm]::Sha512 - } - else { + } else { $ecdsa.HashAlgorithm = [System.Security.Cryptography.CngAlgorithm]::Sha256 } $signedBytes = $ecdsa.SignHash($DataToSign) $signedString = [System.Convert]::ToBase64String($signedBytes) return $signedString - } - <# .Synopsis Gets the hash of string. @@ -295,7 +278,7 @@ function Get-{{{apiNamePrefix}}}ECDSASignature { Specifies the hash name to calculate the hash, Accepted values are "SHA1", "SHA256" and "SHA512" It is recommneded not to use "SHA1" to calculate the Hash .Outputs -String + String #> Function Get-{{{apiNamePrefix}}}StringHash { param( @@ -305,9 +288,9 @@ Function Get-{{{apiNamePrefix}}}StringHash { [Parameter(Mandatory = $true)] [ValidateSet("SHA1", "SHA256", "SHA512")] $HashName - ) + ) $hashAlogrithm = [System.Security.Cryptography.HashAlgorithm]::Create($HashName) - $hashAlogrithm.ComputeHash([System.Text.Encoding]::UTF8.GetBytes($String)) + $hashAlogrithm.ComputeHash([System.Text.Encoding]::UTF8.GetBytes($String)) } <# @@ -359,7 +342,6 @@ function Get-{{{apiNamePrefix}}}CryptographicScheme { return $SigningAlgorithm } - <# .Synopsis Gets the key type from the pem file. @@ -390,20 +372,16 @@ function Get-{{{apiNamePrefix}}}KeyTypeFromFile { if ($key[0] -match $rsaPrivateKeyHeader -and $key[$key.Length - 1] -match $rsaPrivateFooter) { $KeyType = "RSA" - - } - elseif ($key[0] -match $ecPrivateKeyHeader -and $key[$key.Length - 1] -match $ecPrivateKeyFooter) { + } elseif ($key[0] -match $ecPrivateKeyHeader -and $key[$key.Length - 1] -match $ecPrivateKeyFooter) { $keyType = "EC" - } - elseif ($key[0] -match $ecPrivateKeyHeader -and $key[$key.Length - 1] -match $ecPrivateKeyFooter) { + } elseif ($key[0] -match $ecPrivateKeyHeader -and $key[$key.Length - 1] -match $ecPrivateKeyFooter) { <#this type of key can hold many type different types of private key, but here due lack of pem header - Considering this as EC key - #> + Considering this as EC key + #> #TODO :- update the key based on oid $keyType = "EC" - } - else { + } else { throw "Either the key is invalid or key is not supported" } - return $keyType -} \ No newline at end of file + return $keyType +} diff --git a/modules/openapi-generator/src/main/resources/powershell/rsa_provider.mustache b/modules/openapi-generator/src/main/resources/powershell/rsa_provider.mustache index 7a671929fb2b..451221fd8940 100644 --- a/modules/openapi-generator/src/main/resources/powershell/rsa_provider.mustache +++ b/modules/openapi-generator/src/main/resources/powershell/rsa_provider.mustache @@ -64,7 +64,7 @@ namespace RSAEncryption return binkey; } catch (System.FormatException) - { + { StringReader str = new StringReader(pvkstr); //-------- read PEM encryption info. lines and extract salt ----- @@ -234,7 +234,7 @@ namespace RSAEncryption { // ---- Now hash consecutively for count times ------ if (j == 0) - result = data00; //initialize + result = data00; //initialize else { Array.Copy(result, hashtarget, result.Length); @@ -276,4 +276,4 @@ namespace RSAEncryption return decryptedData; } } -} \ No newline at end of file +} diff --git a/samples/client/petstore/powershell/appveyor.yml b/samples/client/petstore/powershell/appveyor.yml index fab089d4d649..ec43839e3e3f 100644 --- a/samples/client/petstore/powershell/appveyor.yml +++ b/samples/client/petstore/powershell/appveyor.yml @@ -21,3 +21,10 @@ test_script: $host.SetShouldExit($Result.FailedCount) exit $Result.FailedCount } + - ps: | + if ($env:APPVEYOR_REPO_TAG -eq $true -and $env:NuGetApiKey -ne $null) + { + choco install NuGet.CommandLine + Install-PackageProvider -Name NuGet -Force + Publish-Module -NuGetApiKey $env:NuGetApiKey -Path .\ -Confirm:$False -Verbose + } diff --git a/samples/client/petstore/powershell/src/PSPetstore/Client/PSConfiguration.ps1 b/samples/client/petstore/powershell/src/PSPetstore/Client/PSConfiguration.ps1 index 8e6910f19707..0d115cc603c5 100644 --- a/samples/client/petstore/powershell/src/PSPetstore/Client/PSConfiguration.ps1 +++ b/samples/client/petstore/powershell/src/PSPetstore/Client/PSConfiguration.ps1 @@ -404,7 +404,7 @@ a key. The 'Authorization' header is added to outbound HTTP requests. Ref: https://openapi-generator.tech .PARAMETER KeyId -KeyId for HTTP signing +KeyId for HTTP signing .PARAMETER KeyFilePath KeyFilePath for HTTP signing @@ -413,7 +413,7 @@ KeyFilePath for HTTP signing KeyPassPhrase, if the HTTP signing key is protected .PARAMETER HttpSigningHeader -HttpSigningHeader list of HTTP headers used to calculate the signature. The two special signature headers '(request-target)' and '(created)' +HttpSigningHeader list of HTTP headers used to calculate the signature. The two special signature headers '(request-target)' and '(created)' SHOULD be included. The '(created)' header expresses when the signature was created. The '(request-target)' header is a concatenation of the lowercased :method, an @@ -424,11 +424,11 @@ If no headers are specified then '(created)' sets as default. HashAlgrithm to calculate the hash, Supported values are "sha256" and "sha512" .PARAMETER SigningAlgorithm -SigningAlgorithm specifies the signature algorithm, supported values are "RSASSA-PKCS1-v1_5" and "RSASSA-PSS" +SigningAlgorithm specifies the signature algorithm, supported values are "RSASSA-PKCS1-v1_5" and "RSASSA-PSS" RSA key : Supported values "RSASSA-PKCS1-v1_5" and "RSASSA-PSS", for ECDSA key this parameter is not applicable .PARAMETER SignatureValidityPeriod -SignatureValidityPeriod specifies the signature maximum validity time in seconds. It accepts integer value +SignatureValidityPeriod specifies the signature maximum validity time in seconds. It accepts integer value .OUTPUTS @@ -475,11 +475,11 @@ function Set-PSConfigurationHttpSigning { } } - if ($keyType -eq "RSA" -and + if ($keyType -eq "RSA" -and ($SigningAlgorithm -ne "RSASSA-PKCS1-v1_5" -and $SigningAlgorithm -ne "RSASSA-PSS" )) { throw "Provided Key and SigningAlgorithm : $SigningAlgorithm is not compatible." } - + if ($HttpSigningHeader -contains "(expires)" -and $SignatureValidityPeriod -le 0) { throw "SignatureValidityPeriod must be greater than 0 seconds." } @@ -502,7 +502,7 @@ function Set-PSConfigurationHttpSigning { if ($null -ne $KeyPassPhrase) { $httpSignatureConfiguration["KeyPassPhrase"] = $KeyPassPhrase } - + $Script:Configuration["HttpSigning"] = New-Object -TypeName PSCustomObject -Property $httpSignatureConfiguration } } diff --git a/samples/client/petstore/powershell/src/PSPetstore/PSPetstore.psm1 b/samples/client/petstore/powershell/src/PSPetstore/PSPetstore.psm1 index f0637343093c..9153f06cd47f 100644 --- a/samples/client/petstore/powershell/src/PSPetstore/PSPetstore.psm1 +++ b/samples/client/petstore/powershell/src/PSPetstore/PSPetstore.psm1 @@ -10,7 +10,7 @@ # set $ErrorActionPreference to 'Stop' globally $ErrorActionPreference = 'Stop' -# store the API client's configuration +# store the API client's configuration $Script:Configuration = [System.Collections.HashTable]@{} $Script:CmdletBindingParameters = @('Verbose','Debug','ErrorAction','WarningAction','InformationAction','ErrorVariable','WarningVariable','InformationVariable','OutVariable','OutBuffer','PipelineVariable') diff --git a/samples/client/petstore/powershell/src/PSPetstore/Private/PSHttpSignatureAuth.ps1 b/samples/client/petstore/powershell/src/PSPetstore/Private/PSHttpSignatureAuth.ps1 index d3fed6ead985..6cb2087ccf13 100644 --- a/samples/client/petstore/powershell/src/PSPetstore/Private/PSHttpSignatureAuth.ps1 +++ b/samples/client/petstore/powershell/src/PSPetstore/Private/PSHttpSignatureAuth.ps1 @@ -9,9 +9,9 @@ .SYNOPSIS Gets the headers for HTTP signature. .DESCRIPTION - Gets the headers for the http sigature. + Gets the headers for the http sigature. .PARAMETER Method - HTTP method + HTTP method .PARAMETER UriBuilder UriBuilder for url and query parameter .PARAMETER Body @@ -50,49 +50,43 @@ function Get-PSHttpSignedHeader { $TargetHost = $UriBuilder.Host $httpSigningConfiguration = Get-PSConfigurationHttpSigning $Digest = $null - + #get the body digest $bodyHash = Get-PSStringHash -String $Body -HashName $httpSigningConfiguration.HashAlgorithm if ($httpSigningConfiguration.HashAlgorithm -eq "SHA256") { $Digest = [String]::Format("SHA-256={0}", [Convert]::ToBase64String($bodyHash)) - } - elseif ($httpSigningConfiguration.HashAlgorithm -eq "SHA512") { + } elseif ($httpSigningConfiguration.HashAlgorithm -eq "SHA512") { $Digest = [String]::Format("SHA-512={0}", [Convert]::ToBase64String($bodyHash)) } - + $dateTime = Get-Date #get the date in UTC $currentDate = $dateTime.ToUniversalTime().ToString("r") foreach ($headerItem in $httpSigningConfiguration.HttpSigningHeader) { - - if ($headerItem -eq $HEADER_REQUEST_TARGET) { + + if ($headerItem -eq $HEADER_REQUEST_TARGET) { $requestTargetPath = [string]::Format("{0} {1}{2}", $Method.ToLower(), $UriBuilder.Path, $UriBuilder.Query) $HttpSignatureHeader.Add($HEADER_REQUEST_TARGET, $requestTargetPath) - } - elseif ($headerItem -eq $HEADER_CREATED) { + } elseif ($headerItem -eq $HEADER_CREATED) { $created = Get-PSUnixTime -Date $dateTime -TotalTime TotalSeconds $HttpSignatureHeader.Add($HEADER_CREATED, $created) - } - elseif ($headerItem -eq $HEADER_EXPIRES) { + } elseif ($headerItem -eq $HEADER_EXPIRES) { $expire = $dateTime.AddSeconds($httpSigningConfiguration.SignatureValidityPeriod) $expireEpocTime = Get-PSUnixTime -Date $expire -TotalTime TotalSeconds $HttpSignatureHeader.Add($HEADER_EXPIRES, $expireEpocTime) - } - elseif ($headerItem -eq $HEADER_HOST) { + } elseif ($headerItem -eq $HEADER_HOST) { $HttpSignedRequestHeader[$HEADER_HOST] = $TargetHost $HttpSignatureHeader.Add($HEADER_HOST.ToLower(), $TargetHost) - } - elseif ($headerItem -eq $HEADER_DATE) { + } elseif ($headerItem -eq $HEADER_DATE) { $HttpSignedRequestHeader[$HEADER_DATE] = $currentDate $HttpSignatureHeader.Add($HEADER_DATE.ToLower(), $currentDate) - } - elseif ($headerItem -eq $HEADER_DIGEST) { + } elseif ($headerItem -eq $HEADER_DIGEST) { $HttpSignedRequestHeader[$HEADER_DIGEST] = $Digest $HttpSignatureHeader.Add($HEADER_DIGEST.ToLower(), $Digest) - }elseif($RequestHeader.ContainsKey($headerItem)){ + } elseif($RequestHeader.ContainsKey($headerItem)) { $HttpSignatureHeader.Add($headerItem.ToLower(), $RequestHeader[$headerItem]) - }else{ + } else { throw "Cannot sign HTTP request. Request does not contain the $headerItem header." } } @@ -105,7 +99,7 @@ function Get-PSHttpSignedHeader { } #Concatinate headers value separated by new line $headerValuesString = $headerValuesList -join "`n" - + #Gets the hash of the headers value $signatureHashString = Get-PSStringHash -String $headerValuesString -HashName $httpSigningConfiguration.HashAlgorithm @@ -118,8 +112,7 @@ function Get-PSHttpSignedHeader { -HashAlgorithmName $httpSigningConfiguration.HashAlgorithm ` -KeyPassPhrase $httpSigningConfiguration.KeyPassPhrase ` -SigningAlgorithm $httpSigningConfiguration.SigningAlgorithm - } - elseif ($KeyType -eq "EC") { + } elseif ($KeyType -eq "EC") { $headerSignatureStr = Get-PSECDSASignature -ECKeyFilePath $httpSigningConfiguration.KeyFilePath ` -DataToSign $signatureHashString ` -HashAlgorithmName $httpSigningConfiguration.HashAlgorithm ` @@ -140,10 +133,10 @@ function Get-PSHttpSignedHeader { if ($HttpSignatureHeader.ContainsKey($HEADER_EXPIRES)) { $authorizationHeaderValue += [string]::Format(",expires={0}", $HttpSignatureHeader[$HEADER_EXPIRES]) } - - $authorizationHeaderValue += [string]::Format(",headers=""{0}"",signature=""{1}""", + + $authorizationHeaderValue += [string]::Format(",headers=""{0}"",signature=""{1}""", $headersKeysString , $headerSignatureStr) - + $HttpSignedRequestHeader[$HEADER_AUTHORIZATION] = $authorizationHeaderValue return $HttpSignedRequestHeader } @@ -153,7 +146,7 @@ function Get-PSHttpSignedHeader { Gets the RSA signature .DESCRIPTION - Gets the RSA signature for the http signing + Gets the RSA signature for the http signing .PARAMETER PrivateKeyFilePath Specify the API key file path .PARAMETER DataToSign @@ -174,11 +167,10 @@ function Get-PSRSASignature { [securestring]$KeyPassPhrase ) try { - + if ($hashAlgorithmName -eq "sha256") { $hashAlgo = [System.Security.Cryptography.HashAlgorithmName]::SHA256 - } - elseif ($hashAlgorithmName -eq "sha512") { + } elseif ($hashAlgorithmName -eq "sha512") { $hashAlgo = [System.Security.Cryptography.HashAlgorithmName]::SHA512 } @@ -194,31 +186,26 @@ function Get-PSRSASignature { if ($SigningAlgorithm -eq "RSASSA-PSS") { $signedBytes = $rsa.SignHash($DataToSign, $hashAlgo, [System.Security.Cryptography.RSASignaturePadding]::Pss) - } - else { + } else { $signedBytes = $rsa.SignHash($DataToSign, $hashAlgo, [System.Security.Cryptography.RSASignaturePadding]::Pkcs1) } - } - else { + } else { $rsa_provider_path = Join-Path -Path $PSScriptRoot -ChildPath "PSRSAEncryptionProvider.cs" $rsa_provider_sourceCode = Get-Content -Path $rsa_provider_path -Raw - Add-Type -TypeDefinition $rsa_provider_sourceCode - + Add-Type -TypeDefinition $rsa_provider_sourceCode + [System.Security.Cryptography.RSA]$rsa = [RSAEncryption.RSAEncryptionProvider]::GetRSAProviderFromPemFile($PrivateKeyFilePath, $KeyPassPhrase) - + if ($SigningAlgorithm -eq "RSASSA-PSS") { throw "$SigningAlgorithm is not supported on $($PSVersionTable.PSVersion)" - } - else { + } else { $signedBytes = $rsa.SignHash($DataToSign, $hashAlgo, [System.Security.Cryptography.RSASignaturePadding]::Pkcs1) } - } $signedString = [Convert]::ToBase64String($signedBytes) return $signedString - } - catch { + } catch { throw $_ } } @@ -228,7 +215,7 @@ function Get-PSRSASignature { Gets the ECDSA signature .DESCRIPTION - Gets the ECDSA signature for the http signing + Gets the ECDSA signature for the http signing .PARAMETER PrivateKeyFilePath Specify the API key file path .PARAMETER DataToSign @@ -255,7 +242,7 @@ function Get-PSECDSASignature { throw "key file path does not exist." } - if($PSVersionTable.PSVersion.Major -lt 7){ + if ($PSVersionTable.PSVersion.Major -lt 7) { throw "ECDSA key is not supported on $($PSVersionTable.PSVersion), Use PSVersion 7.0 and above" } @@ -269,27 +256,23 @@ function Get-PSECDSASignature { #$ecdsa = [System.Security.Cryptography.ECDsaCng]::New($cngKey) $ecdsa = [System.Security.Cryptography.ECDsaCng]::New() [int]$bytCount =0 - if(![string]::IsNullOrEmpty($KeyPassPhrase)){ + if (![string]::IsNullOrEmpty($KeyPassPhrase)) { $ecdsa.ImportEncryptedPkcs8PrivateKey($KeyPassPhrase,$keyBytes,[ref]$bytCount) + } else { + $ecdsa.ImportPkcs8PrivateKey($keyBytes,[ref]$bytCount) } - else{ - $ecdsa.ImportPkcs8PrivateKey($keyBytes,[ref]$bytCount) - } - + if ($HashAlgorithmName -eq "sha512") { $ecdsa.HashAlgorithm = [System.Security.Cryptography.CngAlgorithm]::Sha512 - } - else { + } else { $ecdsa.HashAlgorithm = [System.Security.Cryptography.CngAlgorithm]::Sha256 } $signedBytes = $ecdsa.SignHash($DataToSign) $signedString = [System.Convert]::ToBase64String($signedBytes) return $signedString - } - <# .Synopsis Gets the hash of string. @@ -301,7 +284,7 @@ function Get-PSECDSASignature { Specifies the hash name to calculate the hash, Accepted values are "SHA1", "SHA256" and "SHA512" It is recommneded not to use "SHA1" to calculate the Hash .Outputs -String + String #> Function Get-PSStringHash { param( @@ -311,9 +294,9 @@ Function Get-PSStringHash { [Parameter(Mandatory = $true)] [ValidateSet("SHA1", "SHA256", "SHA512")] $HashName - ) + ) $hashAlogrithm = [System.Security.Cryptography.HashAlgorithm]::Create($HashName) - $hashAlogrithm.ComputeHash([System.Text.Encoding]::UTF8.GetBytes($String)) + $hashAlogrithm.ComputeHash([System.Text.Encoding]::UTF8.GetBytes($String)) } <# @@ -365,7 +348,6 @@ function Get-PSCryptographicScheme { return $SigningAlgorithm } - <# .Synopsis Gets the key type from the pem file. @@ -396,20 +378,16 @@ function Get-PSKeyTypeFromFile { if ($key[0] -match $rsaPrivateKeyHeader -and $key[$key.Length - 1] -match $rsaPrivateFooter) { $KeyType = "RSA" - - } - elseif ($key[0] -match $ecPrivateKeyHeader -and $key[$key.Length - 1] -match $ecPrivateKeyFooter) { + } elseif ($key[0] -match $ecPrivateKeyHeader -and $key[$key.Length - 1] -match $ecPrivateKeyFooter) { $keyType = "EC" - } - elseif ($key[0] -match $ecPrivateKeyHeader -and $key[$key.Length - 1] -match $ecPrivateKeyFooter) { + } elseif ($key[0] -match $ecPrivateKeyHeader -and $key[$key.Length - 1] -match $ecPrivateKeyFooter) { <#this type of key can hold many type different types of private key, but here due lack of pem header - Considering this as EC key - #> + Considering this as EC key + #> #TODO :- update the key based on oid $keyType = "EC" - } - else { + } else { throw "Either the key is invalid or key is not supported" } - return $keyType -} \ No newline at end of file + return $keyType +} diff --git a/samples/client/petstore/powershell/src/PSPetstore/Private/PSRSAEncryptionProvider.cs b/samples/client/petstore/powershell/src/PSPetstore/Private/PSRSAEncryptionProvider.cs index 7a671929fb2b..451221fd8940 100644 --- a/samples/client/petstore/powershell/src/PSPetstore/Private/PSRSAEncryptionProvider.cs +++ b/samples/client/petstore/powershell/src/PSPetstore/Private/PSRSAEncryptionProvider.cs @@ -64,7 +64,7 @@ static byte[] ConvertPrivateKeyToBytes(String instr, SecureString keyPassPharse return binkey; } catch (System.FormatException) - { + { StringReader str = new StringReader(pvkstr); //-------- read PEM encryption info. lines and extract salt ----- @@ -234,7 +234,7 @@ static byte[] GetEncryptedKey(byte[] salt, SecureString secpswd, int count, int { // ---- Now hash consecutively for count times ------ if (j == 0) - result = data00; //initialize + result = data00; //initialize else { Array.Copy(result, hashtarget, result.Length); @@ -276,4 +276,4 @@ static byte[] DecryptKey(byte[] cipherData, byte[] desKey, byte[] IV) return decryptedData; } } -} \ No newline at end of file +} diff --git a/samples/client/petstore/powershell/src/PSPetstore/en-US/about_PSPetstore.help.txt b/samples/client/petstore/powershell/src/PSPetstore/en-US/about_PSPetstore.help.txt index c35d0e44240a..af56b5a29483 100644 --- a/samples/client/petstore/powershell/src/PSPetstore/en-US/about_PSPetstore.help.txt +++ b/samples/client/petstore/powershell/src/PSPetstore/en-US/about_PSPetstore.help.txt @@ -15,5 +15,5 @@ LONG DESCRIPTION Frameworks supported: - * PowerShell 3.0+ + * PowerShell 5.0 or later * .NET 4.0 or later From 761364eec9ee5c1d90c0b3cf39ce9f5936841cd9 Mon Sep 17 00:00:00 2001 From: devhl-labs Date: Sun, 2 Aug 2020 05:53:53 -0400 Subject: [PATCH 109/129] [csharp-netcore] added cancellation tokens to async calls (#7077) * added cancellation tokens to async calls * changed variable name for consistency * update samples Co-authored-by: William Cheng --- .../csharp-netcore/ApiClient.mustache | 39 +- .../IAsynchronousClient.mustache | 21 +- .../resources/csharp-netcore/api.mustache | 24 +- .../Org.OpenAPITools/Api/AnotherFakeApi.cs | 22 +- .../src/Org.OpenAPITools/Api/FakeApi.cs | 618 +++++++++++------- .../Api/FakeClassnameTags123Api.cs | 22 +- .../src/Org.OpenAPITools/Api/PetApi.cs | 268 +++++--- .../src/Org.OpenAPITools/Api/StoreApi.cs | 78 ++- .../src/Org.OpenAPITools/Api/UserApi.cs | 186 +++--- .../src/Org.OpenAPITools/Client/ApiClient.cs | 39 +- .../Client/IAsynchronousClient.cs | 21 +- .../Org.OpenAPITools/Api/AnotherFakeApi.cs | 22 +- .../src/Org.OpenAPITools/Api/FakeApi.cs | 618 +++++++++++------- .../Api/FakeClassnameTags123Api.cs | 22 +- .../src/Org.OpenAPITools/Api/PetApi.cs | 268 +++++--- .../src/Org.OpenAPITools/Api/StoreApi.cs | 78 ++- .../src/Org.OpenAPITools/Api/UserApi.cs | 186 +++--- .../src/Org.OpenAPITools/Client/ApiClient.cs | 39 +- .../Client/IAsynchronousClient.cs | 21 +- 19 files changed, 1619 insertions(+), 973 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/ApiClient.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/ApiClient.mustache index 49b81c72e070..3a0a3dd4272b 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/ApiClient.mustache @@ -448,7 +448,7 @@ namespace {{packageName}}.Client } {{#supportsAsync}} - private async Task> ExecAsync(RestRequest req, IReadableConfiguration configuration) + private async Task> ExecAsync(RestRequest req, IReadableConfiguration configuration, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { RestClient client = new RestClient(_baseUrl); @@ -479,7 +479,7 @@ namespace {{packageName}}.Client InterceptRequest(req); - var response = await client.ExecuteAsync(req); + var response = await client.ExecuteAsync(req, cancellationToken); InterceptResponse(req, response); @@ -526,11 +526,12 @@ namespace {{packageName}}.Client /// The additional request options. /// A per-request configuration object. It is assumed that any merge with /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null) + public Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { var config = configuration ?? GlobalConfiguration.Instance; - return ExecAsync(NewRequest(HttpMethod.Get, path, options, config), config); + return ExecAsync(NewRequest(HttpMethod.Get, path, options, config), config, cancellationToken); } /// @@ -540,11 +541,12 @@ namespace {{packageName}}.Client /// The additional request options. /// A per-request configuration object. It is assumed that any merge with /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null) + public Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { var config = configuration ?? GlobalConfiguration.Instance; - return ExecAsync(NewRequest(HttpMethod.Post, path, options, config), config); + return ExecAsync(NewRequest(HttpMethod.Post, path, options, config), config, cancellationToken); } /// @@ -554,11 +556,12 @@ namespace {{packageName}}.Client /// The additional request options. /// A per-request configuration object. It is assumed that any merge with /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null) + public Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { var config = configuration ?? GlobalConfiguration.Instance; - return ExecAsync(NewRequest(HttpMethod.Put, path, options, config), config); + return ExecAsync(NewRequest(HttpMethod.Put, path, options, config), config, cancellationToken); } /// @@ -568,11 +571,12 @@ namespace {{packageName}}.Client /// The additional request options. /// A per-request configuration object. It is assumed that any merge with /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null) + public Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { var config = configuration ?? GlobalConfiguration.Instance; - return ExecAsync(NewRequest(HttpMethod.Delete, path, options, config), config); + return ExecAsync(NewRequest(HttpMethod.Delete, path, options, config), config, cancellationToken); } /// @@ -582,11 +586,12 @@ namespace {{packageName}}.Client /// The additional request options. /// A per-request configuration object. It is assumed that any merge with /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null) + public Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { var config = configuration ?? GlobalConfiguration.Instance; - return ExecAsync(NewRequest(HttpMethod.Head, path, options, config), config); + return ExecAsync(NewRequest(HttpMethod.Head, path, options, config), config, cancellationToken); } /// @@ -596,11 +601,12 @@ namespace {{packageName}}.Client /// The additional request options. /// A per-request configuration object. It is assumed that any merge with /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null) + public Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { var config = configuration ?? GlobalConfiguration.Instance; - return ExecAsync(NewRequest(HttpMethod.Options, path, options, config), config); + return ExecAsync(NewRequest(HttpMethod.Options, path, options, config), config, cancellationToken); } /// @@ -610,11 +616,12 @@ namespace {{packageName}}.Client /// The additional request options. /// A per-request configuration object. It is assumed that any merge with /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null) + public Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { var config = configuration ?? GlobalConfiguration.Instance; - return ExecAsync(NewRequest(HttpMethod.Patch, path, options, config), config); + return ExecAsync(NewRequest(HttpMethod.Patch, path, options, config), config, cancellationToken); } #endregion IAsynchronousClient {{/supportsAsync}} diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/IAsynchronousClient.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/IAsynchronousClient.mustache index 0068ce5cd4d0..8fa4c40cd94a 100755 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/IAsynchronousClient.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/IAsynchronousClient.mustache @@ -19,9 +19,10 @@ namespace {{packageName}}.Client /// The relative path to invoke. /// The request parameters to pass along to the client. /// Per-request configurable settings. + /// Cancellation Token to cancel the request. /// The return type. /// A task eventually representing the response data, decorated with - Task> GetAsync(String path, RequestOptions options, IReadableConfiguration configuration = null); + Task> GetAsync(String path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Executes a non-blocking call to some using the POST http verb. @@ -29,9 +30,10 @@ namespace {{packageName}}.Client /// The relative path to invoke. /// The request parameters to pass along to the client. /// Per-request configurable settings. + /// Cancellation Token to cancel the request. /// The return type. /// A task eventually representing the response data, decorated with - Task> PostAsync(String path, RequestOptions options, IReadableConfiguration configuration = null); + Task> PostAsync(String path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Executes a non-blocking call to some using the PUT http verb. @@ -39,9 +41,10 @@ namespace {{packageName}}.Client /// The relative path to invoke. /// The request parameters to pass along to the client. /// Per-request configurable settings. + /// Cancellation Token to cancel the request. /// The return type. /// A task eventually representing the response data, decorated with - Task> PutAsync(String path, RequestOptions options, IReadableConfiguration configuration = null); + Task> PutAsync(String path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Executes a non-blocking call to some using the DELETE http verb. @@ -49,9 +52,10 @@ namespace {{packageName}}.Client /// The relative path to invoke. /// The request parameters to pass along to the client. /// Per-request configurable settings. + /// Cancellation Token to cancel the request. /// The return type. /// A task eventually representing the response data, decorated with - Task> DeleteAsync(String path, RequestOptions options, IReadableConfiguration configuration = null); + Task> DeleteAsync(String path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Executes a non-blocking call to some using the HEAD http verb. @@ -59,9 +63,10 @@ namespace {{packageName}}.Client /// The relative path to invoke. /// The request parameters to pass along to the client. /// Per-request configurable settings. + /// Cancellation Token to cancel the request. /// The return type. /// A task eventually representing the response data, decorated with - Task> HeadAsync(String path, RequestOptions options, IReadableConfiguration configuration = null); + Task> HeadAsync(String path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Executes a non-blocking call to some using the OPTIONS http verb. @@ -69,9 +74,10 @@ namespace {{packageName}}.Client /// The relative path to invoke. /// The request parameters to pass along to the client. /// Per-request configurable settings. + /// Cancellation Token to cancel the request. /// The return type. /// A task eventually representing the response data, decorated with - Task> OptionsAsync(String path, RequestOptions options, IReadableConfiguration configuration = null); + Task> OptionsAsync(String path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Executes a non-blocking call to some using the PATCH http verb. @@ -79,9 +85,10 @@ namespace {{packageName}}.Client /// The relative path to invoke. /// The request parameters to pass along to the client. /// Per-request configurable settings. + /// Cancellation Token to cancel the request. /// The return type. /// A task eventually representing the response data, decorated with - Task> PatchAsync(String path, RequestOptions options, IReadableConfiguration configuration = null); + Task> PatchAsync(String path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); } } {{^supportsAsync}}*/{{/supportsAsync}} diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/api.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/api.mustache index 644c038885a3..59a65d9d9634 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/api.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/api.mustache @@ -62,8 +62,9 @@ namespace {{packageName}}.{{apiPackage}} /// /// Thrown when fails to make API call {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} + /// Cancellation Token to cancel the request. {{/allParams}}/// Task of {{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}void{{/returnType}} - {{#returnType}}System.Threading.Tasks.Task<{{{returnType}}}>{{/returnType}}{{^returnType}}System.Threading.Tasks.Task{{/returnType}} {{operationId}}Async ({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}); + {{#returnType}}System.Threading.Tasks.Task<{{{returnType}}}>{{/returnType}}{{^returnType}}System.Threading.Tasks.Task{{/returnType}} {{operationId}}Async ({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// {{summary}} @@ -72,9 +73,10 @@ namespace {{packageName}}.{{apiPackage}} /// {{notes}} /// /// Thrown when fails to make API call - {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} + {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} + /// Cancellation Token to cancel the request. {{/allParams}}/// Task of ApiResponse{{#returnType}} ({{returnType}}){{/returnType}} - System.Threading.Tasks.Task> {{operationId}}AsyncWithHttpInfo ({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}); + System.Threading.Tasks.Task> {{operationId}}AsyncWithHttpInfo ({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); {{/operation}} #endregion Asynchronous Operations } @@ -376,12 +378,13 @@ namespace {{packageName}}.{{apiPackage}} /// {{summary}} {{notes}} /// /// Thrown when fails to make API call - {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} + {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} + /// Cancellation Token to cancel the request. {{/allParams}}/// Task of {{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}void{{/returnType}} - {{#returnType}}public async System.Threading.Tasks.Task<{{{returnType}}}>{{/returnType}}{{^returnType}}public async System.Threading.Tasks.Task{{/returnType}} {{operationId}}Async ({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) + {{#returnType}}public async System.Threading.Tasks.Task<{{{returnType}}}>{{/returnType}}{{^returnType}}public async System.Threading.Tasks.Task{{/returnType}} {{operationId}}Async ({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - {{#returnType}}{{packageName}}.Client.ApiResponse<{{{returnType}}}> localVarResponse = await {{operationId}}AsyncWithHttpInfo({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}); - return localVarResponse.Data;{{/returnType}}{{^returnType}}await {{operationId}}AsyncWithHttpInfo({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}});{{/returnType}} + {{#returnType}}{{packageName}}.Client.ApiResponse<{{{returnType}}}> localVarResponse = await {{operationId}}AsyncWithHttpInfo({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}cancellationToken); + return localVarResponse.Data;{{/returnType}}{{^returnType}}await {{operationId}}AsyncWithHttpInfo({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}cancellationToken);{{/returnType}} } @@ -389,9 +392,10 @@ namespace {{packageName}}.{{apiPackage}} /// {{summary}} {{notes}} /// /// Thrown when fails to make API call - {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} + {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} + /// Cancellation Token to cancel the request. {{/allParams}}/// Task of ApiResponse{{#returnType}} ({{returnType}}){{/returnType}} - public async System.Threading.Tasks.Task<{{packageName}}.Client.ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Object{{/returnType}}>> {{operationId}}AsyncWithHttpInfo ({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) + public async System.Threading.Tasks.Task<{{packageName}}.Client.ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Object{{/returnType}}>> {{operationId}}AsyncWithHttpInfo ({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { {{#allParams}} {{#required}} @@ -534,7 +538,7 @@ namespace {{packageName}}.{{apiPackage}} // make the HTTP request - var localVarResponse = await this.AsynchronousClient.{{#lambda.titlecase}}{{#lambda.lowercase}}{{httpMethod}}{{/lambda.lowercase}}{{/lambda.titlecase}}Async<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Object{{/returnType}}>("{{{path}}}", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.{{#lambda.titlecase}}{{#lambda.lowercase}}{{httpMethod}}{{/lambda.lowercase}}{{/lambda.titlecase}}Async<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Object{{/returnType}}>("{{{path}}}", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/AnotherFakeApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/AnotherFakeApi.cs index 99156f92d281..8d9b36ddfc5c 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/AnotherFakeApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/AnotherFakeApi.cs @@ -65,8 +65,9 @@ public interface IAnotherFakeApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// client model + /// Cancellation Token to cancel the request. /// Task of ModelClient - System.Threading.Tasks.Task Call123TestSpecialTagsAsync (ModelClient body); + System.Threading.Tasks.Task Call123TestSpecialTagsAsync (ModelClient body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// To test special tags @@ -75,9 +76,10 @@ public interface IAnotherFakeApiAsync : IApiAccessor /// To test special tags and operation ID starting with number /// /// Thrown when fails to make API call - /// client model + /// client model + /// Cancellation Token to cancel the request. /// Task of ApiResponse (ModelClient) - System.Threading.Tasks.Task> Call123TestSpecialTagsAsyncWithHttpInfo (ModelClient body); + System.Threading.Tasks.Task> Call123TestSpecialTagsAsyncWithHttpInfo (ModelClient body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); #endregion Asynchronous Operations } @@ -258,11 +260,12 @@ public Org.OpenAPITools.Client.ApiResponse< ModelClient > Call123TestSpecialTags /// To test special tags To test special tags and operation ID starting with number /// /// Thrown when fails to make API call - /// client model + /// client model + /// Cancellation Token to cancel the request. /// Task of ModelClient - public async System.Threading.Tasks.Task Call123TestSpecialTagsAsync (ModelClient body) + public async System.Threading.Tasks.Task Call123TestSpecialTagsAsync (ModelClient body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - Org.OpenAPITools.Client.ApiResponse localVarResponse = await Call123TestSpecialTagsAsyncWithHttpInfo(body); + Org.OpenAPITools.Client.ApiResponse localVarResponse = await Call123TestSpecialTagsAsyncWithHttpInfo(body, cancellationToken); return localVarResponse.Data; } @@ -271,9 +274,10 @@ public async System.Threading.Tasks.Task Call123TestSpecialTagsAsyn /// To test special tags To test special tags and operation ID starting with number /// /// Thrown when fails to make API call - /// client model + /// client model + /// Cancellation Token to cancel the request. /// Task of ApiResponse (ModelClient) - public async System.Threading.Tasks.Task> Call123TestSpecialTagsAsyncWithHttpInfo (ModelClient body) + public async System.Threading.Tasks.Task> Call123TestSpecialTagsAsyncWithHttpInfo (ModelClient body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // verify the required parameter 'body' is set if (body == null) @@ -303,7 +307,7 @@ public async System.Threading.Tasks.Task Call123TestSpecialTagsAsyn // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PatchAsync("/another-fake/dummy", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.PatchAsync("/another-fake/dummy", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/FakeApi.cs index 55ac584e8a77..e510f1f6926b 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/FakeApi.cs @@ -400,8 +400,9 @@ public interface IFakeApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// XmlItem Body + /// Cancellation Token to cancel the request. /// Task of void - System.Threading.Tasks.Task CreateXmlItemAsync (XmlItem xmlItem); + System.Threading.Tasks.Task CreateXmlItemAsync (XmlItem xmlItem, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// creates an XmlItem @@ -410,9 +411,10 @@ public interface IFakeApiAsync : IApiAccessor /// this route creates an XmlItem /// /// Thrown when fails to make API call - /// XmlItem Body + /// XmlItem Body + /// Cancellation Token to cancel the request. /// Task of ApiResponse - System.Threading.Tasks.Task> CreateXmlItemAsyncWithHttpInfo (XmlItem xmlItem); + System.Threading.Tasks.Task> CreateXmlItemAsyncWithHttpInfo (XmlItem xmlItem, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// /// @@ -421,8 +423,9 @@ public interface IFakeApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// Input boolean as post body (optional) + /// Cancellation Token to cancel the request. /// Task of bool - System.Threading.Tasks.Task FakeOuterBooleanSerializeAsync (bool? body = default(bool?)); + System.Threading.Tasks.Task FakeOuterBooleanSerializeAsync (bool? body = default(bool?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// @@ -431,9 +434,10 @@ public interface IFakeApiAsync : IApiAccessor /// Test serialization of outer boolean types /// /// Thrown when fails to make API call - /// Input boolean as post body (optional) + /// Input boolean as post body (optional) + /// Cancellation Token to cancel the request. /// Task of ApiResponse (bool) - System.Threading.Tasks.Task> FakeOuterBooleanSerializeAsyncWithHttpInfo (bool? body = default(bool?)); + System.Threading.Tasks.Task> FakeOuterBooleanSerializeAsyncWithHttpInfo (bool? body = default(bool?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// /// @@ -442,8 +446,9 @@ public interface IFakeApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// Input composite as post body (optional) + /// Cancellation Token to cancel the request. /// Task of OuterComposite - System.Threading.Tasks.Task FakeOuterCompositeSerializeAsync (OuterComposite body = default(OuterComposite)); + System.Threading.Tasks.Task FakeOuterCompositeSerializeAsync (OuterComposite body = default(OuterComposite), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// @@ -452,9 +457,10 @@ public interface IFakeApiAsync : IApiAccessor /// Test serialization of object with outer number type /// /// Thrown when fails to make API call - /// Input composite as post body (optional) + /// Input composite as post body (optional) + /// Cancellation Token to cancel the request. /// Task of ApiResponse (OuterComposite) - System.Threading.Tasks.Task> FakeOuterCompositeSerializeAsyncWithHttpInfo (OuterComposite body = default(OuterComposite)); + System.Threading.Tasks.Task> FakeOuterCompositeSerializeAsyncWithHttpInfo (OuterComposite body = default(OuterComposite), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// /// @@ -463,8 +469,9 @@ public interface IFakeApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// Input number as post body (optional) + /// Cancellation Token to cancel the request. /// Task of decimal - System.Threading.Tasks.Task FakeOuterNumberSerializeAsync (decimal? body = default(decimal?)); + System.Threading.Tasks.Task FakeOuterNumberSerializeAsync (decimal? body = default(decimal?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// @@ -473,9 +480,10 @@ public interface IFakeApiAsync : IApiAccessor /// Test serialization of outer number types /// /// Thrown when fails to make API call - /// Input number as post body (optional) + /// Input number as post body (optional) + /// Cancellation Token to cancel the request. /// Task of ApiResponse (decimal) - System.Threading.Tasks.Task> FakeOuterNumberSerializeAsyncWithHttpInfo (decimal? body = default(decimal?)); + System.Threading.Tasks.Task> FakeOuterNumberSerializeAsyncWithHttpInfo (decimal? body = default(decimal?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// /// @@ -484,8 +492,9 @@ public interface IFakeApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// Input string as post body (optional) + /// Cancellation Token to cancel the request. /// Task of string - System.Threading.Tasks.Task FakeOuterStringSerializeAsync (string body = default(string)); + System.Threading.Tasks.Task FakeOuterStringSerializeAsync (string body = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// @@ -494,9 +503,10 @@ public interface IFakeApiAsync : IApiAccessor /// Test serialization of outer string types /// /// Thrown when fails to make API call - /// Input string as post body (optional) + /// Input string as post body (optional) + /// Cancellation Token to cancel the request. /// Task of ApiResponse (string) - System.Threading.Tasks.Task> FakeOuterStringSerializeAsyncWithHttpInfo (string body = default(string)); + System.Threading.Tasks.Task> FakeOuterStringSerializeAsyncWithHttpInfo (string body = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// /// @@ -505,8 +515,9 @@ public interface IFakeApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// + /// Cancellation Token to cancel the request. /// Task of void - System.Threading.Tasks.Task TestBodyWithFileSchemaAsync (FileSchemaTestClass body); + System.Threading.Tasks.Task TestBodyWithFileSchemaAsync (FileSchemaTestClass body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// @@ -515,9 +526,10 @@ public interface IFakeApiAsync : IApiAccessor /// For this test, the body for this request much reference a schema named `File`. /// /// Thrown when fails to make API call - /// + /// + /// Cancellation Token to cancel the request. /// Task of ApiResponse - System.Threading.Tasks.Task> TestBodyWithFileSchemaAsyncWithHttpInfo (FileSchemaTestClass body); + System.Threading.Tasks.Task> TestBodyWithFileSchemaAsyncWithHttpInfo (FileSchemaTestClass body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// /// @@ -526,9 +538,11 @@ public interface IFakeApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// + /// Cancellation Token to cancel the request. /// + /// Cancellation Token to cancel the request. /// Task of void - System.Threading.Tasks.Task TestBodyWithQueryParamsAsync (string query, User body); + System.Threading.Tasks.Task TestBodyWithQueryParamsAsync (string query, User body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// @@ -537,10 +551,12 @@ public interface IFakeApiAsync : IApiAccessor /// /// /// Thrown when fails to make API call - /// - /// + /// + /// Cancellation Token to cancel the request. + /// + /// Cancellation Token to cancel the request. /// Task of ApiResponse - System.Threading.Tasks.Task> TestBodyWithQueryParamsAsyncWithHttpInfo (string query, User body); + System.Threading.Tasks.Task> TestBodyWithQueryParamsAsyncWithHttpInfo (string query, User body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// To test \"client\" model /// @@ -549,8 +565,9 @@ public interface IFakeApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// client model + /// Cancellation Token to cancel the request. /// Task of ModelClient - System.Threading.Tasks.Task TestClientModelAsync (ModelClient body); + System.Threading.Tasks.Task TestClientModelAsync (ModelClient body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// To test \"client\" model @@ -559,9 +576,10 @@ public interface IFakeApiAsync : IApiAccessor /// To test \"client\" model /// /// Thrown when fails to make API call - /// client model + /// client model + /// Cancellation Token to cancel the request. /// Task of ApiResponse (ModelClient) - System.Threading.Tasks.Task> TestClientModelAsyncWithHttpInfo (ModelClient body); + System.Threading.Tasks.Task> TestClientModelAsyncWithHttpInfo (ModelClient body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 /// @@ -570,21 +588,35 @@ public interface IFakeApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// None + /// Cancellation Token to cancel the request. /// None + /// Cancellation Token to cancel the request. /// None + /// Cancellation Token to cancel the request. /// None + /// Cancellation Token to cancel the request. /// None (optional) + /// Cancellation Token to cancel the request. /// None (optional) + /// Cancellation Token to cancel the request. /// None (optional) + /// Cancellation Token to cancel the request. /// None (optional) + /// Cancellation Token to cancel the request. /// None (optional) + /// Cancellation Token to cancel the request. /// None (optional) + /// Cancellation Token to cancel the request. /// None (optional) + /// Cancellation Token to cancel the request. /// None (optional) + /// Cancellation Token to cancel the request. /// None (optional) + /// Cancellation Token to cancel the request. /// None (optional) + /// Cancellation Token to cancel the request. /// Task of void - System.Threading.Tasks.Task TestEndpointParametersAsync (decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int? integer = default(int?), int? int32 = default(int?), long? int64 = default(long?), float? _float = default(float?), string _string = default(string), System.IO.Stream binary = default(System.IO.Stream), DateTime? date = default(DateTime?), DateTime? dateTime = default(DateTime?), string password = default(string), string callback = default(string)); + System.Threading.Tasks.Task TestEndpointParametersAsync (decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int? integer = default(int?), int? int32 = default(int?), long? int64 = default(long?), float? _float = default(float?), string _string = default(string), System.IO.Stream binary = default(System.IO.Stream), DateTime? date = default(DateTime?), DateTime? dateTime = default(DateTime?), string password = default(string), string callback = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -593,22 +625,36 @@ public interface IFakeApiAsync : IApiAccessor /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 /// /// Thrown when fails to make API call - /// None - /// None - /// None - /// None - /// None (optional) - /// None (optional) - /// None (optional) - /// None (optional) - /// None (optional) - /// None (optional) - /// None (optional) - /// None (optional) - /// None (optional) - /// None (optional) + /// None + /// Cancellation Token to cancel the request. + /// None + /// Cancellation Token to cancel the request. + /// None + /// Cancellation Token to cancel the request. + /// None + /// Cancellation Token to cancel the request. + /// None (optional) + /// Cancellation Token to cancel the request. + /// None (optional) + /// Cancellation Token to cancel the request. + /// None (optional) + /// Cancellation Token to cancel the request. + /// None (optional) + /// Cancellation Token to cancel the request. + /// None (optional) + /// Cancellation Token to cancel the request. + /// None (optional) + /// Cancellation Token to cancel the request. + /// None (optional) + /// Cancellation Token to cancel the request. + /// None (optional) + /// Cancellation Token to cancel the request. + /// None (optional) + /// Cancellation Token to cancel the request. + /// None (optional) + /// Cancellation Token to cancel the request. /// Task of ApiResponse - System.Threading.Tasks.Task> TestEndpointParametersAsyncWithHttpInfo (decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int? integer = default(int?), int? int32 = default(int?), long? int64 = default(long?), float? _float = default(float?), string _string = default(string), System.IO.Stream binary = default(System.IO.Stream), DateTime? date = default(DateTime?), DateTime? dateTime = default(DateTime?), string password = default(string), string callback = default(string)); + System.Threading.Tasks.Task> TestEndpointParametersAsyncWithHttpInfo (decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int? integer = default(int?), int? int32 = default(int?), long? int64 = default(long?), float? _float = default(float?), string _string = default(string), System.IO.Stream binary = default(System.IO.Stream), DateTime? date = default(DateTime?), DateTime? dateTime = default(DateTime?), string password = default(string), string callback = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// To test enum parameters /// @@ -617,15 +663,23 @@ public interface IFakeApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// Header parameter enum test (string array) (optional) + /// Cancellation Token to cancel the request. /// Header parameter enum test (string) (optional, default to -efg) + /// Cancellation Token to cancel the request. /// Query parameter enum test (string array) (optional) + /// Cancellation Token to cancel the request. /// Query parameter enum test (string) (optional, default to -efg) + /// Cancellation Token to cancel the request. /// Query parameter enum test (double) (optional) + /// Cancellation Token to cancel the request. /// Query parameter enum test (double) (optional) + /// Cancellation Token to cancel the request. /// Form parameter enum test (string array) (optional, default to $) + /// Cancellation Token to cancel the request. /// Form parameter enum test (string) (optional, default to -efg) + /// Cancellation Token to cancel the request. /// Task of void - System.Threading.Tasks.Task TestEnumParametersAsync (List enumHeaderStringArray = default(List), string enumHeaderString = default(string), List enumQueryStringArray = default(List), string enumQueryString = default(string), int? enumQueryInteger = default(int?), double? enumQueryDouble = default(double?), List enumFormStringArray = default(List), string enumFormString = default(string)); + System.Threading.Tasks.Task TestEnumParametersAsync (List enumHeaderStringArray = default(List), string enumHeaderString = default(string), List enumQueryStringArray = default(List), string enumQueryString = default(string), int? enumQueryInteger = default(int?), double? enumQueryDouble = default(double?), List enumFormStringArray = default(List), string enumFormString = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// To test enum parameters @@ -634,16 +688,24 @@ public interface IFakeApiAsync : IApiAccessor /// To test enum parameters /// /// Thrown when fails to make API call - /// Header parameter enum test (string array) (optional) - /// Header parameter enum test (string) (optional, default to -efg) - /// Query parameter enum test (string array) (optional) - /// Query parameter enum test (string) (optional, default to -efg) - /// Query parameter enum test (double) (optional) - /// Query parameter enum test (double) (optional) - /// Form parameter enum test (string array) (optional, default to $) - /// Form parameter enum test (string) (optional, default to -efg) + /// Header parameter enum test (string array) (optional) + /// Cancellation Token to cancel the request. + /// Header parameter enum test (string) (optional, default to -efg) + /// Cancellation Token to cancel the request. + /// Query parameter enum test (string array) (optional) + /// Cancellation Token to cancel the request. + /// Query parameter enum test (string) (optional, default to -efg) + /// Cancellation Token to cancel the request. + /// Query parameter enum test (double) (optional) + /// Cancellation Token to cancel the request. + /// Query parameter enum test (double) (optional) + /// Cancellation Token to cancel the request. + /// Form parameter enum test (string array) (optional, default to $) + /// Cancellation Token to cancel the request. + /// Form parameter enum test (string) (optional, default to -efg) + /// Cancellation Token to cancel the request. /// Task of ApiResponse - System.Threading.Tasks.Task> TestEnumParametersAsyncWithHttpInfo (List enumHeaderStringArray = default(List), string enumHeaderString = default(string), List enumQueryStringArray = default(List), string enumQueryString = default(string), int? enumQueryInteger = default(int?), double? enumQueryDouble = default(double?), List enumFormStringArray = default(List), string enumFormString = default(string)); + System.Threading.Tasks.Task> TestEnumParametersAsyncWithHttpInfo (List enumHeaderStringArray = default(List), string enumHeaderString = default(string), List enumQueryStringArray = default(List), string enumQueryString = default(string), int? enumQueryInteger = default(int?), double? enumQueryDouble = default(double?), List enumFormStringArray = default(List), string enumFormString = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Fake endpoint to test group parameters (optional) /// @@ -652,13 +714,19 @@ public interface IFakeApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// Required String in group parameters + /// Cancellation Token to cancel the request. /// Required Boolean in group parameters + /// Cancellation Token to cancel the request. /// Required Integer in group parameters + /// Cancellation Token to cancel the request. /// String in group parameters (optional) + /// Cancellation Token to cancel the request. /// Boolean in group parameters (optional) + /// Cancellation Token to cancel the request. /// Integer in group parameters (optional) + /// Cancellation Token to cancel the request. /// Task of void - System.Threading.Tasks.Task TestGroupParametersAsync (int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, int? stringGroup = default(int?), bool? booleanGroup = default(bool?), long? int64Group = default(long?)); + System.Threading.Tasks.Task TestGroupParametersAsync (int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, int? stringGroup = default(int?), bool? booleanGroup = default(bool?), long? int64Group = default(long?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Fake endpoint to test group parameters (optional) @@ -667,14 +735,20 @@ public interface IFakeApiAsync : IApiAccessor /// Fake endpoint to test group parameters (optional) /// /// Thrown when fails to make API call - /// Required String in group parameters - /// Required Boolean in group parameters - /// Required Integer in group parameters - /// String in group parameters (optional) - /// Boolean in group parameters (optional) - /// Integer in group parameters (optional) + /// Required String in group parameters + /// Cancellation Token to cancel the request. + /// Required Boolean in group parameters + /// Cancellation Token to cancel the request. + /// Required Integer in group parameters + /// Cancellation Token to cancel the request. + /// String in group parameters (optional) + /// Cancellation Token to cancel the request. + /// Boolean in group parameters (optional) + /// Cancellation Token to cancel the request. + /// Integer in group parameters (optional) + /// Cancellation Token to cancel the request. /// Task of ApiResponse - System.Threading.Tasks.Task> TestGroupParametersAsyncWithHttpInfo (int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, int? stringGroup = default(int?), bool? booleanGroup = default(bool?), long? int64Group = default(long?)); + System.Threading.Tasks.Task> TestGroupParametersAsyncWithHttpInfo (int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, int? stringGroup = default(int?), bool? booleanGroup = default(bool?), long? int64Group = default(long?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// test inline additionalProperties /// @@ -683,8 +757,9 @@ public interface IFakeApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// request body + /// Cancellation Token to cancel the request. /// Task of void - System.Threading.Tasks.Task TestInlineAdditionalPropertiesAsync (Dictionary param); + System.Threading.Tasks.Task TestInlineAdditionalPropertiesAsync (Dictionary param, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// test inline additionalProperties @@ -693,9 +768,10 @@ public interface IFakeApiAsync : IApiAccessor /// /// /// Thrown when fails to make API call - /// request body + /// request body + /// Cancellation Token to cancel the request. /// Task of ApiResponse - System.Threading.Tasks.Task> TestInlineAdditionalPropertiesAsyncWithHttpInfo (Dictionary param); + System.Threading.Tasks.Task> TestInlineAdditionalPropertiesAsyncWithHttpInfo (Dictionary param, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// test json serialization of form data /// @@ -704,9 +780,11 @@ public interface IFakeApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// field1 + /// Cancellation Token to cancel the request. /// field2 + /// Cancellation Token to cancel the request. /// Task of void - System.Threading.Tasks.Task TestJsonFormDataAsync (string param, string param2); + System.Threading.Tasks.Task TestJsonFormDataAsync (string param, string param2, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// test json serialization of form data @@ -715,10 +793,12 @@ public interface IFakeApiAsync : IApiAccessor /// /// /// Thrown when fails to make API call - /// field1 - /// field2 + /// field1 + /// Cancellation Token to cancel the request. + /// field2 + /// Cancellation Token to cancel the request. /// Task of ApiResponse - System.Threading.Tasks.Task> TestJsonFormDataAsyncWithHttpInfo (string param, string param2); + System.Threading.Tasks.Task> TestJsonFormDataAsyncWithHttpInfo (string param, string param2, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// /// @@ -727,12 +807,17 @@ public interface IFakeApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// + /// Cancellation Token to cancel the request. /// + /// Cancellation Token to cancel the request. /// + /// Cancellation Token to cancel the request. /// + /// Cancellation Token to cancel the request. /// + /// Cancellation Token to cancel the request. /// Task of void - System.Threading.Tasks.Task TestQueryParameterCollectionFormatAsync (List pipe, List ioutil, List http, List url, List context); + System.Threading.Tasks.Task TestQueryParameterCollectionFormatAsync (List pipe, List ioutil, List http, List url, List context, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// @@ -741,13 +826,18 @@ public interface IFakeApiAsync : IApiAccessor /// To test the collection format in query parameters /// /// Thrown when fails to make API call - /// - /// - /// - /// - /// + /// + /// Cancellation Token to cancel the request. + /// + /// Cancellation Token to cancel the request. + /// + /// Cancellation Token to cancel the request. + /// + /// Cancellation Token to cancel the request. + /// + /// Cancellation Token to cancel the request. /// Task of ApiResponse - System.Threading.Tasks.Task> TestQueryParameterCollectionFormatAsyncWithHttpInfo (List pipe, List ioutil, List http, List url, List context); + System.Threading.Tasks.Task> TestQueryParameterCollectionFormatAsyncWithHttpInfo (List pipe, List ioutil, List http, List url, List context, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); #endregion Asynchronous Operations } @@ -931,11 +1021,12 @@ public Org.OpenAPITools.Client.ApiResponse CreateXmlItemWithHttpInfo (Xm /// creates an XmlItem this route creates an XmlItem /// /// Thrown when fails to make API call - /// XmlItem Body + /// XmlItem Body + /// Cancellation Token to cancel the request. /// Task of void - public async System.Threading.Tasks.Task CreateXmlItemAsync (XmlItem xmlItem) + public async System.Threading.Tasks.Task CreateXmlItemAsync (XmlItem xmlItem, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - await CreateXmlItemAsyncWithHttpInfo(xmlItem); + await CreateXmlItemAsyncWithHttpInfo(xmlItem, cancellationToken); } @@ -943,9 +1034,10 @@ public async System.Threading.Tasks.Task CreateXmlItemAsync (XmlItem xmlItem) /// creates an XmlItem this route creates an XmlItem /// /// Thrown when fails to make API call - /// XmlItem Body + /// XmlItem Body + /// Cancellation Token to cancel the request. /// Task of ApiResponse - public async System.Threading.Tasks.Task> CreateXmlItemAsyncWithHttpInfo (XmlItem xmlItem) + public async System.Threading.Tasks.Task> CreateXmlItemAsyncWithHttpInfo (XmlItem xmlItem, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // verify the required parameter 'xmlItem' is set if (xmlItem == null) @@ -979,7 +1071,7 @@ public async System.Threading.Tasks.Task CreateXmlItemAsync (XmlItem xmlItem) // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/fake/create_xml_item", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.PostAsync("/fake/create_xml_item", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { @@ -1045,11 +1137,12 @@ public async System.Threading.Tasks.Task CreateXmlItemAsync (XmlItem xmlItem) /// Test serialization of outer boolean types /// /// Thrown when fails to make API call - /// Input boolean as post body (optional) + /// Input boolean as post body (optional) + /// Cancellation Token to cancel the request. /// Task of bool - public async System.Threading.Tasks.Task FakeOuterBooleanSerializeAsync (bool? body = default(bool?)) + public async System.Threading.Tasks.Task FakeOuterBooleanSerializeAsync (bool? body = default(bool?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - Org.OpenAPITools.Client.ApiResponse localVarResponse = await FakeOuterBooleanSerializeAsyncWithHttpInfo(body); + Org.OpenAPITools.Client.ApiResponse localVarResponse = await FakeOuterBooleanSerializeAsyncWithHttpInfo(body, cancellationToken); return localVarResponse.Data; } @@ -1058,9 +1151,10 @@ public async System.Threading.Tasks.Task CreateXmlItemAsync (XmlItem xmlItem) /// Test serialization of outer boolean types /// /// Thrown when fails to make API call - /// Input boolean as post body (optional) + /// Input boolean as post body (optional) + /// Cancellation Token to cancel the request. /// Task of ApiResponse (bool) - public async System.Threading.Tasks.Task> FakeOuterBooleanSerializeAsyncWithHttpInfo (bool? body = default(bool?)) + public async System.Threading.Tasks.Task> FakeOuterBooleanSerializeAsyncWithHttpInfo (bool? body = default(bool?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1085,7 +1179,7 @@ public async System.Threading.Tasks.Task CreateXmlItemAsync (XmlItem xmlItem) // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/fake/outer/boolean", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.PostAsync("/fake/outer/boolean", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { @@ -1151,11 +1245,12 @@ public async System.Threading.Tasks.Task CreateXmlItemAsync (XmlItem xmlItem) /// Test serialization of object with outer number type /// /// Thrown when fails to make API call - /// Input composite as post body (optional) + /// Input composite as post body (optional) + /// Cancellation Token to cancel the request. /// Task of OuterComposite - public async System.Threading.Tasks.Task FakeOuterCompositeSerializeAsync (OuterComposite body = default(OuterComposite)) + public async System.Threading.Tasks.Task FakeOuterCompositeSerializeAsync (OuterComposite body = default(OuterComposite), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - Org.OpenAPITools.Client.ApiResponse localVarResponse = await FakeOuterCompositeSerializeAsyncWithHttpInfo(body); + Org.OpenAPITools.Client.ApiResponse localVarResponse = await FakeOuterCompositeSerializeAsyncWithHttpInfo(body, cancellationToken); return localVarResponse.Data; } @@ -1164,9 +1259,10 @@ public async System.Threading.Tasks.Task CreateXmlItemAsync (XmlItem xmlItem) /// Test serialization of object with outer number type /// /// Thrown when fails to make API call - /// Input composite as post body (optional) + /// Input composite as post body (optional) + /// Cancellation Token to cancel the request. /// Task of ApiResponse (OuterComposite) - public async System.Threading.Tasks.Task> FakeOuterCompositeSerializeAsyncWithHttpInfo (OuterComposite body = default(OuterComposite)) + public async System.Threading.Tasks.Task> FakeOuterCompositeSerializeAsyncWithHttpInfo (OuterComposite body = default(OuterComposite), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1191,7 +1287,7 @@ public async System.Threading.Tasks.Task CreateXmlItemAsync (XmlItem xmlItem) // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/fake/outer/composite", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.PostAsync("/fake/outer/composite", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { @@ -1257,11 +1353,12 @@ public async System.Threading.Tasks.Task CreateXmlItemAsync (XmlItem xmlItem) /// Test serialization of outer number types /// /// Thrown when fails to make API call - /// Input number as post body (optional) + /// Input number as post body (optional) + /// Cancellation Token to cancel the request. /// Task of decimal - public async System.Threading.Tasks.Task FakeOuterNumberSerializeAsync (decimal? body = default(decimal?)) + public async System.Threading.Tasks.Task FakeOuterNumberSerializeAsync (decimal? body = default(decimal?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - Org.OpenAPITools.Client.ApiResponse localVarResponse = await FakeOuterNumberSerializeAsyncWithHttpInfo(body); + Org.OpenAPITools.Client.ApiResponse localVarResponse = await FakeOuterNumberSerializeAsyncWithHttpInfo(body, cancellationToken); return localVarResponse.Data; } @@ -1270,9 +1367,10 @@ public async System.Threading.Tasks.Task CreateXmlItemAsync (XmlItem xmlItem) /// Test serialization of outer number types /// /// Thrown when fails to make API call - /// Input number as post body (optional) + /// Input number as post body (optional) + /// Cancellation Token to cancel the request. /// Task of ApiResponse (decimal) - public async System.Threading.Tasks.Task> FakeOuterNumberSerializeAsyncWithHttpInfo (decimal? body = default(decimal?)) + public async System.Threading.Tasks.Task> FakeOuterNumberSerializeAsyncWithHttpInfo (decimal? body = default(decimal?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1297,7 +1395,7 @@ public async System.Threading.Tasks.Task CreateXmlItemAsync (XmlItem xmlItem) // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/fake/outer/number", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.PostAsync("/fake/outer/number", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { @@ -1363,11 +1461,12 @@ public async System.Threading.Tasks.Task CreateXmlItemAsync (XmlItem xmlItem) /// Test serialization of outer string types /// /// Thrown when fails to make API call - /// Input string as post body (optional) + /// Input string as post body (optional) + /// Cancellation Token to cancel the request. /// Task of string - public async System.Threading.Tasks.Task FakeOuterStringSerializeAsync (string body = default(string)) + public async System.Threading.Tasks.Task FakeOuterStringSerializeAsync (string body = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - Org.OpenAPITools.Client.ApiResponse localVarResponse = await FakeOuterStringSerializeAsyncWithHttpInfo(body); + Org.OpenAPITools.Client.ApiResponse localVarResponse = await FakeOuterStringSerializeAsyncWithHttpInfo(body, cancellationToken); return localVarResponse.Data; } @@ -1376,9 +1475,10 @@ public async System.Threading.Tasks.Task CreateXmlItemAsync (XmlItem xmlItem) /// Test serialization of outer string types /// /// Thrown when fails to make API call - /// Input string as post body (optional) + /// Input string as post body (optional) + /// Cancellation Token to cancel the request. /// Task of ApiResponse (string) - public async System.Threading.Tasks.Task> FakeOuterStringSerializeAsyncWithHttpInfo (string body = default(string)) + public async System.Threading.Tasks.Task> FakeOuterStringSerializeAsyncWithHttpInfo (string body = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1403,7 +1503,7 @@ public async System.Threading.Tasks.Task CreateXmlItemAsync (XmlItem xmlItem) // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/fake/outer/string", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.PostAsync("/fake/outer/string", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { @@ -1472,11 +1572,12 @@ public Org.OpenAPITools.Client.ApiResponse TestBodyWithFileSchemaWithHtt /// For this test, the body for this request much reference a schema named `File`. /// /// Thrown when fails to make API call - /// + /// + /// Cancellation Token to cancel the request. /// Task of void - public async System.Threading.Tasks.Task TestBodyWithFileSchemaAsync (FileSchemaTestClass body) + public async System.Threading.Tasks.Task TestBodyWithFileSchemaAsync (FileSchemaTestClass body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - await TestBodyWithFileSchemaAsyncWithHttpInfo(body); + await TestBodyWithFileSchemaAsyncWithHttpInfo(body, cancellationToken); } @@ -1484,9 +1585,10 @@ public async System.Threading.Tasks.Task TestBodyWithFileSchemaAsync (FileSchema /// For this test, the body for this request much reference a schema named `File`. /// /// Thrown when fails to make API call - /// + /// + /// Cancellation Token to cancel the request. /// Task of ApiResponse - public async System.Threading.Tasks.Task> TestBodyWithFileSchemaAsyncWithHttpInfo (FileSchemaTestClass body) + public async System.Threading.Tasks.Task> TestBodyWithFileSchemaAsyncWithHttpInfo (FileSchemaTestClass body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // verify the required parameter 'body' is set if (body == null) @@ -1515,7 +1617,7 @@ public async System.Threading.Tasks.Task TestBodyWithFileSchemaAsync (FileSchema // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PutAsync("/fake/body-with-file-schema", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.PutAsync("/fake/body-with-file-schema", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { @@ -1591,12 +1693,14 @@ public Org.OpenAPITools.Client.ApiResponse TestBodyWithQueryParamsWithHt /// /// /// Thrown when fails to make API call - /// - /// + /// + /// Cancellation Token to cancel the request. + /// + /// Cancellation Token to cancel the request. /// Task of void - public async System.Threading.Tasks.Task TestBodyWithQueryParamsAsync (string query, User body) + public async System.Threading.Tasks.Task TestBodyWithQueryParamsAsync (string query, User body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - await TestBodyWithQueryParamsAsyncWithHttpInfo(query, body); + await TestBodyWithQueryParamsAsyncWithHttpInfo(query, body, cancellationToken); } @@ -1604,10 +1708,12 @@ public async System.Threading.Tasks.Task TestBodyWithQueryParamsAsync (string qu /// /// /// Thrown when fails to make API call - /// - /// + /// + /// Cancellation Token to cancel the request. + /// + /// Cancellation Token to cancel the request. /// Task of ApiResponse - public async System.Threading.Tasks.Task> TestBodyWithQueryParamsAsyncWithHttpInfo (string query, User body) + public async System.Threading.Tasks.Task> TestBodyWithQueryParamsAsyncWithHttpInfo (string query, User body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // verify the required parameter 'query' is set if (query == null) @@ -1641,7 +1747,7 @@ public async System.Threading.Tasks.Task TestBodyWithQueryParamsAsync (string qu // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PutAsync("/fake/body-with-query-params", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.PutAsync("/fake/body-with-query-params", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { @@ -1712,11 +1818,12 @@ public Org.OpenAPITools.Client.ApiResponse< ModelClient > TestClientModelWithHtt /// To test \"client\" model To test \"client\" model /// /// Thrown when fails to make API call - /// client model + /// client model + /// Cancellation Token to cancel the request. /// Task of ModelClient - public async System.Threading.Tasks.Task TestClientModelAsync (ModelClient body) + public async System.Threading.Tasks.Task TestClientModelAsync (ModelClient body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - Org.OpenAPITools.Client.ApiResponse localVarResponse = await TestClientModelAsyncWithHttpInfo(body); + Org.OpenAPITools.Client.ApiResponse localVarResponse = await TestClientModelAsyncWithHttpInfo(body, cancellationToken); return localVarResponse.Data; } @@ -1725,9 +1832,10 @@ public async System.Threading.Tasks.Task TestClientModelAsync (Mode /// To test \"client\" model To test \"client\" model /// /// Thrown when fails to make API call - /// client model + /// client model + /// Cancellation Token to cancel the request. /// Task of ApiResponse (ModelClient) - public async System.Threading.Tasks.Task> TestClientModelAsyncWithHttpInfo (ModelClient body) + public async System.Threading.Tasks.Task> TestClientModelAsyncWithHttpInfo (ModelClient body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // verify the required parameter 'body' is set if (body == null) @@ -1757,7 +1865,7 @@ public async System.Threading.Tasks.Task TestClientModelAsync (Mode // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PatchAsync("/fake", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.PatchAsync("/fake", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { @@ -1905,24 +2013,38 @@ public async System.Threading.Tasks.Task TestClientModelAsync (Mode /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 /// /// Thrown when fails to make API call - /// None - /// None - /// None - /// None - /// None (optional) - /// None (optional) - /// None (optional) - /// None (optional) - /// None (optional) - /// None (optional) - /// None (optional) - /// None (optional) - /// None (optional) - /// None (optional) + /// None + /// Cancellation Token to cancel the request. + /// None + /// Cancellation Token to cancel the request. + /// None + /// Cancellation Token to cancel the request. + /// None + /// Cancellation Token to cancel the request. + /// None (optional) + /// Cancellation Token to cancel the request. + /// None (optional) + /// Cancellation Token to cancel the request. + /// None (optional) + /// Cancellation Token to cancel the request. + /// None (optional) + /// Cancellation Token to cancel the request. + /// None (optional) + /// Cancellation Token to cancel the request. + /// None (optional) + /// Cancellation Token to cancel the request. + /// None (optional) + /// Cancellation Token to cancel the request. + /// None (optional) + /// Cancellation Token to cancel the request. + /// None (optional) + /// Cancellation Token to cancel the request. + /// None (optional) + /// Cancellation Token to cancel the request. /// Task of void - public async System.Threading.Tasks.Task TestEndpointParametersAsync (decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int? integer = default(int?), int? int32 = default(int?), long? int64 = default(long?), float? _float = default(float?), string _string = default(string), System.IO.Stream binary = default(System.IO.Stream), DateTime? date = default(DateTime?), DateTime? dateTime = default(DateTime?), string password = default(string), string callback = default(string)) + public async System.Threading.Tasks.Task TestEndpointParametersAsync (decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int? integer = default(int?), int? int32 = default(int?), long? int64 = default(long?), float? _float = default(float?), string _string = default(string), System.IO.Stream binary = default(System.IO.Stream), DateTime? date = default(DateTime?), DateTime? dateTime = default(DateTime?), string password = default(string), string callback = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - await TestEndpointParametersAsyncWithHttpInfo(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, _string, binary, date, dateTime, password, callback); + await TestEndpointParametersAsyncWithHttpInfo(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, _string, binary, date, dateTime, password, callback, cancellationToken); } @@ -1930,22 +2052,36 @@ public async System.Threading.Tasks.Task TestClientModelAsync (Mode /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 /// /// Thrown when fails to make API call - /// None - /// None - /// None - /// None - /// None (optional) - /// None (optional) - /// None (optional) - /// None (optional) - /// None (optional) - /// None (optional) - /// None (optional) - /// None (optional) - /// None (optional) - /// None (optional) + /// None + /// Cancellation Token to cancel the request. + /// None + /// Cancellation Token to cancel the request. + /// None + /// Cancellation Token to cancel the request. + /// None + /// Cancellation Token to cancel the request. + /// None (optional) + /// Cancellation Token to cancel the request. + /// None (optional) + /// Cancellation Token to cancel the request. + /// None (optional) + /// Cancellation Token to cancel the request. + /// None (optional) + /// Cancellation Token to cancel the request. + /// None (optional) + /// Cancellation Token to cancel the request. + /// None (optional) + /// Cancellation Token to cancel the request. + /// None (optional) + /// Cancellation Token to cancel the request. + /// None (optional) + /// Cancellation Token to cancel the request. + /// None (optional) + /// Cancellation Token to cancel the request. + /// None (optional) + /// Cancellation Token to cancel the request. /// Task of ApiResponse - public async System.Threading.Tasks.Task> TestEndpointParametersAsyncWithHttpInfo (decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int? integer = default(int?), int? int32 = default(int?), long? int64 = default(long?), float? _float = default(float?), string _string = default(string), System.IO.Stream binary = default(System.IO.Stream), DateTime? date = default(DateTime?), DateTime? dateTime = default(DateTime?), string password = default(string), string callback = default(string)) + public async System.Threading.Tasks.Task> TestEndpointParametersAsyncWithHttpInfo (decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int? integer = default(int?), int? int32 = default(int?), long? int64 = default(long?), float? _float = default(float?), string _string = default(string), System.IO.Stream binary = default(System.IO.Stream), DateTime? date = default(DateTime?), DateTime? dateTime = default(DateTime?), string password = default(string), string callback = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // verify the required parameter 'patternWithoutDelimiter' is set if (patternWithoutDelimiter == null) @@ -2027,7 +2163,7 @@ public async System.Threading.Tasks.Task TestClientModelAsync (Mode // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/fake", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.PostAsync("/fake", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { @@ -2137,18 +2273,26 @@ public async System.Threading.Tasks.Task TestClientModelAsync (Mode /// To test enum parameters To test enum parameters /// /// Thrown when fails to make API call - /// Header parameter enum test (string array) (optional) - /// Header parameter enum test (string) (optional, default to -efg) - /// Query parameter enum test (string array) (optional) - /// Query parameter enum test (string) (optional, default to -efg) - /// Query parameter enum test (double) (optional) - /// Query parameter enum test (double) (optional) - /// Form parameter enum test (string array) (optional, default to $) - /// Form parameter enum test (string) (optional, default to -efg) + /// Header parameter enum test (string array) (optional) + /// Cancellation Token to cancel the request. + /// Header parameter enum test (string) (optional, default to -efg) + /// Cancellation Token to cancel the request. + /// Query parameter enum test (string array) (optional) + /// Cancellation Token to cancel the request. + /// Query parameter enum test (string) (optional, default to -efg) + /// Cancellation Token to cancel the request. + /// Query parameter enum test (double) (optional) + /// Cancellation Token to cancel the request. + /// Query parameter enum test (double) (optional) + /// Cancellation Token to cancel the request. + /// Form parameter enum test (string array) (optional, default to $) + /// Cancellation Token to cancel the request. + /// Form parameter enum test (string) (optional, default to -efg) + /// Cancellation Token to cancel the request. /// Task of void - public async System.Threading.Tasks.Task TestEnumParametersAsync (List enumHeaderStringArray = default(List), string enumHeaderString = default(string), List enumQueryStringArray = default(List), string enumQueryString = default(string), int? enumQueryInteger = default(int?), double? enumQueryDouble = default(double?), List enumFormStringArray = default(List), string enumFormString = default(string)) + public async System.Threading.Tasks.Task TestEnumParametersAsync (List enumHeaderStringArray = default(List), string enumHeaderString = default(string), List enumQueryStringArray = default(List), string enumQueryString = default(string), int? enumQueryInteger = default(int?), double? enumQueryDouble = default(double?), List enumFormStringArray = default(List), string enumFormString = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - await TestEnumParametersAsyncWithHttpInfo(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); + await TestEnumParametersAsyncWithHttpInfo(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString, cancellationToken); } @@ -2156,16 +2300,24 @@ public async System.Threading.Tasks.Task TestClientModelAsync (Mode /// To test enum parameters To test enum parameters /// /// Thrown when fails to make API call - /// Header parameter enum test (string array) (optional) - /// Header parameter enum test (string) (optional, default to -efg) - /// Query parameter enum test (string array) (optional) - /// Query parameter enum test (string) (optional, default to -efg) - /// Query parameter enum test (double) (optional) - /// Query parameter enum test (double) (optional) - /// Form parameter enum test (string array) (optional, default to $) - /// Form parameter enum test (string) (optional, default to -efg) + /// Header parameter enum test (string array) (optional) + /// Cancellation Token to cancel the request. + /// Header parameter enum test (string) (optional, default to -efg) + /// Cancellation Token to cancel the request. + /// Query parameter enum test (string array) (optional) + /// Cancellation Token to cancel the request. + /// Query parameter enum test (string) (optional, default to -efg) + /// Cancellation Token to cancel the request. + /// Query parameter enum test (double) (optional) + /// Cancellation Token to cancel the request. + /// Query parameter enum test (double) (optional) + /// Cancellation Token to cancel the request. + /// Form parameter enum test (string array) (optional, default to $) + /// Cancellation Token to cancel the request. + /// Form parameter enum test (string) (optional, default to -efg) + /// Cancellation Token to cancel the request. /// Task of ApiResponse - public async System.Threading.Tasks.Task> TestEnumParametersAsyncWithHttpInfo (List enumHeaderStringArray = default(List), string enumHeaderString = default(string), List enumQueryStringArray = default(List), string enumQueryString = default(string), int? enumQueryInteger = default(int?), double? enumQueryDouble = default(double?), List enumFormStringArray = default(List), string enumFormString = default(string)) + public async System.Threading.Tasks.Task> TestEnumParametersAsyncWithHttpInfo (List enumHeaderStringArray = default(List), string enumHeaderString = default(string), List enumQueryStringArray = default(List), string enumQueryString = default(string), int? enumQueryInteger = default(int?), double? enumQueryDouble = default(double?), List enumFormStringArray = default(List), string enumFormString = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -2221,7 +2373,7 @@ public async System.Threading.Tasks.Task TestClientModelAsync (Mode // make the HTTP request - var localVarResponse = await this.AsynchronousClient.GetAsync("/fake", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.GetAsync("/fake", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { @@ -2309,16 +2461,22 @@ public async System.Threading.Tasks.Task TestClientModelAsync (Mode /// Fake endpoint to test group parameters (optional) Fake endpoint to test group parameters (optional) /// /// Thrown when fails to make API call - /// Required String in group parameters - /// Required Boolean in group parameters - /// Required Integer in group parameters - /// String in group parameters (optional) - /// Boolean in group parameters (optional) - /// Integer in group parameters (optional) + /// Required String in group parameters + /// Cancellation Token to cancel the request. + /// Required Boolean in group parameters + /// Cancellation Token to cancel the request. + /// Required Integer in group parameters + /// Cancellation Token to cancel the request. + /// String in group parameters (optional) + /// Cancellation Token to cancel the request. + /// Boolean in group parameters (optional) + /// Cancellation Token to cancel the request. + /// Integer in group parameters (optional) + /// Cancellation Token to cancel the request. /// Task of void - public async System.Threading.Tasks.Task TestGroupParametersAsync (int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, int? stringGroup = default(int?), bool? booleanGroup = default(bool?), long? int64Group = default(long?)) + public async System.Threading.Tasks.Task TestGroupParametersAsync (int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, int? stringGroup = default(int?), bool? booleanGroup = default(bool?), long? int64Group = default(long?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - await TestGroupParametersAsyncWithHttpInfo(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); + await TestGroupParametersAsyncWithHttpInfo(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group, cancellationToken); } @@ -2326,14 +2484,20 @@ public async System.Threading.Tasks.Task TestClientModelAsync (Mode /// Fake endpoint to test group parameters (optional) Fake endpoint to test group parameters (optional) /// /// Thrown when fails to make API call - /// Required String in group parameters - /// Required Boolean in group parameters - /// Required Integer in group parameters - /// String in group parameters (optional) - /// Boolean in group parameters (optional) - /// Integer in group parameters (optional) + /// Required String in group parameters + /// Cancellation Token to cancel the request. + /// Required Boolean in group parameters + /// Cancellation Token to cancel the request. + /// Required Integer in group parameters + /// Cancellation Token to cancel the request. + /// String in group parameters (optional) + /// Cancellation Token to cancel the request. + /// Boolean in group parameters (optional) + /// Cancellation Token to cancel the request. + /// Integer in group parameters (optional) + /// Cancellation Token to cancel the request. /// Task of ApiResponse - public async System.Threading.Tasks.Task> TestGroupParametersAsyncWithHttpInfo (int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, int? stringGroup = default(int?), bool? booleanGroup = default(bool?), long? int64Group = default(long?)) + public async System.Threading.Tasks.Task> TestGroupParametersAsyncWithHttpInfo (int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, int? stringGroup = default(int?), bool? booleanGroup = default(bool?), long? int64Group = default(long?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -2371,7 +2535,7 @@ public async System.Threading.Tasks.Task TestClientModelAsync (Mode // make the HTTP request - var localVarResponse = await this.AsynchronousClient.DeleteAsync("/fake", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.DeleteAsync("/fake", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { @@ -2440,11 +2604,12 @@ public Org.OpenAPITools.Client.ApiResponse TestInlineAdditionalPropertie /// test inline additionalProperties /// /// Thrown when fails to make API call - /// request body + /// request body + /// Cancellation Token to cancel the request. /// Task of void - public async System.Threading.Tasks.Task TestInlineAdditionalPropertiesAsync (Dictionary param) + public async System.Threading.Tasks.Task TestInlineAdditionalPropertiesAsync (Dictionary param, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - await TestInlineAdditionalPropertiesAsyncWithHttpInfo(param); + await TestInlineAdditionalPropertiesAsyncWithHttpInfo(param, cancellationToken); } @@ -2452,9 +2617,10 @@ public async System.Threading.Tasks.Task TestInlineAdditionalPropertiesAsync (Di /// test inline additionalProperties /// /// Thrown when fails to make API call - /// request body + /// request body + /// Cancellation Token to cancel the request. /// Task of ApiResponse - public async System.Threading.Tasks.Task> TestInlineAdditionalPropertiesAsyncWithHttpInfo (Dictionary param) + public async System.Threading.Tasks.Task> TestInlineAdditionalPropertiesAsyncWithHttpInfo (Dictionary param, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // verify the required parameter 'param' is set if (param == null) @@ -2483,7 +2649,7 @@ public async System.Threading.Tasks.Task TestInlineAdditionalPropertiesAsync (Di // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/fake/inline-additionalProperties", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.PostAsync("/fake/inline-additionalProperties", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { @@ -2559,12 +2725,14 @@ public Org.OpenAPITools.Client.ApiResponse TestJsonFormDataWithHttpInfo /// test json serialization of form data /// /// Thrown when fails to make API call - /// field1 - /// field2 + /// field1 + /// Cancellation Token to cancel the request. + /// field2 + /// Cancellation Token to cancel the request. /// Task of void - public async System.Threading.Tasks.Task TestJsonFormDataAsync (string param, string param2) + public async System.Threading.Tasks.Task TestJsonFormDataAsync (string param, string param2, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - await TestJsonFormDataAsyncWithHttpInfo(param, param2); + await TestJsonFormDataAsyncWithHttpInfo(param, param2, cancellationToken); } @@ -2572,10 +2740,12 @@ public async System.Threading.Tasks.Task TestJsonFormDataAsync (string param, st /// test json serialization of form data /// /// Thrown when fails to make API call - /// field1 - /// field2 + /// field1 + /// Cancellation Token to cancel the request. + /// field2 + /// Cancellation Token to cancel the request. /// Task of ApiResponse - public async System.Threading.Tasks.Task> TestJsonFormDataAsyncWithHttpInfo (string param, string param2) + public async System.Threading.Tasks.Task> TestJsonFormDataAsyncWithHttpInfo (string param, string param2, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // verify the required parameter 'param' is set if (param == null) @@ -2609,7 +2779,7 @@ public async System.Threading.Tasks.Task TestJsonFormDataAsync (string param, st // make the HTTP request - var localVarResponse = await this.AsynchronousClient.GetAsync("/fake/jsonFormData", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.GetAsync("/fake/jsonFormData", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { @@ -2705,15 +2875,20 @@ public Org.OpenAPITools.Client.ApiResponse TestQueryParameterCollectionF /// To test the collection format in query parameters /// /// Thrown when fails to make API call - /// - /// - /// - /// - /// + /// + /// Cancellation Token to cancel the request. + /// + /// Cancellation Token to cancel the request. + /// + /// Cancellation Token to cancel the request. + /// + /// Cancellation Token to cancel the request. + /// + /// Cancellation Token to cancel the request. /// Task of void - public async System.Threading.Tasks.Task TestQueryParameterCollectionFormatAsync (List pipe, List ioutil, List http, List url, List context) + public async System.Threading.Tasks.Task TestQueryParameterCollectionFormatAsync (List pipe, List ioutil, List http, List url, List context, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - await TestQueryParameterCollectionFormatAsyncWithHttpInfo(pipe, ioutil, http, url, context); + await TestQueryParameterCollectionFormatAsyncWithHttpInfo(pipe, ioutil, http, url, context, cancellationToken); } @@ -2721,13 +2896,18 @@ public async System.Threading.Tasks.Task TestQueryParameterCollectionFormatAsync /// To test the collection format in query parameters /// /// Thrown when fails to make API call - /// - /// - /// - /// - /// + /// + /// Cancellation Token to cancel the request. + /// + /// Cancellation Token to cancel the request. + /// + /// Cancellation Token to cancel the request. + /// + /// Cancellation Token to cancel the request. + /// + /// Cancellation Token to cancel the request. /// Task of ApiResponse - public async System.Threading.Tasks.Task> TestQueryParameterCollectionFormatAsyncWithHttpInfo (List pipe, List ioutil, List http, List url, List context) + public async System.Threading.Tasks.Task> TestQueryParameterCollectionFormatAsyncWithHttpInfo (List pipe, List ioutil, List http, List url, List context, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // verify the required parameter 'pipe' is set if (pipe == null) @@ -2775,7 +2955,7 @@ public async System.Threading.Tasks.Task TestQueryParameterCollectionFormatAsync // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PutAsync("/fake/test-query-paramters", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.PutAsync("/fake/test-query-paramters", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs index b663807131fd..ca7fecd46a3d 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs @@ -65,8 +65,9 @@ public interface IFakeClassnameTags123ApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// client model + /// Cancellation Token to cancel the request. /// Task of ModelClient - System.Threading.Tasks.Task TestClassnameAsync (ModelClient body); + System.Threading.Tasks.Task TestClassnameAsync (ModelClient body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// To test class name in snake case @@ -75,9 +76,10 @@ public interface IFakeClassnameTags123ApiAsync : IApiAccessor /// To test class name in snake case /// /// Thrown when fails to make API call - /// client model + /// client model + /// Cancellation Token to cancel the request. /// Task of ApiResponse (ModelClient) - System.Threading.Tasks.Task> TestClassnameAsyncWithHttpInfo (ModelClient body); + System.Threading.Tasks.Task> TestClassnameAsyncWithHttpInfo (ModelClient body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); #endregion Asynchronous Operations } @@ -263,11 +265,12 @@ public Org.OpenAPITools.Client.ApiResponse< ModelClient > TestClassnameWithHttpI /// To test class name in snake case To test class name in snake case /// /// Thrown when fails to make API call - /// client model + /// client model + /// Cancellation Token to cancel the request. /// Task of ModelClient - public async System.Threading.Tasks.Task TestClassnameAsync (ModelClient body) + public async System.Threading.Tasks.Task TestClassnameAsync (ModelClient body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - Org.OpenAPITools.Client.ApiResponse localVarResponse = await TestClassnameAsyncWithHttpInfo(body); + Org.OpenAPITools.Client.ApiResponse localVarResponse = await TestClassnameAsyncWithHttpInfo(body, cancellationToken); return localVarResponse.Data; } @@ -276,9 +279,10 @@ public async System.Threading.Tasks.Task TestClassnameAsync (ModelC /// To test class name in snake case To test class name in snake case /// /// Thrown when fails to make API call - /// client model + /// client model + /// Cancellation Token to cancel the request. /// Task of ApiResponse (ModelClient) - public async System.Threading.Tasks.Task> TestClassnameAsyncWithHttpInfo (ModelClient body) + public async System.Threading.Tasks.Task> TestClassnameAsyncWithHttpInfo (ModelClient body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // verify the required parameter 'body' is set if (body == null) @@ -313,7 +317,7 @@ public async System.Threading.Tasks.Task TestClassnameAsync (ModelC // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PatchAsync("/fake_classname_test", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.PatchAsync("/fake_classname_test", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/PetApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/PetApi.cs index 6c50956c4ad5..a9f87aeb4eaa 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/PetApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/PetApi.cs @@ -247,8 +247,9 @@ public interface IPetApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// Pet object that needs to be added to the store + /// Cancellation Token to cancel the request. /// Task of void - System.Threading.Tasks.Task AddPetAsync (Pet body); + System.Threading.Tasks.Task AddPetAsync (Pet body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Add a new pet to the store @@ -257,9 +258,10 @@ public interface IPetApiAsync : IApiAccessor /// /// /// Thrown when fails to make API call - /// Pet object that needs to be added to the store + /// Pet object that needs to be added to the store + /// Cancellation Token to cancel the request. /// Task of ApiResponse - System.Threading.Tasks.Task> AddPetAsyncWithHttpInfo (Pet body); + System.Threading.Tasks.Task> AddPetAsyncWithHttpInfo (Pet body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Deletes a pet /// @@ -268,9 +270,11 @@ public interface IPetApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// Pet id to delete + /// Cancellation Token to cancel the request. /// (optional) + /// Cancellation Token to cancel the request. /// Task of void - System.Threading.Tasks.Task DeletePetAsync (long petId, string apiKey = default(string)); + System.Threading.Tasks.Task DeletePetAsync (long petId, string apiKey = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Deletes a pet @@ -279,10 +283,12 @@ public interface IPetApiAsync : IApiAccessor /// /// /// Thrown when fails to make API call - /// Pet id to delete - /// (optional) + /// Pet id to delete + /// Cancellation Token to cancel the request. + /// (optional) + /// Cancellation Token to cancel the request. /// Task of ApiResponse - System.Threading.Tasks.Task> DeletePetAsyncWithHttpInfo (long petId, string apiKey = default(string)); + System.Threading.Tasks.Task> DeletePetAsyncWithHttpInfo (long petId, string apiKey = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Finds Pets by status /// @@ -291,8 +297,9 @@ public interface IPetApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// Status values that need to be considered for filter + /// Cancellation Token to cancel the request. /// Task of List<Pet> - System.Threading.Tasks.Task> FindPetsByStatusAsync (List status); + System.Threading.Tasks.Task> FindPetsByStatusAsync (List status, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Finds Pets by status @@ -301,9 +308,10 @@ public interface IPetApiAsync : IApiAccessor /// Multiple status values can be provided with comma separated strings /// /// Thrown when fails to make API call - /// Status values that need to be considered for filter + /// Status values that need to be considered for filter + /// Cancellation Token to cancel the request. /// Task of ApiResponse (List<Pet>) - System.Threading.Tasks.Task>> FindPetsByStatusAsyncWithHttpInfo (List status); + System.Threading.Tasks.Task>> FindPetsByStatusAsyncWithHttpInfo (List status, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Finds Pets by tags /// @@ -312,8 +320,9 @@ public interface IPetApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// Tags to filter by + /// Cancellation Token to cancel the request. /// Task of List<Pet> - System.Threading.Tasks.Task> FindPetsByTagsAsync (List tags); + System.Threading.Tasks.Task> FindPetsByTagsAsync (List tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Finds Pets by tags @@ -322,9 +331,10 @@ public interface IPetApiAsync : IApiAccessor /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. /// /// Thrown when fails to make API call - /// Tags to filter by + /// Tags to filter by + /// Cancellation Token to cancel the request. /// Task of ApiResponse (List<Pet>) - System.Threading.Tasks.Task>> FindPetsByTagsAsyncWithHttpInfo (List tags); + System.Threading.Tasks.Task>> FindPetsByTagsAsyncWithHttpInfo (List tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Find pet by ID /// @@ -333,8 +343,9 @@ public interface IPetApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// ID of pet to return + /// Cancellation Token to cancel the request. /// Task of Pet - System.Threading.Tasks.Task GetPetByIdAsync (long petId); + System.Threading.Tasks.Task GetPetByIdAsync (long petId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Find pet by ID @@ -343,9 +354,10 @@ public interface IPetApiAsync : IApiAccessor /// Returns a single pet /// /// Thrown when fails to make API call - /// ID of pet to return + /// ID of pet to return + /// Cancellation Token to cancel the request. /// Task of ApiResponse (Pet) - System.Threading.Tasks.Task> GetPetByIdAsyncWithHttpInfo (long petId); + System.Threading.Tasks.Task> GetPetByIdAsyncWithHttpInfo (long petId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Update an existing pet /// @@ -354,8 +366,9 @@ public interface IPetApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// Pet object that needs to be added to the store + /// Cancellation Token to cancel the request. /// Task of void - System.Threading.Tasks.Task UpdatePetAsync (Pet body); + System.Threading.Tasks.Task UpdatePetAsync (Pet body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Update an existing pet @@ -364,9 +377,10 @@ public interface IPetApiAsync : IApiAccessor /// /// /// Thrown when fails to make API call - /// Pet object that needs to be added to the store + /// Pet object that needs to be added to the store + /// Cancellation Token to cancel the request. /// Task of ApiResponse - System.Threading.Tasks.Task> UpdatePetAsyncWithHttpInfo (Pet body); + System.Threading.Tasks.Task> UpdatePetAsyncWithHttpInfo (Pet body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Updates a pet in the store with form data /// @@ -375,10 +389,13 @@ public interface IPetApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// ID of pet that needs to be updated + /// Cancellation Token to cancel the request. /// Updated name of the pet (optional) + /// Cancellation Token to cancel the request. /// Updated status of the pet (optional) + /// Cancellation Token to cancel the request. /// Task of void - System.Threading.Tasks.Task UpdatePetWithFormAsync (long petId, string name = default(string), string status = default(string)); + System.Threading.Tasks.Task UpdatePetWithFormAsync (long petId, string name = default(string), string status = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Updates a pet in the store with form data @@ -387,11 +404,14 @@ public interface IPetApiAsync : IApiAccessor /// /// /// Thrown when fails to make API call - /// ID of pet that needs to be updated - /// Updated name of the pet (optional) - /// Updated status of the pet (optional) + /// ID of pet that needs to be updated + /// Cancellation Token to cancel the request. + /// Updated name of the pet (optional) + /// Cancellation Token to cancel the request. + /// Updated status of the pet (optional) + /// Cancellation Token to cancel the request. /// Task of ApiResponse - System.Threading.Tasks.Task> UpdatePetWithFormAsyncWithHttpInfo (long petId, string name = default(string), string status = default(string)); + System.Threading.Tasks.Task> UpdatePetWithFormAsyncWithHttpInfo (long petId, string name = default(string), string status = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// uploads an image /// @@ -400,10 +420,13 @@ public interface IPetApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// ID of pet to update + /// Cancellation Token to cancel the request. /// Additional data to pass to server (optional) + /// Cancellation Token to cancel the request. /// file to upload (optional) + /// Cancellation Token to cancel the request. /// Task of ApiResponse - System.Threading.Tasks.Task UploadFileAsync (long petId, string additionalMetadata = default(string), System.IO.Stream file = default(System.IO.Stream)); + System.Threading.Tasks.Task UploadFileAsync (long petId, string additionalMetadata = default(string), System.IO.Stream file = default(System.IO.Stream), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// uploads an image @@ -412,11 +435,14 @@ public interface IPetApiAsync : IApiAccessor /// /// /// Thrown when fails to make API call - /// ID of pet to update - /// Additional data to pass to server (optional) - /// file to upload (optional) + /// ID of pet to update + /// Cancellation Token to cancel the request. + /// Additional data to pass to server (optional) + /// Cancellation Token to cancel the request. + /// file to upload (optional) + /// Cancellation Token to cancel the request. /// Task of ApiResponse (ApiResponse) - System.Threading.Tasks.Task> UploadFileAsyncWithHttpInfo (long petId, string additionalMetadata = default(string), System.IO.Stream file = default(System.IO.Stream)); + System.Threading.Tasks.Task> UploadFileAsyncWithHttpInfo (long petId, string additionalMetadata = default(string), System.IO.Stream file = default(System.IO.Stream), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// uploads an image (required) /// @@ -425,10 +451,13 @@ public interface IPetApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// ID of pet to update + /// Cancellation Token to cancel the request. /// file to upload + /// Cancellation Token to cancel the request. /// Additional data to pass to server (optional) + /// Cancellation Token to cancel the request. /// Task of ApiResponse - System.Threading.Tasks.Task UploadFileWithRequiredFileAsync (long petId, System.IO.Stream requiredFile, string additionalMetadata = default(string)); + System.Threading.Tasks.Task UploadFileWithRequiredFileAsync (long petId, System.IO.Stream requiredFile, string additionalMetadata = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// uploads an image (required) @@ -437,11 +466,14 @@ public interface IPetApiAsync : IApiAccessor /// /// /// Thrown when fails to make API call - /// ID of pet to update - /// file to upload - /// Additional data to pass to server (optional) + /// ID of pet to update + /// Cancellation Token to cancel the request. + /// file to upload + /// Cancellation Token to cancel the request. + /// Additional data to pass to server (optional) + /// Cancellation Token to cancel the request. /// Task of ApiResponse (ApiResponse) - System.Threading.Tasks.Task> UploadFileWithRequiredFileAsyncWithHttpInfo (long petId, System.IO.Stream requiredFile, string additionalMetadata = default(string)); + System.Threading.Tasks.Task> UploadFileWithRequiredFileAsyncWithHttpInfo (long petId, System.IO.Stream requiredFile, string additionalMetadata = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); #endregion Asynchronous Operations } @@ -627,11 +659,12 @@ public Org.OpenAPITools.Client.ApiResponse AddPetWithHttpInfo (Pet body) /// Add a new pet to the store /// /// Thrown when fails to make API call - /// Pet object that needs to be added to the store + /// Pet object that needs to be added to the store + /// Cancellation Token to cancel the request. /// Task of void - public async System.Threading.Tasks.Task AddPetAsync (Pet body) + public async System.Threading.Tasks.Task AddPetAsync (Pet body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - await AddPetAsyncWithHttpInfo(body); + await AddPetAsyncWithHttpInfo(body, cancellationToken); } @@ -639,9 +672,10 @@ public async System.Threading.Tasks.Task AddPetAsync (Pet body) /// Add a new pet to the store /// /// Thrown when fails to make API call - /// Pet object that needs to be added to the store + /// Pet object that needs to be added to the store + /// Cancellation Token to cancel the request. /// Task of ApiResponse - public async System.Threading.Tasks.Task> AddPetAsyncWithHttpInfo (Pet body) + public async System.Threading.Tasks.Task> AddPetAsyncWithHttpInfo (Pet body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // verify the required parameter 'body' is set if (body == null) @@ -677,7 +711,7 @@ public async System.Threading.Tasks.Task AddPetAsync (Pet body) // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/pet", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.PostAsync("/pet", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { @@ -753,12 +787,14 @@ public async System.Threading.Tasks.Task AddPetAsync (Pet body) /// Deletes a pet /// /// Thrown when fails to make API call - /// Pet id to delete - /// (optional) + /// Pet id to delete + /// Cancellation Token to cancel the request. + /// (optional) + /// Cancellation Token to cancel the request. /// Task of void - public async System.Threading.Tasks.Task DeletePetAsync (long petId, string apiKey = default(string)) + public async System.Threading.Tasks.Task DeletePetAsync (long petId, string apiKey = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - await DeletePetAsyncWithHttpInfo(petId, apiKey); + await DeletePetAsyncWithHttpInfo(petId, apiKey, cancellationToken); } @@ -766,10 +802,12 @@ public async System.Threading.Tasks.Task AddPetAsync (Pet body) /// Deletes a pet /// /// Thrown when fails to make API call - /// Pet id to delete - /// (optional) + /// Pet id to delete + /// Cancellation Token to cancel the request. + /// (optional) + /// Cancellation Token to cancel the request. /// Task of ApiResponse - public async System.Threading.Tasks.Task> DeletePetAsyncWithHttpInfo (long petId, string apiKey = default(string)) + public async System.Threading.Tasks.Task> DeletePetAsyncWithHttpInfo (long petId, string apiKey = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -803,7 +841,7 @@ public async System.Threading.Tasks.Task AddPetAsync (Pet body) // make the HTTP request - var localVarResponse = await this.AsynchronousClient.DeleteAsync("/pet/{petId}", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.DeleteAsync("/pet/{petId}", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { @@ -880,11 +918,12 @@ public Org.OpenAPITools.Client.ApiResponse< List > FindPetsByStatusWithHttp /// Finds Pets by status Multiple status values can be provided with comma separated strings /// /// Thrown when fails to make API call - /// Status values that need to be considered for filter + /// Status values that need to be considered for filter + /// Cancellation Token to cancel the request. /// Task of List<Pet> - public async System.Threading.Tasks.Task> FindPetsByStatusAsync (List status) + public async System.Threading.Tasks.Task> FindPetsByStatusAsync (List status, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - Org.OpenAPITools.Client.ApiResponse> localVarResponse = await FindPetsByStatusAsyncWithHttpInfo(status); + Org.OpenAPITools.Client.ApiResponse> localVarResponse = await FindPetsByStatusAsyncWithHttpInfo(status, cancellationToken); return localVarResponse.Data; } @@ -893,9 +932,10 @@ public async System.Threading.Tasks.Task> FindPetsByStatusAsync (List< /// Finds Pets by status Multiple status values can be provided with comma separated strings /// /// Thrown when fails to make API call - /// Status values that need to be considered for filter + /// Status values that need to be considered for filter + /// Cancellation Token to cancel the request. /// Task of ApiResponse (List<Pet>) - public async System.Threading.Tasks.Task>> FindPetsByStatusAsyncWithHttpInfo (List status) + public async System.Threading.Tasks.Task>> FindPetsByStatusAsyncWithHttpInfo (List status, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // verify the required parameter 'status' is set if (status == null) @@ -931,7 +971,7 @@ public async System.Threading.Tasks.Task> FindPetsByStatusAsync (List< // make the HTTP request - var localVarResponse = await this.AsynchronousClient.GetAsync>("/pet/findByStatus", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.GetAsync>("/pet/findByStatus", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { @@ -1008,11 +1048,12 @@ public Org.OpenAPITools.Client.ApiResponse< List > FindPetsByTagsWithHttpIn /// Finds Pets by tags Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. /// /// Thrown when fails to make API call - /// Tags to filter by + /// Tags to filter by + /// Cancellation Token to cancel the request. /// Task of List<Pet> - public async System.Threading.Tasks.Task> FindPetsByTagsAsync (List tags) + public async System.Threading.Tasks.Task> FindPetsByTagsAsync (List tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - Org.OpenAPITools.Client.ApiResponse> localVarResponse = await FindPetsByTagsAsyncWithHttpInfo(tags); + Org.OpenAPITools.Client.ApiResponse> localVarResponse = await FindPetsByTagsAsyncWithHttpInfo(tags, cancellationToken); return localVarResponse.Data; } @@ -1021,9 +1062,10 @@ public async System.Threading.Tasks.Task> FindPetsByTagsAsync (List /// Thrown when fails to make API call - /// Tags to filter by + /// Tags to filter by + /// Cancellation Token to cancel the request. /// Task of ApiResponse (List<Pet>) - public async System.Threading.Tasks.Task>> FindPetsByTagsAsyncWithHttpInfo (List tags) + public async System.Threading.Tasks.Task>> FindPetsByTagsAsyncWithHttpInfo (List tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // verify the required parameter 'tags' is set if (tags == null) @@ -1059,7 +1101,7 @@ public async System.Threading.Tasks.Task> FindPetsByTagsAsync (List>("/pet/findByTags", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.GetAsync>("/pet/findByTags", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { @@ -1131,11 +1173,12 @@ public Org.OpenAPITools.Client.ApiResponse< Pet > GetPetByIdWithHttpInfo (long p /// Find pet by ID Returns a single pet /// /// Thrown when fails to make API call - /// ID of pet to return + /// ID of pet to return + /// Cancellation Token to cancel the request. /// Task of Pet - public async System.Threading.Tasks.Task GetPetByIdAsync (long petId) + public async System.Threading.Tasks.Task GetPetByIdAsync (long petId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - Org.OpenAPITools.Client.ApiResponse localVarResponse = await GetPetByIdAsyncWithHttpInfo(petId); + Org.OpenAPITools.Client.ApiResponse localVarResponse = await GetPetByIdAsyncWithHttpInfo(petId, cancellationToken); return localVarResponse.Data; } @@ -1144,9 +1187,10 @@ public async System.Threading.Tasks.Task GetPetByIdAsync (long petId) /// Find pet by ID Returns a single pet /// /// Thrown when fails to make API call - /// ID of pet to return + /// ID of pet to return + /// Cancellation Token to cancel the request. /// Task of ApiResponse (Pet) - public async System.Threading.Tasks.Task> GetPetByIdAsyncWithHttpInfo (long petId) + public async System.Threading.Tasks.Task> GetPetByIdAsyncWithHttpInfo (long petId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1177,7 +1221,7 @@ public async System.Threading.Tasks.Task GetPetByIdAsync (long petId) // make the HTTP request - var localVarResponse = await this.AsynchronousClient.GetAsync("/pet/{petId}", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.GetAsync("/pet/{petId}", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { @@ -1253,11 +1297,12 @@ public Org.OpenAPITools.Client.ApiResponse UpdatePetWithHttpInfo (Pet bo /// Update an existing pet /// /// Thrown when fails to make API call - /// Pet object that needs to be added to the store + /// Pet object that needs to be added to the store + /// Cancellation Token to cancel the request. /// Task of void - public async System.Threading.Tasks.Task UpdatePetAsync (Pet body) + public async System.Threading.Tasks.Task UpdatePetAsync (Pet body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - await UpdatePetAsyncWithHttpInfo(body); + await UpdatePetAsyncWithHttpInfo(body, cancellationToken); } @@ -1265,9 +1310,10 @@ public async System.Threading.Tasks.Task UpdatePetAsync (Pet body) /// Update an existing pet /// /// Thrown when fails to make API call - /// Pet object that needs to be added to the store + /// Pet object that needs to be added to the store + /// Cancellation Token to cancel the request. /// Task of ApiResponse - public async System.Threading.Tasks.Task> UpdatePetAsyncWithHttpInfo (Pet body) + public async System.Threading.Tasks.Task> UpdatePetAsyncWithHttpInfo (Pet body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // verify the required parameter 'body' is set if (body == null) @@ -1303,7 +1349,7 @@ public async System.Threading.Tasks.Task UpdatePetAsync (Pet body) // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PutAsync("/pet", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.PutAsync("/pet", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { @@ -1386,13 +1432,16 @@ public async System.Threading.Tasks.Task UpdatePetAsync (Pet body) /// Updates a pet in the store with form data /// /// Thrown when fails to make API call - /// ID of pet that needs to be updated - /// Updated name of the pet (optional) - /// Updated status of the pet (optional) + /// ID of pet that needs to be updated + /// Cancellation Token to cancel the request. + /// Updated name of the pet (optional) + /// Cancellation Token to cancel the request. + /// Updated status of the pet (optional) + /// Cancellation Token to cancel the request. /// Task of void - public async System.Threading.Tasks.Task UpdatePetWithFormAsync (long petId, string name = default(string), string status = default(string)) + public async System.Threading.Tasks.Task UpdatePetWithFormAsync (long petId, string name = default(string), string status = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - await UpdatePetWithFormAsyncWithHttpInfo(petId, name, status); + await UpdatePetWithFormAsyncWithHttpInfo(petId, name, status, cancellationToken); } @@ -1400,11 +1449,14 @@ public async System.Threading.Tasks.Task UpdatePetAsync (Pet body) /// Updates a pet in the store with form data /// /// Thrown when fails to make API call - /// ID of pet that needs to be updated - /// Updated name of the pet (optional) - /// Updated status of the pet (optional) + /// ID of pet that needs to be updated + /// Cancellation Token to cancel the request. + /// Updated name of the pet (optional) + /// Cancellation Token to cancel the request. + /// Updated status of the pet (optional) + /// Cancellation Token to cancel the request. /// Task of ApiResponse - public async System.Threading.Tasks.Task> UpdatePetWithFormAsyncWithHttpInfo (long petId, string name = default(string), string status = default(string)) + public async System.Threading.Tasks.Task> UpdatePetWithFormAsyncWithHttpInfo (long petId, string name = default(string), string status = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1443,7 +1495,7 @@ public async System.Threading.Tasks.Task UpdatePetAsync (Pet body) // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/pet/{petId}", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.PostAsync("/pet/{petId}", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { @@ -1528,13 +1580,16 @@ public async System.Threading.Tasks.Task UpdatePetAsync (Pet body) /// uploads an image /// /// Thrown when fails to make API call - /// ID of pet to update - /// Additional data to pass to server (optional) - /// file to upload (optional) + /// ID of pet to update + /// Cancellation Token to cancel the request. + /// Additional data to pass to server (optional) + /// Cancellation Token to cancel the request. + /// file to upload (optional) + /// Cancellation Token to cancel the request. /// Task of ApiResponse - public async System.Threading.Tasks.Task UploadFileAsync (long petId, string additionalMetadata = default(string), System.IO.Stream file = default(System.IO.Stream)) + public async System.Threading.Tasks.Task UploadFileAsync (long petId, string additionalMetadata = default(string), System.IO.Stream file = default(System.IO.Stream), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - Org.OpenAPITools.Client.ApiResponse localVarResponse = await UploadFileAsyncWithHttpInfo(petId, additionalMetadata, file); + Org.OpenAPITools.Client.ApiResponse localVarResponse = await UploadFileAsyncWithHttpInfo(petId, additionalMetadata, file, cancellationToken); return localVarResponse.Data; } @@ -1543,11 +1598,14 @@ public async System.Threading.Tasks.Task UpdatePetAsync (Pet body) /// uploads an image /// /// Thrown when fails to make API call - /// ID of pet to update - /// Additional data to pass to server (optional) - /// file to upload (optional) + /// ID of pet to update + /// Cancellation Token to cancel the request. + /// Additional data to pass to server (optional) + /// Cancellation Token to cancel the request. + /// file to upload (optional) + /// Cancellation Token to cancel the request. /// Task of ApiResponse (ApiResponse) - public async System.Threading.Tasks.Task> UploadFileAsyncWithHttpInfo (long petId, string additionalMetadata = default(string), System.IO.Stream file = default(System.IO.Stream)) + public async System.Threading.Tasks.Task> UploadFileAsyncWithHttpInfo (long petId, string additionalMetadata = default(string), System.IO.Stream file = default(System.IO.Stream), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1587,7 +1645,7 @@ public async System.Threading.Tasks.Task UpdatePetAsync (Pet body) // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/pet/{petId}/uploadImage", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.PostAsync("/pet/{petId}/uploadImage", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { @@ -1673,13 +1731,16 @@ public async System.Threading.Tasks.Task UpdatePetAsync (Pet body) /// uploads an image (required) /// /// Thrown when fails to make API call - /// ID of pet to update - /// file to upload - /// Additional data to pass to server (optional) + /// ID of pet to update + /// Cancellation Token to cancel the request. + /// file to upload + /// Cancellation Token to cancel the request. + /// Additional data to pass to server (optional) + /// Cancellation Token to cancel the request. /// Task of ApiResponse - public async System.Threading.Tasks.Task UploadFileWithRequiredFileAsync (long petId, System.IO.Stream requiredFile, string additionalMetadata = default(string)) + public async System.Threading.Tasks.Task UploadFileWithRequiredFileAsync (long petId, System.IO.Stream requiredFile, string additionalMetadata = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - Org.OpenAPITools.Client.ApiResponse localVarResponse = await UploadFileWithRequiredFileAsyncWithHttpInfo(petId, requiredFile, additionalMetadata); + Org.OpenAPITools.Client.ApiResponse localVarResponse = await UploadFileWithRequiredFileAsyncWithHttpInfo(petId, requiredFile, additionalMetadata, cancellationToken); return localVarResponse.Data; } @@ -1688,11 +1749,14 @@ public async System.Threading.Tasks.Task UpdatePetAsync (Pet body) /// uploads an image (required) /// /// Thrown when fails to make API call - /// ID of pet to update - /// file to upload - /// Additional data to pass to server (optional) + /// ID of pet to update + /// Cancellation Token to cancel the request. + /// file to upload + /// Cancellation Token to cancel the request. + /// Additional data to pass to server (optional) + /// Cancellation Token to cancel the request. /// Task of ApiResponse (ApiResponse) - public async System.Threading.Tasks.Task> UploadFileWithRequiredFileAsyncWithHttpInfo (long petId, System.IO.Stream requiredFile, string additionalMetadata = default(string)) + public async System.Threading.Tasks.Task> UploadFileWithRequiredFileAsyncWithHttpInfo (long petId, System.IO.Stream requiredFile, string additionalMetadata = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // verify the required parameter 'requiredFile' is set if (requiredFile == null) @@ -1733,7 +1797,7 @@ public async System.Threading.Tasks.Task UpdatePetAsync (Pet body) // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/fake/{petId}/uploadImageWithRequiredFile", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.PostAsync("/fake/{petId}/uploadImageWithRequiredFile", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/StoreApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/StoreApi.cs index a7379d4eac15..431369433551 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/StoreApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/StoreApi.cs @@ -126,8 +126,9 @@ public interface IStoreApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// ID of the order that needs to be deleted + /// Cancellation Token to cancel the request. /// Task of void - System.Threading.Tasks.Task DeleteOrderAsync (string orderId); + System.Threading.Tasks.Task DeleteOrderAsync (string orderId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Delete purchase order by ID @@ -136,9 +137,10 @@ public interface IStoreApiAsync : IApiAccessor /// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors /// /// Thrown when fails to make API call - /// ID of the order that needs to be deleted + /// ID of the order that needs to be deleted + /// Cancellation Token to cancel the request. /// Task of ApiResponse - System.Threading.Tasks.Task> DeleteOrderAsyncWithHttpInfo (string orderId); + System.Threading.Tasks.Task> DeleteOrderAsyncWithHttpInfo (string orderId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Returns pet inventories by status /// @@ -147,7 +149,7 @@ public interface IStoreApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// Task of Dictionary<string, int> - System.Threading.Tasks.Task> GetInventoryAsync (); + System.Threading.Tasks.Task> GetInventoryAsync (System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Returns pet inventories by status @@ -157,7 +159,7 @@ public interface IStoreApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// Task of ApiResponse (Dictionary<string, int>) - System.Threading.Tasks.Task>> GetInventoryAsyncWithHttpInfo (); + System.Threading.Tasks.Task>> GetInventoryAsyncWithHttpInfo (System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Find purchase order by ID /// @@ -166,8 +168,9 @@ public interface IStoreApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// ID of pet that needs to be fetched + /// Cancellation Token to cancel the request. /// Task of Order - System.Threading.Tasks.Task GetOrderByIdAsync (long orderId); + System.Threading.Tasks.Task GetOrderByIdAsync (long orderId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Find purchase order by ID @@ -176,9 +179,10 @@ public interface IStoreApiAsync : IApiAccessor /// For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions /// /// Thrown when fails to make API call - /// ID of pet that needs to be fetched + /// ID of pet that needs to be fetched + /// Cancellation Token to cancel the request. /// Task of ApiResponse (Order) - System.Threading.Tasks.Task> GetOrderByIdAsyncWithHttpInfo (long orderId); + System.Threading.Tasks.Task> GetOrderByIdAsyncWithHttpInfo (long orderId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Place an order for a pet /// @@ -187,8 +191,9 @@ public interface IStoreApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// order placed for purchasing the pet + /// Cancellation Token to cancel the request. /// Task of Order - System.Threading.Tasks.Task PlaceOrderAsync (Order body); + System.Threading.Tasks.Task PlaceOrderAsync (Order body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Place an order for a pet @@ -197,9 +202,10 @@ public interface IStoreApiAsync : IApiAccessor /// /// /// Thrown when fails to make API call - /// order placed for purchasing the pet + /// order placed for purchasing the pet + /// Cancellation Token to cancel the request. /// Task of ApiResponse (Order) - System.Threading.Tasks.Task> PlaceOrderAsyncWithHttpInfo (Order body); + System.Threading.Tasks.Task> PlaceOrderAsyncWithHttpInfo (Order body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); #endregion Asynchronous Operations } @@ -377,11 +383,12 @@ public Org.OpenAPITools.Client.ApiResponse DeleteOrderWithHttpInfo (stri /// Delete purchase order by ID For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors /// /// Thrown when fails to make API call - /// ID of the order that needs to be deleted + /// ID of the order that needs to be deleted + /// Cancellation Token to cancel the request. /// Task of void - public async System.Threading.Tasks.Task DeleteOrderAsync (string orderId) + public async System.Threading.Tasks.Task DeleteOrderAsync (string orderId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - await DeleteOrderAsyncWithHttpInfo(orderId); + await DeleteOrderAsyncWithHttpInfo(orderId, cancellationToken); } @@ -389,9 +396,10 @@ public async System.Threading.Tasks.Task DeleteOrderAsync (string orderId) /// Delete purchase order by ID For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors /// /// Thrown when fails to make API call - /// ID of the order that needs to be deleted + /// ID of the order that needs to be deleted + /// Cancellation Token to cancel the request. /// Task of ApiResponse - public async System.Threading.Tasks.Task> DeleteOrderAsyncWithHttpInfo (string orderId) + public async System.Threading.Tasks.Task> DeleteOrderAsyncWithHttpInfo (string orderId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // verify the required parameter 'orderId' is set if (orderId == null) @@ -419,7 +427,7 @@ public async System.Threading.Tasks.Task DeleteOrderAsync (string orderId) // make the HTTP request - var localVarResponse = await this.AsynchronousClient.DeleteAsync("/store/order/{order_id}", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.DeleteAsync("/store/order/{order_id}", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { @@ -488,9 +496,9 @@ public Org.OpenAPITools.Client.ApiResponse< Dictionary > GetInvento /// /// Thrown when fails to make API call /// Task of Dictionary<string, int> - public async System.Threading.Tasks.Task> GetInventoryAsync () + public async System.Threading.Tasks.Task> GetInventoryAsync (System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - Org.OpenAPITools.Client.ApiResponse> localVarResponse = await GetInventoryAsyncWithHttpInfo(); + Org.OpenAPITools.Client.ApiResponse> localVarResponse = await GetInventoryAsyncWithHttpInfo(cancellationToken); return localVarResponse.Data; } @@ -500,7 +508,7 @@ public async System.Threading.Tasks.Task> GetInventoryAs /// /// Thrown when fails to make API call /// Task of ApiResponse (Dictionary<string, int>) - public async System.Threading.Tasks.Task>> GetInventoryAsyncWithHttpInfo () + public async System.Threading.Tasks.Task>> GetInventoryAsyncWithHttpInfo (System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -529,7 +537,7 @@ public async System.Threading.Tasks.Task> GetInventoryAs // make the HTTP request - var localVarResponse = await this.AsynchronousClient.GetAsync>("/store/inventory", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.GetAsync>("/store/inventory", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { @@ -596,11 +604,12 @@ public Org.OpenAPITools.Client.ApiResponse< Order > GetOrderByIdWithHttpInfo (lo /// Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions /// /// Thrown when fails to make API call - /// ID of pet that needs to be fetched + /// ID of pet that needs to be fetched + /// Cancellation Token to cancel the request. /// Task of Order - public async System.Threading.Tasks.Task GetOrderByIdAsync (long orderId) + public async System.Threading.Tasks.Task GetOrderByIdAsync (long orderId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - Org.OpenAPITools.Client.ApiResponse localVarResponse = await GetOrderByIdAsyncWithHttpInfo(orderId); + Org.OpenAPITools.Client.ApiResponse localVarResponse = await GetOrderByIdAsyncWithHttpInfo(orderId, cancellationToken); return localVarResponse.Data; } @@ -609,9 +618,10 @@ public async System.Threading.Tasks.Task GetOrderByIdAsync (long orderId) /// Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions /// /// Thrown when fails to make API call - /// ID of pet that needs to be fetched + /// ID of pet that needs to be fetched + /// Cancellation Token to cancel the request. /// Task of ApiResponse (Order) - public async System.Threading.Tasks.Task> GetOrderByIdAsyncWithHttpInfo (long orderId) + public async System.Threading.Tasks.Task> GetOrderByIdAsyncWithHttpInfo (long orderId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -637,7 +647,7 @@ public async System.Threading.Tasks.Task GetOrderByIdAsync (long orderId) // make the HTTP request - var localVarResponse = await this.AsynchronousClient.GetAsync("/store/order/{order_id}", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.GetAsync("/store/order/{order_id}", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { @@ -708,11 +718,12 @@ public Org.OpenAPITools.Client.ApiResponse< Order > PlaceOrderWithHttpInfo (Orde /// Place an order for a pet /// /// Thrown when fails to make API call - /// order placed for purchasing the pet + /// order placed for purchasing the pet + /// Cancellation Token to cancel the request. /// Task of Order - public async System.Threading.Tasks.Task PlaceOrderAsync (Order body) + public async System.Threading.Tasks.Task PlaceOrderAsync (Order body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - Org.OpenAPITools.Client.ApiResponse localVarResponse = await PlaceOrderAsyncWithHttpInfo(body); + Org.OpenAPITools.Client.ApiResponse localVarResponse = await PlaceOrderAsyncWithHttpInfo(body, cancellationToken); return localVarResponse.Data; } @@ -721,9 +732,10 @@ public async System.Threading.Tasks.Task PlaceOrderAsync (Order body) /// Place an order for a pet /// /// Thrown when fails to make API call - /// order placed for purchasing the pet + /// order placed for purchasing the pet + /// Cancellation Token to cancel the request. /// Task of ApiResponse (Order) - public async System.Threading.Tasks.Task> PlaceOrderAsyncWithHttpInfo (Order body) + public async System.Threading.Tasks.Task> PlaceOrderAsyncWithHttpInfo (Order body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // verify the required parameter 'body' is set if (body == null) @@ -753,7 +765,7 @@ public async System.Threading.Tasks.Task PlaceOrderAsync (Order body) // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/store/order", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.PostAsync("/store/order", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/UserApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/UserApi.cs index f233973eb0cb..fa89ac357fb0 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/UserApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/UserApi.cs @@ -214,8 +214,9 @@ public interface IUserApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// Created user object + /// Cancellation Token to cancel the request. /// Task of void - System.Threading.Tasks.Task CreateUserAsync (User body); + System.Threading.Tasks.Task CreateUserAsync (User body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Create user @@ -224,9 +225,10 @@ public interface IUserApiAsync : IApiAccessor /// This can only be done by the logged in user. /// /// Thrown when fails to make API call - /// Created user object + /// Created user object + /// Cancellation Token to cancel the request. /// Task of ApiResponse - System.Threading.Tasks.Task> CreateUserAsyncWithHttpInfo (User body); + System.Threading.Tasks.Task> CreateUserAsyncWithHttpInfo (User body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Creates list of users with given input array /// @@ -235,8 +237,9 @@ public interface IUserApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// List of user object + /// Cancellation Token to cancel the request. /// Task of void - System.Threading.Tasks.Task CreateUsersWithArrayInputAsync (List body); + System.Threading.Tasks.Task CreateUsersWithArrayInputAsync (List body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Creates list of users with given input array @@ -245,9 +248,10 @@ public interface IUserApiAsync : IApiAccessor /// /// /// Thrown when fails to make API call - /// List of user object + /// List of user object + /// Cancellation Token to cancel the request. /// Task of ApiResponse - System.Threading.Tasks.Task> CreateUsersWithArrayInputAsyncWithHttpInfo (List body); + System.Threading.Tasks.Task> CreateUsersWithArrayInputAsyncWithHttpInfo (List body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Creates list of users with given input array /// @@ -256,8 +260,9 @@ public interface IUserApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// List of user object + /// Cancellation Token to cancel the request. /// Task of void - System.Threading.Tasks.Task CreateUsersWithListInputAsync (List body); + System.Threading.Tasks.Task CreateUsersWithListInputAsync (List body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Creates list of users with given input array @@ -266,9 +271,10 @@ public interface IUserApiAsync : IApiAccessor /// /// /// Thrown when fails to make API call - /// List of user object + /// List of user object + /// Cancellation Token to cancel the request. /// Task of ApiResponse - System.Threading.Tasks.Task> CreateUsersWithListInputAsyncWithHttpInfo (List body); + System.Threading.Tasks.Task> CreateUsersWithListInputAsyncWithHttpInfo (List body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Delete user /// @@ -277,8 +283,9 @@ public interface IUserApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// The name that needs to be deleted + /// Cancellation Token to cancel the request. /// Task of void - System.Threading.Tasks.Task DeleteUserAsync (string username); + System.Threading.Tasks.Task DeleteUserAsync (string username, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Delete user @@ -287,9 +294,10 @@ public interface IUserApiAsync : IApiAccessor /// This can only be done by the logged in user. /// /// Thrown when fails to make API call - /// The name that needs to be deleted + /// The name that needs to be deleted + /// Cancellation Token to cancel the request. /// Task of ApiResponse - System.Threading.Tasks.Task> DeleteUserAsyncWithHttpInfo (string username); + System.Threading.Tasks.Task> DeleteUserAsyncWithHttpInfo (string username, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Get user by user name /// @@ -298,8 +306,9 @@ public interface IUserApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// The name that needs to be fetched. Use user1 for testing. + /// Cancellation Token to cancel the request. /// Task of User - System.Threading.Tasks.Task GetUserByNameAsync (string username); + System.Threading.Tasks.Task GetUserByNameAsync (string username, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Get user by user name @@ -308,9 +317,10 @@ public interface IUserApiAsync : IApiAccessor /// /// /// Thrown when fails to make API call - /// The name that needs to be fetched. Use user1 for testing. + /// The name that needs to be fetched. Use user1 for testing. + /// Cancellation Token to cancel the request. /// Task of ApiResponse (User) - System.Threading.Tasks.Task> GetUserByNameAsyncWithHttpInfo (string username); + System.Threading.Tasks.Task> GetUserByNameAsyncWithHttpInfo (string username, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Logs user into the system /// @@ -319,9 +329,11 @@ public interface IUserApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// The user name for login + /// Cancellation Token to cancel the request. /// The password for login in clear text + /// Cancellation Token to cancel the request. /// Task of string - System.Threading.Tasks.Task LoginUserAsync (string username, string password); + System.Threading.Tasks.Task LoginUserAsync (string username, string password, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Logs user into the system @@ -330,10 +342,12 @@ public interface IUserApiAsync : IApiAccessor /// /// /// Thrown when fails to make API call - /// The user name for login - /// The password for login in clear text + /// The user name for login + /// Cancellation Token to cancel the request. + /// The password for login in clear text + /// Cancellation Token to cancel the request. /// Task of ApiResponse (string) - System.Threading.Tasks.Task> LoginUserAsyncWithHttpInfo (string username, string password); + System.Threading.Tasks.Task> LoginUserAsyncWithHttpInfo (string username, string password, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Logs out current logged in user session /// @@ -342,7 +356,7 @@ public interface IUserApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// Task of void - System.Threading.Tasks.Task LogoutUserAsync (); + System.Threading.Tasks.Task LogoutUserAsync (System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Logs out current logged in user session @@ -352,7 +366,7 @@ public interface IUserApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// Task of ApiResponse - System.Threading.Tasks.Task> LogoutUserAsyncWithHttpInfo (); + System.Threading.Tasks.Task> LogoutUserAsyncWithHttpInfo (System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Updated user /// @@ -361,9 +375,11 @@ public interface IUserApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// name that need to be deleted + /// Cancellation Token to cancel the request. /// Updated user object + /// Cancellation Token to cancel the request. /// Task of void - System.Threading.Tasks.Task UpdateUserAsync (string username, User body); + System.Threading.Tasks.Task UpdateUserAsync (string username, User body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Updated user @@ -372,10 +388,12 @@ public interface IUserApiAsync : IApiAccessor /// This can only be done by the logged in user. /// /// Thrown when fails to make API call - /// name that need to be deleted - /// Updated user object + /// name that need to be deleted + /// Cancellation Token to cancel the request. + /// Updated user object + /// Cancellation Token to cancel the request. /// Task of ApiResponse - System.Threading.Tasks.Task> UpdateUserAsyncWithHttpInfo (string username, User body); + System.Threading.Tasks.Task> UpdateUserAsyncWithHttpInfo (string username, User body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); #endregion Asynchronous Operations } @@ -553,11 +571,12 @@ public Org.OpenAPITools.Client.ApiResponse CreateUserWithHttpInfo (User /// Create user This can only be done by the logged in user. /// /// Thrown when fails to make API call - /// Created user object + /// Created user object + /// Cancellation Token to cancel the request. /// Task of void - public async System.Threading.Tasks.Task CreateUserAsync (User body) + public async System.Threading.Tasks.Task CreateUserAsync (User body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - await CreateUserAsyncWithHttpInfo(body); + await CreateUserAsyncWithHttpInfo(body, cancellationToken); } @@ -565,9 +584,10 @@ public async System.Threading.Tasks.Task CreateUserAsync (User body) /// Create user This can only be done by the logged in user. /// /// Thrown when fails to make API call - /// Created user object + /// Created user object + /// Cancellation Token to cancel the request. /// Task of ApiResponse - public async System.Threading.Tasks.Task> CreateUserAsyncWithHttpInfo (User body) + public async System.Threading.Tasks.Task> CreateUserAsyncWithHttpInfo (User body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // verify the required parameter 'body' is set if (body == null) @@ -595,7 +615,7 @@ public async System.Threading.Tasks.Task CreateUserAsync (User body) // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/user", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.PostAsync("/user", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { @@ -663,11 +683,12 @@ public Org.OpenAPITools.Client.ApiResponse CreateUsersWithArrayInputWith /// Creates list of users with given input array /// /// Thrown when fails to make API call - /// List of user object + /// List of user object + /// Cancellation Token to cancel the request. /// Task of void - public async System.Threading.Tasks.Task CreateUsersWithArrayInputAsync (List body) + public async System.Threading.Tasks.Task CreateUsersWithArrayInputAsync (List body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - await CreateUsersWithArrayInputAsyncWithHttpInfo(body); + await CreateUsersWithArrayInputAsyncWithHttpInfo(body, cancellationToken); } @@ -675,9 +696,10 @@ public async System.Threading.Tasks.Task CreateUsersWithArrayInputAsync (List /// Thrown when fails to make API call - /// List of user object + /// List of user object + /// Cancellation Token to cancel the request. /// Task of ApiResponse - public async System.Threading.Tasks.Task> CreateUsersWithArrayInputAsyncWithHttpInfo (List body) + public async System.Threading.Tasks.Task> CreateUsersWithArrayInputAsyncWithHttpInfo (List body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // verify the required parameter 'body' is set if (body == null) @@ -705,7 +727,7 @@ public async System.Threading.Tasks.Task CreateUsersWithArrayInputAsync (List("/user/createWithArray", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.PostAsync("/user/createWithArray", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { @@ -773,11 +795,12 @@ public Org.OpenAPITools.Client.ApiResponse CreateUsersWithListInputWithH /// Creates list of users with given input array /// /// Thrown when fails to make API call - /// List of user object + /// List of user object + /// Cancellation Token to cancel the request. /// Task of void - public async System.Threading.Tasks.Task CreateUsersWithListInputAsync (List body) + public async System.Threading.Tasks.Task CreateUsersWithListInputAsync (List body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - await CreateUsersWithListInputAsyncWithHttpInfo(body); + await CreateUsersWithListInputAsyncWithHttpInfo(body, cancellationToken); } @@ -785,9 +808,10 @@ public async System.Threading.Tasks.Task CreateUsersWithListInputAsync (List /// Thrown when fails to make API call - /// List of user object + /// List of user object + /// Cancellation Token to cancel the request. /// Task of ApiResponse - public async System.Threading.Tasks.Task> CreateUsersWithListInputAsyncWithHttpInfo (List body) + public async System.Threading.Tasks.Task> CreateUsersWithListInputAsyncWithHttpInfo (List body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // verify the required parameter 'body' is set if (body == null) @@ -815,7 +839,7 @@ public async System.Threading.Tasks.Task CreateUsersWithListInputAsync (List("/user/createWithList", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.PostAsync("/user/createWithList", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { @@ -883,11 +907,12 @@ public Org.OpenAPITools.Client.ApiResponse DeleteUserWithHttpInfo (strin /// Delete user This can only be done by the logged in user. /// /// Thrown when fails to make API call - /// The name that needs to be deleted + /// The name that needs to be deleted + /// Cancellation Token to cancel the request. /// Task of void - public async System.Threading.Tasks.Task DeleteUserAsync (string username) + public async System.Threading.Tasks.Task DeleteUserAsync (string username, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - await DeleteUserAsyncWithHttpInfo(username); + await DeleteUserAsyncWithHttpInfo(username, cancellationToken); } @@ -895,9 +920,10 @@ public async System.Threading.Tasks.Task DeleteUserAsync (string username) /// Delete user This can only be done by the logged in user. /// /// Thrown when fails to make API call - /// The name that needs to be deleted + /// The name that needs to be deleted + /// Cancellation Token to cancel the request. /// Task of ApiResponse - public async System.Threading.Tasks.Task> DeleteUserAsyncWithHttpInfo (string username) + public async System.Threading.Tasks.Task> DeleteUserAsyncWithHttpInfo (string username, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // verify the required parameter 'username' is set if (username == null) @@ -925,7 +951,7 @@ public async System.Threading.Tasks.Task DeleteUserAsync (string username) // make the HTTP request - var localVarResponse = await this.AsynchronousClient.DeleteAsync("/user/{username}", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.DeleteAsync("/user/{username}", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { @@ -996,11 +1022,12 @@ public Org.OpenAPITools.Client.ApiResponse< User > GetUserByNameWithHttpInfo (st /// Get user by user name /// /// Thrown when fails to make API call - /// The name that needs to be fetched. Use user1 for testing. + /// The name that needs to be fetched. Use user1 for testing. + /// Cancellation Token to cancel the request. /// Task of User - public async System.Threading.Tasks.Task GetUserByNameAsync (string username) + public async System.Threading.Tasks.Task GetUserByNameAsync (string username, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - Org.OpenAPITools.Client.ApiResponse localVarResponse = await GetUserByNameAsyncWithHttpInfo(username); + Org.OpenAPITools.Client.ApiResponse localVarResponse = await GetUserByNameAsyncWithHttpInfo(username, cancellationToken); return localVarResponse.Data; } @@ -1009,9 +1036,10 @@ public async System.Threading.Tasks.Task GetUserByNameAsync (string userna /// Get user by user name /// /// Thrown when fails to make API call - /// The name that needs to be fetched. Use user1 for testing. + /// The name that needs to be fetched. Use user1 for testing. + /// Cancellation Token to cancel the request. /// Task of ApiResponse (User) - public async System.Threading.Tasks.Task> GetUserByNameAsyncWithHttpInfo (string username) + public async System.Threading.Tasks.Task> GetUserByNameAsyncWithHttpInfo (string username, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // verify the required parameter 'username' is set if (username == null) @@ -1041,7 +1069,7 @@ public async System.Threading.Tasks.Task GetUserByNameAsync (string userna // make the HTTP request - var localVarResponse = await this.AsynchronousClient.GetAsync("/user/{username}", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.GetAsync("/user/{username}", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { @@ -1119,12 +1147,14 @@ public Org.OpenAPITools.Client.ApiResponse< string > LoginUserWithHttpInfo (stri /// Logs user into the system /// /// Thrown when fails to make API call - /// The user name for login - /// The password for login in clear text + /// The user name for login + /// Cancellation Token to cancel the request. + /// The password for login in clear text + /// Cancellation Token to cancel the request. /// Task of string - public async System.Threading.Tasks.Task LoginUserAsync (string username, string password) + public async System.Threading.Tasks.Task LoginUserAsync (string username, string password, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - Org.OpenAPITools.Client.ApiResponse localVarResponse = await LoginUserAsyncWithHttpInfo(username, password); + Org.OpenAPITools.Client.ApiResponse localVarResponse = await LoginUserAsyncWithHttpInfo(username, password, cancellationToken); return localVarResponse.Data; } @@ -1133,10 +1163,12 @@ public async System.Threading.Tasks.Task LoginUserAsync (string username /// Logs user into the system /// /// Thrown when fails to make API call - /// The user name for login - /// The password for login in clear text + /// The user name for login + /// Cancellation Token to cancel the request. + /// The password for login in clear text + /// Cancellation Token to cancel the request. /// Task of ApiResponse (string) - public async System.Threading.Tasks.Task> LoginUserAsyncWithHttpInfo (string username, string password) + public async System.Threading.Tasks.Task> LoginUserAsyncWithHttpInfo (string username, string password, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // verify the required parameter 'username' is set if (username == null) @@ -1171,7 +1203,7 @@ public async System.Threading.Tasks.Task LoginUserAsync (string username // make the HTTP request - var localVarResponse = await this.AsynchronousClient.GetAsync("/user/login", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.GetAsync("/user/login", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { @@ -1233,9 +1265,9 @@ public Org.OpenAPITools.Client.ApiResponse LogoutUserWithHttpInfo () /// /// Thrown when fails to make API call /// Task of void - public async System.Threading.Tasks.Task LogoutUserAsync () + public async System.Threading.Tasks.Task LogoutUserAsync (System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - await LogoutUserAsyncWithHttpInfo(); + await LogoutUserAsyncWithHttpInfo(cancellationToken); } @@ -1244,7 +1276,7 @@ public async System.Threading.Tasks.Task LogoutUserAsync () /// /// Thrown when fails to make API call /// Task of ApiResponse - public async System.Threading.Tasks.Task> LogoutUserAsyncWithHttpInfo () + public async System.Threading.Tasks.Task> LogoutUserAsyncWithHttpInfo (System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1267,7 +1299,7 @@ public async System.Threading.Tasks.Task LogoutUserAsync () // make the HTTP request - var localVarResponse = await this.AsynchronousClient.GetAsync("/user/logout", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.GetAsync("/user/logout", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { @@ -1342,12 +1374,14 @@ public Org.OpenAPITools.Client.ApiResponse UpdateUserWithHttpInfo (strin /// Updated user This can only be done by the logged in user. /// /// Thrown when fails to make API call - /// name that need to be deleted - /// Updated user object + /// name that need to be deleted + /// Cancellation Token to cancel the request. + /// Updated user object + /// Cancellation Token to cancel the request. /// Task of void - public async System.Threading.Tasks.Task UpdateUserAsync (string username, User body) + public async System.Threading.Tasks.Task UpdateUserAsync (string username, User body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - await UpdateUserAsyncWithHttpInfo(username, body); + await UpdateUserAsyncWithHttpInfo(username, body, cancellationToken); } @@ -1355,10 +1389,12 @@ public async System.Threading.Tasks.Task UpdateUserAsync (string username, User /// Updated user This can only be done by the logged in user. /// /// Thrown when fails to make API call - /// name that need to be deleted - /// Updated user object + /// name that need to be deleted + /// Cancellation Token to cancel the request. + /// Updated user object + /// Cancellation Token to cancel the request. /// Task of ApiResponse - public async System.Threading.Tasks.Task> UpdateUserAsyncWithHttpInfo (string username, User body) + public async System.Threading.Tasks.Task> UpdateUserAsyncWithHttpInfo (string username, User body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // verify the required parameter 'username' is set if (username == null) @@ -1391,7 +1427,7 @@ public async System.Threading.Tasks.Task UpdateUserAsync (string username, User // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PutAsync("/user/{username}", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.PutAsync("/user/{username}", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Client/ApiClient.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Client/ApiClient.cs index 6160e7a740ec..238b48ce89da 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Client/ApiClient.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Client/ApiClient.cs @@ -450,7 +450,7 @@ private ApiResponse Exec(RestRequest req, IReadableConfiguration configura return result; } - private async Task> ExecAsync(RestRequest req, IReadableConfiguration configuration) + private async Task> ExecAsync(RestRequest req, IReadableConfiguration configuration, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { RestClient client = new RestClient(_baseUrl); @@ -481,7 +481,7 @@ private async Task> ExecAsync(RestRequest req, IReadableConfig InterceptRequest(req); - var response = await client.ExecuteAsync(req); + var response = await client.ExecuteAsync(req, cancellationToken); InterceptResponse(req, response); @@ -528,11 +528,12 @@ private async Task> ExecAsync(RestRequest req, IReadableConfig /// The additional request options. /// A per-request configuration object. It is assumed that any merge with /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null) + public Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { var config = configuration ?? GlobalConfiguration.Instance; - return ExecAsync(NewRequest(HttpMethod.Get, path, options, config), config); + return ExecAsync(NewRequest(HttpMethod.Get, path, options, config), config, cancellationToken); } /// @@ -542,11 +543,12 @@ public Task> GetAsync(string path, RequestOptions options, IRe /// The additional request options. /// A per-request configuration object. It is assumed that any merge with /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null) + public Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { var config = configuration ?? GlobalConfiguration.Instance; - return ExecAsync(NewRequest(HttpMethod.Post, path, options, config), config); + return ExecAsync(NewRequest(HttpMethod.Post, path, options, config), config, cancellationToken); } /// @@ -556,11 +558,12 @@ public Task> PostAsync(string path, RequestOptions options, IR /// The additional request options. /// A per-request configuration object. It is assumed that any merge with /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null) + public Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { var config = configuration ?? GlobalConfiguration.Instance; - return ExecAsync(NewRequest(HttpMethod.Put, path, options, config), config); + return ExecAsync(NewRequest(HttpMethod.Put, path, options, config), config, cancellationToken); } /// @@ -570,11 +573,12 @@ public Task> PutAsync(string path, RequestOptions options, IRe /// The additional request options. /// A per-request configuration object. It is assumed that any merge with /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null) + public Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { var config = configuration ?? GlobalConfiguration.Instance; - return ExecAsync(NewRequest(HttpMethod.Delete, path, options, config), config); + return ExecAsync(NewRequest(HttpMethod.Delete, path, options, config), config, cancellationToken); } /// @@ -584,11 +588,12 @@ public Task> DeleteAsync(string path, RequestOptions options, /// The additional request options. /// A per-request configuration object. It is assumed that any merge with /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null) + public Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { var config = configuration ?? GlobalConfiguration.Instance; - return ExecAsync(NewRequest(HttpMethod.Head, path, options, config), config); + return ExecAsync(NewRequest(HttpMethod.Head, path, options, config), config, cancellationToken); } /// @@ -598,11 +603,12 @@ public Task> HeadAsync(string path, RequestOptions options, IR /// The additional request options. /// A per-request configuration object. It is assumed that any merge with /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null) + public Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { var config = configuration ?? GlobalConfiguration.Instance; - return ExecAsync(NewRequest(HttpMethod.Options, path, options, config), config); + return ExecAsync(NewRequest(HttpMethod.Options, path, options, config), config, cancellationToken); } /// @@ -612,11 +618,12 @@ public Task> OptionsAsync(string path, RequestOptions options, /// The additional request options. /// A per-request configuration object. It is assumed that any merge with /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null) + public Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { var config = configuration ?? GlobalConfiguration.Instance; - return ExecAsync(NewRequest(HttpMethod.Patch, path, options, config), config); + return ExecAsync(NewRequest(HttpMethod.Patch, path, options, config), config, cancellationToken); } #endregion IAsynchronousClient diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Client/IAsynchronousClient.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Client/IAsynchronousClient.cs index 750cf1839362..ea7ec150cf40 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Client/IAsynchronousClient.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Client/IAsynchronousClient.cs @@ -28,9 +28,10 @@ public interface IAsynchronousClient /// The relative path to invoke. /// The request parameters to pass along to the client. /// Per-request configurable settings. + /// Cancellation Token to cancel the request. /// The return type. /// A task eventually representing the response data, decorated with - Task> GetAsync(String path, RequestOptions options, IReadableConfiguration configuration = null); + Task> GetAsync(String path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Executes a non-blocking call to some using the POST http verb. @@ -38,9 +39,10 @@ public interface IAsynchronousClient /// The relative path to invoke. /// The request parameters to pass along to the client. /// Per-request configurable settings. + /// Cancellation Token to cancel the request. /// The return type. /// A task eventually representing the response data, decorated with - Task> PostAsync(String path, RequestOptions options, IReadableConfiguration configuration = null); + Task> PostAsync(String path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Executes a non-blocking call to some using the PUT http verb. @@ -48,9 +50,10 @@ public interface IAsynchronousClient /// The relative path to invoke. /// The request parameters to pass along to the client. /// Per-request configurable settings. + /// Cancellation Token to cancel the request. /// The return type. /// A task eventually representing the response data, decorated with - Task> PutAsync(String path, RequestOptions options, IReadableConfiguration configuration = null); + Task> PutAsync(String path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Executes a non-blocking call to some using the DELETE http verb. @@ -58,9 +61,10 @@ public interface IAsynchronousClient /// The relative path to invoke. /// The request parameters to pass along to the client. /// Per-request configurable settings. + /// Cancellation Token to cancel the request. /// The return type. /// A task eventually representing the response data, decorated with - Task> DeleteAsync(String path, RequestOptions options, IReadableConfiguration configuration = null); + Task> DeleteAsync(String path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Executes a non-blocking call to some using the HEAD http verb. @@ -68,9 +72,10 @@ public interface IAsynchronousClient /// The relative path to invoke. /// The request parameters to pass along to the client. /// Per-request configurable settings. + /// Cancellation Token to cancel the request. /// The return type. /// A task eventually representing the response data, decorated with - Task> HeadAsync(String path, RequestOptions options, IReadableConfiguration configuration = null); + Task> HeadAsync(String path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Executes a non-blocking call to some using the OPTIONS http verb. @@ -78,9 +83,10 @@ public interface IAsynchronousClient /// The relative path to invoke. /// The request parameters to pass along to the client. /// Per-request configurable settings. + /// Cancellation Token to cancel the request. /// The return type. /// A task eventually representing the response data, decorated with - Task> OptionsAsync(String path, RequestOptions options, IReadableConfiguration configuration = null); + Task> OptionsAsync(String path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Executes a non-blocking call to some using the PATCH http verb. @@ -88,9 +94,10 @@ public interface IAsynchronousClient /// The relative path to invoke. /// The request parameters to pass along to the client. /// Per-request configurable settings. + /// Cancellation Token to cancel the request. /// The return type. /// A task eventually representing the response data, decorated with - Task> PatchAsync(String path, RequestOptions options, IReadableConfiguration configuration = null); + Task> PatchAsync(String path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/AnotherFakeApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/AnotherFakeApi.cs index 99156f92d281..8d9b36ddfc5c 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/AnotherFakeApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/AnotherFakeApi.cs @@ -65,8 +65,9 @@ public interface IAnotherFakeApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// client model + /// Cancellation Token to cancel the request. /// Task of ModelClient - System.Threading.Tasks.Task Call123TestSpecialTagsAsync (ModelClient body); + System.Threading.Tasks.Task Call123TestSpecialTagsAsync (ModelClient body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// To test special tags @@ -75,9 +76,10 @@ public interface IAnotherFakeApiAsync : IApiAccessor /// To test special tags and operation ID starting with number /// /// Thrown when fails to make API call - /// client model + /// client model + /// Cancellation Token to cancel the request. /// Task of ApiResponse (ModelClient) - System.Threading.Tasks.Task> Call123TestSpecialTagsAsyncWithHttpInfo (ModelClient body); + System.Threading.Tasks.Task> Call123TestSpecialTagsAsyncWithHttpInfo (ModelClient body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); #endregion Asynchronous Operations } @@ -258,11 +260,12 @@ public Org.OpenAPITools.Client.ApiResponse< ModelClient > Call123TestSpecialTags /// To test special tags To test special tags and operation ID starting with number /// /// Thrown when fails to make API call - /// client model + /// client model + /// Cancellation Token to cancel the request. /// Task of ModelClient - public async System.Threading.Tasks.Task Call123TestSpecialTagsAsync (ModelClient body) + public async System.Threading.Tasks.Task Call123TestSpecialTagsAsync (ModelClient body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - Org.OpenAPITools.Client.ApiResponse localVarResponse = await Call123TestSpecialTagsAsyncWithHttpInfo(body); + Org.OpenAPITools.Client.ApiResponse localVarResponse = await Call123TestSpecialTagsAsyncWithHttpInfo(body, cancellationToken); return localVarResponse.Data; } @@ -271,9 +274,10 @@ public async System.Threading.Tasks.Task Call123TestSpecialTagsAsyn /// To test special tags To test special tags and operation ID starting with number /// /// Thrown when fails to make API call - /// client model + /// client model + /// Cancellation Token to cancel the request. /// Task of ApiResponse (ModelClient) - public async System.Threading.Tasks.Task> Call123TestSpecialTagsAsyncWithHttpInfo (ModelClient body) + public async System.Threading.Tasks.Task> Call123TestSpecialTagsAsyncWithHttpInfo (ModelClient body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // verify the required parameter 'body' is set if (body == null) @@ -303,7 +307,7 @@ public async System.Threading.Tasks.Task Call123TestSpecialTagsAsyn // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PatchAsync("/another-fake/dummy", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.PatchAsync("/another-fake/dummy", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/FakeApi.cs index 55ac584e8a77..e510f1f6926b 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/FakeApi.cs @@ -400,8 +400,9 @@ public interface IFakeApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// XmlItem Body + /// Cancellation Token to cancel the request. /// Task of void - System.Threading.Tasks.Task CreateXmlItemAsync (XmlItem xmlItem); + System.Threading.Tasks.Task CreateXmlItemAsync (XmlItem xmlItem, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// creates an XmlItem @@ -410,9 +411,10 @@ public interface IFakeApiAsync : IApiAccessor /// this route creates an XmlItem /// /// Thrown when fails to make API call - /// XmlItem Body + /// XmlItem Body + /// Cancellation Token to cancel the request. /// Task of ApiResponse - System.Threading.Tasks.Task> CreateXmlItemAsyncWithHttpInfo (XmlItem xmlItem); + System.Threading.Tasks.Task> CreateXmlItemAsyncWithHttpInfo (XmlItem xmlItem, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// /// @@ -421,8 +423,9 @@ public interface IFakeApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// Input boolean as post body (optional) + /// Cancellation Token to cancel the request. /// Task of bool - System.Threading.Tasks.Task FakeOuterBooleanSerializeAsync (bool? body = default(bool?)); + System.Threading.Tasks.Task FakeOuterBooleanSerializeAsync (bool? body = default(bool?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// @@ -431,9 +434,10 @@ public interface IFakeApiAsync : IApiAccessor /// Test serialization of outer boolean types /// /// Thrown when fails to make API call - /// Input boolean as post body (optional) + /// Input boolean as post body (optional) + /// Cancellation Token to cancel the request. /// Task of ApiResponse (bool) - System.Threading.Tasks.Task> FakeOuterBooleanSerializeAsyncWithHttpInfo (bool? body = default(bool?)); + System.Threading.Tasks.Task> FakeOuterBooleanSerializeAsyncWithHttpInfo (bool? body = default(bool?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// /// @@ -442,8 +446,9 @@ public interface IFakeApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// Input composite as post body (optional) + /// Cancellation Token to cancel the request. /// Task of OuterComposite - System.Threading.Tasks.Task FakeOuterCompositeSerializeAsync (OuterComposite body = default(OuterComposite)); + System.Threading.Tasks.Task FakeOuterCompositeSerializeAsync (OuterComposite body = default(OuterComposite), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// @@ -452,9 +457,10 @@ public interface IFakeApiAsync : IApiAccessor /// Test serialization of object with outer number type /// /// Thrown when fails to make API call - /// Input composite as post body (optional) + /// Input composite as post body (optional) + /// Cancellation Token to cancel the request. /// Task of ApiResponse (OuterComposite) - System.Threading.Tasks.Task> FakeOuterCompositeSerializeAsyncWithHttpInfo (OuterComposite body = default(OuterComposite)); + System.Threading.Tasks.Task> FakeOuterCompositeSerializeAsyncWithHttpInfo (OuterComposite body = default(OuterComposite), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// /// @@ -463,8 +469,9 @@ public interface IFakeApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// Input number as post body (optional) + /// Cancellation Token to cancel the request. /// Task of decimal - System.Threading.Tasks.Task FakeOuterNumberSerializeAsync (decimal? body = default(decimal?)); + System.Threading.Tasks.Task FakeOuterNumberSerializeAsync (decimal? body = default(decimal?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// @@ -473,9 +480,10 @@ public interface IFakeApiAsync : IApiAccessor /// Test serialization of outer number types /// /// Thrown when fails to make API call - /// Input number as post body (optional) + /// Input number as post body (optional) + /// Cancellation Token to cancel the request. /// Task of ApiResponse (decimal) - System.Threading.Tasks.Task> FakeOuterNumberSerializeAsyncWithHttpInfo (decimal? body = default(decimal?)); + System.Threading.Tasks.Task> FakeOuterNumberSerializeAsyncWithHttpInfo (decimal? body = default(decimal?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// /// @@ -484,8 +492,9 @@ public interface IFakeApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// Input string as post body (optional) + /// Cancellation Token to cancel the request. /// Task of string - System.Threading.Tasks.Task FakeOuterStringSerializeAsync (string body = default(string)); + System.Threading.Tasks.Task FakeOuterStringSerializeAsync (string body = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// @@ -494,9 +503,10 @@ public interface IFakeApiAsync : IApiAccessor /// Test serialization of outer string types /// /// Thrown when fails to make API call - /// Input string as post body (optional) + /// Input string as post body (optional) + /// Cancellation Token to cancel the request. /// Task of ApiResponse (string) - System.Threading.Tasks.Task> FakeOuterStringSerializeAsyncWithHttpInfo (string body = default(string)); + System.Threading.Tasks.Task> FakeOuterStringSerializeAsyncWithHttpInfo (string body = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// /// @@ -505,8 +515,9 @@ public interface IFakeApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// + /// Cancellation Token to cancel the request. /// Task of void - System.Threading.Tasks.Task TestBodyWithFileSchemaAsync (FileSchemaTestClass body); + System.Threading.Tasks.Task TestBodyWithFileSchemaAsync (FileSchemaTestClass body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// @@ -515,9 +526,10 @@ public interface IFakeApiAsync : IApiAccessor /// For this test, the body for this request much reference a schema named `File`. /// /// Thrown when fails to make API call - /// + /// + /// Cancellation Token to cancel the request. /// Task of ApiResponse - System.Threading.Tasks.Task> TestBodyWithFileSchemaAsyncWithHttpInfo (FileSchemaTestClass body); + System.Threading.Tasks.Task> TestBodyWithFileSchemaAsyncWithHttpInfo (FileSchemaTestClass body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// /// @@ -526,9 +538,11 @@ public interface IFakeApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// + /// Cancellation Token to cancel the request. /// + /// Cancellation Token to cancel the request. /// Task of void - System.Threading.Tasks.Task TestBodyWithQueryParamsAsync (string query, User body); + System.Threading.Tasks.Task TestBodyWithQueryParamsAsync (string query, User body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// @@ -537,10 +551,12 @@ public interface IFakeApiAsync : IApiAccessor /// /// /// Thrown when fails to make API call - /// - /// + /// + /// Cancellation Token to cancel the request. + /// + /// Cancellation Token to cancel the request. /// Task of ApiResponse - System.Threading.Tasks.Task> TestBodyWithQueryParamsAsyncWithHttpInfo (string query, User body); + System.Threading.Tasks.Task> TestBodyWithQueryParamsAsyncWithHttpInfo (string query, User body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// To test \"client\" model /// @@ -549,8 +565,9 @@ public interface IFakeApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// client model + /// Cancellation Token to cancel the request. /// Task of ModelClient - System.Threading.Tasks.Task TestClientModelAsync (ModelClient body); + System.Threading.Tasks.Task TestClientModelAsync (ModelClient body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// To test \"client\" model @@ -559,9 +576,10 @@ public interface IFakeApiAsync : IApiAccessor /// To test \"client\" model /// /// Thrown when fails to make API call - /// client model + /// client model + /// Cancellation Token to cancel the request. /// Task of ApiResponse (ModelClient) - System.Threading.Tasks.Task> TestClientModelAsyncWithHttpInfo (ModelClient body); + System.Threading.Tasks.Task> TestClientModelAsyncWithHttpInfo (ModelClient body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 /// @@ -570,21 +588,35 @@ public interface IFakeApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// None + /// Cancellation Token to cancel the request. /// None + /// Cancellation Token to cancel the request. /// None + /// Cancellation Token to cancel the request. /// None + /// Cancellation Token to cancel the request. /// None (optional) + /// Cancellation Token to cancel the request. /// None (optional) + /// Cancellation Token to cancel the request. /// None (optional) + /// Cancellation Token to cancel the request. /// None (optional) + /// Cancellation Token to cancel the request. /// None (optional) + /// Cancellation Token to cancel the request. /// None (optional) + /// Cancellation Token to cancel the request. /// None (optional) + /// Cancellation Token to cancel the request. /// None (optional) + /// Cancellation Token to cancel the request. /// None (optional) + /// Cancellation Token to cancel the request. /// None (optional) + /// Cancellation Token to cancel the request. /// Task of void - System.Threading.Tasks.Task TestEndpointParametersAsync (decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int? integer = default(int?), int? int32 = default(int?), long? int64 = default(long?), float? _float = default(float?), string _string = default(string), System.IO.Stream binary = default(System.IO.Stream), DateTime? date = default(DateTime?), DateTime? dateTime = default(DateTime?), string password = default(string), string callback = default(string)); + System.Threading.Tasks.Task TestEndpointParametersAsync (decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int? integer = default(int?), int? int32 = default(int?), long? int64 = default(long?), float? _float = default(float?), string _string = default(string), System.IO.Stream binary = default(System.IO.Stream), DateTime? date = default(DateTime?), DateTime? dateTime = default(DateTime?), string password = default(string), string callback = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -593,22 +625,36 @@ public interface IFakeApiAsync : IApiAccessor /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 /// /// Thrown when fails to make API call - /// None - /// None - /// None - /// None - /// None (optional) - /// None (optional) - /// None (optional) - /// None (optional) - /// None (optional) - /// None (optional) - /// None (optional) - /// None (optional) - /// None (optional) - /// None (optional) + /// None + /// Cancellation Token to cancel the request. + /// None + /// Cancellation Token to cancel the request. + /// None + /// Cancellation Token to cancel the request. + /// None + /// Cancellation Token to cancel the request. + /// None (optional) + /// Cancellation Token to cancel the request. + /// None (optional) + /// Cancellation Token to cancel the request. + /// None (optional) + /// Cancellation Token to cancel the request. + /// None (optional) + /// Cancellation Token to cancel the request. + /// None (optional) + /// Cancellation Token to cancel the request. + /// None (optional) + /// Cancellation Token to cancel the request. + /// None (optional) + /// Cancellation Token to cancel the request. + /// None (optional) + /// Cancellation Token to cancel the request. + /// None (optional) + /// Cancellation Token to cancel the request. + /// None (optional) + /// Cancellation Token to cancel the request. /// Task of ApiResponse - System.Threading.Tasks.Task> TestEndpointParametersAsyncWithHttpInfo (decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int? integer = default(int?), int? int32 = default(int?), long? int64 = default(long?), float? _float = default(float?), string _string = default(string), System.IO.Stream binary = default(System.IO.Stream), DateTime? date = default(DateTime?), DateTime? dateTime = default(DateTime?), string password = default(string), string callback = default(string)); + System.Threading.Tasks.Task> TestEndpointParametersAsyncWithHttpInfo (decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int? integer = default(int?), int? int32 = default(int?), long? int64 = default(long?), float? _float = default(float?), string _string = default(string), System.IO.Stream binary = default(System.IO.Stream), DateTime? date = default(DateTime?), DateTime? dateTime = default(DateTime?), string password = default(string), string callback = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// To test enum parameters /// @@ -617,15 +663,23 @@ public interface IFakeApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// Header parameter enum test (string array) (optional) + /// Cancellation Token to cancel the request. /// Header parameter enum test (string) (optional, default to -efg) + /// Cancellation Token to cancel the request. /// Query parameter enum test (string array) (optional) + /// Cancellation Token to cancel the request. /// Query parameter enum test (string) (optional, default to -efg) + /// Cancellation Token to cancel the request. /// Query parameter enum test (double) (optional) + /// Cancellation Token to cancel the request. /// Query parameter enum test (double) (optional) + /// Cancellation Token to cancel the request. /// Form parameter enum test (string array) (optional, default to $) + /// Cancellation Token to cancel the request. /// Form parameter enum test (string) (optional, default to -efg) + /// Cancellation Token to cancel the request. /// Task of void - System.Threading.Tasks.Task TestEnumParametersAsync (List enumHeaderStringArray = default(List), string enumHeaderString = default(string), List enumQueryStringArray = default(List), string enumQueryString = default(string), int? enumQueryInteger = default(int?), double? enumQueryDouble = default(double?), List enumFormStringArray = default(List), string enumFormString = default(string)); + System.Threading.Tasks.Task TestEnumParametersAsync (List enumHeaderStringArray = default(List), string enumHeaderString = default(string), List enumQueryStringArray = default(List), string enumQueryString = default(string), int? enumQueryInteger = default(int?), double? enumQueryDouble = default(double?), List enumFormStringArray = default(List), string enumFormString = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// To test enum parameters @@ -634,16 +688,24 @@ public interface IFakeApiAsync : IApiAccessor /// To test enum parameters /// /// Thrown when fails to make API call - /// Header parameter enum test (string array) (optional) - /// Header parameter enum test (string) (optional, default to -efg) - /// Query parameter enum test (string array) (optional) - /// Query parameter enum test (string) (optional, default to -efg) - /// Query parameter enum test (double) (optional) - /// Query parameter enum test (double) (optional) - /// Form parameter enum test (string array) (optional, default to $) - /// Form parameter enum test (string) (optional, default to -efg) + /// Header parameter enum test (string array) (optional) + /// Cancellation Token to cancel the request. + /// Header parameter enum test (string) (optional, default to -efg) + /// Cancellation Token to cancel the request. + /// Query parameter enum test (string array) (optional) + /// Cancellation Token to cancel the request. + /// Query parameter enum test (string) (optional, default to -efg) + /// Cancellation Token to cancel the request. + /// Query parameter enum test (double) (optional) + /// Cancellation Token to cancel the request. + /// Query parameter enum test (double) (optional) + /// Cancellation Token to cancel the request. + /// Form parameter enum test (string array) (optional, default to $) + /// Cancellation Token to cancel the request. + /// Form parameter enum test (string) (optional, default to -efg) + /// Cancellation Token to cancel the request. /// Task of ApiResponse - System.Threading.Tasks.Task> TestEnumParametersAsyncWithHttpInfo (List enumHeaderStringArray = default(List), string enumHeaderString = default(string), List enumQueryStringArray = default(List), string enumQueryString = default(string), int? enumQueryInteger = default(int?), double? enumQueryDouble = default(double?), List enumFormStringArray = default(List), string enumFormString = default(string)); + System.Threading.Tasks.Task> TestEnumParametersAsyncWithHttpInfo (List enumHeaderStringArray = default(List), string enumHeaderString = default(string), List enumQueryStringArray = default(List), string enumQueryString = default(string), int? enumQueryInteger = default(int?), double? enumQueryDouble = default(double?), List enumFormStringArray = default(List), string enumFormString = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Fake endpoint to test group parameters (optional) /// @@ -652,13 +714,19 @@ public interface IFakeApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// Required String in group parameters + /// Cancellation Token to cancel the request. /// Required Boolean in group parameters + /// Cancellation Token to cancel the request. /// Required Integer in group parameters + /// Cancellation Token to cancel the request. /// String in group parameters (optional) + /// Cancellation Token to cancel the request. /// Boolean in group parameters (optional) + /// Cancellation Token to cancel the request. /// Integer in group parameters (optional) + /// Cancellation Token to cancel the request. /// Task of void - System.Threading.Tasks.Task TestGroupParametersAsync (int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, int? stringGroup = default(int?), bool? booleanGroup = default(bool?), long? int64Group = default(long?)); + System.Threading.Tasks.Task TestGroupParametersAsync (int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, int? stringGroup = default(int?), bool? booleanGroup = default(bool?), long? int64Group = default(long?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Fake endpoint to test group parameters (optional) @@ -667,14 +735,20 @@ public interface IFakeApiAsync : IApiAccessor /// Fake endpoint to test group parameters (optional) /// /// Thrown when fails to make API call - /// Required String in group parameters - /// Required Boolean in group parameters - /// Required Integer in group parameters - /// String in group parameters (optional) - /// Boolean in group parameters (optional) - /// Integer in group parameters (optional) + /// Required String in group parameters + /// Cancellation Token to cancel the request. + /// Required Boolean in group parameters + /// Cancellation Token to cancel the request. + /// Required Integer in group parameters + /// Cancellation Token to cancel the request. + /// String in group parameters (optional) + /// Cancellation Token to cancel the request. + /// Boolean in group parameters (optional) + /// Cancellation Token to cancel the request. + /// Integer in group parameters (optional) + /// Cancellation Token to cancel the request. /// Task of ApiResponse - System.Threading.Tasks.Task> TestGroupParametersAsyncWithHttpInfo (int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, int? stringGroup = default(int?), bool? booleanGroup = default(bool?), long? int64Group = default(long?)); + System.Threading.Tasks.Task> TestGroupParametersAsyncWithHttpInfo (int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, int? stringGroup = default(int?), bool? booleanGroup = default(bool?), long? int64Group = default(long?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// test inline additionalProperties /// @@ -683,8 +757,9 @@ public interface IFakeApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// request body + /// Cancellation Token to cancel the request. /// Task of void - System.Threading.Tasks.Task TestInlineAdditionalPropertiesAsync (Dictionary param); + System.Threading.Tasks.Task TestInlineAdditionalPropertiesAsync (Dictionary param, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// test inline additionalProperties @@ -693,9 +768,10 @@ public interface IFakeApiAsync : IApiAccessor /// /// /// Thrown when fails to make API call - /// request body + /// request body + /// Cancellation Token to cancel the request. /// Task of ApiResponse - System.Threading.Tasks.Task> TestInlineAdditionalPropertiesAsyncWithHttpInfo (Dictionary param); + System.Threading.Tasks.Task> TestInlineAdditionalPropertiesAsyncWithHttpInfo (Dictionary param, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// test json serialization of form data /// @@ -704,9 +780,11 @@ public interface IFakeApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// field1 + /// Cancellation Token to cancel the request. /// field2 + /// Cancellation Token to cancel the request. /// Task of void - System.Threading.Tasks.Task TestJsonFormDataAsync (string param, string param2); + System.Threading.Tasks.Task TestJsonFormDataAsync (string param, string param2, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// test json serialization of form data @@ -715,10 +793,12 @@ public interface IFakeApiAsync : IApiAccessor /// /// /// Thrown when fails to make API call - /// field1 - /// field2 + /// field1 + /// Cancellation Token to cancel the request. + /// field2 + /// Cancellation Token to cancel the request. /// Task of ApiResponse - System.Threading.Tasks.Task> TestJsonFormDataAsyncWithHttpInfo (string param, string param2); + System.Threading.Tasks.Task> TestJsonFormDataAsyncWithHttpInfo (string param, string param2, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// /// @@ -727,12 +807,17 @@ public interface IFakeApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// + /// Cancellation Token to cancel the request. /// + /// Cancellation Token to cancel the request. /// + /// Cancellation Token to cancel the request. /// + /// Cancellation Token to cancel the request. /// + /// Cancellation Token to cancel the request. /// Task of void - System.Threading.Tasks.Task TestQueryParameterCollectionFormatAsync (List pipe, List ioutil, List http, List url, List context); + System.Threading.Tasks.Task TestQueryParameterCollectionFormatAsync (List pipe, List ioutil, List http, List url, List context, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// @@ -741,13 +826,18 @@ public interface IFakeApiAsync : IApiAccessor /// To test the collection format in query parameters /// /// Thrown when fails to make API call - /// - /// - /// - /// - /// + /// + /// Cancellation Token to cancel the request. + /// + /// Cancellation Token to cancel the request. + /// + /// Cancellation Token to cancel the request. + /// + /// Cancellation Token to cancel the request. + /// + /// Cancellation Token to cancel the request. /// Task of ApiResponse - System.Threading.Tasks.Task> TestQueryParameterCollectionFormatAsyncWithHttpInfo (List pipe, List ioutil, List http, List url, List context); + System.Threading.Tasks.Task> TestQueryParameterCollectionFormatAsyncWithHttpInfo (List pipe, List ioutil, List http, List url, List context, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); #endregion Asynchronous Operations } @@ -931,11 +1021,12 @@ public Org.OpenAPITools.Client.ApiResponse CreateXmlItemWithHttpInfo (Xm /// creates an XmlItem this route creates an XmlItem /// /// Thrown when fails to make API call - /// XmlItem Body + /// XmlItem Body + /// Cancellation Token to cancel the request. /// Task of void - public async System.Threading.Tasks.Task CreateXmlItemAsync (XmlItem xmlItem) + public async System.Threading.Tasks.Task CreateXmlItemAsync (XmlItem xmlItem, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - await CreateXmlItemAsyncWithHttpInfo(xmlItem); + await CreateXmlItemAsyncWithHttpInfo(xmlItem, cancellationToken); } @@ -943,9 +1034,10 @@ public async System.Threading.Tasks.Task CreateXmlItemAsync (XmlItem xmlItem) /// creates an XmlItem this route creates an XmlItem /// /// Thrown when fails to make API call - /// XmlItem Body + /// XmlItem Body + /// Cancellation Token to cancel the request. /// Task of ApiResponse - public async System.Threading.Tasks.Task> CreateXmlItemAsyncWithHttpInfo (XmlItem xmlItem) + public async System.Threading.Tasks.Task> CreateXmlItemAsyncWithHttpInfo (XmlItem xmlItem, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // verify the required parameter 'xmlItem' is set if (xmlItem == null) @@ -979,7 +1071,7 @@ public async System.Threading.Tasks.Task CreateXmlItemAsync (XmlItem xmlItem) // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/fake/create_xml_item", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.PostAsync("/fake/create_xml_item", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { @@ -1045,11 +1137,12 @@ public async System.Threading.Tasks.Task CreateXmlItemAsync (XmlItem xmlItem) /// Test serialization of outer boolean types /// /// Thrown when fails to make API call - /// Input boolean as post body (optional) + /// Input boolean as post body (optional) + /// Cancellation Token to cancel the request. /// Task of bool - public async System.Threading.Tasks.Task FakeOuterBooleanSerializeAsync (bool? body = default(bool?)) + public async System.Threading.Tasks.Task FakeOuterBooleanSerializeAsync (bool? body = default(bool?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - Org.OpenAPITools.Client.ApiResponse localVarResponse = await FakeOuterBooleanSerializeAsyncWithHttpInfo(body); + Org.OpenAPITools.Client.ApiResponse localVarResponse = await FakeOuterBooleanSerializeAsyncWithHttpInfo(body, cancellationToken); return localVarResponse.Data; } @@ -1058,9 +1151,10 @@ public async System.Threading.Tasks.Task CreateXmlItemAsync (XmlItem xmlItem) /// Test serialization of outer boolean types /// /// Thrown when fails to make API call - /// Input boolean as post body (optional) + /// Input boolean as post body (optional) + /// Cancellation Token to cancel the request. /// Task of ApiResponse (bool) - public async System.Threading.Tasks.Task> FakeOuterBooleanSerializeAsyncWithHttpInfo (bool? body = default(bool?)) + public async System.Threading.Tasks.Task> FakeOuterBooleanSerializeAsyncWithHttpInfo (bool? body = default(bool?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1085,7 +1179,7 @@ public async System.Threading.Tasks.Task CreateXmlItemAsync (XmlItem xmlItem) // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/fake/outer/boolean", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.PostAsync("/fake/outer/boolean", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { @@ -1151,11 +1245,12 @@ public async System.Threading.Tasks.Task CreateXmlItemAsync (XmlItem xmlItem) /// Test serialization of object with outer number type /// /// Thrown when fails to make API call - /// Input composite as post body (optional) + /// Input composite as post body (optional) + /// Cancellation Token to cancel the request. /// Task of OuterComposite - public async System.Threading.Tasks.Task FakeOuterCompositeSerializeAsync (OuterComposite body = default(OuterComposite)) + public async System.Threading.Tasks.Task FakeOuterCompositeSerializeAsync (OuterComposite body = default(OuterComposite), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - Org.OpenAPITools.Client.ApiResponse localVarResponse = await FakeOuterCompositeSerializeAsyncWithHttpInfo(body); + Org.OpenAPITools.Client.ApiResponse localVarResponse = await FakeOuterCompositeSerializeAsyncWithHttpInfo(body, cancellationToken); return localVarResponse.Data; } @@ -1164,9 +1259,10 @@ public async System.Threading.Tasks.Task CreateXmlItemAsync (XmlItem xmlItem) /// Test serialization of object with outer number type /// /// Thrown when fails to make API call - /// Input composite as post body (optional) + /// Input composite as post body (optional) + /// Cancellation Token to cancel the request. /// Task of ApiResponse (OuterComposite) - public async System.Threading.Tasks.Task> FakeOuterCompositeSerializeAsyncWithHttpInfo (OuterComposite body = default(OuterComposite)) + public async System.Threading.Tasks.Task> FakeOuterCompositeSerializeAsyncWithHttpInfo (OuterComposite body = default(OuterComposite), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1191,7 +1287,7 @@ public async System.Threading.Tasks.Task CreateXmlItemAsync (XmlItem xmlItem) // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/fake/outer/composite", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.PostAsync("/fake/outer/composite", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { @@ -1257,11 +1353,12 @@ public async System.Threading.Tasks.Task CreateXmlItemAsync (XmlItem xmlItem) /// Test serialization of outer number types /// /// Thrown when fails to make API call - /// Input number as post body (optional) + /// Input number as post body (optional) + /// Cancellation Token to cancel the request. /// Task of decimal - public async System.Threading.Tasks.Task FakeOuterNumberSerializeAsync (decimal? body = default(decimal?)) + public async System.Threading.Tasks.Task FakeOuterNumberSerializeAsync (decimal? body = default(decimal?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - Org.OpenAPITools.Client.ApiResponse localVarResponse = await FakeOuterNumberSerializeAsyncWithHttpInfo(body); + Org.OpenAPITools.Client.ApiResponse localVarResponse = await FakeOuterNumberSerializeAsyncWithHttpInfo(body, cancellationToken); return localVarResponse.Data; } @@ -1270,9 +1367,10 @@ public async System.Threading.Tasks.Task CreateXmlItemAsync (XmlItem xmlItem) /// Test serialization of outer number types /// /// Thrown when fails to make API call - /// Input number as post body (optional) + /// Input number as post body (optional) + /// Cancellation Token to cancel the request. /// Task of ApiResponse (decimal) - public async System.Threading.Tasks.Task> FakeOuterNumberSerializeAsyncWithHttpInfo (decimal? body = default(decimal?)) + public async System.Threading.Tasks.Task> FakeOuterNumberSerializeAsyncWithHttpInfo (decimal? body = default(decimal?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1297,7 +1395,7 @@ public async System.Threading.Tasks.Task CreateXmlItemAsync (XmlItem xmlItem) // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/fake/outer/number", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.PostAsync("/fake/outer/number", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { @@ -1363,11 +1461,12 @@ public async System.Threading.Tasks.Task CreateXmlItemAsync (XmlItem xmlItem) /// Test serialization of outer string types /// /// Thrown when fails to make API call - /// Input string as post body (optional) + /// Input string as post body (optional) + /// Cancellation Token to cancel the request. /// Task of string - public async System.Threading.Tasks.Task FakeOuterStringSerializeAsync (string body = default(string)) + public async System.Threading.Tasks.Task FakeOuterStringSerializeAsync (string body = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - Org.OpenAPITools.Client.ApiResponse localVarResponse = await FakeOuterStringSerializeAsyncWithHttpInfo(body); + Org.OpenAPITools.Client.ApiResponse localVarResponse = await FakeOuterStringSerializeAsyncWithHttpInfo(body, cancellationToken); return localVarResponse.Data; } @@ -1376,9 +1475,10 @@ public async System.Threading.Tasks.Task CreateXmlItemAsync (XmlItem xmlItem) /// Test serialization of outer string types /// /// Thrown when fails to make API call - /// Input string as post body (optional) + /// Input string as post body (optional) + /// Cancellation Token to cancel the request. /// Task of ApiResponse (string) - public async System.Threading.Tasks.Task> FakeOuterStringSerializeAsyncWithHttpInfo (string body = default(string)) + public async System.Threading.Tasks.Task> FakeOuterStringSerializeAsyncWithHttpInfo (string body = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1403,7 +1503,7 @@ public async System.Threading.Tasks.Task CreateXmlItemAsync (XmlItem xmlItem) // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/fake/outer/string", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.PostAsync("/fake/outer/string", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { @@ -1472,11 +1572,12 @@ public Org.OpenAPITools.Client.ApiResponse TestBodyWithFileSchemaWithHtt /// For this test, the body for this request much reference a schema named `File`. /// /// Thrown when fails to make API call - /// + /// + /// Cancellation Token to cancel the request. /// Task of void - public async System.Threading.Tasks.Task TestBodyWithFileSchemaAsync (FileSchemaTestClass body) + public async System.Threading.Tasks.Task TestBodyWithFileSchemaAsync (FileSchemaTestClass body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - await TestBodyWithFileSchemaAsyncWithHttpInfo(body); + await TestBodyWithFileSchemaAsyncWithHttpInfo(body, cancellationToken); } @@ -1484,9 +1585,10 @@ public async System.Threading.Tasks.Task TestBodyWithFileSchemaAsync (FileSchema /// For this test, the body for this request much reference a schema named `File`. /// /// Thrown when fails to make API call - /// + /// + /// Cancellation Token to cancel the request. /// Task of ApiResponse - public async System.Threading.Tasks.Task> TestBodyWithFileSchemaAsyncWithHttpInfo (FileSchemaTestClass body) + public async System.Threading.Tasks.Task> TestBodyWithFileSchemaAsyncWithHttpInfo (FileSchemaTestClass body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // verify the required parameter 'body' is set if (body == null) @@ -1515,7 +1617,7 @@ public async System.Threading.Tasks.Task TestBodyWithFileSchemaAsync (FileSchema // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PutAsync("/fake/body-with-file-schema", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.PutAsync("/fake/body-with-file-schema", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { @@ -1591,12 +1693,14 @@ public Org.OpenAPITools.Client.ApiResponse TestBodyWithQueryParamsWithHt /// /// /// Thrown when fails to make API call - /// - /// + /// + /// Cancellation Token to cancel the request. + /// + /// Cancellation Token to cancel the request. /// Task of void - public async System.Threading.Tasks.Task TestBodyWithQueryParamsAsync (string query, User body) + public async System.Threading.Tasks.Task TestBodyWithQueryParamsAsync (string query, User body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - await TestBodyWithQueryParamsAsyncWithHttpInfo(query, body); + await TestBodyWithQueryParamsAsyncWithHttpInfo(query, body, cancellationToken); } @@ -1604,10 +1708,12 @@ public async System.Threading.Tasks.Task TestBodyWithQueryParamsAsync (string qu /// /// /// Thrown when fails to make API call - /// - /// + /// + /// Cancellation Token to cancel the request. + /// + /// Cancellation Token to cancel the request. /// Task of ApiResponse - public async System.Threading.Tasks.Task> TestBodyWithQueryParamsAsyncWithHttpInfo (string query, User body) + public async System.Threading.Tasks.Task> TestBodyWithQueryParamsAsyncWithHttpInfo (string query, User body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // verify the required parameter 'query' is set if (query == null) @@ -1641,7 +1747,7 @@ public async System.Threading.Tasks.Task TestBodyWithQueryParamsAsync (string qu // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PutAsync("/fake/body-with-query-params", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.PutAsync("/fake/body-with-query-params", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { @@ -1712,11 +1818,12 @@ public Org.OpenAPITools.Client.ApiResponse< ModelClient > TestClientModelWithHtt /// To test \"client\" model To test \"client\" model /// /// Thrown when fails to make API call - /// client model + /// client model + /// Cancellation Token to cancel the request. /// Task of ModelClient - public async System.Threading.Tasks.Task TestClientModelAsync (ModelClient body) + public async System.Threading.Tasks.Task TestClientModelAsync (ModelClient body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - Org.OpenAPITools.Client.ApiResponse localVarResponse = await TestClientModelAsyncWithHttpInfo(body); + Org.OpenAPITools.Client.ApiResponse localVarResponse = await TestClientModelAsyncWithHttpInfo(body, cancellationToken); return localVarResponse.Data; } @@ -1725,9 +1832,10 @@ public async System.Threading.Tasks.Task TestClientModelAsync (Mode /// To test \"client\" model To test \"client\" model /// /// Thrown when fails to make API call - /// client model + /// client model + /// Cancellation Token to cancel the request. /// Task of ApiResponse (ModelClient) - public async System.Threading.Tasks.Task> TestClientModelAsyncWithHttpInfo (ModelClient body) + public async System.Threading.Tasks.Task> TestClientModelAsyncWithHttpInfo (ModelClient body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // verify the required parameter 'body' is set if (body == null) @@ -1757,7 +1865,7 @@ public async System.Threading.Tasks.Task TestClientModelAsync (Mode // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PatchAsync("/fake", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.PatchAsync("/fake", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { @@ -1905,24 +2013,38 @@ public async System.Threading.Tasks.Task TestClientModelAsync (Mode /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 /// /// Thrown when fails to make API call - /// None - /// None - /// None - /// None - /// None (optional) - /// None (optional) - /// None (optional) - /// None (optional) - /// None (optional) - /// None (optional) - /// None (optional) - /// None (optional) - /// None (optional) - /// None (optional) + /// None + /// Cancellation Token to cancel the request. + /// None + /// Cancellation Token to cancel the request. + /// None + /// Cancellation Token to cancel the request. + /// None + /// Cancellation Token to cancel the request. + /// None (optional) + /// Cancellation Token to cancel the request. + /// None (optional) + /// Cancellation Token to cancel the request. + /// None (optional) + /// Cancellation Token to cancel the request. + /// None (optional) + /// Cancellation Token to cancel the request. + /// None (optional) + /// Cancellation Token to cancel the request. + /// None (optional) + /// Cancellation Token to cancel the request. + /// None (optional) + /// Cancellation Token to cancel the request. + /// None (optional) + /// Cancellation Token to cancel the request. + /// None (optional) + /// Cancellation Token to cancel the request. + /// None (optional) + /// Cancellation Token to cancel the request. /// Task of void - public async System.Threading.Tasks.Task TestEndpointParametersAsync (decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int? integer = default(int?), int? int32 = default(int?), long? int64 = default(long?), float? _float = default(float?), string _string = default(string), System.IO.Stream binary = default(System.IO.Stream), DateTime? date = default(DateTime?), DateTime? dateTime = default(DateTime?), string password = default(string), string callback = default(string)) + public async System.Threading.Tasks.Task TestEndpointParametersAsync (decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int? integer = default(int?), int? int32 = default(int?), long? int64 = default(long?), float? _float = default(float?), string _string = default(string), System.IO.Stream binary = default(System.IO.Stream), DateTime? date = default(DateTime?), DateTime? dateTime = default(DateTime?), string password = default(string), string callback = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - await TestEndpointParametersAsyncWithHttpInfo(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, _string, binary, date, dateTime, password, callback); + await TestEndpointParametersAsyncWithHttpInfo(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, _string, binary, date, dateTime, password, callback, cancellationToken); } @@ -1930,22 +2052,36 @@ public async System.Threading.Tasks.Task TestClientModelAsync (Mode /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 /// /// Thrown when fails to make API call - /// None - /// None - /// None - /// None - /// None (optional) - /// None (optional) - /// None (optional) - /// None (optional) - /// None (optional) - /// None (optional) - /// None (optional) - /// None (optional) - /// None (optional) - /// None (optional) + /// None + /// Cancellation Token to cancel the request. + /// None + /// Cancellation Token to cancel the request. + /// None + /// Cancellation Token to cancel the request. + /// None + /// Cancellation Token to cancel the request. + /// None (optional) + /// Cancellation Token to cancel the request. + /// None (optional) + /// Cancellation Token to cancel the request. + /// None (optional) + /// Cancellation Token to cancel the request. + /// None (optional) + /// Cancellation Token to cancel the request. + /// None (optional) + /// Cancellation Token to cancel the request. + /// None (optional) + /// Cancellation Token to cancel the request. + /// None (optional) + /// Cancellation Token to cancel the request. + /// None (optional) + /// Cancellation Token to cancel the request. + /// None (optional) + /// Cancellation Token to cancel the request. + /// None (optional) + /// Cancellation Token to cancel the request. /// Task of ApiResponse - public async System.Threading.Tasks.Task> TestEndpointParametersAsyncWithHttpInfo (decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int? integer = default(int?), int? int32 = default(int?), long? int64 = default(long?), float? _float = default(float?), string _string = default(string), System.IO.Stream binary = default(System.IO.Stream), DateTime? date = default(DateTime?), DateTime? dateTime = default(DateTime?), string password = default(string), string callback = default(string)) + public async System.Threading.Tasks.Task> TestEndpointParametersAsyncWithHttpInfo (decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int? integer = default(int?), int? int32 = default(int?), long? int64 = default(long?), float? _float = default(float?), string _string = default(string), System.IO.Stream binary = default(System.IO.Stream), DateTime? date = default(DateTime?), DateTime? dateTime = default(DateTime?), string password = default(string), string callback = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // verify the required parameter 'patternWithoutDelimiter' is set if (patternWithoutDelimiter == null) @@ -2027,7 +2163,7 @@ public async System.Threading.Tasks.Task TestClientModelAsync (Mode // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/fake", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.PostAsync("/fake", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { @@ -2137,18 +2273,26 @@ public async System.Threading.Tasks.Task TestClientModelAsync (Mode /// To test enum parameters To test enum parameters /// /// Thrown when fails to make API call - /// Header parameter enum test (string array) (optional) - /// Header parameter enum test (string) (optional, default to -efg) - /// Query parameter enum test (string array) (optional) - /// Query parameter enum test (string) (optional, default to -efg) - /// Query parameter enum test (double) (optional) - /// Query parameter enum test (double) (optional) - /// Form parameter enum test (string array) (optional, default to $) - /// Form parameter enum test (string) (optional, default to -efg) + /// Header parameter enum test (string array) (optional) + /// Cancellation Token to cancel the request. + /// Header parameter enum test (string) (optional, default to -efg) + /// Cancellation Token to cancel the request. + /// Query parameter enum test (string array) (optional) + /// Cancellation Token to cancel the request. + /// Query parameter enum test (string) (optional, default to -efg) + /// Cancellation Token to cancel the request. + /// Query parameter enum test (double) (optional) + /// Cancellation Token to cancel the request. + /// Query parameter enum test (double) (optional) + /// Cancellation Token to cancel the request. + /// Form parameter enum test (string array) (optional, default to $) + /// Cancellation Token to cancel the request. + /// Form parameter enum test (string) (optional, default to -efg) + /// Cancellation Token to cancel the request. /// Task of void - public async System.Threading.Tasks.Task TestEnumParametersAsync (List enumHeaderStringArray = default(List), string enumHeaderString = default(string), List enumQueryStringArray = default(List), string enumQueryString = default(string), int? enumQueryInteger = default(int?), double? enumQueryDouble = default(double?), List enumFormStringArray = default(List), string enumFormString = default(string)) + public async System.Threading.Tasks.Task TestEnumParametersAsync (List enumHeaderStringArray = default(List), string enumHeaderString = default(string), List enumQueryStringArray = default(List), string enumQueryString = default(string), int? enumQueryInteger = default(int?), double? enumQueryDouble = default(double?), List enumFormStringArray = default(List), string enumFormString = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - await TestEnumParametersAsyncWithHttpInfo(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); + await TestEnumParametersAsyncWithHttpInfo(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString, cancellationToken); } @@ -2156,16 +2300,24 @@ public async System.Threading.Tasks.Task TestClientModelAsync (Mode /// To test enum parameters To test enum parameters /// /// Thrown when fails to make API call - /// Header parameter enum test (string array) (optional) - /// Header parameter enum test (string) (optional, default to -efg) - /// Query parameter enum test (string array) (optional) - /// Query parameter enum test (string) (optional, default to -efg) - /// Query parameter enum test (double) (optional) - /// Query parameter enum test (double) (optional) - /// Form parameter enum test (string array) (optional, default to $) - /// Form parameter enum test (string) (optional, default to -efg) + /// Header parameter enum test (string array) (optional) + /// Cancellation Token to cancel the request. + /// Header parameter enum test (string) (optional, default to -efg) + /// Cancellation Token to cancel the request. + /// Query parameter enum test (string array) (optional) + /// Cancellation Token to cancel the request. + /// Query parameter enum test (string) (optional, default to -efg) + /// Cancellation Token to cancel the request. + /// Query parameter enum test (double) (optional) + /// Cancellation Token to cancel the request. + /// Query parameter enum test (double) (optional) + /// Cancellation Token to cancel the request. + /// Form parameter enum test (string array) (optional, default to $) + /// Cancellation Token to cancel the request. + /// Form parameter enum test (string) (optional, default to -efg) + /// Cancellation Token to cancel the request. /// Task of ApiResponse - public async System.Threading.Tasks.Task> TestEnumParametersAsyncWithHttpInfo (List enumHeaderStringArray = default(List), string enumHeaderString = default(string), List enumQueryStringArray = default(List), string enumQueryString = default(string), int? enumQueryInteger = default(int?), double? enumQueryDouble = default(double?), List enumFormStringArray = default(List), string enumFormString = default(string)) + public async System.Threading.Tasks.Task> TestEnumParametersAsyncWithHttpInfo (List enumHeaderStringArray = default(List), string enumHeaderString = default(string), List enumQueryStringArray = default(List), string enumQueryString = default(string), int? enumQueryInteger = default(int?), double? enumQueryDouble = default(double?), List enumFormStringArray = default(List), string enumFormString = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -2221,7 +2373,7 @@ public async System.Threading.Tasks.Task TestClientModelAsync (Mode // make the HTTP request - var localVarResponse = await this.AsynchronousClient.GetAsync("/fake", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.GetAsync("/fake", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { @@ -2309,16 +2461,22 @@ public async System.Threading.Tasks.Task TestClientModelAsync (Mode /// Fake endpoint to test group parameters (optional) Fake endpoint to test group parameters (optional) /// /// Thrown when fails to make API call - /// Required String in group parameters - /// Required Boolean in group parameters - /// Required Integer in group parameters - /// String in group parameters (optional) - /// Boolean in group parameters (optional) - /// Integer in group parameters (optional) + /// Required String in group parameters + /// Cancellation Token to cancel the request. + /// Required Boolean in group parameters + /// Cancellation Token to cancel the request. + /// Required Integer in group parameters + /// Cancellation Token to cancel the request. + /// String in group parameters (optional) + /// Cancellation Token to cancel the request. + /// Boolean in group parameters (optional) + /// Cancellation Token to cancel the request. + /// Integer in group parameters (optional) + /// Cancellation Token to cancel the request. /// Task of void - public async System.Threading.Tasks.Task TestGroupParametersAsync (int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, int? stringGroup = default(int?), bool? booleanGroup = default(bool?), long? int64Group = default(long?)) + public async System.Threading.Tasks.Task TestGroupParametersAsync (int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, int? stringGroup = default(int?), bool? booleanGroup = default(bool?), long? int64Group = default(long?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - await TestGroupParametersAsyncWithHttpInfo(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); + await TestGroupParametersAsyncWithHttpInfo(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group, cancellationToken); } @@ -2326,14 +2484,20 @@ public async System.Threading.Tasks.Task TestClientModelAsync (Mode /// Fake endpoint to test group parameters (optional) Fake endpoint to test group parameters (optional) /// /// Thrown when fails to make API call - /// Required String in group parameters - /// Required Boolean in group parameters - /// Required Integer in group parameters - /// String in group parameters (optional) - /// Boolean in group parameters (optional) - /// Integer in group parameters (optional) + /// Required String in group parameters + /// Cancellation Token to cancel the request. + /// Required Boolean in group parameters + /// Cancellation Token to cancel the request. + /// Required Integer in group parameters + /// Cancellation Token to cancel the request. + /// String in group parameters (optional) + /// Cancellation Token to cancel the request. + /// Boolean in group parameters (optional) + /// Cancellation Token to cancel the request. + /// Integer in group parameters (optional) + /// Cancellation Token to cancel the request. /// Task of ApiResponse - public async System.Threading.Tasks.Task> TestGroupParametersAsyncWithHttpInfo (int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, int? stringGroup = default(int?), bool? booleanGroup = default(bool?), long? int64Group = default(long?)) + public async System.Threading.Tasks.Task> TestGroupParametersAsyncWithHttpInfo (int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, int? stringGroup = default(int?), bool? booleanGroup = default(bool?), long? int64Group = default(long?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -2371,7 +2535,7 @@ public async System.Threading.Tasks.Task TestClientModelAsync (Mode // make the HTTP request - var localVarResponse = await this.AsynchronousClient.DeleteAsync("/fake", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.DeleteAsync("/fake", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { @@ -2440,11 +2604,12 @@ public Org.OpenAPITools.Client.ApiResponse TestInlineAdditionalPropertie /// test inline additionalProperties /// /// Thrown when fails to make API call - /// request body + /// request body + /// Cancellation Token to cancel the request. /// Task of void - public async System.Threading.Tasks.Task TestInlineAdditionalPropertiesAsync (Dictionary param) + public async System.Threading.Tasks.Task TestInlineAdditionalPropertiesAsync (Dictionary param, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - await TestInlineAdditionalPropertiesAsyncWithHttpInfo(param); + await TestInlineAdditionalPropertiesAsyncWithHttpInfo(param, cancellationToken); } @@ -2452,9 +2617,10 @@ public async System.Threading.Tasks.Task TestInlineAdditionalPropertiesAsync (Di /// test inline additionalProperties /// /// Thrown when fails to make API call - /// request body + /// request body + /// Cancellation Token to cancel the request. /// Task of ApiResponse - public async System.Threading.Tasks.Task> TestInlineAdditionalPropertiesAsyncWithHttpInfo (Dictionary param) + public async System.Threading.Tasks.Task> TestInlineAdditionalPropertiesAsyncWithHttpInfo (Dictionary param, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // verify the required parameter 'param' is set if (param == null) @@ -2483,7 +2649,7 @@ public async System.Threading.Tasks.Task TestInlineAdditionalPropertiesAsync (Di // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/fake/inline-additionalProperties", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.PostAsync("/fake/inline-additionalProperties", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { @@ -2559,12 +2725,14 @@ public Org.OpenAPITools.Client.ApiResponse TestJsonFormDataWithHttpInfo /// test json serialization of form data /// /// Thrown when fails to make API call - /// field1 - /// field2 + /// field1 + /// Cancellation Token to cancel the request. + /// field2 + /// Cancellation Token to cancel the request. /// Task of void - public async System.Threading.Tasks.Task TestJsonFormDataAsync (string param, string param2) + public async System.Threading.Tasks.Task TestJsonFormDataAsync (string param, string param2, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - await TestJsonFormDataAsyncWithHttpInfo(param, param2); + await TestJsonFormDataAsyncWithHttpInfo(param, param2, cancellationToken); } @@ -2572,10 +2740,12 @@ public async System.Threading.Tasks.Task TestJsonFormDataAsync (string param, st /// test json serialization of form data /// /// Thrown when fails to make API call - /// field1 - /// field2 + /// field1 + /// Cancellation Token to cancel the request. + /// field2 + /// Cancellation Token to cancel the request. /// Task of ApiResponse - public async System.Threading.Tasks.Task> TestJsonFormDataAsyncWithHttpInfo (string param, string param2) + public async System.Threading.Tasks.Task> TestJsonFormDataAsyncWithHttpInfo (string param, string param2, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // verify the required parameter 'param' is set if (param == null) @@ -2609,7 +2779,7 @@ public async System.Threading.Tasks.Task TestJsonFormDataAsync (string param, st // make the HTTP request - var localVarResponse = await this.AsynchronousClient.GetAsync("/fake/jsonFormData", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.GetAsync("/fake/jsonFormData", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { @@ -2705,15 +2875,20 @@ public Org.OpenAPITools.Client.ApiResponse TestQueryParameterCollectionF /// To test the collection format in query parameters /// /// Thrown when fails to make API call - /// - /// - /// - /// - /// + /// + /// Cancellation Token to cancel the request. + /// + /// Cancellation Token to cancel the request. + /// + /// Cancellation Token to cancel the request. + /// + /// Cancellation Token to cancel the request. + /// + /// Cancellation Token to cancel the request. /// Task of void - public async System.Threading.Tasks.Task TestQueryParameterCollectionFormatAsync (List pipe, List ioutil, List http, List url, List context) + public async System.Threading.Tasks.Task TestQueryParameterCollectionFormatAsync (List pipe, List ioutil, List http, List url, List context, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - await TestQueryParameterCollectionFormatAsyncWithHttpInfo(pipe, ioutil, http, url, context); + await TestQueryParameterCollectionFormatAsyncWithHttpInfo(pipe, ioutil, http, url, context, cancellationToken); } @@ -2721,13 +2896,18 @@ public async System.Threading.Tasks.Task TestQueryParameterCollectionFormatAsync /// To test the collection format in query parameters /// /// Thrown when fails to make API call - /// - /// - /// - /// - /// + /// + /// Cancellation Token to cancel the request. + /// + /// Cancellation Token to cancel the request. + /// + /// Cancellation Token to cancel the request. + /// + /// Cancellation Token to cancel the request. + /// + /// Cancellation Token to cancel the request. /// Task of ApiResponse - public async System.Threading.Tasks.Task> TestQueryParameterCollectionFormatAsyncWithHttpInfo (List pipe, List ioutil, List http, List url, List context) + public async System.Threading.Tasks.Task> TestQueryParameterCollectionFormatAsyncWithHttpInfo (List pipe, List ioutil, List http, List url, List context, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // verify the required parameter 'pipe' is set if (pipe == null) @@ -2775,7 +2955,7 @@ public async System.Threading.Tasks.Task TestQueryParameterCollectionFormatAsync // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PutAsync("/fake/test-query-paramters", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.PutAsync("/fake/test-query-paramters", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs index b663807131fd..ca7fecd46a3d 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs @@ -65,8 +65,9 @@ public interface IFakeClassnameTags123ApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// client model + /// Cancellation Token to cancel the request. /// Task of ModelClient - System.Threading.Tasks.Task TestClassnameAsync (ModelClient body); + System.Threading.Tasks.Task TestClassnameAsync (ModelClient body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// To test class name in snake case @@ -75,9 +76,10 @@ public interface IFakeClassnameTags123ApiAsync : IApiAccessor /// To test class name in snake case /// /// Thrown when fails to make API call - /// client model + /// client model + /// Cancellation Token to cancel the request. /// Task of ApiResponse (ModelClient) - System.Threading.Tasks.Task> TestClassnameAsyncWithHttpInfo (ModelClient body); + System.Threading.Tasks.Task> TestClassnameAsyncWithHttpInfo (ModelClient body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); #endregion Asynchronous Operations } @@ -263,11 +265,12 @@ public Org.OpenAPITools.Client.ApiResponse< ModelClient > TestClassnameWithHttpI /// To test class name in snake case To test class name in snake case /// /// Thrown when fails to make API call - /// client model + /// client model + /// Cancellation Token to cancel the request. /// Task of ModelClient - public async System.Threading.Tasks.Task TestClassnameAsync (ModelClient body) + public async System.Threading.Tasks.Task TestClassnameAsync (ModelClient body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - Org.OpenAPITools.Client.ApiResponse localVarResponse = await TestClassnameAsyncWithHttpInfo(body); + Org.OpenAPITools.Client.ApiResponse localVarResponse = await TestClassnameAsyncWithHttpInfo(body, cancellationToken); return localVarResponse.Data; } @@ -276,9 +279,10 @@ public async System.Threading.Tasks.Task TestClassnameAsync (ModelC /// To test class name in snake case To test class name in snake case /// /// Thrown when fails to make API call - /// client model + /// client model + /// Cancellation Token to cancel the request. /// Task of ApiResponse (ModelClient) - public async System.Threading.Tasks.Task> TestClassnameAsyncWithHttpInfo (ModelClient body) + public async System.Threading.Tasks.Task> TestClassnameAsyncWithHttpInfo (ModelClient body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // verify the required parameter 'body' is set if (body == null) @@ -313,7 +317,7 @@ public async System.Threading.Tasks.Task TestClassnameAsync (ModelC // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PatchAsync("/fake_classname_test", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.PatchAsync("/fake_classname_test", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/PetApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/PetApi.cs index 6c50956c4ad5..a9f87aeb4eaa 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/PetApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/PetApi.cs @@ -247,8 +247,9 @@ public interface IPetApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// Pet object that needs to be added to the store + /// Cancellation Token to cancel the request. /// Task of void - System.Threading.Tasks.Task AddPetAsync (Pet body); + System.Threading.Tasks.Task AddPetAsync (Pet body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Add a new pet to the store @@ -257,9 +258,10 @@ public interface IPetApiAsync : IApiAccessor /// /// /// Thrown when fails to make API call - /// Pet object that needs to be added to the store + /// Pet object that needs to be added to the store + /// Cancellation Token to cancel the request. /// Task of ApiResponse - System.Threading.Tasks.Task> AddPetAsyncWithHttpInfo (Pet body); + System.Threading.Tasks.Task> AddPetAsyncWithHttpInfo (Pet body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Deletes a pet /// @@ -268,9 +270,11 @@ public interface IPetApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// Pet id to delete + /// Cancellation Token to cancel the request. /// (optional) + /// Cancellation Token to cancel the request. /// Task of void - System.Threading.Tasks.Task DeletePetAsync (long petId, string apiKey = default(string)); + System.Threading.Tasks.Task DeletePetAsync (long petId, string apiKey = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Deletes a pet @@ -279,10 +283,12 @@ public interface IPetApiAsync : IApiAccessor /// /// /// Thrown when fails to make API call - /// Pet id to delete - /// (optional) + /// Pet id to delete + /// Cancellation Token to cancel the request. + /// (optional) + /// Cancellation Token to cancel the request. /// Task of ApiResponse - System.Threading.Tasks.Task> DeletePetAsyncWithHttpInfo (long petId, string apiKey = default(string)); + System.Threading.Tasks.Task> DeletePetAsyncWithHttpInfo (long petId, string apiKey = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Finds Pets by status /// @@ -291,8 +297,9 @@ public interface IPetApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// Status values that need to be considered for filter + /// Cancellation Token to cancel the request. /// Task of List<Pet> - System.Threading.Tasks.Task> FindPetsByStatusAsync (List status); + System.Threading.Tasks.Task> FindPetsByStatusAsync (List status, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Finds Pets by status @@ -301,9 +308,10 @@ public interface IPetApiAsync : IApiAccessor /// Multiple status values can be provided with comma separated strings /// /// Thrown when fails to make API call - /// Status values that need to be considered for filter + /// Status values that need to be considered for filter + /// Cancellation Token to cancel the request. /// Task of ApiResponse (List<Pet>) - System.Threading.Tasks.Task>> FindPetsByStatusAsyncWithHttpInfo (List status); + System.Threading.Tasks.Task>> FindPetsByStatusAsyncWithHttpInfo (List status, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Finds Pets by tags /// @@ -312,8 +320,9 @@ public interface IPetApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// Tags to filter by + /// Cancellation Token to cancel the request. /// Task of List<Pet> - System.Threading.Tasks.Task> FindPetsByTagsAsync (List tags); + System.Threading.Tasks.Task> FindPetsByTagsAsync (List tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Finds Pets by tags @@ -322,9 +331,10 @@ public interface IPetApiAsync : IApiAccessor /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. /// /// Thrown when fails to make API call - /// Tags to filter by + /// Tags to filter by + /// Cancellation Token to cancel the request. /// Task of ApiResponse (List<Pet>) - System.Threading.Tasks.Task>> FindPetsByTagsAsyncWithHttpInfo (List tags); + System.Threading.Tasks.Task>> FindPetsByTagsAsyncWithHttpInfo (List tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Find pet by ID /// @@ -333,8 +343,9 @@ public interface IPetApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// ID of pet to return + /// Cancellation Token to cancel the request. /// Task of Pet - System.Threading.Tasks.Task GetPetByIdAsync (long petId); + System.Threading.Tasks.Task GetPetByIdAsync (long petId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Find pet by ID @@ -343,9 +354,10 @@ public interface IPetApiAsync : IApiAccessor /// Returns a single pet /// /// Thrown when fails to make API call - /// ID of pet to return + /// ID of pet to return + /// Cancellation Token to cancel the request. /// Task of ApiResponse (Pet) - System.Threading.Tasks.Task> GetPetByIdAsyncWithHttpInfo (long petId); + System.Threading.Tasks.Task> GetPetByIdAsyncWithHttpInfo (long petId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Update an existing pet /// @@ -354,8 +366,9 @@ public interface IPetApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// Pet object that needs to be added to the store + /// Cancellation Token to cancel the request. /// Task of void - System.Threading.Tasks.Task UpdatePetAsync (Pet body); + System.Threading.Tasks.Task UpdatePetAsync (Pet body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Update an existing pet @@ -364,9 +377,10 @@ public interface IPetApiAsync : IApiAccessor /// /// /// Thrown when fails to make API call - /// Pet object that needs to be added to the store + /// Pet object that needs to be added to the store + /// Cancellation Token to cancel the request. /// Task of ApiResponse - System.Threading.Tasks.Task> UpdatePetAsyncWithHttpInfo (Pet body); + System.Threading.Tasks.Task> UpdatePetAsyncWithHttpInfo (Pet body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Updates a pet in the store with form data /// @@ -375,10 +389,13 @@ public interface IPetApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// ID of pet that needs to be updated + /// Cancellation Token to cancel the request. /// Updated name of the pet (optional) + /// Cancellation Token to cancel the request. /// Updated status of the pet (optional) + /// Cancellation Token to cancel the request. /// Task of void - System.Threading.Tasks.Task UpdatePetWithFormAsync (long petId, string name = default(string), string status = default(string)); + System.Threading.Tasks.Task UpdatePetWithFormAsync (long petId, string name = default(string), string status = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Updates a pet in the store with form data @@ -387,11 +404,14 @@ public interface IPetApiAsync : IApiAccessor /// /// /// Thrown when fails to make API call - /// ID of pet that needs to be updated - /// Updated name of the pet (optional) - /// Updated status of the pet (optional) + /// ID of pet that needs to be updated + /// Cancellation Token to cancel the request. + /// Updated name of the pet (optional) + /// Cancellation Token to cancel the request. + /// Updated status of the pet (optional) + /// Cancellation Token to cancel the request. /// Task of ApiResponse - System.Threading.Tasks.Task> UpdatePetWithFormAsyncWithHttpInfo (long petId, string name = default(string), string status = default(string)); + System.Threading.Tasks.Task> UpdatePetWithFormAsyncWithHttpInfo (long petId, string name = default(string), string status = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// uploads an image /// @@ -400,10 +420,13 @@ public interface IPetApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// ID of pet to update + /// Cancellation Token to cancel the request. /// Additional data to pass to server (optional) + /// Cancellation Token to cancel the request. /// file to upload (optional) + /// Cancellation Token to cancel the request. /// Task of ApiResponse - System.Threading.Tasks.Task UploadFileAsync (long petId, string additionalMetadata = default(string), System.IO.Stream file = default(System.IO.Stream)); + System.Threading.Tasks.Task UploadFileAsync (long petId, string additionalMetadata = default(string), System.IO.Stream file = default(System.IO.Stream), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// uploads an image @@ -412,11 +435,14 @@ public interface IPetApiAsync : IApiAccessor /// /// /// Thrown when fails to make API call - /// ID of pet to update - /// Additional data to pass to server (optional) - /// file to upload (optional) + /// ID of pet to update + /// Cancellation Token to cancel the request. + /// Additional data to pass to server (optional) + /// Cancellation Token to cancel the request. + /// file to upload (optional) + /// Cancellation Token to cancel the request. /// Task of ApiResponse (ApiResponse) - System.Threading.Tasks.Task> UploadFileAsyncWithHttpInfo (long petId, string additionalMetadata = default(string), System.IO.Stream file = default(System.IO.Stream)); + System.Threading.Tasks.Task> UploadFileAsyncWithHttpInfo (long petId, string additionalMetadata = default(string), System.IO.Stream file = default(System.IO.Stream), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// uploads an image (required) /// @@ -425,10 +451,13 @@ public interface IPetApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// ID of pet to update + /// Cancellation Token to cancel the request. /// file to upload + /// Cancellation Token to cancel the request. /// Additional data to pass to server (optional) + /// Cancellation Token to cancel the request. /// Task of ApiResponse - System.Threading.Tasks.Task UploadFileWithRequiredFileAsync (long petId, System.IO.Stream requiredFile, string additionalMetadata = default(string)); + System.Threading.Tasks.Task UploadFileWithRequiredFileAsync (long petId, System.IO.Stream requiredFile, string additionalMetadata = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// uploads an image (required) @@ -437,11 +466,14 @@ public interface IPetApiAsync : IApiAccessor /// /// /// Thrown when fails to make API call - /// ID of pet to update - /// file to upload - /// Additional data to pass to server (optional) + /// ID of pet to update + /// Cancellation Token to cancel the request. + /// file to upload + /// Cancellation Token to cancel the request. + /// Additional data to pass to server (optional) + /// Cancellation Token to cancel the request. /// Task of ApiResponse (ApiResponse) - System.Threading.Tasks.Task> UploadFileWithRequiredFileAsyncWithHttpInfo (long petId, System.IO.Stream requiredFile, string additionalMetadata = default(string)); + System.Threading.Tasks.Task> UploadFileWithRequiredFileAsyncWithHttpInfo (long petId, System.IO.Stream requiredFile, string additionalMetadata = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); #endregion Asynchronous Operations } @@ -627,11 +659,12 @@ public Org.OpenAPITools.Client.ApiResponse AddPetWithHttpInfo (Pet body) /// Add a new pet to the store /// /// Thrown when fails to make API call - /// Pet object that needs to be added to the store + /// Pet object that needs to be added to the store + /// Cancellation Token to cancel the request. /// Task of void - public async System.Threading.Tasks.Task AddPetAsync (Pet body) + public async System.Threading.Tasks.Task AddPetAsync (Pet body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - await AddPetAsyncWithHttpInfo(body); + await AddPetAsyncWithHttpInfo(body, cancellationToken); } @@ -639,9 +672,10 @@ public async System.Threading.Tasks.Task AddPetAsync (Pet body) /// Add a new pet to the store /// /// Thrown when fails to make API call - /// Pet object that needs to be added to the store + /// Pet object that needs to be added to the store + /// Cancellation Token to cancel the request. /// Task of ApiResponse - public async System.Threading.Tasks.Task> AddPetAsyncWithHttpInfo (Pet body) + public async System.Threading.Tasks.Task> AddPetAsyncWithHttpInfo (Pet body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // verify the required parameter 'body' is set if (body == null) @@ -677,7 +711,7 @@ public async System.Threading.Tasks.Task AddPetAsync (Pet body) // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/pet", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.PostAsync("/pet", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { @@ -753,12 +787,14 @@ public async System.Threading.Tasks.Task AddPetAsync (Pet body) /// Deletes a pet /// /// Thrown when fails to make API call - /// Pet id to delete - /// (optional) + /// Pet id to delete + /// Cancellation Token to cancel the request. + /// (optional) + /// Cancellation Token to cancel the request. /// Task of void - public async System.Threading.Tasks.Task DeletePetAsync (long petId, string apiKey = default(string)) + public async System.Threading.Tasks.Task DeletePetAsync (long petId, string apiKey = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - await DeletePetAsyncWithHttpInfo(petId, apiKey); + await DeletePetAsyncWithHttpInfo(petId, apiKey, cancellationToken); } @@ -766,10 +802,12 @@ public async System.Threading.Tasks.Task AddPetAsync (Pet body) /// Deletes a pet /// /// Thrown when fails to make API call - /// Pet id to delete - /// (optional) + /// Pet id to delete + /// Cancellation Token to cancel the request. + /// (optional) + /// Cancellation Token to cancel the request. /// Task of ApiResponse - public async System.Threading.Tasks.Task> DeletePetAsyncWithHttpInfo (long petId, string apiKey = default(string)) + public async System.Threading.Tasks.Task> DeletePetAsyncWithHttpInfo (long petId, string apiKey = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -803,7 +841,7 @@ public async System.Threading.Tasks.Task AddPetAsync (Pet body) // make the HTTP request - var localVarResponse = await this.AsynchronousClient.DeleteAsync("/pet/{petId}", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.DeleteAsync("/pet/{petId}", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { @@ -880,11 +918,12 @@ public Org.OpenAPITools.Client.ApiResponse< List > FindPetsByStatusWithHttp /// Finds Pets by status Multiple status values can be provided with comma separated strings /// /// Thrown when fails to make API call - /// Status values that need to be considered for filter + /// Status values that need to be considered for filter + /// Cancellation Token to cancel the request. /// Task of List<Pet> - public async System.Threading.Tasks.Task> FindPetsByStatusAsync (List status) + public async System.Threading.Tasks.Task> FindPetsByStatusAsync (List status, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - Org.OpenAPITools.Client.ApiResponse> localVarResponse = await FindPetsByStatusAsyncWithHttpInfo(status); + Org.OpenAPITools.Client.ApiResponse> localVarResponse = await FindPetsByStatusAsyncWithHttpInfo(status, cancellationToken); return localVarResponse.Data; } @@ -893,9 +932,10 @@ public async System.Threading.Tasks.Task> FindPetsByStatusAsync (List< /// Finds Pets by status Multiple status values can be provided with comma separated strings /// /// Thrown when fails to make API call - /// Status values that need to be considered for filter + /// Status values that need to be considered for filter + /// Cancellation Token to cancel the request. /// Task of ApiResponse (List<Pet>) - public async System.Threading.Tasks.Task>> FindPetsByStatusAsyncWithHttpInfo (List status) + public async System.Threading.Tasks.Task>> FindPetsByStatusAsyncWithHttpInfo (List status, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // verify the required parameter 'status' is set if (status == null) @@ -931,7 +971,7 @@ public async System.Threading.Tasks.Task> FindPetsByStatusAsync (List< // make the HTTP request - var localVarResponse = await this.AsynchronousClient.GetAsync>("/pet/findByStatus", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.GetAsync>("/pet/findByStatus", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { @@ -1008,11 +1048,12 @@ public Org.OpenAPITools.Client.ApiResponse< List > FindPetsByTagsWithHttpIn /// Finds Pets by tags Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. /// /// Thrown when fails to make API call - /// Tags to filter by + /// Tags to filter by + /// Cancellation Token to cancel the request. /// Task of List<Pet> - public async System.Threading.Tasks.Task> FindPetsByTagsAsync (List tags) + public async System.Threading.Tasks.Task> FindPetsByTagsAsync (List tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - Org.OpenAPITools.Client.ApiResponse> localVarResponse = await FindPetsByTagsAsyncWithHttpInfo(tags); + Org.OpenAPITools.Client.ApiResponse> localVarResponse = await FindPetsByTagsAsyncWithHttpInfo(tags, cancellationToken); return localVarResponse.Data; } @@ -1021,9 +1062,10 @@ public async System.Threading.Tasks.Task> FindPetsByTagsAsync (List /// Thrown when fails to make API call - /// Tags to filter by + /// Tags to filter by + /// Cancellation Token to cancel the request. /// Task of ApiResponse (List<Pet>) - public async System.Threading.Tasks.Task>> FindPetsByTagsAsyncWithHttpInfo (List tags) + public async System.Threading.Tasks.Task>> FindPetsByTagsAsyncWithHttpInfo (List tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // verify the required parameter 'tags' is set if (tags == null) @@ -1059,7 +1101,7 @@ public async System.Threading.Tasks.Task> FindPetsByTagsAsync (List>("/pet/findByTags", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.GetAsync>("/pet/findByTags", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { @@ -1131,11 +1173,12 @@ public Org.OpenAPITools.Client.ApiResponse< Pet > GetPetByIdWithHttpInfo (long p /// Find pet by ID Returns a single pet /// /// Thrown when fails to make API call - /// ID of pet to return + /// ID of pet to return + /// Cancellation Token to cancel the request. /// Task of Pet - public async System.Threading.Tasks.Task GetPetByIdAsync (long petId) + public async System.Threading.Tasks.Task GetPetByIdAsync (long petId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - Org.OpenAPITools.Client.ApiResponse localVarResponse = await GetPetByIdAsyncWithHttpInfo(petId); + Org.OpenAPITools.Client.ApiResponse localVarResponse = await GetPetByIdAsyncWithHttpInfo(petId, cancellationToken); return localVarResponse.Data; } @@ -1144,9 +1187,10 @@ public async System.Threading.Tasks.Task GetPetByIdAsync (long petId) /// Find pet by ID Returns a single pet /// /// Thrown when fails to make API call - /// ID of pet to return + /// ID of pet to return + /// Cancellation Token to cancel the request. /// Task of ApiResponse (Pet) - public async System.Threading.Tasks.Task> GetPetByIdAsyncWithHttpInfo (long petId) + public async System.Threading.Tasks.Task> GetPetByIdAsyncWithHttpInfo (long petId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1177,7 +1221,7 @@ public async System.Threading.Tasks.Task GetPetByIdAsync (long petId) // make the HTTP request - var localVarResponse = await this.AsynchronousClient.GetAsync("/pet/{petId}", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.GetAsync("/pet/{petId}", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { @@ -1253,11 +1297,12 @@ public Org.OpenAPITools.Client.ApiResponse UpdatePetWithHttpInfo (Pet bo /// Update an existing pet /// /// Thrown when fails to make API call - /// Pet object that needs to be added to the store + /// Pet object that needs to be added to the store + /// Cancellation Token to cancel the request. /// Task of void - public async System.Threading.Tasks.Task UpdatePetAsync (Pet body) + public async System.Threading.Tasks.Task UpdatePetAsync (Pet body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - await UpdatePetAsyncWithHttpInfo(body); + await UpdatePetAsyncWithHttpInfo(body, cancellationToken); } @@ -1265,9 +1310,10 @@ public async System.Threading.Tasks.Task UpdatePetAsync (Pet body) /// Update an existing pet /// /// Thrown when fails to make API call - /// Pet object that needs to be added to the store + /// Pet object that needs to be added to the store + /// Cancellation Token to cancel the request. /// Task of ApiResponse - public async System.Threading.Tasks.Task> UpdatePetAsyncWithHttpInfo (Pet body) + public async System.Threading.Tasks.Task> UpdatePetAsyncWithHttpInfo (Pet body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // verify the required parameter 'body' is set if (body == null) @@ -1303,7 +1349,7 @@ public async System.Threading.Tasks.Task UpdatePetAsync (Pet body) // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PutAsync("/pet", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.PutAsync("/pet", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { @@ -1386,13 +1432,16 @@ public async System.Threading.Tasks.Task UpdatePetAsync (Pet body) /// Updates a pet in the store with form data /// /// Thrown when fails to make API call - /// ID of pet that needs to be updated - /// Updated name of the pet (optional) - /// Updated status of the pet (optional) + /// ID of pet that needs to be updated + /// Cancellation Token to cancel the request. + /// Updated name of the pet (optional) + /// Cancellation Token to cancel the request. + /// Updated status of the pet (optional) + /// Cancellation Token to cancel the request. /// Task of void - public async System.Threading.Tasks.Task UpdatePetWithFormAsync (long petId, string name = default(string), string status = default(string)) + public async System.Threading.Tasks.Task UpdatePetWithFormAsync (long petId, string name = default(string), string status = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - await UpdatePetWithFormAsyncWithHttpInfo(petId, name, status); + await UpdatePetWithFormAsyncWithHttpInfo(petId, name, status, cancellationToken); } @@ -1400,11 +1449,14 @@ public async System.Threading.Tasks.Task UpdatePetAsync (Pet body) /// Updates a pet in the store with form data /// /// Thrown when fails to make API call - /// ID of pet that needs to be updated - /// Updated name of the pet (optional) - /// Updated status of the pet (optional) + /// ID of pet that needs to be updated + /// Cancellation Token to cancel the request. + /// Updated name of the pet (optional) + /// Cancellation Token to cancel the request. + /// Updated status of the pet (optional) + /// Cancellation Token to cancel the request. /// Task of ApiResponse - public async System.Threading.Tasks.Task> UpdatePetWithFormAsyncWithHttpInfo (long petId, string name = default(string), string status = default(string)) + public async System.Threading.Tasks.Task> UpdatePetWithFormAsyncWithHttpInfo (long petId, string name = default(string), string status = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1443,7 +1495,7 @@ public async System.Threading.Tasks.Task UpdatePetAsync (Pet body) // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/pet/{petId}", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.PostAsync("/pet/{petId}", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { @@ -1528,13 +1580,16 @@ public async System.Threading.Tasks.Task UpdatePetAsync (Pet body) /// uploads an image /// /// Thrown when fails to make API call - /// ID of pet to update - /// Additional data to pass to server (optional) - /// file to upload (optional) + /// ID of pet to update + /// Cancellation Token to cancel the request. + /// Additional data to pass to server (optional) + /// Cancellation Token to cancel the request. + /// file to upload (optional) + /// Cancellation Token to cancel the request. /// Task of ApiResponse - public async System.Threading.Tasks.Task UploadFileAsync (long petId, string additionalMetadata = default(string), System.IO.Stream file = default(System.IO.Stream)) + public async System.Threading.Tasks.Task UploadFileAsync (long petId, string additionalMetadata = default(string), System.IO.Stream file = default(System.IO.Stream), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - Org.OpenAPITools.Client.ApiResponse localVarResponse = await UploadFileAsyncWithHttpInfo(petId, additionalMetadata, file); + Org.OpenAPITools.Client.ApiResponse localVarResponse = await UploadFileAsyncWithHttpInfo(petId, additionalMetadata, file, cancellationToken); return localVarResponse.Data; } @@ -1543,11 +1598,14 @@ public async System.Threading.Tasks.Task UpdatePetAsync (Pet body) /// uploads an image /// /// Thrown when fails to make API call - /// ID of pet to update - /// Additional data to pass to server (optional) - /// file to upload (optional) + /// ID of pet to update + /// Cancellation Token to cancel the request. + /// Additional data to pass to server (optional) + /// Cancellation Token to cancel the request. + /// file to upload (optional) + /// Cancellation Token to cancel the request. /// Task of ApiResponse (ApiResponse) - public async System.Threading.Tasks.Task> UploadFileAsyncWithHttpInfo (long petId, string additionalMetadata = default(string), System.IO.Stream file = default(System.IO.Stream)) + public async System.Threading.Tasks.Task> UploadFileAsyncWithHttpInfo (long petId, string additionalMetadata = default(string), System.IO.Stream file = default(System.IO.Stream), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1587,7 +1645,7 @@ public async System.Threading.Tasks.Task UpdatePetAsync (Pet body) // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/pet/{petId}/uploadImage", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.PostAsync("/pet/{petId}/uploadImage", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { @@ -1673,13 +1731,16 @@ public async System.Threading.Tasks.Task UpdatePetAsync (Pet body) /// uploads an image (required) /// /// Thrown when fails to make API call - /// ID of pet to update - /// file to upload - /// Additional data to pass to server (optional) + /// ID of pet to update + /// Cancellation Token to cancel the request. + /// file to upload + /// Cancellation Token to cancel the request. + /// Additional data to pass to server (optional) + /// Cancellation Token to cancel the request. /// Task of ApiResponse - public async System.Threading.Tasks.Task UploadFileWithRequiredFileAsync (long petId, System.IO.Stream requiredFile, string additionalMetadata = default(string)) + public async System.Threading.Tasks.Task UploadFileWithRequiredFileAsync (long petId, System.IO.Stream requiredFile, string additionalMetadata = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - Org.OpenAPITools.Client.ApiResponse localVarResponse = await UploadFileWithRequiredFileAsyncWithHttpInfo(petId, requiredFile, additionalMetadata); + Org.OpenAPITools.Client.ApiResponse localVarResponse = await UploadFileWithRequiredFileAsyncWithHttpInfo(petId, requiredFile, additionalMetadata, cancellationToken); return localVarResponse.Data; } @@ -1688,11 +1749,14 @@ public async System.Threading.Tasks.Task UpdatePetAsync (Pet body) /// uploads an image (required) /// /// Thrown when fails to make API call - /// ID of pet to update - /// file to upload - /// Additional data to pass to server (optional) + /// ID of pet to update + /// Cancellation Token to cancel the request. + /// file to upload + /// Cancellation Token to cancel the request. + /// Additional data to pass to server (optional) + /// Cancellation Token to cancel the request. /// Task of ApiResponse (ApiResponse) - public async System.Threading.Tasks.Task> UploadFileWithRequiredFileAsyncWithHttpInfo (long petId, System.IO.Stream requiredFile, string additionalMetadata = default(string)) + public async System.Threading.Tasks.Task> UploadFileWithRequiredFileAsyncWithHttpInfo (long petId, System.IO.Stream requiredFile, string additionalMetadata = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // verify the required parameter 'requiredFile' is set if (requiredFile == null) @@ -1733,7 +1797,7 @@ public async System.Threading.Tasks.Task UpdatePetAsync (Pet body) // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/fake/{petId}/uploadImageWithRequiredFile", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.PostAsync("/fake/{petId}/uploadImageWithRequiredFile", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/StoreApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/StoreApi.cs index a7379d4eac15..431369433551 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/StoreApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/StoreApi.cs @@ -126,8 +126,9 @@ public interface IStoreApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// ID of the order that needs to be deleted + /// Cancellation Token to cancel the request. /// Task of void - System.Threading.Tasks.Task DeleteOrderAsync (string orderId); + System.Threading.Tasks.Task DeleteOrderAsync (string orderId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Delete purchase order by ID @@ -136,9 +137,10 @@ public interface IStoreApiAsync : IApiAccessor /// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors /// /// Thrown when fails to make API call - /// ID of the order that needs to be deleted + /// ID of the order that needs to be deleted + /// Cancellation Token to cancel the request. /// Task of ApiResponse - System.Threading.Tasks.Task> DeleteOrderAsyncWithHttpInfo (string orderId); + System.Threading.Tasks.Task> DeleteOrderAsyncWithHttpInfo (string orderId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Returns pet inventories by status /// @@ -147,7 +149,7 @@ public interface IStoreApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// Task of Dictionary<string, int> - System.Threading.Tasks.Task> GetInventoryAsync (); + System.Threading.Tasks.Task> GetInventoryAsync (System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Returns pet inventories by status @@ -157,7 +159,7 @@ public interface IStoreApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// Task of ApiResponse (Dictionary<string, int>) - System.Threading.Tasks.Task>> GetInventoryAsyncWithHttpInfo (); + System.Threading.Tasks.Task>> GetInventoryAsyncWithHttpInfo (System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Find purchase order by ID /// @@ -166,8 +168,9 @@ public interface IStoreApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// ID of pet that needs to be fetched + /// Cancellation Token to cancel the request. /// Task of Order - System.Threading.Tasks.Task GetOrderByIdAsync (long orderId); + System.Threading.Tasks.Task GetOrderByIdAsync (long orderId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Find purchase order by ID @@ -176,9 +179,10 @@ public interface IStoreApiAsync : IApiAccessor /// For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions /// /// Thrown when fails to make API call - /// ID of pet that needs to be fetched + /// ID of pet that needs to be fetched + /// Cancellation Token to cancel the request. /// Task of ApiResponse (Order) - System.Threading.Tasks.Task> GetOrderByIdAsyncWithHttpInfo (long orderId); + System.Threading.Tasks.Task> GetOrderByIdAsyncWithHttpInfo (long orderId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Place an order for a pet /// @@ -187,8 +191,9 @@ public interface IStoreApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// order placed for purchasing the pet + /// Cancellation Token to cancel the request. /// Task of Order - System.Threading.Tasks.Task PlaceOrderAsync (Order body); + System.Threading.Tasks.Task PlaceOrderAsync (Order body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Place an order for a pet @@ -197,9 +202,10 @@ public interface IStoreApiAsync : IApiAccessor /// /// /// Thrown when fails to make API call - /// order placed for purchasing the pet + /// order placed for purchasing the pet + /// Cancellation Token to cancel the request. /// Task of ApiResponse (Order) - System.Threading.Tasks.Task> PlaceOrderAsyncWithHttpInfo (Order body); + System.Threading.Tasks.Task> PlaceOrderAsyncWithHttpInfo (Order body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); #endregion Asynchronous Operations } @@ -377,11 +383,12 @@ public Org.OpenAPITools.Client.ApiResponse DeleteOrderWithHttpInfo (stri /// Delete purchase order by ID For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors /// /// Thrown when fails to make API call - /// ID of the order that needs to be deleted + /// ID of the order that needs to be deleted + /// Cancellation Token to cancel the request. /// Task of void - public async System.Threading.Tasks.Task DeleteOrderAsync (string orderId) + public async System.Threading.Tasks.Task DeleteOrderAsync (string orderId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - await DeleteOrderAsyncWithHttpInfo(orderId); + await DeleteOrderAsyncWithHttpInfo(orderId, cancellationToken); } @@ -389,9 +396,10 @@ public async System.Threading.Tasks.Task DeleteOrderAsync (string orderId) /// Delete purchase order by ID For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors /// /// Thrown when fails to make API call - /// ID of the order that needs to be deleted + /// ID of the order that needs to be deleted + /// Cancellation Token to cancel the request. /// Task of ApiResponse - public async System.Threading.Tasks.Task> DeleteOrderAsyncWithHttpInfo (string orderId) + public async System.Threading.Tasks.Task> DeleteOrderAsyncWithHttpInfo (string orderId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // verify the required parameter 'orderId' is set if (orderId == null) @@ -419,7 +427,7 @@ public async System.Threading.Tasks.Task DeleteOrderAsync (string orderId) // make the HTTP request - var localVarResponse = await this.AsynchronousClient.DeleteAsync("/store/order/{order_id}", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.DeleteAsync("/store/order/{order_id}", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { @@ -488,9 +496,9 @@ public Org.OpenAPITools.Client.ApiResponse< Dictionary > GetInvento /// /// Thrown when fails to make API call /// Task of Dictionary<string, int> - public async System.Threading.Tasks.Task> GetInventoryAsync () + public async System.Threading.Tasks.Task> GetInventoryAsync (System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - Org.OpenAPITools.Client.ApiResponse> localVarResponse = await GetInventoryAsyncWithHttpInfo(); + Org.OpenAPITools.Client.ApiResponse> localVarResponse = await GetInventoryAsyncWithHttpInfo(cancellationToken); return localVarResponse.Data; } @@ -500,7 +508,7 @@ public async System.Threading.Tasks.Task> GetInventoryAs /// /// Thrown when fails to make API call /// Task of ApiResponse (Dictionary<string, int>) - public async System.Threading.Tasks.Task>> GetInventoryAsyncWithHttpInfo () + public async System.Threading.Tasks.Task>> GetInventoryAsyncWithHttpInfo (System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -529,7 +537,7 @@ public async System.Threading.Tasks.Task> GetInventoryAs // make the HTTP request - var localVarResponse = await this.AsynchronousClient.GetAsync>("/store/inventory", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.GetAsync>("/store/inventory", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { @@ -596,11 +604,12 @@ public Org.OpenAPITools.Client.ApiResponse< Order > GetOrderByIdWithHttpInfo (lo /// Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions /// /// Thrown when fails to make API call - /// ID of pet that needs to be fetched + /// ID of pet that needs to be fetched + /// Cancellation Token to cancel the request. /// Task of Order - public async System.Threading.Tasks.Task GetOrderByIdAsync (long orderId) + public async System.Threading.Tasks.Task GetOrderByIdAsync (long orderId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - Org.OpenAPITools.Client.ApiResponse localVarResponse = await GetOrderByIdAsyncWithHttpInfo(orderId); + Org.OpenAPITools.Client.ApiResponse localVarResponse = await GetOrderByIdAsyncWithHttpInfo(orderId, cancellationToken); return localVarResponse.Data; } @@ -609,9 +618,10 @@ public async System.Threading.Tasks.Task GetOrderByIdAsync (long orderId) /// Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions /// /// Thrown when fails to make API call - /// ID of pet that needs to be fetched + /// ID of pet that needs to be fetched + /// Cancellation Token to cancel the request. /// Task of ApiResponse (Order) - public async System.Threading.Tasks.Task> GetOrderByIdAsyncWithHttpInfo (long orderId) + public async System.Threading.Tasks.Task> GetOrderByIdAsyncWithHttpInfo (long orderId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -637,7 +647,7 @@ public async System.Threading.Tasks.Task GetOrderByIdAsync (long orderId) // make the HTTP request - var localVarResponse = await this.AsynchronousClient.GetAsync("/store/order/{order_id}", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.GetAsync("/store/order/{order_id}", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { @@ -708,11 +718,12 @@ public Org.OpenAPITools.Client.ApiResponse< Order > PlaceOrderWithHttpInfo (Orde /// Place an order for a pet /// /// Thrown when fails to make API call - /// order placed for purchasing the pet + /// order placed for purchasing the pet + /// Cancellation Token to cancel the request. /// Task of Order - public async System.Threading.Tasks.Task PlaceOrderAsync (Order body) + public async System.Threading.Tasks.Task PlaceOrderAsync (Order body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - Org.OpenAPITools.Client.ApiResponse localVarResponse = await PlaceOrderAsyncWithHttpInfo(body); + Org.OpenAPITools.Client.ApiResponse localVarResponse = await PlaceOrderAsyncWithHttpInfo(body, cancellationToken); return localVarResponse.Data; } @@ -721,9 +732,10 @@ public async System.Threading.Tasks.Task PlaceOrderAsync (Order body) /// Place an order for a pet /// /// Thrown when fails to make API call - /// order placed for purchasing the pet + /// order placed for purchasing the pet + /// Cancellation Token to cancel the request. /// Task of ApiResponse (Order) - public async System.Threading.Tasks.Task> PlaceOrderAsyncWithHttpInfo (Order body) + public async System.Threading.Tasks.Task> PlaceOrderAsyncWithHttpInfo (Order body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // verify the required parameter 'body' is set if (body == null) @@ -753,7 +765,7 @@ public async System.Threading.Tasks.Task PlaceOrderAsync (Order body) // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/store/order", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.PostAsync("/store/order", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/UserApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/UserApi.cs index f233973eb0cb..fa89ac357fb0 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/UserApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/UserApi.cs @@ -214,8 +214,9 @@ public interface IUserApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// Created user object + /// Cancellation Token to cancel the request. /// Task of void - System.Threading.Tasks.Task CreateUserAsync (User body); + System.Threading.Tasks.Task CreateUserAsync (User body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Create user @@ -224,9 +225,10 @@ public interface IUserApiAsync : IApiAccessor /// This can only be done by the logged in user. /// /// Thrown when fails to make API call - /// Created user object + /// Created user object + /// Cancellation Token to cancel the request. /// Task of ApiResponse - System.Threading.Tasks.Task> CreateUserAsyncWithHttpInfo (User body); + System.Threading.Tasks.Task> CreateUserAsyncWithHttpInfo (User body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Creates list of users with given input array /// @@ -235,8 +237,9 @@ public interface IUserApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// List of user object + /// Cancellation Token to cancel the request. /// Task of void - System.Threading.Tasks.Task CreateUsersWithArrayInputAsync (List body); + System.Threading.Tasks.Task CreateUsersWithArrayInputAsync (List body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Creates list of users with given input array @@ -245,9 +248,10 @@ public interface IUserApiAsync : IApiAccessor /// /// /// Thrown when fails to make API call - /// List of user object + /// List of user object + /// Cancellation Token to cancel the request. /// Task of ApiResponse - System.Threading.Tasks.Task> CreateUsersWithArrayInputAsyncWithHttpInfo (List body); + System.Threading.Tasks.Task> CreateUsersWithArrayInputAsyncWithHttpInfo (List body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Creates list of users with given input array /// @@ -256,8 +260,9 @@ public interface IUserApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// List of user object + /// Cancellation Token to cancel the request. /// Task of void - System.Threading.Tasks.Task CreateUsersWithListInputAsync (List body); + System.Threading.Tasks.Task CreateUsersWithListInputAsync (List body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Creates list of users with given input array @@ -266,9 +271,10 @@ public interface IUserApiAsync : IApiAccessor /// /// /// Thrown when fails to make API call - /// List of user object + /// List of user object + /// Cancellation Token to cancel the request. /// Task of ApiResponse - System.Threading.Tasks.Task> CreateUsersWithListInputAsyncWithHttpInfo (List body); + System.Threading.Tasks.Task> CreateUsersWithListInputAsyncWithHttpInfo (List body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Delete user /// @@ -277,8 +283,9 @@ public interface IUserApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// The name that needs to be deleted + /// Cancellation Token to cancel the request. /// Task of void - System.Threading.Tasks.Task DeleteUserAsync (string username); + System.Threading.Tasks.Task DeleteUserAsync (string username, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Delete user @@ -287,9 +294,10 @@ public interface IUserApiAsync : IApiAccessor /// This can only be done by the logged in user. /// /// Thrown when fails to make API call - /// The name that needs to be deleted + /// The name that needs to be deleted + /// Cancellation Token to cancel the request. /// Task of ApiResponse - System.Threading.Tasks.Task> DeleteUserAsyncWithHttpInfo (string username); + System.Threading.Tasks.Task> DeleteUserAsyncWithHttpInfo (string username, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Get user by user name /// @@ -298,8 +306,9 @@ public interface IUserApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// The name that needs to be fetched. Use user1 for testing. + /// Cancellation Token to cancel the request. /// Task of User - System.Threading.Tasks.Task GetUserByNameAsync (string username); + System.Threading.Tasks.Task GetUserByNameAsync (string username, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Get user by user name @@ -308,9 +317,10 @@ public interface IUserApiAsync : IApiAccessor /// /// /// Thrown when fails to make API call - /// The name that needs to be fetched. Use user1 for testing. + /// The name that needs to be fetched. Use user1 for testing. + /// Cancellation Token to cancel the request. /// Task of ApiResponse (User) - System.Threading.Tasks.Task> GetUserByNameAsyncWithHttpInfo (string username); + System.Threading.Tasks.Task> GetUserByNameAsyncWithHttpInfo (string username, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Logs user into the system /// @@ -319,9 +329,11 @@ public interface IUserApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// The user name for login + /// Cancellation Token to cancel the request. /// The password for login in clear text + /// Cancellation Token to cancel the request. /// Task of string - System.Threading.Tasks.Task LoginUserAsync (string username, string password); + System.Threading.Tasks.Task LoginUserAsync (string username, string password, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Logs user into the system @@ -330,10 +342,12 @@ public interface IUserApiAsync : IApiAccessor /// /// /// Thrown when fails to make API call - /// The user name for login - /// The password for login in clear text + /// The user name for login + /// Cancellation Token to cancel the request. + /// The password for login in clear text + /// Cancellation Token to cancel the request. /// Task of ApiResponse (string) - System.Threading.Tasks.Task> LoginUserAsyncWithHttpInfo (string username, string password); + System.Threading.Tasks.Task> LoginUserAsyncWithHttpInfo (string username, string password, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Logs out current logged in user session /// @@ -342,7 +356,7 @@ public interface IUserApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// Task of void - System.Threading.Tasks.Task LogoutUserAsync (); + System.Threading.Tasks.Task LogoutUserAsync (System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Logs out current logged in user session @@ -352,7 +366,7 @@ public interface IUserApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// Task of ApiResponse - System.Threading.Tasks.Task> LogoutUserAsyncWithHttpInfo (); + System.Threading.Tasks.Task> LogoutUserAsyncWithHttpInfo (System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Updated user /// @@ -361,9 +375,11 @@ public interface IUserApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// name that need to be deleted + /// Cancellation Token to cancel the request. /// Updated user object + /// Cancellation Token to cancel the request. /// Task of void - System.Threading.Tasks.Task UpdateUserAsync (string username, User body); + System.Threading.Tasks.Task UpdateUserAsync (string username, User body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Updated user @@ -372,10 +388,12 @@ public interface IUserApiAsync : IApiAccessor /// This can only be done by the logged in user. /// /// Thrown when fails to make API call - /// name that need to be deleted - /// Updated user object + /// name that need to be deleted + /// Cancellation Token to cancel the request. + /// Updated user object + /// Cancellation Token to cancel the request. /// Task of ApiResponse - System.Threading.Tasks.Task> UpdateUserAsyncWithHttpInfo (string username, User body); + System.Threading.Tasks.Task> UpdateUserAsyncWithHttpInfo (string username, User body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); #endregion Asynchronous Operations } @@ -553,11 +571,12 @@ public Org.OpenAPITools.Client.ApiResponse CreateUserWithHttpInfo (User /// Create user This can only be done by the logged in user. /// /// Thrown when fails to make API call - /// Created user object + /// Created user object + /// Cancellation Token to cancel the request. /// Task of void - public async System.Threading.Tasks.Task CreateUserAsync (User body) + public async System.Threading.Tasks.Task CreateUserAsync (User body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - await CreateUserAsyncWithHttpInfo(body); + await CreateUserAsyncWithHttpInfo(body, cancellationToken); } @@ -565,9 +584,10 @@ public async System.Threading.Tasks.Task CreateUserAsync (User body) /// Create user This can only be done by the logged in user. /// /// Thrown when fails to make API call - /// Created user object + /// Created user object + /// Cancellation Token to cancel the request. /// Task of ApiResponse - public async System.Threading.Tasks.Task> CreateUserAsyncWithHttpInfo (User body) + public async System.Threading.Tasks.Task> CreateUserAsyncWithHttpInfo (User body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // verify the required parameter 'body' is set if (body == null) @@ -595,7 +615,7 @@ public async System.Threading.Tasks.Task CreateUserAsync (User body) // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/user", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.PostAsync("/user", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { @@ -663,11 +683,12 @@ public Org.OpenAPITools.Client.ApiResponse CreateUsersWithArrayInputWith /// Creates list of users with given input array /// /// Thrown when fails to make API call - /// List of user object + /// List of user object + /// Cancellation Token to cancel the request. /// Task of void - public async System.Threading.Tasks.Task CreateUsersWithArrayInputAsync (List body) + public async System.Threading.Tasks.Task CreateUsersWithArrayInputAsync (List body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - await CreateUsersWithArrayInputAsyncWithHttpInfo(body); + await CreateUsersWithArrayInputAsyncWithHttpInfo(body, cancellationToken); } @@ -675,9 +696,10 @@ public async System.Threading.Tasks.Task CreateUsersWithArrayInputAsync (List /// Thrown when fails to make API call - /// List of user object + /// List of user object + /// Cancellation Token to cancel the request. /// Task of ApiResponse - public async System.Threading.Tasks.Task> CreateUsersWithArrayInputAsyncWithHttpInfo (List body) + public async System.Threading.Tasks.Task> CreateUsersWithArrayInputAsyncWithHttpInfo (List body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // verify the required parameter 'body' is set if (body == null) @@ -705,7 +727,7 @@ public async System.Threading.Tasks.Task CreateUsersWithArrayInputAsync (List("/user/createWithArray", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.PostAsync("/user/createWithArray", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { @@ -773,11 +795,12 @@ public Org.OpenAPITools.Client.ApiResponse CreateUsersWithListInputWithH /// Creates list of users with given input array /// /// Thrown when fails to make API call - /// List of user object + /// List of user object + /// Cancellation Token to cancel the request. /// Task of void - public async System.Threading.Tasks.Task CreateUsersWithListInputAsync (List body) + public async System.Threading.Tasks.Task CreateUsersWithListInputAsync (List body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - await CreateUsersWithListInputAsyncWithHttpInfo(body); + await CreateUsersWithListInputAsyncWithHttpInfo(body, cancellationToken); } @@ -785,9 +808,10 @@ public async System.Threading.Tasks.Task CreateUsersWithListInputAsync (List /// Thrown when fails to make API call - /// List of user object + /// List of user object + /// Cancellation Token to cancel the request. /// Task of ApiResponse - public async System.Threading.Tasks.Task> CreateUsersWithListInputAsyncWithHttpInfo (List body) + public async System.Threading.Tasks.Task> CreateUsersWithListInputAsyncWithHttpInfo (List body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // verify the required parameter 'body' is set if (body == null) @@ -815,7 +839,7 @@ public async System.Threading.Tasks.Task CreateUsersWithListInputAsync (List("/user/createWithList", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.PostAsync("/user/createWithList", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { @@ -883,11 +907,12 @@ public Org.OpenAPITools.Client.ApiResponse DeleteUserWithHttpInfo (strin /// Delete user This can only be done by the logged in user. /// /// Thrown when fails to make API call - /// The name that needs to be deleted + /// The name that needs to be deleted + /// Cancellation Token to cancel the request. /// Task of void - public async System.Threading.Tasks.Task DeleteUserAsync (string username) + public async System.Threading.Tasks.Task DeleteUserAsync (string username, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - await DeleteUserAsyncWithHttpInfo(username); + await DeleteUserAsyncWithHttpInfo(username, cancellationToken); } @@ -895,9 +920,10 @@ public async System.Threading.Tasks.Task DeleteUserAsync (string username) /// Delete user This can only be done by the logged in user. /// /// Thrown when fails to make API call - /// The name that needs to be deleted + /// The name that needs to be deleted + /// Cancellation Token to cancel the request. /// Task of ApiResponse - public async System.Threading.Tasks.Task> DeleteUserAsyncWithHttpInfo (string username) + public async System.Threading.Tasks.Task> DeleteUserAsyncWithHttpInfo (string username, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // verify the required parameter 'username' is set if (username == null) @@ -925,7 +951,7 @@ public async System.Threading.Tasks.Task DeleteUserAsync (string username) // make the HTTP request - var localVarResponse = await this.AsynchronousClient.DeleteAsync("/user/{username}", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.DeleteAsync("/user/{username}", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { @@ -996,11 +1022,12 @@ public Org.OpenAPITools.Client.ApiResponse< User > GetUserByNameWithHttpInfo (st /// Get user by user name /// /// Thrown when fails to make API call - /// The name that needs to be fetched. Use user1 for testing. + /// The name that needs to be fetched. Use user1 for testing. + /// Cancellation Token to cancel the request. /// Task of User - public async System.Threading.Tasks.Task GetUserByNameAsync (string username) + public async System.Threading.Tasks.Task GetUserByNameAsync (string username, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - Org.OpenAPITools.Client.ApiResponse localVarResponse = await GetUserByNameAsyncWithHttpInfo(username); + Org.OpenAPITools.Client.ApiResponse localVarResponse = await GetUserByNameAsyncWithHttpInfo(username, cancellationToken); return localVarResponse.Data; } @@ -1009,9 +1036,10 @@ public async System.Threading.Tasks.Task GetUserByNameAsync (string userna /// Get user by user name /// /// Thrown when fails to make API call - /// The name that needs to be fetched. Use user1 for testing. + /// The name that needs to be fetched. Use user1 for testing. + /// Cancellation Token to cancel the request. /// Task of ApiResponse (User) - public async System.Threading.Tasks.Task> GetUserByNameAsyncWithHttpInfo (string username) + public async System.Threading.Tasks.Task> GetUserByNameAsyncWithHttpInfo (string username, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // verify the required parameter 'username' is set if (username == null) @@ -1041,7 +1069,7 @@ public async System.Threading.Tasks.Task GetUserByNameAsync (string userna // make the HTTP request - var localVarResponse = await this.AsynchronousClient.GetAsync("/user/{username}", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.GetAsync("/user/{username}", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { @@ -1119,12 +1147,14 @@ public Org.OpenAPITools.Client.ApiResponse< string > LoginUserWithHttpInfo (stri /// Logs user into the system /// /// Thrown when fails to make API call - /// The user name for login - /// The password for login in clear text + /// The user name for login + /// Cancellation Token to cancel the request. + /// The password for login in clear text + /// Cancellation Token to cancel the request. /// Task of string - public async System.Threading.Tasks.Task LoginUserAsync (string username, string password) + public async System.Threading.Tasks.Task LoginUserAsync (string username, string password, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - Org.OpenAPITools.Client.ApiResponse localVarResponse = await LoginUserAsyncWithHttpInfo(username, password); + Org.OpenAPITools.Client.ApiResponse localVarResponse = await LoginUserAsyncWithHttpInfo(username, password, cancellationToken); return localVarResponse.Data; } @@ -1133,10 +1163,12 @@ public async System.Threading.Tasks.Task LoginUserAsync (string username /// Logs user into the system /// /// Thrown when fails to make API call - /// The user name for login - /// The password for login in clear text + /// The user name for login + /// Cancellation Token to cancel the request. + /// The password for login in clear text + /// Cancellation Token to cancel the request. /// Task of ApiResponse (string) - public async System.Threading.Tasks.Task> LoginUserAsyncWithHttpInfo (string username, string password) + public async System.Threading.Tasks.Task> LoginUserAsyncWithHttpInfo (string username, string password, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // verify the required parameter 'username' is set if (username == null) @@ -1171,7 +1203,7 @@ public async System.Threading.Tasks.Task LoginUserAsync (string username // make the HTTP request - var localVarResponse = await this.AsynchronousClient.GetAsync("/user/login", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.GetAsync("/user/login", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { @@ -1233,9 +1265,9 @@ public Org.OpenAPITools.Client.ApiResponse LogoutUserWithHttpInfo () /// /// Thrown when fails to make API call /// Task of void - public async System.Threading.Tasks.Task LogoutUserAsync () + public async System.Threading.Tasks.Task LogoutUserAsync (System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - await LogoutUserAsyncWithHttpInfo(); + await LogoutUserAsyncWithHttpInfo(cancellationToken); } @@ -1244,7 +1276,7 @@ public async System.Threading.Tasks.Task LogoutUserAsync () /// /// Thrown when fails to make API call /// Task of ApiResponse - public async System.Threading.Tasks.Task> LogoutUserAsyncWithHttpInfo () + public async System.Threading.Tasks.Task> LogoutUserAsyncWithHttpInfo (System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1267,7 +1299,7 @@ public async System.Threading.Tasks.Task LogoutUserAsync () // make the HTTP request - var localVarResponse = await this.AsynchronousClient.GetAsync("/user/logout", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.GetAsync("/user/logout", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { @@ -1342,12 +1374,14 @@ public Org.OpenAPITools.Client.ApiResponse UpdateUserWithHttpInfo (strin /// Updated user This can only be done by the logged in user. /// /// Thrown when fails to make API call - /// name that need to be deleted - /// Updated user object + /// name that need to be deleted + /// Cancellation Token to cancel the request. + /// Updated user object + /// Cancellation Token to cancel the request. /// Task of void - public async System.Threading.Tasks.Task UpdateUserAsync (string username, User body) + public async System.Threading.Tasks.Task UpdateUserAsync (string username, User body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - await UpdateUserAsyncWithHttpInfo(username, body); + await UpdateUserAsyncWithHttpInfo(username, body, cancellationToken); } @@ -1355,10 +1389,12 @@ public async System.Threading.Tasks.Task UpdateUserAsync (string username, User /// Updated user This can only be done by the logged in user. /// /// Thrown when fails to make API call - /// name that need to be deleted - /// Updated user object + /// name that need to be deleted + /// Cancellation Token to cancel the request. + /// Updated user object + /// Cancellation Token to cancel the request. /// Task of ApiResponse - public async System.Threading.Tasks.Task> UpdateUserAsyncWithHttpInfo (string username, User body) + public async System.Threading.Tasks.Task> UpdateUserAsyncWithHttpInfo (string username, User body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // verify the required parameter 'username' is set if (username == null) @@ -1391,7 +1427,7 @@ public async System.Threading.Tasks.Task UpdateUserAsync (string username, User // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PutAsync("/user/{username}", localVarRequestOptions, this.Configuration); + var localVarResponse = await this.AsynchronousClient.PutAsync("/user/{username}", localVarRequestOptions, this.Configuration, cancellationToken); if (this.ExceptionFactory != null) { diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Client/ApiClient.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Client/ApiClient.cs index 8c44232d59bf..f94175d7029e 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Client/ApiClient.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Client/ApiClient.cs @@ -451,7 +451,7 @@ private ApiResponse Exec(RestRequest req, IReadableConfiguration configura return result; } - private async Task> ExecAsync(RestRequest req, IReadableConfiguration configuration) + private async Task> ExecAsync(RestRequest req, IReadableConfiguration configuration, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { RestClient client = new RestClient(_baseUrl); @@ -482,7 +482,7 @@ private async Task> ExecAsync(RestRequest req, IReadableConfig InterceptRequest(req); - var response = await client.ExecuteAsync(req); + var response = await client.ExecuteAsync(req, cancellationToken); InterceptResponse(req, response); @@ -529,11 +529,12 @@ private async Task> ExecAsync(RestRequest req, IReadableConfig /// The additional request options. /// A per-request configuration object. It is assumed that any merge with /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null) + public Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { var config = configuration ?? GlobalConfiguration.Instance; - return ExecAsync(NewRequest(HttpMethod.Get, path, options, config), config); + return ExecAsync(NewRequest(HttpMethod.Get, path, options, config), config, cancellationToken); } /// @@ -543,11 +544,12 @@ public Task> GetAsync(string path, RequestOptions options, IRe /// The additional request options. /// A per-request configuration object. It is assumed that any merge with /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null) + public Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { var config = configuration ?? GlobalConfiguration.Instance; - return ExecAsync(NewRequest(HttpMethod.Post, path, options, config), config); + return ExecAsync(NewRequest(HttpMethod.Post, path, options, config), config, cancellationToken); } /// @@ -557,11 +559,12 @@ public Task> PostAsync(string path, RequestOptions options, IR /// The additional request options. /// A per-request configuration object. It is assumed that any merge with /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null) + public Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { var config = configuration ?? GlobalConfiguration.Instance; - return ExecAsync(NewRequest(HttpMethod.Put, path, options, config), config); + return ExecAsync(NewRequest(HttpMethod.Put, path, options, config), config, cancellationToken); } /// @@ -571,11 +574,12 @@ public Task> PutAsync(string path, RequestOptions options, IRe /// The additional request options. /// A per-request configuration object. It is assumed that any merge with /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null) + public Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { var config = configuration ?? GlobalConfiguration.Instance; - return ExecAsync(NewRequest(HttpMethod.Delete, path, options, config), config); + return ExecAsync(NewRequest(HttpMethod.Delete, path, options, config), config, cancellationToken); } /// @@ -585,11 +589,12 @@ public Task> DeleteAsync(string path, RequestOptions options, /// The additional request options. /// A per-request configuration object. It is assumed that any merge with /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null) + public Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { var config = configuration ?? GlobalConfiguration.Instance; - return ExecAsync(NewRequest(HttpMethod.Head, path, options, config), config); + return ExecAsync(NewRequest(HttpMethod.Head, path, options, config), config, cancellationToken); } /// @@ -599,11 +604,12 @@ public Task> HeadAsync(string path, RequestOptions options, IR /// The additional request options. /// A per-request configuration object. It is assumed that any merge with /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null) + public Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { var config = configuration ?? GlobalConfiguration.Instance; - return ExecAsync(NewRequest(HttpMethod.Options, path, options, config), config); + return ExecAsync(NewRequest(HttpMethod.Options, path, options, config), config, cancellationToken); } /// @@ -613,11 +619,12 @@ public Task> OptionsAsync(string path, RequestOptions options, /// The additional request options. /// A per-request configuration object. It is assumed that any merge with /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null) + public Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { var config = configuration ?? GlobalConfiguration.Instance; - return ExecAsync(NewRequest(HttpMethod.Patch, path, options, config), config); + return ExecAsync(NewRequest(HttpMethod.Patch, path, options, config), config, cancellationToken); } #endregion IAsynchronousClient diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Client/IAsynchronousClient.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Client/IAsynchronousClient.cs index 750cf1839362..ea7ec150cf40 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Client/IAsynchronousClient.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Client/IAsynchronousClient.cs @@ -28,9 +28,10 @@ public interface IAsynchronousClient /// The relative path to invoke. /// The request parameters to pass along to the client. /// Per-request configurable settings. + /// Cancellation Token to cancel the request. /// The return type. /// A task eventually representing the response data, decorated with - Task> GetAsync(String path, RequestOptions options, IReadableConfiguration configuration = null); + Task> GetAsync(String path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Executes a non-blocking call to some using the POST http verb. @@ -38,9 +39,10 @@ public interface IAsynchronousClient /// The relative path to invoke. /// The request parameters to pass along to the client. /// Per-request configurable settings. + /// Cancellation Token to cancel the request. /// The return type. /// A task eventually representing the response data, decorated with - Task> PostAsync(String path, RequestOptions options, IReadableConfiguration configuration = null); + Task> PostAsync(String path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Executes a non-blocking call to some using the PUT http verb. @@ -48,9 +50,10 @@ public interface IAsynchronousClient /// The relative path to invoke. /// The request parameters to pass along to the client. /// Per-request configurable settings. + /// Cancellation Token to cancel the request. /// The return type. /// A task eventually representing the response data, decorated with - Task> PutAsync(String path, RequestOptions options, IReadableConfiguration configuration = null); + Task> PutAsync(String path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Executes a non-blocking call to some using the DELETE http verb. @@ -58,9 +61,10 @@ public interface IAsynchronousClient /// The relative path to invoke. /// The request parameters to pass along to the client. /// Per-request configurable settings. + /// Cancellation Token to cancel the request. /// The return type. /// A task eventually representing the response data, decorated with - Task> DeleteAsync(String path, RequestOptions options, IReadableConfiguration configuration = null); + Task> DeleteAsync(String path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Executes a non-blocking call to some using the HEAD http verb. @@ -68,9 +72,10 @@ public interface IAsynchronousClient /// The relative path to invoke. /// The request parameters to pass along to the client. /// Per-request configurable settings. + /// Cancellation Token to cancel the request. /// The return type. /// A task eventually representing the response data, decorated with - Task> HeadAsync(String path, RequestOptions options, IReadableConfiguration configuration = null); + Task> HeadAsync(String path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Executes a non-blocking call to some using the OPTIONS http verb. @@ -78,9 +83,10 @@ public interface IAsynchronousClient /// The relative path to invoke. /// The request parameters to pass along to the client. /// Per-request configurable settings. + /// Cancellation Token to cancel the request. /// The return type. /// A task eventually representing the response data, decorated with - Task> OptionsAsync(String path, RequestOptions options, IReadableConfiguration configuration = null); + Task> OptionsAsync(String path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Executes a non-blocking call to some using the PATCH http verb. @@ -88,9 +94,10 @@ public interface IAsynchronousClient /// The relative path to invoke. /// The request parameters to pass along to the client. /// Per-request configurable settings. + /// Cancellation Token to cancel the request. /// The return type. /// A task eventually representing the response data, decorated with - Task> PatchAsync(String path, RequestOptions options, IReadableConfiguration configuration = null); + Task> PatchAsync(String path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); } } From 93159de77dbc156758bbd69402c50517b195a055 Mon Sep 17 00:00:00 2001 From: ngp-star <55133371+ngp-star@users.noreply.github.com> Date: Sun, 2 Aug 2020 21:46:25 +0530 Subject: [PATCH 110/129] fix for the issue facing spec invlolving arrayschema structure with ref (#6310) fix for the issue facing spec invlolving arrayschema structure with ref --- .../org/openapitools/codegen/languages/AbstractJavaCodegen.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java index 49823e19f8fd..bbf9a3004ac6 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java @@ -798,7 +798,7 @@ public String toDefaultValue(Schema schema) { Schema items = getSchemaItems((ArraySchema) schema); - String typeDeclaration = getTypeDeclaration(items); + String typeDeclaration = getTypeDeclaration(ModelUtils.unaliasSchema(this.openAPI, items)); Object java8obj = additionalProperties.get("java8"); if (java8obj != null) { Boolean java8 = Boolean.valueOf(java8obj.toString()); From a9576a1e2bda76ab3f90cebc938bb4d6e9ba1200 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Mon, 3 Aug 2020 10:10:47 +0800 Subject: [PATCH 111/129] fix http signaure auth in build.sbt (#7110) --- .../resources/Java/libraries/jersey2/build.sbt.mustache | 6 +++--- samples/client/petstore/java/jersey2-java8/build.sbt | 1 - .../openapi3/client/petstore/java/jersey2-java8/build.sbt | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/build.sbt.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/build.sbt.mustache index d4262ef3fdd0..db857d5ea4d2 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/build.sbt.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/build.sbt.mustache @@ -28,9 +28,9 @@ lazy val root = (project in file(".")). {{#hasOAuthMethods}} "com.github.scribejava" % "scribejava-apis" % "6.9.0" % "compile", {{/hasOAuthMethods}} - {{#hasHttpBasicMethods}} - "org.tomitribe" % "tomitribe-http-signatures" % "1.3" % "compile", - {{/hasHttpBasicMethods}} + {{#hasHttpSignatureMethods}} + "org.tomitribe" % "tomitribe-http-signatures" % "1.5" % "compile", + {{/hasHttpSignatureMethods}} {{^java8}} "com.brsanthu" % "migbase64" % "2.2", {{/java8}} diff --git a/samples/client/petstore/java/jersey2-java8/build.sbt b/samples/client/petstore/java/jersey2-java8/build.sbt index 5654b9ea09f2..51c48785bf32 100644 --- a/samples/client/petstore/java/jersey2-java8/build.sbt +++ b/samples/client/petstore/java/jersey2-java8/build.sbt @@ -18,7 +18,6 @@ lazy val root = (project in file(".")). "com.fasterxml.jackson.core" % "jackson-databind" % "2.10.4" % "compile", "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.9.10" % "compile", "com.github.scribejava" % "scribejava-apis" % "6.9.0" % "compile", - "org.tomitribe" % "tomitribe-http-signatures" % "1.3" % "compile", "javax.annotation" % "javax.annotation-api" % "1.3.2" % "compile", "junit" % "junit" % "4.13" % "test", "com.novocode" % "junit-interface" % "0.10" % "test" diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/build.sbt b/samples/openapi3/client/petstore/java/jersey2-java8/build.sbt index b5852c87ea39..c32bb9967593 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/build.sbt +++ b/samples/openapi3/client/petstore/java/jersey2-java8/build.sbt @@ -18,7 +18,7 @@ lazy val root = (project in file(".")). "com.fasterxml.jackson.core" % "jackson-databind" % "2.10.4" % "compile", "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.9.10" % "compile", "com.github.scribejava" % "scribejava-apis" % "6.9.0" % "compile", - "org.tomitribe" % "tomitribe-http-signatures" % "1.3" % "compile", + "org.tomitribe" % "tomitribe-http-signatures" % "1.5" % "compile", "javax.annotation" % "javax.annotation-api" % "1.3.2" % "compile", "junit" % "junit" % "4.13" % "test", "com.novocode" % "junit-interface" % "0.10" % "test" From 1ffe2a780adc0dcdb6bdee4035f8e59068558109 Mon Sep 17 00:00:00 2001 From: Sshnyari Date: Mon, 3 Aug 2020 15:26:40 +0200 Subject: [PATCH 112/129] [aspnetcore] Typo issues in docs and generated code (#7094) * fixed a typo issue in aspnetcore generator #4829 * solved an issue with integration tests using WebApplicationFactory * updated aspnetcore samples impacted by the change --- docs/generators/aspnetcore.md | 2 +- .../codegen/languages/AspNetCoreServerCodegen.java | 2 +- .../src/main/resources/aspnetcore/3.0/Program.mustache | 6 +++--- .../petstore/aspnetcore-3.0/src/Org.OpenAPITools/Program.cs | 6 +++--- .../petstore/aspnetcore-3.1/src/Org.OpenAPITools/Program.cs | 6 +++--- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/docs/generators/aspnetcore.md b/docs/generators/aspnetcore.md index 8117be0c67ea..c014b0793ed3 100644 --- a/docs/generators/aspnetcore.md +++ b/docs/generators/aspnetcore.md @@ -18,7 +18,7 @@ sidebar_label: aspnetcore |modelClassModifier|Model Class Modifier can be nothing or partial| |partial| |newtonsoftVersion|Version for Microsoft.AspNetCore.Mvc.NewtonsoftJson for ASP.NET Core 3.0+| |3.0.0| |operationIsAsync|Set methods to async or sync (default).| |false| -|operationModifier|Operation Modifier can be virtual, abstract or partial| |virtual| +|operationModifier|Operation Modifier can be virtual or abstract| |virtual| |operationResultTask|Set methods result to Task<>.| |false| |packageAuthors|Specifies Authors property in the .NET Core project file.| |OpenAPI| |packageCopyright|Specifies an AssemblyCopyright for the .NET Framework global assembly attributes stored in the AssemblyInfo file.| |No Copyright| diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AspNetCoreServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AspNetCoreServerCodegen.java index 1350dfc19b1d..8e94fd79c1eb 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AspNetCoreServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AspNetCoreServerCodegen.java @@ -70,7 +70,7 @@ public class AspNetCoreServerCodegen extends AbstractCSharpCodegen { protected CliOption swashbuckleVersion = new CliOption(SWASHBUCKLE_VERSION, "Swashbuckle version: 3.0.0, 4.0.0, 5.0.0"); protected CliOption aspnetCoreVersion = new CliOption(ASPNET_CORE_VERSION, "ASP.NET Core version: 3.1, 3.0, 2.2, 2.1, 2.0 (deprecated)"); private CliOption classModifier = new CliOption(CLASS_MODIFIER, "Class Modifier can be empty, abstract"); - private CliOption operationModifier = new CliOption(OPERATION_MODIFIER, "Operation Modifier can be virtual, abstract or partial"); + private CliOption operationModifier = new CliOption(OPERATION_MODIFIER, "Operation Modifier can be virtual or abstract"); private CliOption modelClassModifier = new CliOption(MODEL_CLASS_MODIFIER, "Model Class Modifier can be nothing or partial"); private boolean generateBody = true; private CliOption buildTarget = new CliOption("buildTarget", "Target to build an application or library"); diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/3.0/Program.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/3.0/Program.mustache index 3689e61e6de9..38cd18fc61f2 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/3.0/Program.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/3.0/Program.mustache @@ -14,7 +14,7 @@ namespace {{packageName}} /// public static void Main(string[] args) { - CreateWebHostBuilder(args).Build().Run(); + CreateHostBuilder(args).Build().Run(); } /// @@ -22,7 +22,7 @@ namespace {{packageName}} /// /// /// IHostBuilder - public static IHostBuilder CreateWebHostBuilder(string[] args) => + public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args) .ConfigureWebHostDefaults(webBuilder => { @@ -30,4 +30,4 @@ namespace {{packageName}} .UseUrls("http://0.0.0.0:{{#serverPort}}{{serverPort}}{{/serverPort}}{{^serverPort}}8080{{/serverPort}}/"); }); } -} \ No newline at end of file +} diff --git a/samples/server/petstore/aspnetcore-3.0/src/Org.OpenAPITools/Program.cs b/samples/server/petstore/aspnetcore-3.0/src/Org.OpenAPITools/Program.cs index 28b87acf7538..00ed16ed6758 100644 --- a/samples/server/petstore/aspnetcore-3.0/src/Org.OpenAPITools/Program.cs +++ b/samples/server/petstore/aspnetcore-3.0/src/Org.OpenAPITools/Program.cs @@ -14,7 +14,7 @@ public class Program /// public static void Main(string[] args) { - CreateWebHostBuilder(args).Build().Run(); + CreateHostBuilder(args).Build().Run(); } /// @@ -22,7 +22,7 @@ public static void Main(string[] args) /// /// /// IHostBuilder - public static IHostBuilder CreateWebHostBuilder(string[] args) => + public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args) .ConfigureWebHostDefaults(webBuilder => { @@ -30,4 +30,4 @@ public static IHostBuilder CreateWebHostBuilder(string[] args) => .UseUrls("http://0.0.0.0:8080/"); }); } -} \ No newline at end of file +} diff --git a/samples/server/petstore/aspnetcore-3.1/src/Org.OpenAPITools/Program.cs b/samples/server/petstore/aspnetcore-3.1/src/Org.OpenAPITools/Program.cs index 28b87acf7538..00ed16ed6758 100644 --- a/samples/server/petstore/aspnetcore-3.1/src/Org.OpenAPITools/Program.cs +++ b/samples/server/petstore/aspnetcore-3.1/src/Org.OpenAPITools/Program.cs @@ -14,7 +14,7 @@ public class Program /// public static void Main(string[] args) { - CreateWebHostBuilder(args).Build().Run(); + CreateHostBuilder(args).Build().Run(); } /// @@ -22,7 +22,7 @@ public static void Main(string[] args) /// /// /// IHostBuilder - public static IHostBuilder CreateWebHostBuilder(string[] args) => + public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args) .ConfigureWebHostDefaults(webBuilder => { @@ -30,4 +30,4 @@ public static IHostBuilder CreateWebHostBuilder(string[] args) => .UseUrls("http://0.0.0.0:8080/"); }); } -} \ No newline at end of file +} From 1be98b4920e40c7977d9872a39be5498db141c67 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Mon, 3 Aug 2020 22:56:47 +0800 Subject: [PATCH 113/129] [PowerShell] better publishing workflow (#7114) * better publishing workflow in ps * use package name in appveyor --- .../main/resources/powershell/appveyor.mustache | 14 ++++++++++---- samples/client/petstore/powershell/appveyor.yml | 14 ++++++++++---- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/powershell/appveyor.mustache b/modules/openapi-generator/src/main/resources/powershell/appveyor.mustache index f337f619ba0c..0f70eb14ecfd 100644 --- a/modules/openapi-generator/src/main/resources/powershell/appveyor.mustache +++ b/modules/openapi-generator/src/main/resources/powershell/appveyor.mustache @@ -3,7 +3,6 @@ version: 1.0.{build} image: - Visual Studio 2017 # PS 5.x - Ubuntu # PS 6.x - - macOS # PS 6.x install: - ps: $PSVersionTable.PSVersion - ps: Install-Module Pester -Force -Scope CurrentUser @@ -15,10 +14,17 @@ test_script: $host.SetShouldExit($Result.FailedCount) exit $Result.FailedCount } +deploy_script: - ps: | - if ($env:APPVEYOR_REPO_TAG -eq $true -and $env:NuGetApiKey -ne $null) - { + if ($env:APPVEYOR_REPO_TAG -eq $true -and $env:NuGetApiKey -ne $null -and $env:APPVEYOR_BUILD_WORKER_IMAGE -eq "Visual Studio 2017") { + .\Build.ps1 choco install NuGet.CommandLine Install-PackageProvider -Name NuGet -Force - Publish-Module -NuGetApiKey $env:NuGetApiKey -Path .\ -Confirm:$False -Verbose + Publish-Module -NuGetApiKey $env:NuGetApiKey -Path .\src\{{{packageName}}}\ -Confirm:$False -Verbose + if ($LastExitCode -ne 0) { + $host.SetShouldExit($LastExitCode) + exit $LastExitCode + } else { + Write-Host "Published the PowerShell module." + } } diff --git a/samples/client/petstore/powershell/appveyor.yml b/samples/client/petstore/powershell/appveyor.yml index ec43839e3e3f..1d3959705c84 100644 --- a/samples/client/petstore/powershell/appveyor.yml +++ b/samples/client/petstore/powershell/appveyor.yml @@ -9,7 +9,6 @@ version: 1.0.{build} image: - Visual Studio 2017 # PS 5.x - Ubuntu # PS 6.x - - macOS # PS 6.x install: - ps: $PSVersionTable.PSVersion - ps: Install-Module Pester -Force -Scope CurrentUser @@ -21,10 +20,17 @@ test_script: $host.SetShouldExit($Result.FailedCount) exit $Result.FailedCount } +deploy_script: - ps: | - if ($env:APPVEYOR_REPO_TAG -eq $true -and $env:NuGetApiKey -ne $null) - { + if ($env:APPVEYOR_REPO_TAG -eq $true -and $env:NuGetApiKey -ne $null -and $env:APPVEYOR_BUILD_WORKER_IMAGE -eq "Visual Studio 2017") { + .\Build.ps1 choco install NuGet.CommandLine Install-PackageProvider -Name NuGet -Force - Publish-Module -NuGetApiKey $env:NuGetApiKey -Path .\ -Confirm:$False -Verbose + Publish-Module -NuGetApiKey $env:NuGetApiKey -Path .\src\PSPetstore\ -Confirm:$False -Verbose + if ($LastExitCode -ne 0) { + $host.SetShouldExit($LastExitCode) + exit $LastExitCode + } else { + Write-Host "Published the PowerShell module." + } } From 6a08ec59c0349ae13f51391920227a2bb3f5a68b Mon Sep 17 00:00:00 2001 From: Yuriy Belenko Date: Tue, 4 Aug 2020 01:37:37 +0300 Subject: [PATCH 114/129] [core] Add type and format properties to model of inline response (#6153) --- .../codegen/InlineModelResolver.java | 9 +++ .../codegen/InlineModelResolverTest.java | 17 ++++ .../resources/3_0/6150_model_json_inline.yaml | 79 +++++++++++++++++++ .../go-petstore/api/openapi.yaml | 3 + .../go/go-petstore-withXml/api/openapi.yaml | 3 + .../petstore/go/go-petstore/api/openapi.yaml | 3 + .../petstore/haskell-http-client/openapi.yaml | 3 + .../petstore/java/feign/api/openapi.yaml | 3 + .../java/google-api-client/api/openapi.yaml | 3 + .../petstore/java/jersey1/api/openapi.yaml | 3 + .../java/jersey2-java8/api/openapi.yaml | 3 + .../java/native-async/api/openapi.yaml | 3 + .../petstore/java/native/api/openapi.yaml | 3 + .../api/openapi.yaml | 3 + .../java/okhttp-gson/api/openapi.yaml | 3 + .../rest-assured-jackson/api/openapi.yaml | 3 + .../java/rest-assured/api/openapi.yaml | 3 + .../petstore/java/resteasy/api/openapi.yaml | 3 + .../resttemplate-withXml/api/openapi.yaml | 3 + .../java/resttemplate/api/openapi.yaml | 3 + .../java/retrofit2-play26/api/openapi.yaml | 3 + .../petstore/java/retrofit2/api/openapi.yaml | 3 + .../java/retrofit2rx2/api/openapi.yaml | 3 + .../java/retrofit2rx3/api/openapi.yaml | 3 + .../petstore/java/vertx/api/openapi.yaml | 3 + .../petstore/java/webclient/api/openapi.yaml | 3 + .../go-petstore/api/openapi.yaml | 3 + .../petstore/go/go-petstore/api/openapi.yaml | 3 + .../java/jersey2-java8/api/openapi.yaml | 4 + .../public/openapi.json | 9 ++- .../src/main/openapi/openapi.yaml | 3 + .../jaxrs-spec/src/main/openapi/openapi.yaml | 3 + .../output/multipart-v3/api/openapi.yaml | 1 + .../output/openapi-v3/api/openapi.yaml | 1 + .../api/openapi.yaml | 2 + .../output/rust-server-test/api/openapi.yaml | 1 + .../src/main/resources/openapi.yaml | 3 + 37 files changed, 204 insertions(+), 3 deletions(-) create mode 100644 modules/openapi-generator/src/test/resources/3_0/6150_model_json_inline.yaml diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/InlineModelResolver.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/InlineModelResolver.java index 9d632888f208..703c02474912 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/InlineModelResolver.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/InlineModelResolver.java @@ -621,6 +621,15 @@ private Schema modelFromProperty(OpenAPI openAPI, Schema object, String path) { XML xml = object.getXml(); Map properties = object.getProperties(); Schema model = new Schema(); + if (object.getType() != null) { + model.setType(object.getType()); + } + if (object.getFormat() != null) { + // 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()); diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/InlineModelResolverTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/InlineModelResolverTest.java index e32a45252ede..974e21d833e0 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/InlineModelResolverTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/InlineModelResolverTest.java @@ -263,6 +263,23 @@ public void testInlineResponseModel() { 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("inline_response_200"); + 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(); diff --git a/modules/openapi-generator/src/test/resources/3_0/6150_model_json_inline.yaml b/modules/openapi-generator/src/test/resources/3_0/6150_model_json_inline.yaml new file mode 100644 index 000000000000..624a7bff27a4 --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/6150_model_json_inline.yaml @@ -0,0 +1,79 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Test inline response model + description: Test inline response model. + license: + name: MIT +paths: + /foobar: + get: + operationId: testOperation + description: No type property in modelJson of InlineResponse200 + responses: + 200: + description: InlineResponse200 itself. + content: + application/json: + schema: + type: object + # It is legal to use the `format` keyword for object types. The JSON schema specification explicitly allows this. + # Even if in practice most OAS authors use `format` for primitive types, it should still be allowed to use format for object types. + format: unknown + properties: + foo: + type: string + bar: + type: string + post: + operationId: testOperationPost + description: No type property in modelJson of InlineResponse200 + responses: + 400: + description: InlineResponse200 itself. + content: + application/json: + schema: + title: FooBarObject + type: object + # It is legal to use the `format` keyword for object types. The JSON schema specification explicitly allows this. + # Even if in practice most OAS authors use `format` for primitive types, it should still be allowed to use format for object types. + format: date-time + properties: + foo: + type: string +components: + schemas: + Animal: + type: object + discriminator: className + required: + - className + properties: + className: + type: string + color: + type: string + default: 'red' + Dog: + allOf: + - $ref: '#/components/schemas/Animal' + - type: object + properties: + breed: + type: string + Cat: + allOf: + - $ref: '#/components/schemas/Animal' + - type: object + properties: + declawed: + type: boolean + HugeCat: + allOf: + - $ref: '#/components/schemas/Cat' + - type: object + properties: + kind: + type: string + enum: [lions, tigers, leopards, jaguars] \ No newline at end of file diff --git a/samples/client/petstore/go-experimental/go-petstore/api/openapi.yaml b/samples/client/petstore/go-experimental/go-petstore/api/openapi.yaml index 7a47b6f9bee7..2fe0565e0a54 100644 --- a/samples/client/petstore/go-experimental/go-petstore/api/openapi.yaml +++ b/samples/client/petstore/go-experimental/go-petstore/api/openapi.yaml @@ -2090,10 +2090,12 @@ components: properties: breed: type: string + type: object Cat_allOf: properties: declawed: type: boolean + type: object BigCat_allOf: properties: kind: @@ -2103,6 +2105,7 @@ components: - leopards - jaguars type: string + type: object securitySchemes: petstore_auth: flows: diff --git a/samples/client/petstore/go/go-petstore-withXml/api/openapi.yaml b/samples/client/petstore/go/go-petstore-withXml/api/openapi.yaml index 7a47b6f9bee7..2fe0565e0a54 100644 --- a/samples/client/petstore/go/go-petstore-withXml/api/openapi.yaml +++ b/samples/client/petstore/go/go-petstore-withXml/api/openapi.yaml @@ -2090,10 +2090,12 @@ components: properties: breed: type: string + type: object Cat_allOf: properties: declawed: type: boolean + type: object BigCat_allOf: properties: kind: @@ -2103,6 +2105,7 @@ components: - leopards - jaguars type: string + type: object securitySchemes: petstore_auth: flows: diff --git a/samples/client/petstore/go/go-petstore/api/openapi.yaml b/samples/client/petstore/go/go-petstore/api/openapi.yaml index 7a47b6f9bee7..2fe0565e0a54 100644 --- a/samples/client/petstore/go/go-petstore/api/openapi.yaml +++ b/samples/client/petstore/go/go-petstore/api/openapi.yaml @@ -2090,10 +2090,12 @@ components: properties: breed: type: string + type: object Cat_allOf: properties: declawed: type: boolean + type: object BigCat_allOf: properties: kind: @@ -2103,6 +2105,7 @@ components: - leopards - jaguars type: string + type: object securitySchemes: petstore_auth: flows: diff --git a/samples/client/petstore/haskell-http-client/openapi.yaml b/samples/client/petstore/haskell-http-client/openapi.yaml index 7a47b6f9bee7..2fe0565e0a54 100644 --- a/samples/client/petstore/haskell-http-client/openapi.yaml +++ b/samples/client/petstore/haskell-http-client/openapi.yaml @@ -2090,10 +2090,12 @@ components: properties: breed: type: string + type: object Cat_allOf: properties: declawed: type: boolean + type: object BigCat_allOf: properties: kind: @@ -2103,6 +2105,7 @@ components: - leopards - jaguars type: string + type: object securitySchemes: petstore_auth: flows: diff --git a/samples/client/petstore/java/feign/api/openapi.yaml b/samples/client/petstore/java/feign/api/openapi.yaml index a49359fd348c..00cc0f2f4c26 100644 --- a/samples/client/petstore/java/feign/api/openapi.yaml +++ b/samples/client/petstore/java/feign/api/openapi.yaml @@ -2151,10 +2151,12 @@ components: properties: breed: type: string + type: object Cat_allOf: properties: declawed: type: boolean + type: object BigCat_allOf: properties: kind: @@ -2164,6 +2166,7 @@ components: - leopards - jaguars type: string + type: object securitySchemes: petstore_auth: flows: diff --git a/samples/client/petstore/java/google-api-client/api/openapi.yaml b/samples/client/petstore/java/google-api-client/api/openapi.yaml index a49359fd348c..00cc0f2f4c26 100644 --- a/samples/client/petstore/java/google-api-client/api/openapi.yaml +++ b/samples/client/petstore/java/google-api-client/api/openapi.yaml @@ -2151,10 +2151,12 @@ components: properties: breed: type: string + type: object Cat_allOf: properties: declawed: type: boolean + type: object BigCat_allOf: properties: kind: @@ -2164,6 +2166,7 @@ components: - leopards - jaguars type: string + type: object securitySchemes: petstore_auth: flows: diff --git a/samples/client/petstore/java/jersey1/api/openapi.yaml b/samples/client/petstore/java/jersey1/api/openapi.yaml index a49359fd348c..00cc0f2f4c26 100644 --- a/samples/client/petstore/java/jersey1/api/openapi.yaml +++ b/samples/client/petstore/java/jersey1/api/openapi.yaml @@ -2151,10 +2151,12 @@ components: properties: breed: type: string + type: object Cat_allOf: properties: declawed: type: boolean + type: object BigCat_allOf: properties: kind: @@ -2164,6 +2166,7 @@ components: - leopards - jaguars type: string + type: object securitySchemes: petstore_auth: flows: diff --git a/samples/client/petstore/java/jersey2-java8/api/openapi.yaml b/samples/client/petstore/java/jersey2-java8/api/openapi.yaml index a49359fd348c..00cc0f2f4c26 100644 --- a/samples/client/petstore/java/jersey2-java8/api/openapi.yaml +++ b/samples/client/petstore/java/jersey2-java8/api/openapi.yaml @@ -2151,10 +2151,12 @@ components: properties: breed: type: string + type: object Cat_allOf: properties: declawed: type: boolean + type: object BigCat_allOf: properties: kind: @@ -2164,6 +2166,7 @@ components: - leopards - jaguars type: string + type: object securitySchemes: petstore_auth: flows: diff --git a/samples/client/petstore/java/native-async/api/openapi.yaml b/samples/client/petstore/java/native-async/api/openapi.yaml index a49359fd348c..00cc0f2f4c26 100644 --- a/samples/client/petstore/java/native-async/api/openapi.yaml +++ b/samples/client/petstore/java/native-async/api/openapi.yaml @@ -2151,10 +2151,12 @@ components: properties: breed: type: string + type: object Cat_allOf: properties: declawed: type: boolean + type: object BigCat_allOf: properties: kind: @@ -2164,6 +2166,7 @@ components: - leopards - jaguars type: string + type: object securitySchemes: petstore_auth: flows: diff --git a/samples/client/petstore/java/native/api/openapi.yaml b/samples/client/petstore/java/native/api/openapi.yaml index a49359fd348c..00cc0f2f4c26 100644 --- a/samples/client/petstore/java/native/api/openapi.yaml +++ b/samples/client/petstore/java/native/api/openapi.yaml @@ -2151,10 +2151,12 @@ components: properties: breed: type: string + type: object Cat_allOf: properties: declawed: type: boolean + type: object BigCat_allOf: properties: kind: @@ -2164,6 +2166,7 @@ components: - leopards - jaguars type: string + type: object securitySchemes: petstore_auth: flows: diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/api/openapi.yaml b/samples/client/petstore/java/okhttp-gson-parcelableModel/api/openapi.yaml index a49359fd348c..00cc0f2f4c26 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/api/openapi.yaml +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/api/openapi.yaml @@ -2151,10 +2151,12 @@ components: properties: breed: type: string + type: object Cat_allOf: properties: declawed: type: boolean + type: object BigCat_allOf: properties: kind: @@ -2164,6 +2166,7 @@ components: - leopards - jaguars type: string + type: object securitySchemes: petstore_auth: flows: diff --git a/samples/client/petstore/java/okhttp-gson/api/openapi.yaml b/samples/client/petstore/java/okhttp-gson/api/openapi.yaml index a49359fd348c..00cc0f2f4c26 100644 --- a/samples/client/petstore/java/okhttp-gson/api/openapi.yaml +++ b/samples/client/petstore/java/okhttp-gson/api/openapi.yaml @@ -2151,10 +2151,12 @@ components: properties: breed: type: string + type: object Cat_allOf: properties: declawed: type: boolean + type: object BigCat_allOf: properties: kind: @@ -2164,6 +2166,7 @@ components: - leopards - jaguars type: string + type: object securitySchemes: petstore_auth: flows: diff --git a/samples/client/petstore/java/rest-assured-jackson/api/openapi.yaml b/samples/client/petstore/java/rest-assured-jackson/api/openapi.yaml index a49359fd348c..00cc0f2f4c26 100644 --- a/samples/client/petstore/java/rest-assured-jackson/api/openapi.yaml +++ b/samples/client/petstore/java/rest-assured-jackson/api/openapi.yaml @@ -2151,10 +2151,12 @@ components: properties: breed: type: string + type: object Cat_allOf: properties: declawed: type: boolean + type: object BigCat_allOf: properties: kind: @@ -2164,6 +2166,7 @@ components: - leopards - jaguars type: string + type: object securitySchemes: petstore_auth: flows: diff --git a/samples/client/petstore/java/rest-assured/api/openapi.yaml b/samples/client/petstore/java/rest-assured/api/openapi.yaml index a49359fd348c..00cc0f2f4c26 100644 --- a/samples/client/petstore/java/rest-assured/api/openapi.yaml +++ b/samples/client/petstore/java/rest-assured/api/openapi.yaml @@ -2151,10 +2151,12 @@ components: properties: breed: type: string + type: object Cat_allOf: properties: declawed: type: boolean + type: object BigCat_allOf: properties: kind: @@ -2164,6 +2166,7 @@ components: - leopards - jaguars type: string + type: object securitySchemes: petstore_auth: flows: diff --git a/samples/client/petstore/java/resteasy/api/openapi.yaml b/samples/client/petstore/java/resteasy/api/openapi.yaml index a49359fd348c..00cc0f2f4c26 100644 --- a/samples/client/petstore/java/resteasy/api/openapi.yaml +++ b/samples/client/petstore/java/resteasy/api/openapi.yaml @@ -2151,10 +2151,12 @@ components: properties: breed: type: string + type: object Cat_allOf: properties: declawed: type: boolean + type: object BigCat_allOf: properties: kind: @@ -2164,6 +2166,7 @@ components: - leopards - jaguars type: string + type: object securitySchemes: petstore_auth: flows: diff --git a/samples/client/petstore/java/resttemplate-withXml/api/openapi.yaml b/samples/client/petstore/java/resttemplate-withXml/api/openapi.yaml index a49359fd348c..00cc0f2f4c26 100644 --- a/samples/client/petstore/java/resttemplate-withXml/api/openapi.yaml +++ b/samples/client/petstore/java/resttemplate-withXml/api/openapi.yaml @@ -2151,10 +2151,12 @@ components: properties: breed: type: string + type: object Cat_allOf: properties: declawed: type: boolean + type: object BigCat_allOf: properties: kind: @@ -2164,6 +2166,7 @@ components: - leopards - jaguars type: string + type: object securitySchemes: petstore_auth: flows: diff --git a/samples/client/petstore/java/resttemplate/api/openapi.yaml b/samples/client/petstore/java/resttemplate/api/openapi.yaml index a49359fd348c..00cc0f2f4c26 100644 --- a/samples/client/petstore/java/resttemplate/api/openapi.yaml +++ b/samples/client/petstore/java/resttemplate/api/openapi.yaml @@ -2151,10 +2151,12 @@ components: properties: breed: type: string + type: object Cat_allOf: properties: declawed: type: boolean + type: object BigCat_allOf: properties: kind: @@ -2164,6 +2166,7 @@ components: - leopards - jaguars type: string + type: object securitySchemes: petstore_auth: flows: diff --git a/samples/client/petstore/java/retrofit2-play26/api/openapi.yaml b/samples/client/petstore/java/retrofit2-play26/api/openapi.yaml index a49359fd348c..00cc0f2f4c26 100644 --- a/samples/client/petstore/java/retrofit2-play26/api/openapi.yaml +++ b/samples/client/petstore/java/retrofit2-play26/api/openapi.yaml @@ -2151,10 +2151,12 @@ components: properties: breed: type: string + type: object Cat_allOf: properties: declawed: type: boolean + type: object BigCat_allOf: properties: kind: @@ -2164,6 +2166,7 @@ components: - leopards - jaguars type: string + type: object securitySchemes: petstore_auth: flows: diff --git a/samples/client/petstore/java/retrofit2/api/openapi.yaml b/samples/client/petstore/java/retrofit2/api/openapi.yaml index a49359fd348c..00cc0f2f4c26 100644 --- a/samples/client/petstore/java/retrofit2/api/openapi.yaml +++ b/samples/client/petstore/java/retrofit2/api/openapi.yaml @@ -2151,10 +2151,12 @@ components: properties: breed: type: string + type: object Cat_allOf: properties: declawed: type: boolean + type: object BigCat_allOf: properties: kind: @@ -2164,6 +2166,7 @@ components: - leopards - jaguars type: string + type: object securitySchemes: petstore_auth: flows: diff --git a/samples/client/petstore/java/retrofit2rx2/api/openapi.yaml b/samples/client/petstore/java/retrofit2rx2/api/openapi.yaml index a49359fd348c..00cc0f2f4c26 100644 --- a/samples/client/petstore/java/retrofit2rx2/api/openapi.yaml +++ b/samples/client/petstore/java/retrofit2rx2/api/openapi.yaml @@ -2151,10 +2151,12 @@ components: properties: breed: type: string + type: object Cat_allOf: properties: declawed: type: boolean + type: object BigCat_allOf: properties: kind: @@ -2164,6 +2166,7 @@ components: - leopards - jaguars type: string + type: object securitySchemes: petstore_auth: flows: diff --git a/samples/client/petstore/java/retrofit2rx3/api/openapi.yaml b/samples/client/petstore/java/retrofit2rx3/api/openapi.yaml index a49359fd348c..00cc0f2f4c26 100644 --- a/samples/client/petstore/java/retrofit2rx3/api/openapi.yaml +++ b/samples/client/petstore/java/retrofit2rx3/api/openapi.yaml @@ -2151,10 +2151,12 @@ components: properties: breed: type: string + type: object Cat_allOf: properties: declawed: type: boolean + type: object BigCat_allOf: properties: kind: @@ -2164,6 +2166,7 @@ components: - leopards - jaguars type: string + type: object securitySchemes: petstore_auth: flows: diff --git a/samples/client/petstore/java/vertx/api/openapi.yaml b/samples/client/petstore/java/vertx/api/openapi.yaml index a49359fd348c..00cc0f2f4c26 100644 --- a/samples/client/petstore/java/vertx/api/openapi.yaml +++ b/samples/client/petstore/java/vertx/api/openapi.yaml @@ -2151,10 +2151,12 @@ components: properties: breed: type: string + type: object Cat_allOf: properties: declawed: type: boolean + type: object BigCat_allOf: properties: kind: @@ -2164,6 +2166,7 @@ components: - leopards - jaguars type: string + type: object securitySchemes: petstore_auth: flows: diff --git a/samples/client/petstore/java/webclient/api/openapi.yaml b/samples/client/petstore/java/webclient/api/openapi.yaml index a49359fd348c..00cc0f2f4c26 100644 --- a/samples/client/petstore/java/webclient/api/openapi.yaml +++ b/samples/client/petstore/java/webclient/api/openapi.yaml @@ -2151,10 +2151,12 @@ components: properties: breed: type: string + type: object Cat_allOf: properties: declawed: type: boolean + type: object BigCat_allOf: properties: kind: @@ -2164,6 +2166,7 @@ components: - leopards - jaguars type: string + type: object securitySchemes: petstore_auth: flows: diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/api/openapi.yaml b/samples/openapi3/client/petstore/go-experimental/go-petstore/api/openapi.yaml index 7e77947b7a74..4bb7abdc3927 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/api/openapi.yaml +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/api/openapi.yaml @@ -1999,6 +1999,7 @@ components: properties: string: $ref: '#/components/schemas/Foo' + type: object inline_object: properties: name: @@ -2138,10 +2139,12 @@ components: properties: breed: type: string + type: object Cat_allOf: properties: declawed: type: boolean + type: object securitySchemes: petstore_auth: flows: diff --git a/samples/openapi3/client/petstore/go/go-petstore/api/openapi.yaml b/samples/openapi3/client/petstore/go/go-petstore/api/openapi.yaml index af7148414b93..51e7c2432841 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/api/openapi.yaml +++ b/samples/openapi3/client/petstore/go/go-petstore/api/openapi.yaml @@ -1920,6 +1920,7 @@ components: properties: string: $ref: '#/components/schemas/Foo' + type: object inline_object: properties: name: @@ -2059,10 +2060,12 @@ components: properties: breed: type: string + type: object Cat_allOf: properties: declawed: type: boolean + type: object securitySchemes: petstore_auth: flows: diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/api/openapi.yaml b/samples/openapi3/client/petstore/java/jersey2-java8/api/openapi.yaml index 373650648fe1..e09549a0c3d6 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/api/openapi.yaml +++ b/samples/openapi3/client/petstore/java/jersey2-java8/api/openapi.yaml @@ -2249,6 +2249,7 @@ components: properties: string: $ref: '#/components/schemas/Foo' + type: object inline_object: properties: name: @@ -2390,14 +2391,17 @@ components: properties: breed: type: string + type: object Cat_allOf: properties: declawed: type: boolean + type: object ChildCat_allOf: properties: name: type: string + type: object securitySchemes: petstore_auth: flows: diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/public/openapi.json b/samples/server/petstore/java-play-framework-fake-endpoints/public/openapi.json index ebe044bed921..f5f2da4a9437 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/public/openapi.json +++ b/samples/server/petstore/java-play-framework-fake-endpoints/public/openapi.json @@ -2831,14 +2831,16 @@ "breed" : { "type" : "string" } - } + }, + "type" : "object" }, "Cat_allOf" : { "properties" : { "declawed" : { "type" : "boolean" } - } + }, + "type" : "object" }, "BigCat_allOf" : { "properties" : { @@ -2846,7 +2848,8 @@ "enum" : [ "lions", "tigers", "leopards", "jaguars" ], "type" : "string" } - } + }, + "type" : "object" } }, "securitySchemes" : { diff --git a/samples/server/petstore/jaxrs-spec-interface/src/main/openapi/openapi.yaml b/samples/server/petstore/jaxrs-spec-interface/src/main/openapi/openapi.yaml index da95378bbc81..7d1bd12ec826 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/main/openapi/openapi.yaml +++ b/samples/server/petstore/jaxrs-spec-interface/src/main/openapi/openapi.yaml @@ -2225,10 +2225,12 @@ components: properties: breed: type: string + type: object Cat_allOf: properties: declawed: type: boolean + type: object BigCat_allOf: properties: kind: @@ -2238,6 +2240,7 @@ components: - leopards - jaguars type: string + type: object securitySchemes: petstore_auth: flows: diff --git a/samples/server/petstore/jaxrs-spec/src/main/openapi/openapi.yaml b/samples/server/petstore/jaxrs-spec/src/main/openapi/openapi.yaml index da95378bbc81..7d1bd12ec826 100644 --- a/samples/server/petstore/jaxrs-spec/src/main/openapi/openapi.yaml +++ b/samples/server/petstore/jaxrs-spec/src/main/openapi/openapi.yaml @@ -2225,10 +2225,12 @@ components: properties: breed: type: string + type: object Cat_allOf: properties: declawed: type: boolean + type: object BigCat_allOf: properties: kind: @@ -2238,6 +2240,7 @@ components: - leopards - jaguars type: string + type: object securitySchemes: petstore_auth: flows: diff --git a/samples/server/petstore/rust-server/output/multipart-v3/api/openapi.yaml b/samples/server/petstore/rust-server/output/multipart-v3/api/openapi.yaml index cc003383b966..a1a58c5e69c4 100644 --- a/samples/server/petstore/rust-server/output/multipart-v3/api/openapi.yaml +++ b/samples/server/petstore/rust-server/output/multipart-v3/api/openapi.yaml @@ -132,4 +132,5 @@ components: type: array required: - field_a + type: object diff --git a/samples/server/petstore/rust-server/output/openapi-v3/api/openapi.yaml b/samples/server/petstore/rust-server/output/openapi-v3/api/openapi.yaml index 907d126e3dad..984374b520a5 100644 --- a/samples/server/petstore/rust-server/output/openapi-v3/api/openapi.yaml +++ b/samples/server/petstore/rust-server/output/openapi-v3/api/openapi.yaml @@ -606,6 +606,7 @@ components: properties: foo: type: string + type: object securitySchemes: authScheme: flows: diff --git a/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/api/openapi.yaml b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/api/openapi.yaml index 27f96b0bef1a..02f3dc603a4b 100644 --- a/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/api/openapi.yaml +++ b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/api/openapi.yaml @@ -1565,10 +1565,12 @@ components: properties: breed: type: string + type: object Cat_allOf: properties: declawed: type: boolean + type: object securitySchemes: petstore_auth: flows: diff --git a/samples/server/petstore/rust-server/output/rust-server-test/api/openapi.yaml b/samples/server/petstore/rust-server/output/rust-server-test/api/openapi.yaml index 276349f7a0e7..59a9a76b8877 100644 --- a/samples/server/petstore/rust-server/output/rust-server-test/api/openapi.yaml +++ b/samples/server/petstore/rust-server/output/rust-server-test/api/openapi.yaml @@ -211,4 +211,5 @@ components: type: integer required: - required_thing + type: object diff --git a/samples/server/petstore/springboot-reactive/src/main/resources/openapi.yaml b/samples/server/petstore/springboot-reactive/src/main/resources/openapi.yaml index da95378bbc81..7d1bd12ec826 100644 --- a/samples/server/petstore/springboot-reactive/src/main/resources/openapi.yaml +++ b/samples/server/petstore/springboot-reactive/src/main/resources/openapi.yaml @@ -2225,10 +2225,12 @@ components: properties: breed: type: string + type: object Cat_allOf: properties: declawed: type: boolean + type: object BigCat_allOf: properties: kind: @@ -2238,6 +2240,7 @@ components: - leopards - jaguars type: string + type: object securitySchemes: petstore_auth: flows: From 7a846a193ab129dbdadcfbce90572c0a044efcaf Mon Sep 17 00:00:00 2001 From: Jim Schubert Date: Mon, 3 Aug 2020 21:16:47 -0400 Subject: [PATCH 115/129] [bug][core] Copy all attributes (not properties) on composed schemas when flattening models (#7106) --- .../codegen/InlineModelResolver.java | 75 ++++++-- .../codegen/InlineModelResolverTest.java | 108 +++++++++++ .../test/resources/2_0/regression_6905.yaml | 172 ++++++++++++++++++ .../api/openapi.yaml | 2 + 4 files changed, 344 insertions(+), 13 deletions(-) create mode 100644 modules/openapi-generator/src/test/resources/2_0/regression_6905.yaml diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/InlineModelResolver.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/InlineModelResolver.java index 703c02474912..4a9a163f8c37 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/InlineModelResolver.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/InlineModelResolver.java @@ -17,6 +17,10 @@ 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; @@ -25,6 +29,7 @@ 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.apache.commons.lang3.StringUtils; import org.openapitools.codegen.utils.ModelUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -36,6 +41,17 @@ public class InlineModelResolver { private OpenAPI openapi; private Map addedModels = new HashMap(); private Map generatedSignature = new HashMap(); + + // structure mapper sorts properties alphabetically on write to ensure models are + // serialized consistently for lookup of existing models + private static ObjectMapper structureMapper; + + static { + structureMapper = Json.mapper().copy(); + structureMapper.configure(MapperFeature.SORT_PROPERTIES_ALPHABETICALLY, true); + structureMapper.writer(new DefaultPrettyPrinter()); + } + static Logger LOGGER = LoggerFactory.getLogger(InlineModelResolver.class); void flatten(OpenAPI openapi) { @@ -488,15 +504,25 @@ private String resolveModelName(String title, String key) { } private String matchGenerated(Schema model) { - String json = Json.pretty(model); - if (generatedSignature.containsKey(json)) { - return generatedSignature.get(json); + 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) { - generatedSignature.put(Json.pretty(model), name); + try { + String json = structureMapper.writeValueAsString(model); + generatedSignature.put(json, name); + } catch (JsonProcessingException e) { + e.printStackTrace(); + } } /** @@ -620,22 +646,45 @@ private Schema modelFromProperty(OpenAPI openAPI, Schema object, String path) { } 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(); - if (object.getType() != null) { - model.setType(object.getType()); - } - if (object.getFormat() != null) { - // 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.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.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()); + model.setExample(object.getExample()); + model.setDeprecated(object.getDeprecated()); + if (properties != null) { flattenProperties(openAPI, properties, path); model.setProperties(properties); diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/InlineModelResolverTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/InlineModelResolverTest.java index 974e21d833e0..e612f985de3c 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/InlineModelResolverTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/InlineModelResolverTest.java @@ -785,6 +785,109 @@ public void objectComposedWithInline() { 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"); @@ -888,4 +991,9 @@ public void callbacks() { assertTrue(properties.get("action") instanceof StringSchema); assertTrue(properties.get("data") instanceof StringSchema); } + + @Test + public void regresssion_6905() { + + } } \ No newline at end of file diff --git a/modules/openapi-generator/src/test/resources/2_0/regression_6905.yaml b/modules/openapi-generator/src/test/resources/2_0/regression_6905.yaml new file mode 100644 index 000000000000..5a750ae1dd3c --- /dev/null +++ b/modules/openapi-generator/src/test/resources/2_0/regression_6905.yaml @@ -0,0 +1,172 @@ +swagger: '2.0' + +info: + title: Test Command model generation + description: Test Command model generation + version: 1.0.0 +definitions: + PartyType: + description: type + type: string + enum: + - customer + - contact + + CustomerType: + description: type + type: string + enum: + - person + - organization + + Entity: + type: object + properties: + id: + type: string + readOnly: true + + Party: + allOf: + - $ref: '#/definitions/Entity' + - type: object + discriminator: party_type + required: + - party_type + properties: + party_type: + readOnly: true + $ref: '#/definitions/PartyType' + tax_id_number: + type: string + + Contact: + x-discriminator-value: contact + allOf: + - $ref: '#/definitions/Party' + - type: object + properties: + first_name: + type: string + last_name: + type: string + suffix: + type: string + dob: + type: string + format: date + + Customer: + x-discriminator-value: customer + allOf: + - $ref: '#/definitions/Party' + - type: object + discriminator: customer_type + required: + - customer_type + properties: + customer_type: + readOnly: true + $ref: '#/definitions/CustomerType' + customer_num: + type: string + external_customer_num: + type: string + Person: + x-discriminator-value: person + allOf: + - $ref: '#/definitions/Customer' + - type: object + properties: + first_name: + type: string + last_name: + type: string + + Organization: + x-discriminator-value: organization + allOf: + - $ref: '#/definitions/Customer' + - type: object + required: + - organization_name + properties: + organization_name: + type: string + + ApiError: + type: object + required: + - code + - message + properties: + code: + type: string + readOnly: true + message: + type: string + readOnly: true + +paths: + /customers: + get: + consumes: [] + operationId: queryCustomers + tags: + - Customer + summary: Get customers + responses: + 200: + description: Success + schema: + type: array + items: + $ref: '#/definitions/Customer' + 400: + description: Bad request. + schema: + $ref: '#/definitions/ApiError' + default: + description: Unknown error. + schema: + $ref: '#/definitions/ApiError' + /contacts: + get: + consumes: [] + operationId: queryContacts + tags: + - Contact + summary: Get contact + responses: + 200: + description: Success + schema: + type: array + items: + $ref: '#/definitions/Contact' + 400: + description: Bad request. + schema: + $ref: '#/definitions/ApiError' + default: + description: Unknown error. + schema: + $ref: '#/definitions/ApiError' + /parties: + get: + consumes: [] + responses: + 200: + description: Success + schema: + type: array + items: + $ref: '#/definitions/Party' + 400: + description: Bad request. + schema: + $ref: '#/definitions/ApiError' + default: + description: Unknown error. + schema: + $ref: '#/definitions/ApiError' diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/api/openapi.yaml b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/api/openapi.yaml index 44c6a2aa3c4a..748bc1b78edf 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/api/openapi.yaml +++ b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/api/openapi.yaml @@ -46,8 +46,10 @@ components: properties: prop1: type: string + type: object MySchemaName___Characters_allOf: properties: prop2: type: string + type: object From 34f0d02f388f44b297580cf98235c4f2bc0bbcaf Mon Sep 17 00:00:00 2001 From: mikesaurus <64160787+mikesaurus@users.noreply.github.com> Date: Mon, 3 Aug 2020 21:52:16 -0400 Subject: [PATCH 116/129] ISSUE-4222: Prevent conflicts with accept(s) local variables in generated Java RestTemplate ApiClient (#7101) * ISSUE-4222: Change accept(s) to localVarAccept(s) in Java/resttemplate/api.mustache * ISSUE-4222: Regenerate samples --- .../Java/libraries/resttemplate/api.mustache | 10 +- .../client/api/AnotherFakeApi.java | 10 +- .../org/openapitools/client/api/FakeApi.java | 122 +++++++++--------- .../client/api/FakeClassnameTags123Api.java | 10 +- .../org/openapitools/client/api/PetApi.java | 82 ++++++------ .../org/openapitools/client/api/StoreApi.java | 38 +++--- .../org/openapitools/client/api/UserApi.java | 68 +++++----- .../client/api/AnotherFakeApi.java | 10 +- .../org/openapitools/client/api/FakeApi.java | 122 +++++++++--------- .../client/api/FakeClassnameTags123Api.java | 10 +- .../org/openapitools/client/api/PetApi.java | 82 ++++++------ .../org/openapitools/client/api/StoreApi.java | 38 +++--- .../org/openapitools/client/api/UserApi.java | 68 +++++----- 13 files changed, 335 insertions(+), 335 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/api.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/api.mustache index c139c9b534ff..0ac5c6df7534 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/api.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/api.mustache @@ -134,19 +134,19 @@ public class {{classname}} { formParams.{{^collectionFormat}}add{{/collectionFormat}}{{#collectionFormat}}put{{/collectionFormat}}("{{baseName}}", {{#isFile}}{{^collectionFormat}}{{#useAbstractionForFiles}}{{paramName}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}new FileSystemResource({{paramName}}){{/useAbstractionForFiles}}{{/collectionFormat}}{{/isFile}}{{#isFile}}{{#collectionFormat}}{{paramName}}.stream(){{^useAbstractionForFiles}}.map(FileSystemResource::new){{/useAbstractionForFiles}}.collect(Collectors.toList()){{/collectionFormat}}{{/isFile}}{{^isFile}}{{paramName}}{{/isFile}});{{#hasMore}} {{/hasMore}}{{/formParams}}{{/hasFormParams}} - final String[] accepts = { {{#hasProduces}} + final String[] localVarAccepts = { {{#hasProduces}} {{#produces}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/produces}} - {{/hasProduces}}}; - final List accept = apiClient.selectHeaderAccept(accepts); + {{/hasProduces}} }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); final String[] contentTypes = { {{#hasConsumes}} {{#consumes}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/consumes}} - {{/hasConsumes}}}; + {{/hasConsumes}} }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { {{#authMethods}}"{{name}}"{{#hasMore}}, {{/hasMore}}{{/authMethods}} }; {{#returnType}}ParameterizedTypeReference<{{{returnType}}}> returnType = new ParameterizedTypeReference<{{{returnType}}}>() {};{{/returnType}}{{^returnType}}ParameterizedTypeReference returnType = new ParameterizedTypeReference() {};{{/returnType}} - return apiClient.invokeAPI(path, HttpMethod.{{httpMethod}}, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); + return apiClient.invokeAPI(path, HttpMethod.{{httpMethod}}, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, contentType, authNames, returnType); } {{/operation}} } diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/AnotherFakeApi.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/AnotherFakeApi.java index 0e9eaf39cd4b..3e5a22fd5b17 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/AnotherFakeApi.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/AnotherFakeApi.java @@ -84,18 +84,18 @@ public ResponseEntity call123testSpecialTagsWithHttpInfo(Client body) th final MultiValueMap cookieParams = new LinkedMultiValueMap(); final MultiValueMap formParams = new LinkedMultiValueMap(); - final String[] accepts = { + final String[] localVarAccepts = { "application/json" - }; - final List accept = apiClient.selectHeaderAccept(accepts); + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); final String[] contentTypes = { "application/json" - }; + }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { }; ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI(path, HttpMethod.PATCH, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); + return apiClient.invokeAPI(path, HttpMethod.PATCH, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, contentType, authNames, returnType); } } diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/FakeApi.java index e3fda6c1ee12..ecddc96ba23d 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/FakeApi.java @@ -91,17 +91,17 @@ public ResponseEntity createXmlItemWithHttpInfo(XmlItem xmlItem) throws Re final MultiValueMap cookieParams = new LinkedMultiValueMap(); final MultiValueMap formParams = new LinkedMultiValueMap(); - final String[] accepts = { }; - final List accept = apiClient.selectHeaderAccept(accepts); + final String[] localVarAccepts = { }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); final String[] contentTypes = { "application/xml", "application/xml; charset=utf-8", "application/xml; charset=utf-16", "text/xml", "text/xml; charset=utf-8", "text/xml; charset=utf-16" - }; + }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { }; ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); + return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, contentType, authNames, returnType); } /** * @@ -133,17 +133,17 @@ public ResponseEntity fakeOuterBooleanSerializeWithHttpInfo(Boolean bod final MultiValueMap cookieParams = new LinkedMultiValueMap(); final MultiValueMap formParams = new LinkedMultiValueMap(); - final String[] accepts = { + final String[] localVarAccepts = { "*/*" - }; - final List accept = apiClient.selectHeaderAccept(accepts); - final String[] contentTypes = { }; + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] contentTypes = { }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { }; ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); + return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, contentType, authNames, returnType); } /** * @@ -175,17 +175,17 @@ public ResponseEntity fakeOuterCompositeSerializeWithHttpInfo(Ou final MultiValueMap cookieParams = new LinkedMultiValueMap(); final MultiValueMap formParams = new LinkedMultiValueMap(); - final String[] accepts = { + final String[] localVarAccepts = { "*/*" - }; - final List accept = apiClient.selectHeaderAccept(accepts); - final String[] contentTypes = { }; + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] contentTypes = { }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { }; ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); + return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, contentType, authNames, returnType); } /** * @@ -217,17 +217,17 @@ public ResponseEntity fakeOuterNumberSerializeWithHttpInfo(BigDecima final MultiValueMap cookieParams = new LinkedMultiValueMap(); final MultiValueMap formParams = new LinkedMultiValueMap(); - final String[] accepts = { + final String[] localVarAccepts = { "*/*" - }; - final List accept = apiClient.selectHeaderAccept(accepts); - final String[] contentTypes = { }; + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] contentTypes = { }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { }; ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); + return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, contentType, authNames, returnType); } /** * @@ -259,17 +259,17 @@ public ResponseEntity fakeOuterStringSerializeWithHttpInfo(String body) final MultiValueMap cookieParams = new LinkedMultiValueMap(); final MultiValueMap formParams = new LinkedMultiValueMap(); - final String[] accepts = { + final String[] localVarAccepts = { "*/*" - }; - final List accept = apiClient.selectHeaderAccept(accepts); - final String[] contentTypes = { }; + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] contentTypes = { }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { }; ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); + return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, contentType, authNames, returnType); } /** * @@ -305,17 +305,17 @@ public ResponseEntity testBodyWithFileSchemaWithHttpInfo(FileSchemaTestCla final MultiValueMap cookieParams = new LinkedMultiValueMap(); final MultiValueMap formParams = new LinkedMultiValueMap(); - final String[] accepts = { }; - final List accept = apiClient.selectHeaderAccept(accepts); + final String[] localVarAccepts = { }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); final String[] contentTypes = { "application/json" - }; + }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { }; ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI(path, HttpMethod.PUT, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); + return apiClient.invokeAPI(path, HttpMethod.PUT, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, contentType, authNames, returnType); } /** * @@ -360,17 +360,17 @@ public ResponseEntity testBodyWithQueryParamsWithHttpInfo(String query, Us queryParams.putAll(apiClient.parameterToMultiValueMap(null, "query", query)); - final String[] accepts = { }; - final List accept = apiClient.selectHeaderAccept(accepts); + final String[] localVarAccepts = { }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); final String[] contentTypes = { "application/json" - }; + }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { }; ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI(path, HttpMethod.PUT, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); + return apiClient.invokeAPI(path, HttpMethod.PUT, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, contentType, authNames, returnType); } /** * To test \"client\" model @@ -407,19 +407,19 @@ public ResponseEntity testClientModelWithHttpInfo(Client body) throws Re final MultiValueMap cookieParams = new LinkedMultiValueMap(); final MultiValueMap formParams = new LinkedMultiValueMap(); - final String[] accepts = { + final String[] localVarAccepts = { "application/json" - }; - final List accept = apiClient.selectHeaderAccept(accepts); + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); final String[] contentTypes = { "application/json" - }; + }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { }; ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI(path, HttpMethod.PATCH, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); + return apiClient.invokeAPI(path, HttpMethod.PATCH, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, contentType, authNames, returnType); } /** * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -527,17 +527,17 @@ public ResponseEntity testEndpointParametersWithHttpInfo(BigDecimal number if (paramCallback != null) formParams.add("callback", paramCallback); - final String[] accepts = { }; - final List accept = apiClient.selectHeaderAccept(accepts); + final String[] localVarAccepts = { }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); final String[] contentTypes = { "application/x-www-form-urlencoded" - }; + }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { "http_basic_test" }; ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); + return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, contentType, authNames, returnType); } /** * To test enum parameters @@ -599,17 +599,17 @@ public ResponseEntity testEnumParametersWithHttpInfo(List enumHead if (enumFormString != null) formParams.add("enum_form_string", enumFormString); - final String[] accepts = { }; - final List accept = apiClient.selectHeaderAccept(accepts); + final String[] localVarAccepts = { }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); final String[] contentTypes = { "application/x-www-form-urlencoded" - }; + }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { }; ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); + return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, contentType, authNames, returnType); } /** * Fake endpoint to test group parameters (optional) @@ -675,15 +675,15 @@ public ResponseEntity testGroupParametersWithHttpInfo(Integer requiredStri if (booleanGroup != null) headerParams.add("boolean_group", apiClient.parameterToString(booleanGroup)); - final String[] accepts = { }; - final List accept = apiClient.selectHeaderAccept(accepts); - final String[] contentTypes = { }; + final String[] localVarAccepts = { }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] contentTypes = { }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { }; ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI(path, HttpMethod.DELETE, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); + return apiClient.invokeAPI(path, HttpMethod.DELETE, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, contentType, authNames, returnType); } /** * test inline additionalProperties @@ -719,17 +719,17 @@ public ResponseEntity testInlineAdditionalPropertiesWithHttpInfo(Map cookieParams = new LinkedMultiValueMap(); final MultiValueMap formParams = new LinkedMultiValueMap(); - final String[] accepts = { }; - final List accept = apiClient.selectHeaderAccept(accepts); + final String[] localVarAccepts = { }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); final String[] contentTypes = { "application/json" - }; + }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { }; ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); + return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, contentType, authNames, returnType); } /** * test json serialization of form data @@ -777,17 +777,17 @@ public ResponseEntity testJsonFormDataWithHttpInfo(String param, String pa if (param2 != null) formParams.add("param2", param2); - final String[] accepts = { }; - final List accept = apiClient.selectHeaderAccept(accepts); + final String[] localVarAccepts = { }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); final String[] contentTypes = { "application/x-www-form-urlencoded" - }; + }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { }; ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); + return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, contentType, authNames, returnType); } /** * @@ -857,14 +857,14 @@ public ResponseEntity testQueryParameterCollectionFormatWithHttpInfo(List< queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("csv".toUpperCase(Locale.ROOT)), "url", url)); queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("multi".toUpperCase(Locale.ROOT)), "context", context)); - final String[] accepts = { }; - final List accept = apiClient.selectHeaderAccept(accepts); - final String[] contentTypes = { }; + final String[] localVarAccepts = { }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] contentTypes = { }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { }; ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI(path, HttpMethod.PUT, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); + return apiClient.invokeAPI(path, HttpMethod.PUT, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, contentType, authNames, returnType); } } diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java index d9c821519609..3323ceb624d6 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java @@ -84,18 +84,18 @@ public ResponseEntity testClassnameWithHttpInfo(Client body) throws Rest final MultiValueMap cookieParams = new LinkedMultiValueMap(); final MultiValueMap formParams = new LinkedMultiValueMap(); - final String[] accepts = { + final String[] localVarAccepts = { "application/json" - }; - final List accept = apiClient.selectHeaderAccept(accepts); + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); final String[] contentTypes = { "application/json" - }; + }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { "api_key_query" }; ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI(path, HttpMethod.PATCH, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); + return apiClient.invokeAPI(path, HttpMethod.PATCH, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, contentType, authNames, returnType); } } diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/PetApi.java index eac8abdc3ccd..c05271ceda23 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/PetApi.java @@ -88,17 +88,17 @@ public ResponseEntity addPetWithHttpInfo(Pet body) throws RestClientExcept final MultiValueMap cookieParams = new LinkedMultiValueMap(); final MultiValueMap formParams = new LinkedMultiValueMap(); - final String[] accepts = { }; - final List accept = apiClient.selectHeaderAccept(accepts); + final String[] localVarAccepts = { }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); final String[] contentTypes = { "application/json", "application/xml" - }; + }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { "petstore_auth" }; ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); + return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, contentType, authNames, returnType); } /** * Deletes a pet @@ -144,15 +144,15 @@ public ResponseEntity deletePetWithHttpInfo(Long petId, String apiKey) thr if (apiKey != null) headerParams.add("api_key", apiClient.parameterToString(apiKey)); - final String[] accepts = { }; - final List accept = apiClient.selectHeaderAccept(accepts); - final String[] contentTypes = { }; + final String[] localVarAccepts = { }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] contentTypes = { }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { "petstore_auth" }; ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI(path, HttpMethod.DELETE, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); + return apiClient.invokeAPI(path, HttpMethod.DELETE, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, contentType, authNames, returnType); } /** * Finds Pets by status @@ -193,17 +193,17 @@ public ResponseEntity> findPetsByStatusWithHttpInfo(List statu queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("csv".toUpperCase(Locale.ROOT)), "status", status)); - final String[] accepts = { + final String[] localVarAccepts = { "application/xml", "application/json" - }; - final List accept = apiClient.selectHeaderAccept(accepts); - final String[] contentTypes = { }; + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] contentTypes = { }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { "petstore_auth" }; ParameterizedTypeReference> returnType = new ParameterizedTypeReference>() {}; - return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); + return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, contentType, authNames, returnType); } /** * Finds Pets by tags @@ -246,17 +246,17 @@ public ResponseEntity> findPetsByTagsWithHttpInfo(Set tags) thr queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("csv".toUpperCase(Locale.ROOT)), "tags", tags)); - final String[] accepts = { + final String[] localVarAccepts = { "application/xml", "application/json" - }; - final List accept = apiClient.selectHeaderAccept(accepts); - final String[] contentTypes = { }; + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] contentTypes = { }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { "petstore_auth" }; ParameterizedTypeReference> returnType = new ParameterizedTypeReference>() {}; - return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); + return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, contentType, authNames, returnType); } /** * Find pet by ID @@ -300,17 +300,17 @@ public ResponseEntity getPetByIdWithHttpInfo(Long petId) throws RestClientE final MultiValueMap cookieParams = new LinkedMultiValueMap(); final MultiValueMap formParams = new LinkedMultiValueMap(); - final String[] accepts = { + final String[] localVarAccepts = { "application/xml", "application/json" - }; - final List accept = apiClient.selectHeaderAccept(accepts); - final String[] contentTypes = { }; + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] contentTypes = { }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { "api_key" }; ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); + return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, contentType, authNames, returnType); } /** * Update an existing pet @@ -352,17 +352,17 @@ public ResponseEntity updatePetWithHttpInfo(Pet body) throws RestClientExc final MultiValueMap cookieParams = new LinkedMultiValueMap(); final MultiValueMap formParams = new LinkedMultiValueMap(); - final String[] accepts = { }; - final List accept = apiClient.selectHeaderAccept(accepts); + final String[] localVarAccepts = { }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); final String[] contentTypes = { "application/json", "application/xml" - }; + }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { "petstore_auth" }; ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI(path, HttpMethod.PUT, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); + return apiClient.invokeAPI(path, HttpMethod.PUT, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, contentType, authNames, returnType); } /** * Updates a pet in the store with form data @@ -410,17 +410,17 @@ public ResponseEntity updatePetWithFormWithHttpInfo(Long petId, String nam if (status != null) formParams.add("status", status); - final String[] accepts = { }; - final List accept = apiClient.selectHeaderAccept(accepts); + final String[] localVarAccepts = { }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); final String[] contentTypes = { "application/x-www-form-urlencoded" - }; + }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { "petstore_auth" }; ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); + return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, contentType, authNames, returnType); } /** * uploads an image @@ -469,19 +469,19 @@ public ResponseEntity uploadFileWithHttpInfo(Long petId, Strin if (file != null) formParams.add("file", new FileSystemResource(file)); - final String[] accepts = { + final String[] localVarAccepts = { "application/json" - }; - final List accept = apiClient.selectHeaderAccept(accepts); + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); final String[] contentTypes = { "multipart/form-data" - }; + }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { "petstore_auth" }; ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); + return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, contentType, authNames, returnType); } /** * uploads an image (required) @@ -535,18 +535,18 @@ public ResponseEntity uploadFileWithRequiredFileWithHttpInfo(L if (requiredFile != null) formParams.add("requiredFile", new FileSystemResource(requiredFile)); - final String[] accepts = { + final String[] localVarAccepts = { "application/json" - }; - final List accept = apiClient.selectHeaderAccept(accepts); + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); final String[] contentTypes = { "multipart/form-data" - }; + }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { "petstore_auth" }; ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); + return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, contentType, authNames, returnType); } } diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/StoreApi.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/StoreApi.java index d2897deda183..0c72eb0aaada 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/StoreApi.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/StoreApi.java @@ -88,15 +88,15 @@ public ResponseEntity deleteOrderWithHttpInfo(String orderId) throws RestC final MultiValueMap cookieParams = new LinkedMultiValueMap(); final MultiValueMap formParams = new LinkedMultiValueMap(); - final String[] accepts = { }; - final List accept = apiClient.selectHeaderAccept(accepts); - final String[] contentTypes = { }; + final String[] localVarAccepts = { }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] contentTypes = { }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { }; ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI(path, HttpMethod.DELETE, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); + return apiClient.invokeAPI(path, HttpMethod.DELETE, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, contentType, authNames, returnType); } /** * Returns pet inventories by status @@ -126,17 +126,17 @@ public ResponseEntity> getInventoryWithHttpInfo() throws Re final MultiValueMap cookieParams = new LinkedMultiValueMap(); final MultiValueMap formParams = new LinkedMultiValueMap(); - final String[] accepts = { + final String[] localVarAccepts = { "application/json" - }; - final List accept = apiClient.selectHeaderAccept(accepts); - final String[] contentTypes = { }; + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] contentTypes = { }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { "api_key" }; ParameterizedTypeReference> returnType = new ParameterizedTypeReference>() {}; - return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); + return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, contentType, authNames, returnType); } /** * Find purchase order by ID @@ -180,17 +180,17 @@ public ResponseEntity getOrderByIdWithHttpInfo(Long orderId) throws RestC final MultiValueMap cookieParams = new LinkedMultiValueMap(); final MultiValueMap formParams = new LinkedMultiValueMap(); - final String[] accepts = { + final String[] localVarAccepts = { "application/xml", "application/json" - }; - final List accept = apiClient.selectHeaderAccept(accepts); - final String[] contentTypes = { }; + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] contentTypes = { }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { }; ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); + return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, contentType, authNames, returnType); } /** * Place an order for a pet @@ -229,16 +229,16 @@ public ResponseEntity placeOrderWithHttpInfo(Order body) throws RestClien final MultiValueMap cookieParams = new LinkedMultiValueMap(); final MultiValueMap formParams = new LinkedMultiValueMap(); - final String[] accepts = { + final String[] localVarAccepts = { "application/xml", "application/json" - }; - final List accept = apiClient.selectHeaderAccept(accepts); - final String[] contentTypes = { }; + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] contentTypes = { }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { }; ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); + return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, contentType, authNames, returnType); } } diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/UserApi.java index 7dea94d09185..cd1edb9fe6fd 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/UserApi.java @@ -83,15 +83,15 @@ public ResponseEntity createUserWithHttpInfo(User body) throws RestClientE final MultiValueMap cookieParams = new LinkedMultiValueMap(); final MultiValueMap formParams = new LinkedMultiValueMap(); - final String[] accepts = { }; - final List accept = apiClient.selectHeaderAccept(accepts); - final String[] contentTypes = { }; + final String[] localVarAccepts = { }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] contentTypes = { }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { }; ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); + return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, contentType, authNames, returnType); } /** * Creates list of users with given input array @@ -127,15 +127,15 @@ public ResponseEntity createUsersWithArrayInputWithHttpInfo(List bod final MultiValueMap cookieParams = new LinkedMultiValueMap(); final MultiValueMap formParams = new LinkedMultiValueMap(); - final String[] accepts = { }; - final List accept = apiClient.selectHeaderAccept(accepts); - final String[] contentTypes = { }; + final String[] localVarAccepts = { }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] contentTypes = { }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { }; ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); + return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, contentType, authNames, returnType); } /** * Creates list of users with given input array @@ -171,15 +171,15 @@ public ResponseEntity createUsersWithListInputWithHttpInfo(List body final MultiValueMap cookieParams = new LinkedMultiValueMap(); final MultiValueMap formParams = new LinkedMultiValueMap(); - final String[] accepts = { }; - final List accept = apiClient.selectHeaderAccept(accepts); - final String[] contentTypes = { }; + final String[] localVarAccepts = { }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] contentTypes = { }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { }; ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); + return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, contentType, authNames, returnType); } /** * Delete user @@ -220,15 +220,15 @@ public ResponseEntity deleteUserWithHttpInfo(String username) throws RestC final MultiValueMap cookieParams = new LinkedMultiValueMap(); final MultiValueMap formParams = new LinkedMultiValueMap(); - final String[] accepts = { }; - final List accept = apiClient.selectHeaderAccept(accepts); - final String[] contentTypes = { }; + final String[] localVarAccepts = { }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] contentTypes = { }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { }; ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI(path, HttpMethod.DELETE, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); + return apiClient.invokeAPI(path, HttpMethod.DELETE, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, contentType, authNames, returnType); } /** * Get user by user name @@ -272,17 +272,17 @@ public ResponseEntity getUserByNameWithHttpInfo(String username) throws Re final MultiValueMap cookieParams = new LinkedMultiValueMap(); final MultiValueMap formParams = new LinkedMultiValueMap(); - final String[] accepts = { + final String[] localVarAccepts = { "application/xml", "application/json" - }; - final List accept = apiClient.selectHeaderAccept(accepts); - final String[] contentTypes = { }; + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] contentTypes = { }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { }; ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); + return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, contentType, authNames, returnType); } /** * Logs user into the system @@ -331,17 +331,17 @@ public ResponseEntity loginUserWithHttpInfo(String username, String pass queryParams.putAll(apiClient.parameterToMultiValueMap(null, "username", username)); queryParams.putAll(apiClient.parameterToMultiValueMap(null, "password", password)); - final String[] accepts = { + final String[] localVarAccepts = { "application/xml", "application/json" - }; - final List accept = apiClient.selectHeaderAccept(accepts); - final String[] contentTypes = { }; + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] contentTypes = { }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { }; ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); + return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, contentType, authNames, returnType); } /** * Logs out current logged in user session @@ -370,15 +370,15 @@ public ResponseEntity logoutUserWithHttpInfo() throws RestClientException final MultiValueMap cookieParams = new LinkedMultiValueMap(); final MultiValueMap formParams = new LinkedMultiValueMap(); - final String[] accepts = { }; - final List accept = apiClient.selectHeaderAccept(accepts); - final String[] contentTypes = { }; + final String[] localVarAccepts = { }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] contentTypes = { }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { }; ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); + return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, contentType, authNames, returnType); } /** * Updated user @@ -426,14 +426,14 @@ public ResponseEntity updateUserWithHttpInfo(String username, User body) t final MultiValueMap cookieParams = new LinkedMultiValueMap(); final MultiValueMap formParams = new LinkedMultiValueMap(); - final String[] accepts = { }; - final List accept = apiClient.selectHeaderAccept(accepts); - final String[] contentTypes = { }; + final String[] localVarAccepts = { }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] contentTypes = { }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { }; ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI(path, HttpMethod.PUT, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); + return apiClient.invokeAPI(path, HttpMethod.PUT, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, contentType, authNames, returnType); } } diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/AnotherFakeApi.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/AnotherFakeApi.java index 0e9eaf39cd4b..3e5a22fd5b17 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/AnotherFakeApi.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/AnotherFakeApi.java @@ -84,18 +84,18 @@ public ResponseEntity call123testSpecialTagsWithHttpInfo(Client body) th final MultiValueMap cookieParams = new LinkedMultiValueMap(); final MultiValueMap formParams = new LinkedMultiValueMap(); - final String[] accepts = { + final String[] localVarAccepts = { "application/json" - }; - final List accept = apiClient.selectHeaderAccept(accepts); + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); final String[] contentTypes = { "application/json" - }; + }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { }; ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI(path, HttpMethod.PATCH, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); + return apiClient.invokeAPI(path, HttpMethod.PATCH, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, contentType, authNames, returnType); } } diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/FakeApi.java index e3fda6c1ee12..ecddc96ba23d 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/FakeApi.java @@ -91,17 +91,17 @@ public ResponseEntity createXmlItemWithHttpInfo(XmlItem xmlItem) throws Re final MultiValueMap cookieParams = new LinkedMultiValueMap(); final MultiValueMap formParams = new LinkedMultiValueMap(); - final String[] accepts = { }; - final List accept = apiClient.selectHeaderAccept(accepts); + final String[] localVarAccepts = { }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); final String[] contentTypes = { "application/xml", "application/xml; charset=utf-8", "application/xml; charset=utf-16", "text/xml", "text/xml; charset=utf-8", "text/xml; charset=utf-16" - }; + }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { }; ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); + return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, contentType, authNames, returnType); } /** * @@ -133,17 +133,17 @@ public ResponseEntity fakeOuterBooleanSerializeWithHttpInfo(Boolean bod final MultiValueMap cookieParams = new LinkedMultiValueMap(); final MultiValueMap formParams = new LinkedMultiValueMap(); - final String[] accepts = { + final String[] localVarAccepts = { "*/*" - }; - final List accept = apiClient.selectHeaderAccept(accepts); - final String[] contentTypes = { }; + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] contentTypes = { }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { }; ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); + return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, contentType, authNames, returnType); } /** * @@ -175,17 +175,17 @@ public ResponseEntity fakeOuterCompositeSerializeWithHttpInfo(Ou final MultiValueMap cookieParams = new LinkedMultiValueMap(); final MultiValueMap formParams = new LinkedMultiValueMap(); - final String[] accepts = { + final String[] localVarAccepts = { "*/*" - }; - final List accept = apiClient.selectHeaderAccept(accepts); - final String[] contentTypes = { }; + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] contentTypes = { }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { }; ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); + return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, contentType, authNames, returnType); } /** * @@ -217,17 +217,17 @@ public ResponseEntity fakeOuterNumberSerializeWithHttpInfo(BigDecima final MultiValueMap cookieParams = new LinkedMultiValueMap(); final MultiValueMap formParams = new LinkedMultiValueMap(); - final String[] accepts = { + final String[] localVarAccepts = { "*/*" - }; - final List accept = apiClient.selectHeaderAccept(accepts); - final String[] contentTypes = { }; + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] contentTypes = { }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { }; ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); + return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, contentType, authNames, returnType); } /** * @@ -259,17 +259,17 @@ public ResponseEntity fakeOuterStringSerializeWithHttpInfo(String body) final MultiValueMap cookieParams = new LinkedMultiValueMap(); final MultiValueMap formParams = new LinkedMultiValueMap(); - final String[] accepts = { + final String[] localVarAccepts = { "*/*" - }; - final List accept = apiClient.selectHeaderAccept(accepts); - final String[] contentTypes = { }; + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] contentTypes = { }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { }; ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); + return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, contentType, authNames, returnType); } /** * @@ -305,17 +305,17 @@ public ResponseEntity testBodyWithFileSchemaWithHttpInfo(FileSchemaTestCla final MultiValueMap cookieParams = new LinkedMultiValueMap(); final MultiValueMap formParams = new LinkedMultiValueMap(); - final String[] accepts = { }; - final List accept = apiClient.selectHeaderAccept(accepts); + final String[] localVarAccepts = { }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); final String[] contentTypes = { "application/json" - }; + }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { }; ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI(path, HttpMethod.PUT, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); + return apiClient.invokeAPI(path, HttpMethod.PUT, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, contentType, authNames, returnType); } /** * @@ -360,17 +360,17 @@ public ResponseEntity testBodyWithQueryParamsWithHttpInfo(String query, Us queryParams.putAll(apiClient.parameterToMultiValueMap(null, "query", query)); - final String[] accepts = { }; - final List accept = apiClient.selectHeaderAccept(accepts); + final String[] localVarAccepts = { }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); final String[] contentTypes = { "application/json" - }; + }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { }; ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI(path, HttpMethod.PUT, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); + return apiClient.invokeAPI(path, HttpMethod.PUT, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, contentType, authNames, returnType); } /** * To test \"client\" model @@ -407,19 +407,19 @@ public ResponseEntity testClientModelWithHttpInfo(Client body) throws Re final MultiValueMap cookieParams = new LinkedMultiValueMap(); final MultiValueMap formParams = new LinkedMultiValueMap(); - final String[] accepts = { + final String[] localVarAccepts = { "application/json" - }; - final List accept = apiClient.selectHeaderAccept(accepts); + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); final String[] contentTypes = { "application/json" - }; + }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { }; ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI(path, HttpMethod.PATCH, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); + return apiClient.invokeAPI(path, HttpMethod.PATCH, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, contentType, authNames, returnType); } /** * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -527,17 +527,17 @@ public ResponseEntity testEndpointParametersWithHttpInfo(BigDecimal number if (paramCallback != null) formParams.add("callback", paramCallback); - final String[] accepts = { }; - final List accept = apiClient.selectHeaderAccept(accepts); + final String[] localVarAccepts = { }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); final String[] contentTypes = { "application/x-www-form-urlencoded" - }; + }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { "http_basic_test" }; ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); + return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, contentType, authNames, returnType); } /** * To test enum parameters @@ -599,17 +599,17 @@ public ResponseEntity testEnumParametersWithHttpInfo(List enumHead if (enumFormString != null) formParams.add("enum_form_string", enumFormString); - final String[] accepts = { }; - final List accept = apiClient.selectHeaderAccept(accepts); + final String[] localVarAccepts = { }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); final String[] contentTypes = { "application/x-www-form-urlencoded" - }; + }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { }; ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); + return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, contentType, authNames, returnType); } /** * Fake endpoint to test group parameters (optional) @@ -675,15 +675,15 @@ public ResponseEntity testGroupParametersWithHttpInfo(Integer requiredStri if (booleanGroup != null) headerParams.add("boolean_group", apiClient.parameterToString(booleanGroup)); - final String[] accepts = { }; - final List accept = apiClient.selectHeaderAccept(accepts); - final String[] contentTypes = { }; + final String[] localVarAccepts = { }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] contentTypes = { }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { }; ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI(path, HttpMethod.DELETE, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); + return apiClient.invokeAPI(path, HttpMethod.DELETE, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, contentType, authNames, returnType); } /** * test inline additionalProperties @@ -719,17 +719,17 @@ public ResponseEntity testInlineAdditionalPropertiesWithHttpInfo(Map cookieParams = new LinkedMultiValueMap(); final MultiValueMap formParams = new LinkedMultiValueMap(); - final String[] accepts = { }; - final List accept = apiClient.selectHeaderAccept(accepts); + final String[] localVarAccepts = { }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); final String[] contentTypes = { "application/json" - }; + }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { }; ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); + return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, contentType, authNames, returnType); } /** * test json serialization of form data @@ -777,17 +777,17 @@ public ResponseEntity testJsonFormDataWithHttpInfo(String param, String pa if (param2 != null) formParams.add("param2", param2); - final String[] accepts = { }; - final List accept = apiClient.selectHeaderAccept(accepts); + final String[] localVarAccepts = { }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); final String[] contentTypes = { "application/x-www-form-urlencoded" - }; + }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { }; ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); + return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, contentType, authNames, returnType); } /** * @@ -857,14 +857,14 @@ public ResponseEntity testQueryParameterCollectionFormatWithHttpInfo(List< queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("csv".toUpperCase(Locale.ROOT)), "url", url)); queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("multi".toUpperCase(Locale.ROOT)), "context", context)); - final String[] accepts = { }; - final List accept = apiClient.selectHeaderAccept(accepts); - final String[] contentTypes = { }; + final String[] localVarAccepts = { }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] contentTypes = { }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { }; ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI(path, HttpMethod.PUT, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); + return apiClient.invokeAPI(path, HttpMethod.PUT, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, contentType, authNames, returnType); } } diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java index d9c821519609..3323ceb624d6 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java @@ -84,18 +84,18 @@ public ResponseEntity testClassnameWithHttpInfo(Client body) throws Rest final MultiValueMap cookieParams = new LinkedMultiValueMap(); final MultiValueMap formParams = new LinkedMultiValueMap(); - final String[] accepts = { + final String[] localVarAccepts = { "application/json" - }; - final List accept = apiClient.selectHeaderAccept(accepts); + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); final String[] contentTypes = { "application/json" - }; + }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { "api_key_query" }; ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI(path, HttpMethod.PATCH, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); + return apiClient.invokeAPI(path, HttpMethod.PATCH, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, contentType, authNames, returnType); } } diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/PetApi.java index eac8abdc3ccd..c05271ceda23 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/PetApi.java @@ -88,17 +88,17 @@ public ResponseEntity addPetWithHttpInfo(Pet body) throws RestClientExcept final MultiValueMap cookieParams = new LinkedMultiValueMap(); final MultiValueMap formParams = new LinkedMultiValueMap(); - final String[] accepts = { }; - final List accept = apiClient.selectHeaderAccept(accepts); + final String[] localVarAccepts = { }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); final String[] contentTypes = { "application/json", "application/xml" - }; + }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { "petstore_auth" }; ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); + return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, contentType, authNames, returnType); } /** * Deletes a pet @@ -144,15 +144,15 @@ public ResponseEntity deletePetWithHttpInfo(Long petId, String apiKey) thr if (apiKey != null) headerParams.add("api_key", apiClient.parameterToString(apiKey)); - final String[] accepts = { }; - final List accept = apiClient.selectHeaderAccept(accepts); - final String[] contentTypes = { }; + final String[] localVarAccepts = { }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] contentTypes = { }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { "petstore_auth" }; ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI(path, HttpMethod.DELETE, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); + return apiClient.invokeAPI(path, HttpMethod.DELETE, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, contentType, authNames, returnType); } /** * Finds Pets by status @@ -193,17 +193,17 @@ public ResponseEntity> findPetsByStatusWithHttpInfo(List statu queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("csv".toUpperCase(Locale.ROOT)), "status", status)); - final String[] accepts = { + final String[] localVarAccepts = { "application/xml", "application/json" - }; - final List accept = apiClient.selectHeaderAccept(accepts); - final String[] contentTypes = { }; + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] contentTypes = { }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { "petstore_auth" }; ParameterizedTypeReference> returnType = new ParameterizedTypeReference>() {}; - return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); + return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, contentType, authNames, returnType); } /** * Finds Pets by tags @@ -246,17 +246,17 @@ public ResponseEntity> findPetsByTagsWithHttpInfo(Set tags) thr queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("csv".toUpperCase(Locale.ROOT)), "tags", tags)); - final String[] accepts = { + final String[] localVarAccepts = { "application/xml", "application/json" - }; - final List accept = apiClient.selectHeaderAccept(accepts); - final String[] contentTypes = { }; + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] contentTypes = { }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { "petstore_auth" }; ParameterizedTypeReference> returnType = new ParameterizedTypeReference>() {}; - return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); + return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, contentType, authNames, returnType); } /** * Find pet by ID @@ -300,17 +300,17 @@ public ResponseEntity getPetByIdWithHttpInfo(Long petId) throws RestClientE final MultiValueMap cookieParams = new LinkedMultiValueMap(); final MultiValueMap formParams = new LinkedMultiValueMap(); - final String[] accepts = { + final String[] localVarAccepts = { "application/xml", "application/json" - }; - final List accept = apiClient.selectHeaderAccept(accepts); - final String[] contentTypes = { }; + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] contentTypes = { }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { "api_key" }; ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); + return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, contentType, authNames, returnType); } /** * Update an existing pet @@ -352,17 +352,17 @@ public ResponseEntity updatePetWithHttpInfo(Pet body) throws RestClientExc final MultiValueMap cookieParams = new LinkedMultiValueMap(); final MultiValueMap formParams = new LinkedMultiValueMap(); - final String[] accepts = { }; - final List accept = apiClient.selectHeaderAccept(accepts); + final String[] localVarAccepts = { }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); final String[] contentTypes = { "application/json", "application/xml" - }; + }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { "petstore_auth" }; ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI(path, HttpMethod.PUT, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); + return apiClient.invokeAPI(path, HttpMethod.PUT, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, contentType, authNames, returnType); } /** * Updates a pet in the store with form data @@ -410,17 +410,17 @@ public ResponseEntity updatePetWithFormWithHttpInfo(Long petId, String nam if (status != null) formParams.add("status", status); - final String[] accepts = { }; - final List accept = apiClient.selectHeaderAccept(accepts); + final String[] localVarAccepts = { }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); final String[] contentTypes = { "application/x-www-form-urlencoded" - }; + }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { "petstore_auth" }; ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); + return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, contentType, authNames, returnType); } /** * uploads an image @@ -469,19 +469,19 @@ public ResponseEntity uploadFileWithHttpInfo(Long petId, Strin if (file != null) formParams.add("file", new FileSystemResource(file)); - final String[] accepts = { + final String[] localVarAccepts = { "application/json" - }; - final List accept = apiClient.selectHeaderAccept(accepts); + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); final String[] contentTypes = { "multipart/form-data" - }; + }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { "petstore_auth" }; ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); + return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, contentType, authNames, returnType); } /** * uploads an image (required) @@ -535,18 +535,18 @@ public ResponseEntity uploadFileWithRequiredFileWithHttpInfo(L if (requiredFile != null) formParams.add("requiredFile", new FileSystemResource(requiredFile)); - final String[] accepts = { + final String[] localVarAccepts = { "application/json" - }; - final List accept = apiClient.selectHeaderAccept(accepts); + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); final String[] contentTypes = { "multipart/form-data" - }; + }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { "petstore_auth" }; ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); + return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, contentType, authNames, returnType); } } diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/StoreApi.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/StoreApi.java index d2897deda183..0c72eb0aaada 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/StoreApi.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/StoreApi.java @@ -88,15 +88,15 @@ public ResponseEntity deleteOrderWithHttpInfo(String orderId) throws RestC final MultiValueMap cookieParams = new LinkedMultiValueMap(); final MultiValueMap formParams = new LinkedMultiValueMap(); - final String[] accepts = { }; - final List accept = apiClient.selectHeaderAccept(accepts); - final String[] contentTypes = { }; + final String[] localVarAccepts = { }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] contentTypes = { }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { }; ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI(path, HttpMethod.DELETE, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); + return apiClient.invokeAPI(path, HttpMethod.DELETE, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, contentType, authNames, returnType); } /** * Returns pet inventories by status @@ -126,17 +126,17 @@ public ResponseEntity> getInventoryWithHttpInfo() throws Re final MultiValueMap cookieParams = new LinkedMultiValueMap(); final MultiValueMap formParams = new LinkedMultiValueMap(); - final String[] accepts = { + final String[] localVarAccepts = { "application/json" - }; - final List accept = apiClient.selectHeaderAccept(accepts); - final String[] contentTypes = { }; + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] contentTypes = { }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { "api_key" }; ParameterizedTypeReference> returnType = new ParameterizedTypeReference>() {}; - return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); + return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, contentType, authNames, returnType); } /** * Find purchase order by ID @@ -180,17 +180,17 @@ public ResponseEntity getOrderByIdWithHttpInfo(Long orderId) throws RestC final MultiValueMap cookieParams = new LinkedMultiValueMap(); final MultiValueMap formParams = new LinkedMultiValueMap(); - final String[] accepts = { + final String[] localVarAccepts = { "application/xml", "application/json" - }; - final List accept = apiClient.selectHeaderAccept(accepts); - final String[] contentTypes = { }; + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] contentTypes = { }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { }; ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); + return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, contentType, authNames, returnType); } /** * Place an order for a pet @@ -229,16 +229,16 @@ public ResponseEntity placeOrderWithHttpInfo(Order body) throws RestClien final MultiValueMap cookieParams = new LinkedMultiValueMap(); final MultiValueMap formParams = new LinkedMultiValueMap(); - final String[] accepts = { + final String[] localVarAccepts = { "application/xml", "application/json" - }; - final List accept = apiClient.selectHeaderAccept(accepts); - final String[] contentTypes = { }; + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] contentTypes = { }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { }; ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); + return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, contentType, authNames, returnType); } } diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/UserApi.java index 7dea94d09185..cd1edb9fe6fd 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/UserApi.java @@ -83,15 +83,15 @@ public ResponseEntity createUserWithHttpInfo(User body) throws RestClientE final MultiValueMap cookieParams = new LinkedMultiValueMap(); final MultiValueMap formParams = new LinkedMultiValueMap(); - final String[] accepts = { }; - final List accept = apiClient.selectHeaderAccept(accepts); - final String[] contentTypes = { }; + final String[] localVarAccepts = { }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] contentTypes = { }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { }; ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); + return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, contentType, authNames, returnType); } /** * Creates list of users with given input array @@ -127,15 +127,15 @@ public ResponseEntity createUsersWithArrayInputWithHttpInfo(List bod final MultiValueMap cookieParams = new LinkedMultiValueMap(); final MultiValueMap formParams = new LinkedMultiValueMap(); - final String[] accepts = { }; - final List accept = apiClient.selectHeaderAccept(accepts); - final String[] contentTypes = { }; + final String[] localVarAccepts = { }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] contentTypes = { }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { }; ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); + return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, contentType, authNames, returnType); } /** * Creates list of users with given input array @@ -171,15 +171,15 @@ public ResponseEntity createUsersWithListInputWithHttpInfo(List body final MultiValueMap cookieParams = new LinkedMultiValueMap(); final MultiValueMap formParams = new LinkedMultiValueMap(); - final String[] accepts = { }; - final List accept = apiClient.selectHeaderAccept(accepts); - final String[] contentTypes = { }; + final String[] localVarAccepts = { }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] contentTypes = { }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { }; ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); + return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, contentType, authNames, returnType); } /** * Delete user @@ -220,15 +220,15 @@ public ResponseEntity deleteUserWithHttpInfo(String username) throws RestC final MultiValueMap cookieParams = new LinkedMultiValueMap(); final MultiValueMap formParams = new LinkedMultiValueMap(); - final String[] accepts = { }; - final List accept = apiClient.selectHeaderAccept(accepts); - final String[] contentTypes = { }; + final String[] localVarAccepts = { }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] contentTypes = { }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { }; ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI(path, HttpMethod.DELETE, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); + return apiClient.invokeAPI(path, HttpMethod.DELETE, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, contentType, authNames, returnType); } /** * Get user by user name @@ -272,17 +272,17 @@ public ResponseEntity getUserByNameWithHttpInfo(String username) throws Re final MultiValueMap cookieParams = new LinkedMultiValueMap(); final MultiValueMap formParams = new LinkedMultiValueMap(); - final String[] accepts = { + final String[] localVarAccepts = { "application/xml", "application/json" - }; - final List accept = apiClient.selectHeaderAccept(accepts); - final String[] contentTypes = { }; + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] contentTypes = { }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { }; ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); + return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, contentType, authNames, returnType); } /** * Logs user into the system @@ -331,17 +331,17 @@ public ResponseEntity loginUserWithHttpInfo(String username, String pass queryParams.putAll(apiClient.parameterToMultiValueMap(null, "username", username)); queryParams.putAll(apiClient.parameterToMultiValueMap(null, "password", password)); - final String[] accepts = { + final String[] localVarAccepts = { "application/xml", "application/json" - }; - final List accept = apiClient.selectHeaderAccept(accepts); - final String[] contentTypes = { }; + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] contentTypes = { }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { }; ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); + return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, contentType, authNames, returnType); } /** * Logs out current logged in user session @@ -370,15 +370,15 @@ public ResponseEntity logoutUserWithHttpInfo() throws RestClientException final MultiValueMap cookieParams = new LinkedMultiValueMap(); final MultiValueMap formParams = new LinkedMultiValueMap(); - final String[] accepts = { }; - final List accept = apiClient.selectHeaderAccept(accepts); - final String[] contentTypes = { }; + final String[] localVarAccepts = { }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] contentTypes = { }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { }; ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); + return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, contentType, authNames, returnType); } /** * Updated user @@ -426,14 +426,14 @@ public ResponseEntity updateUserWithHttpInfo(String username, User body) t final MultiValueMap cookieParams = new LinkedMultiValueMap(); final MultiValueMap formParams = new LinkedMultiValueMap(); - final String[] accepts = { }; - final List accept = apiClient.selectHeaderAccept(accepts); - final String[] contentTypes = { }; + final String[] localVarAccepts = { }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] contentTypes = { }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { }; ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; - return apiClient.invokeAPI(path, HttpMethod.PUT, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); + return apiClient.invokeAPI(path, HttpMethod.PUT, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, contentType, authNames, returnType); } } From ca3fa4b9cbe4633045919a7e8600bede18f9a47d Mon Sep 17 00:00:00 2001 From: Jim Schubert Date: Mon, 3 Aug 2020 21:59:08 -0400 Subject: [PATCH 117/129] [contrib][docs] Assert importance of title/description/repro steps (#7103) --- .github/ISSUE_TEMPLATE/bug_report.md | 8 ++++++-- .github/PULL_REQUEST_TEMPLATE.md | 3 ++- CONTRIBUTING.md | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 9de7f88e09af..703f2e0373cb 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -45,9 +45,13 @@ please create a Gist (https://gist.github.com) or upload it somewhere else and link it here. --> -##### Command line used for generation +##### Generation Details - + ##### Steps to reproduce diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 27b62461d93d..cf1c0bfefa15 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -2,8 +2,9 @@ ### PR checklist - + - [ ] Read the [contribution guidelines](https://github.com/openapitools/openapi-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. - [ ] If contributing template-only or documentation-only changes which will change sample output, [build the project](https://github.com/OpenAPITools/openapi-generator#14---build-projects) beforehand. - [ ] Run the shell script `./bin/generate-samples.sh`to update all Petstore samples related to your fix. This is important, as CI jobs will verify _all_ generator outputs of your HEAD commit as it would merge with master. These must match the expectations made by your contribution. You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example `./bin/generate-samples.sh bin/configs/java*`. For Windows users, please run the script in [Git BASH](https://gitforwindows.org/). - [ ] File the PR against the [correct branch](https://github.com/OpenAPITools/openapi-generator/wiki/Git-Branches): `master` diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8fedced7329a..327f2d4f4a28 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -4,7 +4,7 @@ - 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. + - 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. - 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". From ba8a50137a440077113027957a028e0246af8532 Mon Sep 17 00:00:00 2001 From: Yuriy Belenko Date: Tue, 4 Aug 2020 05:33:10 +0300 Subject: [PATCH 118/129] [php-lumen] Set required PHP version to ^7.2.5 (#6949) * Set required PHP version to ^7.2.5 * Write .gitignore into srcBasePath * Update dependencies * Copy latest Lumen sources to templates * Add Lumen license template * Use Lumen license in templates * Fix typo in readme * Add Init App Config readme section * Add composer.lock to root gitignore * Add Travis-CI task * Set OAS 3.0 input spec file for samples * Refresh samples --- .gitignore | 3 + bin/configs/php-lumen.yaml | 2 +- .../languages/PhpLumenServerCodegen.java | 21 ++++- .../src/main/resources/php-lumen/.env.example | 6 +- .../php-lumen/AppServiceProvider.php | 1 + .../php-lumen/AuthServiceProvider.php | 1 + .../main/resources/php-lumen/Authenticate.php | 7 +- .../main/resources/php-lumen/Controller.php | 7 +- .../resources/php-lumen/DatabaseSeeder.php | 1 + .../src/main/resources/php-lumen/Event.php | 1 + .../php-lumen/EventServiceProvider.php | 5 +- .../resources/php-lumen/ExampleController.php | 1 + .../main/resources/php-lumen/ExampleEvent.php | 1 + .../main/resources/php-lumen/ExampleJob.php | 1 + .../resources/php-lumen/ExampleListener.php | 5 +- .../resources/php-lumen/ExampleMiddleware.php | 1 + .../main/resources/php-lumen/ExampleTest.php | 1 + .../src/main/resources/php-lumen/Handler.php | 31 ++++---- .../src/main/resources/php-lumen/Job.php | 5 +- .../src/main/resources/php-lumen/Kernel.php | 7 +- .../main/resources/php-lumen/ModelFactory.php | 14 +++- .../src/main/resources/php-lumen/TestCase.php | 5 +- .../src/main/resources/php-lumen/User.php | 17 ++-- .../src/main/resources/php-lumen/app.php | 36 +++++---- .../src/main/resources/php-lumen/artisan | 1 + .../resources/php-lumen/composer.mustache | 30 +++---- .../src/main/resources/php-lumen/editorconfig | 15 ++++ .../src/main/resources/php-lumen/gitignore | 14 ++-- .../src/main/resources/php-lumen/index.php | 7 +- .../resources/php-lumen/licenseInfo.mustache | 2 +- .../php-lumen/licenseInfoLumen.mustache | 3 + .../src/main/resources/php-lumen/phpunit.xml | 17 ++-- .../src/main/resources/php-lumen/readme.md | 10 ++- .../main/resources/php-lumen/routes.mustache | 14 +++- .../storage_framework_cache_gitignore | 3 + .../php-lumen/storage_logs_.gitignore | 2 - .../php-lumen/storage_logs_gitignore | 2 + .../src/main/resources/php-lumen/styleci | 6 ++ pom.xml | 1 + samples/server/petstore/php-lumen/.gitignore | 8 -- .../php-lumen/.openapi-generator/FILES | 10 ++- .../petstore/php-lumen/lib/.editorconfig | 15 ++++ .../petstore/php-lumen/lib/.env.example | 6 +- .../server/petstore/php-lumen/lib/.gitignore | 6 ++ .../petstore/php-lumen/lib/.styleci.yml | 6 ++ .../php-lumen/lib/app/Console/Kernel.php | 4 +- .../php-lumen/lib/app/Events/Event.php | 4 + .../php-lumen/lib/app/Events/ExampleEvent.php | 4 + .../php-lumen/lib/app/Exceptions/Handler.php | 28 ++++--- .../app/Http/Controllers/AnotherFakeApi.php | 8 +- .../lib/app/Http/Controllers/Controller.php | 4 +- .../lib/app/Http/Controllers/DefaultApi.php | 3 +- .../Http/Controllers/ExampleController.php | 4 + .../lib/app/Http/Controllers/FakeApi.php | 67 ++++++++++------ .../Controllers/FakeClassnameTags123Api.php | 8 +- .../lib/app/Http/Controllers/PetApi.php | 14 ++-- .../lib/app/Http/Controllers/StoreApi.php | 8 +- .../lib/app/Http/Controllers/UserApi.php | 20 ++--- .../lib/app/Http/Middleware/Authenticate.php | 6 +- .../app/Http/Middleware/ExampleMiddleware.php | 4 + .../php-lumen/lib/app/Jobs/ExampleJob.php | 4 + .../petstore/php-lumen/lib/app/Jobs/Job.php | 8 +- .../lib/app/Listeners/ExampleListener.php | 8 +- .../lib/app/Providers/AppServiceProvider.php | 4 + .../lib/app/Providers/AuthServiceProvider.php | 4 + .../app/Providers/EventServiceProvider.php | 8 +- .../petstore/php-lumen/lib/app/User.php | 14 ++-- samples/server/petstore/php-lumen/lib/artisan | 4 + .../petstore/php-lumen/lib/bootstrap/app.php | 33 +++++--- .../petstore/php-lumen/lib/composer.json | 30 +++---- .../lib/database/factories/ModelFactory.php | 17 +++- .../lib/database/seeds/DatabaseSeeder.php | 4 + .../server/petstore/php-lumen/lib/phpunit.xml | 21 +++++ .../petstore/php-lumen/lib/public/index.php | 4 +- .../server/petstore/php-lumen/lib/readme.md | 10 ++- .../petstore/php-lumen/lib/routes/web.php | 79 +++++++++++++++++-- .../php-lumen/lib/storage/app/.gitignore | 2 + .../lib/storage/framework/cache/.gitignore | 3 + .../storage/framework/cache/data/.gitignore | 2 + .../lib/storage/framework/views/.gitignore | 2 + .../php-lumen/lib/storage/logs/.gitignore | 2 +- .../php-lumen/lib/tests/ExampleTest.php | 4 + .../petstore/php-lumen/lib/tests/TestCase.php | 8 +- samples/server/petstore/php-lumen/pom.xml | 74 +++++++++++++++++ 84 files changed, 626 insertions(+), 267 deletions(-) create mode 100644 modules/openapi-generator/src/main/resources/php-lumen/editorconfig create mode 100644 modules/openapi-generator/src/main/resources/php-lumen/licenseInfoLumen.mustache create mode 100644 modules/openapi-generator/src/main/resources/php-lumen/storage_framework_cache_gitignore delete mode 100644 modules/openapi-generator/src/main/resources/php-lumen/storage_logs_.gitignore create mode 100644 modules/openapi-generator/src/main/resources/php-lumen/storage_logs_gitignore create mode 100644 modules/openapi-generator/src/main/resources/php-lumen/styleci delete mode 100644 samples/server/petstore/php-lumen/.gitignore create mode 100644 samples/server/petstore/php-lumen/lib/.editorconfig create mode 100644 samples/server/petstore/php-lumen/lib/.gitignore create mode 100644 samples/server/petstore/php-lumen/lib/.styleci.yml create mode 100644 samples/server/petstore/php-lumen/lib/phpunit.xml create mode 100644 samples/server/petstore/php-lumen/lib/storage/app/.gitignore create mode 100644 samples/server/petstore/php-lumen/lib/storage/framework/cache/.gitignore create mode 100644 samples/server/petstore/php-lumen/lib/storage/framework/cache/data/.gitignore create mode 100644 samples/server/petstore/php-lumen/lib/storage/framework/views/.gitignore create mode 100644 samples/server/petstore/php-lumen/pom.xml diff --git a/.gitignore b/.gitignore index 145ed6b6c01b..14b5a330802b 100644 --- a/.gitignore +++ b/.gitignore @@ -173,6 +173,9 @@ samples/client/petstore/python-asyncio/.venv/ samples/client/petstore/python-asyncio/.pytest_cache/ samples/client/petstore/python-tornado/.venv/ +# PHP +samples/server/petstore/php-lumen/lib/composer.lock + # ts samples/client/petstore/typescript-angular2/npm/npm-debug.log samples/client/petstore/typescript-node/npm/npm-debug.log diff --git a/bin/configs/php-lumen.yaml b/bin/configs/php-lumen.yaml index b8c82bc52d04..4436f9ba46d4 100644 --- a/bin/configs/php-lumen.yaml +++ b/bin/configs/php-lumen.yaml @@ -1,4 +1,4 @@ generatorName: php-lumen outputDir: samples/server/petstore/php-lumen -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +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 diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpLumenServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpLumenServerCodegen.java index e5ef7bba34cc..14dc0768185f 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpLumenServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpLumenServerCodegen.java @@ -105,6 +105,18 @@ public PhpLumenServerCodegen() { * are available in models, apis, and supporting files */ additionalProperties.put("apiVersion", apiVersion); + } + + @Override + public void processOpts() { + super.processOpts(); + + // reset supporting files defined in AbstractPhpCodegen + supportingFiles.clear(); + + // AbstractPhpCodegen generates .gitignore in output folder + // current build needs .gitignore in a "lib" folder which is srcBasePath + supportingFiles.add(new SupportingFile("gitignore", srcBasePath, ".gitignore")); /* * Supporting Files. You can write single files for the generator with the @@ -112,7 +124,11 @@ public PhpLumenServerCodegen() { * it will be processed by the template engine. Otherwise, it will be copied */ supportingFiles.add(new SupportingFile(".env.example", srcBasePath, ".env.example")); - supportingFiles.add(new SupportingFile("storage_logs_.gitignore", srcBasePath + File.separator + "storage" + File.separator + "logs", ".gitignore")); + supportingFiles.add(new SupportingFile("storage_logs_gitignore", srcBasePath + File.separator + "storage" + File.separator + "logs", ".gitignore")); + supportingFiles.add(new SupportingFile("storage_logs_gitignore", srcBasePath + File.separator + "storage" + File.separator + "app", ".gitignore")); + supportingFiles.add(new SupportingFile("storage_logs_gitignore", srcBasePath + File.separator + "storage" + File.separator + "framework" + File.separator + "views", ".gitignore")); + supportingFiles.add(new SupportingFile("storage_framework_cache_gitignore", srcBasePath + File.separator + "storage" + File.separator + "framework" + File.separator + "cache", ".gitignore")); + supportingFiles.add(new SupportingFile("storage_logs_gitignore", srcBasePath + File.separator + "storage" + File.separator + "framework" + File.separator + "cache" + File.separator + "data", ".gitignore")); supportingFiles.add(new SupportingFile("artisan", srcBasePath, "artisan")); supportingFiles.add(new SupportingFile("composer.mustache", srcBasePath, "composer.json")); supportingFiles.add(new SupportingFile("readme.md", srcBasePath, "readme.md")); @@ -142,6 +158,9 @@ public PhpLumenServerCodegen() { supportingFiles.add(new SupportingFile("routes.mustache", srcBasePath + File.separator + "routes", "web.php")); supportingFiles.add(new SupportingFile("ExampleTest.php", srcBasePath + File.separator + "tests", "ExampleTest.php")); supportingFiles.add(new SupportingFile("TestCase.php", srcBasePath + File.separator + "tests", "TestCase.php")); + supportingFiles.add(new SupportingFile("editorconfig", srcBasePath, ".editorconfig")); + supportingFiles.add(new SupportingFile("styleci", srcBasePath, ".styleci.yml")); + supportingFiles.add(new SupportingFile("phpunit.xml", srcBasePath, "phpunit.xml")); } // override with any special post-processing diff --git a/modules/openapi-generator/src/main/resources/php-lumen/.env.example b/modules/openapi-generator/src/main/resources/php-lumen/.env.example index 9e27ce13c484..77194452c5b3 100644 --- a/modules/openapi-generator/src/main/resources/php-lumen/.env.example +++ b/modules/openapi-generator/src/main/resources/php-lumen/.env.example @@ -1,6 +1,8 @@ +APP_NAME=Lumen APP_ENV=local -APP_DEBUG=true APP_KEY= +APP_DEBUG=true +APP_URL=http://localhost APP_TIMEZONE=UTC LOG_CHANNEL=stack @@ -14,4 +16,4 @@ DB_USERNAME=homestead DB_PASSWORD=secret CACHE_DRIVER=file -QUEUE_DRIVER=sync \ No newline at end of file +QUEUE_CONNECTION=sync diff --git a/modules/openapi-generator/src/main/resources/php-lumen/AppServiceProvider.php b/modules/openapi-generator/src/main/resources/php-lumen/AppServiceProvider.php index ddec04694c37..50c438978093 100644 --- a/modules/openapi-generator/src/main/resources/php-lumen/AppServiceProvider.php +++ b/modules/openapi-generator/src/main/resources/php-lumen/AppServiceProvider.php @@ -1,5 +1,6 @@ licenseInfoLumen}} namespace App\Providers; use Illuminate\Support\ServiceProvider; diff --git a/modules/openapi-generator/src/main/resources/php-lumen/AuthServiceProvider.php b/modules/openapi-generator/src/main/resources/php-lumen/AuthServiceProvider.php index 9502a0bfce79..e9bdb2eb578a 100644 --- a/modules/openapi-generator/src/main/resources/php-lumen/AuthServiceProvider.php +++ b/modules/openapi-generator/src/main/resources/php-lumen/AuthServiceProvider.php @@ -1,5 +1,6 @@ licenseInfoLumen}} namespace App\Providers; use App\User; diff --git a/modules/openapi-generator/src/main/resources/php-lumen/Authenticate.php b/modules/openapi-generator/src/main/resources/php-lumen/Authenticate.php index 7cd3d5829a2f..7be121ca61c9 100644 --- a/modules/openapi-generator/src/main/resources/php-lumen/Authenticate.php +++ b/modules/openapi-generator/src/main/resources/php-lumen/Authenticate.php @@ -1,11 +1,6 @@ licenseInfoLumen}} namespace App\Http\Middleware; use Closure; diff --git a/modules/openapi-generator/src/main/resources/php-lumen/Controller.php b/modules/openapi-generator/src/main/resources/php-lumen/Controller.php index 8c3690dc7890..027132d26a99 100644 --- a/modules/openapi-generator/src/main/resources/php-lumen/Controller.php +++ b/modules/openapi-generator/src/main/resources/php-lumen/Controller.php @@ -1,11 +1,6 @@ licenseInfoLumen}} namespace App\Http\Controllers; use Laravel\Lumen\Routing\Controller as BaseController; diff --git a/modules/openapi-generator/src/main/resources/php-lumen/DatabaseSeeder.php b/modules/openapi-generator/src/main/resources/php-lumen/DatabaseSeeder.php index 23526c9d99ce..e6d0dee03561 100644 --- a/modules/openapi-generator/src/main/resources/php-lumen/DatabaseSeeder.php +++ b/modules/openapi-generator/src/main/resources/php-lumen/DatabaseSeeder.php @@ -1,5 +1,6 @@ licenseInfoLumen}} use Illuminate\Database\Seeder; class DatabaseSeeder extends Seeder diff --git a/modules/openapi-generator/src/main/resources/php-lumen/Event.php b/modules/openapi-generator/src/main/resources/php-lumen/Event.php index b8230f0fff18..ad07b2c24154 100644 --- a/modules/openapi-generator/src/main/resources/php-lumen/Event.php +++ b/modules/openapi-generator/src/main/resources/php-lumen/Event.php @@ -1,5 +1,6 @@ licenseInfoLumen}} namespace App\Events; use Illuminate\Queue\SerializesModels; diff --git a/modules/openapi-generator/src/main/resources/php-lumen/EventServiceProvider.php b/modules/openapi-generator/src/main/resources/php-lumen/EventServiceProvider.php index a3d284fc29fb..57f198622cb0 100644 --- a/modules/openapi-generator/src/main/resources/php-lumen/EventServiceProvider.php +++ b/modules/openapi-generator/src/main/resources/php-lumen/EventServiceProvider.php @@ -1,5 +1,6 @@ licenseInfoLumen}} namespace App\Providers; use Laravel\Lumen\Providers\EventServiceProvider as ServiceProvider; @@ -12,8 +13,8 @@ class EventServiceProvider extends ServiceProvider * @var array */ protected $listen = [ - 'App\Events\ExampleEvent' => [ - 'App\Listeners\ExampleListener', + \App\Events\ExampleEvent::class => [ + \App\Listeners\ExampleListener::class, ], ]; } diff --git a/modules/openapi-generator/src/main/resources/php-lumen/ExampleController.php b/modules/openapi-generator/src/main/resources/php-lumen/ExampleController.php index aab066e8c7d7..81d1ff5190e9 100644 --- a/modules/openapi-generator/src/main/resources/php-lumen/ExampleController.php +++ b/modules/openapi-generator/src/main/resources/php-lumen/ExampleController.php @@ -1,5 +1,6 @@ licenseInfoLumen}} namespace App\Http\Controllers; class ExampleController extends Controller diff --git a/modules/openapi-generator/src/main/resources/php-lumen/ExampleEvent.php b/modules/openapi-generator/src/main/resources/php-lumen/ExampleEvent.php index 4bd12685bd26..cd3d462ebbac 100644 --- a/modules/openapi-generator/src/main/resources/php-lumen/ExampleEvent.php +++ b/modules/openapi-generator/src/main/resources/php-lumen/ExampleEvent.php @@ -1,5 +1,6 @@ licenseInfoLumen}} namespace App\Events; class ExampleEvent extends Event diff --git a/modules/openapi-generator/src/main/resources/php-lumen/ExampleJob.php b/modules/openapi-generator/src/main/resources/php-lumen/ExampleJob.php index 7b65bb42288c..4ad285c71b49 100644 --- a/modules/openapi-generator/src/main/resources/php-lumen/ExampleJob.php +++ b/modules/openapi-generator/src/main/resources/php-lumen/ExampleJob.php @@ -1,5 +1,6 @@ licenseInfoLumen}} namespace App\Jobs; class ExampleJob extends Job diff --git a/modules/openapi-generator/src/main/resources/php-lumen/ExampleListener.php b/modules/openapi-generator/src/main/resources/php-lumen/ExampleListener.php index 77fc6a85f90b..93822950d783 100644 --- a/modules/openapi-generator/src/main/resources/php-lumen/ExampleListener.php +++ b/modules/openapi-generator/src/main/resources/php-lumen/ExampleListener.php @@ -1,10 +1,11 @@ licenseInfoLumen}} namespace App\Listeners; use App\Events\ExampleEvent; -use Illuminate\Queue\InteractsWithQueue; use Illuminate\Contracts\Queue\ShouldQueue; +use Illuminate\Queue\InteractsWithQueue; class ExampleListener { @@ -21,7 +22,7 @@ public function __construct() /** * Handle the event. * - * @param ExampleEvent $event + * @param \App\Events\ExampleEvent $event * @return void */ public function handle(ExampleEvent $event) diff --git a/modules/openapi-generator/src/main/resources/php-lumen/ExampleMiddleware.php b/modules/openapi-generator/src/main/resources/php-lumen/ExampleMiddleware.php index 166581c8e69b..6d54e9f9918f 100644 --- a/modules/openapi-generator/src/main/resources/php-lumen/ExampleMiddleware.php +++ b/modules/openapi-generator/src/main/resources/php-lumen/ExampleMiddleware.php @@ -1,5 +1,6 @@ licenseInfoLumen}} namespace App\Http\Middleware; use Closure; diff --git a/modules/openapi-generator/src/main/resources/php-lumen/ExampleTest.php b/modules/openapi-generator/src/main/resources/php-lumen/ExampleTest.php index 1bad6ef7ed7d..d258feaad33d 100644 --- a/modules/openapi-generator/src/main/resources/php-lumen/ExampleTest.php +++ b/modules/openapi-generator/src/main/resources/php-lumen/ExampleTest.php @@ -1,5 +1,6 @@ licenseInfoLumen}} use Laravel\Lumen\Testing\DatabaseMigrations; use Laravel\Lumen\Testing\DatabaseTransactions; diff --git a/modules/openapi-generator/src/main/resources/php-lumen/Handler.php b/modules/openapi-generator/src/main/resources/php-lumen/Handler.php index 56f3a44603c4..af1f860e3234 100644 --- a/modules/openapi-generator/src/main/resources/php-lumen/Handler.php +++ b/modules/openapi-generator/src/main/resources/php-lumen/Handler.php @@ -1,19 +1,14 @@ licenseInfoLumen}} namespace App\Exceptions; -use Exception; -use Illuminate\Validation\ValidationException; use Illuminate\Auth\Access\AuthorizationException; use Illuminate\Database\Eloquent\ModelNotFoundException; -use Symfony\Component\HttpKernel\Exception\HttpException; +use Illuminate\Validation\ValidationException; use Laravel\Lumen\Exceptions\Handler as ExceptionHandler; +use Symfony\Component\HttpKernel\Exception\HttpException; +use Throwable; class Handler extends ExceptionHandler { @@ -34,23 +29,27 @@ class Handler extends ExceptionHandler * * This is a great spot to send exceptions to Sentry, Bugsnag, etc. * - * @param \Exception $e + * @param \Throwable $exception * @return void + * + * @throws \Exception */ - public function report(Exception $e) + public function report(Throwable $exception) { - parent::report($e); + parent::report($exception); } /** * Render an exception into an HTTP response. * * @param \Illuminate\Http\Request $request - * @param \Exception $e - * @return \Illuminate\Http\Response + * @param \Throwable $exception + * @return \Illuminate\Http\Response|\Illuminate\Http\JsonResponse + * + * @throws \Throwable */ - public function render($request, Exception $e) + public function render($request, Throwable $exception) { - return parent::render($request, $e); + return parent::render($request, $exception); } } diff --git a/modules/openapi-generator/src/main/resources/php-lumen/Job.php b/modules/openapi-generator/src/main/resources/php-lumen/Job.php index 7c873e10bdfb..7c71ea4e7dea 100644 --- a/modules/openapi-generator/src/main/resources/php-lumen/Job.php +++ b/modules/openapi-generator/src/main/resources/php-lumen/Job.php @@ -1,11 +1,12 @@ licenseInfoLumen}} namespace App\Jobs; use Illuminate\Bus\Queueable; -use Illuminate\Queue\SerializesModels; -use Illuminate\Queue\InteractsWithQueue; use Illuminate\Contracts\Queue\ShouldQueue; +use Illuminate\Queue\InteractsWithQueue; +use Illuminate\Queue\SerializesModels; abstract class Job implements ShouldQueue { diff --git a/modules/openapi-generator/src/main/resources/php-lumen/Kernel.php b/modules/openapi-generator/src/main/resources/php-lumen/Kernel.php index ed6d21b681ed..a651f3a30d5c 100644 --- a/modules/openapi-generator/src/main/resources/php-lumen/Kernel.php +++ b/modules/openapi-generator/src/main/resources/php-lumen/Kernel.php @@ -1,11 +1,6 @@ licenseInfoLumen}} namespace App\Console; use Illuminate\Console\Scheduling\Schedule; diff --git a/modules/openapi-generator/src/main/resources/php-lumen/ModelFactory.php b/modules/openapi-generator/src/main/resources/php-lumen/ModelFactory.php index bf9496b0eef4..b1ab1efde7c3 100644 --- a/modules/openapi-generator/src/main/resources/php-lumen/ModelFactory.php +++ b/modules/openapi-generator/src/main/resources/php-lumen/ModelFactory.php @@ -1,17 +1,23 @@ licenseInfoLumen}} +/** @var \Illuminate\Database\Eloquent\Factory $factory */ + +use App\User; +use Faker\Generator as Faker; + /* |-------------------------------------------------------------------------- | Model Factories |-------------------------------------------------------------------------- | -| Here you may define all of your model factories. Model factories give -| you a convenient way to create models for testing and seeding your -| database. Just tell the factory how a default model should look. +| This directory should contain each of the model factory definitions for +| your application. Factories provide a convenient way to generate new +| model instances for testing / seeding your application's database. | */ -$factory->define(App\User::class, function (Faker\Generator $faker) { +$factory->define(User::class, function (Faker $faker) { return [ 'name' => $faker->name, 'email' => $faker->email, diff --git a/modules/openapi-generator/src/main/resources/php-lumen/TestCase.php b/modules/openapi-generator/src/main/resources/php-lumen/TestCase.php index 89a058d12105..7e40485e841b 100644 --- a/modules/openapi-generator/src/main/resources/php-lumen/TestCase.php +++ b/modules/openapi-generator/src/main/resources/php-lumen/TestCase.php @@ -1,6 +1,9 @@ licenseInfoLumen}} +use Laravel\Lumen\Testing\TestCase as BaseTestCase; + +abstract class TestCase extends BaseTestCase { /** * Creates the application. diff --git a/modules/openapi-generator/src/main/resources/php-lumen/User.php b/modules/openapi-generator/src/main/resources/php-lumen/User.php index 94adde8542ee..41f9806a2a1b 100644 --- a/modules/openapi-generator/src/main/resources/php-lumen/User.php +++ b/modules/openapi-generator/src/main/resources/php-lumen/User.php @@ -1,22 +1,15 @@ licenseInfoLumen}} namespace App; use Illuminate\Auth\Authenticatable; -use Laravel\Lumen\Auth\Authorizable; -use Illuminate\Database\Eloquent\Model; -use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract; use Illuminate\Contracts\Auth\Access\Authorizable as AuthorizableContract; +use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract; +use Illuminate\Database\Eloquent\Model; +use Laravel\Lumen\Auth\Authorizable; -class User extends Model implements - AuthenticatableContract, - AuthorizableContract +class User extends Model implements AuthenticatableContract, AuthorizableContract { use Authenticatable, Authorizable; diff --git a/modules/openapi-generator/src/main/resources/php-lumen/app.php b/modules/openapi-generator/src/main/resources/php-lumen/app.php index 58dc9d942b99..1a1d5bb493c7 100644 --- a/modules/openapi-generator/src/main/resources/php-lumen/app.php +++ b/modules/openapi-generator/src/main/resources/php-lumen/app.php @@ -1,18 +1,13 @@ licenseInfoLumen}} require_once __DIR__.'/../vendor/autoload.php'; -try { - (new Dotenv\Dotenv(__DIR__.'/../'))->load(); -} catch (Dotenv\Exception\InvalidPathException $e) { - // -} +(new Laravel\Lumen\Bootstrap\LoadEnvironmentVariables( + dirname(__DIR__) +))->bootstrap(); + +date_default_timezone_set(env('APP_TIMEZONE', 'UTC')); /* |-------------------------------------------------------------------------- @@ -26,7 +21,7 @@ */ $app = new Laravel\Lumen\Application( - realpath(__DIR__.'/../') + dirname(__DIR__) ); // $app->withFacades(); @@ -54,6 +49,19 @@ App\Console\Kernel::class ); +/* +|-------------------------------------------------------------------------- +| Register Config Files +|-------------------------------------------------------------------------- +| +| Now we will register the "app" configuration file. If the file exists in +| your configuration directory it will be loaded; otherwise, we'll load +| the default version. You may register other files below as needed. +| +*/ + +$app->configure('app'); + /* |-------------------------------------------------------------------------- | Register Middleware @@ -66,7 +74,7 @@ */ // $app->middleware([ -// App\Http\Middleware\ExampleMiddleware::class +// App\Http\Middleware\ExampleMiddleware::class // ]); // $app->routeMiddleware([ @@ -105,6 +113,4 @@ require __DIR__.'/../routes/web.php'; }); -$app->withFacades(); - return $app; diff --git a/modules/openapi-generator/src/main/resources/php-lumen/artisan b/modules/openapi-generator/src/main/resources/php-lumen/artisan index 6a9d095aeae0..46fb1b6f90ec 100644 --- a/modules/openapi-generator/src/main/resources/php-lumen/artisan +++ b/modules/openapi-generator/src/main/resources/php-lumen/artisan @@ -1,6 +1,7 @@ #!/usr/bin/env php licenseInfoLumen}} use Symfony\Component\Console\Input\ArgvInput; use Symfony\Component\Console\Output\ConsoleOutput; diff --git a/modules/openapi-generator/src/main/resources/php-lumen/composer.mustache b/modules/openapi-generator/src/main/resources/php-lumen/composer.mustache index 433cfd18ad51..27bef59bba66 100644 --- a/modules/openapi-generator/src/main/resources/php-lumen/composer.mustache +++ b/modules/openapi-generator/src/main/resources/php-lumen/composer.mustache @@ -24,29 +24,26 @@ ], "type": "project", "require": { - "php": ">=7.1.3", - "laravel/lumen-framework": "5.6.*", - "vlucas/phpdotenv": "~2.2" + "php": "^7.2.5", + "laravel/lumen-framework": "^7.2" }, "require-dev": { - "fzaninotto/faker": "~1.4", - "phpunit/phpunit": "~7.0", - "mockery/mockery": "~1.0" + "fzaninotto/faker": "^1.9", + "mockery/mockery": "^1.3", + "phpunit/phpunit": "^8.0 || ^9.0" }, "autoload": { + "classmap": [ + "database/seeds", + "database/factories" + ], "psr-4": { "App\\": "app/" } }, "autoload-dev": { "classmap": [ - "tests/", - "database/" - ] - }, - "scripts": { - "post-root-package-install": [ - "@php -r \"file_exists('.env') || copy('.env.example', '.env');\"" + "tests/" ] }, "config": { @@ -55,5 +52,10 @@ "optimize-autoloader": true }, "minimum-stability": "dev", - "prefer-stable": true + "prefer-stable": true, + "scripts": { + "post-root-package-install": [ + "@php -r \"file_exists('.env') || copy('.env.example', '.env');\"" + ] + } } diff --git a/modules/openapi-generator/src/main/resources/php-lumen/editorconfig b/modules/openapi-generator/src/main/resources/php-lumen/editorconfig new file mode 100644 index 000000000000..6537ca4677ee --- /dev/null +++ b/modules/openapi-generator/src/main/resources/php-lumen/editorconfig @@ -0,0 +1,15 @@ +root = true + +[*] +charset = utf-8 +end_of_line = lf +insert_final_newline = true +indent_style = space +indent_size = 4 +trim_trailing_whitespace = true + +[*.md] +trim_trailing_whitespace = false + +[*.{yml,yaml}] +indent_size = 2 diff --git a/modules/openapi-generator/src/main/resources/php-lumen/gitignore b/modules/openapi-generator/src/main/resources/php-lumen/gitignore index 390a8878ede4..2896e8647b29 100644 --- a/modules/openapi-generator/src/main/resources/php-lumen/gitignore +++ b/modules/openapi-generator/src/main/resources/php-lumen/gitignore @@ -1,8 +1,6 @@ -# ref: https://github.com/github/gitignore/blob/master/Composer.gitignore - -composer.phar -/vendor/ - -# Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control -# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file -# composer.lock \ No newline at end of file +/vendor +/.idea +Homestead.json +Homestead.yaml +.env +.phpunit.result.cache diff --git a/modules/openapi-generator/src/main/resources/php-lumen/index.php b/modules/openapi-generator/src/main/resources/php-lumen/index.php index 7f44de3e275d..add2c7c07556 100644 --- a/modules/openapi-generator/src/main/resources/php-lumen/index.php +++ b/modules/openapi-generator/src/main/resources/php-lumen/index.php @@ -1,11 +1,6 @@ licenseInfoLumen}} /* |-------------------------------------------------------------------------- | Create The Application diff --git a/modules/openapi-generator/src/main/resources/php-lumen/licenseInfo.mustache b/modules/openapi-generator/src/main/resources/php-lumen/licenseInfo.mustache index ef8396ce24d4..b119e2a8b97a 100644 --- a/modules/openapi-generator/src/main/resources/php-lumen/licenseInfo.mustache +++ b/modules/openapi-generator/src/main/resources/php-lumen/licenseInfo.mustache @@ -1,7 +1,7 @@ /** * {{{appName}}} * {{{appDescription}}} - * PHP version 7.1.3 + * PHP version 7.2.5 * * {{#version}}The version of the OpenAPI document: {{{version}}}{{/version}} * {{#infoEmail}}Contact: {{{infoEmail}}}{{/infoEmail}} diff --git a/modules/openapi-generator/src/main/resources/php-lumen/licenseInfoLumen.mustache b/modules/openapi-generator/src/main/resources/php-lumen/licenseInfoLumen.mustache new file mode 100644 index 000000000000..52855d2fdd01 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/php-lumen/licenseInfoLumen.mustache @@ -0,0 +1,3 @@ +/** + * The Lumen framework is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT). + */ diff --git a/modules/openapi-generator/src/main/resources/php-lumen/phpunit.xml b/modules/openapi-generator/src/main/resources/php-lumen/phpunit.xml index 218bbb4b49ba..e94653dc9123 100644 --- a/modules/openapi-generator/src/main/resources/php-lumen/phpunit.xml +++ b/modules/openapi-generator/src/main/resources/php-lumen/phpunit.xml @@ -1,14 +1,8 @@ - + ./tests @@ -20,9 +14,8 @@ - - + diff --git a/modules/openapi-generator/src/main/resources/php-lumen/readme.md b/modules/openapi-generator/src/main/resources/php-lumen/readme.md index 77316595b804..b13967538b1f 100644 --- a/modules/openapi-generator/src/main/resources/php-lumen/readme.md +++ b/modules/openapi-generator/src/main/resources/php-lumen/readme.md @@ -1,7 +1,7 @@ # OpenAPITools generated server ## Requirements -* PHP 7.1.3 or newer +* PHP 7.2.5 or newer ## Overview This server was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the @@ -18,9 +18,15 @@ This example uses the [Lumen Framework](http://lumen.laravel.com/). To see how Switch to the generated Lumen server stub directory. Using `composer update` to install the framework and dependencies via [Composer](http://getcomposer.org/). +### Init App Config +Use `.env.example` as starting point for a new application config: +```console +$ composer run post-root-package-install +``` + ## Note -The `composer update` should be the first thing to do right after generating Lumen server stub. The autoload.php will be generated only after excuting `composer update`. +The `composer update` should be the first thing to do right after generating Lumen server stub. The autoload.php will be generated only after executing `composer update`. Or there would be errors during service or model migration. ### Running the generated server stub diff --git a/modules/openapi-generator/src/main/resources/php-lumen/routes.mustache b/modules/openapi-generator/src/main/resources/php-lumen/routes.mustache index 0f0c9d92f009..9eed65e61b8f 100644 --- a/modules/openapi-generator/src/main/resources/php-lumen/routes.mustache +++ b/modules/openapi-generator/src/main/resources/php-lumen/routes.mustache @@ -1,11 +1,23 @@ licenseInfo}} +{{>licenseInfoLumen}} {{#apiInfo}}/** * {{appName}} * @version {{appVersion}} */ +/* +|-------------------------------------------------------------------------- +| Application Routes +|-------------------------------------------------------------------------- +| +| Here is where you can register all of the routes for an application. +| It is a breeze. Simply tell Lumen the URIs it should respond to +| and give it the Closure to call when that URI is requested. +| +*/ + $router->get('/', function () use ($router) { return $router->app->version(); }); @@ -19,8 +31,8 @@ $router->get('/', function () use ($router) { * Notes: {{notes}} */ $router->{{httpMethod}}('{{{basePathWithoutHost}}}{{{path}}}', '{{classname}}@{{operationId}}'); + {{/operation}} {{/operations}} {{/apis}} {{/apiInfo}} - diff --git a/modules/openapi-generator/src/main/resources/php-lumen/storage_framework_cache_gitignore b/modules/openapi-generator/src/main/resources/php-lumen/storage_framework_cache_gitignore new file mode 100644 index 000000000000..01e4a6cda9eb --- /dev/null +++ b/modules/openapi-generator/src/main/resources/php-lumen/storage_framework_cache_gitignore @@ -0,0 +1,3 @@ +* +!data/ +!.gitignore diff --git a/modules/openapi-generator/src/main/resources/php-lumen/storage_logs_.gitignore b/modules/openapi-generator/src/main/resources/php-lumen/storage_logs_.gitignore deleted file mode 100644 index c96a04f008ee..000000000000 --- a/modules/openapi-generator/src/main/resources/php-lumen/storage_logs_.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -* -!.gitignore \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/php-lumen/storage_logs_gitignore b/modules/openapi-generator/src/main/resources/php-lumen/storage_logs_gitignore new file mode 100644 index 000000000000..d6b7ef32c847 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/php-lumen/storage_logs_gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/modules/openapi-generator/src/main/resources/php-lumen/styleci b/modules/openapi-generator/src/main/resources/php-lumen/styleci new file mode 100644 index 000000000000..89801211440a --- /dev/null +++ b/modules/openapi-generator/src/main/resources/php-lumen/styleci @@ -0,0 +1,6 @@ +php: + preset: laravel + disabled: + - unused_use +js: true +css: true diff --git a/pom.xml b/pom.xml index d4fdeae7fe5a..0b77ce578f6f 100644 --- a/pom.xml +++ b/pom.xml @@ -1182,6 +1182,7 @@ samples/server/petstore/python-flask samples/server/petstore/php-slim4 samples/server/petstore/php-laravel + samples/server/petstore/php-lumen samples/server/petstore/rust-server + samples/client/petstore/kotlin-retrofit2 + samples/client/petstore/kotlin-retrofit2-rx3 samples/client/petstore/kotlin-jackson/ samples/client/petstore/kotlin-gson/ samples/client/petstore/kotlin-nonpublic/ diff --git a/samples/client/petstore/kotlin-retrofit2-rx3/pom.xml b/samples/client/petstore/kotlin-retrofit2-rx3/pom.xml new file mode 100644 index 000000000000..1ee09680f372 --- /dev/null +++ b/samples/client/petstore/kotlin-retrofit2-rx3/pom.xml @@ -0,0 +1,46 @@ + + 4.0.0 + org.openapitools + KotlinRetrofit2Rx3PetstoreClientTests + pom + 1.0-SNAPSHOT + Kotlin Retrofit2 Rx3 Petstore Client + + + + maven-dependency-plugin + + + package + + copy-dependencies + + + ${project.build.directory} + + + + + + org.codehaus.mojo + exec-maven-plugin + 1.2.1 + + + bundle-test + integration-test + + exec + + + gradle + + test + + + + + + + + diff --git a/samples/client/petstore/kotlin-retrofit2-rx3/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-retrofit2-rx3/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index d33f1a005402..b52cebf4c31e 100644 --- a/samples/client/petstore/kotlin-retrofit2-rx3/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-retrofit2-rx3/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -9,6 +9,8 @@ import io.reactivex.rxjava3.core.Completable; import org.openapitools.client.models.ApiResponse import org.openapitools.client.models.Pet +import okhttp3.MultipartBody + interface PetApi { /** * Add a new pet to the store diff --git a/samples/client/petstore/kotlin-retrofit2/pom.xml b/samples/client/petstore/kotlin-retrofit2/pom.xml new file mode 100644 index 000000000000..a2a34c203fa8 --- /dev/null +++ b/samples/client/petstore/kotlin-retrofit2/pom.xml @@ -0,0 +1,46 @@ + + 4.0.0 + org.openapitools + KotlinRetrofit2PetstoreClientTests + pom + 1.0-SNAPSHOT + Kotlin Retrofit2 Petstore Client + + + + maven-dependency-plugin + + + package + + copy-dependencies + + + ${project.build.directory} + + + + + + org.codehaus.mojo + exec-maven-plugin + 1.2.1 + + + bundle-test + integration-test + + exec + + + gradle + + test + + + + + + + + diff --git a/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index f3f9c057d241..4d78248129cc 100644 --- a/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -8,6 +8,8 @@ import okhttp3.RequestBody import org.openapitools.client.models.ApiResponse import org.openapitools.client.models.Pet +import okhttp3.MultipartBody + interface PetApi { /** * Add a new pet to the store From c1b8c294aae46b6799ad1cd548ef2588100bc043 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Wed, 5 Aug 2020 10:27:38 +0800 Subject: [PATCH 126/129] [Java][jersey2] Add helper methods for oneOf Java classes (#7115) * add helper methods for oneOf java class * better test comment --- .../libraries/jersey2/oneof_model.mustache | 25 ++++++++++- .../org/openapitools/client/model/Fruit.java | 34 +++++++++++++- .../openapitools/client/model/FruitReq.java | 34 +++++++++++++- .../org/openapitools/client/model/Mammal.java | 45 ++++++++++++++++++- .../client/model/NullableShape.java | 34 +++++++++++++- .../org/openapitools/client/model/Pig.java | 34 +++++++++++++- .../client/model/Quadrilateral.java | 34 +++++++++++++- .../org/openapitools/client/model/Shape.java | 34 +++++++++++++- .../client/model/ShapeOrNull.java | 34 +++++++++++++- .../openapitools/client/model/Triangle.java | 45 ++++++++++++++++++- .../client/JSONComposedSchemaTest.java | 17 ++++++- 11 files changed, 359 insertions(+), 11 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/oneof_model.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/oneof_model.mustache index f3a51dccdc01..64da76c849d3 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/oneof_model.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/oneof_model.mustache @@ -183,7 +183,8 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im /** * Set the instance that matches the oneOf child schema, check - * the instance parameter is valid against the oneOf child schemas. + * the instance parameter is valid against the oneOf child schemas: + * {{#oneOf}}{{{.}}}{{^-last}}, {{/-last}}{{/oneOf}} * * It could be an instance of the 'oneOf' schemas. * The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf). @@ -207,6 +208,28 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im throw new RuntimeException("Invalid instance type. Must be {{#oneOf}}{{{.}}}{{^-last}}, {{/-last}}{{/oneOf}}"); } + /** + * Get the actual instance, which can be the following: + * {{#oneOf}}{{{.}}}{{^-last}}, {{/-last}}{{/oneOf}} + * + * @return The actual instance ({{#oneOf}}{{{.}}}{{^-last}}, {{/-last}}{{/oneOf}}) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + {{#oneOf}} + /** + * Get the actual instance of `{{{.}}}`. If the actual instanct is not `{{{.}}}`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `{{{.}}}` + * @throws ClassCastException if the instance is not `{{{.}}}` + */ + public {{{.}}} get{{{.}}}() throws ClassCastException { + return ({{{.}}})super.getActualInstance(); + } + {{/oneOf}} } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Fruit.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Fruit.java index b7c2f8364148..4e25e5534d7e 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Fruit.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Fruit.java @@ -195,7 +195,8 @@ public Map getSchemas() { /** * Set the instance that matches the oneOf child schema, check - * the instance parameter is valid against the oneOf child schemas. + * the instance parameter is valid against the oneOf child schemas: + * Apple, Banana * * It could be an instance of the 'oneOf' schemas. * The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf). @@ -215,7 +216,38 @@ public void setActualInstance(Object instance) { throw new RuntimeException("Invalid instance type. Must be Apple, Banana"); } + /** + * Get the actual instance, which can be the following: + * Apple, Banana + * + * @return The actual instance (Apple, Banana) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `Apple`. If the actual instanct is not `Apple`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Apple` + * @throws ClassCastException if the instance is not `Apple` + */ + public Apple getApple() throws ClassCastException { + return (Apple)super.getActualInstance(); + } + /** + * Get the actual instance of `Banana`. If the actual instanct is not `Banana`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Banana` + * @throws ClassCastException if the instance is not `Banana` + */ + public Banana getBanana() throws ClassCastException { + return (Banana)super.getActualInstance(); + } } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FruitReq.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FruitReq.java index e780f72ecb85..eb7dda9e472e 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FruitReq.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FruitReq.java @@ -197,7 +197,8 @@ public Map getSchemas() { /** * Set the instance that matches the oneOf child schema, check - * the instance parameter is valid against the oneOf child schemas. + * the instance parameter is valid against the oneOf child schemas: + * AppleReq, BananaReq * * It could be an instance of the 'oneOf' schemas. * The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf). @@ -222,7 +223,38 @@ public void setActualInstance(Object instance) { throw new RuntimeException("Invalid instance type. Must be AppleReq, BananaReq"); } + /** + * Get the actual instance, which can be the following: + * AppleReq, BananaReq + * + * @return The actual instance (AppleReq, BananaReq) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `AppleReq`. If the actual instanct is not `AppleReq`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `AppleReq` + * @throws ClassCastException if the instance is not `AppleReq` + */ + public AppleReq getAppleReq() throws ClassCastException { + return (AppleReq)super.getActualInstance(); + } + /** + * Get the actual instance of `BananaReq`. If the actual instanct is not `BananaReq`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `BananaReq` + * @throws ClassCastException if the instance is not `BananaReq` + */ + public BananaReq getBananaReq() throws ClassCastException { + return (BananaReq)super.getActualInstance(); + } } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Mammal.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Mammal.java index ae0b2f3d97ec..1bf5ddf9e75c 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Mammal.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Mammal.java @@ -310,7 +310,8 @@ public Map getSchemas() { /** * Set the instance that matches the oneOf child schema, check - * the instance parameter is valid against the oneOf child schemas. + * the instance parameter is valid against the oneOf child schemas: + * Pig, Whale, Zebra * * It could be an instance of the 'oneOf' schemas. * The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf). @@ -335,7 +336,49 @@ public void setActualInstance(Object instance) { throw new RuntimeException("Invalid instance type. Must be Pig, Whale, Zebra"); } + /** + * Get the actual instance, which can be the following: + * Pig, Whale, Zebra + * + * @return The actual instance (Pig, Whale, Zebra) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `Pig`. If the actual instanct is not `Pig`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Pig` + * @throws ClassCastException if the instance is not `Pig` + */ + public Pig getPig() throws ClassCastException { + return (Pig)super.getActualInstance(); + } + /** + * Get the actual instance of `Whale`. If the actual instanct is not `Whale`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Whale` + * @throws ClassCastException if the instance is not `Whale` + */ + public Whale getWhale() throws ClassCastException { + return (Whale)super.getActualInstance(); + } + + /** + * Get the actual instance of `Zebra`. If the actual instanct is not `Zebra`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Zebra` + * @throws ClassCastException if the instance is not `Zebra` + */ + public Zebra getZebra() throws ClassCastException { + return (Zebra)super.getActualInstance(); + } } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NullableShape.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NullableShape.java index 7807b98979e8..6a0d58edaa9a 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NullableShape.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NullableShape.java @@ -273,7 +273,8 @@ public Map getSchemas() { /** * Set the instance that matches the oneOf child schema, check - * the instance parameter is valid against the oneOf child schemas. + * the instance parameter is valid against the oneOf child schemas: + * Quadrilateral, Triangle * * It could be an instance of the 'oneOf' schemas. * The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf). @@ -298,7 +299,38 @@ public void setActualInstance(Object instance) { throw new RuntimeException("Invalid instance type. Must be Quadrilateral, Triangle"); } + /** + * Get the actual instance, which can be the following: + * Quadrilateral, Triangle + * + * @return The actual instance (Quadrilateral, Triangle) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `Quadrilateral`. If the actual instanct is not `Quadrilateral`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Quadrilateral` + * @throws ClassCastException if the instance is not `Quadrilateral` + */ + public Quadrilateral getQuadrilateral() throws ClassCastException { + return (Quadrilateral)super.getActualInstance(); + } + /** + * Get the actual instance of `Triangle`. If the actual instanct is not `Triangle`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Triangle` + * @throws ClassCastException if the instance is not `Triangle` + */ + public Triangle getTriangle() throws ClassCastException { + return (Triangle)super.getActualInstance(); + } } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Pig.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Pig.java index a2e751069a32..3a0baa419d23 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Pig.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Pig.java @@ -271,7 +271,8 @@ public Map getSchemas() { /** * Set the instance that matches the oneOf child schema, check - * the instance parameter is valid against the oneOf child schemas. + * the instance parameter is valid against the oneOf child schemas: + * BasquePig, DanishPig * * It could be an instance of the 'oneOf' schemas. * The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf). @@ -291,7 +292,38 @@ public void setActualInstance(Object instance) { throw new RuntimeException("Invalid instance type. Must be BasquePig, DanishPig"); } + /** + * Get the actual instance, which can be the following: + * BasquePig, DanishPig + * + * @return The actual instance (BasquePig, DanishPig) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `BasquePig`. If the actual instanct is not `BasquePig`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `BasquePig` + * @throws ClassCastException if the instance is not `BasquePig` + */ + public BasquePig getBasquePig() throws ClassCastException { + return (BasquePig)super.getActualInstance(); + } + /** + * Get the actual instance of `DanishPig`. If the actual instanct is not `DanishPig`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `DanishPig` + * @throws ClassCastException if the instance is not `DanishPig` + */ + public DanishPig getDanishPig() throws ClassCastException { + return (DanishPig)super.getActualInstance(); + } } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Quadrilateral.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Quadrilateral.java index 8e892e346b38..85572723405f 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Quadrilateral.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Quadrilateral.java @@ -271,7 +271,8 @@ public Map getSchemas() { /** * Set the instance that matches the oneOf child schema, check - * the instance parameter is valid against the oneOf child schemas. + * the instance parameter is valid against the oneOf child schemas: + * ComplexQuadrilateral, SimpleQuadrilateral * * It could be an instance of the 'oneOf' schemas. * The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf). @@ -291,7 +292,38 @@ public void setActualInstance(Object instance) { throw new RuntimeException("Invalid instance type. Must be ComplexQuadrilateral, SimpleQuadrilateral"); } + /** + * Get the actual instance, which can be the following: + * ComplexQuadrilateral, SimpleQuadrilateral + * + * @return The actual instance (ComplexQuadrilateral, SimpleQuadrilateral) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `ComplexQuadrilateral`. If the actual instanct is not `ComplexQuadrilateral`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `ComplexQuadrilateral` + * @throws ClassCastException if the instance is not `ComplexQuadrilateral` + */ + public ComplexQuadrilateral getComplexQuadrilateral() throws ClassCastException { + return (ComplexQuadrilateral)super.getActualInstance(); + } + /** + * Get the actual instance of `SimpleQuadrilateral`. If the actual instanct is not `SimpleQuadrilateral`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `SimpleQuadrilateral` + * @throws ClassCastException if the instance is not `SimpleQuadrilateral` + */ + public SimpleQuadrilateral getSimpleQuadrilateral() throws ClassCastException { + return (SimpleQuadrilateral)super.getActualInstance(); + } } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Shape.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Shape.java index eba2e38da48c..32c60730b709 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Shape.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Shape.java @@ -271,7 +271,8 @@ public Map getSchemas() { /** * Set the instance that matches the oneOf child schema, check - * the instance parameter is valid against the oneOf child schemas. + * the instance parameter is valid against the oneOf child schemas: + * Quadrilateral, Triangle * * It could be an instance of the 'oneOf' schemas. * The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf). @@ -291,7 +292,38 @@ public void setActualInstance(Object instance) { throw new RuntimeException("Invalid instance type. Must be Quadrilateral, Triangle"); } + /** + * Get the actual instance, which can be the following: + * Quadrilateral, Triangle + * + * @return The actual instance (Quadrilateral, Triangle) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `Quadrilateral`. If the actual instanct is not `Quadrilateral`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Quadrilateral` + * @throws ClassCastException if the instance is not `Quadrilateral` + */ + public Quadrilateral getQuadrilateral() throws ClassCastException { + return (Quadrilateral)super.getActualInstance(); + } + /** + * Get the actual instance of `Triangle`. If the actual instanct is not `Triangle`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Triangle` + * @throws ClassCastException if the instance is not `Triangle` + */ + public Triangle getTriangle() throws ClassCastException { + return (Triangle)super.getActualInstance(); + } } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ShapeOrNull.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ShapeOrNull.java index b951e2f4e9cd..3b5057aab253 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ShapeOrNull.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ShapeOrNull.java @@ -273,7 +273,8 @@ public Map getSchemas() { /** * Set the instance that matches the oneOf child schema, check - * the instance parameter is valid against the oneOf child schemas. + * the instance parameter is valid against the oneOf child schemas: + * Quadrilateral, Triangle * * It could be an instance of the 'oneOf' schemas. * The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf). @@ -298,7 +299,38 @@ public void setActualInstance(Object instance) { throw new RuntimeException("Invalid instance type. Must be Quadrilateral, Triangle"); } + /** + * Get the actual instance, which can be the following: + * Quadrilateral, Triangle + * + * @return The actual instance (Quadrilateral, Triangle) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `Quadrilateral`. If the actual instanct is not `Quadrilateral`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Quadrilateral` + * @throws ClassCastException if the instance is not `Quadrilateral` + */ + public Quadrilateral getQuadrilateral() throws ClassCastException { + return (Quadrilateral)super.getActualInstance(); + } + /** + * Get the actual instance of `Triangle`. If the actual instanct is not `Triangle`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Triangle` + * @throws ClassCastException if the instance is not `Triangle` + */ + public Triangle getTriangle() throws ClassCastException { + return (Triangle)super.getActualInstance(); + } } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Triangle.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Triangle.java index 232fed5dc91c..6c1de98e8642 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Triangle.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Triangle.java @@ -310,7 +310,8 @@ public Map getSchemas() { /** * Set the instance that matches the oneOf child schema, check - * the instance parameter is valid against the oneOf child schemas. + * the instance parameter is valid against the oneOf child schemas: + * EquilateralTriangle, IsoscelesTriangle, ScaleneTriangle * * It could be an instance of the 'oneOf' schemas. * The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf). @@ -335,7 +336,49 @@ public void setActualInstance(Object instance) { throw new RuntimeException("Invalid instance type. Must be EquilateralTriangle, IsoscelesTriangle, ScaleneTriangle"); } + /** + * Get the actual instance, which can be the following: + * EquilateralTriangle, IsoscelesTriangle, ScaleneTriangle + * + * @return The actual instance (EquilateralTriangle, IsoscelesTriangle, ScaleneTriangle) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `EquilateralTriangle`. If the actual instanct is not `EquilateralTriangle`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `EquilateralTriangle` + * @throws ClassCastException if the instance is not `EquilateralTriangle` + */ + public EquilateralTriangle getEquilateralTriangle() throws ClassCastException { + return (EquilateralTriangle)super.getActualInstance(); + } + /** + * Get the actual instance of `IsoscelesTriangle`. If the actual instanct is not `IsoscelesTriangle`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `IsoscelesTriangle` + * @throws ClassCastException if the instance is not `IsoscelesTriangle` + */ + public IsoscelesTriangle getIsoscelesTriangle() throws ClassCastException { + return (IsoscelesTriangle)super.getActualInstance(); + } + + /** + * Get the actual instance of `ScaleneTriangle`. If the actual instanct is not `ScaleneTriangle`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `ScaleneTriangle` + * @throws ClassCastException if the instance is not `ScaleneTriangle` + */ + public ScaleneTriangle getScaleneTriangle() throws ClassCastException { + return (ScaleneTriangle)super.getActualInstance(); + } } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/JSONComposedSchemaTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/JSONComposedSchemaTest.java index 54eeda72ee75..1f78f71db78c 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/JSONComposedSchemaTest.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/JSONComposedSchemaTest.java @@ -66,6 +66,17 @@ public void testOneOfSchemaAdditionalProperties() throws Exception { } } + /** + * Test to ensure the getter will throw ClassCastException + */ + @Test(expected = ClassCastException.class) + public void testCastException() throws Exception { + String str = "{ \"cultivar\": \"golden delicious\", \"mealy\": false }"; + FruitReq o = json.getContext(null).readValue(str, FruitReq.class); + assertTrue(o.getActualInstance() instanceof AppleReq); + BananaReq inst2 = o.getBananaReq(); // should throw ClassCastException + } + /** * Validate a oneOf schema can be deserialized into the expected class. * The oneOf schema does not have a discriminator. @@ -81,6 +92,10 @@ public void testOneOfSchemaWithoutDiscriminator() throws Exception { AppleReq inst = (AppleReq) o.getActualInstance(); assertEquals(inst.getCultivar(), "golden delicious"); assertEquals(inst.getMealy(), false); + + AppleReq inst2 = o.getAppleReq(); + assertEquals(inst2.getCultivar(), "golden delicious"); + assertEquals(inst2.getMealy(), false); } { // Same test, but this time with additional (undeclared) properties. @@ -116,7 +131,7 @@ public void testOneOfSchemaWithoutDiscriminator() throws Exception { String str = "null"; FruitReq o = json.getContext(null).readValue(str, FruitReq.class); assertNull(o); - } + } } /** From 51c45eb28b7434db91284e1d9d74a32305fabd1c Mon Sep 17 00:00:00 2001 From: Mike Raineri Date: Wed, 5 Aug 2020 04:33:58 -0400 Subject: [PATCH 127/129] [REQ] Added enumClassPrefix option to Go server generation (#7008) * Added enumClassPrefix option to Go server generation * Using literal 'true' instead of string --- docs/generators/go-server.md | 1 + .../openapitools/codegen/languages/GoServerCodegen.java | 9 ++++++++- .../src/main/resources/go-server/model.mustache | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/docs/generators/go-server.md b/docs/generators/go-server.md index 7eecfc75a0ba..15d771015238 100644 --- a/docs/generators/go-server.md +++ b/docs/generators/go-server.md @@ -11,6 +11,7 @@ sidebar_label: go-server |packageVersion|Go package version.| |1.0.0| |serverPort|The network port the generated server binds to| |8080| |sourceFolder|source folder for generated code| |go| +|enumClassPrefix|Prefix enum with class name| |false| ## IMPORT MAPPING diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoServerCodegen.java index e13042125492..62bb6a67e9b3 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoServerCodegen.java @@ -104,7 +104,7 @@ public GoServerCodegen() { /* * Service templates. You can write services for each Api file with the apiTemplateFiles map. - These services are skeletons built to implement the logic of your api using the + These services are skeletons built to implement the logic of your api using the expected parameters and response. */ apiTemplateFiles.put( @@ -185,6 +185,13 @@ public void processOpts() { additionalProperties.put("featureCORS", corsFeatureEnabled); } + if (additionalProperties.containsKey(CodegenConstants.ENUM_CLASS_PREFIX)) { + setEnumClassPrefix(Boolean.parseBoolean(additionalProperties.get(CodegenConstants.ENUM_CLASS_PREFIX).toString())); + if (enumClassPrefix) { + additionalProperties.put(CodegenConstants.ENUM_CLASS_PREFIX, true); + } + } + modelPackage = packageName; apiPackage = packageName; diff --git a/modules/openapi-generator/src/main/resources/go-server/model.mustache b/modules/openapi-generator/src/main/resources/go-server/model.mustache index b6ae9ba9f349..3b5b5345a5a3 100644 --- a/modules/openapi-generator/src/main/resources/go-server/model.mustache +++ b/modules/openapi-generator/src/main/resources/go-server/model.mustache @@ -11,7 +11,7 @@ type {{{name}}} {{^format}}{{dataType}}{{/format}}{{#format}}{{{format}}}{{/form const ( {{#allowableValues}} {{#enumVars}} - {{name}} {{{classname}}} = {{{value}}} + {{#enumClassPrefix}}{{{classname.toUpperCase}}}_{{/enumClassPrefix}}{{name}} {{{classname}}} = {{{value}}} {{/enumVars}} {{/allowableValues}} ){{/isEnum}}{{^isEnum}}{{#description}} From f5775f483aa82e290e0609c4ac76612462fa500b Mon Sep 17 00:00:00 2001 From: William Cheng Date: Wed, 5 Aug 2020 16:43:11 +0800 Subject: [PATCH 128/129] update doc --- docs/generators/go-server.md | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/generators/go-server.md b/docs/generators/go-server.md index 15d771015238..7eecfc75a0ba 100644 --- a/docs/generators/go-server.md +++ b/docs/generators/go-server.md @@ -11,7 +11,6 @@ sidebar_label: go-server |packageVersion|Go package version.| |1.0.0| |serverPort|The network port the generated server binds to| |8080| |sourceFolder|source folder for generated code| |go| -|enumClassPrefix|Prefix enum with class name| |false| ## IMPORT MAPPING From f752f29af202885e6b817e5ec002facee1ef0c33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erik=20M=C3=BCller?= Date: Wed, 5 Aug 2020 14:23:06 +0200 Subject: [PATCH 129/129] [typescript-axios] add promise to bearer and oauth tokens (#7132) --- .../typescript-axios/apiInner.mustache | 8 +++--- .../typescript-axios/configuration.mustache | 10 +++---- .../builds/composed-schemas/configuration.ts | 10 +++---- .../typescript-axios/builds/default/api.ts | 28 +++++++++---------- .../builds/default/configuration.ts | 10 +++---- .../typescript-axios/builds/es6-target/api.ts | 28 +++++++++---------- .../builds/es6-target/configuration.ts | 10 +++---- .../builds/with-complex-headers/api.ts | 28 +++++++++---------- .../with-complex-headers/configuration.ts | 10 +++---- .../builds/with-interfaces/api.ts | 28 +++++++++---------- .../builds/with-interfaces/configuration.ts | 10 +++---- .../api/another/level/pet-api.ts | 28 +++++++++---------- .../configuration.ts | 10 +++---- .../builds/with-npm-version/api.ts | 28 +++++++++---------- .../builds/with-npm-version/configuration.ts | 10 +++---- .../with-single-request-parameters/api.ts | 28 +++++++++---------- .../configuration.ts | 10 +++---- 17 files changed, 147 insertions(+), 147 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/typescript-axios/apiInner.mustache b/modules/openapi-generator/src/main/resources/typescript-axios/apiInner.mustache index 832bca8e5132..778e33a9bf89 100644 --- a/modules/openapi-generator/src/main/resources/typescript-axios/apiInner.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-axios/apiInner.mustache @@ -87,8 +87,8 @@ export const {{classname}}AxiosParamCreator = function (configuration?: Configur // http bearer authentication required if (configuration && configuration.accessToken) { const accessToken = typeof configuration.accessToken === 'function' - ? configuration.accessToken() - : configuration.accessToken; + ? await configuration.accessToken() + : await configuration.accessToken; localVarHeaderParameter["Authorization"] = "Bearer " + accessToken; } {{/isBasicBearer}} @@ -96,8 +96,8 @@ export const {{classname}}AxiosParamCreator = function (configuration?: Configur // oauth required if (configuration && configuration.accessToken) { const localVarAccessTokenValue = typeof configuration.accessToken === 'function' - ? configuration.accessToken("{{name}}", [{{#scopes}}"{{{scope}}}"{{^-last}}, {{/-last}}{{/scopes}}]) - : configuration.accessToken; + ? await configuration.accessToken("{{name}}", [{{#scopes}}"{{{scope}}}"{{^-last}}, {{/-last}}{{/scopes}}]) + : await configuration.accessToken; localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; } {{/isOAuth}} diff --git a/modules/openapi-generator/src/main/resources/typescript-axios/configuration.mustache b/modules/openapi-generator/src/main/resources/typescript-axios/configuration.mustache index 49fc09da60a7..ae7e0dcc25c2 100644 --- a/modules/openapi-generator/src/main/resources/typescript-axios/configuration.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-axios/configuration.mustache @@ -6,7 +6,7 @@ export interface ConfigurationParameters { apiKey?: string | Promise | ((name: string) => string) | ((name: string) => Promise); username?: string; password?: string; - accessToken?: string | ((name?: string, scopes?: string[]) => string); + accessToken?: string | Promise | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise); basePath?: string; baseOptions?: any; } @@ -20,14 +20,14 @@ export class Configuration { apiKey?: string | Promise | ((name: string) => string) | ((name: string) => Promise); /** * parameter for basic security - * + * * @type {string} * @memberof Configuration */ username?: string; /** * parameter for basic security - * + * * @type {string} * @memberof Configuration */ @@ -38,10 +38,10 @@ export class Configuration { * @param scopes oauth2 scope * @memberof Configuration */ - accessToken?: string | ((name?: string, scopes?: string[]) => string); + accessToken?: string | Promise | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise); /** * override base path - * + * * @type {string} * @memberof Configuration */ diff --git a/samples/client/petstore/typescript-axios/builds/composed-schemas/configuration.ts b/samples/client/petstore/typescript-axios/builds/composed-schemas/configuration.ts index dbeeafb2da99..185f3bbb0025 100644 --- a/samples/client/petstore/typescript-axios/builds/composed-schemas/configuration.ts +++ b/samples/client/petstore/typescript-axios/builds/composed-schemas/configuration.ts @@ -17,7 +17,7 @@ export interface ConfigurationParameters { apiKey?: string | Promise | ((name: string) => string) | ((name: string) => Promise); username?: string; password?: string; - accessToken?: string | ((name?: string, scopes?: string[]) => string); + accessToken?: string | Promise | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise); basePath?: string; baseOptions?: any; } @@ -31,14 +31,14 @@ export class Configuration { apiKey?: string | Promise | ((name: string) => string) | ((name: string) => Promise); /** * parameter for basic security - * + * * @type {string} * @memberof Configuration */ username?: string; /** * parameter for basic security - * + * * @type {string} * @memberof Configuration */ @@ -49,10 +49,10 @@ export class Configuration { * @param scopes oauth2 scope * @memberof Configuration */ - accessToken?: string | ((name?: string, scopes?: string[]) => string); + accessToken?: string | Promise | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise); /** * override base path - * + * * @type {string} * @memberof Configuration */ diff --git a/samples/client/petstore/typescript-axios/builds/default/api.ts b/samples/client/petstore/typescript-axios/builds/default/api.ts index 3e03d994edf3..6077387d660f 100644 --- a/samples/client/petstore/typescript-axios/builds/default/api.ts +++ b/samples/client/petstore/typescript-axios/builds/default/api.ts @@ -279,8 +279,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) // oauth required if (configuration && configuration.accessToken) { const localVarAccessTokenValue = typeof configuration.accessToken === 'function' - ? configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) - : configuration.accessToken; + ? await configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) + : await configuration.accessToken; localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; } @@ -335,8 +335,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) // oauth required if (configuration && configuration.accessToken) { const localVarAccessTokenValue = typeof configuration.accessToken === 'function' - ? configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) - : configuration.accessToken; + ? await configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) + : await configuration.accessToken; localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; } @@ -389,8 +389,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) // oauth required if (configuration && configuration.accessToken) { const localVarAccessTokenValue = typeof configuration.accessToken === 'function' - ? configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) - : configuration.accessToken; + ? await configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) + : await configuration.accessToken; localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; } @@ -443,8 +443,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) // oauth required if (configuration && configuration.accessToken) { const localVarAccessTokenValue = typeof configuration.accessToken === 'function' - ? configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) - : configuration.accessToken; + ? await configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) + : await configuration.accessToken; localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; } @@ -547,8 +547,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) // oauth required if (configuration && configuration.accessToken) { const localVarAccessTokenValue = typeof configuration.accessToken === 'function' - ? configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) - : configuration.accessToken; + ? await configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) + : await configuration.accessToken; localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; } @@ -605,8 +605,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) // oauth required if (configuration && configuration.accessToken) { const localVarAccessTokenValue = typeof configuration.accessToken === 'function' - ? configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) - : configuration.accessToken; + ? await configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) + : await configuration.accessToken; localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; } @@ -670,8 +670,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) // oauth required if (configuration && configuration.accessToken) { const localVarAccessTokenValue = typeof configuration.accessToken === 'function' - ? configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) - : configuration.accessToken; + ? await configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) + : await configuration.accessToken; localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; } diff --git a/samples/client/petstore/typescript-axios/builds/default/configuration.ts b/samples/client/petstore/typescript-axios/builds/default/configuration.ts index 96fa41b21122..11ebab3da28e 100644 --- a/samples/client/petstore/typescript-axios/builds/default/configuration.ts +++ b/samples/client/petstore/typescript-axios/builds/default/configuration.ts @@ -17,7 +17,7 @@ export interface ConfigurationParameters { apiKey?: string | Promise | ((name: string) => string) | ((name: string) => Promise); username?: string; password?: string; - accessToken?: string | ((name?: string, scopes?: string[]) => string); + accessToken?: string | Promise | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise); basePath?: string; baseOptions?: any; } @@ -31,14 +31,14 @@ export class Configuration { apiKey?: string | Promise | ((name: string) => string) | ((name: string) => Promise); /** * parameter for basic security - * + * * @type {string} * @memberof Configuration */ username?: string; /** * parameter for basic security - * + * * @type {string} * @memberof Configuration */ @@ -49,10 +49,10 @@ export class Configuration { * @param scopes oauth2 scope * @memberof Configuration */ - accessToken?: string | ((name?: string, scopes?: string[]) => string); + accessToken?: string | Promise | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise); /** * override base path - * + * * @type {string} * @memberof Configuration */ diff --git a/samples/client/petstore/typescript-axios/builds/es6-target/api.ts b/samples/client/petstore/typescript-axios/builds/es6-target/api.ts index 3e03d994edf3..6077387d660f 100644 --- a/samples/client/petstore/typescript-axios/builds/es6-target/api.ts +++ b/samples/client/petstore/typescript-axios/builds/es6-target/api.ts @@ -279,8 +279,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) // oauth required if (configuration && configuration.accessToken) { const localVarAccessTokenValue = typeof configuration.accessToken === 'function' - ? configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) - : configuration.accessToken; + ? await configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) + : await configuration.accessToken; localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; } @@ -335,8 +335,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) // oauth required if (configuration && configuration.accessToken) { const localVarAccessTokenValue = typeof configuration.accessToken === 'function' - ? configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) - : configuration.accessToken; + ? await configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) + : await configuration.accessToken; localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; } @@ -389,8 +389,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) // oauth required if (configuration && configuration.accessToken) { const localVarAccessTokenValue = typeof configuration.accessToken === 'function' - ? configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) - : configuration.accessToken; + ? await configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) + : await configuration.accessToken; localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; } @@ -443,8 +443,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) // oauth required if (configuration && configuration.accessToken) { const localVarAccessTokenValue = typeof configuration.accessToken === 'function' - ? configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) - : configuration.accessToken; + ? await configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) + : await configuration.accessToken; localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; } @@ -547,8 +547,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) // oauth required if (configuration && configuration.accessToken) { const localVarAccessTokenValue = typeof configuration.accessToken === 'function' - ? configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) - : configuration.accessToken; + ? await configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) + : await configuration.accessToken; localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; } @@ -605,8 +605,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) // oauth required if (configuration && configuration.accessToken) { const localVarAccessTokenValue = typeof configuration.accessToken === 'function' - ? configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) - : configuration.accessToken; + ? await configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) + : await configuration.accessToken; localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; } @@ -670,8 +670,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) // oauth required if (configuration && configuration.accessToken) { const localVarAccessTokenValue = typeof configuration.accessToken === 'function' - ? configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) - : configuration.accessToken; + ? await configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) + : await configuration.accessToken; localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; } diff --git a/samples/client/petstore/typescript-axios/builds/es6-target/configuration.ts b/samples/client/petstore/typescript-axios/builds/es6-target/configuration.ts index 96fa41b21122..11ebab3da28e 100644 --- a/samples/client/petstore/typescript-axios/builds/es6-target/configuration.ts +++ b/samples/client/petstore/typescript-axios/builds/es6-target/configuration.ts @@ -17,7 +17,7 @@ export interface ConfigurationParameters { apiKey?: string | Promise | ((name: string) => string) | ((name: string) => Promise); username?: string; password?: string; - accessToken?: string | ((name?: string, scopes?: string[]) => string); + accessToken?: string | Promise | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise); basePath?: string; baseOptions?: any; } @@ -31,14 +31,14 @@ export class Configuration { apiKey?: string | Promise | ((name: string) => string) | ((name: string) => Promise); /** * parameter for basic security - * + * * @type {string} * @memberof Configuration */ username?: string; /** * parameter for basic security - * + * * @type {string} * @memberof Configuration */ @@ -49,10 +49,10 @@ export class Configuration { * @param scopes oauth2 scope * @memberof Configuration */ - accessToken?: string | ((name?: string, scopes?: string[]) => string); + accessToken?: string | Promise | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise); /** * override base path - * + * * @type {string} * @memberof Configuration */ diff --git a/samples/client/petstore/typescript-axios/builds/with-complex-headers/api.ts b/samples/client/petstore/typescript-axios/builds/with-complex-headers/api.ts index 8fa42b0091d0..e70e4cf32966 100644 --- a/samples/client/petstore/typescript-axios/builds/with-complex-headers/api.ts +++ b/samples/client/petstore/typescript-axios/builds/with-complex-headers/api.ts @@ -319,8 +319,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) // oauth required if (configuration && configuration.accessToken) { const localVarAccessTokenValue = typeof configuration.accessToken === 'function' - ? configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) - : configuration.accessToken; + ? await configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) + : await configuration.accessToken; localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; } @@ -384,8 +384,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) // oauth required if (configuration && configuration.accessToken) { const localVarAccessTokenValue = typeof configuration.accessToken === 'function' - ? configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) - : configuration.accessToken; + ? await configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) + : await configuration.accessToken; localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; } @@ -438,8 +438,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) // oauth required if (configuration && configuration.accessToken) { const localVarAccessTokenValue = typeof configuration.accessToken === 'function' - ? configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) - : configuration.accessToken; + ? await configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) + : await configuration.accessToken; localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; } @@ -492,8 +492,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) // oauth required if (configuration && configuration.accessToken) { const localVarAccessTokenValue = typeof configuration.accessToken === 'function' - ? configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) - : configuration.accessToken; + ? await configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) + : await configuration.accessToken; localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; } @@ -596,8 +596,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) // oauth required if (configuration && configuration.accessToken) { const localVarAccessTokenValue = typeof configuration.accessToken === 'function' - ? configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) - : configuration.accessToken; + ? await configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) + : await configuration.accessToken; localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; } @@ -654,8 +654,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) // oauth required if (configuration && configuration.accessToken) { const localVarAccessTokenValue = typeof configuration.accessToken === 'function' - ? configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) - : configuration.accessToken; + ? await configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) + : await configuration.accessToken; localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; } @@ -719,8 +719,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) // oauth required if (configuration && configuration.accessToken) { const localVarAccessTokenValue = typeof configuration.accessToken === 'function' - ? configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) - : configuration.accessToken; + ? await configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) + : await configuration.accessToken; localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; } diff --git a/samples/client/petstore/typescript-axios/builds/with-complex-headers/configuration.ts b/samples/client/petstore/typescript-axios/builds/with-complex-headers/configuration.ts index 96fa41b21122..11ebab3da28e 100644 --- a/samples/client/petstore/typescript-axios/builds/with-complex-headers/configuration.ts +++ b/samples/client/petstore/typescript-axios/builds/with-complex-headers/configuration.ts @@ -17,7 +17,7 @@ export interface ConfigurationParameters { apiKey?: string | Promise | ((name: string) => string) | ((name: string) => Promise); username?: string; password?: string; - accessToken?: string | ((name?: string, scopes?: string[]) => string); + accessToken?: string | Promise | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise); basePath?: string; baseOptions?: any; } @@ -31,14 +31,14 @@ export class Configuration { apiKey?: string | Promise | ((name: string) => string) | ((name: string) => Promise); /** * parameter for basic security - * + * * @type {string} * @memberof Configuration */ username?: string; /** * parameter for basic security - * + * * @type {string} * @memberof Configuration */ @@ -49,10 +49,10 @@ export class Configuration { * @param scopes oauth2 scope * @memberof Configuration */ - accessToken?: string | ((name?: string, scopes?: string[]) => string); + accessToken?: string | Promise | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise); /** * override base path - * + * * @type {string} * @memberof Configuration */ diff --git a/samples/client/petstore/typescript-axios/builds/with-interfaces/api.ts b/samples/client/petstore/typescript-axios/builds/with-interfaces/api.ts index 2c483d7f6589..3cffd8160208 100644 --- a/samples/client/petstore/typescript-axios/builds/with-interfaces/api.ts +++ b/samples/client/petstore/typescript-axios/builds/with-interfaces/api.ts @@ -279,8 +279,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) // oauth required if (configuration && configuration.accessToken) { const localVarAccessTokenValue = typeof configuration.accessToken === 'function' - ? configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) - : configuration.accessToken; + ? await configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) + : await configuration.accessToken; localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; } @@ -335,8 +335,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) // oauth required if (configuration && configuration.accessToken) { const localVarAccessTokenValue = typeof configuration.accessToken === 'function' - ? configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) - : configuration.accessToken; + ? await configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) + : await configuration.accessToken; localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; } @@ -389,8 +389,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) // oauth required if (configuration && configuration.accessToken) { const localVarAccessTokenValue = typeof configuration.accessToken === 'function' - ? configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) - : configuration.accessToken; + ? await configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) + : await configuration.accessToken; localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; } @@ -443,8 +443,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) // oauth required if (configuration && configuration.accessToken) { const localVarAccessTokenValue = typeof configuration.accessToken === 'function' - ? configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) - : configuration.accessToken; + ? await configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) + : await configuration.accessToken; localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; } @@ -547,8 +547,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) // oauth required if (configuration && configuration.accessToken) { const localVarAccessTokenValue = typeof configuration.accessToken === 'function' - ? configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) - : configuration.accessToken; + ? await configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) + : await configuration.accessToken; localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; } @@ -605,8 +605,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) // oauth required if (configuration && configuration.accessToken) { const localVarAccessTokenValue = typeof configuration.accessToken === 'function' - ? configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) - : configuration.accessToken; + ? await configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) + : await configuration.accessToken; localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; } @@ -670,8 +670,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) // oauth required if (configuration && configuration.accessToken) { const localVarAccessTokenValue = typeof configuration.accessToken === 'function' - ? configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) - : configuration.accessToken; + ? await configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) + : await configuration.accessToken; localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; } diff --git a/samples/client/petstore/typescript-axios/builds/with-interfaces/configuration.ts b/samples/client/petstore/typescript-axios/builds/with-interfaces/configuration.ts index 96fa41b21122..11ebab3da28e 100644 --- a/samples/client/petstore/typescript-axios/builds/with-interfaces/configuration.ts +++ b/samples/client/petstore/typescript-axios/builds/with-interfaces/configuration.ts @@ -17,7 +17,7 @@ export interface ConfigurationParameters { apiKey?: string | Promise | ((name: string) => string) | ((name: string) => Promise); username?: string; password?: string; - accessToken?: string | ((name?: string, scopes?: string[]) => string); + accessToken?: string | Promise | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise); basePath?: string; baseOptions?: any; } @@ -31,14 +31,14 @@ export class Configuration { apiKey?: string | Promise | ((name: string) => string) | ((name: string) => Promise); /** * parameter for basic security - * + * * @type {string} * @memberof Configuration */ username?: string; /** * parameter for basic security - * + * * @type {string} * @memberof Configuration */ @@ -49,10 +49,10 @@ export class Configuration { * @param scopes oauth2 scope * @memberof Configuration */ - accessToken?: string | ((name?: string, scopes?: string[]) => string); + accessToken?: string | Promise | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise); /** * override base path - * + * * @type {string} * @memberof Configuration */ diff --git a/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/api/another/level/pet-api.ts b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/api/another/level/pet-api.ts index 26c6e9639ad6..c7aaed7a17aa 100644 --- a/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/api/another/level/pet-api.ts +++ b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/api/another/level/pet-api.ts @@ -55,8 +55,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) // oauth required if (configuration && configuration.accessToken) { const localVarAccessTokenValue = typeof configuration.accessToken === 'function' - ? configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) - : configuration.accessToken; + ? await configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) + : await configuration.accessToken; localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; } @@ -111,8 +111,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) // oauth required if (configuration && configuration.accessToken) { const localVarAccessTokenValue = typeof configuration.accessToken === 'function' - ? configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) - : configuration.accessToken; + ? await configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) + : await configuration.accessToken; localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; } @@ -165,8 +165,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) // oauth required if (configuration && configuration.accessToken) { const localVarAccessTokenValue = typeof configuration.accessToken === 'function' - ? configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) - : configuration.accessToken; + ? await configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) + : await configuration.accessToken; localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; } @@ -219,8 +219,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) // oauth required if (configuration && configuration.accessToken) { const localVarAccessTokenValue = typeof configuration.accessToken === 'function' - ? configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) - : configuration.accessToken; + ? await configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) + : await configuration.accessToken; localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; } @@ -323,8 +323,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) // oauth required if (configuration && configuration.accessToken) { const localVarAccessTokenValue = typeof configuration.accessToken === 'function' - ? configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) - : configuration.accessToken; + ? await configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) + : await configuration.accessToken; localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; } @@ -381,8 +381,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) // oauth required if (configuration && configuration.accessToken) { const localVarAccessTokenValue = typeof configuration.accessToken === 'function' - ? configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) - : configuration.accessToken; + ? await configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) + : await configuration.accessToken; localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; } @@ -446,8 +446,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) // oauth required if (configuration && configuration.accessToken) { const localVarAccessTokenValue = typeof configuration.accessToken === 'function' - ? configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) - : configuration.accessToken; + ? await configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) + : await configuration.accessToken; localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; } diff --git a/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/configuration.ts b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/configuration.ts index 96fa41b21122..11ebab3da28e 100644 --- a/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/configuration.ts +++ b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/configuration.ts @@ -17,7 +17,7 @@ export interface ConfigurationParameters { apiKey?: string | Promise | ((name: string) => string) | ((name: string) => Promise); username?: string; password?: string; - accessToken?: string | ((name?: string, scopes?: string[]) => string); + accessToken?: string | Promise | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise); basePath?: string; baseOptions?: any; } @@ -31,14 +31,14 @@ export class Configuration { apiKey?: string | Promise | ((name: string) => string) | ((name: string) => Promise); /** * parameter for basic security - * + * * @type {string} * @memberof Configuration */ username?: string; /** * parameter for basic security - * + * * @type {string} * @memberof Configuration */ @@ -49,10 +49,10 @@ export class Configuration { * @param scopes oauth2 scope * @memberof Configuration */ - accessToken?: string | ((name?: string, scopes?: string[]) => string); + accessToken?: string | Promise | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise); /** * override base path - * + * * @type {string} * @memberof Configuration */ diff --git a/samples/client/petstore/typescript-axios/builds/with-npm-version/api.ts b/samples/client/petstore/typescript-axios/builds/with-npm-version/api.ts index 3e03d994edf3..6077387d660f 100644 --- a/samples/client/petstore/typescript-axios/builds/with-npm-version/api.ts +++ b/samples/client/petstore/typescript-axios/builds/with-npm-version/api.ts @@ -279,8 +279,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) // oauth required if (configuration && configuration.accessToken) { const localVarAccessTokenValue = typeof configuration.accessToken === 'function' - ? configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) - : configuration.accessToken; + ? await configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) + : await configuration.accessToken; localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; } @@ -335,8 +335,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) // oauth required if (configuration && configuration.accessToken) { const localVarAccessTokenValue = typeof configuration.accessToken === 'function' - ? configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) - : configuration.accessToken; + ? await configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) + : await configuration.accessToken; localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; } @@ -389,8 +389,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) // oauth required if (configuration && configuration.accessToken) { const localVarAccessTokenValue = typeof configuration.accessToken === 'function' - ? configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) - : configuration.accessToken; + ? await configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) + : await configuration.accessToken; localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; } @@ -443,8 +443,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) // oauth required if (configuration && configuration.accessToken) { const localVarAccessTokenValue = typeof configuration.accessToken === 'function' - ? configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) - : configuration.accessToken; + ? await configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) + : await configuration.accessToken; localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; } @@ -547,8 +547,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) // oauth required if (configuration && configuration.accessToken) { const localVarAccessTokenValue = typeof configuration.accessToken === 'function' - ? configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) - : configuration.accessToken; + ? await configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) + : await configuration.accessToken; localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; } @@ -605,8 +605,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) // oauth required if (configuration && configuration.accessToken) { const localVarAccessTokenValue = typeof configuration.accessToken === 'function' - ? configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) - : configuration.accessToken; + ? await configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) + : await configuration.accessToken; localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; } @@ -670,8 +670,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) // oauth required if (configuration && configuration.accessToken) { const localVarAccessTokenValue = typeof configuration.accessToken === 'function' - ? configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) - : configuration.accessToken; + ? await configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) + : await configuration.accessToken; localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; } diff --git a/samples/client/petstore/typescript-axios/builds/with-npm-version/configuration.ts b/samples/client/petstore/typescript-axios/builds/with-npm-version/configuration.ts index 96fa41b21122..11ebab3da28e 100644 --- a/samples/client/petstore/typescript-axios/builds/with-npm-version/configuration.ts +++ b/samples/client/petstore/typescript-axios/builds/with-npm-version/configuration.ts @@ -17,7 +17,7 @@ export interface ConfigurationParameters { apiKey?: string | Promise | ((name: string) => string) | ((name: string) => Promise); username?: string; password?: string; - accessToken?: string | ((name?: string, scopes?: string[]) => string); + accessToken?: string | Promise | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise); basePath?: string; baseOptions?: any; } @@ -31,14 +31,14 @@ export class Configuration { apiKey?: string | Promise | ((name: string) => string) | ((name: string) => Promise); /** * parameter for basic security - * + * * @type {string} * @memberof Configuration */ username?: string; /** * parameter for basic security - * + * * @type {string} * @memberof Configuration */ @@ -49,10 +49,10 @@ export class Configuration { * @param scopes oauth2 scope * @memberof Configuration */ - accessToken?: string | ((name?: string, scopes?: string[]) => string); + accessToken?: string | Promise | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise); /** * override base path - * + * * @type {string} * @memberof Configuration */ diff --git a/samples/client/petstore/typescript-axios/builds/with-single-request-parameters/api.ts b/samples/client/petstore/typescript-axios/builds/with-single-request-parameters/api.ts index 28f2240908e8..036a01032123 100644 --- a/samples/client/petstore/typescript-axios/builds/with-single-request-parameters/api.ts +++ b/samples/client/petstore/typescript-axios/builds/with-single-request-parameters/api.ts @@ -279,8 +279,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) // oauth required if (configuration && configuration.accessToken) { const localVarAccessTokenValue = typeof configuration.accessToken === 'function' - ? configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) - : configuration.accessToken; + ? await configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) + : await configuration.accessToken; localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; } @@ -335,8 +335,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) // oauth required if (configuration && configuration.accessToken) { const localVarAccessTokenValue = typeof configuration.accessToken === 'function' - ? configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) - : configuration.accessToken; + ? await configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) + : await configuration.accessToken; localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; } @@ -389,8 +389,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) // oauth required if (configuration && configuration.accessToken) { const localVarAccessTokenValue = typeof configuration.accessToken === 'function' - ? configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) - : configuration.accessToken; + ? await configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) + : await configuration.accessToken; localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; } @@ -443,8 +443,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) // oauth required if (configuration && configuration.accessToken) { const localVarAccessTokenValue = typeof configuration.accessToken === 'function' - ? configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) - : configuration.accessToken; + ? await configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) + : await configuration.accessToken; localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; } @@ -547,8 +547,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) // oauth required if (configuration && configuration.accessToken) { const localVarAccessTokenValue = typeof configuration.accessToken === 'function' - ? configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) - : configuration.accessToken; + ? await configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) + : await configuration.accessToken; localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; } @@ -605,8 +605,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) // oauth required if (configuration && configuration.accessToken) { const localVarAccessTokenValue = typeof configuration.accessToken === 'function' - ? configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) - : configuration.accessToken; + ? await configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) + : await configuration.accessToken; localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; } @@ -670,8 +670,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) // oauth required if (configuration && configuration.accessToken) { const localVarAccessTokenValue = typeof configuration.accessToken === 'function' - ? configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) - : configuration.accessToken; + ? await configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) + : await configuration.accessToken; localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; } diff --git a/samples/client/petstore/typescript-axios/builds/with-single-request-parameters/configuration.ts b/samples/client/petstore/typescript-axios/builds/with-single-request-parameters/configuration.ts index 96fa41b21122..11ebab3da28e 100644 --- a/samples/client/petstore/typescript-axios/builds/with-single-request-parameters/configuration.ts +++ b/samples/client/petstore/typescript-axios/builds/with-single-request-parameters/configuration.ts @@ -17,7 +17,7 @@ export interface ConfigurationParameters { apiKey?: string | Promise | ((name: string) => string) | ((name: string) => Promise); username?: string; password?: string; - accessToken?: string | ((name?: string, scopes?: string[]) => string); + accessToken?: string | Promise | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise); basePath?: string; baseOptions?: any; } @@ -31,14 +31,14 @@ export class Configuration { apiKey?: string | Promise | ((name: string) => string) | ((name: string) => Promise); /** * parameter for basic security - * + * * @type {string} * @memberof Configuration */ username?: string; /** * parameter for basic security - * + * * @type {string} * @memberof Configuration */ @@ -49,10 +49,10 @@ export class Configuration { * @param scopes oauth2 scope * @memberof Configuration */ - accessToken?: string | ((name?: string, scopes?: string[]) => string); + accessToken?: string | Promise | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise); /** * override base path - * + * * @type {string} * @memberof Configuration */