forked from loafle/openapi-generator-original
Combine javascript and javascript-apollo generators (#13270)
* Combine javascript and javascript-apollo generator functionality * Combine javascript and javascript-apollo templates * update configs * deprecate javascript-apollo generator * bonus magic string deletion ✨ * update samples * update generator docs * fix: include .babelrc in apollo generation * update samples * update samples * rename javascript-apollo to javascript-apollo-deprecated * fix javascript apollo library template Apollo library now uses the partial_model_generic template file from the ES6 library, as it includes many fixes and improvements (including handling models with ill-named attributes) * update samples * Create javascript-apollo-deprecated.md * Updated javascript generator template's gitignore Updates .gitignore with that from https://github.com/github/gitignore/blob/main/Node.gitignore Main reason for the update is to ignore the 'dist' folder with compiled files by default. * javascript generator: merge api_test template files The only difference is that Apollo is not designed for browser, so having a "if(browser)" check is useless, but doesn't hurt. * update docs * cleanup * avoid possible config clash * update javascript-apollo sample * update javascript-es6 sample I kept the pom.xml from before * update javascript-promise-es6 sample kept pom.xml * update samples
This commit is contained in:
parent
2c22a01779
commit
62a0878bae
7
bin/configs/javascript-apollo.yaml
Normal file
7
bin/configs/javascript-apollo.yaml
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
generatorName: javascript
|
||||||
|
outputDir: samples/client/petstore/javascript-apollo
|
||||||
|
library: apollo
|
||||||
|
inputSpec: modules/openapi-generator/src/test/resources/3_0/javascript/petstore-with-fake-endpoints-models-for-testing.yaml
|
||||||
|
templateDir: modules/openapi-generator/src/main/resources/Javascript
|
||||||
|
additionalProperties:
|
||||||
|
appName: PetstoreClient
|
@ -1,6 +1,7 @@
|
|||||||
generatorName: javascript
|
generatorName: javascript
|
||||||
outputDir: samples/client/petstore/javascript-es6
|
outputDir: samples/client/petstore/javascript-es6
|
||||||
|
library: javascript
|
||||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/javascript/petstore-with-fake-endpoints-models-for-testing.yaml
|
inputSpec: modules/openapi-generator/src/test/resources/3_0/javascript/petstore-with-fake-endpoints-models-for-testing.yaml
|
||||||
templateDir: modules/openapi-generator/src/main/resources/Javascript/es6
|
templateDir: modules/openapi-generator/src/main/resources/Javascript
|
||||||
additionalProperties:
|
additionalProperties:
|
||||||
appName: PetstoreClient
|
appName: PetstoreClient
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
generatorName: javascript
|
generatorName: javascript
|
||||||
outputDir: samples/client/petstore/javascript-promise-es6
|
outputDir: samples/client/petstore/javascript-promise-es6
|
||||||
|
library: javascript
|
||||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/javascript/petstore-with-fake-endpoints-models-for-testing.yaml
|
inputSpec: modules/openapi-generator/src/test/resources/3_0/javascript/petstore-with-fake-endpoints-models-for-testing.yaml
|
||||||
templateDir: modules/openapi-generator/src/main/resources/Javascript/es6
|
templateDir: modules/openapi-generator/src/main/resources/Javascript
|
||||||
additionalProperties:
|
additionalProperties:
|
||||||
usePromises: "true"
|
usePromises: "true"
|
||||||
appName: PetstoreClient
|
appName: PetstoreClient
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
generatorName: javascript-apollo
|
generatorName: javascript-apollo
|
||||||
outputDir: samples/client/petstore/javascript-apollo
|
outputDir: samples/client/petstore/javascript-apollo-unmaintained
|
||||||
inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml
|
inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml
|
||||||
templateDir: modules/openapi-generator/src/main/resources/Javascript-Apollo
|
templateDir: modules/openapi-generator/src/main/resources/Javascript-Apollo
|
||||||
additionalProperties:
|
additionalProperties:
|
||||||
|
@ -34,7 +34,7 @@ The following generators are available:
|
|||||||
* [java](generators/java.md)
|
* [java](generators/java.md)
|
||||||
* [java-micronaut-client (beta)](generators/java-micronaut-client.md)
|
* [java-micronaut-client (beta)](generators/java-micronaut-client.md)
|
||||||
* [javascript](generators/javascript.md)
|
* [javascript](generators/javascript.md)
|
||||||
* [javascript-apollo](generators/javascript-apollo.md)
|
* [javascript-apollo-deprecated (deprecated)](generators/javascript-apollo-deprecated.md)
|
||||||
* [javascript-closure-angular](generators/javascript-closure-angular.md)
|
* [javascript-closure-angular](generators/javascript-closure-angular.md)
|
||||||
* [javascript-flowtyped](generators/javascript-flowtyped.md)
|
* [javascript-flowtyped](generators/javascript-flowtyped.md)
|
||||||
* [jaxrs-cxf-client](generators/jaxrs-cxf-client.md)
|
* [jaxrs-cxf-client](generators/jaxrs-cxf-client.md)
|
||||||
|
274
docs/generators/javascript-apollo-deprecated.md
Normal file
274
docs/generators/javascript-apollo-deprecated.md
Normal file
@ -0,0 +1,274 @@
|
|||||||
|
---
|
||||||
|
title: Documentation for the javascript-apollo-deprecated Generator
|
||||||
|
---
|
||||||
|
|
||||||
|
## METADATA
|
||||||
|
|
||||||
|
| Property | Value | Notes |
|
||||||
|
| -------- | ----- | ----- |
|
||||||
|
| generator name | javascript-apollo-deprecated | pass this to the generate command after -g |
|
||||||
|
| generator stability | DEPRECATED | |
|
||||||
|
| generator type | CLIENT | |
|
||||||
|
| generator language | Javascript | |
|
||||||
|
| generator default templating engine | mustache | |
|
||||||
|
| helpTxt | Generates a JavaScript client library (beta) using Apollo RESTDatasource. | |
|
||||||
|
|
||||||
|
## CONFIG OPTIONS
|
||||||
|
These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details.
|
||||||
|
|
||||||
|
| Option | Description | Values | Default |
|
||||||
|
| ------ | ----------- | ------ | ------- |
|
||||||
|
|allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false|
|
||||||
|
|apiPackage|package for generated api classes| |null|
|
||||||
|
|disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|<dl><dt>**false**</dt><dd>The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.</dd><dt>**true**</dt><dd>Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.</dd></dl>|true|
|
||||||
|
|emitJSDoc|generate JSDoc comments| |true|
|
||||||
|
|emitModelMethods|generate getters and setters for model properties| |false|
|
||||||
|
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|
||||||
|
|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|<dl><dt>**false**</dt><dd>No changes to the enum's are made, this is the default option.</dd><dt>**true**</dt><dd>With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.</dd></dl>|false|
|
||||||
|
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true|
|
||||||
|
|invokerPackage|root package for generated code| |null|
|
||||||
|
|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|<dl><dt>**true**</dt><dd>The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.</dd><dt>**false**</dt><dd>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.</dd></dl>|true|
|
||||||
|
|licenseName|name of the license the project uses (Default: using info.license.name)| |null|
|
||||||
|
|modelPackage|package for generated models| |null|
|
||||||
|
|modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |camelCase|
|
||||||
|
|moduleName|module name for AMD, Node or globals (Default: generated from <projectName>)| |null|
|
||||||
|
|npmRepository|Use this property to set an url your private npmRepo in the package.json| |null|
|
||||||
|
|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false|
|
||||||
|
|projectDescription|description of the project (Default: using info.description or "Client library of <projectName>")| |null|
|
||||||
|
|projectName|name of the project (Default: generated from info.title or "openapi-js-client")| |null|
|
||||||
|
|projectVersion|version of the project (Default: using info.version or "1.0.0")| |null|
|
||||||
|
|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true|
|
||||||
|
|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true|
|
||||||
|
|sourceFolder|source folder for generated code| |src|
|
||||||
|
|useInheritance|use JavaScript prototype chains & delegation for inheritance| |true|
|
||||||
|
|usePromises|use Promises as return values from the client API, instead of superagent callbacks| |false|
|
||||||
|
|
||||||
|
## IMPORT MAPPING
|
||||||
|
|
||||||
|
| Type/Alias | Imports |
|
||||||
|
| ---------- | ------- |
|
||||||
|
|
||||||
|
|
||||||
|
## INSTANTIATION TYPES
|
||||||
|
|
||||||
|
| Type/Alias | Instantiated By |
|
||||||
|
| ---------- | --------------- |
|
||||||
|
|array|Array|
|
||||||
|
|list|Array|
|
||||||
|
|map|Object|
|
||||||
|
|set|Array|
|
||||||
|
|
||||||
|
|
||||||
|
## LANGUAGE PRIMITIVES
|
||||||
|
|
||||||
|
<ul class="column-ul">
|
||||||
|
<li>Array</li>
|
||||||
|
<li>Blob</li>
|
||||||
|
<li>Boolean</li>
|
||||||
|
<li>Date</li>
|
||||||
|
<li>File</li>
|
||||||
|
<li>Number</li>
|
||||||
|
<li>Object</li>
|
||||||
|
<li>String</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
## RESERVED WORDS
|
||||||
|
|
||||||
|
<ul class="column-ul">
|
||||||
|
<li>Array</li>
|
||||||
|
<li>Date</li>
|
||||||
|
<li>Infinity</li>
|
||||||
|
<li>Math</li>
|
||||||
|
<li>NaN</li>
|
||||||
|
<li>Number</li>
|
||||||
|
<li>Object</li>
|
||||||
|
<li>String</li>
|
||||||
|
<li>abstract</li>
|
||||||
|
<li>arguments</li>
|
||||||
|
<li>boolean</li>
|
||||||
|
<li>break</li>
|
||||||
|
<li>byte</li>
|
||||||
|
<li>case</li>
|
||||||
|
<li>catch</li>
|
||||||
|
<li>char</li>
|
||||||
|
<li>class</li>
|
||||||
|
<li>const</li>
|
||||||
|
<li>continue</li>
|
||||||
|
<li>debugger</li>
|
||||||
|
<li>default</li>
|
||||||
|
<li>delete</li>
|
||||||
|
<li>do</li>
|
||||||
|
<li>double</li>
|
||||||
|
<li>else</li>
|
||||||
|
<li>enum</li>
|
||||||
|
<li>eval</li>
|
||||||
|
<li>export</li>
|
||||||
|
<li>extends</li>
|
||||||
|
<li>false</li>
|
||||||
|
<li>final</li>
|
||||||
|
<li>finally</li>
|
||||||
|
<li>float</li>
|
||||||
|
<li>for</li>
|
||||||
|
<li>function</li>
|
||||||
|
<li>goto</li>
|
||||||
|
<li>hasOwnProperty</li>
|
||||||
|
<li>if</li>
|
||||||
|
<li>implements</li>
|
||||||
|
<li>import</li>
|
||||||
|
<li>in</li>
|
||||||
|
<li>instanceof</li>
|
||||||
|
<li>int</li>
|
||||||
|
<li>interface</li>
|
||||||
|
<li>isFinite</li>
|
||||||
|
<li>isNaN</li>
|
||||||
|
<li>isPrototypeOf</li>
|
||||||
|
<li>let</li>
|
||||||
|
<li>long</li>
|
||||||
|
<li>native</li>
|
||||||
|
<li>new</li>
|
||||||
|
<li>null</li>
|
||||||
|
<li>package</li>
|
||||||
|
<li>private</li>
|
||||||
|
<li>protected</li>
|
||||||
|
<li>prototype</li>
|
||||||
|
<li>public</li>
|
||||||
|
<li>return</li>
|
||||||
|
<li>short</li>
|
||||||
|
<li>static</li>
|
||||||
|
<li>super</li>
|
||||||
|
<li>switch</li>
|
||||||
|
<li>synchronized</li>
|
||||||
|
<li>this</li>
|
||||||
|
<li>throw</li>
|
||||||
|
<li>throws</li>
|
||||||
|
<li>toString</li>
|
||||||
|
<li>transient</li>
|
||||||
|
<li>true</li>
|
||||||
|
<li>try</li>
|
||||||
|
<li>typeof</li>
|
||||||
|
<li>undefined</li>
|
||||||
|
<li>valueOf</li>
|
||||||
|
<li>var</li>
|
||||||
|
<li>void</li>
|
||||||
|
<li>volatile</li>
|
||||||
|
<li>while</li>
|
||||||
|
<li>with</li>
|
||||||
|
<li>yield</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
## FEATURE SET
|
||||||
|
|
||||||
|
|
||||||
|
### Client Modification Feature
|
||||||
|
| Name | Supported | Defined By |
|
||||||
|
| ---- | --------- | ---------- |
|
||||||
|
|BasePath|✗|ToolingExtension
|
||||||
|
|Authorizations|✗|ToolingExtension
|
||||||
|
|UserAgent|✗|ToolingExtension
|
||||||
|
|MockServer|✗|ToolingExtension
|
||||||
|
|
||||||
|
### Data Type Feature
|
||||||
|
| Name | Supported | Defined By |
|
||||||
|
| ---- | --------- | ---------- |
|
||||||
|
|Custom|✗|OAS2,OAS3
|
||||||
|
|Int32|✓|OAS2,OAS3
|
||||||
|
|Int64|✓|OAS2,OAS3
|
||||||
|
|Float|✓|OAS2,OAS3
|
||||||
|
|Double|✓|OAS2,OAS3
|
||||||
|
|Decimal|✓|ToolingExtension
|
||||||
|
|String|✓|OAS2,OAS3
|
||||||
|
|Byte|✓|OAS2,OAS3
|
||||||
|
|Binary|✓|OAS2,OAS3
|
||||||
|
|Boolean|✓|OAS2,OAS3
|
||||||
|
|Date|✓|OAS2,OAS3
|
||||||
|
|DateTime|✓|OAS2,OAS3
|
||||||
|
|Password|✓|OAS2,OAS3
|
||||||
|
|File|✓|OAS2
|
||||||
|
|Uuid|✗|
|
||||||
|
|Array|✓|OAS2,OAS3
|
||||||
|
|Null|✗|OAS3
|
||||||
|
|AnyType|✗|OAS2,OAS3
|
||||||
|
|Object|✓|OAS2,OAS3
|
||||||
|
|Maps|✓|ToolingExtension
|
||||||
|
|CollectionFormat|✓|OAS2
|
||||||
|
|CollectionFormatMulti|✓|OAS2
|
||||||
|
|Enum|✓|OAS2,OAS3
|
||||||
|
|ArrayOfEnum|✓|ToolingExtension
|
||||||
|
|ArrayOfModel|✓|ToolingExtension
|
||||||
|
|ArrayOfCollectionOfPrimitives|✓|ToolingExtension
|
||||||
|
|ArrayOfCollectionOfModel|✓|ToolingExtension
|
||||||
|
|ArrayOfCollectionOfEnum|✓|ToolingExtension
|
||||||
|
|MapOfEnum|✓|ToolingExtension
|
||||||
|
|MapOfModel|✓|ToolingExtension
|
||||||
|
|MapOfCollectionOfPrimitives|✓|ToolingExtension
|
||||||
|
|MapOfCollectionOfModel|✓|ToolingExtension
|
||||||
|
|MapOfCollectionOfEnum|✓|ToolingExtension
|
||||||
|
|
||||||
|
### Documentation Feature
|
||||||
|
| Name | Supported | Defined By |
|
||||||
|
| ---- | --------- | ---------- |
|
||||||
|
|Readme|✓|ToolingExtension
|
||||||
|
|Model|✓|ToolingExtension
|
||||||
|
|Api|✓|ToolingExtension
|
||||||
|
|
||||||
|
### Global Feature
|
||||||
|
| Name | Supported | Defined By |
|
||||||
|
| ---- | --------- | ---------- |
|
||||||
|
|Host|✓|OAS2,OAS3
|
||||||
|
|BasePath|✓|OAS2,OAS3
|
||||||
|
|Info|✓|OAS2,OAS3
|
||||||
|
|Schemes|✗|OAS2,OAS3
|
||||||
|
|PartialSchemes|✓|OAS2,OAS3
|
||||||
|
|Consumes|✓|OAS2
|
||||||
|
|Produces|✓|OAS2
|
||||||
|
|ExternalDocumentation|✓|OAS2,OAS3
|
||||||
|
|Examples|✓|OAS2,OAS3
|
||||||
|
|XMLStructureDefinitions|✗|OAS2,OAS3
|
||||||
|
|MultiServer|✗|OAS3
|
||||||
|
|ParameterizedServer|✗|OAS3
|
||||||
|
|ParameterStyling|✗|OAS3
|
||||||
|
|Callbacks|✓|OAS3
|
||||||
|
|LinkObjects|✗|OAS3
|
||||||
|
|
||||||
|
### Parameter Feature
|
||||||
|
| Name | Supported | Defined By |
|
||||||
|
| ---- | --------- | ---------- |
|
||||||
|
|Path|✓|OAS2,OAS3
|
||||||
|
|Query|✓|OAS2,OAS3
|
||||||
|
|Header|✓|OAS2,OAS3
|
||||||
|
|Body|✓|OAS2
|
||||||
|
|FormUnencoded|✓|OAS2
|
||||||
|
|FormMultipart|✓|OAS2
|
||||||
|
|Cookie|✓|OAS3
|
||||||
|
|
||||||
|
### Schema Support Feature
|
||||||
|
| Name | Supported | Defined By |
|
||||||
|
| ---- | --------- | ---------- |
|
||||||
|
|Simple|✓|OAS2,OAS3
|
||||||
|
|Composite|✓|OAS2,OAS3
|
||||||
|
|Polymorphism|✓|OAS2,OAS3
|
||||||
|
|Union|✗|OAS3
|
||||||
|
|allOf|✗|OAS2,OAS3
|
||||||
|
|anyOf|✗|OAS3
|
||||||
|
|oneOf|✗|OAS3
|
||||||
|
|not|✗|OAS3
|
||||||
|
|
||||||
|
### Security Feature
|
||||||
|
| Name | Supported | Defined By |
|
||||||
|
| ---- | --------- | ---------- |
|
||||||
|
|BasicAuth|✓|OAS2,OAS3
|
||||||
|
|ApiKey|✓|OAS2,OAS3
|
||||||
|
|OpenIDConnect|✗|OAS3
|
||||||
|
|BearerToken|✓|OAS3
|
||||||
|
|OAuth2_Implicit|✓|OAS2,OAS3
|
||||||
|
|OAuth2_Password|✓|OAS2,OAS3
|
||||||
|
|OAuth2_ClientCredentials|✓|OAS2,OAS3
|
||||||
|
|OAuth2_AuthorizationCode|✓|OAS2,OAS3
|
||||||
|
|
||||||
|
### Wire Format Feature
|
||||||
|
| Name | Supported | Defined By |
|
||||||
|
| ---- | --------- | ---------- |
|
||||||
|
|JSON|✓|OAS2,OAS3
|
||||||
|
|XML|✓|OAS2,OAS3
|
||||||
|
|PROTOBUF|✗|ToolingExtension
|
||||||
|
|Custom|✗|OAS2,OAS3
|
@ -7,7 +7,7 @@ title: Documentation for the javascript-apollo Generator
|
|||||||
| Property | Value | Notes |
|
| Property | Value | Notes |
|
||||||
| -------- | ----- | ----- |
|
| -------- | ----- | ----- |
|
||||||
| generator name | javascript-apollo | pass this to the generate command after -g |
|
| generator name | javascript-apollo | pass this to the generate command after -g |
|
||||||
| generator stability | STABLE | |
|
| generator stability | DEPRECATED | |
|
||||||
| generator type | CLIENT | |
|
| generator type | CLIENT | |
|
||||||
| generator language | Javascript | |
|
| generator language | Javascript | |
|
||||||
| generator default templating engine | mustache | |
|
| generator default templating engine | mustache | |
|
||||||
|
@ -28,6 +28,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
|||||||
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true|
|
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true|
|
||||||
|invokerPackage|root package for generated code| |null|
|
|invokerPackage|root package for generated code| |null|
|
||||||
|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|<dl><dt>**true**</dt><dd>The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.</dd><dt>**false**</dt><dd>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.</dd></dl>|true|
|
|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|<dl><dt>**true**</dt><dd>The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.</dd><dt>**false**</dt><dd>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.</dd></dl>|true|
|
||||||
|
|library|library template (sub-template)|<dl><dt>**javascript**</dt><dd>JavaScript client library</dd><dt>**apollo**</dt><dd>Apollo REST DataSource</dd></dl>|javascript|
|
||||||
|licenseName|name of the license the project uses (Default: using info.license.name)| |null|
|
|licenseName|name of the license the project uses (Default: using info.license.name)| |null|
|
||||||
|modelPackage|package for generated models| |null|
|
|modelPackage|package for generated models| |null|
|
||||||
|modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |camelCase|
|
|modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |camelCase|
|
||||||
|
@ -5936,7 +5936,7 @@ public class DefaultCodegen implements CodegenConfig {
|
|||||||
for (String lib : supportedLibraries.keySet()) {
|
for (String lib : supportedLibraries.keySet()) {
|
||||||
sb.append("\n").append(lib).append(" - ").append(supportedLibraries.get(lib));
|
sb.append("\n").append(lib).append(" - ").append(supportedLibraries.get(lib));
|
||||||
}
|
}
|
||||||
return new CliOption("library", sb.toString());
|
return new CliOption(CodegenConstants.LIBRARY, sb.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -104,6 +104,10 @@ public class JavascriptApolloClientCodegen extends DefaultCodegen implements Cod
|
|||||||
|
|
||||||
modifyFeatureSet(features -> features.includeDocumentationFeatures(DocumentationFeature.Readme));
|
modifyFeatureSet(features -> features.includeDocumentationFeatures(DocumentationFeature.Readme));
|
||||||
|
|
||||||
|
generatorMetadata = GeneratorMetadata.newBuilder(generatorMetadata)
|
||||||
|
.stability(Stability.DEPRECATED)
|
||||||
|
.build();
|
||||||
|
|
||||||
outputFolder = "generated-code/js";
|
outputFolder = "generated-code/js";
|
||||||
modelTemplateFiles.put("model.mustache", ".js");
|
modelTemplateFiles.put("model.mustache", ".js");
|
||||||
modelTestTemplateFiles.put("model_test.mustache", ".js");
|
modelTestTemplateFiles.put("model_test.mustache", ".js");
|
||||||
@ -217,7 +221,7 @@ public class JavascriptApolloClientCodegen extends DefaultCodegen implements Cod
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return "javascript-apollo";
|
return "javascript-apollo-deprecated";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -56,28 +56,8 @@ public class JavascriptClientCodegen extends DefaultCodegen implements CodegenCo
|
|||||||
public static final String USE_ES6 = "useES6";
|
public static final String USE_ES6 = "useES6";
|
||||||
public static final String NPM_REPOSITORY = "npmRepository";
|
public static final String NPM_REPOSITORY = "npmRepository";
|
||||||
|
|
||||||
final String[][] JAVASCRIPT_SUPPORTING_FILES = {
|
public static final String LIBRARY_JAVASCRIPT = "javascript";
|
||||||
new String[]{"package.mustache", "package.json"},
|
public static final String LIBRARY_APOLLO = "apollo";
|
||||||
// new String[]{"index.mustache", "src/index.js", },
|
|
||||||
// new String[]{"ApiClient.mustache", "src/ApiClient.js"},
|
|
||||||
new String[]{"git_push.sh.mustache", "git_push.sh"},
|
|
||||||
new String[]{"README.mustache", "README.md"},
|
|
||||||
new String[]{"mocha.opts", "mocha.opts"},
|
|
||||||
new String[]{"travis.yml", ".travis.yml"},
|
|
||||||
new String[]{"gitignore.mustache", ".gitignore"}
|
|
||||||
};
|
|
||||||
|
|
||||||
final String[][] JAVASCRIPT_ES6_SUPPORTING_FILES = {
|
|
||||||
new String[]{"package.mustache", "package.json"},
|
|
||||||
// new String[]{"index.mustache", "src/index.js"},
|
|
||||||
// new String[]{"ApiClient.mustache", "src/ApiClient.js"},
|
|
||||||
new String[]{"git_push.sh.mustache", "git_push.sh"},
|
|
||||||
new String[]{"README.mustache", "README.md"},
|
|
||||||
new String[]{"mocha.opts", "mocha.opts"},
|
|
||||||
new String[]{"travis.yml", ".travis.yml"},
|
|
||||||
new String[]{".babelrc.mustache", ".babelrc"},
|
|
||||||
new String[]{"gitignore.mustache", ".gitignore"}
|
|
||||||
};
|
|
||||||
|
|
||||||
protected String projectName;
|
protected String projectName;
|
||||||
protected String moduleName;
|
protected String moduleName;
|
||||||
@ -109,7 +89,7 @@ public class JavascriptClientCodegen extends DefaultCodegen implements CodegenCo
|
|||||||
apiTemplateFiles.put("api.mustache", ".js");
|
apiTemplateFiles.put("api.mustache", ".js");
|
||||||
apiTestTemplateFiles.put("api_test.mustache", ".js");
|
apiTestTemplateFiles.put("api_test.mustache", ".js");
|
||||||
// subfolder Javascript/es6
|
// subfolder Javascript/es6
|
||||||
embeddedTemplateDir = templateDir = "Javascript" + File.separator + "es6";
|
embeddedTemplateDir = templateDir = "Javascript";
|
||||||
apiPackage = "api";
|
apiPackage = "api";
|
||||||
modelPackage = "model";
|
modelPackage = "model";
|
||||||
modelDocTemplateFiles.put("model_doc.mustache", ".md");
|
modelDocTemplateFiles.put("model_doc.mustache", ".md");
|
||||||
@ -207,6 +187,13 @@ public class JavascriptClientCodegen extends DefaultCodegen implements CodegenCo
|
|||||||
.defaultValue(Boolean.TRUE.toString()));
|
.defaultValue(Boolean.TRUE.toString()));
|
||||||
cliOptions.add(new CliOption(CodegenConstants.MODEL_PROPERTY_NAMING, CodegenConstants.MODEL_PROPERTY_NAMING_DESC).defaultValue("camelCase"));
|
cliOptions.add(new CliOption(CodegenConstants.MODEL_PROPERTY_NAMING, CodegenConstants.MODEL_PROPERTY_NAMING_DESC).defaultValue("camelCase"));
|
||||||
cliOptions.add(new CliOption(NPM_REPOSITORY, "Use this property to set an url your private npmRepo in the package.json"));
|
cliOptions.add(new CliOption(NPM_REPOSITORY, "Use this property to set an url your private npmRepo in the package.json"));
|
||||||
|
|
||||||
|
supportedLibraries.put(LIBRARY_JAVASCRIPT, "JavaScript client library");
|
||||||
|
supportedLibraries.put(LIBRARY_APOLLO, "Apollo REST DataSource");
|
||||||
|
setLibrary(LIBRARY_JAVASCRIPT);
|
||||||
|
final CliOption library = new CliOption(CodegenConstants.LIBRARY, CodegenConstants.LIBRARY_DESC).defaultValue(LIBRARY_JAVASCRIPT);
|
||||||
|
library.setEnum(supportedLibraries);
|
||||||
|
cliOptions.add(library);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -275,6 +262,9 @@ public class JavascriptClientCodegen extends DefaultCodegen implements CodegenCo
|
|||||||
if (additionalProperties.containsKey(NPM_REPOSITORY)) {
|
if (additionalProperties.containsKey(NPM_REPOSITORY)) {
|
||||||
setNpmRepository(((String) additionalProperties.get(NPM_REPOSITORY)));
|
setNpmRepository(((String) additionalProperties.get(NPM_REPOSITORY)));
|
||||||
}
|
}
|
||||||
|
if (additionalProperties.containsKey(CodegenConstants.LIBRARY)) {
|
||||||
|
setLibrary((String) additionalProperties.get(CodegenConstants.LIBRARY));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -344,18 +334,18 @@ public class JavascriptClientCodegen extends DefaultCodegen implements CodegenCo
|
|||||||
additionalProperties.put("apiDocPath", apiDocPath);
|
additionalProperties.put("apiDocPath", apiDocPath);
|
||||||
additionalProperties.put("modelDocPath", modelDocPath);
|
additionalProperties.put("modelDocPath", modelDocPath);
|
||||||
|
|
||||||
String[][] supportingTemplateFiles = JAVASCRIPT_SUPPORTING_FILES;
|
supportingFiles.add(new SupportingFile("package.mustache", "package.json"));
|
||||||
if (useES6) {
|
supportingFiles.add(new SupportingFile("git_push.sh.mustache", "git_push.sh"));
|
||||||
supportingTemplateFiles = JAVASCRIPT_ES6_SUPPORTING_FILES;
|
supportingFiles.add(new SupportingFile("README.mustache", "README.md"));
|
||||||
}
|
supportingFiles.add(new SupportingFile("mocha.opts", "mocha.opts"));
|
||||||
|
supportingFiles.add(new SupportingFile("travis.yml", ".travis.yml"));
|
||||||
for (String[] supportingTemplateFile : supportingTemplateFiles) {
|
supportingFiles.add(new SupportingFile("gitignore.mustache", ".gitignore"));
|
||||||
supportingFiles.add(new SupportingFile(supportingTemplateFile[0], "", supportingTemplateFile[1]));
|
|
||||||
}
|
|
||||||
|
|
||||||
supportingFiles.add(new SupportingFile("index.mustache", createPath(sourceFolder, invokerPackage), "index.js"));
|
supportingFiles.add(new SupportingFile("index.mustache", createPath(sourceFolder, invokerPackage), "index.js"));
|
||||||
supportingFiles.add(new SupportingFile("ApiClient.mustache", createPath(sourceFolder, invokerPackage), "ApiClient.js"));
|
supportingFiles.add(new SupportingFile("ApiClient.mustache", createPath(sourceFolder, invokerPackage), "ApiClient.js"));
|
||||||
|
|
||||||
|
if (useES6 || LIBRARY_APOLLO.equals(library)) {
|
||||||
|
supportingFiles.add(new SupportingFile(".babelrc.mustache", ".babelrc"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -1000,9 +990,14 @@ public class JavascriptClientCodegen extends DefaultCodegen implements CodegenCo
|
|||||||
argList.add("opts");
|
argList.add("opts");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!usePromises) {
|
// Add extra function arguments after the required and optional API call parameters:
|
||||||
|
if (LIBRARY_JAVASCRIPT.equals(library) && !usePromises) {
|
||||||
argList.add("callback");
|
argList.add("callback");
|
||||||
}
|
}
|
||||||
|
if (LIBRARY_APOLLO.equals(library)) {
|
||||||
|
argList.add("requestInit");
|
||||||
|
}
|
||||||
|
|
||||||
String joinedArgList = StringUtils.join(argList, ", ");
|
String joinedArgList = StringUtils.join(argList, ", ");
|
||||||
operation.vendorExtensions.put("x-codegen-arg-list", joinedArgList);
|
operation.vendorExtensions.put("x-codegen-arg-list", joinedArgList);
|
||||||
operation.vendorExtensions.put("x-codegen-has-optional-params", hasOptionalParams);
|
operation.vendorExtensions.put("x-codegen-has-optional-params", hasOptionalParams);
|
||||||
|
@ -1,33 +0,0 @@
|
|||||||
# Logs
|
|
||||||
logs
|
|
||||||
*.log
|
|
||||||
npm-debug.log*
|
|
||||||
|
|
||||||
# Runtime data
|
|
||||||
pids
|
|
||||||
*.pid
|
|
||||||
*.seed
|
|
||||||
|
|
||||||
# Directory for instrumented libs generated by jscoverage/JSCover
|
|
||||||
lib-cov
|
|
||||||
|
|
||||||
# Coverage directory used by tools like istanbul
|
|
||||||
coverage
|
|
||||||
|
|
||||||
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
|
|
||||||
.grunt
|
|
||||||
|
|
||||||
# node-waf configuration
|
|
||||||
.lock-wscript
|
|
||||||
|
|
||||||
# Compiled binary addons (http://nodejs.org/api/addons.html)
|
|
||||||
build/Release
|
|
||||||
|
|
||||||
# Dependency directory
|
|
||||||
node_modules
|
|
||||||
|
|
||||||
# Optional npm cache directory
|
|
||||||
.npm
|
|
||||||
|
|
||||||
# Optional REPL history
|
|
||||||
.node_repl_history
|
|
130
modules/openapi-generator/src/main/resources/Javascript/gitignore.mustache
vendored
Normal file
130
modules/openapi-generator/src/main/resources/Javascript/gitignore.mustache
vendored
Normal file
@ -0,0 +1,130 @@
|
|||||||
|
# Logs
|
||||||
|
logs
|
||||||
|
*.log
|
||||||
|
npm-debug.log*
|
||||||
|
yarn-debug.log*
|
||||||
|
yarn-error.log*
|
||||||
|
lerna-debug.log*
|
||||||
|
.pnpm-debug.log*
|
||||||
|
|
||||||
|
# Diagnostic reports (https://nodejs.org/api/report.html)
|
||||||
|
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
|
||||||
|
|
||||||
|
# Runtime data
|
||||||
|
pids
|
||||||
|
*.pid
|
||||||
|
*.seed
|
||||||
|
*.pid.lock
|
||||||
|
|
||||||
|
# Directory for instrumented libs generated by jscoverage/JSCover
|
||||||
|
lib-cov
|
||||||
|
|
||||||
|
# Coverage directory used by tools like istanbul
|
||||||
|
coverage
|
||||||
|
*.lcov
|
||||||
|
|
||||||
|
# nyc test coverage
|
||||||
|
.nyc_output
|
||||||
|
|
||||||
|
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
|
||||||
|
.grunt
|
||||||
|
|
||||||
|
# Bower dependency directory (https://bower.io/)
|
||||||
|
bower_components
|
||||||
|
|
||||||
|
# node-waf configuration
|
||||||
|
.lock-wscript
|
||||||
|
|
||||||
|
# Compiled binary addons (https://nodejs.org/api/addons.html)
|
||||||
|
build/Release
|
||||||
|
|
||||||
|
# Dependency directories
|
||||||
|
node_modules/
|
||||||
|
jspm_packages/
|
||||||
|
|
||||||
|
# Snowpack dependency directory (https://snowpack.dev/)
|
||||||
|
web_modules/
|
||||||
|
|
||||||
|
# TypeScript cache
|
||||||
|
*.tsbuildinfo
|
||||||
|
|
||||||
|
# Optional npm cache directory
|
||||||
|
.npm
|
||||||
|
|
||||||
|
# Optional eslint cache
|
||||||
|
.eslintcache
|
||||||
|
|
||||||
|
# Optional stylelint cache
|
||||||
|
.stylelintcache
|
||||||
|
|
||||||
|
# Microbundle cache
|
||||||
|
.rpt2_cache/
|
||||||
|
.rts2_cache_cjs/
|
||||||
|
.rts2_cache_es/
|
||||||
|
.rts2_cache_umd/
|
||||||
|
|
||||||
|
# Optional REPL history
|
||||||
|
.node_repl_history
|
||||||
|
|
||||||
|
# Output of 'npm pack'
|
||||||
|
*.tgz
|
||||||
|
|
||||||
|
# Yarn Integrity file
|
||||||
|
.yarn-integrity
|
||||||
|
|
||||||
|
# dotenv environment variable files
|
||||||
|
.env
|
||||||
|
.env.development.local
|
||||||
|
.env.test.local
|
||||||
|
.env.production.local
|
||||||
|
.env.local
|
||||||
|
|
||||||
|
# parcel-bundler cache (https://parceljs.org/)
|
||||||
|
.cache
|
||||||
|
.parcel-cache
|
||||||
|
|
||||||
|
# Next.js build output
|
||||||
|
.next
|
||||||
|
out
|
||||||
|
|
||||||
|
# Nuxt.js build / generate output
|
||||||
|
.nuxt
|
||||||
|
dist
|
||||||
|
|
||||||
|
# Gatsby files
|
||||||
|
.cache/
|
||||||
|
# Comment in the public line in if your project uses Gatsby and not Next.js
|
||||||
|
# https://nextjs.org/blog/next-9-1#public-directory-support
|
||||||
|
# public
|
||||||
|
|
||||||
|
# vuepress build output
|
||||||
|
.vuepress/dist
|
||||||
|
|
||||||
|
# vuepress v2.x temp and cache directory
|
||||||
|
.temp
|
||||||
|
.cache
|
||||||
|
|
||||||
|
# Docusaurus cache and generated files
|
||||||
|
.docusaurus
|
||||||
|
|
||||||
|
# Serverless directories
|
||||||
|
.serverless/
|
||||||
|
|
||||||
|
# FuseBox cache
|
||||||
|
.fusebox/
|
||||||
|
|
||||||
|
# DynamoDB Local files
|
||||||
|
.dynamodb/
|
||||||
|
|
||||||
|
# TernJS port file
|
||||||
|
.tern-port
|
||||||
|
|
||||||
|
# Stores VSCode versions used for testing VSCode extensions
|
||||||
|
.vscode-test
|
||||||
|
|
||||||
|
# yarn v2
|
||||||
|
.yarn/cache
|
||||||
|
.yarn/unplugged
|
||||||
|
.yarn/build-state.yml
|
||||||
|
.yarn/install-state.gz
|
||||||
|
.pnp.*
|
306
modules/openapi-generator/src/main/resources/Javascript/libraries/apollo/ApiClient.mustache
vendored
Normal file
306
modules/openapi-generator/src/main/resources/Javascript/libraries/apollo/ApiClient.mustache
vendored
Normal file
@ -0,0 +1,306 @@
|
|||||||
|
{{>licenseInfo}}
|
||||||
|
|
||||||
|
import { RESTDataSource } from 'apollo-datasource-rest';
|
||||||
|
|
||||||
|
{{#emitJSDoc}}/**
|
||||||
|
* @module {{#invokerPackage}}{{.}}/{{/invokerPackage}}ApiClient
|
||||||
|
* @version {{projectVersion}}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Manages low level client-server communications, parameter marshalling, etc. There should not be any need for an
|
||||||
|
* application to use this class directly - the *Api and model classes provide the public API for the service.
|
||||||
|
* @alias module:{{#invokerPackage}}{{.}}/{{/invokerPackage}}ApiClient
|
||||||
|
* @class
|
||||||
|
*/{{/emitJSDoc}}
|
||||||
|
export default class ApiClient extends RESTDataSource {
|
||||||
|
constructor(baseURL = '{{{basePath}}}') {
|
||||||
|
super()
|
||||||
|
|
||||||
|
{{#emitJSDoc}}/**
|
||||||
|
* The base URL against which to resolve every API call's (relative) path.
|
||||||
|
* @type {String}
|
||||||
|
* @default {{{basePath}}}
|
||||||
|
*/{{/emitJSDoc}}
|
||||||
|
this.baseURL = baseURL.replace(/\/+$/, '');
|
||||||
|
|
||||||
|
{{#emitJSDoc}}/**
|
||||||
|
* The authentication methods to be included for all API calls.
|
||||||
|
* @type {Array.<String>}
|
||||||
|
*/{{/emitJSDoc}}{{=< >=}}
|
||||||
|
this.authentications = {
|
||||||
|
<#authMethods>
|
||||||
|
<#isBasic>
|
||||||
|
<#isBasicBasic>
|
||||||
|
'<name>': {type: 'basic'}<^-last>,</-last>
|
||||||
|
</isBasicBasic>
|
||||||
|
<#isBasicBearer>
|
||||||
|
'<name>': {type: 'bearer'}<^-last>,</-last><#bearerFormat> // <&.></bearerFormat>
|
||||||
|
</isBasicBearer>
|
||||||
|
</isBasic>
|
||||||
|
<#isApiKey>
|
||||||
|
'<name>': {type: 'apiKey', 'in': <#isKeyInHeader>'header'</isKeyInHeader><^isKeyInHeader>'query'</isKeyInHeader>, name: '<keyParamName>'}<^-last>,</-last>
|
||||||
|
</isApiKey>
|
||||||
|
<#isOAuth>
|
||||||
|
'<name>': {type: 'oauth2'}<^-last>,</-last>
|
||||||
|
</isOAuth>
|
||||||
|
</authMethods>
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
paramToString(param) {
|
||||||
|
if (param == undefined || param == null) {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
if (param instanceof Date) {
|
||||||
|
return param.toJSON();
|
||||||
|
}
|
||||||
|
|
||||||
|
return param.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
parametrizePath(path, pathParams) {
|
||||||
|
return path.replace(/\{([\w-]+)\}/g, (fullMatch, key) => {
|
||||||
|
var value;
|
||||||
|
if (pathParams.hasOwnProperty(key)) {
|
||||||
|
value = this.paramToString(pathParams[key]);
|
||||||
|
} else {
|
||||||
|
value = fullMatch;
|
||||||
|
}
|
||||||
|
|
||||||
|
return encodeURIComponent(value);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
isFileParam(param) {
|
||||||
|
// fs.ReadStream in Node.js and Electron (but not in runtime like browserify)
|
||||||
|
if (typeof require === 'function') {
|
||||||
|
let fs;
|
||||||
|
try {
|
||||||
|
fs = require('fs');
|
||||||
|
} catch (err) {}
|
||||||
|
if (fs && fs.ReadStream && param instanceof fs.ReadStream) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Buffer in Node.js
|
||||||
|
if (typeof Buffer === 'function' && param instanceof Buffer) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Blob in browser
|
||||||
|
if (typeof Blob === 'function' && param instanceof Blob) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// File in browser (it seems File object is also instance of Blob, but keep this for safe)
|
||||||
|
if (typeof File === 'function' && param instanceof File) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
normalizeParams(params) {
|
||||||
|
var newParams = {};
|
||||||
|
for (var key in params) {
|
||||||
|
if (params.hasOwnProperty(key) && params[key] != undefined && params[key] != null) {
|
||||||
|
var value = params[key];
|
||||||
|
if (this.isFileParam(value) || Array.isArray(value)) {
|
||||||
|
newParams[key] = value;
|
||||||
|
} else {
|
||||||
|
newParams[key] = this.paramToString(value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return newParams;
|
||||||
|
}
|
||||||
|
|
||||||
|
buildCollectionParam(param, collectionFormat) {
|
||||||
|
if (param == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
switch (collectionFormat) {
|
||||||
|
case 'csv':
|
||||||
|
return param.map(this.paramToString).join(',');
|
||||||
|
case 'ssv':
|
||||||
|
return param.map(this.paramToString).join(' ');
|
||||||
|
case 'tsv':
|
||||||
|
return param.map(this.paramToString).join('\t');
|
||||||
|
case 'pipes':
|
||||||
|
return param.map(this.paramToString).join('|');
|
||||||
|
case 'multi':
|
||||||
|
//return the array directly as SuperAgent will handle it as expected
|
||||||
|
return param.map(this.paramToString);
|
||||||
|
default:
|
||||||
|
throw new Error('Unknown collection format: ' + collectionFormat);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
applyAuthOptions(fetchOptions, authNames) {
|
||||||
|
fetchOptions.headers = fetchOptions.headers || {};
|
||||||
|
|
||||||
|
authNames.forEach((authName) => {
|
||||||
|
var auth = this.authentications[authName];
|
||||||
|
switch (auth.type) {
|
||||||
|
case 'basic':
|
||||||
|
if (auth.username || auth.password) {
|
||||||
|
fetchOptions.headers['Authorization'] = 'Basic ' + base64.encode(auth.username + ":" + auth.password);
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
case 'bearer':
|
||||||
|
case 'oauth2':
|
||||||
|
if (auth.accessToken) {
|
||||||
|
fetchOptions.headers['Authorization'] = 'Bearer ' + auth.accessToken;
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
case 'apiKey':
|
||||||
|
if (auth.apiKey) {
|
||||||
|
var data = {};
|
||||||
|
if (auth.apiKeyPrefix) {
|
||||||
|
data[auth.name] = auth.apiKeyPrefix + ' ' + auth.apiKey;
|
||||||
|
} else {
|
||||||
|
data[auth.name] = auth.apiKey;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (auth['in'] === 'header') {
|
||||||
|
Object.assign(fetchOptions.headers, data);
|
||||||
|
} else {
|
||||||
|
Object.assign(fetchOptions.params, data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
throw new Error('Unknown authentication type: ' + auth.type);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
async callApi(path, httpMethod, pathParams,
|
||||||
|
queryParams, headerParams, formParams, bodyParam, authNames,
|
||||||
|
contentTypes, accepts, returnType, requestInit) {
|
||||||
|
|
||||||
|
var parameterizedPath = this.parametrizePath(path, pathParams);
|
||||||
|
var fetchOptions = {
|
||||||
|
headers: headerParams,
|
||||||
|
params: queryParams
|
||||||
|
};
|
||||||
|
|
||||||
|
this.applyAuthOptions(fetchOptions, authNames);
|
||||||
|
|
||||||
|
var body = null;
|
||||||
|
|
||||||
|
if (bodyParam !== null && bodyParam !== undefined) {
|
||||||
|
body = bodyParam;
|
||||||
|
} else if (formParams !== null && formParams !== undefined) {
|
||||||
|
var _formParams = this.normalizeParams(formParams);
|
||||||
|
for (var key in _formParams) {
|
||||||
|
if (_formParams.hasOwnProperty(key)) {
|
||||||
|
body[key] = _formParams[key];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var response;
|
||||||
|
var httpMethodFn = httpMethod.toLowerCase();
|
||||||
|
|
||||||
|
if (httpMethodFn == 'get' || httpMethodFn == 'delete') {
|
||||||
|
response = await this[httpMethodFn](parameterizedPath, [], requestInit);
|
||||||
|
} else {
|
||||||
|
response = await this[httpMethodFn](parameterizedPath, body, requestInit)
|
||||||
|
}
|
||||||
|
|
||||||
|
var convertedResponse = ApiClient.convertToType(response, returnType);
|
||||||
|
return convertedResponse;
|
||||||
|
}
|
||||||
|
|
||||||
|
static parseDate(str) {
|
||||||
|
return new Date(str);
|
||||||
|
}
|
||||||
|
|
||||||
|
static convertToType(data, type) {
|
||||||
|
if (data === null || data === undefined)
|
||||||
|
return data
|
||||||
|
|
||||||
|
switch (type) {
|
||||||
|
case 'Boolean':
|
||||||
|
return Boolean(data);
|
||||||
|
case 'Integer':
|
||||||
|
return parseInt(data, 10);
|
||||||
|
case 'Number':
|
||||||
|
return parseFloat(data);
|
||||||
|
case 'String':
|
||||||
|
return String(data);
|
||||||
|
case 'Date':
|
||||||
|
return ApiClient.parseDate(String(data));
|
||||||
|
case 'Blob':
|
||||||
|
return data;
|
||||||
|
default:
|
||||||
|
if (typeof type === "object") {
|
||||||
|
// generic object, return directly
|
||||||
|
return data;
|
||||||
|
} else if (typeof type.constructFromObject === 'function') {
|
||||||
|
// for model type like User and enum class
|
||||||
|
return type.constructFromObject(data);
|
||||||
|
} else if (Array.isArray(type)) {
|
||||||
|
// for array type like: ['String']
|
||||||
|
var itemType = type[0];
|
||||||
|
|
||||||
|
return data.map((item) => {
|
||||||
|
return ApiClient.convertToType(item, itemType);
|
||||||
|
});
|
||||||
|
} else if (typeof type === 'object') {
|
||||||
|
// for plain object type like: {'String': 'Integer'}
|
||||||
|
var keyType, valueType;
|
||||||
|
for (var k in type) {
|
||||||
|
if (type.hasOwnProperty(k)) {
|
||||||
|
keyType = k;
|
||||||
|
valueType = type[k];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var result = {};
|
||||||
|
for (var k in data) {
|
||||||
|
if (data.hasOwnProperty(k)) {
|
||||||
|
var key = ApiClient.convertToType(k, keyType);
|
||||||
|
var value = ApiClient.convertToType(data[k], valueType);
|
||||||
|
result[key] = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
} else {
|
||||||
|
// for unknown type, return the data directly
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static constructFromObject(data, obj, itemType) {
|
||||||
|
if (Array.isArray(data)) {
|
||||||
|
for (var i = 0; i < data.length; i++) {
|
||||||
|
if (data.hasOwnProperty(i))
|
||||||
|
obj[i] = ApiClient.convertToType(data[i], itemType);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
for (var k in data) {
|
||||||
|
if (data.hasOwnProperty(k))
|
||||||
|
obj[k] = ApiClient.convertToType(data[k], itemType);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
ApiClient.CollectionFormatEnum = {
|
||||||
|
CSV: ',',
|
||||||
|
SSV: ' ',
|
||||||
|
TSV: '\t',
|
||||||
|
PIPES: '|',
|
||||||
|
MULTI: 'multi'
|
||||||
|
};
|
89
modules/openapi-generator/src/main/resources/Javascript/libraries/apollo/api.mustache
vendored
Normal file
89
modules/openapi-generator/src/main/resources/Javascript/libraries/apollo/api.mustache
vendored
Normal file
@ -0,0 +1,89 @@
|
|||||||
|
{{>licenseInfo}}
|
||||||
|
|
||||||
|
{{=< >=}}
|
||||||
|
|
||||||
|
import ApiClient from "../ApiClient";
|
||||||
|
<#imports>import <&import> from '../<#modelPackage><&modelPackage>/</modelPackage><import>';
|
||||||
|
</imports>
|
||||||
|
|
||||||
|
<#emitJSDoc>/**
|
||||||
|
* <baseName> service.
|
||||||
|
* @module <#invokerPackage><&invokerPackage>/</invokerPackage><#apiPackage><&apiPackage>/</apiPackage><classname>
|
||||||
|
* @version <&projectVersion>
|
||||||
|
*/</emitJSDoc>
|
||||||
|
export default class <&classname> extends ApiClient {
|
||||||
|
|
||||||
|
<#emitJSDoc>/**
|
||||||
|
* Constructs a new <&classname>. <#description>
|
||||||
|
* <description></description>
|
||||||
|
* @alias module:<#invokerPackage><&invokerPackage>/</invokerPackage><#apiPackage><&apiPackage>/</apiPackage><classname>
|
||||||
|
* @class
|
||||||
|
*/</emitJSDoc>
|
||||||
|
constructor(baseURL = '<&basePath>') {
|
||||||
|
super(baseURL);
|
||||||
|
}
|
||||||
|
|
||||||
|
<#operations><#operation><#emitJSDoc>
|
||||||
|
/**<#summary>
|
||||||
|
* <&summary></summary><#notes>
|
||||||
|
* <¬es></notes><#allParams><#required>
|
||||||
|
* @param {<&vendorExtensions.x-jsdoc-type>} <¶mName> <&description></required></allParams><#hasOptionalParams>
|
||||||
|
* @param {Object} opts Optional parameters<#allParams><^required>
|
||||||
|
* @param {<&vendorExtensions.x-jsdoc-type>} opts.<¶mName> <&description><#defaultValue> (default to <&.>)</defaultValue></required></allParams></hasOptionalParams>
|
||||||
|
* @param requestInit Dynamic configuration. @see {@link https://github.com/apollographql/apollo-server/pull/1277}
|
||||||
|
<=| |=>* @return {Promise|#returnType|<|&vendorExtensions.x-jsdoc-type|>|/returnType|}|=< >=|
|
||||||
|
*/
|
||||||
|
</emitJSDoc> async <operationId>(<vendorExtensions.x-codegen-arg-list>) {
|
||||||
|
<#vendorExtensions.x-codegen-has-optional-params>
|
||||||
|
opts = opts || {};
|
||||||
|
</vendorExtensions.x-codegen-has-optional-params>
|
||||||
|
let postBody = <#bodyParam><#required><paramName></required><^required>opts['<paramName>']</required></bodyParam><^bodyParam>null</bodyParam>;
|
||||||
|
<#allParams>
|
||||||
|
<#required>
|
||||||
|
// verify the required parameter '<paramName>' is set
|
||||||
|
if (<paramName> === undefined || <paramName> === null) {
|
||||||
|
throw new Error("Missing the required parameter '<paramName>' when calling <operationId>");
|
||||||
|
}
|
||||||
|
</required>
|
||||||
|
</allParams>
|
||||||
|
|
||||||
|
let pathParams = {<#pathParams>
|
||||||
|
'<baseName>': <#required><paramName></required><^required>opts['<paramName>']</required><^-last>,</-last></pathParams>
|
||||||
|
};
|
||||||
|
let queryParams = {<#queryParams>
|
||||||
|
'<baseName>': <#collectionFormat>this.buildCollectionParam(<#required><paramName></required><^required>opts['<paramName>']</required>, '<collectionFormat>')</collectionFormat><^collectionFormat><#required><paramName></required><^required>opts['<paramName>']</required></collectionFormat><^-last>,</-last></queryParams>
|
||||||
|
};
|
||||||
|
let headerParams = {
|
||||||
|
'User-Agent': '<#httpUserAgent><.></httpUserAgent><^httpUserAgent>OpenAPI-Generator/<&projectVersion>/Javascript</httpUserAgent>',<#headerParams>
|
||||||
|
'<baseName>': <#required><paramName></required><^required>opts['<paramName>']</required><^-last>,</-last></headerParams>
|
||||||
|
};
|
||||||
|
let formParams = {<#formParams>
|
||||||
|
'<baseName>': <#collectionFormat>this.buildCollectionParam(<#required><paramName></required><^required>opts['<paramName>']</required>, '<collectionFormat>')</collectionFormat><^collectionFormat><#required><paramName></required><^required>opts['<paramName>']</required></collectionFormat><^-last>,</-last></formParams>
|
||||||
|
};
|
||||||
|
|
||||||
|
let authNames = [<#authMethods>'<name>'<^-last>, </-last></authMethods>];
|
||||||
|
let contentTypes = [<#consumes>'<& mediaType>'<^-last>, </-last></consumes>];
|
||||||
|
let accepts = [<#produces>'<& mediaType>'<^-last>, </-last></produces>];
|
||||||
|
let returnType = <#vendorExtensions.x-return-type><&vendorExtensions.x-return-type></vendorExtensions.x-return-type><^vendorExtensions.x-return-type>null</vendorExtensions.x-return-type>;
|
||||||
|
<#servers.0>
|
||||||
|
let basePaths = [<#servers>'<url>'<^-last>, </-last></servers>];
|
||||||
|
let basePath = basePaths[0]; // by default use the first one in "servers" defined in OpenAPI
|
||||||
|
if (typeof opts['_base_path_index'] !== 'undefined') {
|
||||||
|
if (opts['_base_path_index'] >= basePaths.length || opts['_base_path_index'] < 0) {
|
||||||
|
throw new Error("Invalid index " + opts['_base_path_index'] + " when selecting the host settings. Must be less than " + basePaths.length);
|
||||||
|
}
|
||||||
|
basePath = basePaths[opts['_base_path_index']];
|
||||||
|
}
|
||||||
|
|
||||||
|
</servers.0>
|
||||||
|
|
||||||
|
return this.callApi(
|
||||||
|
'<&path>', '<httpMethod>',
|
||||||
|
pathParams, queryParams, headerParams, formParams, postBody,
|
||||||
|
authNames, contentTypes, accepts, returnType, requestInit
|
||||||
|
);
|
||||||
|
}
|
||||||
|
</operation></operations>
|
||||||
|
|
||||||
|
}
|
||||||
|
<={{ }}=>
|
52
modules/openapi-generator/src/main/resources/Javascript/libraries/apollo/package.mustache
vendored
Normal file
52
modules/openapi-generator/src/main/resources/Javascript/libraries/apollo/package.mustache
vendored
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
{
|
||||||
|
"name": "{{{projectName}}}",
|
||||||
|
"version": "{{{projectVersion}}}",
|
||||||
|
"description": "{{{projectDescription}}}",
|
||||||
|
"license": "{{licenseName}}",
|
||||||
|
"main": "dist{{#invokerPackage}}/{{.}}{{/invokerPackage}}/index.js",
|
||||||
|
"scripts": {
|
||||||
|
"build": "babel src -d dist",
|
||||||
|
"prepare": "npm run build",
|
||||||
|
"test": "mocha --require @babel/register --recursive"
|
||||||
|
},
|
||||||
|
"browser": {
|
||||||
|
"fs": false
|
||||||
|
},
|
||||||
|
{{#npmRepository}}
|
||||||
|
"publishConfig":{
|
||||||
|
"registry":"{{npmRepository}}"
|
||||||
|
},
|
||||||
|
{{/npmRepository}}
|
||||||
|
"dependencies": {
|
||||||
|
"@babel/cli": "^7.0.0",
|
||||||
|
"apollo-datasource-rest": "^3.6.1",
|
||||||
|
"superagent": "^5.3.0"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@babel/core": "^7.0.0",
|
||||||
|
"@babel/plugin-proposal-class-properties": "^7.0.0",
|
||||||
|
"@babel/plugin-proposal-decorators": "^7.0.0",
|
||||||
|
"@babel/plugin-proposal-do-expressions": "^7.0.0",
|
||||||
|
"@babel/plugin-proposal-export-default-from": "^7.0.0",
|
||||||
|
"@babel/plugin-proposal-export-namespace-from": "^7.0.0",
|
||||||
|
"@babel/plugin-proposal-function-bind": "^7.0.0",
|
||||||
|
"@babel/plugin-proposal-function-sent": "^7.0.0",
|
||||||
|
"@babel/plugin-proposal-json-strings": "^7.0.0",
|
||||||
|
"@babel/plugin-proposal-logical-assignment-operators": "^7.0.0",
|
||||||
|
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.0.0",
|
||||||
|
"@babel/plugin-proposal-numeric-separator": "^7.0.0",
|
||||||
|
"@babel/plugin-proposal-optional-chaining": "^7.0.0",
|
||||||
|
"@babel/plugin-proposal-pipeline-operator": "^7.0.0",
|
||||||
|
"@babel/plugin-proposal-throw-expressions": "^7.0.0",
|
||||||
|
"@babel/plugin-syntax-dynamic-import": "^7.0.0",
|
||||||
|
"@babel/plugin-syntax-import-meta": "^7.0.0",
|
||||||
|
"@babel/preset-env": "^7.0.0",
|
||||||
|
"@babel/register": "^7.0.0",
|
||||||
|
"expect.js": "^0.3.1",
|
||||||
|
"mocha": "^8.0.1",
|
||||||
|
"sinon": "^7.2.0"
|
||||||
|
},
|
||||||
|
"files": [
|
||||||
|
"dist"
|
||||||
|
]
|
||||||
|
}
|
33
samples/client/petstore/javascript-apollo/.babelrc
Normal file
33
samples/client/petstore/javascript-apollo/.babelrc
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
{
|
||||||
|
"presets": [
|
||||||
|
"@babel/preset-env"
|
||||||
|
],
|
||||||
|
"plugins": [
|
||||||
|
"@babel/plugin-syntax-dynamic-import",
|
||||||
|
"@babel/plugin-syntax-import-meta",
|
||||||
|
"@babel/plugin-proposal-class-properties",
|
||||||
|
"@babel/plugin-proposal-json-strings",
|
||||||
|
[
|
||||||
|
"@babel/plugin-proposal-decorators",
|
||||||
|
{
|
||||||
|
"legacy": true
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"@babel/plugin-proposal-function-sent",
|
||||||
|
"@babel/plugin-proposal-export-namespace-from",
|
||||||
|
"@babel/plugin-proposal-numeric-separator",
|
||||||
|
"@babel/plugin-proposal-throw-expressions",
|
||||||
|
"@babel/plugin-proposal-export-default-from",
|
||||||
|
"@babel/plugin-proposal-logical-assignment-operators",
|
||||||
|
"@babel/plugin-proposal-optional-chaining",
|
||||||
|
[
|
||||||
|
"@babel/plugin-proposal-pipeline-operator",
|
||||||
|
{
|
||||||
|
"proposal": "minimal"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"@babel/plugin-proposal-nullish-coalescing-operator",
|
||||||
|
"@babel/plugin-proposal-do-expressions",
|
||||||
|
"@babel/plugin-proposal-function-bind"
|
||||||
|
]
|
||||||
|
}
|
130
samples/client/petstore/javascript-apollo/.gitignore
vendored
Normal file
130
samples/client/petstore/javascript-apollo/.gitignore
vendored
Normal file
@ -0,0 +1,130 @@
|
|||||||
|
# Logs
|
||||||
|
logs
|
||||||
|
*.log
|
||||||
|
npm-debug.log*
|
||||||
|
yarn-debug.log*
|
||||||
|
yarn-error.log*
|
||||||
|
lerna-debug.log*
|
||||||
|
.pnpm-debug.log*
|
||||||
|
|
||||||
|
# Diagnostic reports (https://nodejs.org/api/report.html)
|
||||||
|
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
|
||||||
|
|
||||||
|
# Runtime data
|
||||||
|
pids
|
||||||
|
*.pid
|
||||||
|
*.seed
|
||||||
|
*.pid.lock
|
||||||
|
|
||||||
|
# Directory for instrumented libs generated by jscoverage/JSCover
|
||||||
|
lib-cov
|
||||||
|
|
||||||
|
# Coverage directory used by tools like istanbul
|
||||||
|
coverage
|
||||||
|
*.lcov
|
||||||
|
|
||||||
|
# nyc test coverage
|
||||||
|
.nyc_output
|
||||||
|
|
||||||
|
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
|
||||||
|
.grunt
|
||||||
|
|
||||||
|
# Bower dependency directory (https://bower.io/)
|
||||||
|
bower_components
|
||||||
|
|
||||||
|
# node-waf configuration
|
||||||
|
.lock-wscript
|
||||||
|
|
||||||
|
# Compiled binary addons (https://nodejs.org/api/addons.html)
|
||||||
|
build/Release
|
||||||
|
|
||||||
|
# Dependency directories
|
||||||
|
node_modules/
|
||||||
|
jspm_packages/
|
||||||
|
|
||||||
|
# Snowpack dependency directory (https://snowpack.dev/)
|
||||||
|
web_modules/
|
||||||
|
|
||||||
|
# TypeScript cache
|
||||||
|
*.tsbuildinfo
|
||||||
|
|
||||||
|
# Optional npm cache directory
|
||||||
|
.npm
|
||||||
|
|
||||||
|
# Optional eslint cache
|
||||||
|
.eslintcache
|
||||||
|
|
||||||
|
# Optional stylelint cache
|
||||||
|
.stylelintcache
|
||||||
|
|
||||||
|
# Microbundle cache
|
||||||
|
.rpt2_cache/
|
||||||
|
.rts2_cache_cjs/
|
||||||
|
.rts2_cache_es/
|
||||||
|
.rts2_cache_umd/
|
||||||
|
|
||||||
|
# Optional REPL history
|
||||||
|
.node_repl_history
|
||||||
|
|
||||||
|
# Output of 'npm pack'
|
||||||
|
*.tgz
|
||||||
|
|
||||||
|
# Yarn Integrity file
|
||||||
|
.yarn-integrity
|
||||||
|
|
||||||
|
# dotenv environment variable files
|
||||||
|
.env
|
||||||
|
.env.development.local
|
||||||
|
.env.test.local
|
||||||
|
.env.production.local
|
||||||
|
.env.local
|
||||||
|
|
||||||
|
# parcel-bundler cache (https://parceljs.org/)
|
||||||
|
.cache
|
||||||
|
.parcel-cache
|
||||||
|
|
||||||
|
# Next.js build output
|
||||||
|
.next
|
||||||
|
out
|
||||||
|
|
||||||
|
# Nuxt.js build / generate output
|
||||||
|
.nuxt
|
||||||
|
dist
|
||||||
|
|
||||||
|
# Gatsby files
|
||||||
|
.cache/
|
||||||
|
# Comment in the public line in if your project uses Gatsby and not Next.js
|
||||||
|
# https://nextjs.org/blog/next-9-1#public-directory-support
|
||||||
|
# public
|
||||||
|
|
||||||
|
# vuepress build output
|
||||||
|
.vuepress/dist
|
||||||
|
|
||||||
|
# vuepress v2.x temp and cache directory
|
||||||
|
.temp
|
||||||
|
.cache
|
||||||
|
|
||||||
|
# Docusaurus cache and generated files
|
||||||
|
.docusaurus
|
||||||
|
|
||||||
|
# Serverless directories
|
||||||
|
.serverless/
|
||||||
|
|
||||||
|
# FuseBox cache
|
||||||
|
.fusebox/
|
||||||
|
|
||||||
|
# DynamoDB Local files
|
||||||
|
.dynamodb/
|
||||||
|
|
||||||
|
# TernJS port file
|
||||||
|
.tern-port
|
||||||
|
|
||||||
|
# Stores VSCode versions used for testing VSCode extensions
|
||||||
|
.vscode-test
|
||||||
|
|
||||||
|
# yarn v2
|
||||||
|
.yarn/cache
|
||||||
|
.yarn/unplugged
|
||||||
|
.yarn/build-state.yml
|
||||||
|
.yarn/install-state.gz
|
||||||
|
.pnp.*
|
@ -1,10 +1,56 @@
|
|||||||
|
.babelrc
|
||||||
|
.gitignore
|
||||||
.travis.yml
|
.travis.yml
|
||||||
README.md
|
README.md
|
||||||
|
docs/AdditionalPropertiesClass.md
|
||||||
|
docs/Animal.md
|
||||||
|
docs/AnotherFakeApi.md
|
||||||
docs/ApiResponse.md
|
docs/ApiResponse.md
|
||||||
|
docs/ArrayOfArrayOfNumberOnly.md
|
||||||
|
docs/ArrayOfNumberOnly.md
|
||||||
|
docs/ArrayTest.md
|
||||||
|
docs/Capitalization.md
|
||||||
|
docs/Cat.md
|
||||||
|
docs/CatAllOf.md
|
||||||
docs/Category.md
|
docs/Category.md
|
||||||
|
docs/ClassModel.md
|
||||||
|
docs/Client.md
|
||||||
|
docs/DefaultApi.md
|
||||||
|
docs/DeprecatedObject.md
|
||||||
|
docs/Dog.md
|
||||||
|
docs/DogAllOf.md
|
||||||
|
docs/EnumArrays.md
|
||||||
|
docs/EnumClass.md
|
||||||
|
docs/EnumTest.md
|
||||||
|
docs/FakeApi.md
|
||||||
|
docs/FakeClassnameTags123Api.md
|
||||||
|
docs/File.md
|
||||||
|
docs/FileSchemaTestClass.md
|
||||||
|
docs/Foo.md
|
||||||
|
docs/FooGetDefaultResponse.md
|
||||||
|
docs/FormatTest.md
|
||||||
|
docs/HasOnlyReadOnly.md
|
||||||
|
docs/HealthCheckResult.md
|
||||||
|
docs/List.md
|
||||||
|
docs/MapTest.md
|
||||||
|
docs/MixedPropertiesAndAdditionalPropertiesClass.md
|
||||||
|
docs/Model200Response.md
|
||||||
|
docs/Name.md
|
||||||
|
docs/NullableClass.md
|
||||||
|
docs/NumberOnly.md
|
||||||
|
docs/ObjectWithDeprecatedFields.md
|
||||||
docs/Order.md
|
docs/Order.md
|
||||||
|
docs/OuterComposite.md
|
||||||
|
docs/OuterEnum.md
|
||||||
|
docs/OuterEnumDefaultValue.md
|
||||||
|
docs/OuterEnumInteger.md
|
||||||
|
docs/OuterEnumIntegerDefaultValue.md
|
||||||
|
docs/OuterObjectWithEnumProperty.md
|
||||||
docs/Pet.md
|
docs/Pet.md
|
||||||
docs/PetApi.md
|
docs/PetApi.md
|
||||||
|
docs/ReadOnlyFirst.md
|
||||||
|
docs/Return.md
|
||||||
|
docs/SpecialModelName.md
|
||||||
docs/StoreApi.md
|
docs/StoreApi.md
|
||||||
docs/Tag.md
|
docs/Tag.md
|
||||||
docs/User.md
|
docs/User.md
|
||||||
@ -13,13 +59,57 @@ git_push.sh
|
|||||||
mocha.opts
|
mocha.opts
|
||||||
package.json
|
package.json
|
||||||
src/ApiClient.js
|
src/ApiClient.js
|
||||||
|
src/api/AnotherFakeApi.js
|
||||||
|
src/api/DefaultApi.js
|
||||||
|
src/api/FakeApi.js
|
||||||
|
src/api/FakeClassnameTags123Api.js
|
||||||
src/api/PetApi.js
|
src/api/PetApi.js
|
||||||
src/api/StoreApi.js
|
src/api/StoreApi.js
|
||||||
src/api/UserApi.js
|
src/api/UserApi.js
|
||||||
src/index.js
|
src/index.js
|
||||||
|
src/model/AdditionalPropertiesClass.js
|
||||||
|
src/model/Animal.js
|
||||||
src/model/ApiResponse.js
|
src/model/ApiResponse.js
|
||||||
|
src/model/ArrayOfArrayOfNumberOnly.js
|
||||||
|
src/model/ArrayOfNumberOnly.js
|
||||||
|
src/model/ArrayTest.js
|
||||||
|
src/model/Capitalization.js
|
||||||
|
src/model/Cat.js
|
||||||
|
src/model/CatAllOf.js
|
||||||
src/model/Category.js
|
src/model/Category.js
|
||||||
|
src/model/ClassModel.js
|
||||||
|
src/model/Client.js
|
||||||
|
src/model/DeprecatedObject.js
|
||||||
|
src/model/Dog.js
|
||||||
|
src/model/DogAllOf.js
|
||||||
|
src/model/EnumArrays.js
|
||||||
|
src/model/EnumClass.js
|
||||||
|
src/model/EnumTest.js
|
||||||
|
src/model/File.js
|
||||||
|
src/model/FileSchemaTestClass.js
|
||||||
|
src/model/Foo.js
|
||||||
|
src/model/FooGetDefaultResponse.js
|
||||||
|
src/model/FormatTest.js
|
||||||
|
src/model/HasOnlyReadOnly.js
|
||||||
|
src/model/HealthCheckResult.js
|
||||||
|
src/model/List.js
|
||||||
|
src/model/MapTest.js
|
||||||
|
src/model/MixedPropertiesAndAdditionalPropertiesClass.js
|
||||||
|
src/model/Model200Response.js
|
||||||
|
src/model/Name.js
|
||||||
|
src/model/NullableClass.js
|
||||||
|
src/model/NumberOnly.js
|
||||||
|
src/model/ObjectWithDeprecatedFields.js
|
||||||
src/model/Order.js
|
src/model/Order.js
|
||||||
|
src/model/OuterComposite.js
|
||||||
|
src/model/OuterEnum.js
|
||||||
|
src/model/OuterEnumDefaultValue.js
|
||||||
|
src/model/OuterEnumInteger.js
|
||||||
|
src/model/OuterEnumIntegerDefaultValue.js
|
||||||
|
src/model/OuterObjectWithEnumProperty.js
|
||||||
src/model/Pet.js
|
src/model/Pet.js
|
||||||
|
src/model/ReadOnlyFirst.js
|
||||||
|
src/model/Return.js
|
||||||
|
src/model/SpecialModelName.js
|
||||||
src/model/Tag.js
|
src/model/Tag.js
|
||||||
src/model/User.js
|
src/model/User.js
|
||||||
|
@ -1 +1 @@
|
|||||||
5.0.0-SNAPSHOT
|
6.1.0-SNAPSHOT
|
@ -1,12 +1,12 @@
|
|||||||
# open_api_petstore
|
# open_api_petstore
|
||||||
|
|
||||||
OpenApiPetstore - JavaScript client for open_api_petstore
|
OpenApiPetstore - JavaScript client for open_api_petstore
|
||||||
This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||||
This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
|
This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
|
||||||
|
|
||||||
- API version: 1.0.0
|
- API version: 1.0.0
|
||||||
- Package version: 1.0.0
|
- Package version: 1.0.0
|
||||||
- Build package: org.openapitools.codegen.languages.JavascriptApolloClientCodegen
|
- Build package: org.openapitools.codegen.languages.JavascriptClientCodegen
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
@ -100,30 +100,46 @@ Please follow the [installation](#installation) instruction and execute the foll
|
|||||||
```javascript
|
```javascript
|
||||||
var OpenApiPetstore = require('open_api_petstore');
|
var OpenApiPetstore = require('open_api_petstore');
|
||||||
|
|
||||||
var defaultClient = OpenApiPetstore.ApiClient.instance;
|
|
||||||
// Configure OAuth2 access token for authorization: petstore_auth
|
|
||||||
var petstore_auth = defaultClient.authentications['petstore_auth'];
|
|
||||||
petstore_auth.accessToken = "YOUR ACCESS TOKEN"
|
|
||||||
|
|
||||||
var api = new OpenApiPetstore.PetApi()
|
var api = new OpenApiPetstore.AnotherFakeApi()
|
||||||
var body = new OpenApiPetstore.Pet(); // {Pet} Pet object that needs to be added to the store
|
var client = new OpenApiPetstore.Client(); // {Client} client model
|
||||||
var callback = function(error, data, response) {
|
var callback = function(error, data, response) {
|
||||||
if (error) {
|
if (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
} else {
|
} else {
|
||||||
console.log('API called successfully.');
|
console.log('API called successfully. Returned data: ' + data);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
api.addPet(body, callback);
|
api.call123testSpecialTags(client, callback);
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Documentation for API Endpoints
|
## Documentation for API Endpoints
|
||||||
|
|
||||||
All URIs are relative to *http://petstore.swagger.io/v2*
|
All URIs are relative to *http://petstore.swagger.io:80/v2*
|
||||||
|
|
||||||
Class | Method | HTTP request | Description
|
Class | Method | HTTP request | Description
|
||||||
------------ | ------------- | ------------- | -------------
|
------------ | ------------- | ------------- | -------------
|
||||||
|
*OpenApiPetstore.AnotherFakeApi* | [**call123testSpecialTags**](docs/AnotherFakeApi.md#call123testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags
|
||||||
|
*OpenApiPetstore.DefaultApi* | [**fooGet**](docs/DefaultApi.md#fooGet) | **GET** /foo |
|
||||||
|
*OpenApiPetstore.FakeApi* | [**fakeHealthGet**](docs/FakeApi.md#fakeHealthGet) | **GET** /fake/health | Health check endpoint
|
||||||
|
*OpenApiPetstore.FakeApi* | [**fakeHttpSignatureTest**](docs/FakeApi.md#fakeHttpSignatureTest) | **GET** /fake/http-signature-test | test http signature authentication
|
||||||
|
*OpenApiPetstore.FakeApi* | [**fakeOuterBooleanSerialize**](docs/FakeApi.md#fakeOuterBooleanSerialize) | **POST** /fake/outer/boolean |
|
||||||
|
*OpenApiPetstore.FakeApi* | [**fakeOuterCompositeSerialize**](docs/FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite |
|
||||||
|
*OpenApiPetstore.FakeApi* | [**fakeOuterNumberSerialize**](docs/FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number |
|
||||||
|
*OpenApiPetstore.FakeApi* | [**fakeOuterStringSerialize**](docs/FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string |
|
||||||
|
*OpenApiPetstore.FakeApi* | [**fakePropertyEnumIntegerSerialize**](docs/FakeApi.md#fakePropertyEnumIntegerSerialize) | **POST** /fake/property/enum-int |
|
||||||
|
*OpenApiPetstore.FakeApi* | [**testBodyWithBinary**](docs/FakeApi.md#testBodyWithBinary) | **PUT** /fake/body-with-binary |
|
||||||
|
*OpenApiPetstore.FakeApi* | [**testBodyWithFileSchema**](docs/FakeApi.md#testBodyWithFileSchema) | **PUT** /fake/body-with-file-schema |
|
||||||
|
*OpenApiPetstore.FakeApi* | [**testBodyWithQueryParams**](docs/FakeApi.md#testBodyWithQueryParams) | **PUT** /fake/body-with-query-params |
|
||||||
|
*OpenApiPetstore.FakeApi* | [**testClientModel**](docs/FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model
|
||||||
|
*OpenApiPetstore.FakeApi* | [**testEndpointParameters**](docs/FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||||
|
*OpenApiPetstore.FakeApi* | [**testEnumParameters**](docs/FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters
|
||||||
|
*OpenApiPetstore.FakeApi* | [**testGroupParameters**](docs/FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional)
|
||||||
|
*OpenApiPetstore.FakeApi* | [**testInlineAdditionalProperties**](docs/FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties
|
||||||
|
*OpenApiPetstore.FakeApi* | [**testJsonFormData**](docs/FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data
|
||||||
|
*OpenApiPetstore.FakeApi* | [**testQueryParameterCollectionFormat**](docs/FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-parameters |
|
||||||
|
*OpenApiPetstore.FakeClassnameTags123Api* | [**testClassname**](docs/FakeClassnameTags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case
|
||||||
*OpenApiPetstore.PetApi* | [**addPet**](docs/PetApi.md#addPet) | **POST** /pet | Add a new pet to the store
|
*OpenApiPetstore.PetApi* | [**addPet**](docs/PetApi.md#addPet) | **POST** /pet | Add a new pet to the store
|
||||||
*OpenApiPetstore.PetApi* | [**deletePet**](docs/PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet
|
*OpenApiPetstore.PetApi* | [**deletePet**](docs/PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet
|
||||||
*OpenApiPetstore.PetApi* | [**findPetsByStatus**](docs/PetApi.md#findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status
|
*OpenApiPetstore.PetApi* | [**findPetsByStatus**](docs/PetApi.md#findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status
|
||||||
@ -132,9 +148,10 @@ Class | Method | HTTP request | Description
|
|||||||
*OpenApiPetstore.PetApi* | [**updatePet**](docs/PetApi.md#updatePet) | **PUT** /pet | Update an existing pet
|
*OpenApiPetstore.PetApi* | [**updatePet**](docs/PetApi.md#updatePet) | **PUT** /pet | Update an existing pet
|
||||||
*OpenApiPetstore.PetApi* | [**updatePetWithForm**](docs/PetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data
|
*OpenApiPetstore.PetApi* | [**updatePetWithForm**](docs/PetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data
|
||||||
*OpenApiPetstore.PetApi* | [**uploadFile**](docs/PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image
|
*OpenApiPetstore.PetApi* | [**uploadFile**](docs/PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image
|
||||||
*OpenApiPetstore.StoreApi* | [**deleteOrder**](docs/StoreApi.md#deleteOrder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID
|
*OpenApiPetstore.PetApi* | [**uploadFileWithRequiredFile**](docs/PetApi.md#uploadFileWithRequiredFile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required)
|
||||||
|
*OpenApiPetstore.StoreApi* | [**deleteOrder**](docs/StoreApi.md#deleteOrder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID
|
||||||
*OpenApiPetstore.StoreApi* | [**getInventory**](docs/StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status
|
*OpenApiPetstore.StoreApi* | [**getInventory**](docs/StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status
|
||||||
*OpenApiPetstore.StoreApi* | [**getOrderById**](docs/StoreApi.md#getOrderById) | **GET** /store/order/{orderId} | Find purchase order by ID
|
*OpenApiPetstore.StoreApi* | [**getOrderById**](docs/StoreApi.md#getOrderById) | **GET** /store/order/{order_id} | Find purchase order by ID
|
||||||
*OpenApiPetstore.StoreApi* | [**placeOrder**](docs/StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet
|
*OpenApiPetstore.StoreApi* | [**placeOrder**](docs/StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet
|
||||||
*OpenApiPetstore.UserApi* | [**createUser**](docs/UserApi.md#createUser) | **POST** /user | Create user
|
*OpenApiPetstore.UserApi* | [**createUser**](docs/UserApi.md#createUser) | **POST** /user | Create user
|
||||||
*OpenApiPetstore.UserApi* | [**createUsersWithArrayInput**](docs/UserApi.md#createUsersWithArrayInput) | **POST** /user/createWithArray | Creates list of users with given input array
|
*OpenApiPetstore.UserApi* | [**createUsersWithArrayInput**](docs/UserApi.md#createUsersWithArrayInput) | **POST** /user/createWithArray | Creates list of users with given input array
|
||||||
@ -148,10 +165,50 @@ Class | Method | HTTP request | Description
|
|||||||
|
|
||||||
## Documentation for Models
|
## Documentation for Models
|
||||||
|
|
||||||
|
- [OpenApiPetstore.AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md)
|
||||||
|
- [OpenApiPetstore.Animal](docs/Animal.md)
|
||||||
- [OpenApiPetstore.ApiResponse](docs/ApiResponse.md)
|
- [OpenApiPetstore.ApiResponse](docs/ApiResponse.md)
|
||||||
|
- [OpenApiPetstore.ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md)
|
||||||
|
- [OpenApiPetstore.ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md)
|
||||||
|
- [OpenApiPetstore.ArrayTest](docs/ArrayTest.md)
|
||||||
|
- [OpenApiPetstore.Capitalization](docs/Capitalization.md)
|
||||||
|
- [OpenApiPetstore.Cat](docs/Cat.md)
|
||||||
|
- [OpenApiPetstore.CatAllOf](docs/CatAllOf.md)
|
||||||
- [OpenApiPetstore.Category](docs/Category.md)
|
- [OpenApiPetstore.Category](docs/Category.md)
|
||||||
|
- [OpenApiPetstore.ClassModel](docs/ClassModel.md)
|
||||||
|
- [OpenApiPetstore.Client](docs/Client.md)
|
||||||
|
- [OpenApiPetstore.DeprecatedObject](docs/DeprecatedObject.md)
|
||||||
|
- [OpenApiPetstore.Dog](docs/Dog.md)
|
||||||
|
- [OpenApiPetstore.DogAllOf](docs/DogAllOf.md)
|
||||||
|
- [OpenApiPetstore.EnumArrays](docs/EnumArrays.md)
|
||||||
|
- [OpenApiPetstore.EnumClass](docs/EnumClass.md)
|
||||||
|
- [OpenApiPetstore.EnumTest](docs/EnumTest.md)
|
||||||
|
- [OpenApiPetstore.File](docs/File.md)
|
||||||
|
- [OpenApiPetstore.FileSchemaTestClass](docs/FileSchemaTestClass.md)
|
||||||
|
- [OpenApiPetstore.Foo](docs/Foo.md)
|
||||||
|
- [OpenApiPetstore.FooGetDefaultResponse](docs/FooGetDefaultResponse.md)
|
||||||
|
- [OpenApiPetstore.FormatTest](docs/FormatTest.md)
|
||||||
|
- [OpenApiPetstore.HasOnlyReadOnly](docs/HasOnlyReadOnly.md)
|
||||||
|
- [OpenApiPetstore.HealthCheckResult](docs/HealthCheckResult.md)
|
||||||
|
- [OpenApiPetstore.List](docs/List.md)
|
||||||
|
- [OpenApiPetstore.MapTest](docs/MapTest.md)
|
||||||
|
- [OpenApiPetstore.MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md)
|
||||||
|
- [OpenApiPetstore.Model200Response](docs/Model200Response.md)
|
||||||
|
- [OpenApiPetstore.Name](docs/Name.md)
|
||||||
|
- [OpenApiPetstore.NullableClass](docs/NullableClass.md)
|
||||||
|
- [OpenApiPetstore.NumberOnly](docs/NumberOnly.md)
|
||||||
|
- [OpenApiPetstore.ObjectWithDeprecatedFields](docs/ObjectWithDeprecatedFields.md)
|
||||||
- [OpenApiPetstore.Order](docs/Order.md)
|
- [OpenApiPetstore.Order](docs/Order.md)
|
||||||
|
- [OpenApiPetstore.OuterComposite](docs/OuterComposite.md)
|
||||||
|
- [OpenApiPetstore.OuterEnum](docs/OuterEnum.md)
|
||||||
|
- [OpenApiPetstore.OuterEnumDefaultValue](docs/OuterEnumDefaultValue.md)
|
||||||
|
- [OpenApiPetstore.OuterEnumInteger](docs/OuterEnumInteger.md)
|
||||||
|
- [OpenApiPetstore.OuterEnumIntegerDefaultValue](docs/OuterEnumIntegerDefaultValue.md)
|
||||||
|
- [OpenApiPetstore.OuterObjectWithEnumProperty](docs/OuterObjectWithEnumProperty.md)
|
||||||
- [OpenApiPetstore.Pet](docs/Pet.md)
|
- [OpenApiPetstore.Pet](docs/Pet.md)
|
||||||
|
- [OpenApiPetstore.ReadOnlyFirst](docs/ReadOnlyFirst.md)
|
||||||
|
- [OpenApiPetstore.Return](docs/Return.md)
|
||||||
|
- [OpenApiPetstore.SpecialModelName](docs/SpecialModelName.md)
|
||||||
- [OpenApiPetstore.Tag](docs/Tag.md)
|
- [OpenApiPetstore.Tag](docs/Tag.md)
|
||||||
- [OpenApiPetstore.User](docs/User.md)
|
- [OpenApiPetstore.User](docs/User.md)
|
||||||
|
|
||||||
@ -169,6 +226,32 @@ Class | Method | HTTP request | Description
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### api_key_query
|
||||||
|
|
||||||
|
|
||||||
|
- **Type**: API key
|
||||||
|
- **API key parameter name**: api_key_query
|
||||||
|
- **Location**: URL query string
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### bearer_test
|
||||||
|
|
||||||
|
- **Type**: Bearer authentication (JWT)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### http_basic_test
|
||||||
|
|
||||||
|
- **Type**: HTTP basic authentication
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### http_signature_test
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### petstore_auth
|
### petstore_auth
|
||||||
|
|
||||||
|
|
||||||
|
@ -0,0 +1,10 @@
|
|||||||
|
# OpenApiPetstore.AdditionalPropertiesClass
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**mapProperty** | **{String: String}** | | [optional]
|
||||||
|
**mapOfMapProperty** | **{String: {String: String}}** | | [optional]
|
||||||
|
|
||||||
|
|
10
samples/client/petstore/javascript-apollo/docs/Animal.md
Normal file
10
samples/client/petstore/javascript-apollo/docs/Animal.md
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
# OpenApiPetstore.Animal
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**className** | **String** | |
|
||||||
|
**color** | **String** | | [optional] [default to 'red']
|
||||||
|
|
||||||
|
|
@ -0,0 +1,54 @@
|
|||||||
|
# OpenApiPetstore.AnotherFakeApi
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## call123testSpecialTags
|
||||||
|
|
||||||
|
> Client call123testSpecialTags(client)
|
||||||
|
|
||||||
|
To test special tags
|
||||||
|
|
||||||
|
To test special tags and operation ID starting with number
|
||||||
|
|
||||||
|
### Example
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
import OpenApiPetstore from 'open_api_petstore';
|
||||||
|
|
||||||
|
let apiInstance = new OpenApiPetstore.AnotherFakeApi();
|
||||||
|
let client = new OpenApiPetstore.Client(); // Client | client model
|
||||||
|
apiInstance.call123testSpecialTags(client, (error, data, response) => {
|
||||||
|
if (error) {
|
||||||
|
console.error(error);
|
||||||
|
} else {
|
||||||
|
console.log('API called successfully. Returned data: ' + data);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**client** | [**Client**](Client.md)| client model |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
[**Client**](Client.md)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: application/json
|
||||||
|
- **Accept**: application/json
|
||||||
|
|
@ -0,0 +1,9 @@
|
|||||||
|
# OpenApiPetstore.ArrayOfArrayOfNumberOnly
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**arrayArrayNumber** | **[[Number]]** | | [optional]
|
||||||
|
|
||||||
|
|
@ -1,9 +1,9 @@
|
|||||||
# OpenApiPetstore.AdditionalPropertiesNumber
|
# OpenApiPetstore.ArrayOfNumberOnly
|
||||||
|
|
||||||
## Properties
|
## Properties
|
||||||
|
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------ | ------------- | ------------- | -------------
|
------------ | ------------- | ------------- | -------------
|
||||||
**name** | **String** | | [optional]
|
**arrayNumber** | **[Number]** | | [optional]
|
||||||
|
|
||||||
|
|
11
samples/client/petstore/javascript-apollo/docs/ArrayTest.md
Normal file
11
samples/client/petstore/javascript-apollo/docs/ArrayTest.md
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
# OpenApiPetstore.ArrayTest
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**arrayOfString** | **[String]** | | [optional]
|
||||||
|
**arrayArrayOfInteger** | **[[Number]]** | | [optional]
|
||||||
|
**arrayArrayOfModel** | **[[ReadOnlyFirst]]** | | [optional]
|
||||||
|
|
||||||
|
|
@ -0,0 +1,14 @@
|
|||||||
|
# OpenApiPetstore.Capitalization
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**smallCamel** | **String** | | [optional]
|
||||||
|
**capitalCamel** | **String** | | [optional]
|
||||||
|
**smallSnake** | **String** | | [optional]
|
||||||
|
**capitalSnake** | **String** | | [optional]
|
||||||
|
**sCAETHFlowPoints** | **String** | | [optional]
|
||||||
|
**ATT_NAME** | **String** | Name of the pet | [optional]
|
||||||
|
|
||||||
|
|
@ -1,7 +1,9 @@
|
|||||||
# OpenApiPetstore.AnimalFarm
|
# OpenApiPetstore.Cat
|
||||||
|
|
||||||
## Properties
|
## Properties
|
||||||
|
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------ | ------------- | ------------- | -------------
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**declawed** | **Boolean** | | [optional]
|
||||||
|
|
||||||
|
|
@ -1,9 +1,9 @@
|
|||||||
# OpenApiPetstore.ModelReturn
|
# OpenApiPetstore.CatAllOf
|
||||||
|
|
||||||
## Properties
|
## Properties
|
||||||
|
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------ | ------------- | ------------- | -------------
|
------------ | ------------- | ------------- | -------------
|
||||||
**_return** | **Number** | | [optional]
|
**declawed** | **Boolean** | | [optional]
|
||||||
|
|
||||||
|
|
@ -5,6 +5,6 @@
|
|||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------ | ------------- | ------------- | -------------
|
------------ | ------------- | ------------- | -------------
|
||||||
**id** | **Number** | | [optional]
|
**id** | **Number** | | [optional]
|
||||||
**name** | **String** | | [optional]
|
**name** | **String** | | [default to 'default-name']
|
||||||
|
|
||||||
|
|
||||||
|
@ -0,0 +1,9 @@
|
|||||||
|
# OpenApiPetstore.ClassModel
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**_class** | **String** | | [optional]
|
||||||
|
|
||||||
|
|
@ -1,7 +1,9 @@
|
|||||||
# SwaggerPetstore.OuterBoolean
|
# OpenApiPetstore.Client
|
||||||
|
|
||||||
## Properties
|
## Properties
|
||||||
|
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------ | ------------- | ------------- | -------------
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**client** | **String** | | [optional]
|
||||||
|
|
||||||
|
|
48
samples/client/petstore/javascript-apollo/docs/DefaultApi.md
Normal file
48
samples/client/petstore/javascript-apollo/docs/DefaultApi.md
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
# OpenApiPetstore.DefaultApi
|
||||||
|
|
||||||
|
All URIs are relative to *http://petstore.swagger.io:80/v2*
|
||||||
|
|
||||||
|
Method | HTTP request | Description
|
||||||
|
------------- | ------------- | -------------
|
||||||
|
[**fooGet**](DefaultApi.md#fooGet) | **GET** /foo |
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## fooGet
|
||||||
|
|
||||||
|
> FooGetDefaultResponse fooGet()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Example
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
import OpenApiPetstore from 'open_api_petstore';
|
||||||
|
|
||||||
|
let apiInstance = new OpenApiPetstore.DefaultApi();
|
||||||
|
apiInstance.fooGet((error, data, response) => {
|
||||||
|
if (error) {
|
||||||
|
console.error(error);
|
||||||
|
} else {
|
||||||
|
console.log('API called successfully. Returned data: ' + data);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
This endpoint does not need any parameter.
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
[**FooGetDefaultResponse**](FooGetDefaultResponse.md)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/json
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
# OpenApiPetstore.AdditionalPropertiesArray
|
# OpenApiPetstore.DeprecatedObject
|
||||||
|
|
||||||
## Properties
|
## Properties
|
||||||
|
|
@ -1,7 +1,9 @@
|
|||||||
# SwaggerPetstore.OuterNumber
|
# OpenApiPetstore.Dog
|
||||||
|
|
||||||
## Properties
|
## Properties
|
||||||
|
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------ | ------------- | ------------- | -------------
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**breed** | **String** | | [optional]
|
||||||
|
|
||||||
|
|
@ -0,0 +1,9 @@
|
|||||||
|
# OpenApiPetstore.DogAllOf
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**breed** | **String** | | [optional]
|
||||||
|
|
||||||
|
|
32
samples/client/petstore/javascript-apollo/docs/EnumArrays.md
Normal file
32
samples/client/petstore/javascript-apollo/docs/EnumArrays.md
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
# OpenApiPetstore.EnumArrays
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**justSymbol** | **String** | | [optional]
|
||||||
|
**arrayEnum** | **[String]** | | [optional]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## Enum: JustSymbolEnum
|
||||||
|
|
||||||
|
|
||||||
|
* `GREATER_THAN_OR_EQUAL_TO` (value: `">="`)
|
||||||
|
|
||||||
|
* `DOLLAR` (value: `"$"`)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## Enum: [ArrayEnumEnum]
|
||||||
|
|
||||||
|
|
||||||
|
* `fish` (value: `"fish"`)
|
||||||
|
|
||||||
|
* `crab` (value: `"crab"`)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
12
samples/client/petstore/javascript-apollo/docs/EnumClass.md
Normal file
12
samples/client/petstore/javascript-apollo/docs/EnumClass.md
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
# OpenApiPetstore.EnumClass
|
||||||
|
|
||||||
|
## Enum
|
||||||
|
|
||||||
|
|
||||||
|
* `_abc` (value: `"_abc"`)
|
||||||
|
|
||||||
|
* `-efg` (value: `"-efg"`)
|
||||||
|
|
||||||
|
* `(xyz)` (value: `"(xyz)"`)
|
||||||
|
|
||||||
|
|
64
samples/client/petstore/javascript-apollo/docs/EnumTest.md
Normal file
64
samples/client/petstore/javascript-apollo/docs/EnumTest.md
Normal file
@ -0,0 +1,64 @@
|
|||||||
|
# OpenApiPetstore.EnumTest
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**enumString** | **String** | | [optional]
|
||||||
|
**enumStringRequired** | **String** | |
|
||||||
|
**enumInteger** | **Number** | | [optional]
|
||||||
|
**enumNumber** | **Number** | | [optional]
|
||||||
|
**outerEnum** | [**OuterEnum**](OuterEnum.md) | | [optional]
|
||||||
|
**outerEnumInteger** | [**OuterEnumInteger**](OuterEnumInteger.md) | | [optional]
|
||||||
|
**outerEnumDefaultValue** | [**OuterEnumDefaultValue**](OuterEnumDefaultValue.md) | | [optional]
|
||||||
|
**outerEnumIntegerDefaultValue** | [**OuterEnumIntegerDefaultValue**](OuterEnumIntegerDefaultValue.md) | | [optional]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## Enum: EnumStringEnum
|
||||||
|
|
||||||
|
|
||||||
|
* `UPPER` (value: `"UPPER"`)
|
||||||
|
|
||||||
|
* `lower` (value: `"lower"`)
|
||||||
|
|
||||||
|
* `empty` (value: `""`)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## Enum: EnumStringRequiredEnum
|
||||||
|
|
||||||
|
|
||||||
|
* `UPPER` (value: `"UPPER"`)
|
||||||
|
|
||||||
|
* `lower` (value: `"lower"`)
|
||||||
|
|
||||||
|
* `empty` (value: `""`)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## Enum: EnumIntegerEnum
|
||||||
|
|
||||||
|
|
||||||
|
* `1` (value: `1`)
|
||||||
|
|
||||||
|
* `-1` (value: `-1`)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## Enum: EnumNumberEnum
|
||||||
|
|
||||||
|
|
||||||
|
* `1.1` (value: `1.1`)
|
||||||
|
|
||||||
|
* `-1.2` (value: `-1.2`)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
880
samples/client/petstore/javascript-apollo/docs/FakeApi.md
Normal file
880
samples/client/petstore/javascript-apollo/docs/FakeApi.md
Normal file
@ -0,0 +1,880 @@
|
|||||||
|
# OpenApiPetstore.FakeApi
|
||||||
|
|
||||||
|
All URIs are relative to *http://petstore.swagger.io:80/v2*
|
||||||
|
|
||||||
|
Method | HTTP request | Description
|
||||||
|
------------- | ------------- | -------------
|
||||||
|
[**fakeHealthGet**](FakeApi.md#fakeHealthGet) | **GET** /fake/health | Health check endpoint
|
||||||
|
[**fakeHttpSignatureTest**](FakeApi.md#fakeHttpSignatureTest) | **GET** /fake/http-signature-test | test http signature authentication
|
||||||
|
[**fakeOuterBooleanSerialize**](FakeApi.md#fakeOuterBooleanSerialize) | **POST** /fake/outer/boolean |
|
||||||
|
[**fakeOuterCompositeSerialize**](FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite |
|
||||||
|
[**fakeOuterNumberSerialize**](FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number |
|
||||||
|
[**fakeOuterStringSerialize**](FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string |
|
||||||
|
[**fakePropertyEnumIntegerSerialize**](FakeApi.md#fakePropertyEnumIntegerSerialize) | **POST** /fake/property/enum-int |
|
||||||
|
[**testBodyWithBinary**](FakeApi.md#testBodyWithBinary) | **PUT** /fake/body-with-binary |
|
||||||
|
[**testBodyWithFileSchema**](FakeApi.md#testBodyWithFileSchema) | **PUT** /fake/body-with-file-schema |
|
||||||
|
[**testBodyWithQueryParams**](FakeApi.md#testBodyWithQueryParams) | **PUT** /fake/body-with-query-params |
|
||||||
|
[**testClientModel**](FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model
|
||||||
|
[**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||||
|
[**testEnumParameters**](FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters
|
||||||
|
[**testGroupParameters**](FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional)
|
||||||
|
[**testInlineAdditionalProperties**](FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties
|
||||||
|
[**testJsonFormData**](FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data
|
||||||
|
[**testQueryParameterCollectionFormat**](FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-parameters |
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## fakeHealthGet
|
||||||
|
|
||||||
|
> HealthCheckResult fakeHealthGet()
|
||||||
|
|
||||||
|
Health check endpoint
|
||||||
|
|
||||||
|
### Example
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
import OpenApiPetstore from 'open_api_petstore';
|
||||||
|
|
||||||
|
let apiInstance = new OpenApiPetstore.FakeApi();
|
||||||
|
apiInstance.fakeHealthGet((error, data, response) => {
|
||||||
|
if (error) {
|
||||||
|
console.error(error);
|
||||||
|
} else {
|
||||||
|
console.log('API called successfully. Returned data: ' + data);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
This endpoint does not need any parameter.
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
[**HealthCheckResult**](HealthCheckResult.md)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/json
|
||||||
|
|
||||||
|
|
||||||
|
## fakeHttpSignatureTest
|
||||||
|
|
||||||
|
> fakeHttpSignatureTest(pet, opts)
|
||||||
|
|
||||||
|
test http signature authentication
|
||||||
|
|
||||||
|
### Example
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
import OpenApiPetstore from 'open_api_petstore';
|
||||||
|
let defaultClient = OpenApiPetstore.ApiClient.instance;
|
||||||
|
|
||||||
|
let apiInstance = new OpenApiPetstore.FakeApi();
|
||||||
|
let pet = new OpenApiPetstore.Pet(); // Pet | Pet object that needs to be added to the store
|
||||||
|
let opts = {
|
||||||
|
'query1': "query1_example", // String | query parameter
|
||||||
|
'header1': "header1_example" // String | header parameter
|
||||||
|
};
|
||||||
|
apiInstance.fakeHttpSignatureTest(pet, opts, (error, data, response) => {
|
||||||
|
if (error) {
|
||||||
|
console.error(error);
|
||||||
|
} else {
|
||||||
|
console.log('API called successfully.');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
|
||||||
|
**query1** | **String**| query parameter | [optional]
|
||||||
|
**header1** | **String**| header parameter | [optional]
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
null (empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
[http_signature_test](../README.md#http_signature_test)
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: application/json, application/xml
|
||||||
|
- **Accept**: Not defined
|
||||||
|
|
||||||
|
|
||||||
|
## fakeOuterBooleanSerialize
|
||||||
|
|
||||||
|
> Boolean fakeOuterBooleanSerialize(opts)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Test serialization of outer boolean types
|
||||||
|
|
||||||
|
### Example
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
import OpenApiPetstore from 'open_api_petstore';
|
||||||
|
|
||||||
|
let apiInstance = new OpenApiPetstore.FakeApi();
|
||||||
|
let opts = {
|
||||||
|
'body': true // Boolean | Input boolean as post body
|
||||||
|
};
|
||||||
|
apiInstance.fakeOuterBooleanSerialize(opts, (error, data, response) => {
|
||||||
|
if (error) {
|
||||||
|
console.error(error);
|
||||||
|
} else {
|
||||||
|
console.log('API called successfully. Returned data: ' + data);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**body** | **Boolean**| Input boolean as post body | [optional]
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
**Boolean**
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: application/json
|
||||||
|
- **Accept**: */*
|
||||||
|
|
||||||
|
|
||||||
|
## fakeOuterCompositeSerialize
|
||||||
|
|
||||||
|
> OuterComposite fakeOuterCompositeSerialize(opts)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Test serialization of object with outer number type
|
||||||
|
|
||||||
|
### Example
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
import OpenApiPetstore from 'open_api_petstore';
|
||||||
|
|
||||||
|
let apiInstance = new OpenApiPetstore.FakeApi();
|
||||||
|
let opts = {
|
||||||
|
'outerComposite': new OpenApiPetstore.OuterComposite() // OuterComposite | Input composite as post body
|
||||||
|
};
|
||||||
|
apiInstance.fakeOuterCompositeSerialize(opts, (error, data, response) => {
|
||||||
|
if (error) {
|
||||||
|
console.error(error);
|
||||||
|
} else {
|
||||||
|
console.log('API called successfully. Returned data: ' + data);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**outerComposite** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional]
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
[**OuterComposite**](OuterComposite.md)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: application/json
|
||||||
|
- **Accept**: */*
|
||||||
|
|
||||||
|
|
||||||
|
## fakeOuterNumberSerialize
|
||||||
|
|
||||||
|
> Number fakeOuterNumberSerialize(opts)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Test serialization of outer number types
|
||||||
|
|
||||||
|
### Example
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
import OpenApiPetstore from 'open_api_petstore';
|
||||||
|
|
||||||
|
let apiInstance = new OpenApiPetstore.FakeApi();
|
||||||
|
let opts = {
|
||||||
|
'body': 3.4 // Number | Input number as post body
|
||||||
|
};
|
||||||
|
apiInstance.fakeOuterNumberSerialize(opts, (error, data, response) => {
|
||||||
|
if (error) {
|
||||||
|
console.error(error);
|
||||||
|
} else {
|
||||||
|
console.log('API called successfully. Returned data: ' + data);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**body** | **Number**| Input number as post body | [optional]
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
**Number**
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: application/json
|
||||||
|
- **Accept**: */*
|
||||||
|
|
||||||
|
|
||||||
|
## fakeOuterStringSerialize
|
||||||
|
|
||||||
|
> String fakeOuterStringSerialize(opts)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Test serialization of outer string types
|
||||||
|
|
||||||
|
### Example
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
import OpenApiPetstore from 'open_api_petstore';
|
||||||
|
|
||||||
|
let apiInstance = new OpenApiPetstore.FakeApi();
|
||||||
|
let opts = {
|
||||||
|
'body': "body_example" // String | Input string as post body
|
||||||
|
};
|
||||||
|
apiInstance.fakeOuterStringSerialize(opts, (error, data, response) => {
|
||||||
|
if (error) {
|
||||||
|
console.error(error);
|
||||||
|
} else {
|
||||||
|
console.log('API called successfully. Returned data: ' + data);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**body** | **String**| Input string as post body | [optional]
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
**String**
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: application/json
|
||||||
|
- **Accept**: */*
|
||||||
|
|
||||||
|
|
||||||
|
## fakePropertyEnumIntegerSerialize
|
||||||
|
|
||||||
|
> OuterObjectWithEnumProperty fakePropertyEnumIntegerSerialize(outerObjectWithEnumProperty)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Test serialization of enum (int) properties with examples
|
||||||
|
|
||||||
|
### Example
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
import OpenApiPetstore from 'open_api_petstore';
|
||||||
|
|
||||||
|
let apiInstance = new OpenApiPetstore.FakeApi();
|
||||||
|
let outerObjectWithEnumProperty = new OpenApiPetstore.OuterObjectWithEnumProperty(); // OuterObjectWithEnumProperty | Input enum (int) as post body
|
||||||
|
apiInstance.fakePropertyEnumIntegerSerialize(outerObjectWithEnumProperty, (error, data, response) => {
|
||||||
|
if (error) {
|
||||||
|
console.error(error);
|
||||||
|
} else {
|
||||||
|
console.log('API called successfully. Returned data: ' + data);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**outerObjectWithEnumProperty** | [**OuterObjectWithEnumProperty**](OuterObjectWithEnumProperty.md)| Input enum (int) as post body |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
[**OuterObjectWithEnumProperty**](OuterObjectWithEnumProperty.md)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: application/json
|
||||||
|
- **Accept**: */*
|
||||||
|
|
||||||
|
|
||||||
|
## testBodyWithBinary
|
||||||
|
|
||||||
|
> testBodyWithBinary(body)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
For this test, the body has to be a binary file.
|
||||||
|
|
||||||
|
### Example
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
import OpenApiPetstore from 'open_api_petstore';
|
||||||
|
|
||||||
|
let apiInstance = new OpenApiPetstore.FakeApi();
|
||||||
|
let body = "/path/to/file"; // File | image to upload
|
||||||
|
apiInstance.testBodyWithBinary(body, (error, data, response) => {
|
||||||
|
if (error) {
|
||||||
|
console.error(error);
|
||||||
|
} else {
|
||||||
|
console.log('API called successfully.');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**body** | **File**| image to upload |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
null (empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: image/png
|
||||||
|
- **Accept**: Not defined
|
||||||
|
|
||||||
|
|
||||||
|
## testBodyWithFileSchema
|
||||||
|
|
||||||
|
> testBodyWithFileSchema(fileSchemaTestClass)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
For this test, the body for this request must reference a schema named `File`.
|
||||||
|
|
||||||
|
### Example
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
import OpenApiPetstore from 'open_api_petstore';
|
||||||
|
|
||||||
|
let apiInstance = new OpenApiPetstore.FakeApi();
|
||||||
|
let fileSchemaTestClass = new OpenApiPetstore.FileSchemaTestClass(); // FileSchemaTestClass |
|
||||||
|
apiInstance.testBodyWithFileSchema(fileSchemaTestClass, (error, data, response) => {
|
||||||
|
if (error) {
|
||||||
|
console.error(error);
|
||||||
|
} else {
|
||||||
|
console.log('API called successfully.');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**fileSchemaTestClass** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
null (empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: application/json
|
||||||
|
- **Accept**: Not defined
|
||||||
|
|
||||||
|
|
||||||
|
## testBodyWithQueryParams
|
||||||
|
|
||||||
|
> testBodyWithQueryParams(query, user)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Example
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
import OpenApiPetstore from 'open_api_petstore';
|
||||||
|
|
||||||
|
let apiInstance = new OpenApiPetstore.FakeApi();
|
||||||
|
let query = "query_example"; // String |
|
||||||
|
let user = new OpenApiPetstore.User(); // User |
|
||||||
|
apiInstance.testBodyWithQueryParams(query, user, (error, data, response) => {
|
||||||
|
if (error) {
|
||||||
|
console.error(error);
|
||||||
|
} else {
|
||||||
|
console.log('API called successfully.');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**query** | **String**| |
|
||||||
|
**user** | [**User**](User.md)| |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
null (empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: application/json
|
||||||
|
- **Accept**: Not defined
|
||||||
|
|
||||||
|
|
||||||
|
## testClientModel
|
||||||
|
|
||||||
|
> Client testClientModel(client)
|
||||||
|
|
||||||
|
To test \"client\" model
|
||||||
|
|
||||||
|
To test \"client\" model
|
||||||
|
|
||||||
|
### Example
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
import OpenApiPetstore from 'open_api_petstore';
|
||||||
|
|
||||||
|
let apiInstance = new OpenApiPetstore.FakeApi();
|
||||||
|
let client = new OpenApiPetstore.Client(); // Client | client model
|
||||||
|
apiInstance.testClientModel(client, (error, data, response) => {
|
||||||
|
if (error) {
|
||||||
|
console.error(error);
|
||||||
|
} else {
|
||||||
|
console.log('API called successfully. Returned data: ' + data);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**client** | [**Client**](Client.md)| client model |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
[**Client**](Client.md)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: application/json
|
||||||
|
- **Accept**: application/json
|
||||||
|
|
||||||
|
|
||||||
|
## testEndpointParameters
|
||||||
|
|
||||||
|
> testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, opts)
|
||||||
|
|
||||||
|
Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||||
|
|
||||||
|
Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||||
|
|
||||||
|
### Example
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
import OpenApiPetstore from 'open_api_petstore';
|
||||||
|
let defaultClient = OpenApiPetstore.ApiClient.instance;
|
||||||
|
// Configure HTTP basic authorization: http_basic_test
|
||||||
|
let http_basic_test = defaultClient.authentications['http_basic_test'];
|
||||||
|
http_basic_test.username = 'YOUR USERNAME';
|
||||||
|
http_basic_test.password = 'YOUR PASSWORD';
|
||||||
|
|
||||||
|
let apiInstance = new OpenApiPetstore.FakeApi();
|
||||||
|
let number = 3.4; // Number | None
|
||||||
|
let _double = 3.4; // Number | None
|
||||||
|
let patternWithoutDelimiter = "patternWithoutDelimiter_example"; // String | None
|
||||||
|
let _byte = null; // Blob | None
|
||||||
|
let opts = {
|
||||||
|
'integer': 56, // Number | None
|
||||||
|
'int32': 56, // Number | None
|
||||||
|
'int64': 789, // Number | None
|
||||||
|
'_float': 3.4, // Number | None
|
||||||
|
'string': "string_example", // String | None
|
||||||
|
'binary': "/path/to/file", // File | None
|
||||||
|
'date': new Date("2013-10-20"), // Date | None
|
||||||
|
'dateTime': new Date("2013-10-20T19:20:30+01:00"), // Date | None
|
||||||
|
'password': "password_example", // String | None
|
||||||
|
'callback': "callback_example" // String | None
|
||||||
|
};
|
||||||
|
apiInstance.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, opts, (error, data, response) => {
|
||||||
|
if (error) {
|
||||||
|
console.error(error);
|
||||||
|
} else {
|
||||||
|
console.log('API called successfully.');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**number** | **Number**| None |
|
||||||
|
**_double** | **Number**| None |
|
||||||
|
**patternWithoutDelimiter** | **String**| None |
|
||||||
|
**_byte** | **Blob**| None |
|
||||||
|
**integer** | **Number**| None | [optional]
|
||||||
|
**int32** | **Number**| None | [optional]
|
||||||
|
**int64** | **Number**| None | [optional]
|
||||||
|
**_float** | **Number**| None | [optional]
|
||||||
|
**string** | **String**| None | [optional]
|
||||||
|
**binary** | **File**| None | [optional]
|
||||||
|
**date** | **Date**| None | [optional]
|
||||||
|
**dateTime** | **Date**| None | [optional]
|
||||||
|
**password** | **String**| None | [optional]
|
||||||
|
**callback** | **String**| None | [optional]
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
null (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
|
||||||
|
|
||||||
|
|
||||||
|
## testEnumParameters
|
||||||
|
|
||||||
|
> testEnumParameters(opts)
|
||||||
|
|
||||||
|
To test enum parameters
|
||||||
|
|
||||||
|
To test enum parameters
|
||||||
|
|
||||||
|
### Example
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
import OpenApiPetstore from 'open_api_petstore';
|
||||||
|
|
||||||
|
let apiInstance = new OpenApiPetstore.FakeApi();
|
||||||
|
let opts = {
|
||||||
|
'enumHeaderStringArray': ["'$'"], // [String] | Header parameter enum test (string array)
|
||||||
|
'enumHeaderString': "'-efg'", // String | Header parameter enum test (string)
|
||||||
|
'enumQueryStringArray': ["'$'"], // [String] | Query parameter enum test (string array)
|
||||||
|
'enumQueryString': "'-efg'", // String | Query parameter enum test (string)
|
||||||
|
'enumQueryInteger': 56, // Number | Query parameter enum test (double)
|
||||||
|
'enumQueryDouble': 3.4, // Number | Query parameter enum test (double)
|
||||||
|
'enumQueryModelArray': [new OpenApiPetstore.EnumClass()], // [EnumClass] |
|
||||||
|
'enumFormStringArray': ["'$'"], // [String] | Form parameter enum test (string array)
|
||||||
|
'enumFormString': "'-efg'" // String | Form parameter enum test (string)
|
||||||
|
};
|
||||||
|
apiInstance.testEnumParameters(opts, (error, data, response) => {
|
||||||
|
if (error) {
|
||||||
|
console.error(error);
|
||||||
|
} else {
|
||||||
|
console.log('API called successfully.');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**enumHeaderStringArray** | [**[String]**](String.md)| Header parameter enum test (string array) | [optional]
|
||||||
|
**enumHeaderString** | **String**| Header parameter enum test (string) | [optional] [default to '-efg']
|
||||||
|
**enumQueryStringArray** | [**[String]**](String.md)| Query parameter enum test (string array) | [optional]
|
||||||
|
**enumQueryString** | **String**| Query parameter enum test (string) | [optional] [default to '-efg']
|
||||||
|
**enumQueryInteger** | **Number**| Query parameter enum test (double) | [optional]
|
||||||
|
**enumQueryDouble** | **Number**| Query parameter enum test (double) | [optional]
|
||||||
|
**enumQueryModelArray** | [**[EnumClass]**](EnumClass.md)| | [optional]
|
||||||
|
**enumFormStringArray** | [**[String]**](String.md)| Form parameter enum test (string array) | [optional] [default to '$']
|
||||||
|
**enumFormString** | **String**| Form parameter enum test (string) | [optional] [default to '-efg']
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
null (empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: application/x-www-form-urlencoded
|
||||||
|
- **Accept**: Not defined
|
||||||
|
|
||||||
|
|
||||||
|
## testGroupParameters
|
||||||
|
|
||||||
|
> testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, opts)
|
||||||
|
|
||||||
|
Fake endpoint to test group parameters (optional)
|
||||||
|
|
||||||
|
Fake endpoint to test group parameters (optional)
|
||||||
|
|
||||||
|
### Example
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
import OpenApiPetstore from 'open_api_petstore';
|
||||||
|
let defaultClient = OpenApiPetstore.ApiClient.instance;
|
||||||
|
// Configure Bearer (JWT) access token for authorization: bearer_test
|
||||||
|
let bearer_test = defaultClient.authentications['bearer_test'];
|
||||||
|
bearer_test.accessToken = "YOUR ACCESS TOKEN"
|
||||||
|
|
||||||
|
let apiInstance = new OpenApiPetstore.FakeApi();
|
||||||
|
let requiredStringGroup = 56; // Number | Required String in group parameters
|
||||||
|
let requiredBooleanGroup = true; // Boolean | Required Boolean in group parameters
|
||||||
|
let requiredInt64Group = 789; // Number | Required Integer in group parameters
|
||||||
|
let opts = {
|
||||||
|
'stringGroup': 56, // Number | String in group parameters
|
||||||
|
'booleanGroup': true, // Boolean | Boolean in group parameters
|
||||||
|
'int64Group': 789 // Number | Integer in group parameters
|
||||||
|
};
|
||||||
|
apiInstance.testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, opts, (error, data, response) => {
|
||||||
|
if (error) {
|
||||||
|
console.error(error);
|
||||||
|
} else {
|
||||||
|
console.log('API called successfully.');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**requiredStringGroup** | **Number**| Required String in group parameters |
|
||||||
|
**requiredBooleanGroup** | **Boolean**| Required Boolean in group parameters |
|
||||||
|
**requiredInt64Group** | **Number**| Required Integer in group parameters |
|
||||||
|
**stringGroup** | **Number**| String in group parameters | [optional]
|
||||||
|
**booleanGroup** | **Boolean**| Boolean in group parameters | [optional]
|
||||||
|
**int64Group** | **Number**| Integer in group parameters | [optional]
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
null (empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
[bearer_test](../README.md#bearer_test)
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: Not defined
|
||||||
|
|
||||||
|
|
||||||
|
## testInlineAdditionalProperties
|
||||||
|
|
||||||
|
> testInlineAdditionalProperties(requestBody)
|
||||||
|
|
||||||
|
test inline additionalProperties
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Example
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
import OpenApiPetstore from 'open_api_petstore';
|
||||||
|
|
||||||
|
let apiInstance = new OpenApiPetstore.FakeApi();
|
||||||
|
let requestBody = {key: "null"}; // {String: String} | request body
|
||||||
|
apiInstance.testInlineAdditionalProperties(requestBody, (error, data, response) => {
|
||||||
|
if (error) {
|
||||||
|
console.error(error);
|
||||||
|
} else {
|
||||||
|
console.log('API called successfully.');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**requestBody** | [**{String: String}**](String.md)| request body |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
null (empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: application/json
|
||||||
|
- **Accept**: Not defined
|
||||||
|
|
||||||
|
|
||||||
|
## testJsonFormData
|
||||||
|
|
||||||
|
> testJsonFormData(param, param2)
|
||||||
|
|
||||||
|
test json serialization of form data
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Example
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
import OpenApiPetstore from 'open_api_petstore';
|
||||||
|
|
||||||
|
let apiInstance = new OpenApiPetstore.FakeApi();
|
||||||
|
let param = "param_example"; // String | field1
|
||||||
|
let param2 = "param2_example"; // String | field2
|
||||||
|
apiInstance.testJsonFormData(param, param2, (error, data, response) => {
|
||||||
|
if (error) {
|
||||||
|
console.error(error);
|
||||||
|
} else {
|
||||||
|
console.log('API called successfully.');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**param** | **String**| field1 |
|
||||||
|
**param2** | **String**| field2 |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
null (empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: application/x-www-form-urlencoded
|
||||||
|
- **Accept**: Not defined
|
||||||
|
|
||||||
|
|
||||||
|
## testQueryParameterCollectionFormat
|
||||||
|
|
||||||
|
> testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, allowEmpty, opts)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
To test the collection format in query parameters
|
||||||
|
|
||||||
|
### Example
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
import OpenApiPetstore from 'open_api_petstore';
|
||||||
|
|
||||||
|
let apiInstance = new OpenApiPetstore.FakeApi();
|
||||||
|
let pipe = ["null"]; // [String] |
|
||||||
|
let ioutil = ["null"]; // [String] |
|
||||||
|
let http = ["null"]; // [String] |
|
||||||
|
let url = ["null"]; // [String] |
|
||||||
|
let context = ["null"]; // [String] |
|
||||||
|
let allowEmpty = "allowEmpty_example"; // String |
|
||||||
|
let opts = {
|
||||||
|
'language': {key: "null"} // {String: String} |
|
||||||
|
};
|
||||||
|
apiInstance.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, allowEmpty, opts, (error, data, response) => {
|
||||||
|
if (error) {
|
||||||
|
console.error(error);
|
||||||
|
} else {
|
||||||
|
console.log('API called successfully.');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**pipe** | [**[String]**](String.md)| |
|
||||||
|
**ioutil** | [**[String]**](String.md)| |
|
||||||
|
**http** | [**[String]**](String.md)| |
|
||||||
|
**url** | [**[String]**](String.md)| |
|
||||||
|
**context** | [**[String]**](String.md)| |
|
||||||
|
**allowEmpty** | **String**| |
|
||||||
|
**language** | [**{String: String}**](String.md)| | [optional]
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
null (empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: Not defined
|
||||||
|
|
@ -1,35 +1,35 @@
|
|||||||
# SwaggerPetstore.Fake_classname_tags123Api
|
# OpenApiPetstore.FakeClassnameTags123Api
|
||||||
|
|
||||||
All URIs are relative to *http://petstore.swagger.io:80/v2*
|
All URIs are relative to *http://petstore.swagger.io:80/v2*
|
||||||
|
|
||||||
Method | HTTP request | Description
|
Method | HTTP request | Description
|
||||||
------------- | ------------- | -------------
|
------------- | ------------- | -------------
|
||||||
[**testClassname**](Fake_classname_tags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case
|
[**testClassname**](FakeClassnameTags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case
|
||||||
|
|
||||||
|
|
||||||
<a name="testClassname"></a>
|
|
||||||
# **testClassname**
|
## testClassname
|
||||||
> Client testClassname(body)
|
|
||||||
|
> Client testClassname(client)
|
||||||
|
|
||||||
|
To test class name in snake case
|
||||||
|
|
||||||
To test class name in snake case
|
To test class name in snake case
|
||||||
|
|
||||||
### Example
|
### Example
|
||||||
```javascript
|
|
||||||
import SwaggerPetstore from 'swagger_petstore';
|
|
||||||
let defaultClient = SwaggerPetstore.ApiClient.instance;
|
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
import OpenApiPetstore from 'open_api_petstore';
|
||||||
|
let defaultClient = OpenApiPetstore.ApiClient.instance;
|
||||||
// Configure API key authorization: api_key_query
|
// Configure API key authorization: api_key_query
|
||||||
let api_key_query = defaultClient.authentications['api_key_query'];
|
let api_key_query = defaultClient.authentications['api_key_query'];
|
||||||
api_key_query.apiKey = 'YOUR API KEY';
|
api_key_query.apiKey = 'YOUR API KEY';
|
||||||
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
|
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
|
||||||
//api_key_query.apiKeyPrefix = 'Token';
|
//api_key_query.apiKeyPrefix = 'Token';
|
||||||
|
|
||||||
let apiInstance = new SwaggerPetstore.Fake_classname_tags123Api();
|
let apiInstance = new OpenApiPetstore.FakeClassnameTags123Api();
|
||||||
|
let client = new OpenApiPetstore.Client(); // Client | client model
|
||||||
let body = new SwaggerPetstore.Client(); // Client | client model
|
apiInstance.testClassname(client, (error, data, response) => {
|
||||||
|
|
||||||
|
|
||||||
apiInstance.testClassname(body, (error, data, response) => {
|
|
||||||
if (error) {
|
if (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
} else {
|
} else {
|
||||||
@ -40,9 +40,10 @@ apiInstance.testClassname(body, (error, data, response) => {
|
|||||||
|
|
||||||
### Parameters
|
### Parameters
|
||||||
|
|
||||||
|
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------- | ------------- | ------------- | -------------
|
------------- | ------------- | ------------- | -------------
|
||||||
**body** | [**Client**](Client.md)| client model |
|
**client** | [**Client**](Client.md)| client model |
|
||||||
|
|
||||||
### Return type
|
### Return type
|
||||||
|
|
||||||
@ -54,6 +55,6 @@ Name | Type | Description | Notes
|
|||||||
|
|
||||||
### HTTP request headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: application/json
|
- **Content-Type**: application/json
|
||||||
- **Accept**: application/json
|
- **Accept**: application/json
|
||||||
|
|
@ -1,9 +1,9 @@
|
|||||||
# OpenApiPetstore.AdditionalPropertiesAnyType
|
# OpenApiPetstore.File
|
||||||
|
|
||||||
## Properties
|
## Properties
|
||||||
|
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------ | ------------- | ------------- | -------------
|
------------ | ------------- | ------------- | -------------
|
||||||
**name** | **String** | | [optional]
|
**sourceURI** | **String** | Test capitalization | [optional]
|
||||||
|
|
||||||
|
|
@ -0,0 +1,10 @@
|
|||||||
|
# OpenApiPetstore.FileSchemaTestClass
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**file** | **File** | | [optional]
|
||||||
|
**files** | **[File]** | | [optional]
|
||||||
|
|
||||||
|
|
@ -1,9 +1,9 @@
|
|||||||
# OpenApiPetstore.AdditionalPropertiesBoolean
|
# OpenApiPetstore.Foo
|
||||||
|
|
||||||
## Properties
|
## Properties
|
||||||
|
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------ | ------------- | ------------- | -------------
|
------------ | ------------- | ------------- | -------------
|
||||||
**name** | **String** | | [optional]
|
**bar** | **String** | | [optional] [default to 'bar']
|
||||||
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
# OpenApiPetstore.InlineResponseDefault
|
# OpenApiPetstore.FooGetDefaultResponse
|
||||||
|
|
||||||
## Properties
|
## Properties
|
||||||
|
|
24
samples/client/petstore/javascript-apollo/docs/FormatTest.md
Normal file
24
samples/client/petstore/javascript-apollo/docs/FormatTest.md
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
# OpenApiPetstore.FormatTest
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**integer** | **Number** | | [optional]
|
||||||
|
**int32** | **Number** | | [optional]
|
||||||
|
**int64** | **Number** | | [optional]
|
||||||
|
**number** | **Number** | |
|
||||||
|
**_float** | **Number** | | [optional]
|
||||||
|
**_double** | **Number** | | [optional]
|
||||||
|
**decimal** | **Number** | | [optional]
|
||||||
|
**string** | **String** | | [optional]
|
||||||
|
**_byte** | **Blob** | |
|
||||||
|
**binary** | **File** | | [optional]
|
||||||
|
**date** | **Date** | |
|
||||||
|
**dateTime** | **Date** | | [optional]
|
||||||
|
**uuid** | **String** | | [optional]
|
||||||
|
**password** | **String** | |
|
||||||
|
**patternWithDigits** | **String** | A string that is a 10 digit number. Can have leading zeros. | [optional]
|
||||||
|
**patternWithDigitsAndDelimiter** | **String** | A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. | [optional]
|
||||||
|
|
||||||
|
|
@ -0,0 +1,10 @@
|
|||||||
|
# OpenApiPetstore.HasOnlyReadOnly
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**bar** | **String** | | [optional] [readonly]
|
||||||
|
**foo** | **String** | | [optional] [readonly]
|
||||||
|
|
||||||
|
|
@ -0,0 +1,9 @@
|
|||||||
|
# OpenApiPetstore.HealthCheckResult
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**nullableMessage** | **String** | | [optional]
|
||||||
|
|
||||||
|
|
@ -1,7 +1,9 @@
|
|||||||
# SwaggerPetstore.OuterString
|
# OpenApiPetstore.List
|
||||||
|
|
||||||
## Properties
|
## Properties
|
||||||
|
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------ | ------------- | ------------- | -------------
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**_123list** | **String** | | [optional]
|
||||||
|
|
||||||
|
|
23
samples/client/petstore/javascript-apollo/docs/MapTest.md
Normal file
23
samples/client/petstore/javascript-apollo/docs/MapTest.md
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
# OpenApiPetstore.MapTest
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**mapMapOfString** | **{String: {String: String}}** | | [optional]
|
||||||
|
**mapOfEnumString** | **{String: String}** | | [optional]
|
||||||
|
**directMap** | **{String: Boolean}** | | [optional]
|
||||||
|
**indirectMap** | **{String: Boolean}** | | [optional]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## Enum: {String: String}
|
||||||
|
|
||||||
|
|
||||||
|
* `UPPER` (value: `"UPPER"`)
|
||||||
|
|
||||||
|
* `lower` (value: `"lower"`)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,11 @@
|
|||||||
|
# OpenApiPetstore.MixedPropertiesAndAdditionalPropertiesClass
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**uuid** | **String** | | [optional]
|
||||||
|
**dateTime** | **Date** | | [optional]
|
||||||
|
**map** | [**{String: Animal}**](Animal.md) | | [optional]
|
||||||
|
|
||||||
|
|
@ -0,0 +1,10 @@
|
|||||||
|
# OpenApiPetstore.Model200Response
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**name** | **Number** | | [optional]
|
||||||
|
**_class** | **String** | | [optional]
|
||||||
|
|
||||||
|
|
12
samples/client/petstore/javascript-apollo/docs/Name.md
Normal file
12
samples/client/petstore/javascript-apollo/docs/Name.md
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
# OpenApiPetstore.Name
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**name** | **Number** | |
|
||||||
|
**snakeCase** | **Number** | | [optional] [readonly]
|
||||||
|
**property** | **String** | | [optional]
|
||||||
|
**_123number** | **Number** | | [optional] [readonly]
|
||||||
|
|
||||||
|
|
@ -0,0 +1,20 @@
|
|||||||
|
# OpenApiPetstore.NullableClass
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**integerProp** | **Number** | | [optional]
|
||||||
|
**numberProp** | **Number** | | [optional]
|
||||||
|
**booleanProp** | **Boolean** | | [optional]
|
||||||
|
**stringProp** | **String** | | [optional]
|
||||||
|
**dateProp** | **Date** | | [optional]
|
||||||
|
**datetimeProp** | **Date** | | [optional]
|
||||||
|
**arrayNullableProp** | **[Object]** | | [optional]
|
||||||
|
**arrayAndItemsNullableProp** | **[Object]** | | [optional]
|
||||||
|
**arrayItemsNullable** | **[Object]** | | [optional]
|
||||||
|
**objectNullableProp** | **{String: Object}** | | [optional]
|
||||||
|
**objectAndItemsNullableProp** | **{String: Object}** | | [optional]
|
||||||
|
**objectItemsNullable** | **{String: Object}** | | [optional]
|
||||||
|
|
||||||
|
|
@ -0,0 +1,9 @@
|
|||||||
|
# OpenApiPetstore.NumberOnly
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**justNumber** | **Number** | | [optional]
|
||||||
|
|
||||||
|
|
@ -0,0 +1,12 @@
|
|||||||
|
# OpenApiPetstore.ObjectWithDeprecatedFields
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**uuid** | **String** | | [optional]
|
||||||
|
**id** | **Number** | | [optional]
|
||||||
|
**deprecatedRef** | [**DeprecatedObject**](DeprecatedObject.md) | | [optional]
|
||||||
|
**bars** | **[String]** | | [optional]
|
||||||
|
|
||||||
|
|
@ -0,0 +1,11 @@
|
|||||||
|
# OpenApiPetstore.OuterComposite
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**myNumber** | **Number** | | [optional]
|
||||||
|
**myString** | **String** | | [optional]
|
||||||
|
**myBoolean** | **Boolean** | | [optional]
|
||||||
|
|
||||||
|
|
12
samples/client/petstore/javascript-apollo/docs/OuterEnum.md
Normal file
12
samples/client/petstore/javascript-apollo/docs/OuterEnum.md
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
# OpenApiPetstore.OuterEnum
|
||||||
|
|
||||||
|
## Enum
|
||||||
|
|
||||||
|
|
||||||
|
* `placed` (value: `"placed"`)
|
||||||
|
|
||||||
|
* `approved` (value: `"approved"`)
|
||||||
|
|
||||||
|
* `delivered` (value: `"delivered"`)
|
||||||
|
|
||||||
|
|
@ -0,0 +1,12 @@
|
|||||||
|
# OpenApiPetstore.OuterEnumDefaultValue
|
||||||
|
|
||||||
|
## Enum
|
||||||
|
|
||||||
|
|
||||||
|
* `placed` (value: `"placed"`)
|
||||||
|
|
||||||
|
* `approved` (value: `"approved"`)
|
||||||
|
|
||||||
|
* `delivered` (value: `"delivered"`)
|
||||||
|
|
||||||
|
|
@ -0,0 +1,12 @@
|
|||||||
|
# OpenApiPetstore.OuterEnumInteger
|
||||||
|
|
||||||
|
## Enum
|
||||||
|
|
||||||
|
|
||||||
|
* `0` (value: `0`)
|
||||||
|
|
||||||
|
* `1` (value: `1`)
|
||||||
|
|
||||||
|
* `2` (value: `2`)
|
||||||
|
|
||||||
|
|
@ -0,0 +1,12 @@
|
|||||||
|
# OpenApiPetstore.OuterEnumIntegerDefaultValue
|
||||||
|
|
||||||
|
## Enum
|
||||||
|
|
||||||
|
|
||||||
|
* `0` (value: `0`)
|
||||||
|
|
||||||
|
* `1` (value: `1`)
|
||||||
|
|
||||||
|
* `2` (value: `2`)
|
||||||
|
|
||||||
|
|
@ -1,10 +1,9 @@
|
|||||||
# OpenApiPetstore.InlineObject4
|
# OpenApiPetstore.OuterObjectWithEnumProperty
|
||||||
|
|
||||||
## Properties
|
## Properties
|
||||||
|
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------ | ------------- | ------------- | -------------
|
------------ | ------------- | ------------- | -------------
|
||||||
**param** | **String** | field1 |
|
**value** | [**OuterEnumInteger**](OuterEnumInteger.md) | |
|
||||||
**param2** | **String** | field2 |
|
|
||||||
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
|||||||
# OpenApiPetstore.PetApi
|
# OpenApiPetstore.PetApi
|
||||||
|
|
||||||
All URIs are relative to *http://petstore.swagger.io/v2*
|
All URIs are relative to *http://petstore.swagger.io:80/v2*
|
||||||
|
|
||||||
Method | HTTP request | Description
|
Method | HTTP request | Description
|
||||||
------------- | ------------- | -------------
|
------------- | ------------- | -------------
|
||||||
@ -12,15 +12,18 @@ Method | HTTP request | Description
|
|||||||
[**updatePet**](PetApi.md#updatePet) | **PUT** /pet | Update an existing pet
|
[**updatePet**](PetApi.md#updatePet) | **PUT** /pet | Update an existing pet
|
||||||
[**updatePetWithForm**](PetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data
|
[**updatePetWithForm**](PetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data
|
||||||
[**uploadFile**](PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image
|
[**uploadFile**](PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image
|
||||||
|
[**uploadFileWithRequiredFile**](PetApi.md#uploadFileWithRequiredFile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## addPet
|
## addPet
|
||||||
|
|
||||||
> addPet(body)
|
> addPet(pet)
|
||||||
|
|
||||||
Add a new pet to the store
|
Add a new pet to the store
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### Example
|
### Example
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
@ -31,8 +34,8 @@ let petstore_auth = defaultClient.authentications['petstore_auth'];
|
|||||||
petstore_auth.accessToken = 'YOUR ACCESS TOKEN';
|
petstore_auth.accessToken = 'YOUR ACCESS TOKEN';
|
||||||
|
|
||||||
let apiInstance = new OpenApiPetstore.PetApi();
|
let apiInstance = new OpenApiPetstore.PetApi();
|
||||||
let body = new OpenApiPetstore.Pet(); // Pet | Pet object that needs to be added to the store
|
let pet = new OpenApiPetstore.Pet(); // Pet | Pet object that needs to be added to the store
|
||||||
apiInstance.addPet(body, (error, data, response) => {
|
apiInstance.addPet(pet, (error, data, response) => {
|
||||||
if (error) {
|
if (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
} else {
|
} else {
|
||||||
@ -46,7 +49,7 @@ apiInstance.addPet(body, (error, data, response) => {
|
|||||||
|
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------- | ------------- | ------------- | -------------
|
------------- | ------------- | ------------- | -------------
|
||||||
**body** | [**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
|
### Return type
|
||||||
|
|
||||||
@ -68,6 +71,8 @@ null (empty response body)
|
|||||||
|
|
||||||
Deletes a pet
|
Deletes a pet
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### Example
|
### Example
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
@ -264,10 +269,12 @@ Name | Type | Description | Notes
|
|||||||
|
|
||||||
## updatePet
|
## updatePet
|
||||||
|
|
||||||
> updatePet(body)
|
> updatePet(pet)
|
||||||
|
|
||||||
Update an existing pet
|
Update an existing pet
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### Example
|
### Example
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
@ -278,8 +285,8 @@ let petstore_auth = defaultClient.authentications['petstore_auth'];
|
|||||||
petstore_auth.accessToken = 'YOUR ACCESS TOKEN';
|
petstore_auth.accessToken = 'YOUR ACCESS TOKEN';
|
||||||
|
|
||||||
let apiInstance = new OpenApiPetstore.PetApi();
|
let apiInstance = new OpenApiPetstore.PetApi();
|
||||||
let body = new OpenApiPetstore.Pet(); // Pet | Pet object that needs to be added to the store
|
let pet = new OpenApiPetstore.Pet(); // Pet | Pet object that needs to be added to the store
|
||||||
apiInstance.updatePet(body, (error, data, response) => {
|
apiInstance.updatePet(pet, (error, data, response) => {
|
||||||
if (error) {
|
if (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
} else {
|
} else {
|
||||||
@ -293,7 +300,7 @@ apiInstance.updatePet(body, (error, data, response) => {
|
|||||||
|
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------- | ------------- | ------------- | -------------
|
------------- | ------------- | ------------- | -------------
|
||||||
**body** | [**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
|
### Return type
|
||||||
|
|
||||||
@ -315,6 +322,8 @@ null (empty response body)
|
|||||||
|
|
||||||
Updates a pet in the store with form data
|
Updates a pet in the store with form data
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### Example
|
### Example
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
@ -368,6 +377,8 @@ null (empty response body)
|
|||||||
|
|
||||||
uploads an image
|
uploads an image
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### Example
|
### Example
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
@ -414,3 +425,58 @@ Name | Type | Description | Notes
|
|||||||
- **Content-Type**: multipart/form-data
|
- **Content-Type**: multipart/form-data
|
||||||
- **Accept**: application/json
|
- **Accept**: application/json
|
||||||
|
|
||||||
|
|
||||||
|
## uploadFileWithRequiredFile
|
||||||
|
|
||||||
|
> ApiResponse uploadFileWithRequiredFile(petId, requiredFile, opts)
|
||||||
|
|
||||||
|
uploads an image (required)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Example
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
import OpenApiPetstore from 'open_api_petstore';
|
||||||
|
let defaultClient = OpenApiPetstore.ApiClient.instance;
|
||||||
|
// Configure OAuth2 access token for authorization: petstore_auth
|
||||||
|
let petstore_auth = defaultClient.authentications['petstore_auth'];
|
||||||
|
petstore_auth.accessToken = 'YOUR ACCESS TOKEN';
|
||||||
|
|
||||||
|
let apiInstance = new OpenApiPetstore.PetApi();
|
||||||
|
let petId = 789; // Number | ID of pet to update
|
||||||
|
let requiredFile = "/path/to/file"; // File | file to upload
|
||||||
|
let opts = {
|
||||||
|
'additionalMetadata': "additionalMetadata_example" // String | Additional data to pass to server
|
||||||
|
};
|
||||||
|
apiInstance.uploadFileWithRequiredFile(petId, requiredFile, opts, (error, data, response) => {
|
||||||
|
if (error) {
|
||||||
|
console.error(error);
|
||||||
|
} else {
|
||||||
|
console.log('API called successfully. Returned data: ' + data);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**petId** | **Number**| ID of pet to update |
|
||||||
|
**requiredFile** | **File**| file to upload |
|
||||||
|
**additionalMetadata** | **String**| Additional data to pass to server | [optional]
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
[**ApiResponse**](ApiResponse.md)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
[petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: multipart/form-data
|
||||||
|
- **Accept**: application/json
|
||||||
|
|
||||||
|
@ -0,0 +1,10 @@
|
|||||||
|
# OpenApiPetstore.ReadOnlyFirst
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**bar** | **String** | | [optional] [readonly]
|
||||||
|
**baz** | **String** | | [optional]
|
||||||
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
# OpenApiPetstore.ModelReturn
|
# OpenApiPetstore.Return
|
||||||
|
|
||||||
## Properties
|
## Properties
|
||||||
|
|
@ -0,0 +1,9 @@
|
|||||||
|
# OpenApiPetstore.SpecialModelName
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**specialPropertyName** | **Number** | | [optional]
|
||||||
|
|
||||||
|
|
@ -1,12 +1,12 @@
|
|||||||
# OpenApiPetstore.StoreApi
|
# OpenApiPetstore.StoreApi
|
||||||
|
|
||||||
All URIs are relative to *http://petstore.swagger.io/v2*
|
All URIs are relative to *http://petstore.swagger.io:80/v2*
|
||||||
|
|
||||||
Method | HTTP request | Description
|
Method | HTTP request | Description
|
||||||
------------- | ------------- | -------------
|
------------- | ------------- | -------------
|
||||||
[**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID
|
[**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID
|
||||||
[**getInventory**](StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status
|
[**getInventory**](StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status
|
||||||
[**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{orderId} | Find purchase order by ID
|
[**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{order_id} | Find purchase order by ID
|
||||||
[**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet
|
[**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet
|
||||||
|
|
||||||
|
|
||||||
@ -150,18 +150,20 @@ No authorization required
|
|||||||
|
|
||||||
## placeOrder
|
## placeOrder
|
||||||
|
|
||||||
> Order placeOrder(body)
|
> Order placeOrder(order)
|
||||||
|
|
||||||
Place an order for a pet
|
Place an order for a pet
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### Example
|
### Example
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
import OpenApiPetstore from 'open_api_petstore';
|
import OpenApiPetstore from 'open_api_petstore';
|
||||||
|
|
||||||
let apiInstance = new OpenApiPetstore.StoreApi();
|
let apiInstance = new OpenApiPetstore.StoreApi();
|
||||||
let body = new OpenApiPetstore.Order(); // Order | order placed for purchasing the pet
|
let order = new OpenApiPetstore.Order(); // Order | order placed for purchasing the pet
|
||||||
apiInstance.placeOrder(body, (error, data, response) => {
|
apiInstance.placeOrder(order, (error, data, response) => {
|
||||||
if (error) {
|
if (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
} else {
|
} else {
|
||||||
@ -175,7 +177,7 @@ apiInstance.placeOrder(body, (error, data, response) => {
|
|||||||
|
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------- | ------------- | ------------- | -------------
|
------------- | ------------- | ------------- | -------------
|
||||||
**body** | [**Order**](Order.md)| order placed for purchasing the pet |
|
**order** | [**Order**](Order.md)| order placed for purchasing the pet |
|
||||||
|
|
||||||
### Return type
|
### Return type
|
||||||
|
|
||||||
@ -187,6 +189,6 @@ No authorization required
|
|||||||
|
|
||||||
### HTTP request headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
- **Content-Type**: application/json
|
||||||
- **Accept**: application/xml, application/json
|
- **Accept**: application/xml, application/json
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
# OpenApiPetstore.UserApi
|
# OpenApiPetstore.UserApi
|
||||||
|
|
||||||
All URIs are relative to *http://petstore.swagger.io/v2*
|
All URIs are relative to *http://petstore.swagger.io:80/v2*
|
||||||
|
|
||||||
Method | HTTP request | Description
|
Method | HTTP request | Description
|
||||||
------------- | ------------- | -------------
|
------------- | ------------- | -------------
|
||||||
@ -17,7 +17,7 @@ Method | HTTP request | Description
|
|||||||
|
|
||||||
## createUser
|
## createUser
|
||||||
|
|
||||||
> createUser(body)
|
> createUser(user)
|
||||||
|
|
||||||
Create user
|
Create user
|
||||||
|
|
||||||
@ -29,8 +29,8 @@ This can only be done by the logged in user.
|
|||||||
import OpenApiPetstore from 'open_api_petstore';
|
import OpenApiPetstore from 'open_api_petstore';
|
||||||
|
|
||||||
let apiInstance = new OpenApiPetstore.UserApi();
|
let apiInstance = new OpenApiPetstore.UserApi();
|
||||||
let body = new OpenApiPetstore.User(); // User | Created user object
|
let user = new OpenApiPetstore.User(); // User | Created user object
|
||||||
apiInstance.createUser(body, (error, data, response) => {
|
apiInstance.createUser(user, (error, data, response) => {
|
||||||
if (error) {
|
if (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
} else {
|
} else {
|
||||||
@ -44,7 +44,7 @@ apiInstance.createUser(body, (error, data, response) => {
|
|||||||
|
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------- | ------------- | ------------- | -------------
|
------------- | ------------- | ------------- | -------------
|
||||||
**body** | [**User**](User.md)| Created user object |
|
**user** | [**User**](User.md)| Created user object |
|
||||||
|
|
||||||
### Return type
|
### Return type
|
||||||
|
|
||||||
@ -56,24 +56,26 @@ No authorization required
|
|||||||
|
|
||||||
### HTTP request headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
- **Content-Type**: application/json
|
||||||
- **Accept**: Not defined
|
- **Accept**: Not defined
|
||||||
|
|
||||||
|
|
||||||
## createUsersWithArrayInput
|
## createUsersWithArrayInput
|
||||||
|
|
||||||
> createUsersWithArrayInput(body)
|
> createUsersWithArrayInput(user)
|
||||||
|
|
||||||
Creates list of users with given input array
|
Creates list of users with given input array
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### Example
|
### Example
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
import OpenApiPetstore from 'open_api_petstore';
|
import OpenApiPetstore from 'open_api_petstore';
|
||||||
|
|
||||||
let apiInstance = new OpenApiPetstore.UserApi();
|
let apiInstance = new OpenApiPetstore.UserApi();
|
||||||
let body = [new OpenApiPetstore.User()]; // [User] | List of user object
|
let user = [new OpenApiPetstore.User()]; // [User] | List of user object
|
||||||
apiInstance.createUsersWithArrayInput(body, (error, data, response) => {
|
apiInstance.createUsersWithArrayInput(user, (error, data, response) => {
|
||||||
if (error) {
|
if (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
} else {
|
} else {
|
||||||
@ -87,7 +89,7 @@ apiInstance.createUsersWithArrayInput(body, (error, data, response) => {
|
|||||||
|
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------- | ------------- | ------------- | -------------
|
------------- | ------------- | ------------- | -------------
|
||||||
**body** | [**[User]**](User.md)| List of user object |
|
**user** | [**[User]**](User.md)| List of user object |
|
||||||
|
|
||||||
### Return type
|
### Return type
|
||||||
|
|
||||||
@ -99,24 +101,26 @@ No authorization required
|
|||||||
|
|
||||||
### HTTP request headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
- **Content-Type**: application/json
|
||||||
- **Accept**: Not defined
|
- **Accept**: Not defined
|
||||||
|
|
||||||
|
|
||||||
## createUsersWithListInput
|
## createUsersWithListInput
|
||||||
|
|
||||||
> createUsersWithListInput(body)
|
> createUsersWithListInput(user)
|
||||||
|
|
||||||
Creates list of users with given input array
|
Creates list of users with given input array
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### Example
|
### Example
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
import OpenApiPetstore from 'open_api_petstore';
|
import OpenApiPetstore from 'open_api_petstore';
|
||||||
|
|
||||||
let apiInstance = new OpenApiPetstore.UserApi();
|
let apiInstance = new OpenApiPetstore.UserApi();
|
||||||
let body = [new OpenApiPetstore.User()]; // [User] | List of user object
|
let user = [new OpenApiPetstore.User()]; // [User] | List of user object
|
||||||
apiInstance.createUsersWithListInput(body, (error, data, response) => {
|
apiInstance.createUsersWithListInput(user, (error, data, response) => {
|
||||||
if (error) {
|
if (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
} else {
|
} else {
|
||||||
@ -130,7 +134,7 @@ apiInstance.createUsersWithListInput(body, (error, data, response) => {
|
|||||||
|
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------- | ------------- | ------------- | -------------
|
------------- | ------------- | ------------- | -------------
|
||||||
**body** | [**[User]**](User.md)| List of user object |
|
**user** | [**[User]**](User.md)| List of user object |
|
||||||
|
|
||||||
### Return type
|
### Return type
|
||||||
|
|
||||||
@ -142,7 +146,7 @@ No authorization required
|
|||||||
|
|
||||||
### HTTP request headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
- **Content-Type**: application/json
|
||||||
- **Accept**: Not defined
|
- **Accept**: Not defined
|
||||||
|
|
||||||
|
|
||||||
@ -197,6 +201,8 @@ No authorization required
|
|||||||
|
|
||||||
Get user by user name
|
Get user by user name
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### Example
|
### Example
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
@ -240,6 +246,8 @@ No authorization required
|
|||||||
|
|
||||||
Logs user into the system
|
Logs user into the system
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### Example
|
### Example
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
@ -285,6 +293,8 @@ No authorization required
|
|||||||
|
|
||||||
Logs out current logged in user session
|
Logs out current logged in user session
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### Example
|
### Example
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
@ -320,7 +330,7 @@ No authorization required
|
|||||||
|
|
||||||
## updateUser
|
## updateUser
|
||||||
|
|
||||||
> updateUser(username, body)
|
> updateUser(username, user)
|
||||||
|
|
||||||
Updated user
|
Updated user
|
||||||
|
|
||||||
@ -333,8 +343,8 @@ import OpenApiPetstore from 'open_api_petstore';
|
|||||||
|
|
||||||
let apiInstance = new OpenApiPetstore.UserApi();
|
let apiInstance = new OpenApiPetstore.UserApi();
|
||||||
let username = "username_example"; // String | name that need to be deleted
|
let username = "username_example"; // String | name that need to be deleted
|
||||||
let body = new OpenApiPetstore.User(); // User | Updated user object
|
let user = new OpenApiPetstore.User(); // User | Updated user object
|
||||||
apiInstance.updateUser(username, body, (error, data, response) => {
|
apiInstance.updateUser(username, user, (error, data, response) => {
|
||||||
if (error) {
|
if (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
} else {
|
} else {
|
||||||
@ -349,7 +359,7 @@ apiInstance.updateUser(username, body, (error, data, response) => {
|
|||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------- | ------------- | ------------- | -------------
|
------------- | ------------- | ------------- | -------------
|
||||||
**username** | **String**| name that need to be deleted |
|
**username** | **String**| name that need to be deleted |
|
||||||
**body** | [**User**](User.md)| Updated user object |
|
**user** | [**User**](User.md)| Updated user object |
|
||||||
|
|
||||||
### Return type
|
### Return type
|
||||||
|
|
||||||
@ -361,6 +371,6 @@ No authorization required
|
|||||||
|
|
||||||
### HTTP request headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
- **Content-Type**: application/json
|
||||||
- **Accept**: Not defined
|
- **Accept**: Not defined
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
|
# 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"
|
# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com"
|
||||||
|
|
||||||
git_user_id=$1
|
git_user_id=$1
|
||||||
git_repo_id=$2
|
git_repo_id=$2
|
||||||
@ -38,14 +38,14 @@ git add .
|
|||||||
git commit -m "$release_note"
|
git commit -m "$release_note"
|
||||||
|
|
||||||
# Sets the new remote
|
# Sets the new remote
|
||||||
git_remote=`git remote`
|
git_remote=$(git remote)
|
||||||
if [ "$git_remote" = "" ]; then # git remote not defined
|
if [ "$git_remote" = "" ]; then # git remote not defined
|
||||||
|
|
||||||
if [ "$GIT_TOKEN" = "" ]; then
|
if [ "$GIT_TOKEN" = "" ]; then
|
||||||
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
|
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
|
git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git
|
||||||
else
|
else
|
||||||
git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git
|
git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git
|
||||||
fi
|
fi
|
||||||
|
|
||||||
fi
|
fi
|
||||||
@ -55,4 +55,3 @@ git pull origin master
|
|||||||
# Pushes (Forces) the changes in the local repository up to the remote repository
|
# 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"
|
echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git"
|
||||||
git push origin master 2>&1 | grep -v 'To https'
|
git push origin master 2>&1 | grep -v 'To https'
|
||||||
|
|
||||||
|
@ -1,24 +1,47 @@
|
|||||||
{
|
{
|
||||||
"name": "open_api_petstore",
|
"name": "open_api_petstore",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"description": "This_is_a_sample_server_Petstore_server__For_this_sample_you_can_use_the_api_key_special_key_to_test_the_authorization_filters_",
|
"description": "This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"main": "src/index.js",
|
"main": "dist/index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
"build": "babel src -d dist",
|
||||||
|
"prepare": "npm run build",
|
||||||
"test": "mocha --require @babel/register --recursive"
|
"test": "mocha --require @babel/register --recursive"
|
||||||
},
|
},
|
||||||
"browser": {
|
"browser": {
|
||||||
"fs": false
|
"fs": false
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"apollo-datasource-rest": "^0.7.0"
|
"@babel/cli": "^7.0.0",
|
||||||
|
"apollo-datasource-rest": "^3.6.1",
|
||||||
|
"superagent": "^5.3.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"@babel/core": "^7.0.0",
|
||||||
|
"@babel/plugin-proposal-class-properties": "^7.0.0",
|
||||||
|
"@babel/plugin-proposal-decorators": "^7.0.0",
|
||||||
|
"@babel/plugin-proposal-do-expressions": "^7.0.0",
|
||||||
|
"@babel/plugin-proposal-export-default-from": "^7.0.0",
|
||||||
|
"@babel/plugin-proposal-export-namespace-from": "^7.0.0",
|
||||||
|
"@babel/plugin-proposal-function-bind": "^7.0.0",
|
||||||
|
"@babel/plugin-proposal-function-sent": "^7.0.0",
|
||||||
|
"@babel/plugin-proposal-json-strings": "^7.0.0",
|
||||||
|
"@babel/plugin-proposal-logical-assignment-operators": "^7.0.0",
|
||||||
|
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.0.0",
|
||||||
|
"@babel/plugin-proposal-numeric-separator": "^7.0.0",
|
||||||
|
"@babel/plugin-proposal-optional-chaining": "^7.0.0",
|
||||||
|
"@babel/plugin-proposal-pipeline-operator": "^7.0.0",
|
||||||
|
"@babel/plugin-proposal-throw-expressions": "^7.0.0",
|
||||||
|
"@babel/plugin-syntax-dynamic-import": "^7.0.0",
|
||||||
|
"@babel/plugin-syntax-import-meta": "^7.0.0",
|
||||||
|
"@babel/preset-env": "^7.0.0",
|
||||||
|
"@babel/register": "^7.0.0",
|
||||||
"expect.js": "^0.3.1",
|
"expect.js": "^0.3.1",
|
||||||
"mocha": "^5.2.0",
|
"mocha": "^8.0.1",
|
||||||
"sinon": "^7.2.0"
|
"sinon": "^7.2.0"
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
"src"
|
"dist"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/**
|
/**
|
||||||
* OpenAPI Petstore
|
* 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.
|
* 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
|
* The version of the OpenAPI document: 1.0.0
|
||||||
*
|
*
|
||||||
@ -12,7 +12,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
import RESTDataSource from 'apollo-datasource-rest';
|
import { RESTDataSource } from 'apollo-datasource-rest';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @module ApiClient
|
* @module ApiClient
|
||||||
@ -26,15 +26,25 @@ import RESTDataSource from 'apollo-datasource-rest';
|
|||||||
* @class
|
* @class
|
||||||
*/
|
*/
|
||||||
export default class ApiClient extends RESTDataSource {
|
export default class ApiClient extends RESTDataSource {
|
||||||
constructor() {
|
constructor(baseURL = 'http://petstore.swagger.io:80/v2') {
|
||||||
super()
|
super()
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The base URL against which to resolve every API call's (relative) path.
|
||||||
|
* @type {String}
|
||||||
|
* @default http://petstore.swagger.io:80/v2
|
||||||
|
*/
|
||||||
|
this.baseURL = baseURL.replace(/\/+$/, '');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The authentication methods to be included for all API calls.
|
* The authentication methods to be included for all API calls.
|
||||||
* @type {Array.<String>}
|
* @type {Array.<String>}
|
||||||
*/
|
*/
|
||||||
this.authentications = {
|
this.authentications = {
|
||||||
'api_key': {type: 'apiKey', 'in': 'header', name: 'api_key'},
|
'api_key': {type: 'apiKey', 'in': 'header', name: 'api_key'},
|
||||||
|
'api_key_query': {type: 'apiKey', 'in': 'query', name: 'api_key_query'},
|
||||||
|
'bearer_test': {type: 'bearer'}, // JWT
|
||||||
|
'http_basic_test': {type: 'basic'},
|
||||||
'petstore_auth': {type: 'oauth2'}
|
'petstore_auth': {type: 'oauth2'}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -51,7 +61,7 @@ export default class ApiClient extends RESTDataSource {
|
|||||||
}
|
}
|
||||||
|
|
||||||
parametrizePath(path, pathParams) {
|
parametrizePath(path, pathParams) {
|
||||||
return url.replace(/\{([\w-]+)\}/g, (fullMatch, key) => {
|
return path.replace(/\{([\w-]+)\}/g, (fullMatch, key) => {
|
||||||
var value;
|
var value;
|
||||||
if (pathParams.hasOwnProperty(key)) {
|
if (pathParams.hasOwnProperty(key)) {
|
||||||
value = this.paramToString(pathParams[key]);
|
value = this.paramToString(pathParams[key]);
|
||||||
@ -174,7 +184,7 @@ export default class ApiClient extends RESTDataSource {
|
|||||||
|
|
||||||
async callApi(path, httpMethod, pathParams,
|
async callApi(path, httpMethod, pathParams,
|
||||||
queryParams, headerParams, formParams, bodyParam, authNames,
|
queryParams, headerParams, formParams, bodyParam, authNames,
|
||||||
returnType) {
|
contentTypes, accepts, returnType, requestInit) {
|
||||||
|
|
||||||
var parameterizedPath = this.parametrizePath(path, pathParams);
|
var parameterizedPath = this.parametrizePath(path, pathParams);
|
||||||
var fetchOptions = {
|
var fetchOptions = {
|
||||||
@ -185,7 +195,7 @@ export default class ApiClient extends RESTDataSource {
|
|||||||
this.applyAuthOptions(fetchOptions, authNames);
|
this.applyAuthOptions(fetchOptions, authNames);
|
||||||
|
|
||||||
var body = null;
|
var body = null;
|
||||||
|
|
||||||
if (bodyParam !== null && bodyParam !== undefined) {
|
if (bodyParam !== null && bodyParam !== undefined) {
|
||||||
body = bodyParam;
|
body = bodyParam;
|
||||||
} else if (formParams !== null && formParams !== undefined) {
|
} else if (formParams !== null && formParams !== undefined) {
|
||||||
@ -201,9 +211,9 @@ export default class ApiClient extends RESTDataSource {
|
|||||||
var httpMethodFn = httpMethod.toLowerCase();
|
var httpMethodFn = httpMethod.toLowerCase();
|
||||||
|
|
||||||
if (httpMethodFn == 'get' || httpMethodFn == 'delete') {
|
if (httpMethodFn == 'get' || httpMethodFn == 'delete') {
|
||||||
response = await this[httpMethodFn](parameterizedPath, fetchOptions);
|
response = await this[httpMethodFn](parameterizedPath, [], requestInit);
|
||||||
} else {
|
} else {
|
||||||
response = await this[httpMethodFn](parameterizedPath, body, fetchOptions)
|
response = await this[httpMethodFn](parameterizedPath, body, requestInit)
|
||||||
}
|
}
|
||||||
|
|
||||||
var convertedResponse = ApiClient.convertToType(response, returnType);
|
var convertedResponse = ApiClient.convertToType(response, returnType);
|
||||||
@ -232,7 +242,7 @@ export default class ApiClient extends RESTDataSource {
|
|||||||
case 'Blob':
|
case 'Blob':
|
||||||
return data;
|
return data;
|
||||||
default:
|
default:
|
||||||
if (type === Object) {
|
if (typeof type === "object") {
|
||||||
// generic object, return directly
|
// generic object, return directly
|
||||||
return data;
|
return data;
|
||||||
} else if (typeof type.constructFromObject === 'function') {
|
} else if (typeof type.constructFromObject === 'function') {
|
||||||
|
@ -0,0 +1,73 @@
|
|||||||
|
/**
|
||||||
|
* OpenAPI Petstore
|
||||||
|
* 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.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
import ApiClient from "../ApiClient";
|
||||||
|
import Client from '../model/Client';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* AnotherFake service.
|
||||||
|
* @module api/AnotherFakeApi
|
||||||
|
* @version 1.0.0
|
||||||
|
*/
|
||||||
|
export default class AnotherFakeApi extends ApiClient {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructs a new AnotherFakeApi.
|
||||||
|
* @alias module:api/AnotherFakeApi
|
||||||
|
* @class
|
||||||
|
*/
|
||||||
|
constructor(baseURL = 'http://petstore.swagger.io:80/v2') {
|
||||||
|
super(baseURL);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* To test special tags
|
||||||
|
* To test special tags and operation ID starting with number
|
||||||
|
* @param {module:model/Client} client client model
|
||||||
|
* @param requestInit Dynamic configuration. @see {@link https://github.com/apollographql/apollo-server/pull/1277}
|
||||||
|
* @return {Promise<module:model/Client>}
|
||||||
|
*/
|
||||||
|
async call123testSpecialTags(client, requestInit) {
|
||||||
|
let postBody = client;
|
||||||
|
// verify the required parameter 'client' is set
|
||||||
|
if (client === undefined || client === null) {
|
||||||
|
throw new Error("Missing the required parameter 'client' when calling call123testSpecialTags");
|
||||||
|
}
|
||||||
|
|
||||||
|
let pathParams = {
|
||||||
|
};
|
||||||
|
let queryParams = {
|
||||||
|
};
|
||||||
|
let headerParams = {
|
||||||
|
'User-Agent': 'OpenAPI-Generator/1.0.0/Javascript',
|
||||||
|
};
|
||||||
|
let formParams = {
|
||||||
|
};
|
||||||
|
|
||||||
|
let authNames = [];
|
||||||
|
let contentTypes = ['application/json'];
|
||||||
|
let accepts = ['application/json'];
|
||||||
|
let returnType = Client;
|
||||||
|
|
||||||
|
return this.callApi(
|
||||||
|
'/another-fake/dummy', 'PATCH',
|
||||||
|
pathParams, queryParams, headerParams, formParams, postBody,
|
||||||
|
authNames, contentTypes, accepts, returnType, requestInit
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,66 @@
|
|||||||
|
/**
|
||||||
|
* OpenAPI Petstore
|
||||||
|
* 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.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
import ApiClient from "../ApiClient";
|
||||||
|
import FooGetDefaultResponse from '../model/FooGetDefaultResponse';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Default service.
|
||||||
|
* @module api/DefaultApi
|
||||||
|
* @version 1.0.0
|
||||||
|
*/
|
||||||
|
export default class DefaultApi extends ApiClient {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructs a new DefaultApi.
|
||||||
|
* @alias module:api/DefaultApi
|
||||||
|
* @class
|
||||||
|
*/
|
||||||
|
constructor(baseURL = 'http://petstore.swagger.io:80/v2') {
|
||||||
|
super(baseURL);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param requestInit Dynamic configuration. @see {@link https://github.com/apollographql/apollo-server/pull/1277}
|
||||||
|
* @return {Promise<module:model/FooGetDefaultResponse>}
|
||||||
|
*/
|
||||||
|
async fooGet(requestInit) {
|
||||||
|
let postBody = null;
|
||||||
|
|
||||||
|
let pathParams = {
|
||||||
|
};
|
||||||
|
let queryParams = {
|
||||||
|
};
|
||||||
|
let headerParams = {
|
||||||
|
'User-Agent': 'OpenAPI-Generator/1.0.0/Javascript',
|
||||||
|
};
|
||||||
|
let formParams = {
|
||||||
|
};
|
||||||
|
|
||||||
|
let authNames = [];
|
||||||
|
let contentTypes = [];
|
||||||
|
let accepts = ['application/json'];
|
||||||
|
let returnType = FooGetDefaultResponse;
|
||||||
|
|
||||||
|
return this.callApi(
|
||||||
|
'/foo', 'GET',
|
||||||
|
pathParams, queryParams, headerParams, formParams, postBody,
|
||||||
|
authNames, contentTypes, accepts, returnType, requestInit
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
762
samples/client/petstore/javascript-apollo/src/api/FakeApi.js
Normal file
762
samples/client/petstore/javascript-apollo/src/api/FakeApi.js
Normal file
@ -0,0 +1,762 @@
|
|||||||
|
/**
|
||||||
|
* OpenAPI Petstore
|
||||||
|
* 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.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
import ApiClient from "../ApiClient";
|
||||||
|
import Client from '../model/Client';
|
||||||
|
import EnumClass from '../model/EnumClass';
|
||||||
|
import FileSchemaTestClass from '../model/FileSchemaTestClass';
|
||||||
|
import HealthCheckResult from '../model/HealthCheckResult';
|
||||||
|
import OuterComposite from '../model/OuterComposite';
|
||||||
|
import OuterObjectWithEnumProperty from '../model/OuterObjectWithEnumProperty';
|
||||||
|
import Pet from '../model/Pet';
|
||||||
|
import User from '../model/User';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fake service.
|
||||||
|
* @module api/FakeApi
|
||||||
|
* @version 1.0.0
|
||||||
|
*/
|
||||||
|
export default class FakeApi extends ApiClient {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructs a new FakeApi.
|
||||||
|
* @alias module:api/FakeApi
|
||||||
|
* @class
|
||||||
|
*/
|
||||||
|
constructor(baseURL = 'http://petstore.swagger.io:80/v2') {
|
||||||
|
super(baseURL);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Health check endpoint
|
||||||
|
* @param requestInit Dynamic configuration. @see {@link https://github.com/apollographql/apollo-server/pull/1277}
|
||||||
|
* @return {Promise<module:model/HealthCheckResult>}
|
||||||
|
*/
|
||||||
|
async fakeHealthGet(requestInit) {
|
||||||
|
let postBody = null;
|
||||||
|
|
||||||
|
let pathParams = {
|
||||||
|
};
|
||||||
|
let queryParams = {
|
||||||
|
};
|
||||||
|
let headerParams = {
|
||||||
|
'User-Agent': 'OpenAPI-Generator/1.0.0/Javascript',
|
||||||
|
};
|
||||||
|
let formParams = {
|
||||||
|
};
|
||||||
|
|
||||||
|
let authNames = [];
|
||||||
|
let contentTypes = [];
|
||||||
|
let accepts = ['application/json'];
|
||||||
|
let returnType = HealthCheckResult;
|
||||||
|
|
||||||
|
return this.callApi(
|
||||||
|
'/fake/health', 'GET',
|
||||||
|
pathParams, queryParams, headerParams, formParams, postBody,
|
||||||
|
authNames, contentTypes, accepts, returnType, requestInit
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* test http signature authentication
|
||||||
|
* @param {module:model/Pet} pet Pet object that needs to be added to the store
|
||||||
|
* @param {Object} opts Optional parameters
|
||||||
|
* @param {String} opts.query1 query parameter
|
||||||
|
* @param {String} opts.header1 header parameter
|
||||||
|
* @param requestInit Dynamic configuration. @see {@link https://github.com/apollographql/apollo-server/pull/1277}
|
||||||
|
* @return {Promise}
|
||||||
|
*/
|
||||||
|
async fakeHttpSignatureTest(pet, opts, requestInit) {
|
||||||
|
opts = opts || {};
|
||||||
|
let postBody = pet;
|
||||||
|
// verify the required parameter 'pet' is set
|
||||||
|
if (pet === undefined || pet === null) {
|
||||||
|
throw new Error("Missing the required parameter 'pet' when calling fakeHttpSignatureTest");
|
||||||
|
}
|
||||||
|
|
||||||
|
let pathParams = {
|
||||||
|
};
|
||||||
|
let queryParams = {
|
||||||
|
'query_1': opts['query1']
|
||||||
|
};
|
||||||
|
let headerParams = {
|
||||||
|
'User-Agent': 'OpenAPI-Generator/1.0.0/Javascript',
|
||||||
|
'header_1': opts['header1']
|
||||||
|
};
|
||||||
|
let formParams = {
|
||||||
|
};
|
||||||
|
|
||||||
|
let authNames = ['http_signature_test'];
|
||||||
|
let contentTypes = ['application/json', 'application/xml'];
|
||||||
|
let accepts = [];
|
||||||
|
let returnType = null;
|
||||||
|
|
||||||
|
return this.callApi(
|
||||||
|
'/fake/http-signature-test', 'GET',
|
||||||
|
pathParams, queryParams, headerParams, formParams, postBody,
|
||||||
|
authNames, contentTypes, accepts, returnType, requestInit
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test serialization of outer boolean types
|
||||||
|
* @param {Object} opts Optional parameters
|
||||||
|
* @param {Boolean} opts.body Input boolean as post body
|
||||||
|
* @param requestInit Dynamic configuration. @see {@link https://github.com/apollographql/apollo-server/pull/1277}
|
||||||
|
* @return {Promise<Boolean>}
|
||||||
|
*/
|
||||||
|
async fakeOuterBooleanSerialize(opts, requestInit) {
|
||||||
|
opts = opts || {};
|
||||||
|
let postBody = opts['body'];
|
||||||
|
|
||||||
|
let pathParams = {
|
||||||
|
};
|
||||||
|
let queryParams = {
|
||||||
|
};
|
||||||
|
let headerParams = {
|
||||||
|
'User-Agent': 'OpenAPI-Generator/1.0.0/Javascript',
|
||||||
|
};
|
||||||
|
let formParams = {
|
||||||
|
};
|
||||||
|
|
||||||
|
let authNames = [];
|
||||||
|
let contentTypes = ['application/json'];
|
||||||
|
let accepts = ['*/*'];
|
||||||
|
let returnType = 'Boolean';
|
||||||
|
|
||||||
|
return this.callApi(
|
||||||
|
'/fake/outer/boolean', 'POST',
|
||||||
|
pathParams, queryParams, headerParams, formParams, postBody,
|
||||||
|
authNames, contentTypes, accepts, returnType, requestInit
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test serialization of object with outer number type
|
||||||
|
* @param {Object} opts Optional parameters
|
||||||
|
* @param {module:model/OuterComposite} opts.outerComposite Input composite as post body
|
||||||
|
* @param requestInit Dynamic configuration. @see {@link https://github.com/apollographql/apollo-server/pull/1277}
|
||||||
|
* @return {Promise<module:model/OuterComposite>}
|
||||||
|
*/
|
||||||
|
async fakeOuterCompositeSerialize(opts, requestInit) {
|
||||||
|
opts = opts || {};
|
||||||
|
let postBody = opts['outerComposite'];
|
||||||
|
|
||||||
|
let pathParams = {
|
||||||
|
};
|
||||||
|
let queryParams = {
|
||||||
|
};
|
||||||
|
let headerParams = {
|
||||||
|
'User-Agent': 'OpenAPI-Generator/1.0.0/Javascript',
|
||||||
|
};
|
||||||
|
let formParams = {
|
||||||
|
};
|
||||||
|
|
||||||
|
let authNames = [];
|
||||||
|
let contentTypes = ['application/json'];
|
||||||
|
let accepts = ['*/*'];
|
||||||
|
let returnType = OuterComposite;
|
||||||
|
|
||||||
|
return this.callApi(
|
||||||
|
'/fake/outer/composite', 'POST',
|
||||||
|
pathParams, queryParams, headerParams, formParams, postBody,
|
||||||
|
authNames, contentTypes, accepts, returnType, requestInit
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test serialization of outer number types
|
||||||
|
* @param {Object} opts Optional parameters
|
||||||
|
* @param {Number} opts.body Input number as post body
|
||||||
|
* @param requestInit Dynamic configuration. @see {@link https://github.com/apollographql/apollo-server/pull/1277}
|
||||||
|
* @return {Promise<Number>}
|
||||||
|
*/
|
||||||
|
async fakeOuterNumberSerialize(opts, requestInit) {
|
||||||
|
opts = opts || {};
|
||||||
|
let postBody = opts['body'];
|
||||||
|
|
||||||
|
let pathParams = {
|
||||||
|
};
|
||||||
|
let queryParams = {
|
||||||
|
};
|
||||||
|
let headerParams = {
|
||||||
|
'User-Agent': 'OpenAPI-Generator/1.0.0/Javascript',
|
||||||
|
};
|
||||||
|
let formParams = {
|
||||||
|
};
|
||||||
|
|
||||||
|
let authNames = [];
|
||||||
|
let contentTypes = ['application/json'];
|
||||||
|
let accepts = ['*/*'];
|
||||||
|
let returnType = 'Number';
|
||||||
|
|
||||||
|
return this.callApi(
|
||||||
|
'/fake/outer/number', 'POST',
|
||||||
|
pathParams, queryParams, headerParams, formParams, postBody,
|
||||||
|
authNames, contentTypes, accepts, returnType, requestInit
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test serialization of outer string types
|
||||||
|
* @param {Object} opts Optional parameters
|
||||||
|
* @param {String} opts.body Input string as post body
|
||||||
|
* @param requestInit Dynamic configuration. @see {@link https://github.com/apollographql/apollo-server/pull/1277}
|
||||||
|
* @return {Promise<String>}
|
||||||
|
*/
|
||||||
|
async fakeOuterStringSerialize(opts, requestInit) {
|
||||||
|
opts = opts || {};
|
||||||
|
let postBody = opts['body'];
|
||||||
|
|
||||||
|
let pathParams = {
|
||||||
|
};
|
||||||
|
let queryParams = {
|
||||||
|
};
|
||||||
|
let headerParams = {
|
||||||
|
'User-Agent': 'OpenAPI-Generator/1.0.0/Javascript',
|
||||||
|
};
|
||||||
|
let formParams = {
|
||||||
|
};
|
||||||
|
|
||||||
|
let authNames = [];
|
||||||
|
let contentTypes = ['application/json'];
|
||||||
|
let accepts = ['*/*'];
|
||||||
|
let returnType = 'String';
|
||||||
|
|
||||||
|
return this.callApi(
|
||||||
|
'/fake/outer/string', 'POST',
|
||||||
|
pathParams, queryParams, headerParams, formParams, postBody,
|
||||||
|
authNames, contentTypes, accepts, returnType, requestInit
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test serialization of enum (int) properties with examples
|
||||||
|
* @param {module:model/OuterObjectWithEnumProperty} outerObjectWithEnumProperty Input enum (int) as post body
|
||||||
|
* @param requestInit Dynamic configuration. @see {@link https://github.com/apollographql/apollo-server/pull/1277}
|
||||||
|
* @return {Promise<module:model/OuterObjectWithEnumProperty>}
|
||||||
|
*/
|
||||||
|
async fakePropertyEnumIntegerSerialize(outerObjectWithEnumProperty, requestInit) {
|
||||||
|
let postBody = outerObjectWithEnumProperty;
|
||||||
|
// verify the required parameter 'outerObjectWithEnumProperty' is set
|
||||||
|
if (outerObjectWithEnumProperty === undefined || outerObjectWithEnumProperty === null) {
|
||||||
|
throw new Error("Missing the required parameter 'outerObjectWithEnumProperty' when calling fakePropertyEnumIntegerSerialize");
|
||||||
|
}
|
||||||
|
|
||||||
|
let pathParams = {
|
||||||
|
};
|
||||||
|
let queryParams = {
|
||||||
|
};
|
||||||
|
let headerParams = {
|
||||||
|
'User-Agent': 'OpenAPI-Generator/1.0.0/Javascript',
|
||||||
|
};
|
||||||
|
let formParams = {
|
||||||
|
};
|
||||||
|
|
||||||
|
let authNames = [];
|
||||||
|
let contentTypes = ['application/json'];
|
||||||
|
let accepts = ['*/*'];
|
||||||
|
let returnType = OuterObjectWithEnumProperty;
|
||||||
|
|
||||||
|
return this.callApi(
|
||||||
|
'/fake/property/enum-int', 'POST',
|
||||||
|
pathParams, queryParams, headerParams, formParams, postBody,
|
||||||
|
authNames, contentTypes, accepts, returnType, requestInit
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* For this test, the body has to be a binary file.
|
||||||
|
* @param {File} body image to upload
|
||||||
|
* @param requestInit Dynamic configuration. @see {@link https://github.com/apollographql/apollo-server/pull/1277}
|
||||||
|
* @return {Promise}
|
||||||
|
*/
|
||||||
|
async testBodyWithBinary(body, requestInit) {
|
||||||
|
let postBody = body;
|
||||||
|
// verify the required parameter 'body' is set
|
||||||
|
if (body === undefined || body === null) {
|
||||||
|
throw new Error("Missing the required parameter 'body' when calling testBodyWithBinary");
|
||||||
|
}
|
||||||
|
|
||||||
|
let pathParams = {
|
||||||
|
};
|
||||||
|
let queryParams = {
|
||||||
|
};
|
||||||
|
let headerParams = {
|
||||||
|
'User-Agent': 'OpenAPI-Generator/1.0.0/Javascript',
|
||||||
|
};
|
||||||
|
let formParams = {
|
||||||
|
};
|
||||||
|
|
||||||
|
let authNames = [];
|
||||||
|
let contentTypes = ['image/png'];
|
||||||
|
let accepts = [];
|
||||||
|
let returnType = null;
|
||||||
|
|
||||||
|
return this.callApi(
|
||||||
|
'/fake/body-with-binary', 'PUT',
|
||||||
|
pathParams, queryParams, headerParams, formParams, postBody,
|
||||||
|
authNames, contentTypes, accepts, returnType, requestInit
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* For this test, the body for this request must reference a schema named `File`.
|
||||||
|
* @param {module:model/FileSchemaTestClass} fileSchemaTestClass
|
||||||
|
* @param requestInit Dynamic configuration. @see {@link https://github.com/apollographql/apollo-server/pull/1277}
|
||||||
|
* @return {Promise}
|
||||||
|
*/
|
||||||
|
async testBodyWithFileSchema(fileSchemaTestClass, requestInit) {
|
||||||
|
let postBody = fileSchemaTestClass;
|
||||||
|
// verify the required parameter 'fileSchemaTestClass' is set
|
||||||
|
if (fileSchemaTestClass === undefined || fileSchemaTestClass === null) {
|
||||||
|
throw new Error("Missing the required parameter 'fileSchemaTestClass' when calling testBodyWithFileSchema");
|
||||||
|
}
|
||||||
|
|
||||||
|
let pathParams = {
|
||||||
|
};
|
||||||
|
let queryParams = {
|
||||||
|
};
|
||||||
|
let headerParams = {
|
||||||
|
'User-Agent': 'OpenAPI-Generator/1.0.0/Javascript',
|
||||||
|
};
|
||||||
|
let formParams = {
|
||||||
|
};
|
||||||
|
|
||||||
|
let authNames = [];
|
||||||
|
let contentTypes = ['application/json'];
|
||||||
|
let accepts = [];
|
||||||
|
let returnType = null;
|
||||||
|
|
||||||
|
return this.callApi(
|
||||||
|
'/fake/body-with-file-schema', 'PUT',
|
||||||
|
pathParams, queryParams, headerParams, formParams, postBody,
|
||||||
|
authNames, contentTypes, accepts, returnType, requestInit
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {String} query
|
||||||
|
* @param {module:model/User} user
|
||||||
|
* @param requestInit Dynamic configuration. @see {@link https://github.com/apollographql/apollo-server/pull/1277}
|
||||||
|
* @return {Promise}
|
||||||
|
*/
|
||||||
|
async testBodyWithQueryParams(query, user, requestInit) {
|
||||||
|
let postBody = user;
|
||||||
|
// verify the required parameter 'query' is set
|
||||||
|
if (query === undefined || query === null) {
|
||||||
|
throw new Error("Missing the required parameter 'query' when calling testBodyWithQueryParams");
|
||||||
|
}
|
||||||
|
// verify the required parameter 'user' is set
|
||||||
|
if (user === undefined || user === null) {
|
||||||
|
throw new Error("Missing the required parameter 'user' when calling testBodyWithQueryParams");
|
||||||
|
}
|
||||||
|
|
||||||
|
let pathParams = {
|
||||||
|
};
|
||||||
|
let queryParams = {
|
||||||
|
'query': query
|
||||||
|
};
|
||||||
|
let headerParams = {
|
||||||
|
'User-Agent': 'OpenAPI-Generator/1.0.0/Javascript',
|
||||||
|
};
|
||||||
|
let formParams = {
|
||||||
|
};
|
||||||
|
|
||||||
|
let authNames = [];
|
||||||
|
let contentTypes = ['application/json'];
|
||||||
|
let accepts = [];
|
||||||
|
let returnType = null;
|
||||||
|
|
||||||
|
return this.callApi(
|
||||||
|
'/fake/body-with-query-params', 'PUT',
|
||||||
|
pathParams, queryParams, headerParams, formParams, postBody,
|
||||||
|
authNames, contentTypes, accepts, returnType, requestInit
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* To test \"client\" model
|
||||||
|
* To test \"client\" model
|
||||||
|
* @param {module:model/Client} client client model
|
||||||
|
* @param requestInit Dynamic configuration. @see {@link https://github.com/apollographql/apollo-server/pull/1277}
|
||||||
|
* @return {Promise<module:model/Client>}
|
||||||
|
*/
|
||||||
|
async testClientModel(client, requestInit) {
|
||||||
|
let postBody = client;
|
||||||
|
// verify the required parameter 'client' is set
|
||||||
|
if (client === undefined || client === null) {
|
||||||
|
throw new Error("Missing the required parameter 'client' when calling testClientModel");
|
||||||
|
}
|
||||||
|
|
||||||
|
let pathParams = {
|
||||||
|
};
|
||||||
|
let queryParams = {
|
||||||
|
};
|
||||||
|
let headerParams = {
|
||||||
|
'User-Agent': 'OpenAPI-Generator/1.0.0/Javascript',
|
||||||
|
};
|
||||||
|
let formParams = {
|
||||||
|
};
|
||||||
|
|
||||||
|
let authNames = [];
|
||||||
|
let contentTypes = ['application/json'];
|
||||||
|
let accepts = ['application/json'];
|
||||||
|
let returnType = Client;
|
||||||
|
|
||||||
|
return this.callApi(
|
||||||
|
'/fake', 'PATCH',
|
||||||
|
pathParams, queryParams, headerParams, formParams, postBody,
|
||||||
|
authNames, contentTypes, accepts, returnType, requestInit
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||||
|
* Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||||
|
* @param {Number} number None
|
||||||
|
* @param {Number} _double None
|
||||||
|
* @param {String} patternWithoutDelimiter None
|
||||||
|
* @param {Blob} _byte None
|
||||||
|
* @param {Object} opts Optional parameters
|
||||||
|
* @param {Number} opts.integer None
|
||||||
|
* @param {Number} opts.int32 None
|
||||||
|
* @param {Number} opts.int64 None
|
||||||
|
* @param {Number} opts._float None
|
||||||
|
* @param {String} opts.string None
|
||||||
|
* @param {File} opts.binary None
|
||||||
|
* @param {Date} opts.date None
|
||||||
|
* @param {Date} opts.dateTime None
|
||||||
|
* @param {String} opts.password None
|
||||||
|
* @param {String} opts.callback None
|
||||||
|
* @param requestInit Dynamic configuration. @see {@link https://github.com/apollographql/apollo-server/pull/1277}
|
||||||
|
* @return {Promise}
|
||||||
|
*/
|
||||||
|
async testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, opts, requestInit) {
|
||||||
|
opts = opts || {};
|
||||||
|
let postBody = null;
|
||||||
|
// verify the required parameter 'number' is set
|
||||||
|
if (number === undefined || number === null) {
|
||||||
|
throw new Error("Missing the required parameter 'number' when calling testEndpointParameters");
|
||||||
|
}
|
||||||
|
// verify the required parameter '_double' is set
|
||||||
|
if (_double === undefined || _double === null) {
|
||||||
|
throw new Error("Missing the required parameter '_double' when calling testEndpointParameters");
|
||||||
|
}
|
||||||
|
// verify the required parameter 'patternWithoutDelimiter' is set
|
||||||
|
if (patternWithoutDelimiter === undefined || patternWithoutDelimiter === null) {
|
||||||
|
throw new Error("Missing the required parameter 'patternWithoutDelimiter' when calling testEndpointParameters");
|
||||||
|
}
|
||||||
|
// verify the required parameter '_byte' is set
|
||||||
|
if (_byte === undefined || _byte === null) {
|
||||||
|
throw new Error("Missing the required parameter '_byte' when calling testEndpointParameters");
|
||||||
|
}
|
||||||
|
|
||||||
|
let pathParams = {
|
||||||
|
};
|
||||||
|
let queryParams = {
|
||||||
|
};
|
||||||
|
let headerParams = {
|
||||||
|
'User-Agent': 'OpenAPI-Generator/1.0.0/Javascript',
|
||||||
|
};
|
||||||
|
let formParams = {
|
||||||
|
'integer': opts['integer'],
|
||||||
|
'int32': opts['int32'],
|
||||||
|
'int64': opts['int64'],
|
||||||
|
'number': number,
|
||||||
|
'float': opts['_float'],
|
||||||
|
'double': _double,
|
||||||
|
'string': opts['string'],
|
||||||
|
'pattern_without_delimiter': patternWithoutDelimiter,
|
||||||
|
'byte': _byte,
|
||||||
|
'binary': opts['binary'],
|
||||||
|
'date': opts['date'],
|
||||||
|
'dateTime': opts['dateTime'],
|
||||||
|
'password': opts['password'],
|
||||||
|
'callback': opts['callback']
|
||||||
|
};
|
||||||
|
|
||||||
|
let authNames = ['http_basic_test'];
|
||||||
|
let contentTypes = ['application/x-www-form-urlencoded'];
|
||||||
|
let accepts = [];
|
||||||
|
let returnType = null;
|
||||||
|
|
||||||
|
return this.callApi(
|
||||||
|
'/fake', 'POST',
|
||||||
|
pathParams, queryParams, headerParams, formParams, postBody,
|
||||||
|
authNames, contentTypes, accepts, returnType, requestInit
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* To test enum parameters
|
||||||
|
* To test enum parameters
|
||||||
|
* @param {Object} opts Optional parameters
|
||||||
|
* @param {Array.<module:model/String>} opts.enumHeaderStringArray Header parameter enum test (string array)
|
||||||
|
* @param {module:model/String} opts.enumHeaderString Header parameter enum test (string) (default to '-efg')
|
||||||
|
* @param {Array.<module:model/String>} opts.enumQueryStringArray Query parameter enum test (string array)
|
||||||
|
* @param {module:model/String} opts.enumQueryString Query parameter enum test (string) (default to '-efg')
|
||||||
|
* @param {module:model/Number} opts.enumQueryInteger Query parameter enum test (double)
|
||||||
|
* @param {module:model/Number} opts.enumQueryDouble Query parameter enum test (double)
|
||||||
|
* @param {Array.<module:model/EnumClass>} opts.enumQueryModelArray
|
||||||
|
* @param {Array.<module:model/String>} opts.enumFormStringArray Form parameter enum test (string array) (default to '$')
|
||||||
|
* @param {module:model/String} opts.enumFormString Form parameter enum test (string) (default to '-efg')
|
||||||
|
* @param requestInit Dynamic configuration. @see {@link https://github.com/apollographql/apollo-server/pull/1277}
|
||||||
|
* @return {Promise}
|
||||||
|
*/
|
||||||
|
async testEnumParameters(opts, requestInit) {
|
||||||
|
opts = opts || {};
|
||||||
|
let postBody = null;
|
||||||
|
|
||||||
|
let pathParams = {
|
||||||
|
};
|
||||||
|
let queryParams = {
|
||||||
|
'enum_query_string_array': this.buildCollectionParam(opts['enumQueryStringArray'], 'multi'),
|
||||||
|
'enum_query_string': opts['enumQueryString'],
|
||||||
|
'enum_query_integer': opts['enumQueryInteger'],
|
||||||
|
'enum_query_double': opts['enumQueryDouble'],
|
||||||
|
'enum_query_model_array': this.buildCollectionParam(opts['enumQueryModelArray'], 'multi')
|
||||||
|
};
|
||||||
|
let headerParams = {
|
||||||
|
'User-Agent': 'OpenAPI-Generator/1.0.0/Javascript',
|
||||||
|
'enum_header_string_array': opts['enumHeaderStringArray'],
|
||||||
|
'enum_header_string': opts['enumHeaderString']
|
||||||
|
};
|
||||||
|
let formParams = {
|
||||||
|
'enum_form_string_array': this.buildCollectionParam(opts['enumFormStringArray'], 'csv'),
|
||||||
|
'enum_form_string': opts['enumFormString']
|
||||||
|
};
|
||||||
|
|
||||||
|
let authNames = [];
|
||||||
|
let contentTypes = ['application/x-www-form-urlencoded'];
|
||||||
|
let accepts = [];
|
||||||
|
let returnType = null;
|
||||||
|
|
||||||
|
return this.callApi(
|
||||||
|
'/fake', 'GET',
|
||||||
|
pathParams, queryParams, headerParams, formParams, postBody,
|
||||||
|
authNames, contentTypes, accepts, returnType, requestInit
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fake endpoint to test group parameters (optional)
|
||||||
|
* Fake endpoint to test group parameters (optional)
|
||||||
|
* @param {Number} requiredStringGroup Required String in group parameters
|
||||||
|
* @param {Boolean} requiredBooleanGroup Required Boolean in group parameters
|
||||||
|
* @param {Number} requiredInt64Group Required Integer in group parameters
|
||||||
|
* @param {Object} opts Optional parameters
|
||||||
|
* @param {Number} opts.stringGroup String in group parameters
|
||||||
|
* @param {Boolean} opts.booleanGroup Boolean in group parameters
|
||||||
|
* @param {Number} opts.int64Group Integer in group parameters
|
||||||
|
* @param requestInit Dynamic configuration. @see {@link https://github.com/apollographql/apollo-server/pull/1277}
|
||||||
|
* @return {Promise}
|
||||||
|
*/
|
||||||
|
async testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, opts, requestInit) {
|
||||||
|
opts = opts || {};
|
||||||
|
let postBody = null;
|
||||||
|
// verify the required parameter 'requiredStringGroup' is set
|
||||||
|
if (requiredStringGroup === undefined || requiredStringGroup === null) {
|
||||||
|
throw new Error("Missing the required parameter 'requiredStringGroup' when calling testGroupParameters");
|
||||||
|
}
|
||||||
|
// verify the required parameter 'requiredBooleanGroup' is set
|
||||||
|
if (requiredBooleanGroup === undefined || requiredBooleanGroup === null) {
|
||||||
|
throw new Error("Missing the required parameter 'requiredBooleanGroup' when calling testGroupParameters");
|
||||||
|
}
|
||||||
|
// verify the required parameter 'requiredInt64Group' is set
|
||||||
|
if (requiredInt64Group === undefined || requiredInt64Group === null) {
|
||||||
|
throw new Error("Missing the required parameter 'requiredInt64Group' when calling testGroupParameters");
|
||||||
|
}
|
||||||
|
|
||||||
|
let pathParams = {
|
||||||
|
};
|
||||||
|
let queryParams = {
|
||||||
|
'required_string_group': requiredStringGroup,
|
||||||
|
'required_int64_group': requiredInt64Group,
|
||||||
|
'string_group': opts['stringGroup'],
|
||||||
|
'int64_group': opts['int64Group']
|
||||||
|
};
|
||||||
|
let headerParams = {
|
||||||
|
'User-Agent': 'OpenAPI-Generator/1.0.0/Javascript',
|
||||||
|
'required_boolean_group': requiredBooleanGroup,
|
||||||
|
'boolean_group': opts['booleanGroup']
|
||||||
|
};
|
||||||
|
let formParams = {
|
||||||
|
};
|
||||||
|
|
||||||
|
let authNames = ['bearer_test'];
|
||||||
|
let contentTypes = [];
|
||||||
|
let accepts = [];
|
||||||
|
let returnType = null;
|
||||||
|
|
||||||
|
return this.callApi(
|
||||||
|
'/fake', 'DELETE',
|
||||||
|
pathParams, queryParams, headerParams, formParams, postBody,
|
||||||
|
authNames, contentTypes, accepts, returnType, requestInit
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* test inline additionalProperties
|
||||||
|
*
|
||||||
|
* @param {Object.<String, {String: String}>} requestBody request body
|
||||||
|
* @param requestInit Dynamic configuration. @see {@link https://github.com/apollographql/apollo-server/pull/1277}
|
||||||
|
* @return {Promise}
|
||||||
|
*/
|
||||||
|
async testInlineAdditionalProperties(requestBody, requestInit) {
|
||||||
|
let postBody = requestBody;
|
||||||
|
// verify the required parameter 'requestBody' is set
|
||||||
|
if (requestBody === undefined || requestBody === null) {
|
||||||
|
throw new Error("Missing the required parameter 'requestBody' when calling testInlineAdditionalProperties");
|
||||||
|
}
|
||||||
|
|
||||||
|
let pathParams = {
|
||||||
|
};
|
||||||
|
let queryParams = {
|
||||||
|
};
|
||||||
|
let headerParams = {
|
||||||
|
'User-Agent': 'OpenAPI-Generator/1.0.0/Javascript',
|
||||||
|
};
|
||||||
|
let formParams = {
|
||||||
|
};
|
||||||
|
|
||||||
|
let authNames = [];
|
||||||
|
let contentTypes = ['application/json'];
|
||||||
|
let accepts = [];
|
||||||
|
let returnType = null;
|
||||||
|
|
||||||
|
return this.callApi(
|
||||||
|
'/fake/inline-additionalProperties', 'POST',
|
||||||
|
pathParams, queryParams, headerParams, formParams, postBody,
|
||||||
|
authNames, contentTypes, accepts, returnType, requestInit
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* test json serialization of form data
|
||||||
|
*
|
||||||
|
* @param {String} param field1
|
||||||
|
* @param {String} param2 field2
|
||||||
|
* @param requestInit Dynamic configuration. @see {@link https://github.com/apollographql/apollo-server/pull/1277}
|
||||||
|
* @return {Promise}
|
||||||
|
*/
|
||||||
|
async testJsonFormData(param, param2, requestInit) {
|
||||||
|
let postBody = null;
|
||||||
|
// verify the required parameter 'param' is set
|
||||||
|
if (param === undefined || param === null) {
|
||||||
|
throw new Error("Missing the required parameter 'param' when calling testJsonFormData");
|
||||||
|
}
|
||||||
|
// verify the required parameter 'param2' is set
|
||||||
|
if (param2 === undefined || param2 === null) {
|
||||||
|
throw new Error("Missing the required parameter 'param2' when calling testJsonFormData");
|
||||||
|
}
|
||||||
|
|
||||||
|
let pathParams = {
|
||||||
|
};
|
||||||
|
let queryParams = {
|
||||||
|
};
|
||||||
|
let headerParams = {
|
||||||
|
'User-Agent': 'OpenAPI-Generator/1.0.0/Javascript',
|
||||||
|
};
|
||||||
|
let formParams = {
|
||||||
|
'param': param,
|
||||||
|
'param2': param2
|
||||||
|
};
|
||||||
|
|
||||||
|
let authNames = [];
|
||||||
|
let contentTypes = ['application/x-www-form-urlencoded'];
|
||||||
|
let accepts = [];
|
||||||
|
let returnType = null;
|
||||||
|
|
||||||
|
return this.callApi(
|
||||||
|
'/fake/jsonFormData', 'GET',
|
||||||
|
pathParams, queryParams, headerParams, formParams, postBody,
|
||||||
|
authNames, contentTypes, accepts, returnType, requestInit
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* To test the collection format in query parameters
|
||||||
|
* @param {Array.<String>} pipe
|
||||||
|
* @param {Array.<String>} ioutil
|
||||||
|
* @param {Array.<String>} http
|
||||||
|
* @param {Array.<String>} url
|
||||||
|
* @param {Array.<String>} context
|
||||||
|
* @param {String} allowEmpty
|
||||||
|
* @param {Object} opts Optional parameters
|
||||||
|
* @param {Object.<String, {String: String}>} opts.language
|
||||||
|
* @param requestInit Dynamic configuration. @see {@link https://github.com/apollographql/apollo-server/pull/1277}
|
||||||
|
* @return {Promise}
|
||||||
|
*/
|
||||||
|
async testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, allowEmpty, opts, requestInit) {
|
||||||
|
opts = opts || {};
|
||||||
|
let postBody = null;
|
||||||
|
// verify the required parameter 'pipe' is set
|
||||||
|
if (pipe === undefined || pipe === null) {
|
||||||
|
throw new Error("Missing the required parameter 'pipe' when calling testQueryParameterCollectionFormat");
|
||||||
|
}
|
||||||
|
// verify the required parameter 'ioutil' is set
|
||||||
|
if (ioutil === undefined || ioutil === null) {
|
||||||
|
throw new Error("Missing the required parameter 'ioutil' when calling testQueryParameterCollectionFormat");
|
||||||
|
}
|
||||||
|
// verify the required parameter 'http' is set
|
||||||
|
if (http === undefined || http === null) {
|
||||||
|
throw new Error("Missing the required parameter 'http' when calling testQueryParameterCollectionFormat");
|
||||||
|
}
|
||||||
|
// verify the required parameter 'url' is set
|
||||||
|
if (url === undefined || url === null) {
|
||||||
|
throw new Error("Missing the required parameter 'url' when calling testQueryParameterCollectionFormat");
|
||||||
|
}
|
||||||
|
// verify the required parameter 'context' is set
|
||||||
|
if (context === undefined || context === null) {
|
||||||
|
throw new Error("Missing the required parameter 'context' when calling testQueryParameterCollectionFormat");
|
||||||
|
}
|
||||||
|
// verify the required parameter 'allowEmpty' is set
|
||||||
|
if (allowEmpty === undefined || allowEmpty === null) {
|
||||||
|
throw new Error("Missing the required parameter 'allowEmpty' when calling testQueryParameterCollectionFormat");
|
||||||
|
}
|
||||||
|
|
||||||
|
let pathParams = {
|
||||||
|
};
|
||||||
|
let queryParams = {
|
||||||
|
'pipe': this.buildCollectionParam(pipe, 'pipes'),
|
||||||
|
'ioutil': this.buildCollectionParam(ioutil, 'csv'),
|
||||||
|
'http': this.buildCollectionParam(http, 'ssv'),
|
||||||
|
'url': this.buildCollectionParam(url, 'csv'),
|
||||||
|
'context': this.buildCollectionParam(context, 'multi'),
|
||||||
|
'language': opts['language'],
|
||||||
|
'allowEmpty': allowEmpty
|
||||||
|
};
|
||||||
|
let headerParams = {
|
||||||
|
'User-Agent': 'OpenAPI-Generator/1.0.0/Javascript',
|
||||||
|
};
|
||||||
|
let formParams = {
|
||||||
|
};
|
||||||
|
|
||||||
|
let authNames = [];
|
||||||
|
let contentTypes = [];
|
||||||
|
let accepts = [];
|
||||||
|
let returnType = null;
|
||||||
|
|
||||||
|
return this.callApi(
|
||||||
|
'/fake/test-query-parameters', 'PUT',
|
||||||
|
pathParams, queryParams, headerParams, formParams, postBody,
|
||||||
|
authNames, contentTypes, accepts, returnType, requestInit
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,73 @@
|
|||||||
|
/**
|
||||||
|
* OpenAPI Petstore
|
||||||
|
* 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.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
import ApiClient from "../ApiClient";
|
||||||
|
import Client from '../model/Client';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* FakeClassnameTags123 service.
|
||||||
|
* @module api/FakeClassnameTags123Api
|
||||||
|
* @version 1.0.0
|
||||||
|
*/
|
||||||
|
export default class FakeClassnameTags123Api extends ApiClient {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructs a new FakeClassnameTags123Api.
|
||||||
|
* @alias module:api/FakeClassnameTags123Api
|
||||||
|
* @class
|
||||||
|
*/
|
||||||
|
constructor(baseURL = 'http://petstore.swagger.io:80/v2') {
|
||||||
|
super(baseURL);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* To test class name in snake case
|
||||||
|
* To test class name in snake case
|
||||||
|
* @param {module:model/Client} client client model
|
||||||
|
* @param requestInit Dynamic configuration. @see {@link https://github.com/apollographql/apollo-server/pull/1277}
|
||||||
|
* @return {Promise<module:model/Client>}
|
||||||
|
*/
|
||||||
|
async testClassname(client, requestInit) {
|
||||||
|
let postBody = client;
|
||||||
|
// verify the required parameter 'client' is set
|
||||||
|
if (client === undefined || client === null) {
|
||||||
|
throw new Error("Missing the required parameter 'client' when calling testClassname");
|
||||||
|
}
|
||||||
|
|
||||||
|
let pathParams = {
|
||||||
|
};
|
||||||
|
let queryParams = {
|
||||||
|
};
|
||||||
|
let headerParams = {
|
||||||
|
'User-Agent': 'OpenAPI-Generator/1.0.0/Javascript',
|
||||||
|
};
|
||||||
|
let formParams = {
|
||||||
|
};
|
||||||
|
|
||||||
|
let authNames = ['api_key_query'];
|
||||||
|
let contentTypes = ['application/json'];
|
||||||
|
let accepts = ['application/json'];
|
||||||
|
let returnType = Client;
|
||||||
|
|
||||||
|
return this.callApi(
|
||||||
|
'/fake_classname_test', 'PATCH',
|
||||||
|
pathParams, queryParams, headerParams, formParams, postBody,
|
||||||
|
authNames, contentTypes, accepts, returnType, requestInit
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -1,6 +1,6 @@
|
|||||||
/**
|
/**
|
||||||
* OpenAPI Petstore
|
* 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.
|
* 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
|
* The version of the OpenAPI document: 1.0.0
|
||||||
*
|
*
|
||||||
@ -29,22 +29,24 @@ export default class PetApi extends ApiClient {
|
|||||||
* @alias module:api/PetApi
|
* @alias module:api/PetApi
|
||||||
* @class
|
* @class
|
||||||
*/
|
*/
|
||||||
constructor() {
|
constructor(baseURL = 'http://petstore.swagger.io:80/v2') {
|
||||||
super();
|
super(baseURL);
|
||||||
this.baseURL = null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add a new pet to the store
|
* Add a new pet to the store
|
||||||
* @param {Pet} body Pet object that needs to be added to the store
|
*
|
||||||
|
* @param {module:model/Pet} pet Pet object that needs to be added to the store
|
||||||
|
* @param requestInit Dynamic configuration. @see {@link https://github.com/apollographql/apollo-server/pull/1277}
|
||||||
* @return {Promise}
|
* @return {Promise}
|
||||||
*/
|
*/
|
||||||
async addPet(body) {
|
async addPet(pet, opts, requestInit) {
|
||||||
let postBody = body;
|
opts = opts || {};
|
||||||
// verify the required parameter 'body' is set
|
let postBody = pet;
|
||||||
if (body === undefined || body === null) {
|
// verify the required parameter 'pet' is set
|
||||||
throw new Error("Missing the required parameter 'body' when calling addPet");
|
if (pet === undefined || pet === null) {
|
||||||
|
throw new Error("Missing the required parameter 'pet' when calling addPet");
|
||||||
}
|
}
|
||||||
|
|
||||||
let pathParams = {
|
let pathParams = {
|
||||||
@ -52,6 +54,7 @@ export default class PetApi extends ApiClient {
|
|||||||
let queryParams = {
|
let queryParams = {
|
||||||
};
|
};
|
||||||
let headerParams = {
|
let headerParams = {
|
||||||
|
'User-Agent': 'OpenAPI-Generator/1.0.0/Javascript',
|
||||||
};
|
};
|
||||||
let formParams = {
|
let formParams = {
|
||||||
};
|
};
|
||||||
@ -60,22 +63,33 @@ export default class PetApi extends ApiClient {
|
|||||||
let contentTypes = ['application/json', 'application/xml'];
|
let contentTypes = ['application/json', 'application/xml'];
|
||||||
let accepts = [];
|
let accepts = [];
|
||||||
let returnType = null;
|
let returnType = null;
|
||||||
|
let basePaths = ['http://petstore.swagger.io/v2', 'http://path-server-test.petstore.local/v2'];
|
||||||
|
let basePath = basePaths[0]; // by default use the first one in "servers" defined in OpenAPI
|
||||||
|
if (typeof opts['_base_path_index'] !== 'undefined') {
|
||||||
|
if (opts['_base_path_index'] >= basePaths.length || opts['_base_path_index'] < 0) {
|
||||||
|
throw new Error("Invalid index " + opts['_base_path_index'] + " when selecting the host settings. Must be less than " + basePaths.length);
|
||||||
|
}
|
||||||
|
basePath = basePaths[opts['_base_path_index']];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
return this.callApi(
|
return this.callApi(
|
||||||
'/pet', 'POST',
|
'/pet', 'POST',
|
||||||
pathParams, queryParams, headerParams, formParams, postBody,
|
pathParams, queryParams, headerParams, formParams, postBody,
|
||||||
authNames, contentTypes, accepts, returnType
|
authNames, contentTypes, accepts, returnType, requestInit
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Deletes a pet
|
* Deletes a pet
|
||||||
|
*
|
||||||
* @param {Number} petId Pet id to delete
|
* @param {Number} petId Pet id to delete
|
||||||
* @param {Object} opts Optional parameters
|
* @param {Object} opts Optional parameters
|
||||||
* @param {String} opts.apiKey
|
* @param {String} opts.apiKey
|
||||||
|
* @param requestInit Dynamic configuration. @see {@link https://github.com/apollographql/apollo-server/pull/1277}
|
||||||
* @return {Promise}
|
* @return {Promise}
|
||||||
*/
|
*/
|
||||||
async deletePet(petId, opts) {
|
async deletePet(petId, opts, requestInit) {
|
||||||
opts = opts || {};
|
opts = opts || {};
|
||||||
let postBody = null;
|
let postBody = null;
|
||||||
// verify the required parameter 'petId' is set
|
// verify the required parameter 'petId' is set
|
||||||
@ -89,6 +103,7 @@ export default class PetApi extends ApiClient {
|
|||||||
let queryParams = {
|
let queryParams = {
|
||||||
};
|
};
|
||||||
let headerParams = {
|
let headerParams = {
|
||||||
|
'User-Agent': 'OpenAPI-Generator/1.0.0/Javascript',
|
||||||
'api_key': opts['apiKey']
|
'api_key': opts['apiKey']
|
||||||
};
|
};
|
||||||
let formParams = {
|
let formParams = {
|
||||||
@ -102,17 +117,18 @@ export default class PetApi extends ApiClient {
|
|||||||
return this.callApi(
|
return this.callApi(
|
||||||
'/pet/{petId}', 'DELETE',
|
'/pet/{petId}', 'DELETE',
|
||||||
pathParams, queryParams, headerParams, formParams, postBody,
|
pathParams, queryParams, headerParams, formParams, postBody,
|
||||||
authNames, contentTypes, accepts, returnType
|
authNames, contentTypes, accepts, returnType, requestInit
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Finds Pets by status
|
* Finds Pets by status
|
||||||
* Multiple status values can be provided with comma separated strings
|
* Multiple status values can be provided with comma separated strings
|
||||||
* @param {Array.<String>} status Status values that need to be considered for filter
|
* @param {Array.<module:model/String>} status Status values that need to be considered for filter
|
||||||
* @return {Promise<Array.<Pet>>}
|
* @param requestInit Dynamic configuration. @see {@link https://github.com/apollographql/apollo-server/pull/1277}
|
||||||
|
* @return {Promise<Array.<module:model/Pet>>}
|
||||||
*/
|
*/
|
||||||
async findPetsByStatus(status) {
|
async findPetsByStatus(status, requestInit) {
|
||||||
let postBody = null;
|
let postBody = null;
|
||||||
// verify the required parameter 'status' is set
|
// verify the required parameter 'status' is set
|
||||||
if (status === undefined || status === null) {
|
if (status === undefined || status === null) {
|
||||||
@ -125,6 +141,7 @@ export default class PetApi extends ApiClient {
|
|||||||
'status': this.buildCollectionParam(status, 'csv')
|
'status': this.buildCollectionParam(status, 'csv')
|
||||||
};
|
};
|
||||||
let headerParams = {
|
let headerParams = {
|
||||||
|
'User-Agent': 'OpenAPI-Generator/1.0.0/Javascript',
|
||||||
};
|
};
|
||||||
let formParams = {
|
let formParams = {
|
||||||
};
|
};
|
||||||
@ -137,7 +154,7 @@ export default class PetApi extends ApiClient {
|
|||||||
return this.callApi(
|
return this.callApi(
|
||||||
'/pet/findByStatus', 'GET',
|
'/pet/findByStatus', 'GET',
|
||||||
pathParams, queryParams, headerParams, formParams, postBody,
|
pathParams, queryParams, headerParams, formParams, postBody,
|
||||||
authNames, contentTypes, accepts, returnType
|
authNames, contentTypes, accepts, returnType, requestInit
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -145,9 +162,10 @@ export default class PetApi extends ApiClient {
|
|||||||
* Finds Pets by tags
|
* Finds Pets by tags
|
||||||
* Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
|
* Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
|
||||||
* @param {Array.<String>} tags Tags to filter by
|
* @param {Array.<String>} tags Tags to filter by
|
||||||
* @return {Promise<Array.<Pet>>}
|
* @param requestInit Dynamic configuration. @see {@link https://github.com/apollographql/apollo-server/pull/1277}
|
||||||
|
* @return {Promise<Array.<module:model/Pet>>}
|
||||||
*/
|
*/
|
||||||
async findPetsByTags(tags) {
|
async findPetsByTags(tags, requestInit) {
|
||||||
let postBody = null;
|
let postBody = null;
|
||||||
// verify the required parameter 'tags' is set
|
// verify the required parameter 'tags' is set
|
||||||
if (tags === undefined || tags === null) {
|
if (tags === undefined || tags === null) {
|
||||||
@ -160,6 +178,7 @@ export default class PetApi extends ApiClient {
|
|||||||
'tags': this.buildCollectionParam(tags, 'csv')
|
'tags': this.buildCollectionParam(tags, 'csv')
|
||||||
};
|
};
|
||||||
let headerParams = {
|
let headerParams = {
|
||||||
|
'User-Agent': 'OpenAPI-Generator/1.0.0/Javascript',
|
||||||
};
|
};
|
||||||
let formParams = {
|
let formParams = {
|
||||||
};
|
};
|
||||||
@ -172,7 +191,7 @@ export default class PetApi extends ApiClient {
|
|||||||
return this.callApi(
|
return this.callApi(
|
||||||
'/pet/findByTags', 'GET',
|
'/pet/findByTags', 'GET',
|
||||||
pathParams, queryParams, headerParams, formParams, postBody,
|
pathParams, queryParams, headerParams, formParams, postBody,
|
||||||
authNames, contentTypes, accepts, returnType
|
authNames, contentTypes, accepts, returnType, requestInit
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -180,9 +199,10 @@ export default class PetApi extends ApiClient {
|
|||||||
* Find pet by ID
|
* Find pet by ID
|
||||||
* Returns a single pet
|
* Returns a single pet
|
||||||
* @param {Number} petId ID of pet to return
|
* @param {Number} petId ID of pet to return
|
||||||
* @return {Promise<Pet>}
|
* @param requestInit Dynamic configuration. @see {@link https://github.com/apollographql/apollo-server/pull/1277}
|
||||||
|
* @return {Promise<module:model/Pet>}
|
||||||
*/
|
*/
|
||||||
async getPetById(petId) {
|
async getPetById(petId, requestInit) {
|
||||||
let postBody = null;
|
let postBody = null;
|
||||||
// verify the required parameter 'petId' is set
|
// verify the required parameter 'petId' is set
|
||||||
if (petId === undefined || petId === null) {
|
if (petId === undefined || petId === null) {
|
||||||
@ -195,6 +215,7 @@ export default class PetApi extends ApiClient {
|
|||||||
let queryParams = {
|
let queryParams = {
|
||||||
};
|
};
|
||||||
let headerParams = {
|
let headerParams = {
|
||||||
|
'User-Agent': 'OpenAPI-Generator/1.0.0/Javascript',
|
||||||
};
|
};
|
||||||
let formParams = {
|
let formParams = {
|
||||||
};
|
};
|
||||||
@ -207,20 +228,23 @@ export default class PetApi extends ApiClient {
|
|||||||
return this.callApi(
|
return this.callApi(
|
||||||
'/pet/{petId}', 'GET',
|
'/pet/{petId}', 'GET',
|
||||||
pathParams, queryParams, headerParams, formParams, postBody,
|
pathParams, queryParams, headerParams, formParams, postBody,
|
||||||
authNames, contentTypes, accepts, returnType
|
authNames, contentTypes, accepts, returnType, requestInit
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Update an existing pet
|
* Update an existing pet
|
||||||
* @param {Pet} body Pet object that needs to be added to the store
|
*
|
||||||
|
* @param {module:model/Pet} pet Pet object that needs to be added to the store
|
||||||
|
* @param requestInit Dynamic configuration. @see {@link https://github.com/apollographql/apollo-server/pull/1277}
|
||||||
* @return {Promise}
|
* @return {Promise}
|
||||||
*/
|
*/
|
||||||
async updatePet(body) {
|
async updatePet(pet, opts, requestInit) {
|
||||||
let postBody = body;
|
opts = opts || {};
|
||||||
// verify the required parameter 'body' is set
|
let postBody = pet;
|
||||||
if (body === undefined || body === null) {
|
// verify the required parameter 'pet' is set
|
||||||
throw new Error("Missing the required parameter 'body' when calling updatePet");
|
if (pet === undefined || pet === null) {
|
||||||
|
throw new Error("Missing the required parameter 'pet' when calling updatePet");
|
||||||
}
|
}
|
||||||
|
|
||||||
let pathParams = {
|
let pathParams = {
|
||||||
@ -228,6 +252,7 @@ export default class PetApi extends ApiClient {
|
|||||||
let queryParams = {
|
let queryParams = {
|
||||||
};
|
};
|
||||||
let headerParams = {
|
let headerParams = {
|
||||||
|
'User-Agent': 'OpenAPI-Generator/1.0.0/Javascript',
|
||||||
};
|
};
|
||||||
let formParams = {
|
let formParams = {
|
||||||
};
|
};
|
||||||
@ -236,23 +261,34 @@ export default class PetApi extends ApiClient {
|
|||||||
let contentTypes = ['application/json', 'application/xml'];
|
let contentTypes = ['application/json', 'application/xml'];
|
||||||
let accepts = [];
|
let accepts = [];
|
||||||
let returnType = null;
|
let returnType = null;
|
||||||
|
let basePaths = ['http://petstore.swagger.io/v2', 'http://path-server-test.petstore.local/v2'];
|
||||||
|
let basePath = basePaths[0]; // by default use the first one in "servers" defined in OpenAPI
|
||||||
|
if (typeof opts['_base_path_index'] !== 'undefined') {
|
||||||
|
if (opts['_base_path_index'] >= basePaths.length || opts['_base_path_index'] < 0) {
|
||||||
|
throw new Error("Invalid index " + opts['_base_path_index'] + " when selecting the host settings. Must be less than " + basePaths.length);
|
||||||
|
}
|
||||||
|
basePath = basePaths[opts['_base_path_index']];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
return this.callApi(
|
return this.callApi(
|
||||||
'/pet', 'PUT',
|
'/pet', 'PUT',
|
||||||
pathParams, queryParams, headerParams, formParams, postBody,
|
pathParams, queryParams, headerParams, formParams, postBody,
|
||||||
authNames, contentTypes, accepts, returnType
|
authNames, contentTypes, accepts, returnType, requestInit
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Updates a pet in the store with form data
|
* Updates a pet in the store with form data
|
||||||
|
*
|
||||||
* @param {Number} petId ID of pet that needs to be updated
|
* @param {Number} petId ID of pet that needs to be updated
|
||||||
* @param {Object} opts Optional parameters
|
* @param {Object} opts Optional parameters
|
||||||
* @param {String} opts.name Updated name of the pet
|
* @param {String} opts.name Updated name of the pet
|
||||||
* @param {String} opts.status Updated status of the pet
|
* @param {String} opts.status Updated status of the pet
|
||||||
|
* @param requestInit Dynamic configuration. @see {@link https://github.com/apollographql/apollo-server/pull/1277}
|
||||||
* @return {Promise}
|
* @return {Promise}
|
||||||
*/
|
*/
|
||||||
async updatePetWithForm(petId, opts) {
|
async updatePetWithForm(petId, opts, requestInit) {
|
||||||
opts = opts || {};
|
opts = opts || {};
|
||||||
let postBody = null;
|
let postBody = null;
|
||||||
// verify the required parameter 'petId' is set
|
// verify the required parameter 'petId' is set
|
||||||
@ -266,6 +302,7 @@ export default class PetApi extends ApiClient {
|
|||||||
let queryParams = {
|
let queryParams = {
|
||||||
};
|
};
|
||||||
let headerParams = {
|
let headerParams = {
|
||||||
|
'User-Agent': 'OpenAPI-Generator/1.0.0/Javascript',
|
||||||
};
|
};
|
||||||
let formParams = {
|
let formParams = {
|
||||||
'name': opts['name'],
|
'name': opts['name'],
|
||||||
@ -280,19 +317,21 @@ export default class PetApi extends ApiClient {
|
|||||||
return this.callApi(
|
return this.callApi(
|
||||||
'/pet/{petId}', 'POST',
|
'/pet/{petId}', 'POST',
|
||||||
pathParams, queryParams, headerParams, formParams, postBody,
|
pathParams, queryParams, headerParams, formParams, postBody,
|
||||||
authNames, contentTypes, accepts, returnType
|
authNames, contentTypes, accepts, returnType, requestInit
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* uploads an image
|
* uploads an image
|
||||||
|
*
|
||||||
* @param {Number} petId ID of pet to update
|
* @param {Number} petId ID of pet to update
|
||||||
* @param {Object} opts Optional parameters
|
* @param {Object} opts Optional parameters
|
||||||
* @param {String} opts.additionalMetadata Additional data to pass to server
|
* @param {String} opts.additionalMetadata Additional data to pass to server
|
||||||
* @param {File} opts.file file to upload
|
* @param {File} opts.file file to upload
|
||||||
* @return {Promise<ApiResponse>}
|
* @param requestInit Dynamic configuration. @see {@link https://github.com/apollographql/apollo-server/pull/1277}
|
||||||
|
* @return {Promise<module:model/ApiResponse>}
|
||||||
*/
|
*/
|
||||||
async uploadFile(petId, opts) {
|
async uploadFile(petId, opts, requestInit) {
|
||||||
opts = opts || {};
|
opts = opts || {};
|
||||||
let postBody = null;
|
let postBody = null;
|
||||||
// verify the required parameter 'petId' is set
|
// verify the required parameter 'petId' is set
|
||||||
@ -306,6 +345,7 @@ export default class PetApi extends ApiClient {
|
|||||||
let queryParams = {
|
let queryParams = {
|
||||||
};
|
};
|
||||||
let headerParams = {
|
let headerParams = {
|
||||||
|
'User-Agent': 'OpenAPI-Generator/1.0.0/Javascript',
|
||||||
};
|
};
|
||||||
let formParams = {
|
let formParams = {
|
||||||
'additionalMetadata': opts['additionalMetadata'],
|
'additionalMetadata': opts['additionalMetadata'],
|
||||||
@ -320,7 +360,54 @@ export default class PetApi extends ApiClient {
|
|||||||
return this.callApi(
|
return this.callApi(
|
||||||
'/pet/{petId}/uploadImage', 'POST',
|
'/pet/{petId}/uploadImage', 'POST',
|
||||||
pathParams, queryParams, headerParams, formParams, postBody,
|
pathParams, queryParams, headerParams, formParams, postBody,
|
||||||
authNames, contentTypes, accepts, returnType
|
authNames, contentTypes, accepts, returnType, requestInit
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* uploads an image (required)
|
||||||
|
*
|
||||||
|
* @param {Number} petId ID of pet to update
|
||||||
|
* @param {File} requiredFile file to upload
|
||||||
|
* @param {Object} opts Optional parameters
|
||||||
|
* @param {String} opts.additionalMetadata Additional data to pass to server
|
||||||
|
* @param requestInit Dynamic configuration. @see {@link https://github.com/apollographql/apollo-server/pull/1277}
|
||||||
|
* @return {Promise<module:model/ApiResponse>}
|
||||||
|
*/
|
||||||
|
async uploadFileWithRequiredFile(petId, requiredFile, opts, requestInit) {
|
||||||
|
opts = opts || {};
|
||||||
|
let postBody = null;
|
||||||
|
// verify the required parameter 'petId' is set
|
||||||
|
if (petId === undefined || petId === null) {
|
||||||
|
throw new Error("Missing the required parameter 'petId' when calling uploadFileWithRequiredFile");
|
||||||
|
}
|
||||||
|
// verify the required parameter 'requiredFile' is set
|
||||||
|
if (requiredFile === undefined || requiredFile === null) {
|
||||||
|
throw new Error("Missing the required parameter 'requiredFile' when calling uploadFileWithRequiredFile");
|
||||||
|
}
|
||||||
|
|
||||||
|
let pathParams = {
|
||||||
|
'petId': petId
|
||||||
|
};
|
||||||
|
let queryParams = {
|
||||||
|
};
|
||||||
|
let headerParams = {
|
||||||
|
'User-Agent': 'OpenAPI-Generator/1.0.0/Javascript',
|
||||||
|
};
|
||||||
|
let formParams = {
|
||||||
|
'additionalMetadata': opts['additionalMetadata'],
|
||||||
|
'requiredFile': requiredFile
|
||||||
|
};
|
||||||
|
|
||||||
|
let authNames = ['petstore_auth'];
|
||||||
|
let contentTypes = ['multipart/form-data'];
|
||||||
|
let accepts = ['application/json'];
|
||||||
|
let returnType = ApiResponse;
|
||||||
|
|
||||||
|
return this.callApi(
|
||||||
|
'/fake/{petId}/uploadImageWithRequiredFile', 'POST',
|
||||||
|
pathParams, queryParams, headerParams, formParams, postBody,
|
||||||
|
authNames, contentTypes, accepts, returnType, requestInit
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/**
|
/**
|
||||||
* OpenAPI Petstore
|
* 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.
|
* 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
|
* The version of the OpenAPI document: 1.0.0
|
||||||
*
|
*
|
||||||
@ -28,9 +28,8 @@ export default class StoreApi extends ApiClient {
|
|||||||
* @alias module:api/StoreApi
|
* @alias module:api/StoreApi
|
||||||
* @class
|
* @class
|
||||||
*/
|
*/
|
||||||
constructor() {
|
constructor(baseURL = 'http://petstore.swagger.io:80/v2') {
|
||||||
super();
|
super(baseURL);
|
||||||
this.baseURL = null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -38,9 +37,10 @@ export default class StoreApi extends ApiClient {
|
|||||||
* Delete purchase order by ID
|
* Delete purchase order by ID
|
||||||
* For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
|
* For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
|
||||||
* @param {String} orderId ID of the order that needs to be deleted
|
* @param {String} orderId ID of the order that needs to be deleted
|
||||||
|
* @param requestInit Dynamic configuration. @see {@link https://github.com/apollographql/apollo-server/pull/1277}
|
||||||
* @return {Promise}
|
* @return {Promise}
|
||||||
*/
|
*/
|
||||||
async deleteOrder(orderId) {
|
async deleteOrder(orderId, requestInit) {
|
||||||
let postBody = null;
|
let postBody = null;
|
||||||
// verify the required parameter 'orderId' is set
|
// verify the required parameter 'orderId' is set
|
||||||
if (orderId === undefined || orderId === null) {
|
if (orderId === undefined || orderId === null) {
|
||||||
@ -48,11 +48,12 @@ export default class StoreApi extends ApiClient {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let pathParams = {
|
let pathParams = {
|
||||||
'orderId': orderId
|
'order_id': orderId
|
||||||
};
|
};
|
||||||
let queryParams = {
|
let queryParams = {
|
||||||
};
|
};
|
||||||
let headerParams = {
|
let headerParams = {
|
||||||
|
'User-Agent': 'OpenAPI-Generator/1.0.0/Javascript',
|
||||||
};
|
};
|
||||||
let formParams = {
|
let formParams = {
|
||||||
};
|
};
|
||||||
@ -63,18 +64,19 @@ export default class StoreApi extends ApiClient {
|
|||||||
let returnType = null;
|
let returnType = null;
|
||||||
|
|
||||||
return this.callApi(
|
return this.callApi(
|
||||||
'/store/order/{orderId}', 'DELETE',
|
'/store/order/{order_id}', 'DELETE',
|
||||||
pathParams, queryParams, headerParams, formParams, postBody,
|
pathParams, queryParams, headerParams, formParams, postBody,
|
||||||
authNames, contentTypes, accepts, returnType
|
authNames, contentTypes, accepts, returnType, requestInit
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns pet inventories by status
|
* Returns pet inventories by status
|
||||||
* Returns a map of status codes to quantities
|
* Returns a map of status codes to quantities
|
||||||
|
* @param requestInit Dynamic configuration. @see {@link https://github.com/apollographql/apollo-server/pull/1277}
|
||||||
* @return {Promise<Object.<String, {String: Number}>>}
|
* @return {Promise<Object.<String, {String: Number}>>}
|
||||||
*/
|
*/
|
||||||
async getInventory() {
|
async getInventory(requestInit) {
|
||||||
let postBody = null;
|
let postBody = null;
|
||||||
|
|
||||||
let pathParams = {
|
let pathParams = {
|
||||||
@ -82,6 +84,7 @@ export default class StoreApi extends ApiClient {
|
|||||||
let queryParams = {
|
let queryParams = {
|
||||||
};
|
};
|
||||||
let headerParams = {
|
let headerParams = {
|
||||||
|
'User-Agent': 'OpenAPI-Generator/1.0.0/Javascript',
|
||||||
};
|
};
|
||||||
let formParams = {
|
let formParams = {
|
||||||
};
|
};
|
||||||
@ -94,7 +97,7 @@ export default class StoreApi extends ApiClient {
|
|||||||
return this.callApi(
|
return this.callApi(
|
||||||
'/store/inventory', 'GET',
|
'/store/inventory', 'GET',
|
||||||
pathParams, queryParams, headerParams, formParams, postBody,
|
pathParams, queryParams, headerParams, formParams, postBody,
|
||||||
authNames, contentTypes, accepts, returnType
|
authNames, contentTypes, accepts, returnType, requestInit
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -102,9 +105,10 @@ export default class StoreApi extends ApiClient {
|
|||||||
* Find purchase order by ID
|
* Find purchase order by ID
|
||||||
* For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
|
* For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
|
||||||
* @param {Number} orderId ID of pet that needs to be fetched
|
* @param {Number} orderId ID of pet that needs to be fetched
|
||||||
* @return {Promise<Order>}
|
* @param requestInit Dynamic configuration. @see {@link https://github.com/apollographql/apollo-server/pull/1277}
|
||||||
|
* @return {Promise<module:model/Order>}
|
||||||
*/
|
*/
|
||||||
async getOrderById(orderId) {
|
async getOrderById(orderId, requestInit) {
|
||||||
let postBody = null;
|
let postBody = null;
|
||||||
// verify the required parameter 'orderId' is set
|
// verify the required parameter 'orderId' is set
|
||||||
if (orderId === undefined || orderId === null) {
|
if (orderId === undefined || orderId === null) {
|
||||||
@ -112,11 +116,12 @@ export default class StoreApi extends ApiClient {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let pathParams = {
|
let pathParams = {
|
||||||
'orderId': orderId
|
'order_id': orderId
|
||||||
};
|
};
|
||||||
let queryParams = {
|
let queryParams = {
|
||||||
};
|
};
|
||||||
let headerParams = {
|
let headerParams = {
|
||||||
|
'User-Agent': 'OpenAPI-Generator/1.0.0/Javascript',
|
||||||
};
|
};
|
||||||
let formParams = {
|
let formParams = {
|
||||||
};
|
};
|
||||||
@ -127,22 +132,24 @@ export default class StoreApi extends ApiClient {
|
|||||||
let returnType = Order;
|
let returnType = Order;
|
||||||
|
|
||||||
return this.callApi(
|
return this.callApi(
|
||||||
'/store/order/{orderId}', 'GET',
|
'/store/order/{order_id}', 'GET',
|
||||||
pathParams, queryParams, headerParams, formParams, postBody,
|
pathParams, queryParams, headerParams, formParams, postBody,
|
||||||
authNames, contentTypes, accepts, returnType
|
authNames, contentTypes, accepts, returnType, requestInit
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Place an order for a pet
|
* Place an order for a pet
|
||||||
* @param {Order} body order placed for purchasing the pet
|
*
|
||||||
* @return {Promise<Order>}
|
* @param {module:model/Order} order order placed for purchasing the pet
|
||||||
|
* @param requestInit Dynamic configuration. @see {@link https://github.com/apollographql/apollo-server/pull/1277}
|
||||||
|
* @return {Promise<module:model/Order>}
|
||||||
*/
|
*/
|
||||||
async placeOrder(body) {
|
async placeOrder(order, requestInit) {
|
||||||
let postBody = body;
|
let postBody = order;
|
||||||
// verify the required parameter 'body' is set
|
// verify the required parameter 'order' is set
|
||||||
if (body === undefined || body === null) {
|
if (order === undefined || order === null) {
|
||||||
throw new Error("Missing the required parameter 'body' when calling placeOrder");
|
throw new Error("Missing the required parameter 'order' when calling placeOrder");
|
||||||
}
|
}
|
||||||
|
|
||||||
let pathParams = {
|
let pathParams = {
|
||||||
@ -150,19 +157,20 @@ export default class StoreApi extends ApiClient {
|
|||||||
let queryParams = {
|
let queryParams = {
|
||||||
};
|
};
|
||||||
let headerParams = {
|
let headerParams = {
|
||||||
|
'User-Agent': 'OpenAPI-Generator/1.0.0/Javascript',
|
||||||
};
|
};
|
||||||
let formParams = {
|
let formParams = {
|
||||||
};
|
};
|
||||||
|
|
||||||
let authNames = [];
|
let authNames = [];
|
||||||
let contentTypes = [];
|
let contentTypes = ['application/json'];
|
||||||
let accepts = ['application/xml', 'application/json'];
|
let accepts = ['application/xml', 'application/json'];
|
||||||
let returnType = Order;
|
let returnType = Order;
|
||||||
|
|
||||||
return this.callApi(
|
return this.callApi(
|
||||||
'/store/order', 'POST',
|
'/store/order', 'POST',
|
||||||
pathParams, queryParams, headerParams, formParams, postBody,
|
pathParams, queryParams, headerParams, formParams, postBody,
|
||||||
authNames, contentTypes, accepts, returnType
|
authNames, contentTypes, accepts, returnType, requestInit
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/**
|
/**
|
||||||
* OpenAPI Petstore
|
* 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.
|
* 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
|
* The version of the OpenAPI document: 1.0.0
|
||||||
*
|
*
|
||||||
@ -28,23 +28,23 @@ export default class UserApi extends ApiClient {
|
|||||||
* @alias module:api/UserApi
|
* @alias module:api/UserApi
|
||||||
* @class
|
* @class
|
||||||
*/
|
*/
|
||||||
constructor() {
|
constructor(baseURL = 'http://petstore.swagger.io:80/v2') {
|
||||||
super();
|
super(baseURL);
|
||||||
this.baseURL = null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create user
|
* Create user
|
||||||
* This can only be done by the logged in user.
|
* This can only be done by the logged in user.
|
||||||
* @param {User} body Created user object
|
* @param {module:model/User} user Created user object
|
||||||
|
* @param requestInit Dynamic configuration. @see {@link https://github.com/apollographql/apollo-server/pull/1277}
|
||||||
* @return {Promise}
|
* @return {Promise}
|
||||||
*/
|
*/
|
||||||
async createUser(body) {
|
async createUser(user, requestInit) {
|
||||||
let postBody = body;
|
let postBody = user;
|
||||||
// verify the required parameter 'body' is set
|
// verify the required parameter 'user' is set
|
||||||
if (body === undefined || body === null) {
|
if (user === undefined || user === null) {
|
||||||
throw new Error("Missing the required parameter 'body' when calling createUser");
|
throw new Error("Missing the required parameter 'user' when calling createUser");
|
||||||
}
|
}
|
||||||
|
|
||||||
let pathParams = {
|
let pathParams = {
|
||||||
@ -52,32 +52,35 @@ export default class UserApi extends ApiClient {
|
|||||||
let queryParams = {
|
let queryParams = {
|
||||||
};
|
};
|
||||||
let headerParams = {
|
let headerParams = {
|
||||||
|
'User-Agent': 'OpenAPI-Generator/1.0.0/Javascript',
|
||||||
};
|
};
|
||||||
let formParams = {
|
let formParams = {
|
||||||
};
|
};
|
||||||
|
|
||||||
let authNames = [];
|
let authNames = [];
|
||||||
let contentTypes = [];
|
let contentTypes = ['application/json'];
|
||||||
let accepts = [];
|
let accepts = [];
|
||||||
let returnType = null;
|
let returnType = null;
|
||||||
|
|
||||||
return this.callApi(
|
return this.callApi(
|
||||||
'/user', 'POST',
|
'/user', 'POST',
|
||||||
pathParams, queryParams, headerParams, formParams, postBody,
|
pathParams, queryParams, headerParams, formParams, postBody,
|
||||||
authNames, contentTypes, accepts, returnType
|
authNames, contentTypes, accepts, returnType, requestInit
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates list of users with given input array
|
* Creates list of users with given input array
|
||||||
* @param {Array.<User>} body List of user object
|
*
|
||||||
|
* @param {Array.<module:model/User>} user List of user object
|
||||||
|
* @param requestInit Dynamic configuration. @see {@link https://github.com/apollographql/apollo-server/pull/1277}
|
||||||
* @return {Promise}
|
* @return {Promise}
|
||||||
*/
|
*/
|
||||||
async createUsersWithArrayInput(body) {
|
async createUsersWithArrayInput(user, requestInit) {
|
||||||
let postBody = body;
|
let postBody = user;
|
||||||
// verify the required parameter 'body' is set
|
// verify the required parameter 'user' is set
|
||||||
if (body === undefined || body === null) {
|
if (user === undefined || user === null) {
|
||||||
throw new Error("Missing the required parameter 'body' when calling createUsersWithArrayInput");
|
throw new Error("Missing the required parameter 'user' when calling createUsersWithArrayInput");
|
||||||
}
|
}
|
||||||
|
|
||||||
let pathParams = {
|
let pathParams = {
|
||||||
@ -85,32 +88,35 @@ export default class UserApi extends ApiClient {
|
|||||||
let queryParams = {
|
let queryParams = {
|
||||||
};
|
};
|
||||||
let headerParams = {
|
let headerParams = {
|
||||||
|
'User-Agent': 'OpenAPI-Generator/1.0.0/Javascript',
|
||||||
};
|
};
|
||||||
let formParams = {
|
let formParams = {
|
||||||
};
|
};
|
||||||
|
|
||||||
let authNames = [];
|
let authNames = [];
|
||||||
let contentTypes = [];
|
let contentTypes = ['application/json'];
|
||||||
let accepts = [];
|
let accepts = [];
|
||||||
let returnType = null;
|
let returnType = null;
|
||||||
|
|
||||||
return this.callApi(
|
return this.callApi(
|
||||||
'/user/createWithArray', 'POST',
|
'/user/createWithArray', 'POST',
|
||||||
pathParams, queryParams, headerParams, formParams, postBody,
|
pathParams, queryParams, headerParams, formParams, postBody,
|
||||||
authNames, contentTypes, accepts, returnType
|
authNames, contentTypes, accepts, returnType, requestInit
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates list of users with given input array
|
* Creates list of users with given input array
|
||||||
* @param {Array.<User>} body List of user object
|
*
|
||||||
|
* @param {Array.<module:model/User>} user List of user object
|
||||||
|
* @param requestInit Dynamic configuration. @see {@link https://github.com/apollographql/apollo-server/pull/1277}
|
||||||
* @return {Promise}
|
* @return {Promise}
|
||||||
*/
|
*/
|
||||||
async createUsersWithListInput(body) {
|
async createUsersWithListInput(user, requestInit) {
|
||||||
let postBody = body;
|
let postBody = user;
|
||||||
// verify the required parameter 'body' is set
|
// verify the required parameter 'user' is set
|
||||||
if (body === undefined || body === null) {
|
if (user === undefined || user === null) {
|
||||||
throw new Error("Missing the required parameter 'body' when calling createUsersWithListInput");
|
throw new Error("Missing the required parameter 'user' when calling createUsersWithListInput");
|
||||||
}
|
}
|
||||||
|
|
||||||
let pathParams = {
|
let pathParams = {
|
||||||
@ -118,19 +124,20 @@ export default class UserApi extends ApiClient {
|
|||||||
let queryParams = {
|
let queryParams = {
|
||||||
};
|
};
|
||||||
let headerParams = {
|
let headerParams = {
|
||||||
|
'User-Agent': 'OpenAPI-Generator/1.0.0/Javascript',
|
||||||
};
|
};
|
||||||
let formParams = {
|
let formParams = {
|
||||||
};
|
};
|
||||||
|
|
||||||
let authNames = [];
|
let authNames = [];
|
||||||
let contentTypes = [];
|
let contentTypes = ['application/json'];
|
||||||
let accepts = [];
|
let accepts = [];
|
||||||
let returnType = null;
|
let returnType = null;
|
||||||
|
|
||||||
return this.callApi(
|
return this.callApi(
|
||||||
'/user/createWithList', 'POST',
|
'/user/createWithList', 'POST',
|
||||||
pathParams, queryParams, headerParams, formParams, postBody,
|
pathParams, queryParams, headerParams, formParams, postBody,
|
||||||
authNames, contentTypes, accepts, returnType
|
authNames, contentTypes, accepts, returnType, requestInit
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -138,9 +145,10 @@ export default class UserApi extends ApiClient {
|
|||||||
* Delete user
|
* Delete user
|
||||||
* This can only be done by the logged in user.
|
* This can only be done by the logged in user.
|
||||||
* @param {String} username The name that needs to be deleted
|
* @param {String} username The name that needs to be deleted
|
||||||
|
* @param requestInit Dynamic configuration. @see {@link https://github.com/apollographql/apollo-server/pull/1277}
|
||||||
* @return {Promise}
|
* @return {Promise}
|
||||||
*/
|
*/
|
||||||
async deleteUser(username) {
|
async deleteUser(username, requestInit) {
|
||||||
let postBody = null;
|
let postBody = null;
|
||||||
// verify the required parameter 'username' is set
|
// verify the required parameter 'username' is set
|
||||||
if (username === undefined || username === null) {
|
if (username === undefined || username === null) {
|
||||||
@ -153,6 +161,7 @@ export default class UserApi extends ApiClient {
|
|||||||
let queryParams = {
|
let queryParams = {
|
||||||
};
|
};
|
||||||
let headerParams = {
|
let headerParams = {
|
||||||
|
'User-Agent': 'OpenAPI-Generator/1.0.0/Javascript',
|
||||||
};
|
};
|
||||||
let formParams = {
|
let formParams = {
|
||||||
};
|
};
|
||||||
@ -165,16 +174,18 @@ export default class UserApi extends ApiClient {
|
|||||||
return this.callApi(
|
return this.callApi(
|
||||||
'/user/{username}', 'DELETE',
|
'/user/{username}', 'DELETE',
|
||||||
pathParams, queryParams, headerParams, formParams, postBody,
|
pathParams, queryParams, headerParams, formParams, postBody,
|
||||||
authNames, contentTypes, accepts, returnType
|
authNames, contentTypes, accepts, returnType, requestInit
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get user by user name
|
* Get user by user name
|
||||||
|
*
|
||||||
* @param {String} username The name that needs to be fetched. Use user1 for testing.
|
* @param {String} username The name that needs to be fetched. Use user1 for testing.
|
||||||
* @return {Promise<User>}
|
* @param requestInit Dynamic configuration. @see {@link https://github.com/apollographql/apollo-server/pull/1277}
|
||||||
|
* @return {Promise<module:model/User>}
|
||||||
*/
|
*/
|
||||||
async getUserByName(username) {
|
async getUserByName(username, requestInit) {
|
||||||
let postBody = null;
|
let postBody = null;
|
||||||
// verify the required parameter 'username' is set
|
// verify the required parameter 'username' is set
|
||||||
if (username === undefined || username === null) {
|
if (username === undefined || username === null) {
|
||||||
@ -187,6 +198,7 @@ export default class UserApi extends ApiClient {
|
|||||||
let queryParams = {
|
let queryParams = {
|
||||||
};
|
};
|
||||||
let headerParams = {
|
let headerParams = {
|
||||||
|
'User-Agent': 'OpenAPI-Generator/1.0.0/Javascript',
|
||||||
};
|
};
|
||||||
let formParams = {
|
let formParams = {
|
||||||
};
|
};
|
||||||
@ -199,17 +211,19 @@ export default class UserApi extends ApiClient {
|
|||||||
return this.callApi(
|
return this.callApi(
|
||||||
'/user/{username}', 'GET',
|
'/user/{username}', 'GET',
|
||||||
pathParams, queryParams, headerParams, formParams, postBody,
|
pathParams, queryParams, headerParams, formParams, postBody,
|
||||||
authNames, contentTypes, accepts, returnType
|
authNames, contentTypes, accepts, returnType, requestInit
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Logs user into the system
|
* Logs user into the system
|
||||||
|
*
|
||||||
* @param {String} username The user name for login
|
* @param {String} username The user name for login
|
||||||
* @param {String} password The password for login in clear text
|
* @param {String} password The password for login in clear text
|
||||||
|
* @param requestInit Dynamic configuration. @see {@link https://github.com/apollographql/apollo-server/pull/1277}
|
||||||
* @return {Promise<String>}
|
* @return {Promise<String>}
|
||||||
*/
|
*/
|
||||||
async loginUser(username, password) {
|
async loginUser(username, password, requestInit) {
|
||||||
let postBody = null;
|
let postBody = null;
|
||||||
// verify the required parameter 'username' is set
|
// verify the required parameter 'username' is set
|
||||||
if (username === undefined || username === null) {
|
if (username === undefined || username === null) {
|
||||||
@ -227,6 +241,7 @@ export default class UserApi extends ApiClient {
|
|||||||
'password': password
|
'password': password
|
||||||
};
|
};
|
||||||
let headerParams = {
|
let headerParams = {
|
||||||
|
'User-Agent': 'OpenAPI-Generator/1.0.0/Javascript',
|
||||||
};
|
};
|
||||||
let formParams = {
|
let formParams = {
|
||||||
};
|
};
|
||||||
@ -239,15 +254,17 @@ export default class UserApi extends ApiClient {
|
|||||||
return this.callApi(
|
return this.callApi(
|
||||||
'/user/login', 'GET',
|
'/user/login', 'GET',
|
||||||
pathParams, queryParams, headerParams, formParams, postBody,
|
pathParams, queryParams, headerParams, formParams, postBody,
|
||||||
authNames, contentTypes, accepts, returnType
|
authNames, contentTypes, accepts, returnType, requestInit
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Logs out current logged in user session
|
* Logs out current logged in user session
|
||||||
|
*
|
||||||
|
* @param requestInit Dynamic configuration. @see {@link https://github.com/apollographql/apollo-server/pull/1277}
|
||||||
* @return {Promise}
|
* @return {Promise}
|
||||||
*/
|
*/
|
||||||
async logoutUser() {
|
async logoutUser(requestInit) {
|
||||||
let postBody = null;
|
let postBody = null;
|
||||||
|
|
||||||
let pathParams = {
|
let pathParams = {
|
||||||
@ -255,6 +272,7 @@ export default class UserApi extends ApiClient {
|
|||||||
let queryParams = {
|
let queryParams = {
|
||||||
};
|
};
|
||||||
let headerParams = {
|
let headerParams = {
|
||||||
|
'User-Agent': 'OpenAPI-Generator/1.0.0/Javascript',
|
||||||
};
|
};
|
||||||
let formParams = {
|
let formParams = {
|
||||||
};
|
};
|
||||||
@ -267,7 +285,7 @@ export default class UserApi extends ApiClient {
|
|||||||
return this.callApi(
|
return this.callApi(
|
||||||
'/user/logout', 'GET',
|
'/user/logout', 'GET',
|
||||||
pathParams, queryParams, headerParams, formParams, postBody,
|
pathParams, queryParams, headerParams, formParams, postBody,
|
||||||
authNames, contentTypes, accepts, returnType
|
authNames, contentTypes, accepts, returnType, requestInit
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -275,18 +293,19 @@ export default class UserApi extends ApiClient {
|
|||||||
* Updated user
|
* Updated user
|
||||||
* This can only be done by the logged in user.
|
* This can only be done by the logged in user.
|
||||||
* @param {String} username name that need to be deleted
|
* @param {String} username name that need to be deleted
|
||||||
* @param {User} body Updated user object
|
* @param {module:model/User} user Updated user object
|
||||||
|
* @param requestInit Dynamic configuration. @see {@link https://github.com/apollographql/apollo-server/pull/1277}
|
||||||
* @return {Promise}
|
* @return {Promise}
|
||||||
*/
|
*/
|
||||||
async updateUser(username, body) {
|
async updateUser(username, user, requestInit) {
|
||||||
let postBody = body;
|
let postBody = user;
|
||||||
// verify the required parameter 'username' is set
|
// verify the required parameter 'username' is set
|
||||||
if (username === undefined || username === null) {
|
if (username === undefined || username === null) {
|
||||||
throw new Error("Missing the required parameter 'username' when calling updateUser");
|
throw new Error("Missing the required parameter 'username' when calling updateUser");
|
||||||
}
|
}
|
||||||
// verify the required parameter 'body' is set
|
// verify the required parameter 'user' is set
|
||||||
if (body === undefined || body === null) {
|
if (user === undefined || user === null) {
|
||||||
throw new Error("Missing the required parameter 'body' when calling updateUser");
|
throw new Error("Missing the required parameter 'user' when calling updateUser");
|
||||||
}
|
}
|
||||||
|
|
||||||
let pathParams = {
|
let pathParams = {
|
||||||
@ -295,19 +314,20 @@ export default class UserApi extends ApiClient {
|
|||||||
let queryParams = {
|
let queryParams = {
|
||||||
};
|
};
|
||||||
let headerParams = {
|
let headerParams = {
|
||||||
|
'User-Agent': 'OpenAPI-Generator/1.0.0/Javascript',
|
||||||
};
|
};
|
||||||
let formParams = {
|
let formParams = {
|
||||||
};
|
};
|
||||||
|
|
||||||
let authNames = [];
|
let authNames = [];
|
||||||
let contentTypes = [];
|
let contentTypes = ['application/json'];
|
||||||
let accepts = [];
|
let accepts = [];
|
||||||
let returnType = null;
|
let returnType = null;
|
||||||
|
|
||||||
return this.callApi(
|
return this.callApi(
|
||||||
'/user/{username}', 'PUT',
|
'/user/{username}', 'PUT',
|
||||||
pathParams, queryParams, headerParams, formParams, postBody,
|
pathParams, queryParams, headerParams, formParams, postBody,
|
||||||
authNames, contentTypes, accepts, returnType
|
authNames, contentTypes, accepts, returnType, requestInit
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/**
|
/**
|
||||||
* OpenAPI Petstore
|
* 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.
|
* 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
|
* The version of the OpenAPI document: 1.0.0
|
||||||
*
|
*
|
||||||
@ -13,19 +13,63 @@
|
|||||||
|
|
||||||
|
|
||||||
import ApiClient from './ApiClient';
|
import ApiClient from './ApiClient';
|
||||||
|
import AdditionalPropertiesClass from './model/AdditionalPropertiesClass';
|
||||||
|
import Animal from './model/Animal';
|
||||||
import ApiResponse from './model/ApiResponse';
|
import ApiResponse from './model/ApiResponse';
|
||||||
|
import ArrayOfArrayOfNumberOnly from './model/ArrayOfArrayOfNumberOnly';
|
||||||
|
import ArrayOfNumberOnly from './model/ArrayOfNumberOnly';
|
||||||
|
import ArrayTest from './model/ArrayTest';
|
||||||
|
import Capitalization from './model/Capitalization';
|
||||||
|
import Cat from './model/Cat';
|
||||||
|
import CatAllOf from './model/CatAllOf';
|
||||||
import Category from './model/Category';
|
import Category from './model/Category';
|
||||||
|
import ClassModel from './model/ClassModel';
|
||||||
|
import Client from './model/Client';
|
||||||
|
import DeprecatedObject from './model/DeprecatedObject';
|
||||||
|
import Dog from './model/Dog';
|
||||||
|
import DogAllOf from './model/DogAllOf';
|
||||||
|
import EnumArrays from './model/EnumArrays';
|
||||||
|
import EnumClass from './model/EnumClass';
|
||||||
|
import EnumTest from './model/EnumTest';
|
||||||
|
import File from './model/File';
|
||||||
|
import FileSchemaTestClass from './model/FileSchemaTestClass';
|
||||||
|
import Foo from './model/Foo';
|
||||||
|
import FooGetDefaultResponse from './model/FooGetDefaultResponse';
|
||||||
|
import FormatTest from './model/FormatTest';
|
||||||
|
import HasOnlyReadOnly from './model/HasOnlyReadOnly';
|
||||||
|
import HealthCheckResult from './model/HealthCheckResult';
|
||||||
|
import List from './model/List';
|
||||||
|
import MapTest from './model/MapTest';
|
||||||
|
import MixedPropertiesAndAdditionalPropertiesClass from './model/MixedPropertiesAndAdditionalPropertiesClass';
|
||||||
|
import Model200Response from './model/Model200Response';
|
||||||
|
import Name from './model/Name';
|
||||||
|
import NullableClass from './model/NullableClass';
|
||||||
|
import NumberOnly from './model/NumberOnly';
|
||||||
|
import ObjectWithDeprecatedFields from './model/ObjectWithDeprecatedFields';
|
||||||
import Order from './model/Order';
|
import Order from './model/Order';
|
||||||
|
import OuterComposite from './model/OuterComposite';
|
||||||
|
import OuterEnum from './model/OuterEnum';
|
||||||
|
import OuterEnumDefaultValue from './model/OuterEnumDefaultValue';
|
||||||
|
import OuterEnumInteger from './model/OuterEnumInteger';
|
||||||
|
import OuterEnumIntegerDefaultValue from './model/OuterEnumIntegerDefaultValue';
|
||||||
|
import OuterObjectWithEnumProperty from './model/OuterObjectWithEnumProperty';
|
||||||
import Pet from './model/Pet';
|
import Pet from './model/Pet';
|
||||||
|
import ReadOnlyFirst from './model/ReadOnlyFirst';
|
||||||
|
import Return from './model/Return';
|
||||||
|
import SpecialModelName from './model/SpecialModelName';
|
||||||
import Tag from './model/Tag';
|
import Tag from './model/Tag';
|
||||||
import User from './model/User';
|
import User from './model/User';
|
||||||
|
import AnotherFakeApi from './api/AnotherFakeApi';
|
||||||
|
import DefaultApi from './api/DefaultApi';
|
||||||
|
import FakeApi from './api/FakeApi';
|
||||||
|
import FakeClassnameTags123Api from './api/FakeClassnameTags123Api';
|
||||||
import PetApi from './api/PetApi';
|
import PetApi from './api/PetApi';
|
||||||
import StoreApi from './api/StoreApi';
|
import StoreApi from './api/StoreApi';
|
||||||
import UserApi from './api/UserApi';
|
import UserApi from './api/UserApi';
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This_is_a_sample_server_Petstore_server__For_this_sample_you_can_use_the_api_key_special_key_to_test_the_authorization_filters_.<br>
|
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\.<br>
|
||||||
* The <code>index</code> module provides access to constructors for all the classes which comprise the public API.
|
* The <code>index</code> module provides access to constructors for all the classes which comprise the public API.
|
||||||
* <p>
|
* <p>
|
||||||
* An AMD (recommended!) or CommonJS application will generally do something equivalent to the following:
|
* An AMD (recommended!) or CommonJS application will generally do something equivalent to the following:
|
||||||
@ -62,30 +106,270 @@ export {
|
|||||||
*/
|
*/
|
||||||
ApiClient,
|
ApiClient,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The AdditionalPropertiesClass model constructor.
|
||||||
|
* @property {module:model/AdditionalPropertiesClass}
|
||||||
|
*/
|
||||||
|
AdditionalPropertiesClass,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The Animal model constructor.
|
||||||
|
* @property {module:model/Animal}
|
||||||
|
*/
|
||||||
|
Animal,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The ApiResponse model constructor.
|
* The ApiResponse model constructor.
|
||||||
* @property {module:model/ApiResponse}
|
* @property {module:model/ApiResponse}
|
||||||
*/
|
*/
|
||||||
ApiResponse,
|
ApiResponse,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The ArrayOfArrayOfNumberOnly model constructor.
|
||||||
|
* @property {module:model/ArrayOfArrayOfNumberOnly}
|
||||||
|
*/
|
||||||
|
ArrayOfArrayOfNumberOnly,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The ArrayOfNumberOnly model constructor.
|
||||||
|
* @property {module:model/ArrayOfNumberOnly}
|
||||||
|
*/
|
||||||
|
ArrayOfNumberOnly,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The ArrayTest model constructor.
|
||||||
|
* @property {module:model/ArrayTest}
|
||||||
|
*/
|
||||||
|
ArrayTest,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The Capitalization model constructor.
|
||||||
|
* @property {module:model/Capitalization}
|
||||||
|
*/
|
||||||
|
Capitalization,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The Cat model constructor.
|
||||||
|
* @property {module:model/Cat}
|
||||||
|
*/
|
||||||
|
Cat,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The CatAllOf model constructor.
|
||||||
|
* @property {module:model/CatAllOf}
|
||||||
|
*/
|
||||||
|
CatAllOf,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Category model constructor.
|
* The Category model constructor.
|
||||||
* @property {module:model/Category}
|
* @property {module:model/Category}
|
||||||
*/
|
*/
|
||||||
Category,
|
Category,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The ClassModel model constructor.
|
||||||
|
* @property {module:model/ClassModel}
|
||||||
|
*/
|
||||||
|
ClassModel,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The Client model constructor.
|
||||||
|
* @property {module:model/Client}
|
||||||
|
*/
|
||||||
|
Client,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The DeprecatedObject model constructor.
|
||||||
|
* @property {module:model/DeprecatedObject}
|
||||||
|
*/
|
||||||
|
DeprecatedObject,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The Dog model constructor.
|
||||||
|
* @property {module:model/Dog}
|
||||||
|
*/
|
||||||
|
Dog,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The DogAllOf model constructor.
|
||||||
|
* @property {module:model/DogAllOf}
|
||||||
|
*/
|
||||||
|
DogAllOf,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The EnumArrays model constructor.
|
||||||
|
* @property {module:model/EnumArrays}
|
||||||
|
*/
|
||||||
|
EnumArrays,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The EnumClass model constructor.
|
||||||
|
* @property {module:model/EnumClass}
|
||||||
|
*/
|
||||||
|
EnumClass,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The EnumTest model constructor.
|
||||||
|
* @property {module:model/EnumTest}
|
||||||
|
*/
|
||||||
|
EnumTest,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The File model constructor.
|
||||||
|
* @property {module:model/File}
|
||||||
|
*/
|
||||||
|
File,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The FileSchemaTestClass model constructor.
|
||||||
|
* @property {module:model/FileSchemaTestClass}
|
||||||
|
*/
|
||||||
|
FileSchemaTestClass,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The Foo model constructor.
|
||||||
|
* @property {module:model/Foo}
|
||||||
|
*/
|
||||||
|
Foo,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The FooGetDefaultResponse model constructor.
|
||||||
|
* @property {module:model/FooGetDefaultResponse}
|
||||||
|
*/
|
||||||
|
FooGetDefaultResponse,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The FormatTest model constructor.
|
||||||
|
* @property {module:model/FormatTest}
|
||||||
|
*/
|
||||||
|
FormatTest,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The HasOnlyReadOnly model constructor.
|
||||||
|
* @property {module:model/HasOnlyReadOnly}
|
||||||
|
*/
|
||||||
|
HasOnlyReadOnly,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The HealthCheckResult model constructor.
|
||||||
|
* @property {module:model/HealthCheckResult}
|
||||||
|
*/
|
||||||
|
HealthCheckResult,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The List model constructor.
|
||||||
|
* @property {module:model/List}
|
||||||
|
*/
|
||||||
|
List,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The MapTest model constructor.
|
||||||
|
* @property {module:model/MapTest}
|
||||||
|
*/
|
||||||
|
MapTest,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The MixedPropertiesAndAdditionalPropertiesClass model constructor.
|
||||||
|
* @property {module:model/MixedPropertiesAndAdditionalPropertiesClass}
|
||||||
|
*/
|
||||||
|
MixedPropertiesAndAdditionalPropertiesClass,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The Model200Response model constructor.
|
||||||
|
* @property {module:model/Model200Response}
|
||||||
|
*/
|
||||||
|
Model200Response,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The Name model constructor.
|
||||||
|
* @property {module:model/Name}
|
||||||
|
*/
|
||||||
|
Name,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The NullableClass model constructor.
|
||||||
|
* @property {module:model/NullableClass}
|
||||||
|
*/
|
||||||
|
NullableClass,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The NumberOnly model constructor.
|
||||||
|
* @property {module:model/NumberOnly}
|
||||||
|
*/
|
||||||
|
NumberOnly,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The ObjectWithDeprecatedFields model constructor.
|
||||||
|
* @property {module:model/ObjectWithDeprecatedFields}
|
||||||
|
*/
|
||||||
|
ObjectWithDeprecatedFields,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Order model constructor.
|
* The Order model constructor.
|
||||||
* @property {module:model/Order}
|
* @property {module:model/Order}
|
||||||
*/
|
*/
|
||||||
Order,
|
Order,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The OuterComposite model constructor.
|
||||||
|
* @property {module:model/OuterComposite}
|
||||||
|
*/
|
||||||
|
OuterComposite,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The OuterEnum model constructor.
|
||||||
|
* @property {module:model/OuterEnum}
|
||||||
|
*/
|
||||||
|
OuterEnum,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The OuterEnumDefaultValue model constructor.
|
||||||
|
* @property {module:model/OuterEnumDefaultValue}
|
||||||
|
*/
|
||||||
|
OuterEnumDefaultValue,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The OuterEnumInteger model constructor.
|
||||||
|
* @property {module:model/OuterEnumInteger}
|
||||||
|
*/
|
||||||
|
OuterEnumInteger,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The OuterEnumIntegerDefaultValue model constructor.
|
||||||
|
* @property {module:model/OuterEnumIntegerDefaultValue}
|
||||||
|
*/
|
||||||
|
OuterEnumIntegerDefaultValue,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The OuterObjectWithEnumProperty model constructor.
|
||||||
|
* @property {module:model/OuterObjectWithEnumProperty}
|
||||||
|
*/
|
||||||
|
OuterObjectWithEnumProperty,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Pet model constructor.
|
* The Pet model constructor.
|
||||||
* @property {module:model/Pet}
|
* @property {module:model/Pet}
|
||||||
*/
|
*/
|
||||||
Pet,
|
Pet,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The ReadOnlyFirst model constructor.
|
||||||
|
* @property {module:model/ReadOnlyFirst}
|
||||||
|
*/
|
||||||
|
ReadOnlyFirst,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The Return model constructor.
|
||||||
|
* @property {module:model/Return}
|
||||||
|
*/
|
||||||
|
Return,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The SpecialModelName model constructor.
|
||||||
|
* @property {module:model/SpecialModelName}
|
||||||
|
*/
|
||||||
|
SpecialModelName,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Tag model constructor.
|
* The Tag model constructor.
|
||||||
* @property {module:model/Tag}
|
* @property {module:model/Tag}
|
||||||
@ -98,6 +382,30 @@ export {
|
|||||||
*/
|
*/
|
||||||
User,
|
User,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The AnotherFakeApi service constructor.
|
||||||
|
* @property {module:api/AnotherFakeApi}
|
||||||
|
*/
|
||||||
|
AnotherFakeApi,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The DefaultApi service constructor.
|
||||||
|
* @property {module:api/DefaultApi}
|
||||||
|
*/
|
||||||
|
DefaultApi,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The FakeApi service constructor.
|
||||||
|
* @property {module:api/FakeApi}
|
||||||
|
*/
|
||||||
|
FakeApi,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The FakeClassnameTags123Api service constructor.
|
||||||
|
* @property {module:api/FakeClassnameTags123Api}
|
||||||
|
*/
|
||||||
|
FakeClassnameTags123Api,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The PetApi service constructor.
|
* The PetApi service constructor.
|
||||||
* @property {module:api/PetApi}
|
* @property {module:api/PetApi}
|
||||||
|
@ -0,0 +1,79 @@
|
|||||||
|
/**
|
||||||
|
* OpenAPI Petstore
|
||||||
|
* 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.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
import ApiClient from '../ApiClient';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The AdditionalPropertiesClass model module.
|
||||||
|
* @module model/AdditionalPropertiesClass
|
||||||
|
* @version 1.0.0
|
||||||
|
*/
|
||||||
|
class AdditionalPropertiesClass {
|
||||||
|
/**
|
||||||
|
* Constructs a new <code>AdditionalPropertiesClass</code>.
|
||||||
|
* @alias module:model/AdditionalPropertiesClass
|
||||||
|
*/
|
||||||
|
constructor() {
|
||||||
|
|
||||||
|
AdditionalPropertiesClass.initialize(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Initializes the fields of this object.
|
||||||
|
* This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
|
||||||
|
* Only for internal use.
|
||||||
|
*/
|
||||||
|
static initialize(obj) {
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructs a <code>AdditionalPropertiesClass</code> from a plain JavaScript object, optionally creating a new instance.
|
||||||
|
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
|
||||||
|
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
||||||
|
* @param {module:model/AdditionalPropertiesClass} obj Optional instance to populate.
|
||||||
|
* @return {module:model/AdditionalPropertiesClass} The populated <code>AdditionalPropertiesClass</code> instance.
|
||||||
|
*/
|
||||||
|
static constructFromObject(data, obj) {
|
||||||
|
if (data) {
|
||||||
|
obj = obj || new AdditionalPropertiesClass();
|
||||||
|
|
||||||
|
if (data.hasOwnProperty('map_property')) {
|
||||||
|
obj['map_property'] = ApiClient.convertToType(data['map_property'], {'String': 'String'});
|
||||||
|
}
|
||||||
|
if (data.hasOwnProperty('map_of_map_property')) {
|
||||||
|
obj['map_of_map_property'] = ApiClient.convertToType(data['map_of_map_property'], {'String': {'String': 'String'}});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return obj;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @member {Object.<String, String>} map_property
|
||||||
|
*/
|
||||||
|
AdditionalPropertiesClass.prototype['map_property'] = undefined;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @member {Object.<String, Object.<String, String>>} map_of_map_property
|
||||||
|
*/
|
||||||
|
AdditionalPropertiesClass.prototype['map_of_map_property'] = undefined;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
export default AdditionalPropertiesClass;
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user