diff --git a/modules/swagger-codegen/src/main/resources/htmlDocs2/index.mustache b/modules/swagger-codegen/src/main/resources/htmlDocs2/index.mustache index d2878b33492..89fbb662604 100644 --- a/modules/swagger-codegen/src/main/resources/htmlDocs2/index.mustache +++ b/modules/swagger-codegen/src/main/resources/htmlDocs2/index.mustache @@ -363,20 +363,21 @@ $(document).ready(function() { var schemaWrapper = {{{jsonSchema}}}; var schema = schemaWrapper.schema; - schemaWrapper.definitions = defs; - //console.log(JSON.stringify(schema)) - JsonRefs.resolveRefs(schemaWrapper, { - "depth": 3, - "resolveRemoteRefs": false, - "resolveFileRefs": false - }, function(err, resolved, metadata) { - //console.log(JSON.stringify(resolved)); - var view = new JSONSchemaView(resolved.schema, 3); - $('#responses-{{nickname}}-{{code}}-schema-data').val(JSON.stringify(resolved.schema)); - var result = $('#responses-{{nickname}}-{{code}}-schema-{{code}}'); - result.empty(); - result.append(view.render()); - }); + if (schema.$ref != null) { + schema = defsParser.$refs.get(schema.$ref); + } else { + schemaWrapper.definitions = Object.assign({}, defs); + $RefParser.dereference(schemaWrapper).catch(function(err) { + console.log(err); + }); + } + + //console.log(JSON.stringify(schema)); + var view = new JSONSchemaView(schema, 3); + $('#responses-{{nickname}}-{{code}}-schema-data').val(stringify(schema)); + var result = $('#responses-{{nickname}}-{{code}}-schema-{{code}}'); + result.empty(); + result.append(view.render()); }); @@ -448,8 +449,17 @@ {{>js_jsonformatter}} {{>js_jsonschemaview}} - {{>js_jsonref}} + {{>js_json_schema_ref_parser}} + {{>js_json_stringify_safe}} {{>js_webfontloader}} + diff --git a/modules/swagger-codegen/src/main/resources/htmlDocs2/js_json_stringify_safe.mustache b/modules/swagger-codegen/src/main/resources/htmlDocs2/js_json_stringify_safe.mustache new file mode 100644 index 00000000000..732823d76db --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/htmlDocs2/js_json_stringify_safe.mustache @@ -0,0 +1,27 @@ + diff --git a/modules/swagger-codegen/src/main/resources/htmlDocs2/js_jsonref.mustache b/modules/swagger-codegen/src/main/resources/htmlDocs2/js_jsonref.mustache deleted file mode 100644 index 406ba0003fc..00000000000 --- a/modules/swagger-codegen/src/main/resources/htmlDocs2/js_jsonref.mustache +++ /dev/null @@ -1,3 +0,0 @@ - diff --git a/modules/swagger-codegen/src/main/resources/htmlDocs2/paramB.mustache b/modules/swagger-codegen/src/main/resources/htmlDocs2/paramB.mustache index 03aa9ef4d43..7878337b74b 100644 --- a/modules/swagger-codegen/src/main/resources/htmlDocs2/paramB.mustache +++ b/modules/swagger-codegen/src/main/resources/htmlDocs2/paramB.mustache @@ -3,33 +3,24 @@ -
+ var view = new JSONSchemaView(schema,2,{isBodyParam: true}); + var result = $('#d2e199_{{nickname}}_{{paramName}}'); + result.empty(); + result.append(view.render()); +}); + + diff --git a/samples/html2/index.html b/samples/html2/index.html index cb667b55eb6..f4ce1aa2f63 100644 --- a/samples/html2/index.html +++ b/samples/html2/index.html @@ -1006,19 +1006,20 @@ margin-bottom: 20px;curl -X post "http://petstore.swagger.io/v2/pet"
+
+ curl -X post "http://petstore.swagger.io/v2/pet"
+
import io.swagger.client.*;
+
+ import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
-import io.swagger.client.api.PetApi;
+import .PetApi;
import java.io.File;
import java.util.*;
@@ -1041,11 +1042,14 @@ public class PetApiExample {
e.printStackTrace();
}
}
-}
+}
+
+
import io.swagger.client.api.PetApi;
+
+ import .PetApi;
public class PetApiExample {
@@ -1059,18 +1063,22 @@ public class PetApiExample {
e.printStackTrace();
}
}
-}
+}
+
+
Configuration *apiConfig = [Configuration sharedConfig];
+
+ Configuration *apiConfig = [Configuration sharedConfig];
// Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];
+
Pet *body = ; // Pet object that needs to be added to the store
PetApi *apiInstance = [[PetApi alloc] init];
@@ -1082,18 +1090,20 @@ PetApi *apiInstance = [[PetApi alloc] init];
NSLog(@"Error: %@", error);
}
}];
-
+
+
var SwaggerPetstore = require('swagger_petstore');
-var defaultClient = SwaggerPetstore.ApiClient.instance;
+
+ var = require('');
+var defaultClient = .ApiClient.instance;
// Configure OAuth2 access token for authorization: petstore_auth
var petstore_auth = defaultClient.authentications['petstore_auth'];
petstore_auth.accessToken = "YOUR ACCESS TOKEN"
-var api = new SwaggerPetstore.PetApi()
+var api = new .PetApi()
var body = ; // {Pet} Pet object that needs to be added to the store
@@ -1106,18 +1116,20 @@ var callback = function(error, data, response) {
}
};
api.addPet(body, callback);
-
+
+
using System;
+
+ using System;
using System.Diagnostics;
-using IO.Swagger.Api;
-using IO.Swagger.Client;
-using IO.Swagger.Model;
+using .Api;
+using .Client;
+using ;
namespace Example
{
@@ -1143,17 +1155,20 @@ namespace Example
}
}
}
-}
+}
+
+
<?php
+
+
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: petstore_auth
-Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
+io.swagger.client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
-$api_instance = new Swagger\Client\Api\PetApi();
+$api_instance = new io.swagger.client\Api\PetApi();
$body = ; // Pet | Pet object that needs to be added to the store
try {
@@ -1161,47 +1176,8 @@ try {
} catch (Exception $e) {
echo 'Exception when calling PetApi->addPet: ', $e->getMessage(), PHP_EOL;
}
-?>
-
use Data::Dumper;
-use WWW::SwaggerClient::Configuration;
-use WWW::SwaggerClient::PetApi;
-
-# Configure OAuth2 access token for authorization: petstore_auth
-$WWW::SwaggerClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';
-
-my $api_instance = WWW::SwaggerClient::PetApi->new();
-my $body = WWW::SwaggerClient::Object::Pet->new(); # Pet | Pet object that needs to be added to the store
-
-eval {
- $api_instance->addPet(body => $body);
-};
-if ($@) {
- warn "Exception when calling PetApi->addPet: $@\n";
-}
- from __future__ import print_statement
-import time
-import swagger_client
-from swagger_client.rest import ApiException
-from pprint import pprint
-
-# Configure OAuth2 access token for authorization: petstore_auth
-swagger_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'
-
-# create an instance of the API class
-api_instance = swagger_client.PetApi()
-body = # Pet | Pet object that needs to be added to the store
-
-try:
- # Add a new pet to the store
- api_instance.addPet(body)
-except ApiException as e:
- print("Exception when calling PetApi->addPet: %s\n" % e)
+
curl -X delete "http://petstore.swagger.io/v2/pet/{petId}"
+
+ curl -X delete "http://petstore.swagger.io/v2/pet/{petId}"
+
import io.swagger.client.*;
+
+ import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
-import io.swagger.client.api.PetApi;
+import .PetApi;
import java.io.File;
import java.util.*;
@@ -1337,11 +1308,14 @@ public class PetApiExample {
e.printStackTrace();
}
}
-}
+}
+
+
import io.swagger.client.api.PetApi;
+
+ import .PetApi;
public class PetApiExample {
@@ -1356,18 +1330,22 @@ public class PetApiExample {
e.printStackTrace();
}
}
-}
+}
+
+
Configuration *apiConfig = [Configuration sharedConfig];
+
+ Configuration *apiConfig = [Configuration sharedConfig];
// Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];
+
Long *petId = 789; // Pet id to delete
String *apiKey = apiKey_example; // (optional)
@@ -1381,18 +1359,20 @@ PetApi *apiInstance = [[PetApi alloc] init];
NSLog(@"Error: %@", error);
}
}];
-
+
+
var SwaggerPetstore = require('swagger_petstore');
-var defaultClient = SwaggerPetstore.ApiClient.instance;
+
+ var = require('');
+var defaultClient = .ApiClient.instance;
// Configure OAuth2 access token for authorization: petstore_auth
var petstore_auth = defaultClient.authentications['petstore_auth'];
petstore_auth.accessToken = "YOUR ACCESS TOKEN"
-var api = new SwaggerPetstore.PetApi()
+var api = new .PetApi()
var petId = 789; // {Long} Pet id to delete
@@ -1408,18 +1388,20 @@ var callback = function(error, data, response) {
}
};
api.deletePet(petId, opts, callback);
-
+
+
using System;
+
+ using System;
using System.Diagnostics;
-using IO.Swagger.Api;
-using IO.Swagger.Client;
-using IO.Swagger.Model;
+using .Api;
+using .Client;
+using ;
namespace Example
{
@@ -1446,17 +1428,20 @@ namespace Example
}
}
}
-}
+}
+
+
<?php
+
+
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: petstore_auth
-Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
+io.swagger.client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
-$api_instance = new Swagger\Client\Api\PetApi();
+$api_instance = new io.swagger.client\Api\PetApi();
$petId = 789; // Long | Pet id to delete
$apiKey = apiKey_example; // String |
@@ -1465,49 +1450,8 @@ try {
} catch (Exception $e) {
echo 'Exception when calling PetApi->deletePet: ', $e->getMessage(), PHP_EOL;
}
-?>
-
use Data::Dumper;
-use WWW::SwaggerClient::Configuration;
-use WWW::SwaggerClient::PetApi;
-
-# Configure OAuth2 access token for authorization: petstore_auth
-$WWW::SwaggerClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';
-
-my $api_instance = WWW::SwaggerClient::PetApi->new();
-my $petId = 789; # Long | Pet id to delete
-my $apiKey = apiKey_example; # String |
-
-eval {
- $api_instance->deletePet(petId => $petId, apiKey => $apiKey);
-};
-if ($@) {
- warn "Exception when calling PetApi->deletePet: $@\n";
-}
- from __future__ import print_statement
-import time
-import swagger_client
-from swagger_client.rest import ApiException
-from pprint import pprint
-
-# Configure OAuth2 access token for authorization: petstore_auth
-swagger_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'
-
-# create an instance of the API class
-api_instance = swagger_client.PetApi()
-petId = 789 # Long | Pet id to delete
-apiKey = apiKey_example # String | (optional)
-
-try:
- # Deletes a pet
- api_instance.deletePet(petId, apiKey=apiKey)
-except ApiException as e:
- print("Exception when calling PetApi->deletePet: %s\n" % e)
+
curl -X get "http://petstore.swagger.io/v2/pet/findByStatus?status="
+
+ curl -X get "http://petstore.swagger.io/v2/pet/findByStatus?status="
+
import io.swagger.client.*;
+
+ import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
-import io.swagger.client.api.PetApi;
+import .PetApi;
import java.io.File;
import java.util.*;
@@ -1672,11 +1611,14 @@ public class PetApiExample {
e.printStackTrace();
}
}
-}
+}
+
+
import io.swagger.client.api.PetApi;
+
+ import .PetApi;
public class PetApiExample {
@@ -1691,18 +1633,22 @@ public class PetApiExample {
e.printStackTrace();
}
}
-}
+}
+
+
Configuration *apiConfig = [Configuration sharedConfig];
+
+ Configuration *apiConfig = [Configuration sharedConfig];
// Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];
+
array[String] *status = ; // Status values that need to be considered for filter
PetApi *apiInstance = [[PetApi alloc] init];
@@ -1717,18 +1663,20 @@ PetApi *apiInstance = [[PetApi alloc] init];
NSLog(@"Error: %@", error);
}
}];
-
+
+
var SwaggerPetstore = require('swagger_petstore');
-var defaultClient = SwaggerPetstore.ApiClient.instance;
+
+ var = require('');
+var defaultClient = .ApiClient.instance;
// Configure OAuth2 access token for authorization: petstore_auth
var petstore_auth = defaultClient.authentications['petstore_auth'];
petstore_auth.accessToken = "YOUR ACCESS TOKEN"
-var api = new SwaggerPetstore.PetApi()
+var api = new .PetApi()
var status = ; // {array[String]} Status values that need to be considered for filter
@@ -1741,18 +1689,20 @@ var callback = function(error, data, response) {
}
};
api.findPetsByStatus(status, callback);
-
+
+
using System;
+
+ using System;
using System.Diagnostics;
-using IO.Swagger.Api;
-using IO.Swagger.Client;
-using IO.Swagger.Model;
+using .Api;
+using .Client;
+using ;
namespace Example
{
@@ -1779,17 +1729,20 @@ namespace Example
}
}
}
-}
+}
+
+
<?php
+
+
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: petstore_auth
-Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
+io.swagger.client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
-$api_instance = new Swagger\Client\Api\PetApi();
+$api_instance = new io.swagger.client\Api\PetApi();
$status = ; // array[String] | Status values that need to be considered for filter
try {
@@ -1798,49 +1751,8 @@ try {
} catch (Exception $e) {
echo 'Exception when calling PetApi->findPetsByStatus: ', $e->getMessage(), PHP_EOL;
}
-?>
-
use Data::Dumper;
-use WWW::SwaggerClient::Configuration;
-use WWW::SwaggerClient::PetApi;
-
-# Configure OAuth2 access token for authorization: petstore_auth
-$WWW::SwaggerClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';
-
-my $api_instance = WWW::SwaggerClient::PetApi->new();
-my $status = []; # array[String] | Status values that need to be considered for filter
-
-eval {
- my $result = $api_instance->findPetsByStatus(status => $status);
- print Dumper($result);
-};
-if ($@) {
- warn "Exception when calling PetApi->findPetsByStatus: $@\n";
-}
- from __future__ import print_statement
-import time
-import swagger_client
-from swagger_client.rest import ApiException
-from pprint import pprint
-
-# Configure OAuth2 access token for authorization: petstore_auth
-swagger_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'
-
-# create an instance of the API class
-api_instance = swagger_client.PetApi()
-status = # array[String] | Status values that need to be considered for filter
-
-try:
- # Finds Pets by status
- api_response = api_instance.findPetsByStatus(status)
- pprint(api_response)
-except ApiException as e:
- print("Exception when calling PetApi->findPetsByStatus: %s\n" % e)
+
curl -X get "http://petstore.swagger.io/v2/pet/findByTags?tags="
+
+ curl -X get "http://petstore.swagger.io/v2/pet/findByTags?tags="
+
import io.swagger.client.*;
+
+ import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
-import io.swagger.client.api.PetApi;
+import .PetApi;
import java.io.File;
import java.util.*;
@@ -2016,11 +1923,14 @@ public class PetApiExample {
e.printStackTrace();
}
}
-}
+}
+
+
import io.swagger.client.api.PetApi;
+
+ import .PetApi;
public class PetApiExample {
@@ -2035,18 +1945,22 @@ public class PetApiExample {
e.printStackTrace();
}
}
-}
+}
+
+
Configuration *apiConfig = [Configuration sharedConfig];
+
+ Configuration *apiConfig = [Configuration sharedConfig];
// Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];
+
array[String] *tags = ; // Tags to filter by
PetApi *apiInstance = [[PetApi alloc] init];
@@ -2061,18 +1975,20 @@ PetApi *apiInstance = [[PetApi alloc] init];
NSLog(@"Error: %@", error);
}
}];
-
+
+
var SwaggerPetstore = require('swagger_petstore');
-var defaultClient = SwaggerPetstore.ApiClient.instance;
+
+ var = require('');
+var defaultClient = .ApiClient.instance;
// Configure OAuth2 access token for authorization: petstore_auth
var petstore_auth = defaultClient.authentications['petstore_auth'];
petstore_auth.accessToken = "YOUR ACCESS TOKEN"
-var api = new SwaggerPetstore.PetApi()
+var api = new .PetApi()
var tags = ; // {array[String]} Tags to filter by
@@ -2085,18 +2001,20 @@ var callback = function(error, data, response) {
}
};
api.findPetsByTags(tags, callback);
-
+
+
using System;
+
+ using System;
using System.Diagnostics;
-using IO.Swagger.Api;
-using IO.Swagger.Client;
-using IO.Swagger.Model;
+using .Api;
+using .Client;
+using ;
namespace Example
{
@@ -2123,17 +2041,20 @@ namespace Example
}
}
}
-}
+}
+
+
<?php
+
+
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: petstore_auth
-Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
+io.swagger.client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
-$api_instance = new Swagger\Client\Api\PetApi();
+$api_instance = new io.swagger.client\Api\PetApi();
$tags = ; // array[String] | Tags to filter by
try {
@@ -2142,49 +2063,8 @@ try {
} catch (Exception $e) {
echo 'Exception when calling PetApi->findPetsByTags: ', $e->getMessage(), PHP_EOL;
}
-?>
-
use Data::Dumper;
-use WWW::SwaggerClient::Configuration;
-use WWW::SwaggerClient::PetApi;
-
-# Configure OAuth2 access token for authorization: petstore_auth
-$WWW::SwaggerClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';
-
-my $api_instance = WWW::SwaggerClient::PetApi->new();
-my $tags = []; # array[String] | Tags to filter by
-
-eval {
- my $result = $api_instance->findPetsByTags(tags => $tags);
- print Dumper($result);
-};
-if ($@) {
- warn "Exception when calling PetApi->findPetsByTags: $@\n";
-}
- from __future__ import print_statement
-import time
-import swagger_client
-from swagger_client.rest import ApiException
-from pprint import pprint
-
-# Configure OAuth2 access token for authorization: petstore_auth
-swagger_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'
-
-# create an instance of the API class
-api_instance = swagger_client.PetApi()
-tags = # array[String] | Tags to filter by
-
-try:
- # Finds Pets by tags
- api_response = api_instance.findPetsByTags(tags)
- pprint(api_response)
-except ApiException as e:
- print("Exception when calling PetApi->findPetsByTags: %s\n" % e)
+
curl -X get -H "api_key: [[apiKey]]" "http://petstore.swagger.io/v2/pet/{petId}"
+
+ curl -X get -H "api_key: [[apiKey]]" "http://petstore.swagger.io/v2/pet/{petId}"
+
import io.swagger.client.*;
+
+ import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
-import io.swagger.client.api.PetApi;
+import .PetApi;
import java.io.File;
import java.util.*;
@@ -2360,11 +2235,14 @@ public class PetApiExample {
e.printStackTrace();
}
}
-}
+}
+
+
import io.swagger.client.api.PetApi;
+
+ import .PetApi;
public class PetApiExample {
@@ -2379,20 +2257,24 @@ public class PetApiExample {
e.printStackTrace();
}
}
-}
+}
+
+
Configuration *apiConfig = [Configuration sharedConfig];
+
+ Configuration *apiConfig = [Configuration sharedConfig];
// Configure API key authorization: (authentication scheme: api_key)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"api_key"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"api_key"];
+
Long *petId = 789; // ID of pet to return
PetApi *apiInstance = [[PetApi alloc] init];
@@ -2407,12 +2289,14 @@ PetApi *apiInstance = [[PetApi alloc] init];
NSLog(@"Error: %@", error);
}
}];
-
+
+
var SwaggerPetstore = require('swagger_petstore');
-var defaultClient = SwaggerPetstore.ApiClient.instance;
+
+ var = require('');
+var defaultClient = .ApiClient.instance;
// Configure API key authorization: api_key
var api_key = defaultClient.authentications['api_key'];
@@ -2420,7 +2304,7 @@ api_key.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.apiKeyPrefix['api_key'] = "Token"
-var api = new SwaggerPetstore.PetApi()
+var api = new .PetApi()
var petId = 789; // {Long} ID of pet to return
@@ -2433,18 +2317,20 @@ var callback = function(error, data, response) {
}
};
api.getPetById(petId, callback);
-
+
+
using System;
+
+ using System;
using System.Diagnostics;
-using IO.Swagger.Api;
-using IO.Swagger.Client;
-using IO.Swagger.Model;
+using .Api;
+using .Client;
+using ;
namespace Example
{
@@ -2473,19 +2359,22 @@ namespace Example
}
}
}
-}
+}
+
+
<?php
+
+
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: api_key
-Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('api_key', 'YOUR_API_KEY');
+io.swagger.client\Configuration::getDefaultConfiguration()->setApiKey('api_key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api_key', 'Bearer');
+// io.swagger.client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api_key', 'Bearer');
-$api_instance = new Swagger\Client\Api\PetApi();
+$api_instance = new io.swagger.client\Api\PetApi();
$petId = 789; // Long | ID of pet to return
try {
@@ -2494,53 +2383,8 @@ try {
} catch (Exception $e) {
echo 'Exception when calling PetApi->getPetById: ', $e->getMessage(), PHP_EOL;
}
-?>
-
use Data::Dumper;
-use WWW::SwaggerClient::Configuration;
-use WWW::SwaggerClient::PetApi;
-
-# Configure API key authorization: api_key
-$WWW::SwaggerClient::Configuration::api_key->{'api_key'} = 'YOUR_API_KEY';
-# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-#$WWW::SwaggerClient::Configuration::api_key_prefix->{'api_key'} = "Bearer";
-
-my $api_instance = WWW::SwaggerClient::PetApi->new();
-my $petId = 789; # Long | ID of pet to return
-
-eval {
- my $result = $api_instance->getPetById(petId => $petId);
- print Dumper($result);
-};
-if ($@) {
- warn "Exception when calling PetApi->getPetById: $@\n";
-}
- from __future__ import print_statement
-import time
-import swagger_client
-from swagger_client.rest import ApiException
-from pprint import pprint
-
-# Configure API key authorization: api_key
-swagger_client.configuration.api_key['api_key'] = 'YOUR_API_KEY'
-# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-# swagger_client.configuration.api_key_prefix['api_key'] = 'Bearer'
-
-# create an instance of the API class
-api_instance = swagger_client.PetApi()
-petId = 789 # Long | ID of pet to return
-
-try:
- # Find pet by ID
- api_response = api_instance.getPetById(petId)
- pprint(api_response)
-except ApiException as e:
- print("Exception when calling PetApi->getPetById: %s\n" % e)
+
curl -X put "http://petstore.swagger.io/v2/pet"
+
+ curl -X put "http://petstore.swagger.io/v2/pet"
+
import io.swagger.client.*;
+
+ import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
-import io.swagger.client.api.PetApi;
+import .PetApi;
import java.io.File;
import java.util.*;
@@ -2715,11 +2548,14 @@ public class PetApiExample {
e.printStackTrace();
}
}
-}
+}
+
+
import io.swagger.client.api.PetApi;
+
+ import .PetApi;
public class PetApiExample {
@@ -2733,18 +2569,22 @@ public class PetApiExample {
e.printStackTrace();
}
}
-}
+}
+
+
Configuration *apiConfig = [Configuration sharedConfig];
+
+ Configuration *apiConfig = [Configuration sharedConfig];
// Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];
+
Pet *body = ; // Pet object that needs to be added to the store
PetApi *apiInstance = [[PetApi alloc] init];
@@ -2756,18 +2596,20 @@ PetApi *apiInstance = [[PetApi alloc] init];
NSLog(@"Error: %@", error);
}
}];
-
+
+
var SwaggerPetstore = require('swagger_petstore');
-var defaultClient = SwaggerPetstore.ApiClient.instance;
+
+ var = require('');
+var defaultClient = .ApiClient.instance;
// Configure OAuth2 access token for authorization: petstore_auth
var petstore_auth = defaultClient.authentications['petstore_auth'];
petstore_auth.accessToken = "YOUR ACCESS TOKEN"
-var api = new SwaggerPetstore.PetApi()
+var api = new .PetApi()
var body = ; // {Pet} Pet object that needs to be added to the store
@@ -2780,18 +2622,20 @@ var callback = function(error, data, response) {
}
};
api.updatePet(body, callback);
-
+
+
using System;
+
+ using System;
using System.Diagnostics;
-using IO.Swagger.Api;
-using IO.Swagger.Client;
-using IO.Swagger.Model;
+using .Api;
+using .Client;
+using ;
namespace Example
{
@@ -2817,17 +2661,20 @@ namespace Example
}
}
}
-}
+}
+
+
<?php
+
+
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: petstore_auth
-Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
+io.swagger.client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
-$api_instance = new Swagger\Client\Api\PetApi();
+$api_instance = new io.swagger.client\Api\PetApi();
$body = ; // Pet | Pet object that needs to be added to the store
try {
@@ -2835,47 +2682,8 @@ try {
} catch (Exception $e) {
echo 'Exception when calling PetApi->updatePet: ', $e->getMessage(), PHP_EOL;
}
-?>
-
use Data::Dumper;
-use WWW::SwaggerClient::Configuration;
-use WWW::SwaggerClient::PetApi;
-
-# Configure OAuth2 access token for authorization: petstore_auth
-$WWW::SwaggerClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';
-
-my $api_instance = WWW::SwaggerClient::PetApi->new();
-my $body = WWW::SwaggerClient::Object::Pet->new(); # Pet | Pet object that needs to be added to the store
-
-eval {
- $api_instance->updatePet(body => $body);
-};
-if ($@) {
- warn "Exception when calling PetApi->updatePet: $@\n";
-}
- from __future__ import print_statement
-import time
-import swagger_client
-from swagger_client.rest import ApiException
-from pprint import pprint
-
-# Configure OAuth2 access token for authorization: petstore_auth
-swagger_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'
-
-# create an instance of the API class
-api_instance = swagger_client.PetApi()
-body = # Pet | Pet object that needs to be added to the store
-
-try:
- # Update an existing pet
- api_instance.updatePet(body)
-except ApiException as e:
- print("Exception when calling PetApi->updatePet: %s\n" % e)
+
curl -X post "http://petstore.swagger.io/v2/pet/{petId}"
+
+ curl -X post "http://petstore.swagger.io/v2/pet/{petId}"
+
import io.swagger.client.*;
+
+ import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
-import io.swagger.client.api.PetApi;
+import .PetApi;
import java.io.File;
import java.util.*;
@@ -3028,11 +2819,14 @@ public class PetApiExample {
e.printStackTrace();
}
}
-}
+}
+
+
import io.swagger.client.api.PetApi;
+
+ import .PetApi;
public class PetApiExample {
@@ -3048,18 +2842,22 @@ public class PetApiExample {
e.printStackTrace();
}
}
-}
+}
+
+
Configuration *apiConfig = [Configuration sharedConfig];
+
+ Configuration *apiConfig = [Configuration sharedConfig];
// Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];
+
Long *petId = 789; // ID of pet that needs to be updated
String *name = name_example; // Updated name of the pet (optional)
String *status = status_example; // Updated status of the pet (optional)
@@ -3075,18 +2873,20 @@ PetApi *apiInstance = [[PetApi alloc] init];
NSLog(@"Error: %@", error);
}
}];
-
+
+
var SwaggerPetstore = require('swagger_petstore');
-var defaultClient = SwaggerPetstore.ApiClient.instance;
+
+ var = require('');
+var defaultClient = .ApiClient.instance;
// Configure OAuth2 access token for authorization: petstore_auth
var petstore_auth = defaultClient.authentications['petstore_auth'];
petstore_auth.accessToken = "YOUR ACCESS TOKEN"
-var api = new SwaggerPetstore.PetApi()
+var api = new .PetApi()
var petId = 789; // {Long} ID of pet that needs to be updated
@@ -3103,18 +2903,20 @@ var callback = function(error, data, response) {
}
};
api.updatePetWithForm(petId, opts, callback);
-
+
+
using System;
+
+ using System;
using System.Diagnostics;
-using IO.Swagger.Api;
-using IO.Swagger.Client;
-using IO.Swagger.Model;
+using .Api;
+using .Client;
+using ;
namespace Example
{
@@ -3142,17 +2944,20 @@ namespace Example
}
}
}
-}
+}
+
+
<?php
+
+
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: petstore_auth
-Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
+io.swagger.client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
-$api_instance = new Swagger\Client\Api\PetApi();
+$api_instance = new io.swagger.client\Api\PetApi();
$petId = 789; // Long | ID of pet that needs to be updated
$name = name_example; // String | Updated name of the pet
$status = status_example; // String | Updated status of the pet
@@ -3162,51 +2967,8 @@ try {
} catch (Exception $e) {
echo 'Exception when calling PetApi->updatePetWithForm: ', $e->getMessage(), PHP_EOL;
}
-?>
-
use Data::Dumper;
-use WWW::SwaggerClient::Configuration;
-use WWW::SwaggerClient::PetApi;
-
-# Configure OAuth2 access token for authorization: petstore_auth
-$WWW::SwaggerClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';
-
-my $api_instance = WWW::SwaggerClient::PetApi->new();
-my $petId = 789; # Long | ID of pet that needs to be updated
-my $name = name_example; # String | Updated name of the pet
-my $status = status_example; # String | Updated status of the pet
-
-eval {
- $api_instance->updatePetWithForm(petId => $petId, name => $name, status => $status);
-};
-if ($@) {
- warn "Exception when calling PetApi->updatePetWithForm: $@\n";
-}
- from __future__ import print_statement
-import time
-import swagger_client
-from swagger_client.rest import ApiException
-from pprint import pprint
-
-# Configure OAuth2 access token for authorization: petstore_auth
-swagger_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'
-
-# create an instance of the API class
-api_instance = swagger_client.PetApi()
-petId = 789 # Long | ID of pet that needs to be updated
-name = name_example # String | Updated name of the pet (optional)
-status = status_example # String | Updated status of the pet (optional)
-
-try:
- # Updates a pet in the store with form data
- api_instance.updatePetWithForm(petId, name=name, status=status)
-except ApiException as e:
- print("Exception when calling PetApi->updatePetWithForm: %s\n" % e)
+
curl -X post "http://petstore.swagger.io/v2/pet/{petId}/uploadImage"
+
+ curl -X post "http://petstore.swagger.io/v2/pet/{petId}/uploadImage"
+
import io.swagger.client.*;
+
+ import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
-import io.swagger.client.api.PetApi;
+import .PetApi;
import java.io.File;
import java.util.*;
@@ -3398,7 +3155,7 @@ public class PetApiExample {
PetApi apiInstance = new PetApi();
Long petId = 789; // Long | ID of pet to update
String additionalMetadata = additionalMetadata_example; // String | Additional data to pass to server
- File file = /path/to/file.txt; // File | file to upload
+ file file = /path/to/file.txt; // file | file to upload
try {
ApiResponse result = apiInstance.uploadFile(petId, additionalMetadata, file);
System.out.println(result);
@@ -3407,11 +3164,14 @@ public class PetApiExample {
e.printStackTrace();
}
}
-}
+}
+
+
import io.swagger.client.api.PetApi;
+
+ import .PetApi;
public class PetApiExample {
@@ -3419,7 +3179,7 @@ public class PetApiExample {
PetApi apiInstance = new PetApi();
Long petId = 789; // Long | ID of pet to update
String additionalMetadata = additionalMetadata_example; // String | Additional data to pass to server
- File file = /path/to/file.txt; // File | file to upload
+ file file = /path/to/file.txt; // file | file to upload
try {
ApiResponse result = apiInstance.uploadFile(petId, additionalMetadata, file);
System.out.println(result);
@@ -3428,21 +3188,25 @@ public class PetApiExample {
e.printStackTrace();
}
}
-}
+}
+
+
Configuration *apiConfig = [Configuration sharedConfig];
+
+ Configuration *apiConfig = [Configuration sharedConfig];
// Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];
+
Long *petId = 789; // ID of pet to update
String *additionalMetadata = additionalMetadata_example; // Additional data to pass to server (optional)
-File *file = /path/to/file.txt; // file to upload (optional)
+file *file = /path/to/file.txt; // file to upload (optional)
PetApi *apiInstance = [[PetApi alloc] init];
@@ -3458,24 +3222,26 @@ PetApi *apiInstance = [[PetApi alloc] init];
NSLog(@"Error: %@", error);
}
}];
-
+
+
var SwaggerPetstore = require('swagger_petstore');
-var defaultClient = SwaggerPetstore.ApiClient.instance;
+
+ var = require('');
+var defaultClient = .ApiClient.instance;
// Configure OAuth2 access token for authorization: petstore_auth
var petstore_auth = defaultClient.authentications['petstore_auth'];
petstore_auth.accessToken = "YOUR ACCESS TOKEN"
-var api = new SwaggerPetstore.PetApi()
+var api = new .PetApi()
var petId = 789; // {Long} ID of pet to update
var opts = {
'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
};
var callback = function(error, data, response) {
@@ -3486,18 +3252,20 @@ var callback = function(error, data, response) {
}
};
api.uploadFile(petId, opts, callback);
-
+
+
using System;
+
+ using System;
using System.Diagnostics;
-using IO.Swagger.Api;
-using IO.Swagger.Client;
-using IO.Swagger.Model;
+using .Api;
+using .Client;
+using ;
namespace Example
{
@@ -3512,7 +3280,7 @@ namespace Example
var apiInstance = new PetApi();
var petId = 789; // Long | ID of pet to update
var additionalMetadata = additionalMetadata_example; // String | Additional data to pass to server (optional)
- var file = new File(); // File | file to upload (optional)
+ var file = new file(); // file | file to upload (optional)
try
{
@@ -3526,20 +3294,23 @@ namespace Example
}
}
}
-}
+}
+
+
<?php
+
+
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: petstore_auth
-Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
+io.swagger.client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
-$api_instance = new Swagger\Client\Api\PetApi();
+$api_instance = new io.swagger.client\Api\PetApi();
$petId = 789; // Long | ID of pet to update
$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
try {
$result = $api_instance->uploadFile($petId, $additionalMetadata, $file);
@@ -3547,53 +3318,8 @@ try {
} catch (Exception $e) {
echo 'Exception when calling PetApi->uploadFile: ', $e->getMessage(), PHP_EOL;
}
-?>
-
use Data::Dumper;
-use WWW::SwaggerClient::Configuration;
-use WWW::SwaggerClient::PetApi;
-
-# Configure OAuth2 access token for authorization: petstore_auth
-$WWW::SwaggerClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';
-
-my $api_instance = WWW::SwaggerClient::PetApi->new();
-my $petId = 789; # Long | ID of pet to update
-my $additionalMetadata = additionalMetadata_example; # String | Additional data to pass to server
-my $file = /path/to/file.txt; # File | file to upload
-
-eval {
- my $result = $api_instance->uploadFile(petId => $petId, additionalMetadata => $additionalMetadata, file => $file);
- print Dumper($result);
-};
-if ($@) {
- warn "Exception when calling PetApi->uploadFile: $@\n";
-}
- from __future__ import print_statement
-import time
-import swagger_client
-from swagger_client.rest import ApiException
-from pprint import pprint
-
-# Configure OAuth2 access token for authorization: petstore_auth
-swagger_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'
-
-# create an instance of the API class
-api_instance = swagger_client.PetApi()
-petId = 789 # Long | ID of pet to update
-additionalMetadata = additionalMetadata_example # String | Additional data to pass to server (optional)
-file = /path/to/file.txt # File | file to upload (optional)
-
-try:
- # uploads an image
- api_response = api_instance.uploadFile(petId, additionalMetadata=additionalMetadata, file=file)
- pprint(api_response)
-except ApiException as e:
- print("Exception when calling PetApi->uploadFile: %s\n" % e)
+
curl -X delete "http://petstore.swagger.io/v2/store/order/{orderId}"
+
+ curl -X delete "http://petstore.swagger.io/v2/store/order/{orderId}"
+
import io.swagger.client.*;
+
+ import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
-import io.swagger.client.api.StoreApi;
+import .StoreApi;
import java.io.File;
import java.util.*;
@@ -3823,11 +3550,14 @@ public class StoreApiExample {
e.printStackTrace();
}
}
-}
+}
+
+
import io.swagger.client.api.StoreApi;
+
+ import .StoreApi;
public class StoreApiExample {
@@ -3841,14 +3571,18 @@ public class StoreApiExample {
e.printStackTrace();
}
}
-}
+}
+
+
String *orderId = orderId_example; // ID of the order that needs to be deleted
+
+
+String *orderId = orderId_example; // ID of the order that needs to be deleted
StoreApi *apiInstance = [[StoreApi alloc] init];
@@ -3859,13 +3593,15 @@ StoreApi *apiInstance = [[StoreApi alloc] init];
NSLog(@"Error: %@", error);
}
}];
-
+
+
var SwaggerPetstore = require('swagger_petstore');
+
+ var = require('');
-var api = new SwaggerPetstore.StoreApi()
+var api = new .StoreApi()
var orderId = orderId_example; // {String} ID of the order that needs to be deleted
@@ -3878,18 +3614,20 @@ var callback = function(error, data, response) {
}
};
api.deleteOrder(orderId, callback);
-
+
+
using System;
+
+ using System;
using System.Diagnostics;
-using IO.Swagger.Api;
-using IO.Swagger.Client;
-using IO.Swagger.Model;
+using .Api;
+using .Client;
+using ;
namespace Example
{
@@ -3912,14 +3650,17 @@ namespace Example
}
}
}
-}
+}
+
+
<?php
+
+
require_once(__DIR__ . '/vendor/autoload.php');
-$api_instance = new Swagger\Client\Api\StoreApi();
+$api_instance = new io.swagger.client\Api\StoreApi();
$orderId = orderId_example; // String | ID of the order that needs to be deleted
try {
@@ -3927,41 +3668,8 @@ try {
} catch (Exception $e) {
echo 'Exception when calling StoreApi->deleteOrder: ', $e->getMessage(), PHP_EOL;
}
-?>
-
use Data::Dumper;
-use WWW::SwaggerClient::Configuration;
-use WWW::SwaggerClient::StoreApi;
-
-my $api_instance = WWW::SwaggerClient::StoreApi->new();
-my $orderId = orderId_example; # String | ID of the order that needs to be deleted
-
-eval {
- $api_instance->deleteOrder(orderId => $orderId);
-};
-if ($@) {
- warn "Exception when calling StoreApi->deleteOrder: $@\n";
-}
- from __future__ import print_statement
-import time
-import swagger_client
-from swagger_client.rest import ApiException
-from pprint import pprint
-
-# create an instance of the API class
-api_instance = swagger_client.StoreApi()
-orderId = orderId_example # String | ID of the order that needs to be deleted
-
-try:
- # Delete purchase order by ID
- api_instance.deleteOrder(orderId)
-except ApiException as e:
- print("Exception when calling StoreApi->deleteOrder: %s\n" % e)
+
curl -X get -H "api_key: [[apiKey]]" "http://petstore.swagger.io/v2/store/inventory"
+
+ curl -X get -H "api_key: [[apiKey]]" "http://petstore.swagger.io/v2/store/inventory"
+
import io.swagger.client.*;
+
+ import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
-import io.swagger.client.api.StoreApi;
+import .StoreApi;
import java.io.File;
import java.util.*;
@@ -4095,11 +3792,14 @@ public class StoreApiExample {
e.printStackTrace();
}
}
-}
+}
+
+
import io.swagger.client.api.StoreApi;
+
+ import .StoreApi;
public class StoreApiExample {
@@ -4113,14 +3813,17 @@ public class StoreApiExample {
e.printStackTrace();
}
}
-}
+}
+
+
Configuration *apiConfig = [Configuration sharedConfig];
+
+ Configuration *apiConfig = [Configuration sharedConfig];
// Configure API key authorization: (authentication scheme: api_key)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"api_key"];
@@ -4128,6 +3831,7 @@ public class StoreApiExample {
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"api_key"];
+
StoreApi *apiInstance = [[StoreApi alloc] init];
// Returns pet inventories by status
@@ -4140,12 +3844,14 @@ StoreApi *apiInstance = [[StoreApi alloc] init];
NSLog(@"Error: %@", error);
}
}];
-
+
+
var SwaggerPetstore = require('swagger_petstore');
-var defaultClient = SwaggerPetstore.ApiClient.instance;
+
+ var = require('');
+var defaultClient = .ApiClient.instance;
// Configure API key authorization: api_key
var api_key = defaultClient.authentications['api_key'];
@@ -4153,7 +3859,7 @@ api_key.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.apiKeyPrefix['api_key'] = "Token"
-var api = new SwaggerPetstore.StoreApi()
+var api = new .StoreApi()
var callback = function(error, data, response) {
if (error) {
@@ -4163,18 +3869,20 @@ var callback = function(error, data, response) {
}
};
api.getInventory(callback);
-
+
+
using System;
+
+ using System;
using System.Diagnostics;
-using IO.Swagger.Api;
-using IO.Swagger.Client;
-using IO.Swagger.Model;
+using .Api;
+using .Client;
+using ;
namespace Example
{
@@ -4202,19 +3910,22 @@ namespace Example
}
}
}
-}
+}
+
+
<?php
+
+
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: api_key
-Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('api_key', 'YOUR_API_KEY');
+io.swagger.client\Configuration::getDefaultConfiguration()->setApiKey('api_key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api_key', 'Bearer');
+// io.swagger.client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api_key', 'Bearer');
-$api_instance = new Swagger\Client\Api\StoreApi();
+$api_instance = new io.swagger.client\Api\StoreApi();
try {
$result = $api_instance->getInventory();
@@ -4222,51 +3933,8 @@ try {
} catch (Exception $e) {
echo 'Exception when calling StoreApi->getInventory: ', $e->getMessage(), PHP_EOL;
}
-?>
-
use Data::Dumper;
-use WWW::SwaggerClient::Configuration;
-use WWW::SwaggerClient::StoreApi;
-
-# Configure API key authorization: api_key
-$WWW::SwaggerClient::Configuration::api_key->{'api_key'} = 'YOUR_API_KEY';
-# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-#$WWW::SwaggerClient::Configuration::api_key_prefix->{'api_key'} = "Bearer";
-
-my $api_instance = WWW::SwaggerClient::StoreApi->new();
-
-eval {
- my $result = $api_instance->getInventory();
- print Dumper($result);
-};
-if ($@) {
- warn "Exception when calling StoreApi->getInventory: $@\n";
-}
- from __future__ import print_statement
-import time
-import swagger_client
-from swagger_client.rest import ApiException
-from pprint import pprint
-
-# Configure API key authorization: api_key
-swagger_client.configuration.api_key['api_key'] = 'YOUR_API_KEY'
-# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-# swagger_client.configuration.api_key_prefix['api_key'] = 'Bearer'
-
-# create an instance of the API class
-api_instance = swagger_client.StoreApi()
-
-try:
- # Returns pet inventories by status
- api_response = api_instance.getInventory()
- pprint(api_response)
-except ApiException as e:
- print("Exception when calling StoreApi->getInventory: %s\n" % e)
+
curl -X get "http://petstore.swagger.io/v2/store/order/{orderId}"
+
+ curl -X get "http://petstore.swagger.io/v2/store/order/{orderId}"
+
import io.swagger.client.*;
+
+ import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
-import io.swagger.client.api.StoreApi;
+import .StoreApi;
import java.io.File;
import java.util.*;
@@ -4384,11 +4053,14 @@ public class StoreApiExample {
e.printStackTrace();
}
}
-}
+}
+
+
import io.swagger.client.api.StoreApi;
+
+ import .StoreApi;
public class StoreApiExample {
@@ -4403,14 +4075,18 @@ public class StoreApiExample {
e.printStackTrace();
}
}
-}
+}
+
+
Long *orderId = 789; // ID of pet that needs to be fetched
+
+
+Long *orderId = 789; // ID of pet that needs to be fetched
StoreApi *apiInstance = [[StoreApi alloc] init];
@@ -4424,13 +4100,15 @@ StoreApi *apiInstance = [[StoreApi alloc] init];
NSLog(@"Error: %@", error);
}
}];
-
+
+
var SwaggerPetstore = require('swagger_petstore');
+
+ var = require('');
-var api = new SwaggerPetstore.StoreApi()
+var api = new .StoreApi()
var orderId = 789; // {Long} ID of pet that needs to be fetched
@@ -4443,18 +4121,20 @@ var callback = function(error, data, response) {
}
};
api.getOrderById(orderId, callback);
-
+
+
using System;
+
+ using System;
using System.Diagnostics;
-using IO.Swagger.Api;
-using IO.Swagger.Client;
-using IO.Swagger.Model;
+using .Api;
+using .Client;
+using ;
namespace Example
{
@@ -4478,14 +4158,17 @@ namespace Example
}
}
}
-}
+}
+
+
<?php
+
+
require_once(__DIR__ . '/vendor/autoload.php');
-$api_instance = new Swagger\Client\Api\StoreApi();
+$api_instance = new io.swagger.client\Api\StoreApi();
$orderId = 789; // Long | ID of pet that needs to be fetched
try {
@@ -4494,43 +4177,8 @@ try {
} catch (Exception $e) {
echo 'Exception when calling StoreApi->getOrderById: ', $e->getMessage(), PHP_EOL;
}
-?>
-
use Data::Dumper;
-use WWW::SwaggerClient::Configuration;
-use WWW::SwaggerClient::StoreApi;
-
-my $api_instance = WWW::SwaggerClient::StoreApi->new();
-my $orderId = 789; # Long | ID of pet that needs to be fetched
-
-eval {
- my $result = $api_instance->getOrderById(orderId => $orderId);
- print Dumper($result);
-};
-if ($@) {
- warn "Exception when calling StoreApi->getOrderById: $@\n";
-}
- from __future__ import print_statement
-import time
-import swagger_client
-from swagger_client.rest import ApiException
-from pprint import pprint
-
-# create an instance of the API class
-api_instance = swagger_client.StoreApi()
-orderId = 789 # Long | ID of pet that needs to be fetched
-
-try:
- # Find purchase order by ID
- api_response = api_instance.getOrderById(orderId)
- pprint(api_response)
-except ApiException as e:
- print("Exception when calling StoreApi->getOrderById: %s\n" % e)
+
curl -X post "http://petstore.swagger.io/v2/store/order"
+
+ curl -X post "http://petstore.swagger.io/v2/store/order"
+
import io.swagger.client.*;
+
+ import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
-import io.swagger.client.api.StoreApi;
+import .StoreApi;
import java.io.File;
import java.util.*;
@@ -4703,11 +4340,14 @@ public class StoreApiExample {
e.printStackTrace();
}
}
-}
+}
+
+
import io.swagger.client.api.StoreApi;
+
+ import .StoreApi;
public class StoreApiExample {
@@ -4722,14 +4362,18 @@ public class StoreApiExample {
e.printStackTrace();
}
}
-}
+}
+
+
Order *body = ; // order placed for purchasing the pet
+
+
+Order *body = ; // order placed for purchasing the pet
StoreApi *apiInstance = [[StoreApi alloc] init];
@@ -4743,13 +4387,15 @@ StoreApi *apiInstance = [[StoreApi alloc] init];
NSLog(@"Error: %@", error);
}
}];
-
+
+
var SwaggerPetstore = require('swagger_petstore');
+
+ var = require('');
-var api = new SwaggerPetstore.StoreApi()
+var api = new .StoreApi()
var body = ; // {Order} order placed for purchasing the pet
@@ -4762,18 +4408,20 @@ var callback = function(error, data, response) {
}
};
api.placeOrder(body, callback);
-
+
+
using System;
+
+ using System;
using System.Diagnostics;
-using IO.Swagger.Api;
-using IO.Swagger.Client;
-using IO.Swagger.Model;
+using .Api;
+using .Client;
+using ;
namespace Example
{
@@ -4797,14 +4445,17 @@ namespace Example
}
}
}
-}
+}
+
+
<?php
+
+
require_once(__DIR__ . '/vendor/autoload.php');
-$api_instance = new Swagger\Client\Api\StoreApi();
+$api_instance = new io.swagger.client\Api\StoreApi();
$body = ; // Order | order placed for purchasing the pet
try {
@@ -4813,43 +4464,8 @@ try {
} catch (Exception $e) {
echo 'Exception when calling StoreApi->placeOrder: ', $e->getMessage(), PHP_EOL;
}
-?>
-
use Data::Dumper;
-use WWW::SwaggerClient::Configuration;
-use WWW::SwaggerClient::StoreApi;
-
-my $api_instance = WWW::SwaggerClient::StoreApi->new();
-my $body = WWW::SwaggerClient::Object::Order->new(); # Order | order placed for purchasing the pet
-
-eval {
- my $result = $api_instance->placeOrder(body => $body);
- print Dumper($result);
-};
-if ($@) {
- warn "Exception when calling StoreApi->placeOrder: $@\n";
-}
- from __future__ import print_statement
-import time
-import swagger_client
-from swagger_client.rest import ApiException
-from pprint import pprint
-
-# create an instance of the API class
-api_instance = swagger_client.StoreApi()
-body = # Order | order placed for purchasing the pet
-
-try:
- # Place an order for a pet
- api_response = api_instance.placeOrder(body)
- pprint(api_response)
-except ApiException as e:
- print("Exception when calling StoreApi->placeOrder: %s\n" % e)
+
curl -X post "http://petstore.swagger.io/v2/user"
+
+ curl -X post "http://petstore.swagger.io/v2/user"
+
import io.swagger.client.*;
+
+ import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
-import io.swagger.client.api.UserApi;
+import .UserApi;
import java.io.File;
import java.util.*;
@@ -5024,11 +4635,14 @@ public class UserApiExample {
e.printStackTrace();
}
}
-}
+}
+
+
import io.swagger.client.api.UserApi;
+
+ import .UserApi;
public class UserApiExample {
@@ -5042,14 +4656,18 @@ public class UserApiExample {
e.printStackTrace();
}
}
-}
+}
+
+
User *body = ; // Created user object
+
+
+User *body = ; // Created user object
UserApi *apiInstance = [[UserApi alloc] init];
@@ -5060,13 +4678,15 @@ UserApi *apiInstance = [[UserApi alloc] init];
NSLog(@"Error: %@", error);
}
}];
-
+
+
var SwaggerPetstore = require('swagger_petstore');
+
+ var = require('');
-var api = new SwaggerPetstore.UserApi()
+var api = new .UserApi()
var body = ; // {User} Created user object
@@ -5079,18 +4699,20 @@ var callback = function(error, data, response) {
}
};
api.createUser(body, callback);
-
+
+
using System;
+
+ using System;
using System.Diagnostics;
-using IO.Swagger.Api;
-using IO.Swagger.Client;
-using IO.Swagger.Model;
+using .Api;
+using .Client;
+using ;
namespace Example
{
@@ -5113,14 +4735,17 @@ namespace Example
}
}
}
-}
+}
+
+
<?php
+
+
require_once(__DIR__ . '/vendor/autoload.php');
-$api_instance = new Swagger\Client\Api\UserApi();
+$api_instance = new io.swagger.client\Api\UserApi();
$body = ; // User | Created user object
try {
@@ -5128,41 +4753,8 @@ try {
} catch (Exception $e) {
echo 'Exception when calling UserApi->createUser: ', $e->getMessage(), PHP_EOL;
}
-?>
-
use Data::Dumper;
-use WWW::SwaggerClient::Configuration;
-use WWW::SwaggerClient::UserApi;
-
-my $api_instance = WWW::SwaggerClient::UserApi->new();
-my $body = WWW::SwaggerClient::Object::User->new(); # User | Created user object
-
-eval {
- $api_instance->createUser(body => $body);
-};
-if ($@) {
- warn "Exception when calling UserApi->createUser: $@\n";
-}
- from __future__ import print_statement
-import time
-import swagger_client
-from swagger_client.rest import ApiException
-from pprint import pprint
-
-# create an instance of the API class
-api_instance = swagger_client.UserApi()
-body = # User | Created user object
-
-try:
- # Create user
- api_instance.createUser(body)
-except ApiException as e:
- print("Exception when calling UserApi->createUser: %s\n" % e)
+
curl -X post "http://petstore.swagger.io/v2/user/createWithArray"
+
+ curl -X post "http://petstore.swagger.io/v2/user/createWithArray"
+
import io.swagger.client.*;
+
+ import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
-import io.swagger.client.api.UserApi;
+import .UserApi;
import java.io.File;
import java.util.*;
@@ -5292,11 +4879,14 @@ public class UserApiExample {
e.printStackTrace();
}
}
-}
+}
+
+
import io.swagger.client.api.UserApi;
+
+ import .UserApi;
public class UserApiExample {
@@ -5310,14 +4900,18 @@ public class UserApiExample {
e.printStackTrace();
}
}
-}
+}
+
+
array[User] *body = ; // List of user object
+
+
+array[User] *body = ; // List of user object
UserApi *apiInstance = [[UserApi alloc] init];
@@ -5328,13 +4922,15 @@ UserApi *apiInstance = [[UserApi alloc] init];
NSLog(@"Error: %@", error);
}
}];
-
+
+
var SwaggerPetstore = require('swagger_petstore');
+
+ var = require('');
-var api = new SwaggerPetstore.UserApi()
+var api = new .UserApi()
var body = ; // {array[User]} List of user object
@@ -5347,18 +4943,20 @@ var callback = function(error, data, response) {
}
};
api.createUsersWithArrayInput(body, callback);
-
+
+
using System;
+
+ using System;
using System.Diagnostics;
-using IO.Swagger.Api;
-using IO.Swagger.Client;
-using IO.Swagger.Model;
+using .Api;
+using .Client;
+using ;
namespace Example
{
@@ -5381,14 +4979,17 @@ namespace Example
}
}
}
-}
+}
+
+
<?php
+
+
require_once(__DIR__ . '/vendor/autoload.php');
-$api_instance = new Swagger\Client\Api\UserApi();
+$api_instance = new io.swagger.client\Api\UserApi();
$body = ; // array[User] | List of user object
try {
@@ -5396,41 +4997,8 @@ try {
} catch (Exception $e) {
echo 'Exception when calling UserApi->createUsersWithArrayInput: ', $e->getMessage(), PHP_EOL;
}
-?>
-
use Data::Dumper;
-use WWW::SwaggerClient::Configuration;
-use WWW::SwaggerClient::UserApi;
-
-my $api_instance = WWW::SwaggerClient::UserApi->new();
-my $body = [WWW::SwaggerClient::Object::array[User]->new()]; # array[User] | List of user object
-
-eval {
- $api_instance->createUsersWithArrayInput(body => $body);
-};
-if ($@) {
- warn "Exception when calling UserApi->createUsersWithArrayInput: $@\n";
-}
- from __future__ import print_statement
-import time
-import swagger_client
-from swagger_client.rest import ApiException
-from pprint import pprint
-
-# create an instance of the API class
-api_instance = swagger_client.UserApi()
-body = # array[User] | List of user object
-
-try:
- # Creates list of users with given input array
- api_instance.createUsersWithArrayInput(body)
-except ApiException as e:
- print("Exception when calling UserApi->createUsersWithArrayInput: %s\n" % e)
+
curl -X post "http://petstore.swagger.io/v2/user/createWithList"
+
+ curl -X post "http://petstore.swagger.io/v2/user/createWithList"
+
import io.swagger.client.*;
+
+ import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
-import io.swagger.client.api.UserApi;
+import .UserApi;
import java.io.File;
import java.util.*;
@@ -5563,11 +5126,14 @@ public class UserApiExample {
e.printStackTrace();
}
}
-}
+}
+
+
import io.swagger.client.api.UserApi;
+
+ import .UserApi;
public class UserApiExample {
@@ -5581,14 +5147,18 @@ public class UserApiExample {
e.printStackTrace();
}
}
-}
+}
+
+
array[User] *body = ; // List of user object
+
+
+array[User] *body = ; // List of user object
UserApi *apiInstance = [[UserApi alloc] init];
@@ -5599,13 +5169,15 @@ UserApi *apiInstance = [[UserApi alloc] init];
NSLog(@"Error: %@", error);
}
}];
-
+
+
var SwaggerPetstore = require('swagger_petstore');
+
+ var = require('');
-var api = new SwaggerPetstore.UserApi()
+var api = new .UserApi()
var body = ; // {array[User]} List of user object
@@ -5618,18 +5190,20 @@ var callback = function(error, data, response) {
}
};
api.createUsersWithListInput(body, callback);
-
+
+
using System;
+
+ using System;
using System.Diagnostics;
-using IO.Swagger.Api;
-using IO.Swagger.Client;
-using IO.Swagger.Model;
+using .Api;
+using .Client;
+using ;
namespace Example
{
@@ -5652,14 +5226,17 @@ namespace Example
}
}
}
-}
+}
+
+
<?php
+
+
require_once(__DIR__ . '/vendor/autoload.php');
-$api_instance = new Swagger\Client\Api\UserApi();
+$api_instance = new io.swagger.client\Api\UserApi();
$body = ; // array[User] | List of user object
try {
@@ -5667,41 +5244,8 @@ try {
} catch (Exception $e) {
echo 'Exception when calling UserApi->createUsersWithListInput: ', $e->getMessage(), PHP_EOL;
}
-?>
-
use Data::Dumper;
-use WWW::SwaggerClient::Configuration;
-use WWW::SwaggerClient::UserApi;
-
-my $api_instance = WWW::SwaggerClient::UserApi->new();
-my $body = [WWW::SwaggerClient::Object::array[User]->new()]; # array[User] | List of user object
-
-eval {
- $api_instance->createUsersWithListInput(body => $body);
-};
-if ($@) {
- warn "Exception when calling UserApi->createUsersWithListInput: $@\n";
-}
- from __future__ import print_statement
-import time
-import swagger_client
-from swagger_client.rest import ApiException
-from pprint import pprint
-
-# create an instance of the API class
-api_instance = swagger_client.UserApi()
-body = # array[User] | List of user object
-
-try:
- # Creates list of users with given input array
- api_instance.createUsersWithListInput(body)
-except ApiException as e:
- print("Exception when calling UserApi->createUsersWithListInput: %s\n" % e)
+
curl -X delete "http://petstore.swagger.io/v2/user/{username}"
+
+ curl -X delete "http://petstore.swagger.io/v2/user/{username}"
+
import io.swagger.client.*;
+
+ import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
-import io.swagger.client.api.UserApi;
+import .UserApi;
import java.io.File;
import java.util.*;
@@ -5834,11 +5373,14 @@ public class UserApiExample {
e.printStackTrace();
}
}
-}
+}
+
+
import io.swagger.client.api.UserApi;
+
+ import .UserApi;
public class UserApiExample {
@@ -5852,14 +5394,18 @@ public class UserApiExample {
e.printStackTrace();
}
}
-}
+}
+
+
String *username = username_example; // The name that needs to be deleted
+
+
+String *username = username_example; // The name that needs to be deleted
UserApi *apiInstance = [[UserApi alloc] init];
@@ -5870,13 +5416,15 @@ UserApi *apiInstance = [[UserApi alloc] init];
NSLog(@"Error: %@", error);
}
}];
-
+
+
var SwaggerPetstore = require('swagger_petstore');
+
+ var = require('');
-var api = new SwaggerPetstore.UserApi()
+var api = new .UserApi()
var username = username_example; // {String} The name that needs to be deleted
@@ -5889,18 +5437,20 @@ var callback = function(error, data, response) {
}
};
api.deleteUser(username, callback);
-
+
+
using System;
+
+ using System;
using System.Diagnostics;
-using IO.Swagger.Api;
-using IO.Swagger.Client;
-using IO.Swagger.Model;
+using .Api;
+using .Client;
+using ;
namespace Example
{
@@ -5923,14 +5473,17 @@ namespace Example
}
}
}
-}
+}
+
+
<?php
+
+
require_once(__DIR__ . '/vendor/autoload.php');
-$api_instance = new Swagger\Client\Api\UserApi();
+$api_instance = new io.swagger.client\Api\UserApi();
$username = username_example; // String | The name that needs to be deleted
try {
@@ -5938,41 +5491,8 @@ try {
} catch (Exception $e) {
echo 'Exception when calling UserApi->deleteUser: ', $e->getMessage(), PHP_EOL;
}
-?>
-
use Data::Dumper;
-use WWW::SwaggerClient::Configuration;
-use WWW::SwaggerClient::UserApi;
-
-my $api_instance = WWW::SwaggerClient::UserApi->new();
-my $username = username_example; # String | The name that needs to be deleted
-
-eval {
- $api_instance->deleteUser(username => $username);
-};
-if ($@) {
- warn "Exception when calling UserApi->deleteUser: $@\n";
-}
- from __future__ import print_statement
-import time
-import swagger_client
-from swagger_client.rest import ApiException
-from pprint import pprint
-
-# create an instance of the API class
-api_instance = swagger_client.UserApi()
-username = username_example # String | The name that needs to be deleted
-
-try:
- # Delete user
- api_instance.deleteUser(username)
-except ApiException as e:
- print("Exception when calling UserApi->deleteUser: %s\n" % e)
+
curl -X get "http://petstore.swagger.io/v2/user/{username}"
+
+ curl -X get "http://petstore.swagger.io/v2/user/{username}"
+
import io.swagger.client.*;
+
+ import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
-import io.swagger.client.api.UserApi;
+import .UserApi;
import java.io.File;
import java.util.*;
@@ -6100,11 +5609,14 @@ public class UserApiExample {
e.printStackTrace();
}
}
-}
+}
+
+
import io.swagger.client.api.UserApi;
+
+ import .UserApi;
public class UserApiExample {
@@ -6119,14 +5631,18 @@ public class UserApiExample {
e.printStackTrace();
}
}
-}
+}
+
+
String *username = username_example; // The name that needs to be fetched. Use user1 for testing.
+
+
+String *username = username_example; // The name that needs to be fetched. Use user1 for testing.
UserApi *apiInstance = [[UserApi alloc] init];
@@ -6140,13 +5656,15 @@ UserApi *apiInstance = [[UserApi alloc] init];
NSLog(@"Error: %@", error);
}
}];
-
+
+
var SwaggerPetstore = require('swagger_petstore');
+
+ var = require('');
-var api = new SwaggerPetstore.UserApi()
+var api = new .UserApi()
var username = username_example; // {String} The name that needs to be fetched. Use user1 for testing.
@@ -6159,18 +5677,20 @@ var callback = function(error, data, response) {
}
};
api.getUserByName(username, callback);
-
+
+
using System;
+
+ using System;
using System.Diagnostics;
-using IO.Swagger.Api;
-using IO.Swagger.Client;
-using IO.Swagger.Model;
+using .Api;
+using .Client;
+using ;
namespace Example
{
@@ -6194,14 +5714,17 @@ namespace Example
}
}
}
-}
+}
+
+
<?php
+
+
require_once(__DIR__ . '/vendor/autoload.php');
-$api_instance = new Swagger\Client\Api\UserApi();
+$api_instance = new io.swagger.client\Api\UserApi();
$username = username_example; // String | The name that needs to be fetched. Use user1 for testing.
try {
@@ -6210,43 +5733,8 @@ try {
} catch (Exception $e) {
echo 'Exception when calling UserApi->getUserByName: ', $e->getMessage(), PHP_EOL;
}
-?>
-
use Data::Dumper;
-use WWW::SwaggerClient::Configuration;
-use WWW::SwaggerClient::UserApi;
-
-my $api_instance = WWW::SwaggerClient::UserApi->new();
-my $username = username_example; # String | The name that needs to be fetched. Use user1 for testing.
-
-eval {
- my $result = $api_instance->getUserByName(username => $username);
- print Dumper($result);
-};
-if ($@) {
- warn "Exception when calling UserApi->getUserByName: $@\n";
-}
- from __future__ import print_statement
-import time
-import swagger_client
-from swagger_client.rest import ApiException
-from pprint import pprint
-
-# create an instance of the API class
-api_instance = swagger_client.UserApi()
-username = username_example # String | The name that needs to be fetched. Use user1 for testing.
-
-try:
- # Get user by user name
- api_response = api_instance.getUserByName(username)
- pprint(api_response)
-except ApiException as e:
- print("Exception when calling UserApi->getUserByName: %s\n" % e)
+
curl -X get "http://petstore.swagger.io/v2/user/login?username=&password="
+
+ curl -X get "http://petstore.swagger.io/v2/user/login?username=&password="
+
import io.swagger.client.*;
+
+ import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
-import io.swagger.client.api.UserApi;
+import .UserApi;
import java.io.File;
import java.util.*;
@@ -6417,11 +5894,14 @@ public class UserApiExample {
e.printStackTrace();
}
}
-}
+}
+
+
import io.swagger.client.api.UserApi;
+
+ import .UserApi;
public class UserApiExample {
@@ -6437,14 +5917,18 @@ public class UserApiExample {
e.printStackTrace();
}
}
-}
+}
+
+
String *username = username_example; // The user name for login
+
+
+String *username = username_example; // The user name for login
String *password = password_example; // The password for login in clear text
UserApi *apiInstance = [[UserApi alloc] init];
@@ -6460,13 +5944,15 @@ UserApi *apiInstance = [[UserApi alloc] init];
NSLog(@"Error: %@", error);
}
}];
-
+
+
var SwaggerPetstore = require('swagger_petstore');
+
+ var = require('');
-var api = new SwaggerPetstore.UserApi()
+var api = new .UserApi()
var username = username_example; // {String} The user name for login
@@ -6481,18 +5967,20 @@ var callback = function(error, data, response) {
}
};
api.loginUser(username, password, callback);
-
+
+
using System;
+
+ using System;
using System.Diagnostics;
-using IO.Swagger.Api;
-using IO.Swagger.Client;
-using IO.Swagger.Model;
+using .Api;
+using .Client;
+using ;
namespace Example
{
@@ -6517,14 +6005,17 @@ namespace Example
}
}
}
-}
+}
+
+
<?php
+
+
require_once(__DIR__ . '/vendor/autoload.php');
-$api_instance = new Swagger\Client\Api\UserApi();
+$api_instance = new io.swagger.client\Api\UserApi();
$username = username_example; // String | The user name for login
$password = password_example; // String | The password for login in clear text
@@ -6534,45 +6025,8 @@ try {
} catch (Exception $e) {
echo 'Exception when calling UserApi->loginUser: ', $e->getMessage(), PHP_EOL;
}
-?>
-
use Data::Dumper;
-use WWW::SwaggerClient::Configuration;
-use WWW::SwaggerClient::UserApi;
-
-my $api_instance = WWW::SwaggerClient::UserApi->new();
-my $username = username_example; # String | The user name for login
-my $password = password_example; # String | The password for login in clear text
-
-eval {
- my $result = $api_instance->loginUser(username => $username, password => $password);
- print Dumper($result);
-};
-if ($@) {
- warn "Exception when calling UserApi->loginUser: $@\n";
-}
- from __future__ import print_statement
-import time
-import swagger_client
-from swagger_client.rest import ApiException
-from pprint import pprint
-
-# create an instance of the API class
-api_instance = swagger_client.UserApi()
-username = username_example # String | The user name for login
-password = password_example # String | The password for login in clear text
-
-try:
- # Logs user into the system
- api_response = api_instance.loginUser(username, password)
- pprint(api_response)
-except ApiException as e:
- print("Exception when calling UserApi->loginUser: %s\n" % e)
+
Name | -Type | -Format | -Description | -
---|---|---|---|
X-Rate-Limit | -Integer | -int32 | -calls per hour allowed by the user | -
X-Expires-After | -Date | -date-time | -date in UTC when toekn expires | -
curl -X get "http://petstore.swagger.io/v2/user/logout"
+
+ curl -X get "http://petstore.swagger.io/v2/user/logout"
+
import io.swagger.client.*;
+
+ import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
-import io.swagger.client.api.UserApi;
+import .UserApi;
import java.io.File;
import java.util.*;
@@ -6802,11 +6226,14 @@ public class UserApiExample {
e.printStackTrace();
}
}
-}
+}
+
+
import io.swagger.client.api.UserApi;
+
+ import .UserApi;
public class UserApiExample {
@@ -6819,7 +6246,9 @@ public class UserApiExample {
e.printStackTrace();
}
}
-}
+}
+
+
+
+
UserApi *apiInstance = [[UserApi alloc] init];
// Logs out current logged in user session
@@ -6836,13 +6267,15 @@ UserApi *apiInstance = [[UserApi alloc] init];
NSLog(@"Error: %@", error);
}
}];
-
+
+
var SwaggerPetstore = require('swagger_petstore');
+
+ var = require('');
-var api = new SwaggerPetstore.UserApi()
+var api = new .UserApi()
var callback = function(error, data, response) {
if (error) {
@@ -6852,18 +6285,20 @@ var callback = function(error, data, response) {
}
};
api.logoutUser(callback);
-
+
+
using System;
+
+ using System;
using System.Diagnostics;
-using IO.Swagger.Api;
-using IO.Swagger.Client;
-using IO.Swagger.Model;
+using .Api;
+using .Client;
+using ;
namespace Example
{
@@ -6885,53 +6320,25 @@ namespace Example
}
}
}
-}
+}
+
+
<?php
+
+
require_once(__DIR__ . '/vendor/autoload.php');
-$api_instance = new Swagger\Client\Api\UserApi();
+$api_instance = new io.swagger.client\Api\UserApi();
try {
$api_instance->logoutUser();
} catch (Exception $e) {
echo 'Exception when calling UserApi->logoutUser: ', $e->getMessage(), PHP_EOL;
}
-?>
-
use Data::Dumper;
-use WWW::SwaggerClient::Configuration;
-use WWW::SwaggerClient::UserApi;
-
-my $api_instance = WWW::SwaggerClient::UserApi->new();
-
-eval {
- $api_instance->logoutUser();
-};
-if ($@) {
- warn "Exception when calling UserApi->logoutUser: $@\n";
-}
- from __future__ import print_statement
-import time
-import swagger_client
-from swagger_client.rest import ApiException
-from pprint import pprint
-
-# create an instance of the API class
-api_instance = swagger_client.UserApi()
-
-try:
- # Logs out current logged in user session
- api_instance.logoutUser()
-except ApiException as e:
- print("Exception when calling UserApi->logoutUser: %s\n" % e)
+
curl -X put "http://petstore.swagger.io/v2/user/{username}"
+
+ curl -X put "http://petstore.swagger.io/v2/user/{username}"
+
import io.swagger.client.*;
+
+ import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
-import io.swagger.client.api.UserApi;
+import .UserApi;
import java.io.File;
import java.util.*;
@@ -7011,11 +6413,14 @@ public class UserApiExample {
e.printStackTrace();
}
}
-}
+}
+
+
import io.swagger.client.api.UserApi;
+
+ import .UserApi;
public class UserApiExample {
@@ -7030,14 +6435,18 @@ public class UserApiExample {
e.printStackTrace();
}
}
-}
+}
+
+
String *username = username_example; // name that need to be deleted
+
+
+String *username = username_example; // name that need to be deleted
User *body = ; // Updated user object
UserApi *apiInstance = [[UserApi alloc] init];
@@ -7050,13 +6459,15 @@ UserApi *apiInstance = [[UserApi alloc] init];
NSLog(@"Error: %@", error);
}
}];
-
+
+
var SwaggerPetstore = require('swagger_petstore');
+
+ var = require('');
-var api = new SwaggerPetstore.UserApi()
+var api = new .UserApi()
var username = username_example; // {String} name that need to be deleted
@@ -7071,18 +6482,20 @@ var callback = function(error, data, response) {
}
};
api.updateUser(username, body, callback);
-
+
+
using System;
+
+ using System;
using System.Diagnostics;
-using IO.Swagger.Api;
-using IO.Swagger.Client;
-using IO.Swagger.Model;
+using .Api;
+using .Client;
+using ;
namespace Example
{
@@ -7106,14 +6519,17 @@ namespace Example
}
}
}
-}
+}
+
+
<?php
+
+
require_once(__DIR__ . '/vendor/autoload.php');
-$api_instance = new Swagger\Client\Api\UserApi();
+$api_instance = new io.swagger.client\Api\UserApi();
$username = username_example; // String | name that need to be deleted
$body = ; // User | Updated user object
@@ -7122,43 +6538,8 @@ try {
} catch (Exception $e) {
echo 'Exception when calling UserApi->updateUser: ', $e->getMessage(), PHP_EOL;
}
-?>
-
use Data::Dumper;
-use WWW::SwaggerClient::Configuration;
-use WWW::SwaggerClient::UserApi;
-
-my $api_instance = WWW::SwaggerClient::UserApi->new();
-my $username = username_example; # String | name that need to be deleted
-my $body = WWW::SwaggerClient::Object::User->new(); # User | Updated user object
-
-eval {
- $api_instance->updateUser(username => $username, body => $body);
-};
-if ($@) {
- warn "Exception when calling UserApi->updateUser: $@\n";
-}
- from __future__ import print_statement
-import time
-import swagger_client
-from swagger_client.rest import ApiException
-from pprint import pprint
-
-# create an instance of the API class
-api_instance = swagger_client.UserApi()
-username = username_example # String | name that need to be deleted
-body = # User | Updated user object
-
-try:
- # Updated user
- api_instance.updateUser(username, body)
-except ApiException as e:
- print("Exception when calling UserApi->updateUser: %s\n" % e)
+