forked from loafle/openapi-generator-original
Update Dart default value, re-enable Objc Tests (#328)
* update dart client default * re-enable objc test * restore dart flutter_petstore, update dart oas3 script
This commit is contained in:
parent
3c666a6d44
commit
aab99bc530
5
.gitignore
vendored
5
.gitignore
vendored
@ -197,3 +197,8 @@ samples/client/petstore/erlang-client/_build/
|
||||
samples/client/petstore/erlang-client/rebar.lock
|
||||
samples/server/petstore/erlang-server/_build/
|
||||
samples/server/petstore/erlang-server/rebar.lock
|
||||
|
||||
# dart
|
||||
samples/client/petstore/dart/petstore/packages
|
||||
samples/client/petstore/dart/flutter_petstore/test/packages
|
||||
samples/client/petstore/dart/petstore/test/packages
|
||||
|
@ -29,18 +29,18 @@ fi
|
||||
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
|
||||
# Generate non-browserClient
|
||||
ags="$@ generate -t modules/openapi-generator/src/main/resources/dart -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -l dart -o samples/client/petstore/dart/swagger -DhideGenerationTimestamp=true -DbrowserClient=false"
|
||||
ags="$@ generate -t modules/openapi-generator/src/main/resources/dart -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -l dart -o samples/client/petstore/dart/openapi -DhideGenerationTimestamp=true -DbrowserClient=false"
|
||||
|
||||
# then options to generate the library for vm would be:
|
||||
#ags="$@ generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -l dart -o samples/client/petstore/dart/swagger_vm -DbrowserClient=false -DpubName=swagger_vm"
|
||||
#ags="$@ generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -l dart -o samples/client/petstore/dart/openapi_vm -DbrowserClient=false -DpubName=openapi_vm"
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
|
||||
# Generate browserClient
|
||||
ags="$@ generate -t modules/openapi-generator/src/main/resources/dart -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -l dart -o samples/client/petstore/dart/swagger-browser-client -DhideGenerationTimestamp=true -DbrowserClient=true"
|
||||
ags="$@ generate -t modules/openapi-generator/src/main/resources/dart -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -l dart -o samples/client/petstore/dart/openapi-browser-client -DhideGenerationTimestamp=true -DbrowserClient=true"
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
|
||||
# Generate non-browserClient and put it to the flutter sample app
|
||||
ags="$@ generate -t modules/openapi-generator/src/main/resources/dart -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -l dart -o samples/client/petstore/dart/flutter_petstore/swagger -DhideGenerationTimestamp=true -DbrowserClient=false"
|
||||
ags="$@ generate -t modules/openapi-generator/src/main/resources/dart -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -l dart -o samples/client/petstore/dart/flutter_petstore/openapi -DhideGenerationTimestamp=true -DbrowserClient=false"
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
|
||||
# There is a proposal to allow importing different libraries depending on the environment:
|
||||
@ -48,4 +48,3 @@ java $JAVA_OPTS -jar $executable $ags
|
||||
# When this is implemented there will only be one library.
|
||||
|
||||
# The current petstore test will then work for both: the browser library and the vm library.
|
||||
|
||||
|
@ -29,18 +29,18 @@ fi
|
||||
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
|
||||
# Generate non-browserClient
|
||||
ags="$@ generate -t modules/openapi-generator/src/main/resources/dart -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -l dart -o samples/client/petstore/dart/swagger -DhideGenerationTimestamp=true -DbrowserClient=false"
|
||||
ags="$@ generate -t modules/openapi-generator/src/main/resources/dart -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -l dart -o samples/client/petstore/dart/openapi -DhideGenerationTimestamp=true -DbrowserClient=false"
|
||||
|
||||
# then options to generate the library for vm would be:
|
||||
#ags="$@ generate -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -l dart -o samples/client/petstore/dart/swagger_vm -DbrowserClient=false -DpubName=swagger_vm"
|
||||
#ags="$@ generate -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -l dart -o samples/client/petstore/dart/openapi_vm -DbrowserClient=false -DpubName=openapi_vm"
|
||||
#java $JAVA_OPTS -jar $executable $ags
|
||||
|
||||
# Generate browserClient
|
||||
ags="$@ generate -t modules/openapi-generator/src/main/resources/dart -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -l dart -o samples/client/petstore/dart/swagger-browser-client -DhideGenerationTimestamp=true -DbrowserClient=true"
|
||||
ags="$@ generate -t modules/openapi-generator/src/main/resources/dart -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -l dart -o samples/client/petstore/dart/openapi-browser-client -DhideGenerationTimestamp=true -DbrowserClient=true"
|
||||
#java $JAVA_OPTS -jar $executable $ags
|
||||
|
||||
# Generate non-browserClient and put it to the flutter sample app
|
||||
ags="$@ generate -t modules/openapi-generator/src/main/resources/dart -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -l dart -o samples/client/petstore/dart/flutter_petstore/swagger -DhideGenerationTimestamp=true -DbrowserClient=false"
|
||||
ags="$@ generate -t modules/openapi-generator/src/main/resources/dart -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -l dart -o samples/client/petstore/dart/flutter_petstore/openapi -DhideGenerationTimestamp=true -DbrowserClient=false"
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
|
||||
# There is a proposal to allow importing different libraries depending on the environment:
|
||||
|
@ -44,13 +44,13 @@ public class DartClientCodegen extends DefaultCodegen implements CodegenConfig {
|
||||
public static final String PUB_DESCRIPTION = "pubDescription";
|
||||
public static final String USE_ENUM_EXTENSION = "useEnumExtension";
|
||||
protected boolean browserClient = true;
|
||||
protected String pubName = "swagger";
|
||||
protected String pubName = "openapi";
|
||||
protected String pubVersion = "1.0.0";
|
||||
protected String pubDescription = "Swagger API client";
|
||||
protected String pubDescription = "OpenAPI API client";
|
||||
protected boolean useEnumExtension = false;
|
||||
protected String sourceFolder = "";
|
||||
protected String apiDocPath = "docs/";
|
||||
protected String modelDocPath = "docs/";
|
||||
protected String apiDocPath = "docs" + File.separator;
|
||||
protected String modelDocPath = "docs" + File.separator;
|
||||
|
||||
public DartClientCodegen() {
|
||||
super();
|
||||
@ -110,10 +110,9 @@ public class DartClientCodegen extends DefaultCodegen implements CodegenConfig {
|
||||
typeMapping.put("Date", "DateTime");
|
||||
typeMapping.put("date", "DateTime");
|
||||
typeMapping.put("File", "MultipartFile");
|
||||
typeMapping.put("binary", "MultipartFile");
|
||||
typeMapping.put("UUID", "String");
|
||||
//TODO binary should be mapped to byte array
|
||||
// mapped to String as a workaround
|
||||
typeMapping.put("binary", "String");
|
||||
typeMapping.put("ByteArray", "String");
|
||||
|
||||
cliOptions.add(new CliOption(BROWSER_CLIENT, "Is the client browser based"));
|
||||
cliOptions.add(new CliOption(PUB_NAME, "Name in generated pubspec"));
|
||||
@ -210,12 +209,12 @@ public class DartClientCodegen extends DefaultCodegen implements CodegenConfig {
|
||||
|
||||
@Override
|
||||
public String apiFileFolder() {
|
||||
return outputFolder + "/" + sourceFolder + "/" + apiPackage().replace('.', File.separatorChar);
|
||||
return outputFolder + File.separator + sourceFolder + File.separator + apiPackage().replace('.', File.separatorChar);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String modelFileFolder() {
|
||||
return outputFolder + "/" + sourceFolder + "/" + modelPackage().replace('.', File.separatorChar);
|
||||
return outputFolder + File.separator + sourceFolder + File.separator + modelPackage().replace('.', File.separatorChar);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -231,7 +230,7 @@ public class DartClientCodegen extends DefaultCodegen implements CodegenConfig {
|
||||
@Override
|
||||
public String toVarName(String name) {
|
||||
// replace - with _ e.g. created-at => created_at
|
||||
name = name.replaceAll("-", "_"); // FIXME: a parameter should not be assigned. Also declare the methods parameters as 'final'.
|
||||
name = name.replaceAll("-", "_");
|
||||
|
||||
// if it's all uppper case, do nothing
|
||||
if (name.matches("^[A-Z_]*$")) {
|
||||
|
@ -42,10 +42,8 @@ public class ElixirClientOptionsTest extends AbstractOptionsTest {
|
||||
@Override
|
||||
protected void setExpectations() {
|
||||
new Expectations(clientCodegen) {{
|
||||
// TODO
|
||||
clientCodegen.setModuleName(ElixirClientOptionsProvider.INVOKER_PACKAGE_VALUE);
|
||||
times = 1;
|
||||
|
||||
}};
|
||||
}
|
||||
}
|
@ -275,7 +275,7 @@ public class ObjcModelTest {
|
||||
Assert.assertEquals(Sets.intersection(cm.imports, Sets.newHashSet("SWGChildren")).size(), 1);
|
||||
}
|
||||
|
||||
@Test(description = "convert an map model", enabled = false)
|
||||
@Test(description = "convert an map model")
|
||||
public void mapModelTest() {
|
||||
final Schema model = new Schema()
|
||||
.description("a map model for testing ObjC generator")
|
||||
@ -329,7 +329,7 @@ public class ObjcModelTest {
|
||||
}
|
||||
|
||||
|
||||
@Test(description = "test binary data", enabled = false)
|
||||
@Test(description = "test binary data")
|
||||
public void binaryDataModelTest() {
|
||||
final OpenAPI model = new OpenAPIParser().readLocation("src/test/resources/2_0/binaryDataTest.json", null, new ParseOptions()).getOpenAPI();
|
||||
final DefaultCodegen codegen = new ObjcClientCodegen();
|
||||
@ -339,8 +339,8 @@ public class ObjcModelTest {
|
||||
|
||||
Assert.assertTrue(op.bodyParam.isBinary);
|
||||
Assert.assertTrue(op.responses.get(0).isBinary);
|
||||
Assert.assertEquals(op.returnType, "NSData*");
|
||||
Assert.assertEquals(op.bodyParam.dataType, "NSData*");
|
||||
Assert.assertEquals(op.returnType, "NSURL*");
|
||||
Assert.assertEquals(op.bodyParam.dataType, "NSURL*");
|
||||
}
|
||||
|
||||
@Test(description = "create proper imports per #316")
|
||||
|
@ -1,10 +1,27 @@
|
||||
.DS_Store
|
||||
.atom/
|
||||
.idea
|
||||
# See https://www.dartlang.org/tools/private-files.html
|
||||
|
||||
# Files and directories created by pub
|
||||
.buildlog
|
||||
.packages
|
||||
.project
|
||||
.pub/
|
||||
build/
|
||||
ios/.generated/
|
||||
packages
|
||||
**/packages/
|
||||
|
||||
# Files created by dart2js
|
||||
# (Most Dart developers will use pub build to compile Dart, use/modify these
|
||||
# rules if you intend to use dart2js directly
|
||||
# Convention is to use extension '.dart.js' for Dart compiled to Javascript to
|
||||
# differentiate from explicit Javascript files)
|
||||
*.dart.js
|
||||
*.part.js
|
||||
*.js.deps
|
||||
*.js.map
|
||||
*.info.json
|
||||
|
||||
# Directory created by dartdoc
|
||||
doc/api/
|
||||
|
||||
# Don't commit pubspec lock file
|
||||
# (Library packages only! Remove pattern if developing an application package)
|
||||
pubspec.lock
|
||||
.flutter-plugins
|
||||
|
@ -1,11 +1,11 @@
|
||||
# Swagger Codegen Ignore
|
||||
# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen
|
||||
# OpenAPI Generator Ignore
|
||||
# Generated by openapi-generator https://github.com/openapitools/openapi-generator
|
||||
|
||||
# Use this file to prevent files from being overwritten by the generator.
|
||||
# The patterns follow closely to .gitignore or .dockerignore.
|
||||
|
||||
# As an example, the C# client generator defines ApiClient.cs.
|
||||
# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line:
|
||||
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
|
||||
#ApiClient.cs
|
||||
|
||||
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
|
@ -1,11 +1,11 @@
|
||||
# Swagger Codegen Ignore
|
||||
# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen
|
||||
# OpenAPI Generator Ignore
|
||||
# Generated by openapi-generator https://github.com/openapitools/openapi-generator
|
||||
|
||||
# Use this file to prevent files from being overwritten by the generator.
|
||||
# The patterns follow closely to .gitignore or .dockerignore.
|
||||
|
||||
# As an example, the C# client generator defines ApiClient.cs.
|
||||
# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line:
|
||||
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
|
||||
#ApiClient.cs
|
||||
|
||||
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
|
@ -1,4 +1,4 @@
|
||||
# swagger
|
||||
# openapi
|
||||
This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
|
||||
This Dart package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
|
||||
@ -15,11 +15,11 @@ Dart 1.20.0 or later OR Flutter 0.0.20 or later
|
||||
### Github
|
||||
If this Dart package is published to Github, please include the following in pubspec.yaml
|
||||
```
|
||||
name: swagger
|
||||
name: openapi
|
||||
version: 1.0.0
|
||||
description: Swagger API client
|
||||
description: OpenAPI API client
|
||||
dependencies:
|
||||
swagger:
|
||||
openapi:
|
||||
git: https://github.com/GIT_USER_ID/GIT_REPO_ID.git
|
||||
version: 'any'
|
||||
```
|
||||
@ -28,8 +28,8 @@ dependencies:
|
||||
To use the package in your local drive, please include the following in pubspec.yaml
|
||||
```
|
||||
dependencies:
|
||||
swagger:
|
||||
path: /path/to/swagger
|
||||
openapi:
|
||||
path: /path/to/openapi
|
||||
```
|
||||
|
||||
## Tests
|
||||
@ -41,10 +41,10 @@ TODO
|
||||
Please follow the [installation procedure](#installation--usage) and then run the following:
|
||||
|
||||
```dart
|
||||
import 'package:swagger/api.dart';
|
||||
import 'package:openapi/api.dart';
|
||||
|
||||
// TODO Configure OAuth2 access token for authorization: petstore_auth
|
||||
//swagger.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN';
|
||||
//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN';
|
||||
|
||||
var api_instance = new PetApi();
|
||||
var pet = new Pet(); // Pet | Pet object that needs to be added to the store
|
@ -1,8 +1,8 @@
|
||||
# swagger.model.ApiResponse
|
||||
# openapi.model.ApiResponse
|
||||
|
||||
## Load the model package
|
||||
```dart
|
||||
import 'package:swagger/api.dart';
|
||||
import 'package:openapi/api.dart';
|
||||
```
|
||||
|
||||
## Properties
|
@ -1,8 +1,8 @@
|
||||
# swagger.model.Category
|
||||
# openapi.model.Category
|
||||
|
||||
## Load the model package
|
||||
```dart
|
||||
import 'package:swagger/api.dart';
|
||||
import 'package:openapi/api.dart';
|
||||
```
|
||||
|
||||
## Properties
|
@ -1,8 +1,8 @@
|
||||
# swagger.model.Order
|
||||
# openapi.model.Order
|
||||
|
||||
## Load the model package
|
||||
```dart
|
||||
import 'package:swagger/api.dart';
|
||||
import 'package:openapi/api.dart';
|
||||
```
|
||||
|
||||
## Properties
|
@ -1,8 +1,8 @@
|
||||
# swagger.model.Pet
|
||||
# openapi.model.Pet
|
||||
|
||||
## Load the model package
|
||||
```dart
|
||||
import 'package:swagger/api.dart';
|
||||
import 'package:openapi/api.dart';
|
||||
```
|
||||
|
||||
## Properties
|
@ -1,8 +1,8 @@
|
||||
# swagger.api.PetApi
|
||||
# openapi.api.PetApi
|
||||
|
||||
## Load the API package
|
||||
```dart
|
||||
import 'package:swagger/api.dart';
|
||||
import 'package:openapi/api.dart';
|
||||
```
|
||||
|
||||
All URIs are relative to *http://petstore.swagger.io/v2*
|
||||
@ -26,9 +26,9 @@ Add a new pet to the store
|
||||
|
||||
### Example
|
||||
```dart
|
||||
import 'package:swagger/api.dart';
|
||||
import 'package:openapi/api.dart';
|
||||
// TODO Configure OAuth2 access token for authorization: petstore_auth
|
||||
//swagger.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN';
|
||||
//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN';
|
||||
|
||||
var api_instance = new PetApi();
|
||||
var pet = new Pet(); // Pet | Pet object that needs to be added to the store
|
||||
@ -68,9 +68,9 @@ Deletes a pet
|
||||
|
||||
### Example
|
||||
```dart
|
||||
import 'package:swagger/api.dart';
|
||||
import 'package:openapi/api.dart';
|
||||
// TODO Configure OAuth2 access token for authorization: petstore_auth
|
||||
//swagger.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN';
|
||||
//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN';
|
||||
|
||||
var api_instance = new PetApi();
|
||||
var petId = 789; // int | Pet id to delete
|
||||
@ -114,9 +114,9 @@ Multiple status values can be provided with comma separated strings
|
||||
|
||||
### Example
|
||||
```dart
|
||||
import 'package:swagger/api.dart';
|
||||
import 'package:openapi/api.dart';
|
||||
// TODO Configure OAuth2 access token for authorization: petstore_auth
|
||||
//swagger.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN';
|
||||
//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN';
|
||||
|
||||
var api_instance = new PetApi();
|
||||
var status = []; // List<String> | Status values that need to be considered for filter
|
||||
@ -159,9 +159,9 @@ Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3
|
||||
|
||||
### Example
|
||||
```dart
|
||||
import 'package:swagger/api.dart';
|
||||
import 'package:openapi/api.dart';
|
||||
// TODO Configure OAuth2 access token for authorization: petstore_auth
|
||||
//swagger.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN';
|
||||
//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN';
|
||||
|
||||
var api_instance = new PetApi();
|
||||
var tags = []; // List<String> | Tags to filter by
|
||||
@ -204,11 +204,11 @@ Returns a single pet
|
||||
|
||||
### Example
|
||||
```dart
|
||||
import 'package:swagger/api.dart';
|
||||
import 'package:openapi/api.dart';
|
||||
// TODO Configure API key authorization: api_key
|
||||
//swagger.api.Configuration.apiKey{'api_key'} = 'YOUR_API_KEY';
|
||||
//openapi.api.Configuration.apiKey{'api_key'} = 'YOUR_API_KEY';
|
||||
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
|
||||
//swagger.api.Configuration.apiKeyPrefix{'api_key'} = "Bearer";
|
||||
//openapi.api.Configuration.apiKeyPrefix{'api_key'} = "Bearer";
|
||||
|
||||
var api_instance = new PetApi();
|
||||
var petId = 789; // int | ID of pet to return
|
||||
@ -249,9 +249,9 @@ Update an existing pet
|
||||
|
||||
### Example
|
||||
```dart
|
||||
import 'package:swagger/api.dart';
|
||||
import 'package:openapi/api.dart';
|
||||
// TODO Configure OAuth2 access token for authorization: petstore_auth
|
||||
//swagger.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN';
|
||||
//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN';
|
||||
|
||||
var api_instance = new PetApi();
|
||||
var pet = new Pet(); // Pet | Pet object that needs to be added to the store
|
||||
@ -291,9 +291,9 @@ Updates a pet in the store with form data
|
||||
|
||||
### Example
|
||||
```dart
|
||||
import 'package:swagger/api.dart';
|
||||
import 'package:openapi/api.dart';
|
||||
// TODO Configure OAuth2 access token for authorization: petstore_auth
|
||||
//swagger.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN';
|
||||
//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN';
|
||||
|
||||
var api_instance = new PetApi();
|
||||
var petId = 789; // int | ID of pet that needs to be updated
|
||||
@ -337,9 +337,9 @@ uploads an image
|
||||
|
||||
### Example
|
||||
```dart
|
||||
import 'package:swagger/api.dart';
|
||||
import 'package:openapi/api.dart';
|
||||
// TODO Configure OAuth2 access token for authorization: petstore_auth
|
||||
//swagger.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN';
|
||||
//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN';
|
||||
|
||||
var api_instance = new PetApi();
|
||||
var petId = 789; // int | ID of pet to update
|
@ -1,8 +1,8 @@
|
||||
# swagger.api.StoreApi
|
||||
# openapi.api.StoreApi
|
||||
|
||||
## Load the API package
|
||||
```dart
|
||||
import 'package:swagger/api.dart';
|
||||
import 'package:openapi/api.dart';
|
||||
```
|
||||
|
||||
All URIs are relative to *http://petstore.swagger.io/v2*
|
||||
@ -24,7 +24,7 @@ For valid response try integer IDs with value < 1000. Anything above 1000 or non
|
||||
|
||||
### Example
|
||||
```dart
|
||||
import 'package:swagger/api.dart';
|
||||
import 'package:openapi/api.dart';
|
||||
|
||||
var api_instance = new StoreApi();
|
||||
var orderId = orderId_example; // String | ID of the order that needs to be deleted
|
||||
@ -66,11 +66,11 @@ Returns a map of status codes to quantities
|
||||
|
||||
### Example
|
||||
```dart
|
||||
import 'package:swagger/api.dart';
|
||||
import 'package:openapi/api.dart';
|
||||
// TODO Configure API key authorization: api_key
|
||||
//swagger.api.Configuration.apiKey{'api_key'} = 'YOUR_API_KEY';
|
||||
//openapi.api.Configuration.apiKey{'api_key'} = 'YOUR_API_KEY';
|
||||
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
|
||||
//swagger.api.Configuration.apiKeyPrefix{'api_key'} = "Bearer";
|
||||
//openapi.api.Configuration.apiKeyPrefix{'api_key'} = "Bearer";
|
||||
|
||||
var api_instance = new StoreApi();
|
||||
|
||||
@ -109,7 +109,7 @@ For valid response try integer IDs with value <= 5 or > 10. Other values will ge
|
||||
|
||||
### Example
|
||||
```dart
|
||||
import 'package:swagger/api.dart';
|
||||
import 'package:openapi/api.dart';
|
||||
|
||||
var api_instance = new StoreApi();
|
||||
var orderId = 789; // int | ID of pet that needs to be fetched
|
||||
@ -150,7 +150,7 @@ Place an order for a pet
|
||||
|
||||
### Example
|
||||
```dart
|
||||
import 'package:swagger/api.dart';
|
||||
import 'package:openapi/api.dart';
|
||||
|
||||
var api_instance = new StoreApi();
|
||||
var order = new Order(); // Order | order placed for purchasing the pet
|
||||
@ -179,7 +179,7 @@ No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/xml, application/json
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
@ -1,8 +1,8 @@
|
||||
# swagger.model.Tag
|
||||
# openapi.model.Tag
|
||||
|
||||
## Load the model package
|
||||
```dart
|
||||
import 'package:swagger/api.dart';
|
||||
import 'package:openapi/api.dart';
|
||||
```
|
||||
|
||||
## Properties
|
@ -1,8 +1,8 @@
|
||||
# swagger.model.User
|
||||
# openapi.model.User
|
||||
|
||||
## Load the model package
|
||||
```dart
|
||||
import 'package:swagger/api.dart';
|
||||
import 'package:openapi/api.dart';
|
||||
```
|
||||
|
||||
## Properties
|
@ -1,8 +1,8 @@
|
||||
# swagger.api.UserApi
|
||||
# openapi.api.UserApi
|
||||
|
||||
## Load the API package
|
||||
```dart
|
||||
import 'package:swagger/api.dart';
|
||||
import 'package:openapi/api.dart';
|
||||
```
|
||||
|
||||
All URIs are relative to *http://petstore.swagger.io/v2*
|
||||
@ -28,7 +28,7 @@ This can only be done by the logged in user.
|
||||
|
||||
### Example
|
||||
```dart
|
||||
import 'package:swagger/api.dart';
|
||||
import 'package:openapi/api.dart';
|
||||
|
||||
var api_instance = new UserApi();
|
||||
var user = new User(); // User | Created user object
|
||||
@ -56,7 +56,7 @@ No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: Not defined
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
@ -68,7 +68,7 @@ Creates list of users with given input array
|
||||
|
||||
### Example
|
||||
```dart
|
||||
import 'package:swagger/api.dart';
|
||||
import 'package:openapi/api.dart';
|
||||
|
||||
var api_instance = new UserApi();
|
||||
var user = [new List<User>()]; // List<User> | List of user object
|
||||
@ -96,7 +96,7 @@ No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: Not defined
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
@ -108,7 +108,7 @@ Creates list of users with given input array
|
||||
|
||||
### Example
|
||||
```dart
|
||||
import 'package:swagger/api.dart';
|
||||
import 'package:openapi/api.dart';
|
||||
|
||||
var api_instance = new UserApi();
|
||||
var user = [new List<User>()]; // List<User> | List of user object
|
||||
@ -136,7 +136,7 @@ No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: Not defined
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
@ -150,7 +150,7 @@ This can only be done by the logged in user.
|
||||
|
||||
### Example
|
||||
```dart
|
||||
import 'package:swagger/api.dart';
|
||||
import 'package:openapi/api.dart';
|
||||
|
||||
var api_instance = new UserApi();
|
||||
var username = username_example; // String | The name that needs to be deleted
|
||||
@ -190,7 +190,7 @@ Get user by user name
|
||||
|
||||
### Example
|
||||
```dart
|
||||
import 'package:swagger/api.dart';
|
||||
import 'package:openapi/api.dart';
|
||||
|
||||
var api_instance = new UserApi();
|
||||
var username = username_example; // String | The name that needs to be fetched. Use user1 for testing.
|
||||
@ -231,7 +231,7 @@ Logs user into the system
|
||||
|
||||
### Example
|
||||
```dart
|
||||
import 'package:swagger/api.dart';
|
||||
import 'package:openapi/api.dart';
|
||||
|
||||
var api_instance = new UserApi();
|
||||
var username = username_example; // String | The user name for login
|
||||
@ -274,7 +274,7 @@ Logs out current logged in user session
|
||||
|
||||
### Example
|
||||
```dart
|
||||
import 'package:swagger/api.dart';
|
||||
import 'package:openapi/api.dart';
|
||||
|
||||
var api_instance = new UserApi();
|
||||
|
||||
@ -312,7 +312,7 @@ This can only be done by the logged in user.
|
||||
|
||||
### Example
|
||||
```dart
|
||||
import 'package:swagger/api.dart';
|
||||
import 'package:openapi/api.dart';
|
||||
|
||||
var api_instance = new UserApi();
|
||||
var username = username_example; // String | name that need to be deleted
|
||||
@ -342,7 +342,7 @@ No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: Not defined
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
@ -1,4 +1,4 @@
|
||||
library swagger.api;
|
||||
library openapi.api;
|
||||
|
||||
import 'dart:async';
|
||||
import 'dart:convert';
|
@ -1,4 +1,4 @@
|
||||
part of swagger.api;
|
||||
part of openapi.api;
|
||||
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
part of swagger.api;
|
||||
part of openapi.api;
|
||||
|
||||
|
||||
|
||||
@ -173,7 +173,7 @@ class StoreApi {
|
||||
Map<String, String> headerParams = {};
|
||||
Map<String, String> formParams = {};
|
||||
|
||||
List<String> contentTypes = ["application/json"];
|
||||
List<String> contentTypes = [];
|
||||
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
List<String> authNames = [];
|
@ -1,4 +1,4 @@
|
||||
part of swagger.api;
|
||||
part of openapi.api;
|
||||
|
||||
|
||||
|
||||
@ -26,7 +26,7 @@ class UserApi {
|
||||
Map<String, String> headerParams = {};
|
||||
Map<String, String> formParams = {};
|
||||
|
||||
List<String> contentTypes = ["application/json"];
|
||||
List<String> contentTypes = [];
|
||||
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
List<String> authNames = [];
|
||||
@ -75,7 +75,7 @@ class UserApi {
|
||||
Map<String, String> headerParams = {};
|
||||
Map<String, String> formParams = {};
|
||||
|
||||
List<String> contentTypes = ["application/json"];
|
||||
List<String> contentTypes = [];
|
||||
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
List<String> authNames = [];
|
||||
@ -124,7 +124,7 @@ class UserApi {
|
||||
Map<String, String> headerParams = {};
|
||||
Map<String, String> formParams = {};
|
||||
|
||||
List<String> contentTypes = ["application/json"];
|
||||
List<String> contentTypes = [];
|
||||
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
List<String> authNames = [];
|
||||
@ -376,7 +376,7 @@ class UserApi {
|
||||
Map<String, String> headerParams = {};
|
||||
Map<String, String> formParams = {};
|
||||
|
||||
List<String> contentTypes = ["application/json"];
|
||||
List<String> contentTypes = [];
|
||||
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
List<String> authNames = [];
|
@ -1,4 +1,4 @@
|
||||
part of swagger.api;
|
||||
part of openapi.api;
|
||||
|
||||
class QueryParam {
|
||||
String name;
|
@ -1,4 +1,4 @@
|
||||
part of swagger.api;
|
||||
part of openapi.api;
|
||||
|
||||
class ApiException implements Exception {
|
||||
int code = 0;
|
@ -1,4 +1,4 @@
|
||||
part of swagger.api;
|
||||
part of openapi.api;
|
||||
|
||||
const _delimiters = const {'csv': ',', 'ssv': ' ', 'tsv': '\t', 'pipes': '|'};
|
||||
|
@ -1,4 +1,4 @@
|
||||
part of swagger.api;
|
||||
part of openapi.api;
|
||||
|
||||
class ApiKeyAuth implements Authentication {
|
||||
|
@ -1,4 +1,4 @@
|
||||
part of swagger.api;
|
||||
part of openapi.api;
|
||||
|
||||
abstract class Authentication {
|
||||
|
@ -1,4 +1,4 @@
|
||||
part of swagger.api;
|
||||
part of openapi.api;
|
||||
|
||||
class HttpBasicAuth implements Authentication {
|
||||
|
@ -1,4 +1,4 @@
|
||||
part of swagger.api;
|
||||
part of openapi.api;
|
||||
|
||||
class OAuth implements Authentication {
|
||||
String accessToken;
|
@ -1,4 +1,4 @@
|
||||
part of swagger.api;
|
||||
part of openapi.api;
|
||||
|
||||
class ApiResponse {
|
||||
|
@ -1,4 +1,4 @@
|
||||
part of swagger.api;
|
||||
part of openapi.api;
|
||||
|
||||
class Category {
|
||||
|
@ -1,4 +1,4 @@
|
||||
part of swagger.api;
|
||||
part of openapi.api;
|
||||
|
||||
class Order {
|
||||
|
@ -1,4 +1,4 @@
|
||||
part of swagger.api;
|
||||
part of openapi.api;
|
||||
|
||||
class Pet {
|
||||
|
@ -1,4 +1,4 @@
|
||||
part of swagger.api;
|
||||
part of openapi.api;
|
||||
|
||||
class Tag {
|
||||
|
@ -1,4 +1,4 @@
|
||||
part of swagger.api;
|
||||
part of openapi.api;
|
||||
|
||||
class User {
|
||||
|
@ -1,5 +1,5 @@
|
||||
name: swagger
|
||||
name: openapi
|
||||
version: 1.0.0
|
||||
description: Swagger API client
|
||||
description: OpenAPI API client
|
||||
dependencies:
|
||||
http: '>=0.11.1 <0.12.0'
|
@ -1,11 +1,11 @@
|
||||
name: flutter_petstore
|
||||
description: Swagger petstore sample flutter
|
||||
description: OpenAPI petstore sample flutter
|
||||
|
||||
dependencies:
|
||||
flutter:
|
||||
sdk: flutter
|
||||
swagger:
|
||||
path: ./swagger
|
||||
openapi:
|
||||
path: ./openapi
|
||||
|
||||
# The following adds the Cupertino Icons font to your application.
|
||||
# Use with the CupertinoIcons class for iOS style icons.
|
||||
|
@ -0,0 +1 @@
|
||||
3.0.0-SNAPSHOT
|
@ -1,10 +1,10 @@
|
||||
# swagger
|
||||
# openapi
|
||||
This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
|
||||
This Dart package is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:
|
||||
This Dart package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
|
||||
|
||||
- API version: 1.0.0
|
||||
- Build package: io.swagger.codegen.languages.DartClientCodegen
|
||||
- Build package: org.openapitools.codegen.languages.DartClientCodegen
|
||||
|
||||
## Requirements
|
||||
|
||||
@ -15,11 +15,11 @@ Dart 1.20.0 or later OR Flutter 0.0.20 or later
|
||||
### Github
|
||||
If this Dart package is published to Github, please include the following in pubspec.yaml
|
||||
```
|
||||
name: swagger
|
||||
name: openapi
|
||||
version: 1.0.0
|
||||
description: Swagger API client
|
||||
description: OpenAPI API client
|
||||
dependencies:
|
||||
swagger:
|
||||
openapi:
|
||||
git: https://github.com/GIT_USER_ID/GIT_REPO_ID.git
|
||||
version: 'any'
|
||||
```
|
||||
@ -28,8 +28,8 @@ dependencies:
|
||||
To use the package in your local drive, please include the following in pubspec.yaml
|
||||
```
|
||||
dependencies:
|
||||
swagger:
|
||||
path: /path/to/swagger
|
||||
openapi:
|
||||
path: /path/to/openapi
|
||||
```
|
||||
|
||||
## Tests
|
||||
@ -41,16 +41,16 @@ TODO
|
||||
Please follow the [installation procedure](#installation--usage) and then run the following:
|
||||
|
||||
```dart
|
||||
import 'package:swagger/api.dart';
|
||||
import 'package:openapi/api.dart';
|
||||
|
||||
// TODO Configure OAuth2 access token for authorization: petstore_auth
|
||||
//swagger.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN';
|
||||
//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN';
|
||||
|
||||
var api_instance = new PetApi();
|
||||
var body = new Pet(); // Pet | Pet object that needs to be added to the store
|
||||
var pet = new Pet(); // Pet | Pet object that needs to be added to the store
|
||||
|
||||
try {
|
||||
api_instance.addPet(body);
|
||||
api_instance.addPet(pet);
|
||||
} catch (e) {
|
||||
print("Exception when calling PetApi->addPet: $e\n");
|
||||
}
|
||||
@ -59,7 +59,7 @@ try {
|
||||
|
||||
## Documentation for API Endpoints
|
||||
|
||||
All URIs are relative to *http://localhost/v2*
|
||||
All URIs are relative to *http://petstore.swagger.io/v2*
|
||||
|
||||
Class | Method | HTTP request | Description
|
||||
------------ | ------------- | ------------- | -------------
|
@ -1,8 +1,8 @@
|
||||
# swagger.model.ApiResponse
|
||||
# openapi.model.ApiResponse
|
||||
|
||||
## Load the model package
|
||||
```dart
|
||||
import 'package:swagger/api.dart';
|
||||
import 'package:openapi/api.dart';
|
||||
```
|
||||
|
||||
## Properties
|
@ -1,8 +1,8 @@
|
||||
# swagger.model.Category
|
||||
# openapi.model.Category
|
||||
|
||||
## Load the model package
|
||||
```dart
|
||||
import 'package:swagger/api.dart';
|
||||
import 'package:openapi/api.dart';
|
||||
```
|
||||
|
||||
## Properties
|
@ -1,8 +1,8 @@
|
||||
# swagger.model.Order
|
||||
# openapi.model.Order
|
||||
|
||||
## Load the model package
|
||||
```dart
|
||||
import 'package:swagger/api.dart';
|
||||
import 'package:openapi/api.dart';
|
||||
```
|
||||
|
||||
## Properties
|
||||
@ -13,7 +13,7 @@ Name | Type | Description | Notes
|
||||
**quantity** | **int** | | [optional] [default to null]
|
||||
**shipDate** | [**DateTime**](DateTime.md) | | [optional] [default to null]
|
||||
**status** | **String** | Order Status | [optional] [default to null]
|
||||
**complete** | **bool** | | [optional] [default to null]
|
||||
**complete** | **bool** | | [optional] [default to false]
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
@ -1,8 +1,8 @@
|
||||
# swagger.model.Pet
|
||||
# openapi.model.Pet
|
||||
|
||||
## Load the model package
|
||||
```dart
|
||||
import 'package:swagger/api.dart';
|
||||
import 'package:openapi/api.dart';
|
||||
```
|
||||
|
||||
## Properties
|
@ -1,11 +1,11 @@
|
||||
# swagger.api.PetApi
|
||||
# openapi.api.PetApi
|
||||
|
||||
## Load the API package
|
||||
```dart
|
||||
import 'package:swagger/api.dart';
|
||||
import 'package:openapi/api.dart';
|
||||
```
|
||||
|
||||
All URIs are relative to *http://localhost/v2*
|
||||
All URIs are relative to *http://petstore.swagger.io/v2*
|
||||
|
||||
Method | HTTP request | Description
|
||||
------------- | ------------- | -------------
|
||||
@ -20,23 +20,21 @@ Method | HTTP request | Description
|
||||
|
||||
|
||||
# **addPet**
|
||||
> addPet(body)
|
||||
> addPet(pet)
|
||||
|
||||
Add a new pet to the store
|
||||
|
||||
|
||||
|
||||
### Example
|
||||
```dart
|
||||
import 'package:swagger/api.dart';
|
||||
import 'package:openapi/api.dart';
|
||||
// TODO Configure OAuth2 access token for authorization: petstore_auth
|
||||
//swagger.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN';
|
||||
//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN';
|
||||
|
||||
var api_instance = new PetApi();
|
||||
var body = new Pet(); // Pet | Pet object that needs to be added to the store
|
||||
var pet = new Pet(); // Pet | Pet object that needs to be added to the store
|
||||
|
||||
try {
|
||||
api_instance.addPet(body);
|
||||
api_instance.addPet(pet);
|
||||
} catch (e) {
|
||||
print("Exception when calling PetApi->addPet: $e\n");
|
||||
}
|
||||
@ -46,7 +44,7 @@ try {
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
|
||||
**pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
|
||||
|
||||
### Return type
|
||||
|
||||
@ -59,7 +57,7 @@ void (empty response body)
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json, application/xml
|
||||
- **Accept**: application/xml, application/json
|
||||
- **Accept**: Not defined
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
@ -68,13 +66,11 @@ void (empty response body)
|
||||
|
||||
Deletes a pet
|
||||
|
||||
|
||||
|
||||
### Example
|
||||
```dart
|
||||
import 'package:swagger/api.dart';
|
||||
import 'package:openapi/api.dart';
|
||||
// TODO Configure OAuth2 access token for authorization: petstore_auth
|
||||
//swagger.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN';
|
||||
//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN';
|
||||
|
||||
var api_instance = new PetApi();
|
||||
var petId = 789; // int | Pet id to delete
|
||||
@ -105,7 +101,7 @@ void (empty response body)
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/xml, application/json
|
||||
- **Accept**: Not defined
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
@ -118,9 +114,9 @@ Multiple status values can be provided with comma separated strings
|
||||
|
||||
### Example
|
||||
```dart
|
||||
import 'package:swagger/api.dart';
|
||||
import 'package:openapi/api.dart';
|
||||
// TODO Configure OAuth2 access token for authorization: petstore_auth
|
||||
//swagger.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN';
|
||||
//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN';
|
||||
|
||||
var api_instance = new PetApi();
|
||||
var status = []; // List<String> | Status values that need to be considered for filter
|
||||
@ -163,9 +159,9 @@ Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3
|
||||
|
||||
### Example
|
||||
```dart
|
||||
import 'package:swagger/api.dart';
|
||||
import 'package:openapi/api.dart';
|
||||
// TODO Configure OAuth2 access token for authorization: petstore_auth
|
||||
//swagger.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN';
|
||||
//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN';
|
||||
|
||||
var api_instance = new PetApi();
|
||||
var tags = []; // List<String> | Tags to filter by
|
||||
@ -208,11 +204,11 @@ Returns a single pet
|
||||
|
||||
### Example
|
||||
```dart
|
||||
import 'package:swagger/api.dart';
|
||||
import 'package:openapi/api.dart';
|
||||
// TODO Configure API key authorization: api_key
|
||||
//swagger.api.Configuration.apiKey{'api_key'} = 'YOUR_API_KEY';
|
||||
//openapi.api.Configuration.apiKey{'api_key'} = 'YOUR_API_KEY';
|
||||
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
|
||||
//swagger.api.Configuration.apiKeyPrefix{'api_key'} = "Bearer";
|
||||
//openapi.api.Configuration.apiKeyPrefix{'api_key'} = "Bearer";
|
||||
|
||||
var api_instance = new PetApi();
|
||||
var petId = 789; // int | ID of pet to return
|
||||
@ -247,23 +243,21 @@ Name | Type | Description | Notes
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
# **updatePet**
|
||||
> updatePet(body)
|
||||
> updatePet(pet)
|
||||
|
||||
Update an existing pet
|
||||
|
||||
|
||||
|
||||
### Example
|
||||
```dart
|
||||
import 'package:swagger/api.dart';
|
||||
import 'package:openapi/api.dart';
|
||||
// TODO Configure OAuth2 access token for authorization: petstore_auth
|
||||
//swagger.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN';
|
||||
//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN';
|
||||
|
||||
var api_instance = new PetApi();
|
||||
var body = new Pet(); // Pet | Pet object that needs to be added to the store
|
||||
var pet = new Pet(); // Pet | Pet object that needs to be added to the store
|
||||
|
||||
try {
|
||||
api_instance.updatePet(body);
|
||||
api_instance.updatePet(pet);
|
||||
} catch (e) {
|
||||
print("Exception when calling PetApi->updatePet: $e\n");
|
||||
}
|
||||
@ -273,7 +267,7 @@ try {
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
|
||||
**pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
|
||||
|
||||
### Return type
|
||||
|
||||
@ -286,7 +280,7 @@ void (empty response body)
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json, application/xml
|
||||
- **Accept**: application/xml, application/json
|
||||
- **Accept**: Not defined
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
@ -295,13 +289,11 @@ void (empty response body)
|
||||
|
||||
Updates a pet in the store with form data
|
||||
|
||||
|
||||
|
||||
### Example
|
||||
```dart
|
||||
import 'package:swagger/api.dart';
|
||||
import 'package:openapi/api.dart';
|
||||
// TODO Configure OAuth2 access token for authorization: petstore_auth
|
||||
//swagger.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN';
|
||||
//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN';
|
||||
|
||||
var api_instance = new PetApi();
|
||||
var petId = 789; // int | ID of pet that needs to be updated
|
||||
@ -320,8 +312,8 @@ try {
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**petId** | **int**| ID of pet that needs to be updated |
|
||||
**name** | **String**| Updated name of the pet | [optional]
|
||||
**status** | **String**| Updated status of the pet | [optional]
|
||||
**name** | **String**| Updated name of the pet | [optional] [default to null]
|
||||
**status** | **String**| Updated status of the pet | [optional] [default to null]
|
||||
|
||||
### Return type
|
||||
|
||||
@ -334,7 +326,7 @@ void (empty response body)
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/x-www-form-urlencoded
|
||||
- **Accept**: application/xml, application/json
|
||||
- **Accept**: Not defined
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
@ -343,18 +335,16 @@ void (empty response body)
|
||||
|
||||
uploads an image
|
||||
|
||||
|
||||
|
||||
### Example
|
||||
```dart
|
||||
import 'package:swagger/api.dart';
|
||||
import 'package:openapi/api.dart';
|
||||
// TODO Configure OAuth2 access token for authorization: petstore_auth
|
||||
//swagger.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN';
|
||||
//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN';
|
||||
|
||||
var api_instance = new PetApi();
|
||||
var petId = 789; // int | ID of pet to update
|
||||
var additionalMetadata = additionalMetadata_example; // String | Additional data to pass to server
|
||||
var file = /path/to/file.txt; // MultipartFile | file to upload
|
||||
var file = BINARY_DATA_HERE; // MultipartFile | file to upload
|
||||
|
||||
try {
|
||||
var result = api_instance.uploadFile(petId, additionalMetadata, file);
|
||||
@ -369,8 +359,8 @@ try {
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**petId** | **int**| ID of pet to update |
|
||||
**additionalMetadata** | **String**| Additional data to pass to server | [optional]
|
||||
**file** | **MultipartFile**| file to upload | [optional]
|
||||
**additionalMetadata** | **String**| Additional data to pass to server | [optional] [default to null]
|
||||
**file** | **MultipartFile**| file to upload | [optional] [default to null]
|
||||
|
||||
### Return type
|
||||
|
@ -1,11 +1,11 @@
|
||||
# swagger.api.StoreApi
|
||||
# openapi.api.StoreApi
|
||||
|
||||
## Load the API package
|
||||
```dart
|
||||
import 'package:swagger/api.dart';
|
||||
import 'package:openapi/api.dart';
|
||||
```
|
||||
|
||||
All URIs are relative to *http://localhost/v2*
|
||||
All URIs are relative to *http://petstore.swagger.io/v2*
|
||||
|
||||
Method | HTTP request | Description
|
||||
------------- | ------------- | -------------
|
||||
@ -24,7 +24,7 @@ For valid response try integer IDs with value < 1000. Anything above 1000 or non
|
||||
|
||||
### Example
|
||||
```dart
|
||||
import 'package:swagger/api.dart';
|
||||
import 'package:openapi/api.dart';
|
||||
|
||||
var api_instance = new StoreApi();
|
||||
var orderId = orderId_example; // String | ID of the order that needs to be deleted
|
||||
@ -53,7 +53,7 @@ No authorization required
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/xml, application/json
|
||||
- **Accept**: Not defined
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
@ -66,11 +66,11 @@ Returns a map of status codes to quantities
|
||||
|
||||
### Example
|
||||
```dart
|
||||
import 'package:swagger/api.dart';
|
||||
import 'package:openapi/api.dart';
|
||||
// TODO Configure API key authorization: api_key
|
||||
//swagger.api.Configuration.apiKey{'api_key'} = 'YOUR_API_KEY';
|
||||
//openapi.api.Configuration.apiKey{'api_key'} = 'YOUR_API_KEY';
|
||||
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
|
||||
//swagger.api.Configuration.apiKeyPrefix{'api_key'} = "Bearer";
|
||||
//openapi.api.Configuration.apiKeyPrefix{'api_key'} = "Bearer";
|
||||
|
||||
var api_instance = new StoreApi();
|
||||
|
||||
@ -109,7 +109,7 @@ For valid response try integer IDs with value <= 5 or > 10. Other values will ge
|
||||
|
||||
### Example
|
||||
```dart
|
||||
import 'package:swagger/api.dart';
|
||||
import 'package:openapi/api.dart';
|
||||
|
||||
var api_instance = new StoreApi();
|
||||
var orderId = 789; // int | ID of pet that needs to be fetched
|
||||
@ -144,21 +144,19 @@ No authorization required
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
# **placeOrder**
|
||||
> Order placeOrder(body)
|
||||
> Order placeOrder(order)
|
||||
|
||||
Place an order for a pet
|
||||
|
||||
|
||||
|
||||
### Example
|
||||
```dart
|
||||
import 'package:swagger/api.dart';
|
||||
import 'package:openapi/api.dart';
|
||||
|
||||
var api_instance = new StoreApi();
|
||||
var body = new Order(); // Order | order placed for purchasing the pet
|
||||
var order = new Order(); // Order | order placed for purchasing the pet
|
||||
|
||||
try {
|
||||
var result = api_instance.placeOrder(body);
|
||||
var result = api_instance.placeOrder(order);
|
||||
print(result);
|
||||
} catch (e) {
|
||||
print("Exception when calling StoreApi->placeOrder: $e\n");
|
||||
@ -169,7 +167,7 @@ try {
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**body** | [**Order**](Order.md)| order placed for purchasing the pet |
|
||||
**order** | [**Order**](Order.md)| order placed for purchasing the pet |
|
||||
|
||||
### Return type
|
||||
|
@ -1,8 +1,8 @@
|
||||
# swagger.model.Tag
|
||||
# openapi.model.Tag
|
||||
|
||||
## Load the model package
|
||||
```dart
|
||||
import 'package:swagger/api.dart';
|
||||
import 'package:openapi/api.dart';
|
||||
```
|
||||
|
||||
## Properties
|
@ -1,8 +1,8 @@
|
||||
# swagger.model.User
|
||||
# openapi.model.User
|
||||
|
||||
## Load the model package
|
||||
```dart
|
||||
import 'package:swagger/api.dart';
|
||||
import 'package:openapi/api.dart';
|
||||
```
|
||||
|
||||
## Properties
|
@ -1,11 +1,11 @@
|
||||
# swagger.api.UserApi
|
||||
# openapi.api.UserApi
|
||||
|
||||
## Load the API package
|
||||
```dart
|
||||
import 'package:swagger/api.dart';
|
||||
import 'package:openapi/api.dart';
|
||||
```
|
||||
|
||||
All URIs are relative to *http://localhost/v2*
|
||||
All URIs are relative to *http://petstore.swagger.io/v2*
|
||||
|
||||
Method | HTTP request | Description
|
||||
------------- | ------------- | -------------
|
||||
@ -20,7 +20,7 @@ Method | HTTP request | Description
|
||||
|
||||
|
||||
# **createUser**
|
||||
> createUser(body)
|
||||
> createUser(user)
|
||||
|
||||
Create user
|
||||
|
||||
@ -28,13 +28,13 @@ This can only be done by the logged in user.
|
||||
|
||||
### Example
|
||||
```dart
|
||||
import 'package:swagger/api.dart';
|
||||
import 'package:openapi/api.dart';
|
||||
|
||||
var api_instance = new UserApi();
|
||||
var body = new User(); // User | Created user object
|
||||
var user = new User(); // User | Created user object
|
||||
|
||||
try {
|
||||
api_instance.createUser(body);
|
||||
api_instance.createUser(user);
|
||||
} catch (e) {
|
||||
print("Exception when calling UserApi->createUser: $e\n");
|
||||
}
|
||||
@ -44,7 +44,7 @@ try {
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**body** | [**User**](User.md)| Created user object |
|
||||
**user** | [**User**](User.md)| Created user object |
|
||||
|
||||
### Return type
|
||||
|
||||
@ -57,26 +57,24 @@ No authorization required
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/xml, application/json
|
||||
- **Accept**: Not defined
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
# **createUsersWithArrayInput**
|
||||
> createUsersWithArrayInput(body)
|
||||
> createUsersWithArrayInput(user)
|
||||
|
||||
Creates list of users with given input array
|
||||
|
||||
|
||||
|
||||
### Example
|
||||
```dart
|
||||
import 'package:swagger/api.dart';
|
||||
import 'package:openapi/api.dart';
|
||||
|
||||
var api_instance = new UserApi();
|
||||
var body = [new List<User>()]; // List<User> | List of user object
|
||||
var user = [new List<User>()]; // List<User> | List of user object
|
||||
|
||||
try {
|
||||
api_instance.createUsersWithArrayInput(body);
|
||||
api_instance.createUsersWithArrayInput(user);
|
||||
} catch (e) {
|
||||
print("Exception when calling UserApi->createUsersWithArrayInput: $e\n");
|
||||
}
|
||||
@ -86,7 +84,7 @@ try {
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**body** | [**List<User>**](User.md)| List of user object |
|
||||
**user** | [**List<User>**](List.md)| List of user object |
|
||||
|
||||
### Return type
|
||||
|
||||
@ -99,26 +97,24 @@ No authorization required
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/xml, application/json
|
||||
- **Accept**: Not defined
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
# **createUsersWithListInput**
|
||||
> createUsersWithListInput(body)
|
||||
> createUsersWithListInput(user)
|
||||
|
||||
Creates list of users with given input array
|
||||
|
||||
|
||||
|
||||
### Example
|
||||
```dart
|
||||
import 'package:swagger/api.dart';
|
||||
import 'package:openapi/api.dart';
|
||||
|
||||
var api_instance = new UserApi();
|
||||
var body = [new List<User>()]; // List<User> | List of user object
|
||||
var user = [new List<User>()]; // List<User> | List of user object
|
||||
|
||||
try {
|
||||
api_instance.createUsersWithListInput(body);
|
||||
api_instance.createUsersWithListInput(user);
|
||||
} catch (e) {
|
||||
print("Exception when calling UserApi->createUsersWithListInput: $e\n");
|
||||
}
|
||||
@ -128,7 +124,7 @@ try {
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**body** | [**List<User>**](User.md)| List of user object |
|
||||
**user** | [**List<User>**](List.md)| List of user object |
|
||||
|
||||
### Return type
|
||||
|
||||
@ -141,7 +137,7 @@ No authorization required
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/xml, application/json
|
||||
- **Accept**: Not defined
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
@ -154,7 +150,7 @@ This can only be done by the logged in user.
|
||||
|
||||
### Example
|
||||
```dart
|
||||
import 'package:swagger/api.dart';
|
||||
import 'package:openapi/api.dart';
|
||||
|
||||
var api_instance = new UserApi();
|
||||
var username = username_example; // String | The name that needs to be deleted
|
||||
@ -183,7 +179,7 @@ No authorization required
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/xml, application/json
|
||||
- **Accept**: Not defined
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
@ -192,11 +188,9 @@ No authorization required
|
||||
|
||||
Get user by user name
|
||||
|
||||
|
||||
|
||||
### Example
|
||||
```dart
|
||||
import 'package:swagger/api.dart';
|
||||
import 'package:openapi/api.dart';
|
||||
|
||||
var api_instance = new UserApi();
|
||||
var username = username_example; // String | The name that needs to be fetched. Use user1 for testing.
|
||||
@ -235,11 +229,9 @@ No authorization required
|
||||
|
||||
Logs user into the system
|
||||
|
||||
|
||||
|
||||
### Example
|
||||
```dart
|
||||
import 'package:swagger/api.dart';
|
||||
import 'package:openapi/api.dart';
|
||||
|
||||
var api_instance = new UserApi();
|
||||
var username = username_example; // String | The user name for login
|
||||
@ -280,11 +272,9 @@ No authorization required
|
||||
|
||||
Logs out current logged in user session
|
||||
|
||||
|
||||
|
||||
### Example
|
||||
```dart
|
||||
import 'package:swagger/api.dart';
|
||||
import 'package:openapi/api.dart';
|
||||
|
||||
var api_instance = new UserApi();
|
||||
|
||||
@ -309,12 +299,12 @@ No authorization required
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/xml, application/json
|
||||
- **Accept**: Not defined
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
# **updateUser**
|
||||
> updateUser(username, body)
|
||||
> updateUser(username, user)
|
||||
|
||||
Updated user
|
||||
|
||||
@ -322,14 +312,14 @@ This can only be done by the logged in user.
|
||||
|
||||
### Example
|
||||
```dart
|
||||
import 'package:swagger/api.dart';
|
||||
import 'package:openapi/api.dart';
|
||||
|
||||
var api_instance = new UserApi();
|
||||
var username = username_example; // String | name that need to be deleted
|
||||
var body = new User(); // User | Updated user object
|
||||
var user = new User(); // User | Updated user object
|
||||
|
||||
try {
|
||||
api_instance.updateUser(username, body);
|
||||
api_instance.updateUser(username, user);
|
||||
} catch (e) {
|
||||
print("Exception when calling UserApi->updateUser: $e\n");
|
||||
}
|
||||
@ -340,7 +330,7 @@ try {
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**username** | **String**| name that need to be deleted |
|
||||
**body** | [**User**](User.md)| Updated user object |
|
||||
**user** | [**User**](User.md)| Updated user object |
|
||||
|
||||
### Return type
|
||||
|
||||
@ -353,7 +343,7 @@ No authorization required
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/xml, application/json
|
||||
- **Accept**: Not defined
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
@ -1,7 +1,7 @@
|
||||
#!/bin/sh
|
||||
# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
|
||||
#
|
||||
# Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update"
|
||||
# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update"
|
||||
|
||||
git_user_id=$1
|
||||
git_repo_id=$2
|
@ -1,4 +1,4 @@
|
||||
library swagger.api;
|
||||
library openapi.api;
|
||||
|
||||
import 'dart:async';
|
||||
import 'dart:convert';
|
@ -1,4 +1,4 @@
|
||||
part of swagger.api;
|
||||
part of openapi.api;
|
||||
|
||||
|
||||
|
||||
@ -10,12 +10,12 @@ class PetApi {
|
||||
/// Add a new pet to the store
|
||||
///
|
||||
///
|
||||
Future addPet(Pet body) async {
|
||||
Object postBody = body;
|
||||
Future addPet(Pet pet) async {
|
||||
Object postBody = pet;
|
||||
|
||||
// verify required params are set
|
||||
if(body == null) {
|
||||
throw new ApiException(400, "Missing required param: body");
|
||||
if(pet == null) {
|
||||
throw new ApiException(400, "Missing required param: pet");
|
||||
}
|
||||
|
||||
// create path and map variables
|
||||
@ -34,7 +34,6 @@ class PetApi {
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
bool hasFields = false;
|
||||
MultipartRequest mp = new MultipartRequest(null, null);
|
||||
|
||||
if(hasFields)
|
||||
postBody = mp;
|
||||
}
|
||||
@ -53,9 +52,8 @@ class PetApi {
|
||||
if(response.statusCode >= 400) {
|
||||
throw new ApiException(response.statusCode, response.body);
|
||||
} else if(response.body != null) {
|
||||
return ;
|
||||
} else {
|
||||
return ;
|
||||
return;
|
||||
}
|
||||
}
|
||||
/// Deletes a pet
|
||||
@ -86,7 +84,6 @@ class PetApi {
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
bool hasFields = false;
|
||||
MultipartRequest mp = new MultipartRequest(null, null);
|
||||
|
||||
if(hasFields)
|
||||
postBody = mp;
|
||||
}
|
||||
@ -105,9 +102,8 @@ class PetApi {
|
||||
if(response.statusCode >= 400) {
|
||||
throw new ApiException(response.statusCode, response.body);
|
||||
} else if(response.body != null) {
|
||||
return ;
|
||||
} else {
|
||||
return ;
|
||||
return;
|
||||
}
|
||||
}
|
||||
/// Finds Pets by status
|
||||
@ -138,7 +134,6 @@ class PetApi {
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
bool hasFields = false;
|
||||
MultipartRequest mp = new MultipartRequest(null, null);
|
||||
|
||||
if(hasFields)
|
||||
postBody = mp;
|
||||
}
|
||||
@ -157,7 +152,7 @@ class PetApi {
|
||||
if(response.statusCode >= 400) {
|
||||
throw new ApiException(response.statusCode, response.body);
|
||||
} else if(response.body != null) {
|
||||
return apiClient.deserialize(response.body, 'List<Pet>') as List<Pet> ;
|
||||
return (apiClient.deserialize(response.body, 'List<Pet>') as List).map((item) => item as Pet).toList();
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
@ -190,7 +185,6 @@ class PetApi {
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
bool hasFields = false;
|
||||
MultipartRequest mp = new MultipartRequest(null, null);
|
||||
|
||||
if(hasFields)
|
||||
postBody = mp;
|
||||
}
|
||||
@ -209,7 +203,7 @@ class PetApi {
|
||||
if(response.statusCode >= 400) {
|
||||
throw new ApiException(response.statusCode, response.body);
|
||||
} else if(response.body != null) {
|
||||
return apiClient.deserialize(response.body, 'List<Pet>') as List<Pet> ;
|
||||
return (apiClient.deserialize(response.body, 'List<Pet>') as List).map((item) => item as Pet).toList();
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
@ -241,7 +235,6 @@ class PetApi {
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
bool hasFields = false;
|
||||
MultipartRequest mp = new MultipartRequest(null, null);
|
||||
|
||||
if(hasFields)
|
||||
postBody = mp;
|
||||
}
|
||||
@ -260,7 +253,7 @@ class PetApi {
|
||||
if(response.statusCode >= 400) {
|
||||
throw new ApiException(response.statusCode, response.body);
|
||||
} else if(response.body != null) {
|
||||
return apiClient.deserialize(response.body, 'Pet') as Pet ;
|
||||
return apiClient.deserialize(response.body, 'Pet') as Pet;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
@ -268,12 +261,12 @@ class PetApi {
|
||||
/// Update an existing pet
|
||||
///
|
||||
///
|
||||
Future updatePet(Pet body) async {
|
||||
Object postBody = body;
|
||||
Future updatePet(Pet pet) async {
|
||||
Object postBody = pet;
|
||||
|
||||
// verify required params are set
|
||||
if(body == null) {
|
||||
throw new ApiException(400, "Missing required param: body");
|
||||
if(pet == null) {
|
||||
throw new ApiException(400, "Missing required param: pet");
|
||||
}
|
||||
|
||||
// create path and map variables
|
||||
@ -292,7 +285,6 @@ class PetApi {
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
bool hasFields = false;
|
||||
MultipartRequest mp = new MultipartRequest(null, null);
|
||||
|
||||
if(hasFields)
|
||||
postBody = mp;
|
||||
}
|
||||
@ -311,9 +303,8 @@ class PetApi {
|
||||
if(response.statusCode >= 400) {
|
||||
throw new ApiException(response.statusCode, response.body);
|
||||
} else if(response.body != null) {
|
||||
return ;
|
||||
} else {
|
||||
return ;
|
||||
return;
|
||||
}
|
||||
}
|
||||
/// Updates a pet in the store with form data
|
||||
@ -343,24 +334,21 @@ class PetApi {
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
bool hasFields = false;
|
||||
MultipartRequest mp = new MultipartRequest(null, null);
|
||||
|
||||
if (name != null) {
|
||||
hasFields = true;
|
||||
mp.fields['name'] = parameterToString(name);
|
||||
}
|
||||
|
||||
if (status != null) {
|
||||
hasFields = true;
|
||||
mp.fields['status'] = parameterToString(status);
|
||||
}
|
||||
|
||||
if(hasFields)
|
||||
postBody = mp;
|
||||
}
|
||||
else {
|
||||
if (name != null)
|
||||
formParams['name'] = parameterToString(name);
|
||||
if (status != null)
|
||||
if (status != null)
|
||||
formParams['status'] = parameterToString(status);
|
||||
}
|
||||
|
||||
@ -376,9 +364,8 @@ if (status != null)
|
||||
if(response.statusCode >= 400) {
|
||||
throw new ApiException(response.statusCode, response.body);
|
||||
} else if(response.body != null) {
|
||||
return ;
|
||||
} else {
|
||||
return ;
|
||||
return;
|
||||
}
|
||||
}
|
||||
/// uploads an image
|
||||
@ -408,25 +395,21 @@ if (status != null)
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
bool hasFields = false;
|
||||
MultipartRequest mp = new MultipartRequest(null, null);
|
||||
|
||||
if (additionalMetadata != null) {
|
||||
hasFields = true;
|
||||
mp.fields['additionalMetadata'] = parameterToString(additionalMetadata);
|
||||
}
|
||||
|
||||
if (file != null) {
|
||||
hasFields = true;
|
||||
mp.fields['file'] = file.field;
|
||||
mp.files.add(file);
|
||||
}
|
||||
|
||||
if(hasFields)
|
||||
postBody = mp;
|
||||
}
|
||||
else {
|
||||
if (additionalMetadata != null)
|
||||
formParams['additionalMetadata'] = parameterToString(additionalMetadata);
|
||||
|
||||
}
|
||||
|
||||
var response = await apiClient.invokeAPI(path,
|
||||
@ -441,7 +424,7 @@ if (status != null)
|
||||
if(response.statusCode >= 400) {
|
||||
throw new ApiException(response.statusCode, response.body);
|
||||
} else if(response.body != null) {
|
||||
return apiClient.deserialize(response.body, 'ApiResponse') as ApiResponse ;
|
||||
return apiClient.deserialize(response.body, 'ApiResponse') as ApiResponse;
|
||||
} else {
|
||||
return null;
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
part of swagger.api;
|
||||
part of openapi.api;
|
||||
|
||||
|
||||
|
||||
@ -34,7 +34,6 @@ class StoreApi {
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
bool hasFields = false;
|
||||
MultipartRequest mp = new MultipartRequest(null, null);
|
||||
|
||||
if(hasFields)
|
||||
postBody = mp;
|
||||
}
|
||||
@ -53,9 +52,8 @@ class StoreApi {
|
||||
if(response.statusCode >= 400) {
|
||||
throw new ApiException(response.statusCode, response.body);
|
||||
} else if(response.body != null) {
|
||||
return ;
|
||||
} else {
|
||||
return ;
|
||||
return;
|
||||
}
|
||||
}
|
||||
/// Returns pet inventories by status
|
||||
@ -82,7 +80,6 @@ class StoreApi {
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
bool hasFields = false;
|
||||
MultipartRequest mp = new MultipartRequest(null, null);
|
||||
|
||||
if(hasFields)
|
||||
postBody = mp;
|
||||
}
|
||||
@ -101,7 +98,8 @@ class StoreApi {
|
||||
if(response.statusCode >= 400) {
|
||||
throw new ApiException(response.statusCode, response.body);
|
||||
} else if(response.body != null) {
|
||||
return apiClient.deserialize(response.body, 'Map<String, int>') as Map<String, int> ;
|
||||
return new Map<String, int>.from(apiClient.deserialize(response.body, 'Map<String, int>'));
|
||||
;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
@ -133,7 +131,6 @@ class StoreApi {
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
bool hasFields = false;
|
||||
MultipartRequest mp = new MultipartRequest(null, null);
|
||||
|
||||
if(hasFields)
|
||||
postBody = mp;
|
||||
}
|
||||
@ -152,7 +149,7 @@ class StoreApi {
|
||||
if(response.statusCode >= 400) {
|
||||
throw new ApiException(response.statusCode, response.body);
|
||||
} else if(response.body != null) {
|
||||
return apiClient.deserialize(response.body, 'Order') as Order ;
|
||||
return apiClient.deserialize(response.body, 'Order') as Order;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
@ -160,12 +157,12 @@ class StoreApi {
|
||||
/// Place an order for a pet
|
||||
///
|
||||
///
|
||||
Future<Order> placeOrder(Order body) async {
|
||||
Object postBody = body;
|
||||
Future<Order> placeOrder(Order order) async {
|
||||
Object postBody = order;
|
||||
|
||||
// verify required params are set
|
||||
if(body == null) {
|
||||
throw new ApiException(400, "Missing required param: body");
|
||||
if(order == null) {
|
||||
throw new ApiException(400, "Missing required param: order");
|
||||
}
|
||||
|
||||
// create path and map variables
|
||||
@ -184,7 +181,6 @@ class StoreApi {
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
bool hasFields = false;
|
||||
MultipartRequest mp = new MultipartRequest(null, null);
|
||||
|
||||
if(hasFields)
|
||||
postBody = mp;
|
||||
}
|
||||
@ -203,7 +199,7 @@ class StoreApi {
|
||||
if(response.statusCode >= 400) {
|
||||
throw new ApiException(response.statusCode, response.body);
|
||||
} else if(response.body != null) {
|
||||
return apiClient.deserialize(response.body, 'Order') as Order ;
|
||||
return apiClient.deserialize(response.body, 'Order') as Order;
|
||||
} else {
|
||||
return null;
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
part of swagger.api;
|
||||
part of openapi.api;
|
||||
|
||||
|
||||
|
||||
@ -10,12 +10,12 @@ class UserApi {
|
||||
/// Create user
|
||||
///
|
||||
/// This can only be done by the logged in user.
|
||||
Future createUser(User body) async {
|
||||
Object postBody = body;
|
||||
Future createUser(User user) async {
|
||||
Object postBody = user;
|
||||
|
||||
// verify required params are set
|
||||
if(body == null) {
|
||||
throw new ApiException(400, "Missing required param: body");
|
||||
if(user == null) {
|
||||
throw new ApiException(400, "Missing required param: user");
|
||||
}
|
||||
|
||||
// create path and map variables
|
||||
@ -34,7 +34,6 @@ class UserApi {
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
bool hasFields = false;
|
||||
MultipartRequest mp = new MultipartRequest(null, null);
|
||||
|
||||
if(hasFields)
|
||||
postBody = mp;
|
||||
}
|
||||
@ -53,20 +52,19 @@ class UserApi {
|
||||
if(response.statusCode >= 400) {
|
||||
throw new ApiException(response.statusCode, response.body);
|
||||
} else if(response.body != null) {
|
||||
return ;
|
||||
} else {
|
||||
return ;
|
||||
return;
|
||||
}
|
||||
}
|
||||
/// Creates list of users with given input array
|
||||
///
|
||||
///
|
||||
Future createUsersWithArrayInput(List<User> body) async {
|
||||
Object postBody = body;
|
||||
Future createUsersWithArrayInput(List<User> user) async {
|
||||
Object postBody = user;
|
||||
|
||||
// verify required params are set
|
||||
if(body == null) {
|
||||
throw new ApiException(400, "Missing required param: body");
|
||||
if(user == null) {
|
||||
throw new ApiException(400, "Missing required param: user");
|
||||
}
|
||||
|
||||
// create path and map variables
|
||||
@ -85,7 +83,6 @@ class UserApi {
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
bool hasFields = false;
|
||||
MultipartRequest mp = new MultipartRequest(null, null);
|
||||
|
||||
if(hasFields)
|
||||
postBody = mp;
|
||||
}
|
||||
@ -104,20 +101,19 @@ class UserApi {
|
||||
if(response.statusCode >= 400) {
|
||||
throw new ApiException(response.statusCode, response.body);
|
||||
} else if(response.body != null) {
|
||||
return ;
|
||||
} else {
|
||||
return ;
|
||||
return;
|
||||
}
|
||||
}
|
||||
/// Creates list of users with given input array
|
||||
///
|
||||
///
|
||||
Future createUsersWithListInput(List<User> body) async {
|
||||
Object postBody = body;
|
||||
Future createUsersWithListInput(List<User> user) async {
|
||||
Object postBody = user;
|
||||
|
||||
// verify required params are set
|
||||
if(body == null) {
|
||||
throw new ApiException(400, "Missing required param: body");
|
||||
if(user == null) {
|
||||
throw new ApiException(400, "Missing required param: user");
|
||||
}
|
||||
|
||||
// create path and map variables
|
||||
@ -136,7 +132,6 @@ class UserApi {
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
bool hasFields = false;
|
||||
MultipartRequest mp = new MultipartRequest(null, null);
|
||||
|
||||
if(hasFields)
|
||||
postBody = mp;
|
||||
}
|
||||
@ -155,9 +150,8 @@ class UserApi {
|
||||
if(response.statusCode >= 400) {
|
||||
throw new ApiException(response.statusCode, response.body);
|
||||
} else if(response.body != null) {
|
||||
return ;
|
||||
} else {
|
||||
return ;
|
||||
return;
|
||||
}
|
||||
}
|
||||
/// Delete user
|
||||
@ -187,7 +181,6 @@ class UserApi {
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
bool hasFields = false;
|
||||
MultipartRequest mp = new MultipartRequest(null, null);
|
||||
|
||||
if(hasFields)
|
||||
postBody = mp;
|
||||
}
|
||||
@ -206,9 +199,8 @@ class UserApi {
|
||||
if(response.statusCode >= 400) {
|
||||
throw new ApiException(response.statusCode, response.body);
|
||||
} else if(response.body != null) {
|
||||
return ;
|
||||
} else {
|
||||
return ;
|
||||
return;
|
||||
}
|
||||
}
|
||||
/// Get user by user name
|
||||
@ -238,7 +230,6 @@ class UserApi {
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
bool hasFields = false;
|
||||
MultipartRequest mp = new MultipartRequest(null, null);
|
||||
|
||||
if(hasFields)
|
||||
postBody = mp;
|
||||
}
|
||||
@ -257,7 +248,7 @@ class UserApi {
|
||||
if(response.statusCode >= 400) {
|
||||
throw new ApiException(response.statusCode, response.body);
|
||||
} else if(response.body != null) {
|
||||
return apiClient.deserialize(response.body, 'User') as User ;
|
||||
return apiClient.deserialize(response.body, 'User') as User;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
@ -294,7 +285,6 @@ class UserApi {
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
bool hasFields = false;
|
||||
MultipartRequest mp = new MultipartRequest(null, null);
|
||||
|
||||
if(hasFields)
|
||||
postBody = mp;
|
||||
}
|
||||
@ -313,7 +303,7 @@ class UserApi {
|
||||
if(response.statusCode >= 400) {
|
||||
throw new ApiException(response.statusCode, response.body);
|
||||
} else if(response.body != null) {
|
||||
return apiClient.deserialize(response.body, 'String') as String ;
|
||||
return apiClient.deserialize(response.body, 'String') as String;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
@ -342,7 +332,6 @@ class UserApi {
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
bool hasFields = false;
|
||||
MultipartRequest mp = new MultipartRequest(null, null);
|
||||
|
||||
if(hasFields)
|
||||
postBody = mp;
|
||||
}
|
||||
@ -361,23 +350,22 @@ class UserApi {
|
||||
if(response.statusCode >= 400) {
|
||||
throw new ApiException(response.statusCode, response.body);
|
||||
} else if(response.body != null) {
|
||||
return ;
|
||||
} else {
|
||||
return ;
|
||||
return;
|
||||
}
|
||||
}
|
||||
/// Updated user
|
||||
///
|
||||
/// This can only be done by the logged in user.
|
||||
Future updateUser(String username, User body) async {
|
||||
Object postBody = body;
|
||||
Future updateUser(String username, User user) async {
|
||||
Object postBody = user;
|
||||
|
||||
// verify required params are set
|
||||
if(username == null) {
|
||||
throw new ApiException(400, "Missing required param: username");
|
||||
}
|
||||
if(body == null) {
|
||||
throw new ApiException(400, "Missing required param: body");
|
||||
if(user == null) {
|
||||
throw new ApiException(400, "Missing required param: user");
|
||||
}
|
||||
|
||||
// create path and map variables
|
||||
@ -396,7 +384,6 @@ class UserApi {
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
bool hasFields = false;
|
||||
MultipartRequest mp = new MultipartRequest(null, null);
|
||||
|
||||
if(hasFields)
|
||||
postBody = mp;
|
||||
}
|
||||
@ -415,9 +402,8 @@ class UserApi {
|
||||
if(response.statusCode >= 400) {
|
||||
throw new ApiException(response.statusCode, response.body);
|
||||
} else if(response.body != null) {
|
||||
return ;
|
||||
} else {
|
||||
return ;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
part of swagger.api;
|
||||
part of openapi.api;
|
||||
|
||||
class QueryParam {
|
||||
String name;
|
||||
@ -18,7 +18,7 @@ class ApiClient {
|
||||
final _RegList = new RegExp(r'^List<(.*)>$');
|
||||
final _RegMap = new RegExp(r'^Map<String,(.*)>$');
|
||||
|
||||
ApiClient({this.basePath: "http://localhost/v2"}) {
|
||||
ApiClient({this.basePath: "http://petstore.swagger.io/v2"}) {
|
||||
// Setup authentications (key: authentication name, value: authentication).
|
||||
_authentications['api_key'] = new ApiKeyAuth("header", "api_key");
|
||||
_authentications['petstore_auth'] = new OAuth();
|
@ -1,4 +1,4 @@
|
||||
part of swagger.api;
|
||||
part of openapi.api;
|
||||
|
||||
class ApiException implements Exception {
|
||||
int code = 0;
|
@ -1,4 +1,4 @@
|
||||
part of swagger.api;
|
||||
part of openapi.api;
|
||||
|
||||
const _delimiters = const {'csv': ',', 'ssv': ' ', 'tsv': '\t', 'pipes': '|'};
|
||||
|
@ -1,4 +1,4 @@
|
||||
part of swagger.api;
|
||||
part of openapi.api;
|
||||
|
||||
class ApiKeyAuth implements Authentication {
|
||||
|
@ -1,4 +1,4 @@
|
||||
part of swagger.api;
|
||||
part of openapi.api;
|
||||
|
||||
abstract class Authentication {
|
||||
|
@ -1,4 +1,4 @@
|
||||
part of swagger.api;
|
||||
part of openapi.api;
|
||||
|
||||
class HttpBasicAuth implements Authentication {
|
||||
|
@ -1,4 +1,4 @@
|
||||
part of swagger.api;
|
||||
part of openapi.api;
|
||||
|
||||
class OAuth implements Authentication {
|
||||
String accessToken;
|
@ -1,15 +1,12 @@
|
||||
part of swagger.api;
|
||||
part of openapi.api;
|
||||
|
||||
class ApiResponse {
|
||||
|
||||
int code = null;
|
||||
|
||||
|
||||
String type = null;
|
||||
|
||||
|
||||
String message = null;
|
||||
|
||||
ApiResponse();
|
||||
|
||||
@override
|
||||
@ -19,12 +16,9 @@ class ApiResponse {
|
||||
|
||||
ApiResponse.fromJson(Map<String, dynamic> json) {
|
||||
if (json == null) return;
|
||||
code =
|
||||
json['code'];
|
||||
type =
|
||||
json['type'];
|
||||
message =
|
||||
json['message'];
|
||||
code = json['code'];
|
||||
type = json['type'];
|
||||
message = json['message'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
@ -35,12 +29,8 @@ class ApiResponse {
|
||||
};
|
||||
}
|
||||
|
||||
static List<ApiResponse> listFromJson(List<Map<String, dynamic>> json) {
|
||||
var list = new List<ApiResponse>();
|
||||
if (json != null && json.length > 0) {
|
||||
json.forEach((Map<String, dynamic> value) => list.add(new ApiResponse.fromJson(value)));
|
||||
}
|
||||
return list;
|
||||
static List<ApiResponse> listFromJson(List<dynamic> json) {
|
||||
return json == null ? new List<ApiResponse>() : json.map((value) => new ApiResponse.fromJson(value)).toList();
|
||||
}
|
||||
|
||||
static Map<String, ApiResponse> mapFromJson(Map<String, Map<String, dynamic>> json) {
|
@ -1,12 +1,10 @@
|
||||
part of swagger.api;
|
||||
part of openapi.api;
|
||||
|
||||
class Category {
|
||||
|
||||
int id = null;
|
||||
|
||||
|
||||
String name = null;
|
||||
|
||||
Category();
|
||||
|
||||
@override
|
||||
@ -16,10 +14,8 @@ class Category {
|
||||
|
||||
Category.fromJson(Map<String, dynamic> json) {
|
||||
if (json == null) return;
|
||||
id =
|
||||
json['id'];
|
||||
name =
|
||||
json['name'];
|
||||
id = json['id'];
|
||||
name = json['name'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
@ -29,12 +25,8 @@ class Category {
|
||||
};
|
||||
}
|
||||
|
||||
static List<Category> listFromJson(List<Map<String, dynamic>> json) {
|
||||
var list = new List<Category>();
|
||||
if (json != null && json.length > 0) {
|
||||
json.forEach((Map<String, dynamic> value) => list.add(new Category.fromJson(value)));
|
||||
}
|
||||
return list;
|
||||
static List<Category> listFromJson(List<dynamic> json) {
|
||||
return json == null ? new List<Category>() : json.map((value) => new Category.fromJson(value)).toList();
|
||||
}
|
||||
|
||||
static Map<String, Category> mapFromJson(Map<String, Map<String, dynamic>> json) {
|
@ -1,24 +1,19 @@
|
||||
part of swagger.api;
|
||||
part of openapi.api;
|
||||
|
||||
class Order {
|
||||
|
||||
int id = null;
|
||||
|
||||
|
||||
int petId = null;
|
||||
|
||||
|
||||
int quantity = null;
|
||||
|
||||
|
||||
DateTime shipDate = null;
|
||||
|
||||
/* Order Status */
|
||||
/* Order Status */
|
||||
String status = null;
|
||||
//enum statusEnum { placed, approved, delivered, };
|
||||
|
||||
bool complete = null;
|
||||
//enum statusEnum { placed, approved, delivered, };{
|
||||
|
||||
bool complete = false;
|
||||
Order();
|
||||
|
||||
@override
|
||||
@ -28,17 +23,12 @@ class Order {
|
||||
|
||||
Order.fromJson(Map<String, dynamic> json) {
|
||||
if (json == null) return;
|
||||
id =
|
||||
json['id'];
|
||||
petId =
|
||||
json['petId'];
|
||||
quantity =
|
||||
json['quantity'];
|
||||
id = json['id'];
|
||||
petId = json['petId'];
|
||||
quantity = json['quantity'];
|
||||
shipDate = json['shipDate'] == null ? null : DateTime.parse(json['shipDate']);
|
||||
status =
|
||||
json['status'];
|
||||
complete =
|
||||
json['complete'];
|
||||
status = json['status'];
|
||||
complete = json['complete'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
@ -52,12 +42,8 @@ class Order {
|
||||
};
|
||||
}
|
||||
|
||||
static List<Order> listFromJson(List<Map<String, dynamic>> json) {
|
||||
var list = new List<Order>();
|
||||
if (json != null && json.length > 0) {
|
||||
json.forEach((Map<String, dynamic> value) => list.add(new Order.fromJson(value)));
|
||||
}
|
||||
return list;
|
||||
static List<Order> listFromJson(List<dynamic> json) {
|
||||
return json == null ? new List<Order>() : json.map((value) => new Order.fromJson(value)).toList();
|
||||
}
|
||||
|
||||
static Map<String, Order> mapFromJson(Map<String, Map<String, dynamic>> json) {
|
@ -1,24 +1,19 @@
|
||||
part of swagger.api;
|
||||
part of openapi.api;
|
||||
|
||||
class Pet {
|
||||
|
||||
int id = null;
|
||||
|
||||
|
||||
Category category = null;
|
||||
|
||||
|
||||
String name = null;
|
||||
|
||||
|
||||
List<String> photoUrls = [];
|
||||
|
||||
|
||||
List<Tag> tags = [];
|
||||
|
||||
/* pet status in the store */
|
||||
/* pet status in the store */
|
||||
String status = null;
|
||||
//enum statusEnum { available, pending, sold, };
|
||||
//enum statusEnum { available, pending, sold, };{
|
||||
Pet();
|
||||
|
||||
@override
|
||||
@ -28,22 +23,12 @@ class Pet {
|
||||
|
||||
Pet.fromJson(Map<String, dynamic> json) {
|
||||
if (json == null) return;
|
||||
id =
|
||||
json['id'];
|
||||
category =
|
||||
|
||||
|
||||
new Category.fromJson(json['category'])
|
||||
;
|
||||
name =
|
||||
json['name'];
|
||||
photoUrls =
|
||||
json['photoUrls'];
|
||||
tags =
|
||||
Tag.listFromJson(json['tags'])
|
||||
;
|
||||
status =
|
||||
json['status'];
|
||||
id = json['id'];
|
||||
category = new Category.fromJson(json['category']);
|
||||
name = json['name'];
|
||||
photoUrls = (json['photoUrls'] as List).map((item) => item as String).toList();
|
||||
tags = Tag.listFromJson(json['tags']);
|
||||
status = json['status'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
@ -57,12 +42,8 @@ class Pet {
|
||||
};
|
||||
}
|
||||
|
||||
static List<Pet> listFromJson(List<Map<String, dynamic>> json) {
|
||||
var list = new List<Pet>();
|
||||
if (json != null && json.length > 0) {
|
||||
json.forEach((Map<String, dynamic> value) => list.add(new Pet.fromJson(value)));
|
||||
}
|
||||
return list;
|
||||
static List<Pet> listFromJson(List<dynamic> json) {
|
||||
return json == null ? new List<Pet>() : json.map((value) => new Pet.fromJson(value)).toList();
|
||||
}
|
||||
|
||||
static Map<String, Pet> mapFromJson(Map<String, Map<String, dynamic>> json) {
|
@ -1,12 +1,10 @@
|
||||
part of swagger.api;
|
||||
part of openapi.api;
|
||||
|
||||
class Tag {
|
||||
|
||||
int id = null;
|
||||
|
||||
|
||||
String name = null;
|
||||
|
||||
Tag();
|
||||
|
||||
@override
|
||||
@ -16,10 +14,8 @@ class Tag {
|
||||
|
||||
Tag.fromJson(Map<String, dynamic> json) {
|
||||
if (json == null) return;
|
||||
id =
|
||||
json['id'];
|
||||
name =
|
||||
json['name'];
|
||||
id = json['id'];
|
||||
name = json['name'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
@ -29,12 +25,8 @@ class Tag {
|
||||
};
|
||||
}
|
||||
|
||||
static List<Tag> listFromJson(List<Map<String, dynamic>> json) {
|
||||
var list = new List<Tag>();
|
||||
if (json != null && json.length > 0) {
|
||||
json.forEach((Map<String, dynamic> value) => list.add(new Tag.fromJson(value)));
|
||||
}
|
||||
return list;
|
||||
static List<Tag> listFromJson(List<dynamic> json) {
|
||||
return json == null ? new List<Tag>() : json.map((value) => new Tag.fromJson(value)).toList();
|
||||
}
|
||||
|
||||
static Map<String, Tag> mapFromJson(Map<String, Map<String, dynamic>> json) {
|
@ -1,30 +1,22 @@
|
||||
part of swagger.api;
|
||||
part of openapi.api;
|
||||
|
||||
class User {
|
||||
|
||||
int id = null;
|
||||
|
||||
|
||||
String username = null;
|
||||
|
||||
|
||||
String firstName = null;
|
||||
|
||||
|
||||
String lastName = null;
|
||||
|
||||
|
||||
String email = null;
|
||||
|
||||
|
||||
String password = null;
|
||||
|
||||
|
||||
String phone = null;
|
||||
|
||||
/* User Status */
|
||||
/* User Status */
|
||||
int userStatus = null;
|
||||
|
||||
User();
|
||||
|
||||
@override
|
||||
@ -34,22 +26,14 @@ class User {
|
||||
|
||||
User.fromJson(Map<String, dynamic> json) {
|
||||
if (json == null) return;
|
||||
id =
|
||||
json['id'];
|
||||
username =
|
||||
json['username'];
|
||||
firstName =
|
||||
json['firstName'];
|
||||
lastName =
|
||||
json['lastName'];
|
||||
email =
|
||||
json['email'];
|
||||
password =
|
||||
json['password'];
|
||||
phone =
|
||||
json['phone'];
|
||||
userStatus =
|
||||
json['userStatus'];
|
||||
id = json['id'];
|
||||
username = json['username'];
|
||||
firstName = json['firstName'];
|
||||
lastName = json['lastName'];
|
||||
email = json['email'];
|
||||
password = json['password'];
|
||||
phone = json['phone'];
|
||||
userStatus = json['userStatus'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
@ -65,12 +49,8 @@ class User {
|
||||
};
|
||||
}
|
||||
|
||||
static List<User> listFromJson(List<Map<String, dynamic>> json) {
|
||||
var list = new List<User>();
|
||||
if (json != null && json.length > 0) {
|
||||
json.forEach((Map<String, dynamic> value) => list.add(new User.fromJson(value)));
|
||||
}
|
||||
return list;
|
||||
static List<User> listFromJson(List<dynamic> json) {
|
||||
return json == null ? new List<User>() : json.map((value) => new User.fromJson(value)).toList();
|
||||
}
|
||||
|
||||
static Map<String, User> mapFromJson(Map<String, Map<String, dynamic>> json) {
|
@ -1,5 +1,5 @@
|
||||
name: swagger
|
||||
name: openapi
|
||||
version: 1.0.0
|
||||
description: Swagger API client
|
||||
description: OpenAPI API client
|
||||
dependencies:
|
||||
http: '>=0.11.1 <0.12.0'
|
2
samples/client/petstore/dart/openapi/.analysis_options
Normal file
2
samples/client/petstore/dart/openapi/.analysis_options
Normal file
@ -0,0 +1,2 @@
|
||||
analyzer:
|
||||
strong-mode: true
|
@ -0,0 +1,23 @@
|
||||
# OpenAPI Generator Ignore
|
||||
# Generated by openapi-generator https://github.com/openapitools/openapi-generator
|
||||
|
||||
# Use this file to prevent files from being overwritten by the generator.
|
||||
# The patterns follow closely to .gitignore or .dockerignore.
|
||||
|
||||
# As an example, the C# client generator defines ApiClient.cs.
|
||||
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
|
||||
#ApiClient.cs
|
||||
|
||||
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
|
||||
#foo/*/qux
|
||||
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
|
||||
|
||||
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
|
||||
#foo/**/qux
|
||||
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
|
||||
|
||||
# You can also negate patterns with an exclamation (!).
|
||||
# For example, you can ignore all files in a docs folder with the file extension .md:
|
||||
#docs/*.md
|
||||
# Then explicitly reverse the ignore rule for a single file:
|
||||
#!docs/README.md
|
@ -0,0 +1 @@
|
||||
3.0.0-SNAPSHOT
|
@ -1,10 +1,10 @@
|
||||
# swagger
|
||||
# openapi
|
||||
This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
|
||||
This Dart package is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:
|
||||
This Dart package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
|
||||
|
||||
- API version: 1.0.0
|
||||
- Build package: io.swagger.codegen.languages.DartClientCodegen
|
||||
- Build package: org.openapitools.codegen.languages.DartClientCodegen
|
||||
|
||||
## Requirements
|
||||
|
||||
@ -15,11 +15,11 @@ Dart 1.20.0 or later OR Flutter 0.0.20 or later
|
||||
### Github
|
||||
If this Dart package is published to Github, please include the following in pubspec.yaml
|
||||
```
|
||||
name: swagger
|
||||
name: openapi
|
||||
version: 1.0.0
|
||||
description: Swagger API client
|
||||
description: OpenAPI API client
|
||||
dependencies:
|
||||
swagger:
|
||||
openapi:
|
||||
git: https://github.com/GIT_USER_ID/GIT_REPO_ID.git
|
||||
version: 'any'
|
||||
```
|
||||
@ -28,8 +28,8 @@ dependencies:
|
||||
To use the package in your local drive, please include the following in pubspec.yaml
|
||||
```
|
||||
dependencies:
|
||||
swagger:
|
||||
path: /path/to/swagger
|
||||
openapi:
|
||||
path: /path/to/openapi
|
||||
```
|
||||
|
||||
## Tests
|
||||
@ -41,16 +41,16 @@ TODO
|
||||
Please follow the [installation procedure](#installation--usage) and then run the following:
|
||||
|
||||
```dart
|
||||
import 'package:swagger/api.dart';
|
||||
import 'package:openapi/api.dart';
|
||||
|
||||
// TODO Configure OAuth2 access token for authorization: petstore_auth
|
||||
//swagger.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN';
|
||||
//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN';
|
||||
|
||||
var api_instance = new PetApi();
|
||||
var body = new Pet(); // Pet | Pet object that needs to be added to the store
|
||||
var pet = new Pet(); // Pet | Pet object that needs to be added to the store
|
||||
|
||||
try {
|
||||
api_instance.addPet(body);
|
||||
api_instance.addPet(pet);
|
||||
} catch (e) {
|
||||
print("Exception when calling PetApi->addPet: $e\n");
|
||||
}
|
||||
@ -59,7 +59,7 @@ try {
|
||||
|
||||
## Documentation for API Endpoints
|
||||
|
||||
All URIs are relative to *http://localhost/v2*
|
||||
All URIs are relative to *http://petstore.swagger.io/v2*
|
||||
|
||||
Class | Method | HTTP request | Description
|
||||
------------ | ------------- | ------------- | -------------
|
@ -1,8 +1,8 @@
|
||||
# swagger.model.ApiResponse
|
||||
# openapi.model.ApiResponse
|
||||
|
||||
## Load the model package
|
||||
```dart
|
||||
import 'package:swagger/api.dart';
|
||||
import 'package:openapi/api.dart';
|
||||
```
|
||||
|
||||
## Properties
|
@ -1,8 +1,8 @@
|
||||
# swagger.model.Category
|
||||
# openapi.model.Category
|
||||
|
||||
## Load the model package
|
||||
```dart
|
||||
import 'package:swagger/api.dart';
|
||||
import 'package:openapi/api.dart';
|
||||
```
|
||||
|
||||
## Properties
|
@ -1,8 +1,8 @@
|
||||
# swagger.model.Order
|
||||
# openapi.model.Order
|
||||
|
||||
## Load the model package
|
||||
```dart
|
||||
import 'package:swagger/api.dart';
|
||||
import 'package:openapi/api.dart';
|
||||
```
|
||||
|
||||
## Properties
|
||||
@ -13,7 +13,7 @@ Name | Type | Description | Notes
|
||||
**quantity** | **int** | | [optional] [default to null]
|
||||
**shipDate** | [**DateTime**](DateTime.md) | | [optional] [default to null]
|
||||
**status** | **String** | Order Status | [optional] [default to null]
|
||||
**complete** | **bool** | | [optional] [default to null]
|
||||
**complete** | **bool** | | [optional] [default to false]
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
@ -1,8 +1,8 @@
|
||||
# swagger.model.Pet
|
||||
# openapi.model.Pet
|
||||
|
||||
## Load the model package
|
||||
```dart
|
||||
import 'package:swagger/api.dart';
|
||||
import 'package:openapi/api.dart';
|
||||
```
|
||||
|
||||
## Properties
|
@ -1,11 +1,11 @@
|
||||
# swagger.api.PetApi
|
||||
# openapi.api.PetApi
|
||||
|
||||
## Load the API package
|
||||
```dart
|
||||
import 'package:swagger/api.dart';
|
||||
import 'package:openapi/api.dart';
|
||||
```
|
||||
|
||||
All URIs are relative to *http://localhost/v2*
|
||||
All URIs are relative to *http://petstore.swagger.io/v2*
|
||||
|
||||
Method | HTTP request | Description
|
||||
------------- | ------------- | -------------
|
||||
@ -20,23 +20,21 @@ Method | HTTP request | Description
|
||||
|
||||
|
||||
# **addPet**
|
||||
> addPet(body)
|
||||
> addPet(pet)
|
||||
|
||||
Add a new pet to the store
|
||||
|
||||
|
||||
|
||||
### Example
|
||||
```dart
|
||||
import 'package:swagger/api.dart';
|
||||
import 'package:openapi/api.dart';
|
||||
// TODO Configure OAuth2 access token for authorization: petstore_auth
|
||||
//swagger.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN';
|
||||
//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN';
|
||||
|
||||
var api_instance = new PetApi();
|
||||
var body = new Pet(); // Pet | Pet object that needs to be added to the store
|
||||
var pet = new Pet(); // Pet | Pet object that needs to be added to the store
|
||||
|
||||
try {
|
||||
api_instance.addPet(body);
|
||||
api_instance.addPet(pet);
|
||||
} catch (e) {
|
||||
print("Exception when calling PetApi->addPet: $e\n");
|
||||
}
|
||||
@ -46,7 +44,7 @@ try {
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
|
||||
**pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
|
||||
|
||||
### Return type
|
||||
|
||||
@ -59,7 +57,7 @@ void (empty response body)
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json, application/xml
|
||||
- **Accept**: application/xml, application/json
|
||||
- **Accept**: Not defined
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
@ -68,13 +66,11 @@ void (empty response body)
|
||||
|
||||
Deletes a pet
|
||||
|
||||
|
||||
|
||||
### Example
|
||||
```dart
|
||||
import 'package:swagger/api.dart';
|
||||
import 'package:openapi/api.dart';
|
||||
// TODO Configure OAuth2 access token for authorization: petstore_auth
|
||||
//swagger.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN';
|
||||
//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN';
|
||||
|
||||
var api_instance = new PetApi();
|
||||
var petId = 789; // int | Pet id to delete
|
||||
@ -105,7 +101,7 @@ void (empty response body)
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/xml, application/json
|
||||
- **Accept**: Not defined
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
@ -118,9 +114,9 @@ Multiple status values can be provided with comma separated strings
|
||||
|
||||
### Example
|
||||
```dart
|
||||
import 'package:swagger/api.dart';
|
||||
import 'package:openapi/api.dart';
|
||||
// TODO Configure OAuth2 access token for authorization: petstore_auth
|
||||
//swagger.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN';
|
||||
//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN';
|
||||
|
||||
var api_instance = new PetApi();
|
||||
var status = []; // List<String> | Status values that need to be considered for filter
|
||||
@ -163,9 +159,9 @@ Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3
|
||||
|
||||
### Example
|
||||
```dart
|
||||
import 'package:swagger/api.dart';
|
||||
import 'package:openapi/api.dart';
|
||||
// TODO Configure OAuth2 access token for authorization: petstore_auth
|
||||
//swagger.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN';
|
||||
//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN';
|
||||
|
||||
var api_instance = new PetApi();
|
||||
var tags = []; // List<String> | Tags to filter by
|
||||
@ -208,11 +204,11 @@ Returns a single pet
|
||||
|
||||
### Example
|
||||
```dart
|
||||
import 'package:swagger/api.dart';
|
||||
import 'package:openapi/api.dart';
|
||||
// TODO Configure API key authorization: api_key
|
||||
//swagger.api.Configuration.apiKey{'api_key'} = 'YOUR_API_KEY';
|
||||
//openapi.api.Configuration.apiKey{'api_key'} = 'YOUR_API_KEY';
|
||||
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
|
||||
//swagger.api.Configuration.apiKeyPrefix{'api_key'} = "Bearer";
|
||||
//openapi.api.Configuration.apiKeyPrefix{'api_key'} = "Bearer";
|
||||
|
||||
var api_instance = new PetApi();
|
||||
var petId = 789; // int | ID of pet to return
|
||||
@ -247,23 +243,21 @@ Name | Type | Description | Notes
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
# **updatePet**
|
||||
> updatePet(body)
|
||||
> updatePet(pet)
|
||||
|
||||
Update an existing pet
|
||||
|
||||
|
||||
|
||||
### Example
|
||||
```dart
|
||||
import 'package:swagger/api.dart';
|
||||
import 'package:openapi/api.dart';
|
||||
// TODO Configure OAuth2 access token for authorization: petstore_auth
|
||||
//swagger.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN';
|
||||
//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN';
|
||||
|
||||
var api_instance = new PetApi();
|
||||
var body = new Pet(); // Pet | Pet object that needs to be added to the store
|
||||
var pet = new Pet(); // Pet | Pet object that needs to be added to the store
|
||||
|
||||
try {
|
||||
api_instance.updatePet(body);
|
||||
api_instance.updatePet(pet);
|
||||
} catch (e) {
|
||||
print("Exception when calling PetApi->updatePet: $e\n");
|
||||
}
|
||||
@ -273,7 +267,7 @@ try {
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
|
||||
**pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
|
||||
|
||||
### Return type
|
||||
|
||||
@ -286,7 +280,7 @@ void (empty response body)
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json, application/xml
|
||||
- **Accept**: application/xml, application/json
|
||||
- **Accept**: Not defined
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
@ -295,13 +289,11 @@ void (empty response body)
|
||||
|
||||
Updates a pet in the store with form data
|
||||
|
||||
|
||||
|
||||
### Example
|
||||
```dart
|
||||
import 'package:swagger/api.dart';
|
||||
import 'package:openapi/api.dart';
|
||||
// TODO Configure OAuth2 access token for authorization: petstore_auth
|
||||
//swagger.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN';
|
||||
//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN';
|
||||
|
||||
var api_instance = new PetApi();
|
||||
var petId = 789; // int | ID of pet that needs to be updated
|
||||
@ -320,8 +312,8 @@ try {
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**petId** | **int**| ID of pet that needs to be updated |
|
||||
**name** | **String**| Updated name of the pet | [optional]
|
||||
**status** | **String**| Updated status of the pet | [optional]
|
||||
**name** | **String**| Updated name of the pet | [optional] [default to null]
|
||||
**status** | **String**| Updated status of the pet | [optional] [default to null]
|
||||
|
||||
### Return type
|
||||
|
||||
@ -334,7 +326,7 @@ void (empty response body)
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/x-www-form-urlencoded
|
||||
- **Accept**: application/xml, application/json
|
||||
- **Accept**: Not defined
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
@ -343,18 +335,16 @@ void (empty response body)
|
||||
|
||||
uploads an image
|
||||
|
||||
|
||||
|
||||
### Example
|
||||
```dart
|
||||
import 'package:swagger/api.dart';
|
||||
import 'package:openapi/api.dart';
|
||||
// TODO Configure OAuth2 access token for authorization: petstore_auth
|
||||
//swagger.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN';
|
||||
//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN';
|
||||
|
||||
var api_instance = new PetApi();
|
||||
var petId = 789; // int | ID of pet to update
|
||||
var additionalMetadata = additionalMetadata_example; // String | Additional data to pass to server
|
||||
var file = /path/to/file.txt; // MultipartFile | file to upload
|
||||
var file = BINARY_DATA_HERE; // MultipartFile | file to upload
|
||||
|
||||
try {
|
||||
var result = api_instance.uploadFile(petId, additionalMetadata, file);
|
||||
@ -369,8 +359,8 @@ try {
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**petId** | **int**| ID of pet to update |
|
||||
**additionalMetadata** | **String**| Additional data to pass to server | [optional]
|
||||
**file** | **MultipartFile**| file to upload | [optional]
|
||||
**additionalMetadata** | **String**| Additional data to pass to server | [optional] [default to null]
|
||||
**file** | **MultipartFile**| file to upload | [optional] [default to null]
|
||||
|
||||
### Return type
|
||||
|
@ -1,11 +1,11 @@
|
||||
# swagger.api.StoreApi
|
||||
# openapi.api.StoreApi
|
||||
|
||||
## Load the API package
|
||||
```dart
|
||||
import 'package:swagger/api.dart';
|
||||
import 'package:openapi/api.dart';
|
||||
```
|
||||
|
||||
All URIs are relative to *http://localhost/v2*
|
||||
All URIs are relative to *http://petstore.swagger.io/v2*
|
||||
|
||||
Method | HTTP request | Description
|
||||
------------- | ------------- | -------------
|
||||
@ -24,7 +24,7 @@ For valid response try integer IDs with value < 1000. Anything above 1000 or non
|
||||
|
||||
### Example
|
||||
```dart
|
||||
import 'package:swagger/api.dart';
|
||||
import 'package:openapi/api.dart';
|
||||
|
||||
var api_instance = new StoreApi();
|
||||
var orderId = orderId_example; // String | ID of the order that needs to be deleted
|
||||
@ -53,7 +53,7 @@ No authorization required
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/xml, application/json
|
||||
- **Accept**: Not defined
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
@ -66,11 +66,11 @@ Returns a map of status codes to quantities
|
||||
|
||||
### Example
|
||||
```dart
|
||||
import 'package:swagger/api.dart';
|
||||
import 'package:openapi/api.dart';
|
||||
// TODO Configure API key authorization: api_key
|
||||
//swagger.api.Configuration.apiKey{'api_key'} = 'YOUR_API_KEY';
|
||||
//openapi.api.Configuration.apiKey{'api_key'} = 'YOUR_API_KEY';
|
||||
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
|
||||
//swagger.api.Configuration.apiKeyPrefix{'api_key'} = "Bearer";
|
||||
//openapi.api.Configuration.apiKeyPrefix{'api_key'} = "Bearer";
|
||||
|
||||
var api_instance = new StoreApi();
|
||||
|
||||
@ -109,7 +109,7 @@ For valid response try integer IDs with value <= 5 or > 10. Other values will ge
|
||||
|
||||
### Example
|
||||
```dart
|
||||
import 'package:swagger/api.dart';
|
||||
import 'package:openapi/api.dart';
|
||||
|
||||
var api_instance = new StoreApi();
|
||||
var orderId = 789; // int | ID of pet that needs to be fetched
|
||||
@ -144,21 +144,19 @@ No authorization required
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
# **placeOrder**
|
||||
> Order placeOrder(body)
|
||||
> Order placeOrder(order)
|
||||
|
||||
Place an order for a pet
|
||||
|
||||
|
||||
|
||||
### Example
|
||||
```dart
|
||||
import 'package:swagger/api.dart';
|
||||
import 'package:openapi/api.dart';
|
||||
|
||||
var api_instance = new StoreApi();
|
||||
var body = new Order(); // Order | order placed for purchasing the pet
|
||||
var order = new Order(); // Order | order placed for purchasing the pet
|
||||
|
||||
try {
|
||||
var result = api_instance.placeOrder(body);
|
||||
var result = api_instance.placeOrder(order);
|
||||
print(result);
|
||||
} catch (e) {
|
||||
print("Exception when calling StoreApi->placeOrder: $e\n");
|
||||
@ -169,7 +167,7 @@ try {
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**body** | [**Order**](Order.md)| order placed for purchasing the pet |
|
||||
**order** | [**Order**](Order.md)| order placed for purchasing the pet |
|
||||
|
||||
### Return type
|
||||
|
@ -1,8 +1,8 @@
|
||||
# swagger.model.Tag
|
||||
# openapi.model.Tag
|
||||
|
||||
## Load the model package
|
||||
```dart
|
||||
import 'package:swagger/api.dart';
|
||||
import 'package:openapi/api.dart';
|
||||
```
|
||||
|
||||
## Properties
|
@ -1,8 +1,8 @@
|
||||
# swagger.model.User
|
||||
# openapi.model.User
|
||||
|
||||
## Load the model package
|
||||
```dart
|
||||
import 'package:swagger/api.dart';
|
||||
import 'package:openapi/api.dart';
|
||||
```
|
||||
|
||||
## Properties
|
@ -1,11 +1,11 @@
|
||||
# swagger.api.UserApi
|
||||
# openapi.api.UserApi
|
||||
|
||||
## Load the API package
|
||||
```dart
|
||||
import 'package:swagger/api.dart';
|
||||
import 'package:openapi/api.dart';
|
||||
```
|
||||
|
||||
All URIs are relative to *http://localhost/v2*
|
||||
All URIs are relative to *http://petstore.swagger.io/v2*
|
||||
|
||||
Method | HTTP request | Description
|
||||
------------- | ------------- | -------------
|
||||
@ -20,7 +20,7 @@ Method | HTTP request | Description
|
||||
|
||||
|
||||
# **createUser**
|
||||
> createUser(body)
|
||||
> createUser(user)
|
||||
|
||||
Create user
|
||||
|
||||
@ -28,13 +28,13 @@ This can only be done by the logged in user.
|
||||
|
||||
### Example
|
||||
```dart
|
||||
import 'package:swagger/api.dart';
|
||||
import 'package:openapi/api.dart';
|
||||
|
||||
var api_instance = new UserApi();
|
||||
var body = new User(); // User | Created user object
|
||||
var user = new User(); // User | Created user object
|
||||
|
||||
try {
|
||||
api_instance.createUser(body);
|
||||
api_instance.createUser(user);
|
||||
} catch (e) {
|
||||
print("Exception when calling UserApi->createUser: $e\n");
|
||||
}
|
||||
@ -44,7 +44,7 @@ try {
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**body** | [**User**](User.md)| Created user object |
|
||||
**user** | [**User**](User.md)| Created user object |
|
||||
|
||||
### Return type
|
||||
|
||||
@ -57,26 +57,24 @@ No authorization required
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/xml, application/json
|
||||
- **Accept**: Not defined
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
# **createUsersWithArrayInput**
|
||||
> createUsersWithArrayInput(body)
|
||||
> createUsersWithArrayInput(user)
|
||||
|
||||
Creates list of users with given input array
|
||||
|
||||
|
||||
|
||||
### Example
|
||||
```dart
|
||||
import 'package:swagger/api.dart';
|
||||
import 'package:openapi/api.dart';
|
||||
|
||||
var api_instance = new UserApi();
|
||||
var body = [new List<User>()]; // List<User> | List of user object
|
||||
var user = [new List<User>()]; // List<User> | List of user object
|
||||
|
||||
try {
|
||||
api_instance.createUsersWithArrayInput(body);
|
||||
api_instance.createUsersWithArrayInput(user);
|
||||
} catch (e) {
|
||||
print("Exception when calling UserApi->createUsersWithArrayInput: $e\n");
|
||||
}
|
||||
@ -86,7 +84,7 @@ try {
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**body** | [**List<User>**](User.md)| List of user object |
|
||||
**user** | [**List<User>**](List.md)| List of user object |
|
||||
|
||||
### Return type
|
||||
|
||||
@ -99,26 +97,24 @@ No authorization required
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/xml, application/json
|
||||
- **Accept**: Not defined
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
# **createUsersWithListInput**
|
||||
> createUsersWithListInput(body)
|
||||
> createUsersWithListInput(user)
|
||||
|
||||
Creates list of users with given input array
|
||||
|
||||
|
||||
|
||||
### Example
|
||||
```dart
|
||||
import 'package:swagger/api.dart';
|
||||
import 'package:openapi/api.dart';
|
||||
|
||||
var api_instance = new UserApi();
|
||||
var body = [new List<User>()]; // List<User> | List of user object
|
||||
var user = [new List<User>()]; // List<User> | List of user object
|
||||
|
||||
try {
|
||||
api_instance.createUsersWithListInput(body);
|
||||
api_instance.createUsersWithListInput(user);
|
||||
} catch (e) {
|
||||
print("Exception when calling UserApi->createUsersWithListInput: $e\n");
|
||||
}
|
||||
@ -128,7 +124,7 @@ try {
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**body** | [**List<User>**](User.md)| List of user object |
|
||||
**user** | [**List<User>**](List.md)| List of user object |
|
||||
|
||||
### Return type
|
||||
|
||||
@ -141,7 +137,7 @@ No authorization required
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/xml, application/json
|
||||
- **Accept**: Not defined
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
@ -154,7 +150,7 @@ This can only be done by the logged in user.
|
||||
|
||||
### Example
|
||||
```dart
|
||||
import 'package:swagger/api.dart';
|
||||
import 'package:openapi/api.dart';
|
||||
|
||||
var api_instance = new UserApi();
|
||||
var username = username_example; // String | The name that needs to be deleted
|
||||
@ -183,7 +179,7 @@ No authorization required
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/xml, application/json
|
||||
- **Accept**: Not defined
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
@ -192,11 +188,9 @@ No authorization required
|
||||
|
||||
Get user by user name
|
||||
|
||||
|
||||
|
||||
### Example
|
||||
```dart
|
||||
import 'package:swagger/api.dart';
|
||||
import 'package:openapi/api.dart';
|
||||
|
||||
var api_instance = new UserApi();
|
||||
var username = username_example; // String | The name that needs to be fetched. Use user1 for testing.
|
||||
@ -235,11 +229,9 @@ No authorization required
|
||||
|
||||
Logs user into the system
|
||||
|
||||
|
||||
|
||||
### Example
|
||||
```dart
|
||||
import 'package:swagger/api.dart';
|
||||
import 'package:openapi/api.dart';
|
||||
|
||||
var api_instance = new UserApi();
|
||||
var username = username_example; // String | The user name for login
|
||||
@ -280,11 +272,9 @@ No authorization required
|
||||
|
||||
Logs out current logged in user session
|
||||
|
||||
|
||||
|
||||
### Example
|
||||
```dart
|
||||
import 'package:swagger/api.dart';
|
||||
import 'package:openapi/api.dart';
|
||||
|
||||
var api_instance = new UserApi();
|
||||
|
||||
@ -309,12 +299,12 @@ No authorization required
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/xml, application/json
|
||||
- **Accept**: Not defined
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
# **updateUser**
|
||||
> updateUser(username, body)
|
||||
> updateUser(username, user)
|
||||
|
||||
Updated user
|
||||
|
||||
@ -322,14 +312,14 @@ This can only be done by the logged in user.
|
||||
|
||||
### Example
|
||||
```dart
|
||||
import 'package:swagger/api.dart';
|
||||
import 'package:openapi/api.dart';
|
||||
|
||||
var api_instance = new UserApi();
|
||||
var username = username_example; // String | name that need to be deleted
|
||||
var body = new User(); // User | Updated user object
|
||||
var user = new User(); // User | Updated user object
|
||||
|
||||
try {
|
||||
api_instance.updateUser(username, body);
|
||||
api_instance.updateUser(username, user);
|
||||
} catch (e) {
|
||||
print("Exception when calling UserApi->updateUser: $e\n");
|
||||
}
|
||||
@ -340,7 +330,7 @@ try {
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**username** | **String**| name that need to be deleted |
|
||||
**body** | [**User**](User.md)| Updated user object |
|
||||
**user** | [**User**](User.md)| Updated user object |
|
||||
|
||||
### Return type
|
||||
|
||||
@ -353,7 +343,7 @@ No authorization required
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/xml, application/json
|
||||
- **Accept**: Not defined
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
@ -1,7 +1,7 @@
|
||||
#!/bin/sh
|
||||
# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
|
||||
#
|
||||
# Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update"
|
||||
# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update"
|
||||
|
||||
git_user_id=$1
|
||||
git_repo_id=$2
|
@ -1,4 +1,4 @@
|
||||
library swagger.api;
|
||||
library openapi.api;
|
||||
|
||||
import 'dart:async';
|
||||
import 'dart:convert';
|
@ -1,4 +1,4 @@
|
||||
part of swagger.api;
|
||||
part of openapi.api;
|
||||
|
||||
|
||||
|
||||
@ -10,12 +10,12 @@ class PetApi {
|
||||
/// Add a new pet to the store
|
||||
///
|
||||
///
|
||||
Future addPet(Pet body) async {
|
||||
Object postBody = body;
|
||||
Future addPet(Pet pet) async {
|
||||
Object postBody = pet;
|
||||
|
||||
// verify required params are set
|
||||
if(body == null) {
|
||||
throw new ApiException(400, "Missing required param: body");
|
||||
if(pet == null) {
|
||||
throw new ApiException(400, "Missing required param: pet");
|
||||
}
|
||||
|
||||
// create path and map variables
|
||||
@ -34,7 +34,6 @@ class PetApi {
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
bool hasFields = false;
|
||||
MultipartRequest mp = new MultipartRequest(null, null);
|
||||
|
||||
if(hasFields)
|
||||
postBody = mp;
|
||||
}
|
||||
@ -53,9 +52,8 @@ class PetApi {
|
||||
if(response.statusCode >= 400) {
|
||||
throw new ApiException(response.statusCode, response.body);
|
||||
} else if(response.body != null) {
|
||||
return ;
|
||||
} else {
|
||||
return ;
|
||||
return;
|
||||
}
|
||||
}
|
||||
/// Deletes a pet
|
||||
@ -86,7 +84,6 @@ class PetApi {
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
bool hasFields = false;
|
||||
MultipartRequest mp = new MultipartRequest(null, null);
|
||||
|
||||
if(hasFields)
|
||||
postBody = mp;
|
||||
}
|
||||
@ -105,9 +102,8 @@ class PetApi {
|
||||
if(response.statusCode >= 400) {
|
||||
throw new ApiException(response.statusCode, response.body);
|
||||
} else if(response.body != null) {
|
||||
return ;
|
||||
} else {
|
||||
return ;
|
||||
return;
|
||||
}
|
||||
}
|
||||
/// Finds Pets by status
|
||||
@ -138,7 +134,6 @@ class PetApi {
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
bool hasFields = false;
|
||||
MultipartRequest mp = new MultipartRequest(null, null);
|
||||
|
||||
if(hasFields)
|
||||
postBody = mp;
|
||||
}
|
||||
@ -157,7 +152,7 @@ class PetApi {
|
||||
if(response.statusCode >= 400) {
|
||||
throw new ApiException(response.statusCode, response.body);
|
||||
} else if(response.body != null) {
|
||||
return apiClient.deserialize(response.body, 'List<Pet>') as List<Pet> ;
|
||||
return (apiClient.deserialize(response.body, 'List<Pet>') as List).map((item) => item as Pet).toList();
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
@ -190,7 +185,6 @@ class PetApi {
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
bool hasFields = false;
|
||||
MultipartRequest mp = new MultipartRequest(null, null);
|
||||
|
||||
if(hasFields)
|
||||
postBody = mp;
|
||||
}
|
||||
@ -209,7 +203,7 @@ class PetApi {
|
||||
if(response.statusCode >= 400) {
|
||||
throw new ApiException(response.statusCode, response.body);
|
||||
} else if(response.body != null) {
|
||||
return apiClient.deserialize(response.body, 'List<Pet>') as List<Pet> ;
|
||||
return (apiClient.deserialize(response.body, 'List<Pet>') as List).map((item) => item as Pet).toList();
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
@ -241,7 +235,6 @@ class PetApi {
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
bool hasFields = false;
|
||||
MultipartRequest mp = new MultipartRequest(null, null);
|
||||
|
||||
if(hasFields)
|
||||
postBody = mp;
|
||||
}
|
||||
@ -260,7 +253,7 @@ class PetApi {
|
||||
if(response.statusCode >= 400) {
|
||||
throw new ApiException(response.statusCode, response.body);
|
||||
} else if(response.body != null) {
|
||||
return apiClient.deserialize(response.body, 'Pet') as Pet ;
|
||||
return apiClient.deserialize(response.body, 'Pet') as Pet;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
@ -268,12 +261,12 @@ class PetApi {
|
||||
/// Update an existing pet
|
||||
///
|
||||
///
|
||||
Future updatePet(Pet body) async {
|
||||
Object postBody = body;
|
||||
Future updatePet(Pet pet) async {
|
||||
Object postBody = pet;
|
||||
|
||||
// verify required params are set
|
||||
if(body == null) {
|
||||
throw new ApiException(400, "Missing required param: body");
|
||||
if(pet == null) {
|
||||
throw new ApiException(400, "Missing required param: pet");
|
||||
}
|
||||
|
||||
// create path and map variables
|
||||
@ -292,7 +285,6 @@ class PetApi {
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
bool hasFields = false;
|
||||
MultipartRequest mp = new MultipartRequest(null, null);
|
||||
|
||||
if(hasFields)
|
||||
postBody = mp;
|
||||
}
|
||||
@ -311,9 +303,8 @@ class PetApi {
|
||||
if(response.statusCode >= 400) {
|
||||
throw new ApiException(response.statusCode, response.body);
|
||||
} else if(response.body != null) {
|
||||
return ;
|
||||
} else {
|
||||
return ;
|
||||
return;
|
||||
}
|
||||
}
|
||||
/// Updates a pet in the store with form data
|
||||
@ -343,24 +334,21 @@ class PetApi {
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
bool hasFields = false;
|
||||
MultipartRequest mp = new MultipartRequest(null, null);
|
||||
|
||||
if (name != null) {
|
||||
hasFields = true;
|
||||
mp.fields['name'] = parameterToString(name);
|
||||
}
|
||||
|
||||
if (status != null) {
|
||||
hasFields = true;
|
||||
mp.fields['status'] = parameterToString(status);
|
||||
}
|
||||
|
||||
if(hasFields)
|
||||
postBody = mp;
|
||||
}
|
||||
else {
|
||||
if (name != null)
|
||||
formParams['name'] = parameterToString(name);
|
||||
if (status != null)
|
||||
if (status != null)
|
||||
formParams['status'] = parameterToString(status);
|
||||
}
|
||||
|
||||
@ -376,9 +364,8 @@ if (status != null)
|
||||
if(response.statusCode >= 400) {
|
||||
throw new ApiException(response.statusCode, response.body);
|
||||
} else if(response.body != null) {
|
||||
return ;
|
||||
} else {
|
||||
return ;
|
||||
return;
|
||||
}
|
||||
}
|
||||
/// uploads an image
|
||||
@ -408,25 +395,21 @@ if (status != null)
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
bool hasFields = false;
|
||||
MultipartRequest mp = new MultipartRequest(null, null);
|
||||
|
||||
if (additionalMetadata != null) {
|
||||
hasFields = true;
|
||||
mp.fields['additionalMetadata'] = parameterToString(additionalMetadata);
|
||||
}
|
||||
|
||||
if (file != null) {
|
||||
hasFields = true;
|
||||
mp.fields['file'] = file.field;
|
||||
mp.files.add(file);
|
||||
}
|
||||
|
||||
if(hasFields)
|
||||
postBody = mp;
|
||||
}
|
||||
else {
|
||||
if (additionalMetadata != null)
|
||||
formParams['additionalMetadata'] = parameterToString(additionalMetadata);
|
||||
|
||||
}
|
||||
|
||||
var response = await apiClient.invokeAPI(path,
|
||||
@ -441,7 +424,7 @@ if (status != null)
|
||||
if(response.statusCode >= 400) {
|
||||
throw new ApiException(response.statusCode, response.body);
|
||||
} else if(response.body != null) {
|
||||
return apiClient.deserialize(response.body, 'ApiResponse') as ApiResponse ;
|
||||
return apiClient.deserialize(response.body, 'ApiResponse') as ApiResponse;
|
||||
} else {
|
||||
return null;
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
part of swagger.api;
|
||||
part of openapi.api;
|
||||
|
||||
|
||||
|
||||
@ -34,7 +34,6 @@ class StoreApi {
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
bool hasFields = false;
|
||||
MultipartRequest mp = new MultipartRequest(null, null);
|
||||
|
||||
if(hasFields)
|
||||
postBody = mp;
|
||||
}
|
||||
@ -53,9 +52,8 @@ class StoreApi {
|
||||
if(response.statusCode >= 400) {
|
||||
throw new ApiException(response.statusCode, response.body);
|
||||
} else if(response.body != null) {
|
||||
return ;
|
||||
} else {
|
||||
return ;
|
||||
return;
|
||||
}
|
||||
}
|
||||
/// Returns pet inventories by status
|
||||
@ -82,7 +80,6 @@ class StoreApi {
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
bool hasFields = false;
|
||||
MultipartRequest mp = new MultipartRequest(null, null);
|
||||
|
||||
if(hasFields)
|
||||
postBody = mp;
|
||||
}
|
||||
@ -101,7 +98,8 @@ class StoreApi {
|
||||
if(response.statusCode >= 400) {
|
||||
throw new ApiException(response.statusCode, response.body);
|
||||
} else if(response.body != null) {
|
||||
return apiClient.deserialize(response.body, 'Map<String, int>') as Map<String, int> ;
|
||||
return new Map<String, int>.from(apiClient.deserialize(response.body, 'Map<String, int>'));
|
||||
;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
@ -133,7 +131,6 @@ class StoreApi {
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
bool hasFields = false;
|
||||
MultipartRequest mp = new MultipartRequest(null, null);
|
||||
|
||||
if(hasFields)
|
||||
postBody = mp;
|
||||
}
|
||||
@ -152,7 +149,7 @@ class StoreApi {
|
||||
if(response.statusCode >= 400) {
|
||||
throw new ApiException(response.statusCode, response.body);
|
||||
} else if(response.body != null) {
|
||||
return apiClient.deserialize(response.body, 'Order') as Order ;
|
||||
return apiClient.deserialize(response.body, 'Order') as Order;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
@ -160,12 +157,12 @@ class StoreApi {
|
||||
/// Place an order for a pet
|
||||
///
|
||||
///
|
||||
Future<Order> placeOrder(Order body) async {
|
||||
Object postBody = body;
|
||||
Future<Order> placeOrder(Order order) async {
|
||||
Object postBody = order;
|
||||
|
||||
// verify required params are set
|
||||
if(body == null) {
|
||||
throw new ApiException(400, "Missing required param: body");
|
||||
if(order == null) {
|
||||
throw new ApiException(400, "Missing required param: order");
|
||||
}
|
||||
|
||||
// create path and map variables
|
||||
@ -184,7 +181,6 @@ class StoreApi {
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
bool hasFields = false;
|
||||
MultipartRequest mp = new MultipartRequest(null, null);
|
||||
|
||||
if(hasFields)
|
||||
postBody = mp;
|
||||
}
|
||||
@ -203,7 +199,7 @@ class StoreApi {
|
||||
if(response.statusCode >= 400) {
|
||||
throw new ApiException(response.statusCode, response.body);
|
||||
} else if(response.body != null) {
|
||||
return apiClient.deserialize(response.body, 'Order') as Order ;
|
||||
return apiClient.deserialize(response.body, 'Order') as Order;
|
||||
} else {
|
||||
return null;
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
part of swagger.api;
|
||||
part of openapi.api;
|
||||
|
||||
|
||||
|
||||
@ -10,12 +10,12 @@ class UserApi {
|
||||
/// Create user
|
||||
///
|
||||
/// This can only be done by the logged in user.
|
||||
Future createUser(User body) async {
|
||||
Object postBody = body;
|
||||
Future createUser(User user) async {
|
||||
Object postBody = user;
|
||||
|
||||
// verify required params are set
|
||||
if(body == null) {
|
||||
throw new ApiException(400, "Missing required param: body");
|
||||
if(user == null) {
|
||||
throw new ApiException(400, "Missing required param: user");
|
||||
}
|
||||
|
||||
// create path and map variables
|
||||
@ -34,7 +34,6 @@ class UserApi {
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
bool hasFields = false;
|
||||
MultipartRequest mp = new MultipartRequest(null, null);
|
||||
|
||||
if(hasFields)
|
||||
postBody = mp;
|
||||
}
|
||||
@ -53,20 +52,19 @@ class UserApi {
|
||||
if(response.statusCode >= 400) {
|
||||
throw new ApiException(response.statusCode, response.body);
|
||||
} else if(response.body != null) {
|
||||
return ;
|
||||
} else {
|
||||
return ;
|
||||
return;
|
||||
}
|
||||
}
|
||||
/// Creates list of users with given input array
|
||||
///
|
||||
///
|
||||
Future createUsersWithArrayInput(List<User> body) async {
|
||||
Object postBody = body;
|
||||
Future createUsersWithArrayInput(List<User> user) async {
|
||||
Object postBody = user;
|
||||
|
||||
// verify required params are set
|
||||
if(body == null) {
|
||||
throw new ApiException(400, "Missing required param: body");
|
||||
if(user == null) {
|
||||
throw new ApiException(400, "Missing required param: user");
|
||||
}
|
||||
|
||||
// create path and map variables
|
||||
@ -85,7 +83,6 @@ class UserApi {
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
bool hasFields = false;
|
||||
MultipartRequest mp = new MultipartRequest(null, null);
|
||||
|
||||
if(hasFields)
|
||||
postBody = mp;
|
||||
}
|
||||
@ -104,20 +101,19 @@ class UserApi {
|
||||
if(response.statusCode >= 400) {
|
||||
throw new ApiException(response.statusCode, response.body);
|
||||
} else if(response.body != null) {
|
||||
return ;
|
||||
} else {
|
||||
return ;
|
||||
return;
|
||||
}
|
||||
}
|
||||
/// Creates list of users with given input array
|
||||
///
|
||||
///
|
||||
Future createUsersWithListInput(List<User> body) async {
|
||||
Object postBody = body;
|
||||
Future createUsersWithListInput(List<User> user) async {
|
||||
Object postBody = user;
|
||||
|
||||
// verify required params are set
|
||||
if(body == null) {
|
||||
throw new ApiException(400, "Missing required param: body");
|
||||
if(user == null) {
|
||||
throw new ApiException(400, "Missing required param: user");
|
||||
}
|
||||
|
||||
// create path and map variables
|
||||
@ -136,7 +132,6 @@ class UserApi {
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
bool hasFields = false;
|
||||
MultipartRequest mp = new MultipartRequest(null, null);
|
||||
|
||||
if(hasFields)
|
||||
postBody = mp;
|
||||
}
|
||||
@ -155,9 +150,8 @@ class UserApi {
|
||||
if(response.statusCode >= 400) {
|
||||
throw new ApiException(response.statusCode, response.body);
|
||||
} else if(response.body != null) {
|
||||
return ;
|
||||
} else {
|
||||
return ;
|
||||
return;
|
||||
}
|
||||
}
|
||||
/// Delete user
|
||||
@ -187,7 +181,6 @@ class UserApi {
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
bool hasFields = false;
|
||||
MultipartRequest mp = new MultipartRequest(null, null);
|
||||
|
||||
if(hasFields)
|
||||
postBody = mp;
|
||||
}
|
||||
@ -206,9 +199,8 @@ class UserApi {
|
||||
if(response.statusCode >= 400) {
|
||||
throw new ApiException(response.statusCode, response.body);
|
||||
} else if(response.body != null) {
|
||||
return ;
|
||||
} else {
|
||||
return ;
|
||||
return;
|
||||
}
|
||||
}
|
||||
/// Get user by user name
|
||||
@ -238,7 +230,6 @@ class UserApi {
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
bool hasFields = false;
|
||||
MultipartRequest mp = new MultipartRequest(null, null);
|
||||
|
||||
if(hasFields)
|
||||
postBody = mp;
|
||||
}
|
||||
@ -257,7 +248,7 @@ class UserApi {
|
||||
if(response.statusCode >= 400) {
|
||||
throw new ApiException(response.statusCode, response.body);
|
||||
} else if(response.body != null) {
|
||||
return apiClient.deserialize(response.body, 'User') as User ;
|
||||
return apiClient.deserialize(response.body, 'User') as User;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
@ -294,7 +285,6 @@ class UserApi {
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
bool hasFields = false;
|
||||
MultipartRequest mp = new MultipartRequest(null, null);
|
||||
|
||||
if(hasFields)
|
||||
postBody = mp;
|
||||
}
|
||||
@ -313,7 +303,7 @@ class UserApi {
|
||||
if(response.statusCode >= 400) {
|
||||
throw new ApiException(response.statusCode, response.body);
|
||||
} else if(response.body != null) {
|
||||
return apiClient.deserialize(response.body, 'String') as String ;
|
||||
return apiClient.deserialize(response.body, 'String') as String;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
@ -342,7 +332,6 @@ class UserApi {
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
bool hasFields = false;
|
||||
MultipartRequest mp = new MultipartRequest(null, null);
|
||||
|
||||
if(hasFields)
|
||||
postBody = mp;
|
||||
}
|
||||
@ -361,23 +350,22 @@ class UserApi {
|
||||
if(response.statusCode >= 400) {
|
||||
throw new ApiException(response.statusCode, response.body);
|
||||
} else if(response.body != null) {
|
||||
return ;
|
||||
} else {
|
||||
return ;
|
||||
return;
|
||||
}
|
||||
}
|
||||
/// Updated user
|
||||
///
|
||||
/// This can only be done by the logged in user.
|
||||
Future updateUser(String username, User body) async {
|
||||
Object postBody = body;
|
||||
Future updateUser(String username, User user) async {
|
||||
Object postBody = user;
|
||||
|
||||
// verify required params are set
|
||||
if(username == null) {
|
||||
throw new ApiException(400, "Missing required param: username");
|
||||
}
|
||||
if(body == null) {
|
||||
throw new ApiException(400, "Missing required param: body");
|
||||
if(user == null) {
|
||||
throw new ApiException(400, "Missing required param: user");
|
||||
}
|
||||
|
||||
// create path and map variables
|
||||
@ -396,7 +384,6 @@ class UserApi {
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
bool hasFields = false;
|
||||
MultipartRequest mp = new MultipartRequest(null, null);
|
||||
|
||||
if(hasFields)
|
||||
postBody = mp;
|
||||
}
|
||||
@ -415,9 +402,8 @@ class UserApi {
|
||||
if(response.statusCode >= 400) {
|
||||
throw new ApiException(response.statusCode, response.body);
|
||||
} else if(response.body != null) {
|
||||
return ;
|
||||
} else {
|
||||
return ;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
part of swagger.api;
|
||||
part of openapi.api;
|
||||
|
||||
class QueryParam {
|
||||
String name;
|
||||
@ -18,7 +18,7 @@ class ApiClient {
|
||||
final _RegList = new RegExp(r'^List<(.*)>$');
|
||||
final _RegMap = new RegExp(r'^Map<String,(.*)>$');
|
||||
|
||||
ApiClient({this.basePath: "http://localhost/v2"}) {
|
||||
ApiClient({this.basePath: "http://petstore.swagger.io/v2"}) {
|
||||
// Setup authentications (key: authentication name, value: authentication).
|
||||
_authentications['api_key'] = new ApiKeyAuth("header", "api_key");
|
||||
_authentications['petstore_auth'] = new OAuth();
|
@ -1,4 +1,4 @@
|
||||
part of swagger.api;
|
||||
part of openapi.api;
|
||||
|
||||
class ApiException implements Exception {
|
||||
int code = 0;
|
@ -1,4 +1,4 @@
|
||||
part of swagger.api;
|
||||
part of openapi.api;
|
||||
|
||||
const _delimiters = const {'csv': ',', 'ssv': ' ', 'tsv': '\t', 'pipes': '|'};
|
||||
|
@ -1,4 +1,4 @@
|
||||
part of swagger.api;
|
||||
part of openapi.api;
|
||||
|
||||
class ApiKeyAuth implements Authentication {
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user