forked from loafle/openapi-generator-original
Merge branch 'master' into java-docs
This commit is contained in:
commit
a6fd93db41
@ -87,7 +87,7 @@ To build from source, you need the following installed and available in your $PA
|
|||||||
|
|
||||||
* [Java 7 or 8](http://java.oracle.com)
|
* [Java 7 or 8](http://java.oracle.com)
|
||||||
|
|
||||||
* [Apache maven 3.0.3 or greater](http://maven.apache.org/)
|
* [Apache maven 3.3.3 or greater](http://maven.apache.org/)
|
||||||
|
|
||||||
#### OS X Users
|
#### OS X Users
|
||||||
Don't forget to install Java 7 or 8. You probably have 1.6.
|
Don't forget to install Java 7 or 8. You probably have 1.6.
|
||||||
@ -740,6 +740,7 @@ Here are some companies/projects using Swagger Codegen in production. To add you
|
|||||||
- [FH Münster - University of Applied Sciences](http://www.fh-muenster.de)
|
- [FH Münster - University of Applied Sciences](http://www.fh-muenster.de)
|
||||||
- [LANDR Audio](https://www.landr.com/)
|
- [LANDR Audio](https://www.landr.com/)
|
||||||
- [LiveAgent](https://www.ladesk.com/)
|
- [LiveAgent](https://www.ladesk.com/)
|
||||||
|
- [Kuary](https://kuary.com/)
|
||||||
- [nViso](http://www.nviso.ch/)
|
- [nViso](http://www.nviso.ch/)
|
||||||
- [Okiok](https://www.okiok.com)
|
- [Okiok](https://www.okiok.com)
|
||||||
- [OSDN](https://osdn.jp)
|
- [OSDN](https://osdn.jp)
|
||||||
|
@ -8,9 +8,9 @@ buildscript {
|
|||||||
jcenter()
|
jcenter()
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'com.android.tools.build:gradle:1.2.2'
|
classpath 'com.android.tools.build:gradle:1.5.+'
|
||||||
{{#useAndroidMavenGradlePlugin}}
|
{{#useAndroidMavenGradlePlugin}}
|
||||||
classpath 'com.github.dcendents:android-maven-plugin:1.2'
|
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.3'
|
||||||
{{/useAndroidMavenGradlePlugin}}
|
{{/useAndroidMavenGradlePlugin}}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -28,11 +28,12 @@ apply plugin: 'com.github.dcendents.android-maven'
|
|||||||
{{/useAndroidMavenGradlePlugin}}
|
{{/useAndroidMavenGradlePlugin}}
|
||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdkVersion 22
|
compileSdkVersion 23
|
||||||
buildToolsVersion '22.0.0'
|
buildToolsVersion '23.0.2'
|
||||||
|
useLibrary 'org.apache.http.legacy'
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
minSdkVersion 14
|
minSdkVersion 14
|
||||||
targetSdkVersion 22
|
targetSdkVersion 23
|
||||||
}
|
}
|
||||||
compileOptions {
|
compileOptions {
|
||||||
sourceCompatibility JavaVersion.VERSION_1_7
|
sourceCompatibility JavaVersion.VERSION_1_7
|
||||||
@ -55,16 +56,17 @@ android {
|
|||||||
ext {
|
ext {
|
||||||
swagger_annotations_version = "1.5.0"
|
swagger_annotations_version = "1.5.0"
|
||||||
gson_version = "2.3.1"
|
gson_version = "2.3.1"
|
||||||
httpclient_version = "4.3.3"
|
httpclient_version = "4.5.2"
|
||||||
junit_version = "4.8.1"
|
httpcore_version = "4.4.4"
|
||||||
|
junit_version = "4.12"
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compile "io.swagger:swagger-annotations:$swagger_annotations_version"
|
compile "io.swagger:swagger-annotations:$swagger_annotations_version"
|
||||||
compile "com.google.code.gson:gson:$gson_version"
|
compile "com.google.code.gson:gson:$gson_version"
|
||||||
compile "org.apache.httpcomponents:httpcore:$httpclient_version"
|
compile "org.apache.httpcomponents:httpcore:$httpcore_version"
|
||||||
compile "org.apache.httpcomponents:httpclient:$httpclient_version"
|
compile "org.apache.httpcomponents:httpclient:$httpclient_version"
|
||||||
compile ("org.apache.httpcomponents:httpcore:$httpclient_version") {
|
compile ("org.apache.httpcomponents:httpcore:$httpcore_version") {
|
||||||
exclude(group: 'org.apache.httpcomponents', module: 'httpclient')
|
exclude(group: 'org.apache.httpcomponents', module: 'httpclient')
|
||||||
}
|
}
|
||||||
compile ("org.apache.httpcomponents:httpmime:$httpclient_version") {
|
compile ("org.apache.httpcomponents:httpmime:$httpclient_version") {
|
||||||
|
@ -197,7 +197,8 @@ public class ApiInvoker {
|
|||||||
INSTANCE.authentications.put("{{name}}", new HttpBasicAuth());
|
INSTANCE.authentications.put("{{name}}", new HttpBasicAuth());
|
||||||
{{/isBasic}}
|
{{/isBasic}}
|
||||||
{{#isOAuth}}
|
{{#isOAuth}}
|
||||||
INSTANCE.authentications.put("{{name}}", new OAuth());
|
// TODO: comment out below as OAuth does not exist
|
||||||
|
//INSTANCE.authentications.put("{{name}}", new OAuth());
|
||||||
{{/isOAuth}}
|
{{/isOAuth}}
|
||||||
{{/authMethods}}
|
{{/authMethods}}
|
||||||
// Prevent the authentications from being modified.
|
// Prevent the authentications from being modified.
|
||||||
|
@ -8,9 +8,9 @@ buildscript {
|
|||||||
jcenter()
|
jcenter()
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'com.android.tools.build:gradle:1.2.2'
|
classpath 'com.android.tools.build:gradle:1.5.+'
|
||||||
{{#useAndroidMavenGradlePlugin}}
|
{{#useAndroidMavenGradlePlugin}}
|
||||||
classpath 'com.github.dcendents:android-maven-plugin:1.2'
|
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.3'
|
||||||
{{/useAndroidMavenGradlePlugin}}
|
{{/useAndroidMavenGradlePlugin}}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -59,9 +59,10 @@ android {
|
|||||||
ext {
|
ext {
|
||||||
swagger_annotations_version = "1.5.0"
|
swagger_annotations_version = "1.5.0"
|
||||||
gson_version = "2.3.1"
|
gson_version = "2.3.1"
|
||||||
httpclient_version = "4.3.3"
|
httpclient_version = "4.5.2"
|
||||||
|
httpcore_version = "4.4.4"
|
||||||
volley_version = "1.0.19"
|
volley_version = "1.0.19"
|
||||||
junit_version = "4.8.1"
|
junit_version = "4.12"
|
||||||
robolectric_version = "3.0"
|
robolectric_version = "3.0"
|
||||||
concurrent_unit_version = "0.4.2"
|
concurrent_unit_version = "0.4.2"
|
||||||
}
|
}
|
||||||
|
@ -114,6 +114,7 @@ class {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}implements ArrayA
|
|||||||
*/
|
*/
|
||||||
public function __construct(array $data = null)
|
public function __construct(array $data = null)
|
||||||
{
|
{
|
||||||
|
{{#parent}}parent::__construct($data);{{/parent}}
|
||||||
if ($data != null) {
|
if ($data != null) {
|
||||||
{{#vars}}$this->{{name}} = $data["{{name}}"];{{#hasMore}}
|
{{#vars}}$this->{{name}} = $data["{{name}}"];{{#hasMore}}
|
||||||
{{/hasMore}}{{/vars}}
|
{{/hasMore}}{{/vars}}
|
||||||
|
@ -1339,6 +1339,42 @@
|
|||||||
"xml": {
|
"xml": {
|
||||||
"name": "Name"
|
"name": "Name"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"Dog" : {
|
||||||
|
"allOf" : [ {
|
||||||
|
"$ref" : "#/definitions/Animal"
|
||||||
|
}, {
|
||||||
|
"type" : "object",
|
||||||
|
"properties" : {
|
||||||
|
"breed" : {
|
||||||
|
"type" : "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} ]
|
||||||
|
},
|
||||||
|
"Cat" : {
|
||||||
|
"allOf" : [ {
|
||||||
|
"$ref" : "#/definitions/Animal"
|
||||||
|
}, {
|
||||||
|
"type" : "object",
|
||||||
|
"properties" : {
|
||||||
|
"declawed" : {
|
||||||
|
"type" : "boolean"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} ]
|
||||||
|
},
|
||||||
|
"Animal" : {
|
||||||
|
"type" : "object",
|
||||||
|
"discriminator": "className",
|
||||||
|
"required": [
|
||||||
|
"className"
|
||||||
|
],
|
||||||
|
"properties" : {
|
||||||
|
"className" : {
|
||||||
|
"type" : "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -90,10 +90,19 @@ public class Generator {
|
|||||||
throw new BadRequestException("The swagger specification supplied was not valid");
|
throw new BadRequestException("The swagger specification supplied was not valid");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String destPath = null;
|
||||||
|
|
||||||
|
if(opts != null && opts.getOptions() != null) {
|
||||||
|
destPath = opts.getOptions().get("outputFolder");
|
||||||
|
}
|
||||||
|
if(destPath == null) {
|
||||||
|
destPath = language + "-"
|
||||||
|
+ type.getTypeName();
|
||||||
|
}
|
||||||
|
|
||||||
ClientOptInput clientOptInput = new ClientOptInput();
|
ClientOptInput clientOptInput = new ClientOptInput();
|
||||||
ClientOpts clientOpts = new ClientOpts();
|
ClientOpts clientOpts = new ClientOpts();
|
||||||
String outputFolder = getTmpFolder().getAbsolutePath() + File.separator + language + "-"
|
String outputFolder = getTmpFolder().getAbsolutePath() + File.separator + destPath;
|
||||||
+ type.getTypeName();
|
|
||||||
String outputFilename = outputFolder + "-bundle.zip";
|
String outputFilename = outputFolder + "-bundle.zip";
|
||||||
|
|
||||||
clientOptInput
|
clientOptInput
|
||||||
|
2
pom.xml
2
pom.xml
@ -559,7 +559,7 @@
|
|||||||
</repository>
|
</repository>
|
||||||
</repositories>
|
</repositories>
|
||||||
<properties>
|
<properties>
|
||||||
<swagger-parser-version>1.0.18-SNAPSHOT</swagger-parser-version>
|
<swagger-parser-version>1.0.18</swagger-parser-version>
|
||||||
<scala-version>2.11.1</scala-version>
|
<scala-version>2.11.1</scala-version>
|
||||||
<felix-version>2.3.4</felix-version>
|
<felix-version>2.3.4</felix-version>
|
||||||
<swagger-core-version>1.5.8</swagger-core-version>
|
<swagger-core-version>1.5.8</swagger-core-version>
|
||||||
|
@ -6,9 +6,9 @@ buildscript {
|
|||||||
jcenter()
|
jcenter()
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'com.android.tools.build:gradle:1.2.2'
|
classpath 'com.android.tools.build:gradle:1.5.+'
|
||||||
|
|
||||||
classpath 'com.github.dcendents:android-maven-plugin:1.2'
|
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.3'
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -24,11 +24,12 @@ apply plugin: 'com.android.library'
|
|||||||
apply plugin: 'com.github.dcendents.android-maven'
|
apply plugin: 'com.github.dcendents.android-maven'
|
||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdkVersion 22
|
compileSdkVersion 23
|
||||||
buildToolsVersion '22.0.0'
|
buildToolsVersion '23.0.2'
|
||||||
|
useLibrary 'org.apache.http.legacy'
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
minSdkVersion 14
|
minSdkVersion 14
|
||||||
targetSdkVersion 22
|
targetSdkVersion 23
|
||||||
}
|
}
|
||||||
compileOptions {
|
compileOptions {
|
||||||
sourceCompatibility JavaVersion.VERSION_1_7
|
sourceCompatibility JavaVersion.VERSION_1_7
|
||||||
@ -51,16 +52,17 @@ android {
|
|||||||
ext {
|
ext {
|
||||||
swagger_annotations_version = "1.5.0"
|
swagger_annotations_version = "1.5.0"
|
||||||
gson_version = "2.3.1"
|
gson_version = "2.3.1"
|
||||||
httpclient_version = "4.3.3"
|
httpclient_version = "4.5.2"
|
||||||
junit_version = "4.8.1"
|
httpcore_version = "4.4.4"
|
||||||
|
junit_version = "4.12"
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compile "io.swagger:swagger-annotations:$swagger_annotations_version"
|
compile "io.swagger:swagger-annotations:$swagger_annotations_version"
|
||||||
compile "com.google.code.gson:gson:$gson_version"
|
compile "com.google.code.gson:gson:$gson_version"
|
||||||
compile "org.apache.httpcomponents:httpcore:$httpclient_version"
|
compile "org.apache.httpcomponents:httpcore:$httpcore_version"
|
||||||
compile "org.apache.httpcomponents:httpclient:$httpclient_version"
|
compile "org.apache.httpcomponents:httpclient:$httpclient_version"
|
||||||
compile ("org.apache.httpcomponents:httpcore:$httpclient_version") {
|
compile ("org.apache.httpcomponents:httpcore:$httpcore_version") {
|
||||||
exclude(group: 'org.apache.httpcomponents', module: 'httpclient')
|
exclude(group: 'org.apache.httpcomponents', module: 'httpclient')
|
||||||
}
|
}
|
||||||
compile ("org.apache.httpcomponents:httpmime:$httpclient_version") {
|
compile ("org.apache.httpcomponents:httpmime:$httpclient_version") {
|
||||||
|
@ -10,6 +10,8 @@ public class Name {
|
|||||||
|
|
||||||
@SerializedName("name")
|
@SerializedName("name")
|
||||||
private Integer name = null;
|
private Integer name = null;
|
||||||
|
@SerializedName("snake_case")
|
||||||
|
private Integer snakeCase = null;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -23,6 +25,17 @@ public class Name {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
**/
|
||||||
|
@ApiModelProperty(value = "")
|
||||||
|
public Integer getSnakeCase() {
|
||||||
|
return snakeCase;
|
||||||
|
}
|
||||||
|
public void setSnakeCase(Integer snakeCase) {
|
||||||
|
this.snakeCase = snakeCase;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
@ -30,6 +43,7 @@ public class Name {
|
|||||||
sb.append("class Name {\n");
|
sb.append("class Name {\n");
|
||||||
|
|
||||||
sb.append(" name: ").append(name).append("\n");
|
sb.append(" name: ").append(name).append("\n");
|
||||||
|
sb.append(" snakeCase: ").append(snakeCase).append("\n");
|
||||||
sb.append("}\n");
|
sb.append("}\n");
|
||||||
return sb.toString();
|
return sb.toString();
|
||||||
}
|
}
|
||||||
|
@ -6,9 +6,9 @@ buildscript {
|
|||||||
jcenter()
|
jcenter()
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'com.android.tools.build:gradle:1.2.2'
|
classpath 'com.android.tools.build:gradle:1.5.0'
|
||||||
|
|
||||||
classpath 'com.github.dcendents:android-maven-plugin:1.2'
|
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.3'
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -229,7 +229,8 @@ public class ApiInvoker {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
INSTANCE.authentications.put("petstore_auth", new OAuth());
|
// TODO: comment out below as OAuth does not exist
|
||||||
|
//INSTANCE.authentications.put("petstore_auth", new OAuth());
|
||||||
|
|
||||||
|
|
||||||
// Prevent the authentications from being modified.
|
// Prevent the authentications from being modified.
|
||||||
|
@ -10,6 +10,8 @@ public class Name {
|
|||||||
|
|
||||||
@SerializedName("name")
|
@SerializedName("name")
|
||||||
private Integer name = null;
|
private Integer name = null;
|
||||||
|
@SerializedName("snake_case")
|
||||||
|
private Integer snakeCase = null;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -23,6 +25,17 @@ public class Name {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
**/
|
||||||
|
@ApiModelProperty(value = "")
|
||||||
|
public Integer getSnakeCase() {
|
||||||
|
return snakeCase;
|
||||||
|
}
|
||||||
|
public void setSnakeCase(Integer snakeCase) {
|
||||||
|
this.snakeCase = snakeCase;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
@ -30,6 +43,7 @@ public class Name {
|
|||||||
sb.append("class Name {\n");
|
sb.append("class Name {\n");
|
||||||
|
|
||||||
sb.append(" name: ").append(name).append("\n");
|
sb.append(" name: ").append(name).append("\n");
|
||||||
|
sb.append(" snakeCase: ").append(snakeCase).append("\n");
|
||||||
sb.append("}\n");
|
sb.append("}\n");
|
||||||
return sb.toString();
|
return sb.toString();
|
||||||
}
|
}
|
||||||
|
@ -1,69 +1,76 @@
|
|||||||
# swagger-petstore
|
# swagger-petstore
|
||||||
|
|
||||||
SwaggerPetstore - JavaScript client for swagger-petstore
|
SwaggerPetstore - JavaScript client for swagger-petstore
|
||||||
|
This is a sample server Petstore server. You can find out more about Swagger at <a href=\"http://swagger.io\">http://swagger.io</a> or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters
|
||||||
|
This SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:
|
||||||
|
|
||||||
Version: 1.0.0
|
- API verion: 1.0.0
|
||||||
|
- Package version: 1.0.0
|
||||||
Automatically generated by the JavaScript Swagger Codegen project:
|
- Build date: 2016-03-24T19:50:42.301+08:00
|
||||||
|
|
||||||
- Build date: 2016-03-18T15:44:17.513Z
|
|
||||||
- Build package: class io.swagger.codegen.languages.JavascriptClientCodegen
|
- Build package: class io.swagger.codegen.languages.JavascriptClientCodegen
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
### Use in [Node.js](https://nodejs.org/)
|
### For [Node.js](https://nodejs.org/)
|
||||||
|
|
||||||
The generated client is valid [npm](https://www.npmjs.com/) package, you can publish it as described
|
#### npm
|
||||||
in [Publishing npm packages](https://docs.npmjs.com/getting-started/publishing-npm-packages).
|
|
||||||
|
|
||||||
After that, you can install it into your project via:
|
To publish the library as a [npm](https://www.npmjs.com/),
|
||||||
|
please follow the procedure in ["Publishing npm packages"](https://docs.npmjs.com/getting-started/publishing-npm-packages).
|
||||||
|
|
||||||
|
Then install it via:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
npm install swagger-petstore --save
|
npm install swagger-petstore --save
|
||||||
```
|
```
|
||||||
|
|
||||||
You can also host the generated client as a git repository on github, e.g.
|
#### git
|
||||||
https://github.com/YOUR_USERNAME/swagger-petstore
|
#
|
||||||
|
If the library is hosted at a git repository, e.g.
|
||||||
Then you can install it via:
|
https://github.com/YOUR_USERNAME/YOUR_GIT_REPO_ID
|
||||||
|
then install it via:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
npm install YOUR_USERNAME/swagger-petstore --save
|
npm install YOUR_USERNAME/YOUR_GIT_REPO_ID --save
|
||||||
```
|
```
|
||||||
|
|
||||||
### Use in browser with [browserify](http://browserify.org/)
|
### For browser
|
||||||
|
|
||||||
The client also works in browser environment via npm and browserify. After following
|
The library also works in the browser environment via npm and [browserify](http://browserify.org/). After following
|
||||||
the above steps with Node.js and installing browserify with `npm install -g browserify`,
|
the above steps with Node.js and installing browserify with `npm install -g browserify`,
|
||||||
you can do this in your project (assuming *main.js* is your entry file):
|
perform the following (assuming *main.js* is your entry file):
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
browserify main.js > bundle.js
|
browserify main.js > bundle.js
|
||||||
```
|
```
|
||||||
|
|
||||||
The generated *bundle.js* can now be included in your HTML pages.
|
Then include *bundle.js* in the HTML pages.
|
||||||
|
|
||||||
## Getting Started
|
## Getting Started
|
||||||
|
|
||||||
|
Please follow the [installation](#installation) instruction and execute the following JS code:
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
var SwaggerPetstore = require('swagger-petstore');
|
var SwaggerPetstore = require('swagger-petstore');
|
||||||
|
|
||||||
var defaultClient = SwaggerPetstore.ApiClient.default;
|
var defaultClient = SwaggerPetstore.ApiClient.default;
|
||||||
defaultClient.timeout = 10 * 1000;
|
|
||||||
defaultClient.defaultHeaders['Test-Header'] = 'test_value';
|
|
||||||
|
|
||||||
// Assuming there's a `PetApi` containing a `getPetById` method
|
// Configure OAuth2 access token for authorization: petstore_auth
|
||||||
// which returns a model object:
|
var petstore_auth = defaultClient.authentications['petstore_auth'];
|
||||||
var api = new SwaggerPetstore.PetApi();
|
petstore_auth.accessToken = "YOUR ACCESS TOKEN"
|
||||||
api.getPetById(2, function(err, pet, resp) {
|
|
||||||
console.log('HTTP status code: ' + resp.status);
|
var api = new SwaggerPetstore.PetApi()
|
||||||
console.log('Response Content-Type: ' + resp.get('Content-Type'));
|
|
||||||
if (err) {
|
var opts = {
|
||||||
console.error(err);
|
'body': new SwaggerPetstore.Pet() // {Pet} Pet object that needs to be added to the store
|
||||||
} else {
|
};
|
||||||
console.log(pet);
|
api.addPet(opts).then(function() {
|
||||||
}
|
console.log('API called successfully.');
|
||||||
|
}, function(error) {
|
||||||
|
console.error(error);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Documentation for API Endpoints
|
## Documentation for API Endpoints
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
# SwaggerPetstore.InlineResponse200
|
# SwaggerPetstore.InlineResponse200
|
||||||
|
|
||||||
## Properties
|
## Properties
|
||||||
|
@ -4,5 +4,6 @@
|
|||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------ | ------------- | ------------- | -------------
|
------------ | ------------- | ------------- | -------------
|
||||||
**name** | **Integer** | | [optional]
|
**name** | **Integer** | | [optional]
|
||||||
|
**snakeCase** | **Integer** | | [optional]
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
# SwaggerPetstore.PetApi
|
# SwaggerPetstore.PetApi
|
||||||
|
|
||||||
All URIs are relative to *http://petstore.swagger.io/v2*
|
All URIs are relative to *http://petstore.swagger.io/v2*
|
||||||
@ -35,12 +34,12 @@ var defaultClient = SwaggerPetstore.ApiClient.default;
|
|||||||
var petstore_auth = defaultClient.authentications['petstore_auth'];
|
var petstore_auth = defaultClient.authentications['petstore_auth'];
|
||||||
petstore_auth.accessToken = "YOUR ACCESS TOKEN"
|
petstore_auth.accessToken = "YOUR ACCESS TOKEN"
|
||||||
|
|
||||||
var api = new SwaggerPetstore.PetApi()
|
var apiInstance = new SwaggerPetstore.PetApi()
|
||||||
|
|
||||||
var opts = {
|
var opts = {
|
||||||
'body': new SwaggerPetstore.Pet() // {Pet} Pet object that needs to be added to the store
|
'body': new SwaggerPetstore.Pet() // {Pet} Pet object that needs to be added to the store
|
||||||
};
|
};
|
||||||
api.addPet(opts).then(function() {
|
apiInstance.addPet(opts).then(function() {
|
||||||
console.log('API called successfully.');
|
console.log('API called successfully.');
|
||||||
}, function(error) {
|
}, function(error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
@ -84,12 +83,12 @@ var defaultClient = SwaggerPetstore.ApiClient.default;
|
|||||||
var petstore_auth = defaultClient.authentications['petstore_auth'];
|
var petstore_auth = defaultClient.authentications['petstore_auth'];
|
||||||
petstore_auth.accessToken = "YOUR ACCESS TOKEN"
|
petstore_auth.accessToken = "YOUR ACCESS TOKEN"
|
||||||
|
|
||||||
var api = new SwaggerPetstore.PetApi()
|
var apiInstance = new SwaggerPetstore.PetApi()
|
||||||
|
|
||||||
var opts = {
|
var opts = {
|
||||||
'body': "B" // {String} Pet object in the form of byte array
|
'body': "B" // {String} Pet object in the form of byte array
|
||||||
};
|
};
|
||||||
api.addPetUsingByteArray(opts).then(function() {
|
apiInstance.addPetUsingByteArray(opts).then(function() {
|
||||||
console.log('API called successfully.');
|
console.log('API called successfully.');
|
||||||
}, function(error) {
|
}, function(error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
@ -133,14 +132,14 @@ var defaultClient = SwaggerPetstore.ApiClient.default;
|
|||||||
var petstore_auth = defaultClient.authentications['petstore_auth'];
|
var petstore_auth = defaultClient.authentications['petstore_auth'];
|
||||||
petstore_auth.accessToken = "YOUR ACCESS TOKEN"
|
petstore_auth.accessToken = "YOUR ACCESS TOKEN"
|
||||||
|
|
||||||
var api = new SwaggerPetstore.PetApi()
|
var apiInstance = new SwaggerPetstore.PetApi()
|
||||||
|
|
||||||
var petId = 789; // {Integer} Pet id to delete
|
var petId = 789; // {Integer} Pet id to delete
|
||||||
|
|
||||||
var opts = {
|
var opts = {
|
||||||
'apiKey': "apiKey_example" // {String}
|
'apiKey': "apiKey_example" // {String}
|
||||||
};
|
};
|
||||||
api.deletePet(petId, opts).then(function() {
|
apiInstance.deletePet(petId, opts).then(function() {
|
||||||
console.log('API called successfully.');
|
console.log('API called successfully.');
|
||||||
}, function(error) {
|
}, function(error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
@ -185,12 +184,12 @@ var defaultClient = SwaggerPetstore.ApiClient.default;
|
|||||||
var petstore_auth = defaultClient.authentications['petstore_auth'];
|
var petstore_auth = defaultClient.authentications['petstore_auth'];
|
||||||
petstore_auth.accessToken = "YOUR ACCESS TOKEN"
|
petstore_auth.accessToken = "YOUR ACCESS TOKEN"
|
||||||
|
|
||||||
var api = new SwaggerPetstore.PetApi()
|
var apiInstance = new SwaggerPetstore.PetApi()
|
||||||
|
|
||||||
var opts = {
|
var opts = {
|
||||||
'status': ["available"] // {[String]} Status values that need to be considered for query
|
'status': ["available"] // {[String]} Status values that need to be considered for query
|
||||||
};
|
};
|
||||||
api.findPetsByStatus(opts).then(function(data) {
|
apiInstance.findPetsByStatus(opts).then(function(data) {
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data: ' + data);
|
||||||
}, function(error) {
|
}, function(error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
@ -234,12 +233,12 @@ var defaultClient = SwaggerPetstore.ApiClient.default;
|
|||||||
var petstore_auth = defaultClient.authentications['petstore_auth'];
|
var petstore_auth = defaultClient.authentications['petstore_auth'];
|
||||||
petstore_auth.accessToken = "YOUR ACCESS TOKEN"
|
petstore_auth.accessToken = "YOUR ACCESS TOKEN"
|
||||||
|
|
||||||
var api = new SwaggerPetstore.PetApi()
|
var apiInstance = new SwaggerPetstore.PetApi()
|
||||||
|
|
||||||
var opts = {
|
var opts = {
|
||||||
'tags': ["tags_example"] // {[String]} Tags to filter by
|
'tags': ["tags_example"] // {[String]} Tags to filter by
|
||||||
};
|
};
|
||||||
api.findPetsByTags(opts).then(function(data) {
|
apiInstance.findPetsByTags(opts).then(function(data) {
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data: ' + data);
|
||||||
}, function(error) {
|
}, function(error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
@ -289,11 +288,11 @@ api_key.apiKey = "YOUR API KEY"
|
|||||||
var petstore_auth = defaultClient.authentications['petstore_auth'];
|
var petstore_auth = defaultClient.authentications['petstore_auth'];
|
||||||
petstore_auth.accessToken = "YOUR ACCESS TOKEN"
|
petstore_auth.accessToken = "YOUR ACCESS TOKEN"
|
||||||
|
|
||||||
var api = new SwaggerPetstore.PetApi()
|
var apiInstance = new SwaggerPetstore.PetApi()
|
||||||
|
|
||||||
var petId = 789; // {Integer} ID of pet that needs to be fetched
|
var petId = 789; // {Integer} ID of pet that needs to be fetched
|
||||||
|
|
||||||
api.getPetById(petId).then(function(data) {
|
apiInstance.getPetById(petId).then(function(data) {
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data: ' + data);
|
||||||
}, function(error) {
|
}, function(error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
@ -343,11 +342,11 @@ api_key.apiKey = "YOUR API KEY"
|
|||||||
var petstore_auth = defaultClient.authentications['petstore_auth'];
|
var petstore_auth = defaultClient.authentications['petstore_auth'];
|
||||||
petstore_auth.accessToken = "YOUR ACCESS TOKEN"
|
petstore_auth.accessToken = "YOUR ACCESS TOKEN"
|
||||||
|
|
||||||
var api = new SwaggerPetstore.PetApi()
|
var apiInstance = new SwaggerPetstore.PetApi()
|
||||||
|
|
||||||
var petId = 789; // {Integer} ID of pet that needs to be fetched
|
var petId = 789; // {Integer} ID of pet that needs to be fetched
|
||||||
|
|
||||||
api.getPetByIdInObject(petId).then(function(data) {
|
apiInstance.getPetByIdInObject(petId).then(function(data) {
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data: ' + data);
|
||||||
}, function(error) {
|
}, function(error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
@ -397,11 +396,11 @@ api_key.apiKey = "YOUR API KEY"
|
|||||||
var petstore_auth = defaultClient.authentications['petstore_auth'];
|
var petstore_auth = defaultClient.authentications['petstore_auth'];
|
||||||
petstore_auth.accessToken = "YOUR ACCESS TOKEN"
|
petstore_auth.accessToken = "YOUR ACCESS TOKEN"
|
||||||
|
|
||||||
var api = new SwaggerPetstore.PetApi()
|
var apiInstance = new SwaggerPetstore.PetApi()
|
||||||
|
|
||||||
var petId = 789; // {Integer} ID of pet that needs to be fetched
|
var petId = 789; // {Integer} ID of pet that needs to be fetched
|
||||||
|
|
||||||
api.petPetIdtestingByteArraytrueGet(petId).then(function(data) {
|
apiInstance.petPetIdtestingByteArraytrueGet(petId).then(function(data) {
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data: ' + data);
|
||||||
}, function(error) {
|
}, function(error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
@ -445,12 +444,12 @@ var defaultClient = SwaggerPetstore.ApiClient.default;
|
|||||||
var petstore_auth = defaultClient.authentications['petstore_auth'];
|
var petstore_auth = defaultClient.authentications['petstore_auth'];
|
||||||
petstore_auth.accessToken = "YOUR ACCESS TOKEN"
|
petstore_auth.accessToken = "YOUR ACCESS TOKEN"
|
||||||
|
|
||||||
var api = new SwaggerPetstore.PetApi()
|
var apiInstance = new SwaggerPetstore.PetApi()
|
||||||
|
|
||||||
var opts = {
|
var opts = {
|
||||||
'body': new SwaggerPetstore.Pet() // {Pet} Pet object that needs to be added to the store
|
'body': new SwaggerPetstore.Pet() // {Pet} Pet object that needs to be added to the store
|
||||||
};
|
};
|
||||||
api.updatePet(opts).then(function() {
|
apiInstance.updatePet(opts).then(function() {
|
||||||
console.log('API called successfully.');
|
console.log('API called successfully.');
|
||||||
}, function(error) {
|
}, function(error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
@ -494,7 +493,7 @@ var defaultClient = SwaggerPetstore.ApiClient.default;
|
|||||||
var petstore_auth = defaultClient.authentications['petstore_auth'];
|
var petstore_auth = defaultClient.authentications['petstore_auth'];
|
||||||
petstore_auth.accessToken = "YOUR ACCESS TOKEN"
|
petstore_auth.accessToken = "YOUR ACCESS TOKEN"
|
||||||
|
|
||||||
var api = new SwaggerPetstore.PetApi()
|
var apiInstance = new SwaggerPetstore.PetApi()
|
||||||
|
|
||||||
var petId = "petId_example"; // {String} ID of pet that needs to be updated
|
var petId = "petId_example"; // {String} ID of pet that needs to be updated
|
||||||
|
|
||||||
@ -502,7 +501,7 @@ var opts = {
|
|||||||
'name': "name_example", // {String} Updated name of the pet
|
'name': "name_example", // {String} Updated name of the pet
|
||||||
'status': "status_example" // {String} Updated status of the pet
|
'status': "status_example" // {String} Updated status of the pet
|
||||||
};
|
};
|
||||||
api.updatePetWithForm(petId, opts).then(function() {
|
apiInstance.updatePetWithForm(petId, opts).then(function() {
|
||||||
console.log('API called successfully.');
|
console.log('API called successfully.');
|
||||||
}, function(error) {
|
}, function(error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
@ -548,7 +547,7 @@ var defaultClient = SwaggerPetstore.ApiClient.default;
|
|||||||
var petstore_auth = defaultClient.authentications['petstore_auth'];
|
var petstore_auth = defaultClient.authentications['petstore_auth'];
|
||||||
petstore_auth.accessToken = "YOUR ACCESS TOKEN"
|
petstore_auth.accessToken = "YOUR ACCESS TOKEN"
|
||||||
|
|
||||||
var api = new SwaggerPetstore.PetApi()
|
var apiInstance = new SwaggerPetstore.PetApi()
|
||||||
|
|
||||||
var petId = 789; // {Integer} ID of pet to update
|
var petId = 789; // {Integer} ID of pet to update
|
||||||
|
|
||||||
@ -556,7 +555,7 @@ var opts = {
|
|||||||
'additionalMetadata': "additionalMetadata_example", // {String} Additional data to pass to server
|
'additionalMetadata': "additionalMetadata_example", // {String} Additional data to pass to server
|
||||||
'file': "/path/to/file.txt" // {File} file to upload
|
'file': "/path/to/file.txt" // {File} file to upload
|
||||||
};
|
};
|
||||||
api.uploadFile(petId, opts).then(function() {
|
apiInstance.uploadFile(petId, opts).then(function() {
|
||||||
console.log('API called successfully.');
|
console.log('API called successfully.');
|
||||||
}, function(error) {
|
}, function(error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
# SwaggerPetstore.StoreApi
|
# SwaggerPetstore.StoreApi
|
||||||
|
|
||||||
All URIs are relative to *http://petstore.swagger.io/v2*
|
All URIs are relative to *http://petstore.swagger.io/v2*
|
||||||
@ -25,11 +24,11 @@ For valid response try integer IDs with value < 1000. Anything above 1000 or
|
|||||||
```javascript
|
```javascript
|
||||||
var SwaggerPetstore = require('swagger-petstore');
|
var SwaggerPetstore = require('swagger-petstore');
|
||||||
|
|
||||||
var api = new SwaggerPetstore.StoreApi()
|
var apiInstance = new SwaggerPetstore.StoreApi()
|
||||||
|
|
||||||
var orderId = "orderId_example"; // {String} ID of the order that needs to be deleted
|
var orderId = "orderId_example"; // {String} ID of the order that needs to be deleted
|
||||||
|
|
||||||
api.deleteOrder(orderId).then(function() {
|
apiInstance.deleteOrder(orderId).then(function() {
|
||||||
console.log('API called successfully.');
|
console.log('API called successfully.');
|
||||||
}, function(error) {
|
}, function(error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
@ -81,12 +80,12 @@ test_api_client_secret.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)
|
||||||
//test_api_client_secret.apiKeyPrefix['x-test_api_client_secret'] = "Token"
|
//test_api_client_secret.apiKeyPrefix['x-test_api_client_secret'] = "Token"
|
||||||
|
|
||||||
var api = new SwaggerPetstore.StoreApi()
|
var apiInstance = new SwaggerPetstore.StoreApi()
|
||||||
|
|
||||||
var opts = {
|
var opts = {
|
||||||
'status': "placed" // {String} Status value that needs to be considered for query
|
'status': "placed" // {String} Status value that needs to be considered for query
|
||||||
};
|
};
|
||||||
api.findOrdersByStatus(opts).then(function(data) {
|
apiInstance.findOrdersByStatus(opts).then(function(data) {
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data: ' + data);
|
||||||
}, function(error) {
|
}, function(error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
@ -132,8 +131,8 @@ api_key.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.apiKeyPrefix['api_key'] = "Token"
|
//api_key.apiKeyPrefix['api_key'] = "Token"
|
||||||
|
|
||||||
var api = new SwaggerPetstore.StoreApi()
|
var apiInstance = new SwaggerPetstore.StoreApi()
|
||||||
api.getInventory().then(function(data) {
|
apiInstance.getInventory().then(function(data) {
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data: ' + data);
|
||||||
}, function(error) {
|
}, function(error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
@ -176,8 +175,8 @@ api_key.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.apiKeyPrefix['api_key'] = "Token"
|
//api_key.apiKeyPrefix['api_key'] = "Token"
|
||||||
|
|
||||||
var api = new SwaggerPetstore.StoreApi()
|
var apiInstance = new SwaggerPetstore.StoreApi()
|
||||||
api.getInventoryInObject().then(function(data) {
|
apiInstance.getInventoryInObject().then(function(data) {
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data: ' + data);
|
||||||
}, function(error) {
|
}, function(error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
@ -226,11 +225,11 @@ test_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)
|
||||||
//test_api_key_query.apiKeyPrefix['test_api_key_query'] = "Token"
|
//test_api_key_query.apiKeyPrefix['test_api_key_query'] = "Token"
|
||||||
|
|
||||||
var api = new SwaggerPetstore.StoreApi()
|
var apiInstance = new SwaggerPetstore.StoreApi()
|
||||||
|
|
||||||
var orderId = "orderId_example"; // {String} ID of pet that needs to be fetched
|
var orderId = "orderId_example"; // {String} ID of pet that needs to be fetched
|
||||||
|
|
||||||
api.getOrderById(orderId).then(function(data) {
|
apiInstance.getOrderById(orderId).then(function(data) {
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data: ' + data);
|
||||||
}, function(error) {
|
}, function(error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
@ -282,12 +281,12 @@ test_api_client_secret.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)
|
||||||
//test_api_client_secret.apiKeyPrefix['x-test_api_client_secret'] = "Token"
|
//test_api_client_secret.apiKeyPrefix['x-test_api_client_secret'] = "Token"
|
||||||
|
|
||||||
var api = new SwaggerPetstore.StoreApi()
|
var apiInstance = new SwaggerPetstore.StoreApi()
|
||||||
|
|
||||||
var opts = {
|
var opts = {
|
||||||
'body': new SwaggerPetstore.Order() // {Order} order placed for purchasing the pet
|
'body': new SwaggerPetstore.Order() // {Order} order placed for purchasing the pet
|
||||||
};
|
};
|
||||||
api.placeOrder(opts).then(function(data) {
|
apiInstance.placeOrder(opts).then(function(data) {
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data: ' + data);
|
||||||
}, function(error) {
|
}, function(error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
|
@ -26,12 +26,12 @@ This can only be done by the logged in user.
|
|||||||
```javascript
|
```javascript
|
||||||
var SwaggerPetstore = require('swagger-petstore');
|
var SwaggerPetstore = require('swagger-petstore');
|
||||||
|
|
||||||
var api = new SwaggerPetstore.UserApi()
|
var apiInstance = new SwaggerPetstore.UserApi()
|
||||||
|
|
||||||
var opts = {
|
var opts = {
|
||||||
'body': new SwaggerPetstore.User() // {User} Created user object
|
'body': new SwaggerPetstore.User() // {User} Created user object
|
||||||
};
|
};
|
||||||
api.createUser(opts).then(function() {
|
apiInstance.createUser(opts).then(function() {
|
||||||
console.log('API called successfully.');
|
console.log('API called successfully.');
|
||||||
}, function(error) {
|
}, function(error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
@ -70,12 +70,12 @@ Creates list of users with given input array
|
|||||||
```javascript
|
```javascript
|
||||||
var SwaggerPetstore = require('swagger-petstore');
|
var SwaggerPetstore = require('swagger-petstore');
|
||||||
|
|
||||||
var api = new SwaggerPetstore.UserApi()
|
var apiInstance = new SwaggerPetstore.UserApi()
|
||||||
|
|
||||||
var opts = {
|
var opts = {
|
||||||
'body': [new SwaggerPetstore.User()] // {[User]} List of user object
|
'body': [new SwaggerPetstore.User()] // {[User]} List of user object
|
||||||
};
|
};
|
||||||
api.createUsersWithArrayInput(opts).then(function() {
|
apiInstance.createUsersWithArrayInput(opts).then(function() {
|
||||||
console.log('API called successfully.');
|
console.log('API called successfully.');
|
||||||
}, function(error) {
|
}, function(error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
@ -114,12 +114,12 @@ Creates list of users with given input array
|
|||||||
```javascript
|
```javascript
|
||||||
var SwaggerPetstore = require('swagger-petstore');
|
var SwaggerPetstore = require('swagger-petstore');
|
||||||
|
|
||||||
var api = new SwaggerPetstore.UserApi()
|
var apiInstance = new SwaggerPetstore.UserApi()
|
||||||
|
|
||||||
var opts = {
|
var opts = {
|
||||||
'body': [new SwaggerPetstore.User()] // {[User]} List of user object
|
'body': [new SwaggerPetstore.User()] // {[User]} List of user object
|
||||||
};
|
};
|
||||||
api.createUsersWithListInput(opts).then(function() {
|
apiInstance.createUsersWithListInput(opts).then(function() {
|
||||||
console.log('API called successfully.');
|
console.log('API called successfully.');
|
||||||
}, function(error) {
|
}, function(error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
@ -164,11 +164,11 @@ var test_http_basic = defaultClient.authentications['test_http_basic'];
|
|||||||
test_http_basic.username = 'YOUR USERNAME'
|
test_http_basic.username = 'YOUR USERNAME'
|
||||||
test_http_basic.password = 'YOUR PASSWORD'
|
test_http_basic.password = 'YOUR PASSWORD'
|
||||||
|
|
||||||
var api = new SwaggerPetstore.UserApi()
|
var apiInstance = new SwaggerPetstore.UserApi()
|
||||||
|
|
||||||
var username = "username_example"; // {String} The name that needs to be deleted
|
var username = "username_example"; // {String} The name that needs to be deleted
|
||||||
|
|
||||||
api.deleteUser(username).then(function() {
|
apiInstance.deleteUser(username).then(function() {
|
||||||
console.log('API called successfully.');
|
console.log('API called successfully.');
|
||||||
}, function(error) {
|
}, function(error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
@ -207,11 +207,11 @@ Get user by user name
|
|||||||
```javascript
|
```javascript
|
||||||
var SwaggerPetstore = require('swagger-petstore');
|
var SwaggerPetstore = require('swagger-petstore');
|
||||||
|
|
||||||
var api = new SwaggerPetstore.UserApi()
|
var apiInstance = new SwaggerPetstore.UserApi()
|
||||||
|
|
||||||
var username = "username_example"; // {String} The name that needs to be fetched. Use user1 for testing.
|
var username = "username_example"; // {String} The name that needs to be fetched. Use user1 for testing.
|
||||||
|
|
||||||
api.getUserByName(username).then(function(data) {
|
apiInstance.getUserByName(username).then(function(data) {
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data: ' + data);
|
||||||
}, function(error) {
|
}, function(error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
@ -250,13 +250,13 @@ Logs user into the system
|
|||||||
```javascript
|
```javascript
|
||||||
var SwaggerPetstore = require('swagger-petstore');
|
var SwaggerPetstore = require('swagger-petstore');
|
||||||
|
|
||||||
var api = new SwaggerPetstore.UserApi()
|
var apiInstance = new SwaggerPetstore.UserApi()
|
||||||
|
|
||||||
var opts = {
|
var opts = {
|
||||||
'username': "username_example", // {String} The user name for login
|
'username': "username_example", // {String} The user name for login
|
||||||
'password': "password_example" // {String} The password for login in clear text
|
'password': "password_example" // {String} The password for login in clear text
|
||||||
};
|
};
|
||||||
api.loginUser(opts).then(function(data) {
|
apiInstance.loginUser(opts).then(function(data) {
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data: ' + data);
|
||||||
}, function(error) {
|
}, function(error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
@ -296,8 +296,8 @@ Logs out current logged in user session
|
|||||||
```javascript
|
```javascript
|
||||||
var SwaggerPetstore = require('swagger-petstore');
|
var SwaggerPetstore = require('swagger-petstore');
|
||||||
|
|
||||||
var api = new SwaggerPetstore.UserApi()
|
var apiInstance = new SwaggerPetstore.UserApi()
|
||||||
api.logoutUser().then(function() {
|
apiInstance.logoutUser().then(function() {
|
||||||
console.log('API called successfully.');
|
console.log('API called successfully.');
|
||||||
}, function(error) {
|
}, function(error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
@ -333,14 +333,14 @@ This can only be done by the logged in user.
|
|||||||
```javascript
|
```javascript
|
||||||
var SwaggerPetstore = require('swagger-petstore');
|
var SwaggerPetstore = require('swagger-petstore');
|
||||||
|
|
||||||
var api = new SwaggerPetstore.UserApi()
|
var apiInstance = new SwaggerPetstore.UserApi()
|
||||||
|
|
||||||
var username = "username_example"; // {String} name that need to be deleted
|
var username = "username_example"; // {String} name that need to be deleted
|
||||||
|
|
||||||
var opts = {
|
var opts = {
|
||||||
'body': new SwaggerPetstore.User() // {User} Updated user object
|
'body': new SwaggerPetstore.User() // {User} Updated user object
|
||||||
};
|
};
|
||||||
api.updateUser(username, opts).then(function() {
|
apiInstance.updateUser(username, opts).then(function() {
|
||||||
console.log('API called successfully.');
|
console.log('API called successfully.');
|
||||||
}, function(error) {
|
}, function(error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
* Constructs a new PetApi.
|
* Constructs a new PetApi.
|
||||||
* @alias module:api/PetApi
|
* @alias module:api/PetApi
|
||||||
* @class
|
* @class
|
||||||
* @param {module:ApiClient} apiClient Optional API client implementation to use, defaulting to {@link module:ApiClient#instance}
|
* @param {module:ApiClient} apiClient Optional API client implementation to use, default to {@link module:ApiClient#instance}
|
||||||
* if unspecified.
|
* if unspecified.
|
||||||
*/
|
*/
|
||||||
var exports = function(apiClient) {
|
var exports = function(apiClient) {
|
||||||
@ -144,7 +144,7 @@
|
|||||||
* 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 {Object} opts Optional parameters
|
* @param {Object} opts Optional parameters
|
||||||
* @param {Array.<String>} opts.status Status values that need to be considered for query
|
* @param {Array.<String>} opts.status Status values that need to be considered for query (default to available)
|
||||||
* data is of type: {Array.<module:model/Pet>}
|
* data is of type: {Array.<module:model/Pet>}
|
||||||
*/
|
*/
|
||||||
this.findPetsByStatus = function(opts) {
|
this.findPetsByStatus = function(opts) {
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
* Constructs a new StoreApi.
|
* Constructs a new StoreApi.
|
||||||
* @alias module:api/StoreApi
|
* @alias module:api/StoreApi
|
||||||
* @class
|
* @class
|
||||||
* @param {module:ApiClient} apiClient Optional API client implementation to use, defaulting to {@link module:ApiClient#instance}
|
* @param {module:ApiClient} apiClient Optional API client implementation to use, default to {@link module:ApiClient#instance}
|
||||||
* if unspecified.
|
* if unspecified.
|
||||||
*/
|
*/
|
||||||
var exports = function(apiClient) {
|
var exports = function(apiClient) {
|
||||||
@ -40,11 +40,6 @@
|
|||||||
*/
|
*/
|
||||||
this.deleteOrder = function(orderId) {
|
this.deleteOrder = function(orderId) {
|
||||||
var postBody = null;
|
var postBody = null;
|
||||||
// verify the required parameter 'orderId' is set
|
|
||||||
if (orderId == null) {
|
|
||||||
throw "Missing the required parameter 'orderId' when calling deleteOrder";
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// verify the required parameter 'orderId' is set
|
// verify the required parameter 'orderId' is set
|
||||||
if (orderId == undefined || orderId == null) {
|
if (orderId == undefined || orderId == null) {
|
||||||
@ -79,7 +74,7 @@
|
|||||||
* Finds orders by status
|
* Finds orders by status
|
||||||
* A single status value can be provided as a string
|
* A single status value can be provided as a string
|
||||||
* @param {Object} opts Optional parameters
|
* @param {Object} opts Optional parameters
|
||||||
* @param {module:model/String} opts.status Status value that needs to be considered for query
|
* @param {module:model/String} opts.status Status value that needs to be considered for query (default to placed)
|
||||||
* data is of type: {Array.<module:model/Order>}
|
* data is of type: {Array.<module:model/Order>}
|
||||||
*/
|
*/
|
||||||
this.findOrdersByStatus = function(opts) {
|
this.findOrdersByStatus = function(opts) {
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
* Constructs a new UserApi.
|
* Constructs a new UserApi.
|
||||||
* @alias module:api/UserApi
|
* @alias module:api/UserApi
|
||||||
* @class
|
* @class
|
||||||
* @param {module:ApiClient} apiClient Optional API client implementation to use, defaulting to {@link module:ApiClient#instance}
|
* @param {module:ApiClient} apiClient Optional API client implementation to use, default to {@link module:ApiClient#instance}
|
||||||
* if unspecified.
|
* if unspecified.
|
||||||
*/
|
*/
|
||||||
var exports = function(apiClient) {
|
var exports = function(apiClient) {
|
||||||
@ -139,11 +139,6 @@
|
|||||||
*/
|
*/
|
||||||
this.deleteUser = function(username) {
|
this.deleteUser = function(username) {
|
||||||
var postBody = null;
|
var postBody = null;
|
||||||
// verify the required parameter 'username' is set
|
|
||||||
if (username == null) {
|
|
||||||
throw "Missing the required parameter 'username' when calling deleteUser";
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// verify the required parameter 'username' is set
|
// verify the required parameter 'username' is set
|
||||||
if (username == undefined || username == null) {
|
if (username == undefined || username == null) {
|
||||||
@ -182,11 +177,6 @@
|
|||||||
*/
|
*/
|
||||||
this.getUserByName = function(username) {
|
this.getUserByName = function(username) {
|
||||||
var postBody = null;
|
var postBody = null;
|
||||||
// verify the required parameter 'username' is set
|
|
||||||
if (username == null) {
|
|
||||||
throw "Missing the required parameter 'username' when calling getUserByName";
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// verify the required parameter 'username' is set
|
// verify the required parameter 'username' is set
|
||||||
if (username == undefined || username == null) {
|
if (username == undefined || username == null) {
|
||||||
|
@ -29,6 +29,7 @@
|
|||||||
var exports = function() {
|
var exports = function() {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -45,6 +46,9 @@
|
|||||||
if (data.hasOwnProperty('name')) {
|
if (data.hasOwnProperty('name')) {
|
||||||
obj['name'] = ApiClient.convertToType(data['name'], 'Integer');
|
obj['name'] = ApiClient.convertToType(data['name'], 'Integer');
|
||||||
}
|
}
|
||||||
|
if (data.hasOwnProperty('snake_case')) {
|
||||||
|
obj['snake_case'] = ApiClient.convertToType(data['snake_case'], 'Integer');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return obj;
|
return obj;
|
||||||
}
|
}
|
||||||
@ -55,6 +59,11 @@
|
|||||||
*/
|
*/
|
||||||
exports.prototype['name'] = undefined;
|
exports.prototype['name'] = undefined;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @member {Integer} snake_case
|
||||||
|
*/
|
||||||
|
exports.prototype['snake_case'] = undefined;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ This SDK is automatically generated by the [Swagger Codegen](https://github.com/
|
|||||||
|
|
||||||
- API verion: 1.0.0
|
- API verion: 1.0.0
|
||||||
- Package version: 1.0.0
|
- Package version: 1.0.0
|
||||||
- Build date: 2016-03-18T18:26:17.121+08:00
|
- Build date: 2016-03-24T19:50:27.240+08:00
|
||||||
- Build package: class io.swagger.codegen.languages.JavascriptClientCodegen
|
- Build package: class io.swagger.codegen.languages.JavascriptClientCodegen
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
@ -4,5 +4,6 @@
|
|||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------ | ------------- | ------------- | -------------
|
------------ | ------------- | ------------- | -------------
|
||||||
**name** | **Integer** | | [optional]
|
**name** | **Integer** | | [optional]
|
||||||
|
**snakeCase** | **Integer** | | [optional]
|
||||||
|
|
||||||
|
|
||||||
|
@ -25,11 +25,7 @@
|
|||||||
* Constructs a new PetApi.
|
* Constructs a new PetApi.
|
||||||
* @alias module:api/PetApi
|
* @alias module:api/PetApi
|
||||||
* @class
|
* @class
|
||||||
<<<<<<< HEAD
|
|
||||||
* @param {module:ApiClient} apiClient Optional API client implementation to use, defaulting to {@link module:ApiClient#instance}
|
|
||||||
=======
|
|
||||||
* @param {module:ApiClient} apiClient Optional API client implementation to use, default to {@link module:ApiClient#instance}
|
* @param {module:ApiClient} apiClient Optional API client implementation to use, default to {@link module:ApiClient#instance}
|
||||||
>>>>>>> update js doc
|
|
||||||
* if unspecified.
|
* if unspecified.
|
||||||
*/
|
*/
|
||||||
var exports = function(apiClient) {
|
var exports = function(apiClient) {
|
||||||
@ -179,11 +175,7 @@
|
|||||||
* 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 {Object} opts Optional parameters
|
* @param {Object} opts Optional parameters
|
||||||
<<<<<<< HEAD
|
|
||||||
* @param {Array.<String>} opts.status Status values that need to be considered for query
|
|
||||||
=======
|
|
||||||
* @param {Array.<String>} opts.status Status values that need to be considered for query (default to available)
|
* @param {Array.<String>} opts.status Status values that need to be considered for query (default to available)
|
||||||
>>>>>>> update js doc
|
|
||||||
* @param {module:api/PetApi~findPetsByStatusCallback} callback The callback function, accepting three arguments: error, data, response
|
* @param {module:api/PetApi~findPetsByStatusCallback} callback The callback function, accepting three arguments: error, data, response
|
||||||
* data is of type: {Array.<module:model/Pet>}
|
* data is of type: {Array.<module:model/Pet>}
|
||||||
*/
|
*/
|
||||||
|
@ -29,6 +29,7 @@
|
|||||||
var exports = function() {
|
var exports = function() {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -45,6 +46,9 @@
|
|||||||
if (data.hasOwnProperty('name')) {
|
if (data.hasOwnProperty('name')) {
|
||||||
obj['name'] = ApiClient.convertToType(data['name'], 'Integer');
|
obj['name'] = ApiClient.convertToType(data['name'], 'Integer');
|
||||||
}
|
}
|
||||||
|
if (data.hasOwnProperty('snake_case')) {
|
||||||
|
obj['snake_case'] = ApiClient.convertToType(data['snake_case'], 'Integer');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return obj;
|
return obj;
|
||||||
}
|
}
|
||||||
@ -55,6 +59,11 @@
|
|||||||
*/
|
*/
|
||||||
exports.prototype['name'] = undefined;
|
exports.prototype['name'] = undefined;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @member {Integer} snake_case
|
||||||
|
*/
|
||||||
|
exports.prototype['snake_case'] = undefined;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@ This PHP package is automatically generated by the [Swagger Codegen](https://git
|
|||||||
|
|
||||||
- API verion: 1.0.0
|
- API verion: 1.0.0
|
||||||
- Package version: 1.0.0
|
- Package version: 1.0.0
|
||||||
- Build date: 2016-03-19T16:11:03.465+08:00
|
- Build date: 2016-03-28T11:19:00.169+02:00
|
||||||
- Build package: class io.swagger.codegen.languages.PhpClientCodegen
|
- Build package: class io.swagger.codegen.languages.PhpClientCodegen
|
||||||
|
|
||||||
## Requirements
|
## Requirements
|
||||||
@ -108,7 +108,10 @@ Class | Method | HTTP request | Description
|
|||||||
|
|
||||||
## Documentation For Models
|
## Documentation For Models
|
||||||
|
|
||||||
|
- [Animal](docs/Animal.md)
|
||||||
|
- [Cat](docs/Cat.md)
|
||||||
- [Category](docs/Category.md)
|
- [Category](docs/Category.md)
|
||||||
|
- [Dog](docs/Dog.md)
|
||||||
- [InlineResponse200](docs/InlineResponse200.md)
|
- [InlineResponse200](docs/InlineResponse200.md)
|
||||||
- [Model200Response](docs/Model200Response.md)
|
- [Model200Response](docs/Model200Response.md)
|
||||||
- [ModelReturn](docs/ModelReturn.md)
|
- [ModelReturn](docs/ModelReturn.md)
|
||||||
@ -123,10 +126,25 @@ Class | Method | HTTP request | Description
|
|||||||
## Documentation For Authorization
|
## Documentation For Authorization
|
||||||
|
|
||||||
|
|
||||||
## test_api_key_header
|
## petstore_auth
|
||||||
|
|
||||||
|
- **Type**: OAuth
|
||||||
|
- **Flow**: implicit
|
||||||
|
- **Authorizatoin URL**: http://petstore.swagger.io/api/oauth/dialog
|
||||||
|
- **Scopes**:
|
||||||
|
- **write:pets**: modify pets in your account
|
||||||
|
- **read:pets**: read your pets
|
||||||
|
|
||||||
|
## test_api_client_id
|
||||||
|
|
||||||
- **Type**: API key
|
- **Type**: API key
|
||||||
- **API key parameter name**: test_api_key_header
|
- **API key parameter name**: x-test_api_client_id
|
||||||
|
- **Location**: HTTP header
|
||||||
|
|
||||||
|
## test_api_client_secret
|
||||||
|
|
||||||
|
- **Type**: API key
|
||||||
|
- **API key parameter name**: x-test_api_client_secret
|
||||||
- **Location**: HTTP header
|
- **Location**: HTTP header
|
||||||
|
|
||||||
## api_key
|
## api_key
|
||||||
@ -139,32 +157,17 @@ Class | Method | HTTP request | Description
|
|||||||
|
|
||||||
- **Type**: HTTP basic authentication
|
- **Type**: HTTP basic authentication
|
||||||
|
|
||||||
## test_api_client_secret
|
|
||||||
|
|
||||||
- **Type**: API key
|
|
||||||
- **API key parameter name**: x-test_api_client_secret
|
|
||||||
- **Location**: HTTP header
|
|
||||||
|
|
||||||
## test_api_client_id
|
|
||||||
|
|
||||||
- **Type**: API key
|
|
||||||
- **API key parameter name**: x-test_api_client_id
|
|
||||||
- **Location**: HTTP header
|
|
||||||
|
|
||||||
## test_api_key_query
|
## test_api_key_query
|
||||||
|
|
||||||
- **Type**: API key
|
- **Type**: API key
|
||||||
- **API key parameter name**: test_api_key_query
|
- **API key parameter name**: test_api_key_query
|
||||||
- **Location**: URL query string
|
- **Location**: URL query string
|
||||||
|
|
||||||
## petstore_auth
|
## test_api_key_header
|
||||||
|
|
||||||
- **Type**: OAuth
|
- **Type**: API key
|
||||||
- **Flow**: implicit
|
- **API key parameter name**: test_api_key_header
|
||||||
- **Authorizatoin URL**: http://petstore.swagger.io/api/oauth/dialog
|
- **Location**: HTTP header
|
||||||
- **Scopes**:
|
|
||||||
- **write:pets**: modify pets in your account
|
|
||||||
- **read:pets**: read your pets
|
|
||||||
|
|
||||||
|
|
||||||
## Author
|
## Author
|
||||||
|
10
samples/client/petstore/php/SwaggerClient-php/docs/Animal.md
Normal file
10
samples/client/petstore/php/SwaggerClient-php/docs/Animal.md
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
# Animal
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**class_name** | **string** | |
|
||||||
|
|
||||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
|
10
samples/client/petstore/php/SwaggerClient-php/docs/Cat.md
Normal file
10
samples/client/petstore/php/SwaggerClient-php/docs/Cat.md
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
# Cat
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**declawed** | **bool** | | [optional]
|
||||||
|
|
||||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
|
10
samples/client/petstore/php/SwaggerClient-php/docs/Dog.md
Normal file
10
samples/client/petstore/php/SwaggerClient-php/docs/Dog.md
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
# Dog
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**breed** | **string** | | [optional]
|
||||||
|
|
||||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
|
@ -3,12 +3,12 @@
|
|||||||
## Properties
|
## Properties
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------ | ------------- | ------------- | -------------
|
------------ | ------------- | ------------- | -------------
|
||||||
**tags** | [**\Swagger\Client\Model\Tag[]**](Tag.md) | | [optional]
|
**photo_urls** | **string[]** | | [optional]
|
||||||
|
**name** | **string** | | [optional]
|
||||||
**id** | **int** | |
|
**id** | **int** | |
|
||||||
**category** | **object** | | [optional]
|
**category** | **object** | | [optional]
|
||||||
|
**tags** | [**\Swagger\Client\Model\Tag[]**](Tag.md) | | [optional]
|
||||||
**status** | **string** | pet status in the store | [optional]
|
**status** | **string** | pet status in the store | [optional]
|
||||||
**name** | **string** | | [optional]
|
|
||||||
**photo_urls** | **string[]** | | [optional]
|
|
||||||
|
|
||||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
@ -268,12 +268,12 @@ Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error cond
|
|||||||
<?php
|
<?php
|
||||||
require_once(__DIR__ . '/vendor/autoload.php');
|
require_once(__DIR__ . '/vendor/autoload.php');
|
||||||
|
|
||||||
|
// Configure OAuth2 access token for authorization: petstore_auth
|
||||||
|
Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
|
||||||
// Configure API key authorization: api_key
|
// Configure API key authorization: api_key
|
||||||
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('api_key', 'YOUR_API_KEY');
|
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('api_key', 'YOUR_API_KEY');
|
||||||
// Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
// Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
||||||
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api_key', 'BEARER');
|
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api_key', 'BEARER');
|
||||||
// Configure OAuth2 access token for authorization: petstore_auth
|
|
||||||
Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
|
|
||||||
|
|
||||||
$api_instance = new Swagger\Client\Api\PetApi();
|
$api_instance = new Swagger\Client\Api\PetApi();
|
||||||
$pet_id = 789; // int | ID of pet that needs to be fetched
|
$pet_id = 789; // int | ID of pet that needs to be fetched
|
||||||
@ -299,7 +299,7 @@ Name | Type | Description | Notes
|
|||||||
|
|
||||||
### Authorization
|
### Authorization
|
||||||
|
|
||||||
[api_key](../README.md#api_key), [petstore_auth](../README.md#petstore_auth)
|
[petstore_auth](../README.md#petstore_auth), [api_key](../README.md#api_key)
|
||||||
|
|
||||||
### HTTP reuqest headers
|
### HTTP reuqest headers
|
||||||
|
|
||||||
@ -320,12 +320,12 @@ Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error cond
|
|||||||
<?php
|
<?php
|
||||||
require_once(__DIR__ . '/vendor/autoload.php');
|
require_once(__DIR__ . '/vendor/autoload.php');
|
||||||
|
|
||||||
|
// Configure OAuth2 access token for authorization: petstore_auth
|
||||||
|
Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
|
||||||
// Configure API key authorization: api_key
|
// Configure API key authorization: api_key
|
||||||
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('api_key', 'YOUR_API_KEY');
|
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('api_key', 'YOUR_API_KEY');
|
||||||
// Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
// Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
||||||
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api_key', 'BEARER');
|
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api_key', 'BEARER');
|
||||||
// Configure OAuth2 access token for authorization: petstore_auth
|
|
||||||
Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
|
|
||||||
|
|
||||||
$api_instance = new Swagger\Client\Api\PetApi();
|
$api_instance = new Swagger\Client\Api\PetApi();
|
||||||
$pet_id = 789; // int | ID of pet that needs to be fetched
|
$pet_id = 789; // int | ID of pet that needs to be fetched
|
||||||
@ -351,7 +351,7 @@ Name | Type | Description | Notes
|
|||||||
|
|
||||||
### Authorization
|
### Authorization
|
||||||
|
|
||||||
[api_key](../README.md#api_key), [petstore_auth](../README.md#petstore_auth)
|
[petstore_auth](../README.md#petstore_auth), [api_key](../README.md#api_key)
|
||||||
|
|
||||||
### HTTP reuqest headers
|
### HTTP reuqest headers
|
||||||
|
|
||||||
@ -372,12 +372,12 @@ Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error cond
|
|||||||
<?php
|
<?php
|
||||||
require_once(__DIR__ . '/vendor/autoload.php');
|
require_once(__DIR__ . '/vendor/autoload.php');
|
||||||
|
|
||||||
|
// Configure OAuth2 access token for authorization: petstore_auth
|
||||||
|
Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
|
||||||
// Configure API key authorization: api_key
|
// Configure API key authorization: api_key
|
||||||
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('api_key', 'YOUR_API_KEY');
|
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('api_key', 'YOUR_API_KEY');
|
||||||
// Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
// Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
||||||
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api_key', 'BEARER');
|
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api_key', 'BEARER');
|
||||||
// Configure OAuth2 access token for authorization: petstore_auth
|
|
||||||
Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
|
|
||||||
|
|
||||||
$api_instance = new Swagger\Client\Api\PetApi();
|
$api_instance = new Swagger\Client\Api\PetApi();
|
||||||
$pet_id = 789; // int | ID of pet that needs to be fetched
|
$pet_id = 789; // int | ID of pet that needs to be fetched
|
||||||
@ -403,7 +403,7 @@ Name | Type | Description | Notes
|
|||||||
|
|
||||||
### Authorization
|
### Authorization
|
||||||
|
|
||||||
[api_key](../README.md#api_key), [petstore_auth](../README.md#petstore_auth)
|
[petstore_auth](../README.md#petstore_auth), [api_key](../README.md#api_key)
|
||||||
|
|
||||||
### HTTP reuqest headers
|
### HTTP reuqest headers
|
||||||
|
|
||||||
|
@ -214,14 +214,14 @@ For valid response try integer IDs with value <= 5 or > 10. Other values will ge
|
|||||||
<?php
|
<?php
|
||||||
require_once(__DIR__ . '/vendor/autoload.php');
|
require_once(__DIR__ . '/vendor/autoload.php');
|
||||||
|
|
||||||
// Configure API key authorization: test_api_key_header
|
|
||||||
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('test_api_key_header', 'YOUR_API_KEY');
|
|
||||||
// Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
|
||||||
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('test_api_key_header', 'BEARER');
|
|
||||||
// Configure API key authorization: test_api_key_query
|
// Configure API key authorization: test_api_key_query
|
||||||
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('test_api_key_query', 'YOUR_API_KEY');
|
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('test_api_key_query', 'YOUR_API_KEY');
|
||||||
// Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
// Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
||||||
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('test_api_key_query', 'BEARER');
|
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('test_api_key_query', 'BEARER');
|
||||||
|
// Configure API key authorization: test_api_key_header
|
||||||
|
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('test_api_key_header', 'YOUR_API_KEY');
|
||||||
|
// Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
||||||
|
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('test_api_key_header', 'BEARER');
|
||||||
|
|
||||||
$api_instance = new Swagger\Client\Api\StoreApi();
|
$api_instance = new Swagger\Client\Api\StoreApi();
|
||||||
$order_id = "order_id_example"; // string | ID of pet that needs to be fetched
|
$order_id = "order_id_example"; // string | ID of pet that needs to be fetched
|
||||||
@ -247,7 +247,7 @@ Name | Type | Description | Notes
|
|||||||
|
|
||||||
### Authorization
|
### Authorization
|
||||||
|
|
||||||
[test_api_key_header](../README.md#test_api_key_header), [test_api_key_query](../README.md#test_api_key_query)
|
[test_api_key_query](../README.md#test_api_key_query), [test_api_key_header](../README.md#test_api_key_header)
|
||||||
|
|
||||||
### HTTP reuqest headers
|
### HTTP reuqest headers
|
||||||
|
|
||||||
|
@ -618,6 +618,11 @@ class PetApi
|
|||||||
$httpBody = $formParams; // for HTTP post (form)
|
$httpBody = $formParams; // for HTTP post (form)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// this endpoint requires OAuth (access token)
|
||||||
|
if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) {
|
||||||
|
$headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken();
|
||||||
|
}
|
||||||
|
|
||||||
// this endpoint requires API key authentication
|
// this endpoint requires API key authentication
|
||||||
$apiKey = $this->apiClient->getApiKeyWithPrefix('api_key');
|
$apiKey = $this->apiClient->getApiKeyWithPrefix('api_key');
|
||||||
if (strlen($apiKey) !== 0) {
|
if (strlen($apiKey) !== 0) {
|
||||||
@ -625,11 +630,6 @@ class PetApi
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// this endpoint requires OAuth (access token)
|
|
||||||
if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) {
|
|
||||||
$headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken();
|
|
||||||
}
|
|
||||||
|
|
||||||
// make the API Call
|
// make the API Call
|
||||||
try {
|
try {
|
||||||
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
|
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
|
||||||
@ -725,6 +725,11 @@ class PetApi
|
|||||||
$httpBody = $formParams; // for HTTP post (form)
|
$httpBody = $formParams; // for HTTP post (form)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// this endpoint requires OAuth (access token)
|
||||||
|
if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) {
|
||||||
|
$headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken();
|
||||||
|
}
|
||||||
|
|
||||||
// this endpoint requires API key authentication
|
// this endpoint requires API key authentication
|
||||||
$apiKey = $this->apiClient->getApiKeyWithPrefix('api_key');
|
$apiKey = $this->apiClient->getApiKeyWithPrefix('api_key');
|
||||||
if (strlen($apiKey) !== 0) {
|
if (strlen($apiKey) !== 0) {
|
||||||
@ -732,11 +737,6 @@ class PetApi
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// this endpoint requires OAuth (access token)
|
|
||||||
if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) {
|
|
||||||
$headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken();
|
|
||||||
}
|
|
||||||
|
|
||||||
// make the API Call
|
// make the API Call
|
||||||
try {
|
try {
|
||||||
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
|
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
|
||||||
@ -832,6 +832,11 @@ class PetApi
|
|||||||
$httpBody = $formParams; // for HTTP post (form)
|
$httpBody = $formParams; // for HTTP post (form)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// this endpoint requires OAuth (access token)
|
||||||
|
if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) {
|
||||||
|
$headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken();
|
||||||
|
}
|
||||||
|
|
||||||
// this endpoint requires API key authentication
|
// this endpoint requires API key authentication
|
||||||
$apiKey = $this->apiClient->getApiKeyWithPrefix('api_key');
|
$apiKey = $this->apiClient->getApiKeyWithPrefix('api_key');
|
||||||
if (strlen($apiKey) !== 0) {
|
if (strlen($apiKey) !== 0) {
|
||||||
@ -839,11 +844,6 @@ class PetApi
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// this endpoint requires OAuth (access token)
|
|
||||||
if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) {
|
|
||||||
$headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken();
|
|
||||||
}
|
|
||||||
|
|
||||||
// make the API Call
|
// make the API Call
|
||||||
try {
|
try {
|
||||||
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
|
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
|
||||||
|
@ -525,16 +525,16 @@ class StoreApi
|
|||||||
}
|
}
|
||||||
|
|
||||||
// this endpoint requires API key authentication
|
// this endpoint requires API key authentication
|
||||||
$apiKey = $this->apiClient->getApiKeyWithPrefix('test_api_key_header');
|
$apiKey = $this->apiClient->getApiKeyWithPrefix('test_api_key_query');
|
||||||
if (strlen($apiKey) !== 0) {
|
if (strlen($apiKey) !== 0) {
|
||||||
$headerParams['test_api_key_header'] = $apiKey;
|
$queryParams['test_api_key_query'] = $apiKey;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// this endpoint requires API key authentication
|
// this endpoint requires API key authentication
|
||||||
$apiKey = $this->apiClient->getApiKeyWithPrefix('test_api_key_query');
|
$apiKey = $this->apiClient->getApiKeyWithPrefix('test_api_key_header');
|
||||||
if (strlen($apiKey) !== 0) {
|
if (strlen($apiKey) !== 0) {
|
||||||
$queryParams['test_api_key_query'] = $apiKey;
|
$headerParams['test_api_key_header'] = $apiKey;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -0,0 +1,191 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Animal
|
||||||
|
*
|
||||||
|
* PHP version 5
|
||||||
|
*
|
||||||
|
* @category Class
|
||||||
|
* @package Swagger\Client
|
||||||
|
* @author http://github.com/swagger-api/swagger-codegen
|
||||||
|
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2
|
||||||
|
* @link https://github.com/swagger-api/swagger-codegen
|
||||||
|
*/
|
||||||
|
/**
|
||||||
|
* Copyright 2016 SmartBear Software
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
/**
|
||||||
|
* NOTE: This class is auto generated by the swagger code generator program.
|
||||||
|
* https://github.com/swagger-api/swagger-codegen
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Swagger\Client\Model;
|
||||||
|
|
||||||
|
use \ArrayAccess;
|
||||||
|
/**
|
||||||
|
* Animal Class Doc Comment
|
||||||
|
*
|
||||||
|
* @category Class
|
||||||
|
* @description
|
||||||
|
* @package Swagger\Client
|
||||||
|
* @author http://github.com/swagger-api/swagger-codegen
|
||||||
|
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2
|
||||||
|
* @link https://github.com/swagger-api/swagger-codegen
|
||||||
|
*/
|
||||||
|
class Animal implements ArrayAccess
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Array of property to type mappings. Used for (de)serialization
|
||||||
|
* @var string[]
|
||||||
|
*/
|
||||||
|
static $swaggerTypes = array(
|
||||||
|
'class_name' => 'string'
|
||||||
|
);
|
||||||
|
|
||||||
|
static function swaggerTypes() {
|
||||||
|
return self::$swaggerTypes;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Array of attributes where the key is the local name, and the value is the original name
|
||||||
|
* @var string[]
|
||||||
|
*/
|
||||||
|
static $attributeMap = array(
|
||||||
|
'class_name' => 'className'
|
||||||
|
);
|
||||||
|
|
||||||
|
static function attributeMap() {
|
||||||
|
return self::$attributeMap;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Array of attributes to setter functions (for deserialization of responses)
|
||||||
|
* @var string[]
|
||||||
|
*/
|
||||||
|
static $setters = array(
|
||||||
|
'class_name' => 'setClassName'
|
||||||
|
);
|
||||||
|
|
||||||
|
static function setters() {
|
||||||
|
return self::$setters;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Array of attributes to getter functions (for serialization of requests)
|
||||||
|
* @var string[]
|
||||||
|
*/
|
||||||
|
static $getters = array(
|
||||||
|
'class_name' => 'getClassName'
|
||||||
|
);
|
||||||
|
|
||||||
|
static function getters() {
|
||||||
|
return self::$getters;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* $class_name
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $class_name;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor
|
||||||
|
* @param mixed[] $data Associated array of property value initalizing the model
|
||||||
|
*/
|
||||||
|
public function __construct(array $data = null)
|
||||||
|
{
|
||||||
|
|
||||||
|
if ($data != null) {
|
||||||
|
$this->class_name = $data["class_name"];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets class_name
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getClassName()
|
||||||
|
{
|
||||||
|
return $this->class_name;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets class_name
|
||||||
|
* @param string $class_name
|
||||||
|
* @return $this
|
||||||
|
*/
|
||||||
|
public function setClassName($class_name)
|
||||||
|
{
|
||||||
|
|
||||||
|
$this->class_name = $class_name;
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns true if offset exists. False otherwise.
|
||||||
|
* @param integer $offset Offset
|
||||||
|
* @return boolean
|
||||||
|
*/
|
||||||
|
public function offsetExists($offset)
|
||||||
|
{
|
||||||
|
return isset($this->$offset);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets offset.
|
||||||
|
* @param integer $offset Offset
|
||||||
|
* @return mixed
|
||||||
|
*/
|
||||||
|
public function offsetGet($offset)
|
||||||
|
{
|
||||||
|
return $this->$offset;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets value based on offset.
|
||||||
|
* @param integer $offset Offset
|
||||||
|
* @param mixed $value Value to be set
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function offsetSet($offset, $value)
|
||||||
|
{
|
||||||
|
$this->$offset = $value;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Unsets offset.
|
||||||
|
* @param integer $offset Offset
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function offsetUnset($offset)
|
||||||
|
{
|
||||||
|
unset($this->$offset);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the string presentation of the object
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function __toString()
|
||||||
|
{
|
||||||
|
if (defined('JSON_PRETTY_PRINT')) {
|
||||||
|
return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT);
|
||||||
|
} else {
|
||||||
|
return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
191
samples/client/petstore/php/SwaggerClient-php/lib/Model/Cat.php
Normal file
191
samples/client/petstore/php/SwaggerClient-php/lib/Model/Cat.php
Normal file
@ -0,0 +1,191 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Cat
|
||||||
|
*
|
||||||
|
* PHP version 5
|
||||||
|
*
|
||||||
|
* @category Class
|
||||||
|
* @package Swagger\Client
|
||||||
|
* @author http://github.com/swagger-api/swagger-codegen
|
||||||
|
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2
|
||||||
|
* @link https://github.com/swagger-api/swagger-codegen
|
||||||
|
*/
|
||||||
|
/**
|
||||||
|
* Copyright 2016 SmartBear Software
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
/**
|
||||||
|
* NOTE: This class is auto generated by the swagger code generator program.
|
||||||
|
* https://github.com/swagger-api/swagger-codegen
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Swagger\Client\Model;
|
||||||
|
|
||||||
|
use \ArrayAccess;
|
||||||
|
/**
|
||||||
|
* Cat Class Doc Comment
|
||||||
|
*
|
||||||
|
* @category Class
|
||||||
|
* @description
|
||||||
|
* @package Swagger\Client
|
||||||
|
* @author http://github.com/swagger-api/swagger-codegen
|
||||||
|
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2
|
||||||
|
* @link https://github.com/swagger-api/swagger-codegen
|
||||||
|
*/
|
||||||
|
class Cat extends Animal implements ArrayAccess
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Array of property to type mappings. Used for (de)serialization
|
||||||
|
* @var string[]
|
||||||
|
*/
|
||||||
|
static $swaggerTypes = array(
|
||||||
|
'declawed' => 'bool'
|
||||||
|
);
|
||||||
|
|
||||||
|
static function swaggerTypes() {
|
||||||
|
return self::$swaggerTypes + parent::swaggerTypes();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Array of attributes where the key is the local name, and the value is the original name
|
||||||
|
* @var string[]
|
||||||
|
*/
|
||||||
|
static $attributeMap = array(
|
||||||
|
'declawed' => 'declawed'
|
||||||
|
);
|
||||||
|
|
||||||
|
static function attributeMap() {
|
||||||
|
return parent::attributeMap() + self::$attributeMap;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Array of attributes to setter functions (for deserialization of responses)
|
||||||
|
* @var string[]
|
||||||
|
*/
|
||||||
|
static $setters = array(
|
||||||
|
'declawed' => 'setDeclawed'
|
||||||
|
);
|
||||||
|
|
||||||
|
static function setters() {
|
||||||
|
return parent::setters() + self::$setters;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Array of attributes to getter functions (for serialization of requests)
|
||||||
|
* @var string[]
|
||||||
|
*/
|
||||||
|
static $getters = array(
|
||||||
|
'declawed' => 'getDeclawed'
|
||||||
|
);
|
||||||
|
|
||||||
|
static function getters() {
|
||||||
|
return parent::getters() + self::$getters;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* $declawed
|
||||||
|
* @var bool
|
||||||
|
*/
|
||||||
|
protected $declawed;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor
|
||||||
|
* @param mixed[] $data Associated array of property value initalizing the model
|
||||||
|
*/
|
||||||
|
public function __construct(array $data = null)
|
||||||
|
{
|
||||||
|
parent::__construct($data);
|
||||||
|
if ($data != null) {
|
||||||
|
$this->declawed = $data["declawed"];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets declawed
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public function getDeclawed()
|
||||||
|
{
|
||||||
|
return $this->declawed;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets declawed
|
||||||
|
* @param bool $declawed
|
||||||
|
* @return $this
|
||||||
|
*/
|
||||||
|
public function setDeclawed($declawed)
|
||||||
|
{
|
||||||
|
|
||||||
|
$this->declawed = $declawed;
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns true if offset exists. False otherwise.
|
||||||
|
* @param integer $offset Offset
|
||||||
|
* @return boolean
|
||||||
|
*/
|
||||||
|
public function offsetExists($offset)
|
||||||
|
{
|
||||||
|
return isset($this->$offset);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets offset.
|
||||||
|
* @param integer $offset Offset
|
||||||
|
* @return mixed
|
||||||
|
*/
|
||||||
|
public function offsetGet($offset)
|
||||||
|
{
|
||||||
|
return $this->$offset;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets value based on offset.
|
||||||
|
* @param integer $offset Offset
|
||||||
|
* @param mixed $value Value to be set
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function offsetSet($offset, $value)
|
||||||
|
{
|
||||||
|
$this->$offset = $value;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Unsets offset.
|
||||||
|
* @param integer $offset Offset
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function offsetUnset($offset)
|
||||||
|
{
|
||||||
|
unset($this->$offset);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the string presentation of the object
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function __toString()
|
||||||
|
{
|
||||||
|
if (defined('JSON_PRETTY_PRINT')) {
|
||||||
|
return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT);
|
||||||
|
} else {
|
||||||
|
return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -118,6 +118,7 @@ class Category implements ArrayAccess
|
|||||||
*/
|
*/
|
||||||
public function __construct(array $data = null)
|
public function __construct(array $data = null)
|
||||||
{
|
{
|
||||||
|
|
||||||
if ($data != null) {
|
if ($data != null) {
|
||||||
$this->id = $data["id"];
|
$this->id = $data["id"];
|
||||||
$this->name = $data["name"];
|
$this->name = $data["name"];
|
||||||
|
191
samples/client/petstore/php/SwaggerClient-php/lib/Model/Dog.php
Normal file
191
samples/client/petstore/php/SwaggerClient-php/lib/Model/Dog.php
Normal file
@ -0,0 +1,191 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Dog
|
||||||
|
*
|
||||||
|
* PHP version 5
|
||||||
|
*
|
||||||
|
* @category Class
|
||||||
|
* @package Swagger\Client
|
||||||
|
* @author http://github.com/swagger-api/swagger-codegen
|
||||||
|
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2
|
||||||
|
* @link https://github.com/swagger-api/swagger-codegen
|
||||||
|
*/
|
||||||
|
/**
|
||||||
|
* Copyright 2016 SmartBear Software
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
/**
|
||||||
|
* NOTE: This class is auto generated by the swagger code generator program.
|
||||||
|
* https://github.com/swagger-api/swagger-codegen
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Swagger\Client\Model;
|
||||||
|
|
||||||
|
use \ArrayAccess;
|
||||||
|
/**
|
||||||
|
* Dog Class Doc Comment
|
||||||
|
*
|
||||||
|
* @category Class
|
||||||
|
* @description
|
||||||
|
* @package Swagger\Client
|
||||||
|
* @author http://github.com/swagger-api/swagger-codegen
|
||||||
|
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2
|
||||||
|
* @link https://github.com/swagger-api/swagger-codegen
|
||||||
|
*/
|
||||||
|
class Dog extends Animal implements ArrayAccess
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Array of property to type mappings. Used for (de)serialization
|
||||||
|
* @var string[]
|
||||||
|
*/
|
||||||
|
static $swaggerTypes = array(
|
||||||
|
'breed' => 'string'
|
||||||
|
);
|
||||||
|
|
||||||
|
static function swaggerTypes() {
|
||||||
|
return self::$swaggerTypes + parent::swaggerTypes();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Array of attributes where the key is the local name, and the value is the original name
|
||||||
|
* @var string[]
|
||||||
|
*/
|
||||||
|
static $attributeMap = array(
|
||||||
|
'breed' => 'breed'
|
||||||
|
);
|
||||||
|
|
||||||
|
static function attributeMap() {
|
||||||
|
return parent::attributeMap() + self::$attributeMap;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Array of attributes to setter functions (for deserialization of responses)
|
||||||
|
* @var string[]
|
||||||
|
*/
|
||||||
|
static $setters = array(
|
||||||
|
'breed' => 'setBreed'
|
||||||
|
);
|
||||||
|
|
||||||
|
static function setters() {
|
||||||
|
return parent::setters() + self::$setters;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Array of attributes to getter functions (for serialization of requests)
|
||||||
|
* @var string[]
|
||||||
|
*/
|
||||||
|
static $getters = array(
|
||||||
|
'breed' => 'getBreed'
|
||||||
|
);
|
||||||
|
|
||||||
|
static function getters() {
|
||||||
|
return parent::getters() + self::$getters;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* $breed
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $breed;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor
|
||||||
|
* @param mixed[] $data Associated array of property value initalizing the model
|
||||||
|
*/
|
||||||
|
public function __construct(array $data = null)
|
||||||
|
{
|
||||||
|
parent::__construct($data);
|
||||||
|
if ($data != null) {
|
||||||
|
$this->breed = $data["breed"];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets breed
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getBreed()
|
||||||
|
{
|
||||||
|
return $this->breed;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets breed
|
||||||
|
* @param string $breed
|
||||||
|
* @return $this
|
||||||
|
*/
|
||||||
|
public function setBreed($breed)
|
||||||
|
{
|
||||||
|
|
||||||
|
$this->breed = $breed;
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns true if offset exists. False otherwise.
|
||||||
|
* @param integer $offset Offset
|
||||||
|
* @return boolean
|
||||||
|
*/
|
||||||
|
public function offsetExists($offset)
|
||||||
|
{
|
||||||
|
return isset($this->$offset);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets offset.
|
||||||
|
* @param integer $offset Offset
|
||||||
|
* @return mixed
|
||||||
|
*/
|
||||||
|
public function offsetGet($offset)
|
||||||
|
{
|
||||||
|
return $this->$offset;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets value based on offset.
|
||||||
|
* @param integer $offset Offset
|
||||||
|
* @param mixed $value Value to be set
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function offsetSet($offset, $value)
|
||||||
|
{
|
||||||
|
$this->$offset = $value;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Unsets offset.
|
||||||
|
* @param integer $offset Offset
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function offsetUnset($offset)
|
||||||
|
{
|
||||||
|
unset($this->$offset);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the string presentation of the object
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function __toString()
|
||||||
|
{
|
||||||
|
if (defined('JSON_PRETTY_PRINT')) {
|
||||||
|
return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT);
|
||||||
|
} else {
|
||||||
|
return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -51,12 +51,12 @@ class InlineResponse200 implements ArrayAccess
|
|||||||
* @var string[]
|
* @var string[]
|
||||||
*/
|
*/
|
||||||
static $swaggerTypes = array(
|
static $swaggerTypes = array(
|
||||||
'tags' => '\Swagger\Client\Model\Tag[]',
|
'photo_urls' => 'string[]',
|
||||||
|
'name' => 'string',
|
||||||
'id' => 'int',
|
'id' => 'int',
|
||||||
'category' => 'object',
|
'category' => 'object',
|
||||||
'status' => 'string',
|
'tags' => '\Swagger\Client\Model\Tag[]',
|
||||||
'name' => 'string',
|
'status' => 'string'
|
||||||
'photo_urls' => 'string[]'
|
|
||||||
);
|
);
|
||||||
|
|
||||||
static function swaggerTypes() {
|
static function swaggerTypes() {
|
||||||
@ -68,12 +68,12 @@ class InlineResponse200 implements ArrayAccess
|
|||||||
* @var string[]
|
* @var string[]
|
||||||
*/
|
*/
|
||||||
static $attributeMap = array(
|
static $attributeMap = array(
|
||||||
'tags' => 'tags',
|
'photo_urls' => 'photoUrls',
|
||||||
|
'name' => 'name',
|
||||||
'id' => 'id',
|
'id' => 'id',
|
||||||
'category' => 'category',
|
'category' => 'category',
|
||||||
'status' => 'status',
|
'tags' => 'tags',
|
||||||
'name' => 'name',
|
'status' => 'status'
|
||||||
'photo_urls' => 'photoUrls'
|
|
||||||
);
|
);
|
||||||
|
|
||||||
static function attributeMap() {
|
static function attributeMap() {
|
||||||
@ -85,12 +85,12 @@ class InlineResponse200 implements ArrayAccess
|
|||||||
* @var string[]
|
* @var string[]
|
||||||
*/
|
*/
|
||||||
static $setters = array(
|
static $setters = array(
|
||||||
'tags' => 'setTags',
|
'photo_urls' => 'setPhotoUrls',
|
||||||
|
'name' => 'setName',
|
||||||
'id' => 'setId',
|
'id' => 'setId',
|
||||||
'category' => 'setCategory',
|
'category' => 'setCategory',
|
||||||
'status' => 'setStatus',
|
'tags' => 'setTags',
|
||||||
'name' => 'setName',
|
'status' => 'setStatus'
|
||||||
'photo_urls' => 'setPhotoUrls'
|
|
||||||
);
|
);
|
||||||
|
|
||||||
static function setters() {
|
static function setters() {
|
||||||
@ -102,12 +102,12 @@ class InlineResponse200 implements ArrayAccess
|
|||||||
* @var string[]
|
* @var string[]
|
||||||
*/
|
*/
|
||||||
static $getters = array(
|
static $getters = array(
|
||||||
'tags' => 'getTags',
|
'photo_urls' => 'getPhotoUrls',
|
||||||
|
'name' => 'getName',
|
||||||
'id' => 'getId',
|
'id' => 'getId',
|
||||||
'category' => 'getCategory',
|
'category' => 'getCategory',
|
||||||
'status' => 'getStatus',
|
'tags' => 'getTags',
|
||||||
'name' => 'getName',
|
'status' => 'getStatus'
|
||||||
'photo_urls' => 'getPhotoUrls'
|
|
||||||
);
|
);
|
||||||
|
|
||||||
static function getters() {
|
static function getters() {
|
||||||
@ -116,10 +116,16 @@ class InlineResponse200 implements ArrayAccess
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* $tags
|
* $photo_urls
|
||||||
* @var \Swagger\Client\Model\Tag[]
|
* @var string[]
|
||||||
*/
|
*/
|
||||||
protected $tags;
|
protected $photo_urls;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* $name
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $name;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* $id
|
* $id
|
||||||
@ -133,24 +139,18 @@ class InlineResponse200 implements ArrayAccess
|
|||||||
*/
|
*/
|
||||||
protected $category;
|
protected $category;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* $tags
|
||||||
|
* @var \Swagger\Client\Model\Tag[]
|
||||||
|
*/
|
||||||
|
protected $tags;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* $status pet status in the store
|
* $status pet status in the store
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
protected $status;
|
protected $status;
|
||||||
|
|
||||||
/**
|
|
||||||
* $name
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
protected $name;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* $photo_urls
|
|
||||||
* @var string[]
|
|
||||||
*/
|
|
||||||
protected $photo_urls;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
@ -158,34 +158,56 @@ class InlineResponse200 implements ArrayAccess
|
|||||||
*/
|
*/
|
||||||
public function __construct(array $data = null)
|
public function __construct(array $data = null)
|
||||||
{
|
{
|
||||||
|
|
||||||
if ($data != null) {
|
if ($data != null) {
|
||||||
$this->tags = $data["tags"];
|
$this->photo_urls = $data["photo_urls"];
|
||||||
|
$this->name = $data["name"];
|
||||||
$this->id = $data["id"];
|
$this->id = $data["id"];
|
||||||
$this->category = $data["category"];
|
$this->category = $data["category"];
|
||||||
|
$this->tags = $data["tags"];
|
||||||
$this->status = $data["status"];
|
$this->status = $data["status"];
|
||||||
$this->name = $data["name"];
|
|
||||||
$this->photo_urls = $data["photo_urls"];
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets tags
|
* Gets photo_urls
|
||||||
* @return \Swagger\Client\Model\Tag[]
|
* @return string[]
|
||||||
*/
|
*/
|
||||||
public function getTags()
|
public function getPhotoUrls()
|
||||||
{
|
{
|
||||||
return $this->tags;
|
return $this->photo_urls;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets tags
|
* Sets photo_urls
|
||||||
* @param \Swagger\Client\Model\Tag[] $tags
|
* @param string[] $photo_urls
|
||||||
* @return $this
|
* @return $this
|
||||||
*/
|
*/
|
||||||
public function setTags($tags)
|
public function setPhotoUrls($photo_urls)
|
||||||
{
|
{
|
||||||
|
|
||||||
$this->tags = $tags;
|
$this->photo_urls = $photo_urls;
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets name
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getName()
|
||||||
|
{
|
||||||
|
return $this->name;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets name
|
||||||
|
* @param string $name
|
||||||
|
* @return $this
|
||||||
|
*/
|
||||||
|
public function setName($name)
|
||||||
|
{
|
||||||
|
|
||||||
|
$this->name = $name;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -231,6 +253,27 @@ class InlineResponse200 implements ArrayAccess
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets tags
|
||||||
|
* @return \Swagger\Client\Model\Tag[]
|
||||||
|
*/
|
||||||
|
public function getTags()
|
||||||
|
{
|
||||||
|
return $this->tags;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets tags
|
||||||
|
* @param \Swagger\Client\Model\Tag[] $tags
|
||||||
|
* @return $this
|
||||||
|
*/
|
||||||
|
public function setTags($tags)
|
||||||
|
{
|
||||||
|
|
||||||
|
$this->tags = $tags;
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets status
|
* Gets status
|
||||||
* @return string
|
* @return string
|
||||||
@ -255,48 +298,6 @@ class InlineResponse200 implements ArrayAccess
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets name
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public function getName()
|
|
||||||
{
|
|
||||||
return $this->name;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets name
|
|
||||||
* @param string $name
|
|
||||||
* @return $this
|
|
||||||
*/
|
|
||||||
public function setName($name)
|
|
||||||
{
|
|
||||||
|
|
||||||
$this->name = $name;
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets photo_urls
|
|
||||||
* @return string[]
|
|
||||||
*/
|
|
||||||
public function getPhotoUrls()
|
|
||||||
{
|
|
||||||
return $this->photo_urls;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets photo_urls
|
|
||||||
* @param string[] $photo_urls
|
|
||||||
* @return $this
|
|
||||||
*/
|
|
||||||
public function setPhotoUrls($photo_urls)
|
|
||||||
{
|
|
||||||
|
|
||||||
$this->photo_urls = $photo_urls;
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns true if offset exists. False otherwise.
|
* Returns true if offset exists. False otherwise.
|
||||||
* @param integer $offset Offset
|
* @param integer $offset Offset
|
||||||
|
@ -108,6 +108,7 @@ class Model200Response implements ArrayAccess
|
|||||||
*/
|
*/
|
||||||
public function __construct(array $data = null)
|
public function __construct(array $data = null)
|
||||||
{
|
{
|
||||||
|
|
||||||
if ($data != null) {
|
if ($data != null) {
|
||||||
$this->name = $data["name"];
|
$this->name = $data["name"];
|
||||||
}
|
}
|
||||||
|
@ -108,6 +108,7 @@ class ModelReturn implements ArrayAccess
|
|||||||
*/
|
*/
|
||||||
public function __construct(array $data = null)
|
public function __construct(array $data = null)
|
||||||
{
|
{
|
||||||
|
|
||||||
if ($data != null) {
|
if ($data != null) {
|
||||||
$this->return = $data["return"];
|
$this->return = $data["return"];
|
||||||
}
|
}
|
||||||
|
@ -118,6 +118,7 @@ class Name implements ArrayAccess
|
|||||||
*/
|
*/
|
||||||
public function __construct(array $data = null)
|
public function __construct(array $data = null)
|
||||||
{
|
{
|
||||||
|
|
||||||
if ($data != null) {
|
if ($data != null) {
|
||||||
$this->name = $data["name"];
|
$this->name = $data["name"];
|
||||||
$this->snake_case = $data["snake_case"];
|
$this->snake_case = $data["snake_case"];
|
||||||
|
@ -158,6 +158,7 @@ class Order implements ArrayAccess
|
|||||||
*/
|
*/
|
||||||
public function __construct(array $data = null)
|
public function __construct(array $data = null)
|
||||||
{
|
{
|
||||||
|
|
||||||
if ($data != null) {
|
if ($data != null) {
|
||||||
$this->id = $data["id"];
|
$this->id = $data["id"];
|
||||||
$this->pet_id = $data["pet_id"];
|
$this->pet_id = $data["pet_id"];
|
||||||
|
@ -158,6 +158,7 @@ class Pet implements ArrayAccess
|
|||||||
*/
|
*/
|
||||||
public function __construct(array $data = null)
|
public function __construct(array $data = null)
|
||||||
{
|
{
|
||||||
|
|
||||||
if ($data != null) {
|
if ($data != null) {
|
||||||
$this->id = $data["id"];
|
$this->id = $data["id"];
|
||||||
$this->category = $data["category"];
|
$this->category = $data["category"];
|
||||||
|
@ -108,6 +108,7 @@ class SpecialModelName implements ArrayAccess
|
|||||||
*/
|
*/
|
||||||
public function __construct(array $data = null)
|
public function __construct(array $data = null)
|
||||||
{
|
{
|
||||||
|
|
||||||
if ($data != null) {
|
if ($data != null) {
|
||||||
$this->special_property_name = $data["special_property_name"];
|
$this->special_property_name = $data["special_property_name"];
|
||||||
}
|
}
|
||||||
|
@ -118,6 +118,7 @@ class Tag implements ArrayAccess
|
|||||||
*/
|
*/
|
||||||
public function __construct(array $data = null)
|
public function __construct(array $data = null)
|
||||||
{
|
{
|
||||||
|
|
||||||
if ($data != null) {
|
if ($data != null) {
|
||||||
$this->id = $data["id"];
|
$this->id = $data["id"];
|
||||||
$this->name = $data["name"];
|
$this->name = $data["name"];
|
||||||
|
@ -178,6 +178,7 @@ class User implements ArrayAccess
|
|||||||
*/
|
*/
|
||||||
public function __construct(array $data = null)
|
public function __construct(array $data = null)
|
||||||
{
|
{
|
||||||
|
|
||||||
if ($data != null) {
|
if ($data != null) {
|
||||||
$this->id = $data["id"];
|
$this->id = $data["id"];
|
||||||
$this->username = $data["username"];
|
$this->username = $data["username"];
|
||||||
|
@ -257,7 +257,7 @@ class ObjectSerializer
|
|||||||
} else {
|
} else {
|
||||||
$deserialized = null;
|
$deserialized = null;
|
||||||
}
|
}
|
||||||
} elseif (in_array($class, array('integer', 'int', 'void', 'number', 'object', 'double', 'float', 'byte', 'DateTime', 'string', 'mixed', 'boolean', 'bool'))) {
|
} elseif (in_array($class, array('void', 'bool', 'string', 'double', 'byte', 'mixed', 'integer', 'float', 'int', 'DateTime', 'number', 'boolean', 'object'))) {
|
||||||
settype($data, $class);
|
settype($data, $class);
|
||||||
$deserialized = $data;
|
$deserialized = $data;
|
||||||
} elseif ($class === '\SplFileObject') {
|
} elseif ($class === '\SplFileObject') {
|
||||||
|
@ -0,0 +1,70 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* AnimalTest
|
||||||
|
*
|
||||||
|
* PHP version 5
|
||||||
|
*
|
||||||
|
* @category Class
|
||||||
|
* @package Swagger\Client
|
||||||
|
* @author http://github.com/swagger-api/swagger-codegen
|
||||||
|
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2
|
||||||
|
* @link https://github.com/swagger-api/swagger-codegen
|
||||||
|
*/
|
||||||
|
/**
|
||||||
|
* Copyright 2016 SmartBear Software
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
/**
|
||||||
|
* NOTE: This class is auto generated by the swagger code generator program.
|
||||||
|
* https://github.com/swagger-api/swagger-codegen
|
||||||
|
* Please update the test case below to test the model.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Swagger\Client\Model;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* AnimalTest Class Doc Comment
|
||||||
|
*
|
||||||
|
* @category Class
|
||||||
|
* @description
|
||||||
|
* @package Swagger\Client
|
||||||
|
* @author http://github.com/swagger-api/swagger-codegen
|
||||||
|
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2
|
||||||
|
* @link https://github.com/swagger-api/swagger-codegen
|
||||||
|
*/
|
||||||
|
class AnimalTest extends \PHPUnit_Framework_TestCase
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Setup before running each test case
|
||||||
|
*/
|
||||||
|
public static function setUpBeforeClass() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Clean up after running each test case
|
||||||
|
*/
|
||||||
|
public static function tearDownAfterClass() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test Animal
|
||||||
|
*/
|
||||||
|
public function testAnimal() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,70 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* CatTest
|
||||||
|
*
|
||||||
|
* PHP version 5
|
||||||
|
*
|
||||||
|
* @category Class
|
||||||
|
* @package Swagger\Client
|
||||||
|
* @author http://github.com/swagger-api/swagger-codegen
|
||||||
|
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2
|
||||||
|
* @link https://github.com/swagger-api/swagger-codegen
|
||||||
|
*/
|
||||||
|
/**
|
||||||
|
* Copyright 2016 SmartBear Software
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
/**
|
||||||
|
* NOTE: This class is auto generated by the swagger code generator program.
|
||||||
|
* https://github.com/swagger-api/swagger-codegen
|
||||||
|
* Please update the test case below to test the model.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Swagger\Client\Model;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* CatTest Class Doc Comment
|
||||||
|
*
|
||||||
|
* @category Class
|
||||||
|
* @description
|
||||||
|
* @package Swagger\Client
|
||||||
|
* @author http://github.com/swagger-api/swagger-codegen
|
||||||
|
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2
|
||||||
|
* @link https://github.com/swagger-api/swagger-codegen
|
||||||
|
*/
|
||||||
|
class CatTest extends \PHPUnit_Framework_TestCase
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Setup before running each test case
|
||||||
|
*/
|
||||||
|
public static function setUpBeforeClass() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Clean up after running each test case
|
||||||
|
*/
|
||||||
|
public static function tearDownAfterClass() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test Cat
|
||||||
|
*/
|
||||||
|
public function testCat() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,70 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* DogTest
|
||||||
|
*
|
||||||
|
* PHP version 5
|
||||||
|
*
|
||||||
|
* @category Class
|
||||||
|
* @package Swagger\Client
|
||||||
|
* @author http://github.com/swagger-api/swagger-codegen
|
||||||
|
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2
|
||||||
|
* @link https://github.com/swagger-api/swagger-codegen
|
||||||
|
*/
|
||||||
|
/**
|
||||||
|
* Copyright 2016 SmartBear Software
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
/**
|
||||||
|
* NOTE: This class is auto generated by the swagger code generator program.
|
||||||
|
* https://github.com/swagger-api/swagger-codegen
|
||||||
|
* Please update the test case below to test the model.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Swagger\Client\Model;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* DogTest Class Doc Comment
|
||||||
|
*
|
||||||
|
* @category Class
|
||||||
|
* @description
|
||||||
|
* @package Swagger\Client
|
||||||
|
* @author http://github.com/swagger-api/swagger-codegen
|
||||||
|
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2
|
||||||
|
* @link https://github.com/swagger-api/swagger-codegen
|
||||||
|
*/
|
||||||
|
class DogTest extends \PHPUnit_Framework_TestCase
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Setup before running each test case
|
||||||
|
*/
|
||||||
|
public static function setUpBeforeClass() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Clean up after running each test case
|
||||||
|
*/
|
||||||
|
public static function tearDownAfterClass() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test Dog
|
||||||
|
*/
|
||||||
|
public function testDog() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -375,6 +375,33 @@ class PetApiTest extends \PHPUnit_Framework_TestCase
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// test inheritance in the model
|
||||||
|
public function testInheritance()
|
||||||
|
{
|
||||||
|
$new_dog = new Swagger\Client\Model\Dog;
|
||||||
|
// the object should be an instance of the derived class
|
||||||
|
$this->assertInstanceOf('Swagger\Client\Model\Dog', $new_dog);
|
||||||
|
// the object should also be an instance of the parent class
|
||||||
|
$this->assertInstanceOf('Swagger\Client\Model\Animal', $new_dog);
|
||||||
|
}
|
||||||
|
|
||||||
|
// test inheritance constructor is working with data
|
||||||
|
// initialization
|
||||||
|
public function testInheritanceConstructorDataInitialization()
|
||||||
|
{
|
||||||
|
// initialize the object with data in the constructor
|
||||||
|
$data = array(
|
||||||
|
'class_name' => 'Dog',
|
||||||
|
'breed' => 'Great Dane'
|
||||||
|
);
|
||||||
|
$new_dog = new Swagger\Client\Model\Dog($data);
|
||||||
|
|
||||||
|
// the property on the derived class should be set
|
||||||
|
$this->assertSame('Great Dane', $new_dog->getBreed());
|
||||||
|
// the property on the parent class should be set
|
||||||
|
$this->assertSame('Dog', $new_dog->getClassName());
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user