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:
William Cheng 2018-05-06 01:45:52 +08:00 committed by GitHub
parent 3c666a6d44
commit aab99bc530
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
113 changed files with 712 additions and 940 deletions

5
.gitignore vendored
View File

@ -197,3 +197,8 @@ samples/client/petstore/erlang-client/_build/
samples/client/petstore/erlang-client/rebar.lock samples/client/petstore/erlang-client/rebar.lock
samples/server/petstore/erlang-server/_build/ samples/server/petstore/erlang-server/_build/
samples/server/petstore/erlang-server/rebar.lock 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

View File

@ -29,18 +29,18 @@ fi
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties" export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
# Generate non-browserClient # 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: # 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 java $JAVA_OPTS -jar $executable $ags
# Generate browserClient # 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 java $JAVA_OPTS -jar $executable $ags
# Generate non-browserClient and put it to the flutter sample app # 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 java $JAVA_OPTS -jar $executable $ags
# There is a proposal to allow importing different libraries depending on the environment: # 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. # 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. # The current petstore test will then work for both: the browser library and the vm library.

View File

@ -29,18 +29,18 @@ fi
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties" export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
# Generate non-browserClient # 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: # 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 #java $JAVA_OPTS -jar $executable $ags
# Generate browserClient # 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 #java $JAVA_OPTS -jar $executable $ags
# Generate non-browserClient and put it to the flutter sample app # 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 java $JAVA_OPTS -jar $executable $ags
# There is a proposal to allow importing different libraries depending on the environment: # There is a proposal to allow importing different libraries depending on the environment:

View File

@ -44,13 +44,13 @@ public class DartClientCodegen extends DefaultCodegen implements CodegenConfig {
public static final String PUB_DESCRIPTION = "pubDescription"; public static final String PUB_DESCRIPTION = "pubDescription";
public static final String USE_ENUM_EXTENSION = "useEnumExtension"; public static final String USE_ENUM_EXTENSION = "useEnumExtension";
protected boolean browserClient = true; protected boolean browserClient = true;
protected String pubName = "swagger"; protected String pubName = "openapi";
protected String pubVersion = "1.0.0"; protected String pubVersion = "1.0.0";
protected String pubDescription = "Swagger API client"; protected String pubDescription = "OpenAPI API client";
protected boolean useEnumExtension = false; protected boolean useEnumExtension = false;
protected String sourceFolder = ""; protected String sourceFolder = "";
protected String apiDocPath = "docs/"; protected String apiDocPath = "docs" + File.separator;
protected String modelDocPath = "docs/"; protected String modelDocPath = "docs" + File.separator;
public DartClientCodegen() { public DartClientCodegen() {
super(); super();
@ -110,10 +110,9 @@ public class DartClientCodegen extends DefaultCodegen implements CodegenConfig {
typeMapping.put("Date", "DateTime"); typeMapping.put("Date", "DateTime");
typeMapping.put("date", "DateTime"); typeMapping.put("date", "DateTime");
typeMapping.put("File", "MultipartFile"); typeMapping.put("File", "MultipartFile");
typeMapping.put("binary", "MultipartFile");
typeMapping.put("UUID", "String"); typeMapping.put("UUID", "String");
//TODO binary should be mapped to byte array typeMapping.put("ByteArray", "String");
// mapped to String as a workaround
typeMapping.put("binary", "String");
cliOptions.add(new CliOption(BROWSER_CLIENT, "Is the client browser based")); cliOptions.add(new CliOption(BROWSER_CLIENT, "Is the client browser based"));
cliOptions.add(new CliOption(PUB_NAME, "Name in generated pubspec")); cliOptions.add(new CliOption(PUB_NAME, "Name in generated pubspec"));
@ -210,12 +209,12 @@ public class DartClientCodegen extends DefaultCodegen implements CodegenConfig {
@Override @Override
public String apiFileFolder() { public String apiFileFolder() {
return outputFolder + "/" + sourceFolder + "/" + apiPackage().replace('.', File.separatorChar); return outputFolder + File.separator + sourceFolder + File.separator + apiPackage().replace('.', File.separatorChar);
} }
@Override @Override
public String modelFileFolder() { public String modelFileFolder() {
return outputFolder + "/" + sourceFolder + "/" + modelPackage().replace('.', File.separatorChar); return outputFolder + File.separator + sourceFolder + File.separator + modelPackage().replace('.', File.separatorChar);
} }
@Override @Override
@ -231,7 +230,7 @@ public class DartClientCodegen extends DefaultCodegen implements CodegenConfig {
@Override @Override
public String toVarName(String name) { public String toVarName(String name) {
// replace - with _ e.g. created-at => created_at // 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 it's all uppper case, do nothing
if (name.matches("^[A-Z_]*$")) { if (name.matches("^[A-Z_]*$")) {

View File

@ -42,10 +42,8 @@ public class ElixirClientOptionsTest extends AbstractOptionsTest {
@Override @Override
protected void setExpectations() { protected void setExpectations() {
new Expectations(clientCodegen) {{ new Expectations(clientCodegen) {{
// TODO
clientCodegen.setModuleName(ElixirClientOptionsProvider.INVOKER_PACKAGE_VALUE); clientCodegen.setModuleName(ElixirClientOptionsProvider.INVOKER_PACKAGE_VALUE);
times = 1; times = 1;
}}; }};
} }
} }

View File

@ -275,7 +275,7 @@ public class ObjcModelTest {
Assert.assertEquals(Sets.intersection(cm.imports, Sets.newHashSet("SWGChildren")).size(), 1); 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() { public void mapModelTest() {
final Schema model = new Schema() final Schema model = new Schema()
.description("a map model for testing ObjC generator") .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() { public void binaryDataModelTest() {
final OpenAPI model = new OpenAPIParser().readLocation("src/test/resources/2_0/binaryDataTest.json", null, new ParseOptions()).getOpenAPI(); final OpenAPI model = new OpenAPIParser().readLocation("src/test/resources/2_0/binaryDataTest.json", null, new ParseOptions()).getOpenAPI();
final DefaultCodegen codegen = new ObjcClientCodegen(); final DefaultCodegen codegen = new ObjcClientCodegen();
@ -339,8 +339,8 @@ public class ObjcModelTest {
Assert.assertTrue(op.bodyParam.isBinary); Assert.assertTrue(op.bodyParam.isBinary);
Assert.assertTrue(op.responses.get(0).isBinary); Assert.assertTrue(op.responses.get(0).isBinary);
Assert.assertEquals(op.returnType, "NSData*"); Assert.assertEquals(op.returnType, "NSURL*");
Assert.assertEquals(op.bodyParam.dataType, "NSData*"); Assert.assertEquals(op.bodyParam.dataType, "NSURL*");
} }
@Test(description = "create proper imports per #316") @Test(description = "create proper imports per #316")

View File

@ -1,10 +1,27 @@
.DS_Store # See https://www.dartlang.org/tools/private-files.html
.atom/
.idea # Files and directories created by pub
.buildlog
.packages .packages
.project
.pub/ .pub/
build/ 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 pubspec.lock
.flutter-plugins

View File

@ -1,11 +1,11 @@
# Swagger Codegen Ignore # OpenAPI Generator Ignore
# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen # Generated by openapi-generator https://github.com/openapitools/openapi-generator
# Use this file to prevent files from being overwritten by the generator. # Use this file to prevent files from being overwritten by the generator.
# The patterns follow closely to .gitignore or .dockerignore. # The patterns follow closely to .gitignore or .dockerignore.
# As an example, the C# client generator defines ApiClient.cs. # 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 #ApiClient.cs
# You can match any string of characters against a directory, file or extension with a single asterisk (*): # You can match any string of characters against a directory, file or extension with a single asterisk (*):

View File

@ -1,11 +1,11 @@
# Swagger Codegen Ignore # OpenAPI Generator Ignore
# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen # Generated by openapi-generator https://github.com/openapitools/openapi-generator
# Use this file to prevent files from being overwritten by the generator. # Use this file to prevent files from being overwritten by the generator.
# The patterns follow closely to .gitignore or .dockerignore. # The patterns follow closely to .gitignore or .dockerignore.
# As an example, the C# client generator defines ApiClient.cs. # 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 #ApiClient.cs
# You can match any string of characters against a directory, file or extension with a single asterisk (*): # You can match any string of characters against a directory, file or extension with a single asterisk (*):

View File

@ -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 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: 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 ### Github
If this Dart package is published to Github, please include the following in pubspec.yaml If this Dart package is published to Github, please include the following in pubspec.yaml
``` ```
name: swagger name: openapi
version: 1.0.0 version: 1.0.0
description: Swagger API client description: OpenAPI API client
dependencies: dependencies:
swagger: openapi:
git: https://github.com/GIT_USER_ID/GIT_REPO_ID.git git: https://github.com/GIT_USER_ID/GIT_REPO_ID.git
version: 'any' version: 'any'
``` ```
@ -28,8 +28,8 @@ dependencies:
To use the package in your local drive, please include the following in pubspec.yaml To use the package in your local drive, please include the following in pubspec.yaml
``` ```
dependencies: dependencies:
swagger: openapi:
path: /path/to/swagger path: /path/to/openapi
``` ```
## Tests ## Tests
@ -41,10 +41,10 @@ TODO
Please follow the [installation procedure](#installation--usage) and then run the following: Please follow the [installation procedure](#installation--usage) and then run the following:
```dart ```dart
import 'package:swagger/api.dart'; import 'package:openapi/api.dart';
// TODO Configure OAuth2 access token for authorization: petstore_auth // 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 api_instance = new PetApi();
var pet = 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

View File

@ -1,8 +1,8 @@
# swagger.model.ApiResponse # openapi.model.ApiResponse
## Load the model package ## Load the model package
```dart ```dart
import 'package:swagger/api.dart'; import 'package:openapi/api.dart';
``` ```
## Properties ## Properties

View File

@ -1,8 +1,8 @@
# swagger.model.Category # openapi.model.Category
## Load the model package ## Load the model package
```dart ```dart
import 'package:swagger/api.dart'; import 'package:openapi/api.dart';
``` ```
## Properties ## Properties

View File

@ -1,8 +1,8 @@
# swagger.model.Order # openapi.model.Order
## Load the model package ## Load the model package
```dart ```dart
import 'package:swagger/api.dart'; import 'package:openapi/api.dart';
``` ```
## Properties ## Properties

View File

@ -1,8 +1,8 @@
# swagger.model.Pet # openapi.model.Pet
## Load the model package ## Load the model package
```dart ```dart
import 'package:swagger/api.dart'; import 'package:openapi/api.dart';
``` ```
## Properties ## Properties

View File

@ -1,8 +1,8 @@
# swagger.api.PetApi # openapi.api.PetApi
## Load the API package ## Load the API package
```dart ```dart
import 'package:swagger/api.dart'; import 'package:openapi/api.dart';
``` ```
All URIs are relative to *http://petstore.swagger.io/v2* All URIs are relative to *http://petstore.swagger.io/v2*
@ -26,9 +26,9 @@ Add a new pet to the store
### Example ### Example
```dart ```dart
import 'package:swagger/api.dart'; import 'package:openapi/api.dart';
// TODO Configure OAuth2 access token for authorization: petstore_auth // 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 api_instance = new PetApi();
var pet = 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
@ -68,9 +68,9 @@ Deletes a pet
### Example ### Example
```dart ```dart
import 'package:swagger/api.dart'; import 'package:openapi/api.dart';
// TODO Configure OAuth2 access token for authorization: petstore_auth // 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 api_instance = new PetApi();
var petId = 789; // int | Pet id to delete var petId = 789; // int | Pet id to delete
@ -114,9 +114,9 @@ Multiple status values can be provided with comma separated strings
### Example ### Example
```dart ```dart
import 'package:swagger/api.dart'; import 'package:openapi/api.dart';
// TODO Configure OAuth2 access token for authorization: petstore_auth // 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 api_instance = new PetApi();
var status = []; // List<String> | Status values that need to be considered for filter 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 ### Example
```dart ```dart
import 'package:swagger/api.dart'; import 'package:openapi/api.dart';
// TODO Configure OAuth2 access token for authorization: petstore_auth // 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 api_instance = new PetApi();
var tags = []; // List<String> | Tags to filter by var tags = []; // List<String> | Tags to filter by
@ -204,11 +204,11 @@ Returns a single pet
### Example ### Example
```dart ```dart
import 'package:swagger/api.dart'; import 'package:openapi/api.dart';
// TODO Configure API key authorization: api_key // 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 // 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 api_instance = new PetApi();
var petId = 789; // int | ID of pet to return var petId = 789; // int | ID of pet to return
@ -249,9 +249,9 @@ Update an existing pet
### Example ### Example
```dart ```dart
import 'package:swagger/api.dart'; import 'package:openapi/api.dart';
// TODO Configure OAuth2 access token for authorization: petstore_auth // 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 api_instance = new PetApi();
var pet = 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
@ -291,9 +291,9 @@ Updates a pet in the store with form data
### Example ### Example
```dart ```dart
import 'package:swagger/api.dart'; import 'package:openapi/api.dart';
// TODO Configure OAuth2 access token for authorization: petstore_auth // 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 api_instance = new PetApi();
var petId = 789; // int | ID of pet that needs to be updated var petId = 789; // int | ID of pet that needs to be updated
@ -337,9 +337,9 @@ uploads an image
### Example ### Example
```dart ```dart
import 'package:swagger/api.dart'; import 'package:openapi/api.dart';
// TODO Configure OAuth2 access token for authorization: petstore_auth // 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 api_instance = new PetApi();
var petId = 789; // int | ID of pet to update var petId = 789; // int | ID of pet to update

View File

@ -1,8 +1,8 @@
# swagger.api.StoreApi # openapi.api.StoreApi
## Load the API package ## Load the API package
```dart ```dart
import 'package:swagger/api.dart'; import 'package:openapi/api.dart';
``` ```
All URIs are relative to *http://petstore.swagger.io/v2* 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 ### Example
```dart ```dart
import 'package:swagger/api.dart'; import 'package:openapi/api.dart';
var api_instance = new StoreApi(); var api_instance = new StoreApi();
var orderId = orderId_example; // String | ID of the order that needs to be deleted var orderId = orderId_example; // String | ID of the order that needs to be deleted
@ -66,11 +66,11 @@ Returns a map of status codes to quantities
### Example ### Example
```dart ```dart
import 'package:swagger/api.dart'; import 'package:openapi/api.dart';
// TODO Configure API key authorization: api_key // 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 // 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(); 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 ### Example
```dart ```dart
import 'package:swagger/api.dart'; import 'package:openapi/api.dart';
var api_instance = new StoreApi(); var api_instance = new StoreApi();
var orderId = 789; // int | ID of pet that needs to be fetched var orderId = 789; // int | ID of pet that needs to be fetched
@ -150,7 +150,7 @@ Place an order for a pet
### Example ### Example
```dart ```dart
import 'package:swagger/api.dart'; import 'package:openapi/api.dart';
var api_instance = new StoreApi(); var api_instance = new StoreApi();
var order = new Order(); // Order | order placed for purchasing the pet var order = new Order(); // Order | order placed for purchasing the pet
@ -179,7 +179,7 @@ No authorization required
### HTTP request headers ### HTTP request headers
- **Content-Type**: application/json - **Content-Type**: Not defined
- **Accept**: application/xml, application/json - **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) [[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)

View File

@ -1,8 +1,8 @@
# swagger.model.Tag # openapi.model.Tag
## Load the model package ## Load the model package
```dart ```dart
import 'package:swagger/api.dart'; import 'package:openapi/api.dart';
``` ```
## Properties ## Properties

View File

@ -1,8 +1,8 @@
# swagger.model.User # openapi.model.User
## Load the model package ## Load the model package
```dart ```dart
import 'package:swagger/api.dart'; import 'package:openapi/api.dart';
``` ```
## Properties ## Properties

View File

@ -1,8 +1,8 @@
# swagger.api.UserApi # openapi.api.UserApi
## Load the API package ## Load the API package
```dart ```dart
import 'package:swagger/api.dart'; import 'package:openapi/api.dart';
``` ```
All URIs are relative to *http://petstore.swagger.io/v2* 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 ### Example
```dart ```dart
import 'package:swagger/api.dart'; import 'package:openapi/api.dart';
var api_instance = new UserApi(); var api_instance = new UserApi();
var user = new User(); // User | Created user object var user = new User(); // User | Created user object
@ -56,7 +56,7 @@ No authorization required
### HTTP request headers ### HTTP request headers
- **Content-Type**: application/json - **Content-Type**: Not defined
- **Accept**: 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) [[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 ### Example
```dart ```dart
import 'package:swagger/api.dart'; import 'package:openapi/api.dart';
var api_instance = new UserApi(); var api_instance = new UserApi();
var user = [new List&lt;User&gt;()]; // List<User> | List of user object var user = [new List&lt;User&gt;()]; // List<User> | List of user object
@ -96,7 +96,7 @@ No authorization required
### HTTP request headers ### HTTP request headers
- **Content-Type**: application/json - **Content-Type**: Not defined
- **Accept**: 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) [[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 ### Example
```dart ```dart
import 'package:swagger/api.dart'; import 'package:openapi/api.dart';
var api_instance = new UserApi(); var api_instance = new UserApi();
var user = [new List&lt;User&gt;()]; // List<User> | List of user object var user = [new List&lt;User&gt;()]; // List<User> | List of user object
@ -136,7 +136,7 @@ No authorization required
### HTTP request headers ### HTTP request headers
- **Content-Type**: application/json - **Content-Type**: Not defined
- **Accept**: 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) [[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 ### Example
```dart ```dart
import 'package:swagger/api.dart'; import 'package:openapi/api.dart';
var api_instance = new UserApi(); var api_instance = new UserApi();
var username = username_example; // String | The name that needs to be deleted var username = username_example; // String | The name that needs to be deleted
@ -190,7 +190,7 @@ Get user by user name
### Example ### Example
```dart ```dart
import 'package:swagger/api.dart'; import 'package:openapi/api.dart';
var api_instance = new UserApi(); var api_instance = new UserApi();
var username = username_example; // String | The name that needs to be fetched. Use user1 for testing. var username = username_example; // String | The name that needs to be fetched. Use user1 for testing.
@ -231,7 +231,7 @@ Logs user into the system
### Example ### Example
```dart ```dart
import 'package:swagger/api.dart'; import 'package:openapi/api.dart';
var api_instance = new UserApi(); var api_instance = new UserApi();
var username = username_example; // String | The user name for login var username = username_example; // String | The user name for login
@ -274,7 +274,7 @@ Logs out current logged in user session
### Example ### Example
```dart ```dart
import 'package:swagger/api.dart'; import 'package:openapi/api.dart';
var api_instance = new UserApi(); var api_instance = new UserApi();
@ -312,7 +312,7 @@ This can only be done by the logged in user.
### Example ### Example
```dart ```dart
import 'package:swagger/api.dart'; import 'package:openapi/api.dart';
var api_instance = new UserApi(); var api_instance = new UserApi();
var username = username_example; // String | name that need to be deleted var username = username_example; // String | name that need to be deleted
@ -342,7 +342,7 @@ No authorization required
### HTTP request headers ### HTTP request headers
- **Content-Type**: application/json - **Content-Type**: Not defined
- **Accept**: 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) [[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)

View File

@ -1,4 +1,4 @@
library swagger.api; library openapi.api;
import 'dart:async'; import 'dart:async';
import 'dart:convert'; import 'dart:convert';

View File

@ -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> headerParams = {};
Map<String, String> formParams = {}; Map<String, String> formParams = {};
List<String> contentTypes = ["application/json"]; List<String> contentTypes = [];
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
List<String> authNames = []; List<String> authNames = [];

View File

@ -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> headerParams = {};
Map<String, String> formParams = {}; Map<String, String> formParams = {};
List<String> contentTypes = ["application/json"]; List<String> contentTypes = [];
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
List<String> authNames = []; List<String> authNames = [];
@ -75,7 +75,7 @@ class UserApi {
Map<String, String> headerParams = {}; Map<String, String> headerParams = {};
Map<String, String> formParams = {}; Map<String, String> formParams = {};
List<String> contentTypes = ["application/json"]; List<String> contentTypes = [];
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
List<String> authNames = []; List<String> authNames = [];
@ -124,7 +124,7 @@ class UserApi {
Map<String, String> headerParams = {}; Map<String, String> headerParams = {};
Map<String, String> formParams = {}; Map<String, String> formParams = {};
List<String> contentTypes = ["application/json"]; List<String> contentTypes = [];
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
List<String> authNames = []; List<String> authNames = [];
@ -376,7 +376,7 @@ class UserApi {
Map<String, String> headerParams = {}; Map<String, String> headerParams = {};
Map<String, String> formParams = {}; Map<String, String> formParams = {};
List<String> contentTypes = ["application/json"]; List<String> contentTypes = [];
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
List<String> authNames = []; List<String> authNames = [];

View File

@ -1,4 +1,4 @@
part of swagger.api; part of openapi.api;
class QueryParam { class QueryParam {
String name; String name;

View File

@ -1,4 +1,4 @@
part of swagger.api; part of openapi.api;
class ApiException implements Exception { class ApiException implements Exception {
int code = 0; int code = 0;

View File

@ -1,4 +1,4 @@
part of swagger.api; part of openapi.api;
const _delimiters = const {'csv': ',', 'ssv': ' ', 'tsv': '\t', 'pipes': '|'}; const _delimiters = const {'csv': ',', 'ssv': ' ', 'tsv': '\t', 'pipes': '|'};

View File

@ -1,4 +1,4 @@
part of swagger.api; part of openapi.api;
class ApiKeyAuth implements Authentication { class ApiKeyAuth implements Authentication {

View File

@ -1,4 +1,4 @@
part of swagger.api; part of openapi.api;
abstract class Authentication { abstract class Authentication {

View File

@ -1,4 +1,4 @@
part of swagger.api; part of openapi.api;
class HttpBasicAuth implements Authentication { class HttpBasicAuth implements Authentication {

View File

@ -1,4 +1,4 @@
part of swagger.api; part of openapi.api;
class OAuth implements Authentication { class OAuth implements Authentication {
String accessToken; String accessToken;

View File

@ -1,4 +1,4 @@
part of swagger.api; part of openapi.api;
class ApiResponse { class ApiResponse {

View File

@ -1,4 +1,4 @@
part of swagger.api; part of openapi.api;
class Category { class Category {

View File

@ -1,5 +1,5 @@
name: swagger name: openapi
version: 1.0.0 version: 1.0.0
description: Swagger API client description: OpenAPI API client
dependencies: dependencies:
http: '>=0.11.1 <0.12.0' http: '>=0.11.1 <0.12.0'

View File

@ -1,11 +1,11 @@
name: flutter_petstore name: flutter_petstore
description: Swagger petstore sample flutter description: OpenAPI petstore sample flutter
dependencies: dependencies:
flutter: flutter:
sdk: flutter sdk: flutter
swagger: openapi:
path: ./swagger path: ./openapi
# The following adds the Cupertino Icons font to your application. # The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons. # Use with the CupertinoIcons class for iOS style icons.

View File

@ -0,0 +1 @@
3.0.0-SNAPSHOT

View File

@ -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 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 - API version: 1.0.0
- Build package: io.swagger.codegen.languages.DartClientCodegen - Build package: org.openapitools.codegen.languages.DartClientCodegen
## Requirements ## Requirements
@ -15,11 +15,11 @@ Dart 1.20.0 or later OR Flutter 0.0.20 or later
### Github ### Github
If this Dart package is published to Github, please include the following in pubspec.yaml If this Dart package is published to Github, please include the following in pubspec.yaml
``` ```
name: swagger name: openapi
version: 1.0.0 version: 1.0.0
description: Swagger API client description: OpenAPI API client
dependencies: dependencies:
swagger: openapi:
git: https://github.com/GIT_USER_ID/GIT_REPO_ID.git git: https://github.com/GIT_USER_ID/GIT_REPO_ID.git
version: 'any' version: 'any'
``` ```
@ -28,8 +28,8 @@ dependencies:
To use the package in your local drive, please include the following in pubspec.yaml To use the package in your local drive, please include the following in pubspec.yaml
``` ```
dependencies: dependencies:
swagger: openapi:
path: /path/to/swagger path: /path/to/openapi
``` ```
## Tests ## Tests
@ -41,16 +41,16 @@ TODO
Please follow the [installation procedure](#installation--usage) and then run the following: Please follow the [installation procedure](#installation--usage) and then run the following:
```dart ```dart
import 'package:swagger/api.dart'; import 'package:openapi/api.dart';
// TODO Configure OAuth2 access token for authorization: petstore_auth // 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 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 { try {
api_instance.addPet(body); api_instance.addPet(pet);
} catch (e) { } catch (e) {
print("Exception when calling PetApi->addPet: $e\n"); print("Exception when calling PetApi->addPet: $e\n");
} }
@ -59,7 +59,7 @@ try {
## Documentation for API Endpoints ## 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 Class | Method | HTTP request | Description
------------ | ------------- | ------------- | ------------- ------------ | ------------- | ------------- | -------------

View File

@ -1,8 +1,8 @@
# swagger.model.ApiResponse # openapi.model.ApiResponse
## Load the model package ## Load the model package
```dart ```dart
import 'package:swagger/api.dart'; import 'package:openapi/api.dart';
``` ```
## Properties ## Properties

View File

@ -1,8 +1,8 @@
# swagger.model.Category # openapi.model.Category
## Load the model package ## Load the model package
```dart ```dart
import 'package:swagger/api.dart'; import 'package:openapi/api.dart';
``` ```
## Properties ## Properties

View File

@ -1,8 +1,8 @@
# swagger.model.Order # openapi.model.Order
## Load the model package ## Load the model package
```dart ```dart
import 'package:swagger/api.dart'; import 'package:openapi/api.dart';
``` ```
## Properties ## Properties
@ -13,7 +13,7 @@ Name | Type | Description | Notes
**quantity** | **int** | | [optional] [default to null] **quantity** | **int** | | [optional] [default to null]
**shipDate** | [**DateTime**](DateTime.md) | | [optional] [default to null] **shipDate** | [**DateTime**](DateTime.md) | | [optional] [default to null]
**status** | **String** | Order Status | [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) [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -1,8 +1,8 @@
# swagger.model.Pet # openapi.model.Pet
## Load the model package ## Load the model package
```dart ```dart
import 'package:swagger/api.dart'; import 'package:openapi/api.dart';
``` ```
## Properties ## Properties

View File

@ -1,11 +1,11 @@
# swagger.api.PetApi # openapi.api.PetApi
## Load the API package ## Load the API package
```dart ```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 Method | HTTP request | Description
------------- | ------------- | ------------- ------------- | ------------- | -------------
@ -20,23 +20,21 @@ Method | HTTP request | Description
# **addPet** # **addPet**
> addPet(body) > addPet(pet)
Add a new pet to the store Add a new pet to the store
### Example ### Example
```dart ```dart
import 'package:swagger/api.dart'; import 'package:openapi/api.dart';
// TODO Configure OAuth2 access token for authorization: petstore_auth // 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 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 { try {
api_instance.addPet(body); api_instance.addPet(pet);
} catch (e) { } catch (e) {
print("Exception when calling PetApi->addPet: $e\n"); print("Exception when calling PetApi->addPet: $e\n");
} }
@ -46,7 +44,7 @@ try {
Name | Type | Description | Notes Name | Type | Description | Notes
------------- | ------------- | ------------- | ------------- ------------- | ------------- | ------------- | -------------
**body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
### Return type ### Return type
@ -59,7 +57,7 @@ void (empty response body)
### HTTP request headers ### HTTP request headers
- **Content-Type**: application/json, application/xml - **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) [[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 Deletes a pet
### Example ### Example
```dart ```dart
import 'package:swagger/api.dart'; import 'package:openapi/api.dart';
// TODO Configure OAuth2 access token for authorization: petstore_auth // 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 api_instance = new PetApi();
var petId = 789; // int | Pet id to delete var petId = 789; // int | Pet id to delete
@ -105,7 +101,7 @@ void (empty response body)
### HTTP request headers ### HTTP request headers
- **Content-Type**: Not defined - **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) [[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 ### Example
```dart ```dart
import 'package:swagger/api.dart'; import 'package:openapi/api.dart';
// TODO Configure OAuth2 access token for authorization: petstore_auth // 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 api_instance = new PetApi();
var status = []; // List<String> | Status values that need to be considered for filter 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 ### Example
```dart ```dart
import 'package:swagger/api.dart'; import 'package:openapi/api.dart';
// TODO Configure OAuth2 access token for authorization: petstore_auth // 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 api_instance = new PetApi();
var tags = []; // List<String> | Tags to filter by var tags = []; // List<String> | Tags to filter by
@ -208,11 +204,11 @@ Returns a single pet
### Example ### Example
```dart ```dart
import 'package:swagger/api.dart'; import 'package:openapi/api.dart';
// TODO Configure API key authorization: api_key // 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 // 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 api_instance = new PetApi();
var petId = 789; // int | ID of pet to return 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) [[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**
> updatePet(body) > updatePet(pet)
Update an existing pet Update an existing pet
### Example ### Example
```dart ```dart
import 'package:swagger/api.dart'; import 'package:openapi/api.dart';
// TODO Configure OAuth2 access token for authorization: petstore_auth // 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 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 { try {
api_instance.updatePet(body); api_instance.updatePet(pet);
} catch (e) { } catch (e) {
print("Exception when calling PetApi->updatePet: $e\n"); print("Exception when calling PetApi->updatePet: $e\n");
} }
@ -273,7 +267,7 @@ try {
Name | Type | Description | Notes Name | Type | Description | Notes
------------- | ------------- | ------------- | ------------- ------------- | ------------- | ------------- | -------------
**body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
### Return type ### Return type
@ -286,7 +280,7 @@ void (empty response body)
### HTTP request headers ### HTTP request headers
- **Content-Type**: application/json, application/xml - **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) [[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 Updates a pet in the store with form data
### Example ### Example
```dart ```dart
import 'package:swagger/api.dart'; import 'package:openapi/api.dart';
// TODO Configure OAuth2 access token for authorization: petstore_auth // 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 api_instance = new PetApi();
var petId = 789; // int | ID of pet that needs to be updated var petId = 789; // int | ID of pet that needs to be updated
@ -320,8 +312,8 @@ try {
Name | Type | Description | Notes Name | Type | Description | Notes
------------- | ------------- | ------------- | ------------- ------------- | ------------- | ------------- | -------------
**petId** | **int**| ID of pet that needs to be updated | **petId** | **int**| ID of pet that needs to be updated |
**name** | **String**| Updated name of the pet | [optional] **name** | **String**| Updated name of the pet | [optional] [default to null]
**status** | **String**| Updated status of the pet | [optional] **status** | **String**| Updated status of the pet | [optional] [default to null]
### Return type ### Return type
@ -334,7 +326,7 @@ void (empty response body)
### HTTP request headers ### HTTP request headers
- **Content-Type**: application/x-www-form-urlencoded - **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) [[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 uploads an image
### Example ### Example
```dart ```dart
import 'package:swagger/api.dart'; import 'package:openapi/api.dart';
// TODO Configure OAuth2 access token for authorization: petstore_auth // 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 api_instance = new PetApi();
var petId = 789; // int | ID of pet to update var petId = 789; // int | ID of pet to update
var additionalMetadata = additionalMetadata_example; // String | Additional data to pass to server 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 { try {
var result = api_instance.uploadFile(petId, additionalMetadata, file); var result = api_instance.uploadFile(petId, additionalMetadata, file);
@ -369,8 +359,8 @@ try {
Name | Type | Description | Notes Name | Type | Description | Notes
------------- | ------------- | ------------- | ------------- ------------- | ------------- | ------------- | -------------
**petId** | **int**| ID of pet to update | **petId** | **int**| ID of pet to update |
**additionalMetadata** | **String**| Additional data to pass to server | [optional] **additionalMetadata** | **String**| Additional data to pass to server | [optional] [default to null]
**file** | **MultipartFile**| file to upload | [optional] **file** | **MultipartFile**| file to upload | [optional] [default to null]
### Return type ### Return type

View File

@ -1,11 +1,11 @@
# swagger.api.StoreApi # openapi.api.StoreApi
## Load the API package ## Load the API package
```dart ```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 Method | HTTP request | Description
------------- | ------------- | ------------- ------------- | ------------- | -------------
@ -24,7 +24,7 @@ For valid response try integer IDs with value < 1000. Anything above 1000 or non
### Example ### Example
```dart ```dart
import 'package:swagger/api.dart'; import 'package:openapi/api.dart';
var api_instance = new StoreApi(); var api_instance = new StoreApi();
var orderId = orderId_example; // String | ID of the order that needs to be deleted var orderId = orderId_example; // String | ID of the order that needs to be deleted
@ -53,7 +53,7 @@ No authorization required
### HTTP request headers ### HTTP request headers
- **Content-Type**: Not defined - **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) [[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 ### Example
```dart ```dart
import 'package:swagger/api.dart'; import 'package:openapi/api.dart';
// TODO Configure API key authorization: api_key // 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 // 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(); 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 ### Example
```dart ```dart
import 'package:swagger/api.dart'; import 'package:openapi/api.dart';
var api_instance = new StoreApi(); var api_instance = new StoreApi();
var orderId = 789; // int | ID of pet that needs to be fetched 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) [[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** # **placeOrder**
> Order placeOrder(body) > Order placeOrder(order)
Place an order for a pet Place an order for a pet
### Example ### Example
```dart ```dart
import 'package:swagger/api.dart'; import 'package:openapi/api.dart';
var api_instance = new StoreApi(); 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 { try {
var result = api_instance.placeOrder(body); var result = api_instance.placeOrder(order);
print(result); print(result);
} catch (e) { } catch (e) {
print("Exception when calling StoreApi->placeOrder: $e\n"); print("Exception when calling StoreApi->placeOrder: $e\n");
@ -169,7 +167,7 @@ try {
Name | Type | Description | Notes Name | Type | Description | Notes
------------- | ------------- | ------------- | ------------- ------------- | ------------- | ------------- | -------------
**body** | [**Order**](Order.md)| order placed for purchasing the pet | **order** | [**Order**](Order.md)| order placed for purchasing the pet |
### Return type ### Return type

View File

@ -1,8 +1,8 @@
# swagger.model.Tag # openapi.model.Tag
## Load the model package ## Load the model package
```dart ```dart
import 'package:swagger/api.dart'; import 'package:openapi/api.dart';
``` ```
## Properties ## Properties

View File

@ -1,8 +1,8 @@
# swagger.model.User # openapi.model.User
## Load the model package ## Load the model package
```dart ```dart
import 'package:swagger/api.dart'; import 'package:openapi/api.dart';
``` ```
## Properties ## Properties

View File

@ -1,11 +1,11 @@
# swagger.api.UserApi # openapi.api.UserApi
## Load the API package ## Load the API package
```dart ```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 Method | HTTP request | Description
------------- | ------------- | ------------- ------------- | ------------- | -------------
@ -20,7 +20,7 @@ Method | HTTP request | Description
# **createUser** # **createUser**
> createUser(body) > createUser(user)
Create user Create user
@ -28,13 +28,13 @@ This can only be done by the logged in user.
### Example ### Example
```dart ```dart
import 'package:swagger/api.dart'; import 'package:openapi/api.dart';
var api_instance = new UserApi(); var api_instance = new UserApi();
var body = new User(); // User | Created user object var user = new User(); // User | Created user object
try { try {
api_instance.createUser(body); api_instance.createUser(user);
} catch (e) { } catch (e) {
print("Exception when calling UserApi->createUser: $e\n"); print("Exception when calling UserApi->createUser: $e\n");
} }
@ -44,7 +44,7 @@ try {
Name | Type | Description | Notes Name | Type | Description | Notes
------------- | ------------- | ------------- | ------------- ------------- | ------------- | ------------- | -------------
**body** | [**User**](User.md)| Created user object | **user** | [**User**](User.md)| Created user object |
### Return type ### Return type
@ -57,26 +57,24 @@ No authorization required
### HTTP request headers ### HTTP request headers
- **Content-Type**: Not defined - **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) [[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**
> createUsersWithArrayInput(body) > createUsersWithArrayInput(user)
Creates list of users with given input array Creates list of users with given input array
### Example ### Example
```dart ```dart
import 'package:swagger/api.dart'; import 'package:openapi/api.dart';
var api_instance = new UserApi(); var api_instance = new UserApi();
var body = [new List&lt;User&gt;()]; // List<User> | List of user object var user = [new List&lt;User&gt;()]; // List<User> | List of user object
try { try {
api_instance.createUsersWithArrayInput(body); api_instance.createUsersWithArrayInput(user);
} catch (e) { } catch (e) {
print("Exception when calling UserApi->createUsersWithArrayInput: $e\n"); print("Exception when calling UserApi->createUsersWithArrayInput: $e\n");
} }
@ -86,7 +84,7 @@ try {
Name | Type | Description | Notes Name | Type | Description | Notes
------------- | ------------- | ------------- | ------------- ------------- | ------------- | ------------- | -------------
**body** | [**List&lt;User&gt;**](User.md)| List of user object | **user** | [**List&lt;User&gt;**](List.md)| List of user object |
### Return type ### Return type
@ -99,26 +97,24 @@ No authorization required
### HTTP request headers ### HTTP request headers
- **Content-Type**: Not defined - **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) [[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**
> createUsersWithListInput(body) > createUsersWithListInput(user)
Creates list of users with given input array Creates list of users with given input array
### Example ### Example
```dart ```dart
import 'package:swagger/api.dart'; import 'package:openapi/api.dart';
var api_instance = new UserApi(); var api_instance = new UserApi();
var body = [new List&lt;User&gt;()]; // List<User> | List of user object var user = [new List&lt;User&gt;()]; // List<User> | List of user object
try { try {
api_instance.createUsersWithListInput(body); api_instance.createUsersWithListInput(user);
} catch (e) { } catch (e) {
print("Exception when calling UserApi->createUsersWithListInput: $e\n"); print("Exception when calling UserApi->createUsersWithListInput: $e\n");
} }
@ -128,7 +124,7 @@ try {
Name | Type | Description | Notes Name | Type | Description | Notes
------------- | ------------- | ------------- | ------------- ------------- | ------------- | ------------- | -------------
**body** | [**List&lt;User&gt;**](User.md)| List of user object | **user** | [**List&lt;User&gt;**](List.md)| List of user object |
### Return type ### Return type
@ -141,7 +137,7 @@ No authorization required
### HTTP request headers ### HTTP request headers
- **Content-Type**: Not defined - **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) [[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 ### Example
```dart ```dart
import 'package:swagger/api.dart'; import 'package:openapi/api.dart';
var api_instance = new UserApi(); var api_instance = new UserApi();
var username = username_example; // String | The name that needs to be deleted var username = username_example; // String | The name that needs to be deleted
@ -183,7 +179,7 @@ No authorization required
### HTTP request headers ### HTTP request headers
- **Content-Type**: Not defined - **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) [[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 Get user by user name
### Example ### Example
```dart ```dart
import 'package:swagger/api.dart'; import 'package:openapi/api.dart';
var api_instance = new UserApi(); var api_instance = new UserApi();
var username = username_example; // String | The name that needs to be fetched. Use user1 for testing. var username = username_example; // String | The name that needs to be fetched. Use user1 for testing.
@ -235,11 +229,9 @@ No authorization required
Logs user into the system Logs user into the system
### Example ### Example
```dart ```dart
import 'package:swagger/api.dart'; import 'package:openapi/api.dart';
var api_instance = new UserApi(); var api_instance = new UserApi();
var username = username_example; // String | The user name for login var username = username_example; // String | The user name for login
@ -280,11 +272,9 @@ No authorization required
Logs out current logged in user session Logs out current logged in user session
### Example ### Example
```dart ```dart
import 'package:swagger/api.dart'; import 'package:openapi/api.dart';
var api_instance = new UserApi(); var api_instance = new UserApi();
@ -309,12 +299,12 @@ No authorization required
### HTTP request headers ### HTTP request headers
- **Content-Type**: Not defined - **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) [[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**
> updateUser(username, body) > updateUser(username, user)
Updated user Updated user
@ -322,14 +312,14 @@ This can only be done by the logged in user.
### Example ### Example
```dart ```dart
import 'package:swagger/api.dart'; import 'package:openapi/api.dart';
var api_instance = new UserApi(); var api_instance = new UserApi();
var username = username_example; // String | name that need to be deleted 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 { try {
api_instance.updateUser(username, body); api_instance.updateUser(username, user);
} catch (e) { } catch (e) {
print("Exception when calling UserApi->updateUser: $e\n"); print("Exception when calling UserApi->updateUser: $e\n");
} }
@ -340,7 +330,7 @@ try {
Name | Type | Description | Notes Name | Type | Description | Notes
------------- | ------------- | ------------- | ------------- ------------- | ------------- | ------------- | -------------
**username** | **String**| name that need to be deleted | **username** | **String**| name that need to be deleted |
**body** | [**User**](User.md)| Updated user object | **user** | [**User**](User.md)| Updated user object |
### Return type ### Return type
@ -353,7 +343,7 @@ No authorization required
### HTTP request headers ### HTTP request headers
- **Content-Type**: Not defined - **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) [[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)

View File

@ -1,7 +1,7 @@
#!/bin/sh #!/bin/sh
# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ # ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
# #
# Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update" # Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update"
git_user_id=$1 git_user_id=$1
git_repo_id=$2 git_repo_id=$2

View File

@ -1,4 +1,4 @@
library swagger.api; library openapi.api;
import 'dart:async'; import 'dart:async';
import 'dart:convert'; import 'dart:convert';

View File

@ -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 /// Add a new pet to the store
/// ///
/// ///
Future addPet(Pet body) async { Future addPet(Pet pet) async {
Object postBody = body; Object postBody = pet;
// verify required params are set // verify required params are set
if(body == null) { if(pet == null) {
throw new ApiException(400, "Missing required param: body"); throw new ApiException(400, "Missing required param: pet");
} }
// create path and map variables // create path and map variables
@ -34,7 +34,6 @@ class PetApi {
if(contentType.startsWith("multipart/form-data")) { if(contentType.startsWith("multipart/form-data")) {
bool hasFields = false; bool hasFields = false;
MultipartRequest mp = new MultipartRequest(null, null); MultipartRequest mp = new MultipartRequest(null, null);
if(hasFields) if(hasFields)
postBody = mp; postBody = mp;
} }
@ -53,9 +52,8 @@ class PetApi {
if(response.statusCode >= 400) { if(response.statusCode >= 400) {
throw new ApiException(response.statusCode, response.body); throw new ApiException(response.statusCode, response.body);
} else if(response.body != null) { } else if(response.body != null) {
return ;
} else { } else {
return ; return;
} }
} }
/// Deletes a pet /// Deletes a pet
@ -86,7 +84,6 @@ class PetApi {
if(contentType.startsWith("multipart/form-data")) { if(contentType.startsWith("multipart/form-data")) {
bool hasFields = false; bool hasFields = false;
MultipartRequest mp = new MultipartRequest(null, null); MultipartRequest mp = new MultipartRequest(null, null);
if(hasFields) if(hasFields)
postBody = mp; postBody = mp;
} }
@ -105,9 +102,8 @@ class PetApi {
if(response.statusCode >= 400) { if(response.statusCode >= 400) {
throw new ApiException(response.statusCode, response.body); throw new ApiException(response.statusCode, response.body);
} else if(response.body != null) { } else if(response.body != null) {
return ;
} else { } else {
return ; return;
} }
} }
/// Finds Pets by status /// Finds Pets by status
@ -138,7 +134,6 @@ class PetApi {
if(contentType.startsWith("multipart/form-data")) { if(contentType.startsWith("multipart/form-data")) {
bool hasFields = false; bool hasFields = false;
MultipartRequest mp = new MultipartRequest(null, null); MultipartRequest mp = new MultipartRequest(null, null);
if(hasFields) if(hasFields)
postBody = mp; postBody = mp;
} }
@ -157,7 +152,7 @@ class PetApi {
if(response.statusCode >= 400) { if(response.statusCode >= 400) {
throw new ApiException(response.statusCode, response.body); throw new ApiException(response.statusCode, response.body);
} else if(response.body != null) { } 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 { } else {
return null; return null;
} }
@ -190,7 +185,6 @@ class PetApi {
if(contentType.startsWith("multipart/form-data")) { if(contentType.startsWith("multipart/form-data")) {
bool hasFields = false; bool hasFields = false;
MultipartRequest mp = new MultipartRequest(null, null); MultipartRequest mp = new MultipartRequest(null, null);
if(hasFields) if(hasFields)
postBody = mp; postBody = mp;
} }
@ -209,7 +203,7 @@ class PetApi {
if(response.statusCode >= 400) { if(response.statusCode >= 400) {
throw new ApiException(response.statusCode, response.body); throw new ApiException(response.statusCode, response.body);
} else if(response.body != null) { } 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 { } else {
return null; return null;
} }
@ -241,7 +235,6 @@ class PetApi {
if(contentType.startsWith("multipart/form-data")) { if(contentType.startsWith("multipart/form-data")) {
bool hasFields = false; bool hasFields = false;
MultipartRequest mp = new MultipartRequest(null, null); MultipartRequest mp = new MultipartRequest(null, null);
if(hasFields) if(hasFields)
postBody = mp; postBody = mp;
} }
@ -260,7 +253,7 @@ class PetApi {
if(response.statusCode >= 400) { if(response.statusCode >= 400) {
throw new ApiException(response.statusCode, response.body); throw new ApiException(response.statusCode, response.body);
} else if(response.body != null) { } else if(response.body != null) {
return apiClient.deserialize(response.body, 'Pet') as Pet ; return apiClient.deserialize(response.body, 'Pet') as Pet;
} else { } else {
return null; return null;
} }
@ -268,12 +261,12 @@ class PetApi {
/// Update an existing pet /// Update an existing pet
/// ///
/// ///
Future updatePet(Pet body) async { Future updatePet(Pet pet) async {
Object postBody = body; Object postBody = pet;
// verify required params are set // verify required params are set
if(body == null) { if(pet == null) {
throw new ApiException(400, "Missing required param: body"); throw new ApiException(400, "Missing required param: pet");
} }
// create path and map variables // create path and map variables
@ -292,7 +285,6 @@ class PetApi {
if(contentType.startsWith("multipart/form-data")) { if(contentType.startsWith("multipart/form-data")) {
bool hasFields = false; bool hasFields = false;
MultipartRequest mp = new MultipartRequest(null, null); MultipartRequest mp = new MultipartRequest(null, null);
if(hasFields) if(hasFields)
postBody = mp; postBody = mp;
} }
@ -311,9 +303,8 @@ class PetApi {
if(response.statusCode >= 400) { if(response.statusCode >= 400) {
throw new ApiException(response.statusCode, response.body); throw new ApiException(response.statusCode, response.body);
} else if(response.body != null) { } else if(response.body != null) {
return ;
} else { } else {
return ; return;
} }
} }
/// Updates a pet in the store with form data /// Updates a pet in the store with form data
@ -343,24 +334,21 @@ class PetApi {
if(contentType.startsWith("multipart/form-data")) { if(contentType.startsWith("multipart/form-data")) {
bool hasFields = false; bool hasFields = false;
MultipartRequest mp = new MultipartRequest(null, null); MultipartRequest mp = new MultipartRequest(null, null);
if (name != null) { if (name != null) {
hasFields = true; hasFields = true;
mp.fields['name'] = parameterToString(name); mp.fields['name'] = parameterToString(name);
} }
if (status != null) { if (status != null) {
hasFields = true; hasFields = true;
mp.fields['status'] = parameterToString(status); mp.fields['status'] = parameterToString(status);
} }
if(hasFields) if(hasFields)
postBody = mp; postBody = mp;
} }
else { else {
if (name != null) if (name != null)
formParams['name'] = parameterToString(name); formParams['name'] = parameterToString(name);
if (status != null) if (status != null)
formParams['status'] = parameterToString(status); formParams['status'] = parameterToString(status);
} }
@ -376,9 +364,8 @@ if (status != null)
if(response.statusCode >= 400) { if(response.statusCode >= 400) {
throw new ApiException(response.statusCode, response.body); throw new ApiException(response.statusCode, response.body);
} else if(response.body != null) { } else if(response.body != null) {
return ;
} else { } else {
return ; return;
} }
} }
/// uploads an image /// uploads an image
@ -408,25 +395,21 @@ if (status != null)
if(contentType.startsWith("multipart/form-data")) { if(contentType.startsWith("multipart/form-data")) {
bool hasFields = false; bool hasFields = false;
MultipartRequest mp = new MultipartRequest(null, null); MultipartRequest mp = new MultipartRequest(null, null);
if (additionalMetadata != null) { if (additionalMetadata != null) {
hasFields = true; hasFields = true;
mp.fields['additionalMetadata'] = parameterToString(additionalMetadata); mp.fields['additionalMetadata'] = parameterToString(additionalMetadata);
} }
if (file != null) { if (file != null) {
hasFields = true; hasFields = true;
mp.fields['file'] = file.field; mp.fields['file'] = file.field;
mp.files.add(file); mp.files.add(file);
} }
if(hasFields) if(hasFields)
postBody = mp; postBody = mp;
} }
else { else {
if (additionalMetadata != null) if (additionalMetadata != null)
formParams['additionalMetadata'] = parameterToString(additionalMetadata); formParams['additionalMetadata'] = parameterToString(additionalMetadata);
} }
var response = await apiClient.invokeAPI(path, var response = await apiClient.invokeAPI(path,
@ -441,7 +424,7 @@ if (status != null)
if(response.statusCode >= 400) { if(response.statusCode >= 400) {
throw new ApiException(response.statusCode, response.body); throw new ApiException(response.statusCode, response.body);
} else if(response.body != null) { } else if(response.body != null) {
return apiClient.deserialize(response.body, 'ApiResponse') as ApiResponse ; return apiClient.deserialize(response.body, 'ApiResponse') as ApiResponse;
} else { } else {
return null; return null;
} }

View File

@ -1,4 +1,4 @@
part of swagger.api; part of openapi.api;
@ -34,7 +34,6 @@ class StoreApi {
if(contentType.startsWith("multipart/form-data")) { if(contentType.startsWith("multipart/form-data")) {
bool hasFields = false; bool hasFields = false;
MultipartRequest mp = new MultipartRequest(null, null); MultipartRequest mp = new MultipartRequest(null, null);
if(hasFields) if(hasFields)
postBody = mp; postBody = mp;
} }
@ -53,9 +52,8 @@ class StoreApi {
if(response.statusCode >= 400) { if(response.statusCode >= 400) {
throw new ApiException(response.statusCode, response.body); throw new ApiException(response.statusCode, response.body);
} else if(response.body != null) { } else if(response.body != null) {
return ;
} else { } else {
return ; return;
} }
} }
/// Returns pet inventories by status /// Returns pet inventories by status
@ -82,7 +80,6 @@ class StoreApi {
if(contentType.startsWith("multipart/form-data")) { if(contentType.startsWith("multipart/form-data")) {
bool hasFields = false; bool hasFields = false;
MultipartRequest mp = new MultipartRequest(null, null); MultipartRequest mp = new MultipartRequest(null, null);
if(hasFields) if(hasFields)
postBody = mp; postBody = mp;
} }
@ -101,7 +98,8 @@ class StoreApi {
if(response.statusCode >= 400) { if(response.statusCode >= 400) {
throw new ApiException(response.statusCode, response.body); throw new ApiException(response.statusCode, response.body);
} else if(response.body != null) { } 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 { } else {
return null; return null;
} }
@ -133,7 +131,6 @@ class StoreApi {
if(contentType.startsWith("multipart/form-data")) { if(contentType.startsWith("multipart/form-data")) {
bool hasFields = false; bool hasFields = false;
MultipartRequest mp = new MultipartRequest(null, null); MultipartRequest mp = new MultipartRequest(null, null);
if(hasFields) if(hasFields)
postBody = mp; postBody = mp;
} }
@ -152,7 +149,7 @@ class StoreApi {
if(response.statusCode >= 400) { if(response.statusCode >= 400) {
throw new ApiException(response.statusCode, response.body); throw new ApiException(response.statusCode, response.body);
} else if(response.body != null) { } else if(response.body != null) {
return apiClient.deserialize(response.body, 'Order') as Order ; return apiClient.deserialize(response.body, 'Order') as Order;
} else { } else {
return null; return null;
} }
@ -160,12 +157,12 @@ class StoreApi {
/// Place an order for a pet /// Place an order for a pet
/// ///
/// ///
Future<Order> placeOrder(Order body) async { Future<Order> placeOrder(Order order) async {
Object postBody = body; Object postBody = order;
// verify required params are set // verify required params are set
if(body == null) { if(order == null) {
throw new ApiException(400, "Missing required param: body"); throw new ApiException(400, "Missing required param: order");
} }
// create path and map variables // create path and map variables
@ -184,7 +181,6 @@ class StoreApi {
if(contentType.startsWith("multipart/form-data")) { if(contentType.startsWith("multipart/form-data")) {
bool hasFields = false; bool hasFields = false;
MultipartRequest mp = new MultipartRequest(null, null); MultipartRequest mp = new MultipartRequest(null, null);
if(hasFields) if(hasFields)
postBody = mp; postBody = mp;
} }
@ -203,7 +199,7 @@ class StoreApi {
if(response.statusCode >= 400) { if(response.statusCode >= 400) {
throw new ApiException(response.statusCode, response.body); throw new ApiException(response.statusCode, response.body);
} else if(response.body != null) { } else if(response.body != null) {
return apiClient.deserialize(response.body, 'Order') as Order ; return apiClient.deserialize(response.body, 'Order') as Order;
} else { } else {
return null; return null;
} }

View File

@ -1,4 +1,4 @@
part of swagger.api; part of openapi.api;
@ -10,12 +10,12 @@ class UserApi {
/// Create user /// Create user
/// ///
/// This can only be done by the logged in user. /// This can only be done by the logged in user.
Future createUser(User body) async { Future createUser(User user) async {
Object postBody = body; Object postBody = user;
// verify required params are set // verify required params are set
if(body == null) { if(user == null) {
throw new ApiException(400, "Missing required param: body"); throw new ApiException(400, "Missing required param: user");
} }
// create path and map variables // create path and map variables
@ -34,7 +34,6 @@ class UserApi {
if(contentType.startsWith("multipart/form-data")) { if(contentType.startsWith("multipart/form-data")) {
bool hasFields = false; bool hasFields = false;
MultipartRequest mp = new MultipartRequest(null, null); MultipartRequest mp = new MultipartRequest(null, null);
if(hasFields) if(hasFields)
postBody = mp; postBody = mp;
} }
@ -53,20 +52,19 @@ class UserApi {
if(response.statusCode >= 400) { if(response.statusCode >= 400) {
throw new ApiException(response.statusCode, response.body); throw new ApiException(response.statusCode, response.body);
} else if(response.body != null) { } else if(response.body != null) {
return ;
} else { } else {
return ; return;
} }
} }
/// Creates list of users with given input array /// Creates list of users with given input array
/// ///
/// ///
Future createUsersWithArrayInput(List<User> body) async { Future createUsersWithArrayInput(List<User> user) async {
Object postBody = body; Object postBody = user;
// verify required params are set // verify required params are set
if(body == null) { if(user == null) {
throw new ApiException(400, "Missing required param: body"); throw new ApiException(400, "Missing required param: user");
} }
// create path and map variables // create path and map variables
@ -85,7 +83,6 @@ class UserApi {
if(contentType.startsWith("multipart/form-data")) { if(contentType.startsWith("multipart/form-data")) {
bool hasFields = false; bool hasFields = false;
MultipartRequest mp = new MultipartRequest(null, null); MultipartRequest mp = new MultipartRequest(null, null);
if(hasFields) if(hasFields)
postBody = mp; postBody = mp;
} }
@ -104,20 +101,19 @@ class UserApi {
if(response.statusCode >= 400) { if(response.statusCode >= 400) {
throw new ApiException(response.statusCode, response.body); throw new ApiException(response.statusCode, response.body);
} else if(response.body != null) { } else if(response.body != null) {
return ;
} else { } else {
return ; return;
} }
} }
/// Creates list of users with given input array /// Creates list of users with given input array
/// ///
/// ///
Future createUsersWithListInput(List<User> body) async { Future createUsersWithListInput(List<User> user) async {
Object postBody = body; Object postBody = user;
// verify required params are set // verify required params are set
if(body == null) { if(user == null) {
throw new ApiException(400, "Missing required param: body"); throw new ApiException(400, "Missing required param: user");
} }
// create path and map variables // create path and map variables
@ -136,7 +132,6 @@ class UserApi {
if(contentType.startsWith("multipart/form-data")) { if(contentType.startsWith("multipart/form-data")) {
bool hasFields = false; bool hasFields = false;
MultipartRequest mp = new MultipartRequest(null, null); MultipartRequest mp = new MultipartRequest(null, null);
if(hasFields) if(hasFields)
postBody = mp; postBody = mp;
} }
@ -155,9 +150,8 @@ class UserApi {
if(response.statusCode >= 400) { if(response.statusCode >= 400) {
throw new ApiException(response.statusCode, response.body); throw new ApiException(response.statusCode, response.body);
} else if(response.body != null) { } else if(response.body != null) {
return ;
} else { } else {
return ; return;
} }
} }
/// Delete user /// Delete user
@ -187,7 +181,6 @@ class UserApi {
if(contentType.startsWith("multipart/form-data")) { if(contentType.startsWith("multipart/form-data")) {
bool hasFields = false; bool hasFields = false;
MultipartRequest mp = new MultipartRequest(null, null); MultipartRequest mp = new MultipartRequest(null, null);
if(hasFields) if(hasFields)
postBody = mp; postBody = mp;
} }
@ -206,9 +199,8 @@ class UserApi {
if(response.statusCode >= 400) { if(response.statusCode >= 400) {
throw new ApiException(response.statusCode, response.body); throw new ApiException(response.statusCode, response.body);
} else if(response.body != null) { } else if(response.body != null) {
return ;
} else { } else {
return ; return;
} }
} }
/// Get user by user name /// Get user by user name
@ -238,7 +230,6 @@ class UserApi {
if(contentType.startsWith("multipart/form-data")) { if(contentType.startsWith("multipart/form-data")) {
bool hasFields = false; bool hasFields = false;
MultipartRequest mp = new MultipartRequest(null, null); MultipartRequest mp = new MultipartRequest(null, null);
if(hasFields) if(hasFields)
postBody = mp; postBody = mp;
} }
@ -257,7 +248,7 @@ class UserApi {
if(response.statusCode >= 400) { if(response.statusCode >= 400) {
throw new ApiException(response.statusCode, response.body); throw new ApiException(response.statusCode, response.body);
} else if(response.body != null) { } else if(response.body != null) {
return apiClient.deserialize(response.body, 'User') as User ; return apiClient.deserialize(response.body, 'User') as User;
} else { } else {
return null; return null;
} }
@ -294,7 +285,6 @@ class UserApi {
if(contentType.startsWith("multipart/form-data")) { if(contentType.startsWith("multipart/form-data")) {
bool hasFields = false; bool hasFields = false;
MultipartRequest mp = new MultipartRequest(null, null); MultipartRequest mp = new MultipartRequest(null, null);
if(hasFields) if(hasFields)
postBody = mp; postBody = mp;
} }
@ -313,7 +303,7 @@ class UserApi {
if(response.statusCode >= 400) { if(response.statusCode >= 400) {
throw new ApiException(response.statusCode, response.body); throw new ApiException(response.statusCode, response.body);
} else if(response.body != null) { } else if(response.body != null) {
return apiClient.deserialize(response.body, 'String') as String ; return apiClient.deserialize(response.body, 'String') as String;
} else { } else {
return null; return null;
} }
@ -342,7 +332,6 @@ class UserApi {
if(contentType.startsWith("multipart/form-data")) { if(contentType.startsWith("multipart/form-data")) {
bool hasFields = false; bool hasFields = false;
MultipartRequest mp = new MultipartRequest(null, null); MultipartRequest mp = new MultipartRequest(null, null);
if(hasFields) if(hasFields)
postBody = mp; postBody = mp;
} }
@ -361,23 +350,22 @@ class UserApi {
if(response.statusCode >= 400) { if(response.statusCode >= 400) {
throw new ApiException(response.statusCode, response.body); throw new ApiException(response.statusCode, response.body);
} else if(response.body != null) { } else if(response.body != null) {
return ;
} else { } else {
return ; return;
} }
} }
/// Updated user /// Updated user
/// ///
/// This can only be done by the logged in user. /// This can only be done by the logged in user.
Future updateUser(String username, User body) async { Future updateUser(String username, User user) async {
Object postBody = body; Object postBody = user;
// verify required params are set // verify required params are set
if(username == null) { if(username == null) {
throw new ApiException(400, "Missing required param: username"); throw new ApiException(400, "Missing required param: username");
} }
if(body == null) { if(user == null) {
throw new ApiException(400, "Missing required param: body"); throw new ApiException(400, "Missing required param: user");
} }
// create path and map variables // create path and map variables
@ -396,7 +384,6 @@ class UserApi {
if(contentType.startsWith("multipart/form-data")) { if(contentType.startsWith("multipart/form-data")) {
bool hasFields = false; bool hasFields = false;
MultipartRequest mp = new MultipartRequest(null, null); MultipartRequest mp = new MultipartRequest(null, null);
if(hasFields) if(hasFields)
postBody = mp; postBody = mp;
} }
@ -415,9 +402,8 @@ class UserApi {
if(response.statusCode >= 400) { if(response.statusCode >= 400) {
throw new ApiException(response.statusCode, response.body); throw new ApiException(response.statusCode, response.body);
} else if(response.body != null) { } else if(response.body != null) {
return ;
} else { } else {
return ; return;
} }
} }
} }

View File

@ -1,4 +1,4 @@
part of swagger.api; part of openapi.api;
class QueryParam { class QueryParam {
String name; String name;
@ -18,7 +18,7 @@ class ApiClient {
final _RegList = new RegExp(r'^List<(.*)>$'); final _RegList = new RegExp(r'^List<(.*)>$');
final _RegMap = new RegExp(r'^Map<String,(.*)>$'); 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). // Setup authentications (key: authentication name, value: authentication).
_authentications['api_key'] = new ApiKeyAuth("header", "api_key"); _authentications['api_key'] = new ApiKeyAuth("header", "api_key");
_authentications['petstore_auth'] = new OAuth(); _authentications['petstore_auth'] = new OAuth();

View File

@ -1,4 +1,4 @@
part of swagger.api; part of openapi.api;
class ApiException implements Exception { class ApiException implements Exception {
int code = 0; int code = 0;

View File

@ -1,4 +1,4 @@
part of swagger.api; part of openapi.api;
const _delimiters = const {'csv': ',', 'ssv': ' ', 'tsv': '\t', 'pipes': '|'}; const _delimiters = const {'csv': ',', 'ssv': ' ', 'tsv': '\t', 'pipes': '|'};

View File

@ -1,4 +1,4 @@
part of swagger.api; part of openapi.api;
class ApiKeyAuth implements Authentication { class ApiKeyAuth implements Authentication {

View File

@ -1,4 +1,4 @@
part of swagger.api; part of openapi.api;
abstract class Authentication { abstract class Authentication {

View File

@ -1,4 +1,4 @@
part of swagger.api; part of openapi.api;
class HttpBasicAuth implements Authentication { class HttpBasicAuth implements Authentication {

View File

@ -1,4 +1,4 @@
part of swagger.api; part of openapi.api;
class OAuth implements Authentication { class OAuth implements Authentication {
String accessToken; String accessToken;

View File

@ -1,15 +1,12 @@
part of swagger.api; part of openapi.api;
class ApiResponse { class ApiResponse {
int code = null; int code = null;
String type = null; String type = null;
String message = null; String message = null;
ApiResponse(); ApiResponse();
@override @override
@ -19,12 +16,9 @@ class ApiResponse {
ApiResponse.fromJson(Map<String, dynamic> json) { ApiResponse.fromJson(Map<String, dynamic> json) {
if (json == null) return; if (json == null) return;
code = code = json['code'];
json['code']; type = json['type'];
type = message = json['message'];
json['type'];
message =
json['message'];
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
@ -35,12 +29,8 @@ class ApiResponse {
}; };
} }
static List<ApiResponse> listFromJson(List<Map<String, dynamic>> json) { static List<ApiResponse> listFromJson(List<dynamic> json) {
var list = new List<ApiResponse>(); return json == null ? new List<ApiResponse>() : json.map((value) => new ApiResponse.fromJson(value)).toList();
if (json != null && json.length > 0) {
json.forEach((Map<String, dynamic> value) => list.add(new ApiResponse.fromJson(value)));
}
return list;
} }
static Map<String, ApiResponse> mapFromJson(Map<String, Map<String, dynamic>> json) { static Map<String, ApiResponse> mapFromJson(Map<String, Map<String, dynamic>> json) {

View File

@ -1,12 +1,10 @@
part of swagger.api; part of openapi.api;
class Category { class Category {
int id = null; int id = null;
String name = null; String name = null;
Category(); Category();
@override @override
@ -16,10 +14,8 @@ class Category {
Category.fromJson(Map<String, dynamic> json) { Category.fromJson(Map<String, dynamic> json) {
if (json == null) return; if (json == null) return;
id = id = json['id'];
json['id']; name = json['name'];
name =
json['name'];
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
@ -29,12 +25,8 @@ class Category {
}; };
} }
static List<Category> listFromJson(List<Map<String, dynamic>> json) { static List<Category> listFromJson(List<dynamic> json) {
var list = new List<Category>(); return json == null ? new List<Category>() : json.map((value) => new Category.fromJson(value)).toList();
if (json != null && json.length > 0) {
json.forEach((Map<String, dynamic> value) => list.add(new Category.fromJson(value)));
}
return list;
} }
static Map<String, Category> mapFromJson(Map<String, Map<String, dynamic>> json) { static Map<String, Category> mapFromJson(Map<String, Map<String, dynamic>> json) {

View File

@ -1,24 +1,19 @@
part of swagger.api; part of openapi.api;
class Order { class Order {
int id = null; int id = null;
int petId = null; int petId = null;
int quantity = null; int quantity = null;
DateTime shipDate = null; DateTime shipDate = null;
/* Order Status */
/* Order Status */
String status = null; String status = null;
//enum statusEnum { placed, approved, delivered, }; //enum statusEnum { placed, approved, delivered, };{
bool complete = null;
bool complete = false;
Order(); Order();
@override @override
@ -28,17 +23,12 @@ class Order {
Order.fromJson(Map<String, dynamic> json) { Order.fromJson(Map<String, dynamic> json) {
if (json == null) return; if (json == null) return;
id = id = json['id'];
json['id']; petId = json['petId'];
petId = quantity = json['quantity'];
json['petId'];
quantity =
json['quantity'];
shipDate = json['shipDate'] == null ? null : DateTime.parse(json['shipDate']); shipDate = json['shipDate'] == null ? null : DateTime.parse(json['shipDate']);
status = status = json['status'];
json['status']; complete = json['complete'];
complete =
json['complete'];
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
@ -52,12 +42,8 @@ class Order {
}; };
} }
static List<Order> listFromJson(List<Map<String, dynamic>> json) { static List<Order> listFromJson(List<dynamic> json) {
var list = new List<Order>(); return json == null ? new List<Order>() : json.map((value) => new Order.fromJson(value)).toList();
if (json != null && json.length > 0) {
json.forEach((Map<String, dynamic> value) => list.add(new Order.fromJson(value)));
}
return list;
} }
static Map<String, Order> mapFromJson(Map<String, Map<String, dynamic>> json) { static Map<String, Order> mapFromJson(Map<String, Map<String, dynamic>> json) {

View File

@ -1,24 +1,19 @@
part of swagger.api; part of openapi.api;
class Pet { class Pet {
int id = null; int id = null;
Category category = null; Category category = null;
String name = null; String name = null;
List<String> photoUrls = []; List<String> photoUrls = [];
List<Tag> tags = []; List<Tag> tags = [];
/* pet status in the store */
/* pet status in the store */
String status = null; String status = null;
//enum statusEnum { available, pending, sold, }; //enum statusEnum { available, pending, sold, };{
Pet(); Pet();
@override @override
@ -28,22 +23,12 @@ class Pet {
Pet.fromJson(Map<String, dynamic> json) { Pet.fromJson(Map<String, dynamic> json) {
if (json == null) return; if (json == null) return;
id = id = json['id'];
json['id']; category = new Category.fromJson(json['category']);
category = name = json['name'];
photoUrls = (json['photoUrls'] as List).map((item) => item as String).toList();
tags = Tag.listFromJson(json['tags']);
new Category.fromJson(json['category']) status = json['status'];
;
name =
json['name'];
photoUrls =
json['photoUrls'];
tags =
Tag.listFromJson(json['tags'])
;
status =
json['status'];
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
@ -57,12 +42,8 @@ class Pet {
}; };
} }
static List<Pet> listFromJson(List<Map<String, dynamic>> json) { static List<Pet> listFromJson(List<dynamic> json) {
var list = new List<Pet>(); return json == null ? new List<Pet>() : json.map((value) => new Pet.fromJson(value)).toList();
if (json != null && json.length > 0) {
json.forEach((Map<String, dynamic> value) => list.add(new Pet.fromJson(value)));
}
return list;
} }
static Map<String, Pet> mapFromJson(Map<String, Map<String, dynamic>> json) { static Map<String, Pet> mapFromJson(Map<String, Map<String, dynamic>> json) {

View File

@ -1,12 +1,10 @@
part of swagger.api; part of openapi.api;
class Tag { class Tag {
int id = null; int id = null;
String name = null; String name = null;
Tag(); Tag();
@override @override
@ -16,10 +14,8 @@ class Tag {
Tag.fromJson(Map<String, dynamic> json) { Tag.fromJson(Map<String, dynamic> json) {
if (json == null) return; if (json == null) return;
id = id = json['id'];
json['id']; name = json['name'];
name =
json['name'];
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
@ -29,12 +25,8 @@ class Tag {
}; };
} }
static List<Tag> listFromJson(List<Map<String, dynamic>> json) { static List<Tag> listFromJson(List<dynamic> json) {
var list = new List<Tag>(); return json == null ? new List<Tag>() : json.map((value) => new Tag.fromJson(value)).toList();
if (json != null && json.length > 0) {
json.forEach((Map<String, dynamic> value) => list.add(new Tag.fromJson(value)));
}
return list;
} }
static Map<String, Tag> mapFromJson(Map<String, Map<String, dynamic>> json) { static Map<String, Tag> mapFromJson(Map<String, Map<String, dynamic>> json) {

View File

@ -1,30 +1,22 @@
part of swagger.api; part of openapi.api;
class User { class User {
int id = null; int id = null;
String username = null; String username = null;
String firstName = null; String firstName = null;
String lastName = null; String lastName = null;
String email = null; String email = null;
String password = null; String password = null;
String phone = null; String phone = null;
/* User Status */
/* User Status */
int userStatus = null; int userStatus = null;
User(); User();
@override @override
@ -34,22 +26,14 @@ class User {
User.fromJson(Map<String, dynamic> json) { User.fromJson(Map<String, dynamic> json) {
if (json == null) return; if (json == null) return;
id = id = json['id'];
json['id']; username = json['username'];
username = firstName = json['firstName'];
json['username']; lastName = json['lastName'];
firstName = email = json['email'];
json['firstName']; password = json['password'];
lastName = phone = json['phone'];
json['lastName']; userStatus = json['userStatus'];
email =
json['email'];
password =
json['password'];
phone =
json['phone'];
userStatus =
json['userStatus'];
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
@ -65,12 +49,8 @@ class User {
}; };
} }
static List<User> listFromJson(List<Map<String, dynamic>> json) { static List<User> listFromJson(List<dynamic> json) {
var list = new List<User>(); return json == null ? new List<User>() : json.map((value) => new User.fromJson(value)).toList();
if (json != null && json.length > 0) {
json.forEach((Map<String, dynamic> value) => list.add(new User.fromJson(value)));
}
return list;
} }
static Map<String, User> mapFromJson(Map<String, Map<String, dynamic>> json) { static Map<String, User> mapFromJson(Map<String, Map<String, dynamic>> json) {

View File

@ -1,5 +1,5 @@
name: swagger name: openapi
version: 1.0.0 version: 1.0.0
description: Swagger API client description: OpenAPI API client
dependencies: dependencies:
http: '>=0.11.1 <0.12.0' http: '>=0.11.1 <0.12.0'

View File

@ -0,0 +1,2 @@
analyzer:
strong-mode: true

View File

@ -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

View File

@ -0,0 +1 @@
3.0.0-SNAPSHOT

View File

@ -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 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 - API version: 1.0.0
- Build package: io.swagger.codegen.languages.DartClientCodegen - Build package: org.openapitools.codegen.languages.DartClientCodegen
## Requirements ## Requirements
@ -15,11 +15,11 @@ Dart 1.20.0 or later OR Flutter 0.0.20 or later
### Github ### Github
If this Dart package is published to Github, please include the following in pubspec.yaml If this Dart package is published to Github, please include the following in pubspec.yaml
``` ```
name: swagger name: openapi
version: 1.0.0 version: 1.0.0
description: Swagger API client description: OpenAPI API client
dependencies: dependencies:
swagger: openapi:
git: https://github.com/GIT_USER_ID/GIT_REPO_ID.git git: https://github.com/GIT_USER_ID/GIT_REPO_ID.git
version: 'any' version: 'any'
``` ```
@ -28,8 +28,8 @@ dependencies:
To use the package in your local drive, please include the following in pubspec.yaml To use the package in your local drive, please include the following in pubspec.yaml
``` ```
dependencies: dependencies:
swagger: openapi:
path: /path/to/swagger path: /path/to/openapi
``` ```
## Tests ## Tests
@ -41,16 +41,16 @@ TODO
Please follow the [installation procedure](#installation--usage) and then run the following: Please follow the [installation procedure](#installation--usage) and then run the following:
```dart ```dart
import 'package:swagger/api.dart'; import 'package:openapi/api.dart';
// TODO Configure OAuth2 access token for authorization: petstore_auth // 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 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 { try {
api_instance.addPet(body); api_instance.addPet(pet);
} catch (e) { } catch (e) {
print("Exception when calling PetApi->addPet: $e\n"); print("Exception when calling PetApi->addPet: $e\n");
} }
@ -59,7 +59,7 @@ try {
## Documentation for API Endpoints ## 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 Class | Method | HTTP request | Description
------------ | ------------- | ------------- | ------------- ------------ | ------------- | ------------- | -------------

View File

@ -1,8 +1,8 @@
# swagger.model.ApiResponse # openapi.model.ApiResponse
## Load the model package ## Load the model package
```dart ```dart
import 'package:swagger/api.dart'; import 'package:openapi/api.dart';
``` ```
## Properties ## Properties

View File

@ -1,8 +1,8 @@
# swagger.model.Category # openapi.model.Category
## Load the model package ## Load the model package
```dart ```dart
import 'package:swagger/api.dart'; import 'package:openapi/api.dart';
``` ```
## Properties ## Properties

View File

@ -1,8 +1,8 @@
# swagger.model.Order # openapi.model.Order
## Load the model package ## Load the model package
```dart ```dart
import 'package:swagger/api.dart'; import 'package:openapi/api.dart';
``` ```
## Properties ## Properties
@ -13,7 +13,7 @@ Name | Type | Description | Notes
**quantity** | **int** | | [optional] [default to null] **quantity** | **int** | | [optional] [default to null]
**shipDate** | [**DateTime**](DateTime.md) | | [optional] [default to null] **shipDate** | [**DateTime**](DateTime.md) | | [optional] [default to null]
**status** | **String** | Order Status | [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) [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -1,8 +1,8 @@
# swagger.model.Pet # openapi.model.Pet
## Load the model package ## Load the model package
```dart ```dart
import 'package:swagger/api.dart'; import 'package:openapi/api.dart';
``` ```
## Properties ## Properties

View File

@ -1,11 +1,11 @@
# swagger.api.PetApi # openapi.api.PetApi
## Load the API package ## Load the API package
```dart ```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 Method | HTTP request | Description
------------- | ------------- | ------------- ------------- | ------------- | -------------
@ -20,23 +20,21 @@ Method | HTTP request | Description
# **addPet** # **addPet**
> addPet(body) > addPet(pet)
Add a new pet to the store Add a new pet to the store
### Example ### Example
```dart ```dart
import 'package:swagger/api.dart'; import 'package:openapi/api.dart';
// TODO Configure OAuth2 access token for authorization: petstore_auth // 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 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 { try {
api_instance.addPet(body); api_instance.addPet(pet);
} catch (e) { } catch (e) {
print("Exception when calling PetApi->addPet: $e\n"); print("Exception when calling PetApi->addPet: $e\n");
} }
@ -46,7 +44,7 @@ try {
Name | Type | Description | Notes Name | Type | Description | Notes
------------- | ------------- | ------------- | ------------- ------------- | ------------- | ------------- | -------------
**body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
### Return type ### Return type
@ -59,7 +57,7 @@ void (empty response body)
### HTTP request headers ### HTTP request headers
- **Content-Type**: application/json, application/xml - **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) [[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 Deletes a pet
### Example ### Example
```dart ```dart
import 'package:swagger/api.dart'; import 'package:openapi/api.dart';
// TODO Configure OAuth2 access token for authorization: petstore_auth // 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 api_instance = new PetApi();
var petId = 789; // int | Pet id to delete var petId = 789; // int | Pet id to delete
@ -105,7 +101,7 @@ void (empty response body)
### HTTP request headers ### HTTP request headers
- **Content-Type**: Not defined - **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) [[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 ### Example
```dart ```dart
import 'package:swagger/api.dart'; import 'package:openapi/api.dart';
// TODO Configure OAuth2 access token for authorization: petstore_auth // 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 api_instance = new PetApi();
var status = []; // List<String> | Status values that need to be considered for filter 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 ### Example
```dart ```dart
import 'package:swagger/api.dart'; import 'package:openapi/api.dart';
// TODO Configure OAuth2 access token for authorization: petstore_auth // 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 api_instance = new PetApi();
var tags = []; // List<String> | Tags to filter by var tags = []; // List<String> | Tags to filter by
@ -208,11 +204,11 @@ Returns a single pet
### Example ### Example
```dart ```dart
import 'package:swagger/api.dart'; import 'package:openapi/api.dart';
// TODO Configure API key authorization: api_key // 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 // 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 api_instance = new PetApi();
var petId = 789; // int | ID of pet to return 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) [[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**
> updatePet(body) > updatePet(pet)
Update an existing pet Update an existing pet
### Example ### Example
```dart ```dart
import 'package:swagger/api.dart'; import 'package:openapi/api.dart';
// TODO Configure OAuth2 access token for authorization: petstore_auth // 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 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 { try {
api_instance.updatePet(body); api_instance.updatePet(pet);
} catch (e) { } catch (e) {
print("Exception when calling PetApi->updatePet: $e\n"); print("Exception when calling PetApi->updatePet: $e\n");
} }
@ -273,7 +267,7 @@ try {
Name | Type | Description | Notes Name | Type | Description | Notes
------------- | ------------- | ------------- | ------------- ------------- | ------------- | ------------- | -------------
**body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
### Return type ### Return type
@ -286,7 +280,7 @@ void (empty response body)
### HTTP request headers ### HTTP request headers
- **Content-Type**: application/json, application/xml - **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) [[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 Updates a pet in the store with form data
### Example ### Example
```dart ```dart
import 'package:swagger/api.dart'; import 'package:openapi/api.dart';
// TODO Configure OAuth2 access token for authorization: petstore_auth // 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 api_instance = new PetApi();
var petId = 789; // int | ID of pet that needs to be updated var petId = 789; // int | ID of pet that needs to be updated
@ -320,8 +312,8 @@ try {
Name | Type | Description | Notes Name | Type | Description | Notes
------------- | ------------- | ------------- | ------------- ------------- | ------------- | ------------- | -------------
**petId** | **int**| ID of pet that needs to be updated | **petId** | **int**| ID of pet that needs to be updated |
**name** | **String**| Updated name of the pet | [optional] **name** | **String**| Updated name of the pet | [optional] [default to null]
**status** | **String**| Updated status of the pet | [optional] **status** | **String**| Updated status of the pet | [optional] [default to null]
### Return type ### Return type
@ -334,7 +326,7 @@ void (empty response body)
### HTTP request headers ### HTTP request headers
- **Content-Type**: application/x-www-form-urlencoded - **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) [[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 uploads an image
### Example ### Example
```dart ```dart
import 'package:swagger/api.dart'; import 'package:openapi/api.dart';
// TODO Configure OAuth2 access token for authorization: petstore_auth // 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 api_instance = new PetApi();
var petId = 789; // int | ID of pet to update var petId = 789; // int | ID of pet to update
var additionalMetadata = additionalMetadata_example; // String | Additional data to pass to server 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 { try {
var result = api_instance.uploadFile(petId, additionalMetadata, file); var result = api_instance.uploadFile(petId, additionalMetadata, file);
@ -369,8 +359,8 @@ try {
Name | Type | Description | Notes Name | Type | Description | Notes
------------- | ------------- | ------------- | ------------- ------------- | ------------- | ------------- | -------------
**petId** | **int**| ID of pet to update | **petId** | **int**| ID of pet to update |
**additionalMetadata** | **String**| Additional data to pass to server | [optional] **additionalMetadata** | **String**| Additional data to pass to server | [optional] [default to null]
**file** | **MultipartFile**| file to upload | [optional] **file** | **MultipartFile**| file to upload | [optional] [default to null]
### Return type ### Return type

View File

@ -1,11 +1,11 @@
# swagger.api.StoreApi # openapi.api.StoreApi
## Load the API package ## Load the API package
```dart ```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 Method | HTTP request | Description
------------- | ------------- | ------------- ------------- | ------------- | -------------
@ -24,7 +24,7 @@ For valid response try integer IDs with value < 1000. Anything above 1000 or non
### Example ### Example
```dart ```dart
import 'package:swagger/api.dart'; import 'package:openapi/api.dart';
var api_instance = new StoreApi(); var api_instance = new StoreApi();
var orderId = orderId_example; // String | ID of the order that needs to be deleted var orderId = orderId_example; // String | ID of the order that needs to be deleted
@ -53,7 +53,7 @@ No authorization required
### HTTP request headers ### HTTP request headers
- **Content-Type**: Not defined - **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) [[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 ### Example
```dart ```dart
import 'package:swagger/api.dart'; import 'package:openapi/api.dart';
// TODO Configure API key authorization: api_key // 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 // 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(); 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 ### Example
```dart ```dart
import 'package:swagger/api.dart'; import 'package:openapi/api.dart';
var api_instance = new StoreApi(); var api_instance = new StoreApi();
var orderId = 789; // int | ID of pet that needs to be fetched 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) [[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** # **placeOrder**
> Order placeOrder(body) > Order placeOrder(order)
Place an order for a pet Place an order for a pet
### Example ### Example
```dart ```dart
import 'package:swagger/api.dart'; import 'package:openapi/api.dart';
var api_instance = new StoreApi(); 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 { try {
var result = api_instance.placeOrder(body); var result = api_instance.placeOrder(order);
print(result); print(result);
} catch (e) { } catch (e) {
print("Exception when calling StoreApi->placeOrder: $e\n"); print("Exception when calling StoreApi->placeOrder: $e\n");
@ -169,7 +167,7 @@ try {
Name | Type | Description | Notes Name | Type | Description | Notes
------------- | ------------- | ------------- | ------------- ------------- | ------------- | ------------- | -------------
**body** | [**Order**](Order.md)| order placed for purchasing the pet | **order** | [**Order**](Order.md)| order placed for purchasing the pet |
### Return type ### Return type

View File

@ -1,8 +1,8 @@
# swagger.model.Tag # openapi.model.Tag
## Load the model package ## Load the model package
```dart ```dart
import 'package:swagger/api.dart'; import 'package:openapi/api.dart';
``` ```
## Properties ## Properties

View File

@ -1,8 +1,8 @@
# swagger.model.User # openapi.model.User
## Load the model package ## Load the model package
```dart ```dart
import 'package:swagger/api.dart'; import 'package:openapi/api.dart';
``` ```
## Properties ## Properties

View File

@ -1,11 +1,11 @@
# swagger.api.UserApi # openapi.api.UserApi
## Load the API package ## Load the API package
```dart ```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 Method | HTTP request | Description
------------- | ------------- | ------------- ------------- | ------------- | -------------
@ -20,7 +20,7 @@ Method | HTTP request | Description
# **createUser** # **createUser**
> createUser(body) > createUser(user)
Create user Create user
@ -28,13 +28,13 @@ This can only be done by the logged in user.
### Example ### Example
```dart ```dart
import 'package:swagger/api.dart'; import 'package:openapi/api.dart';
var api_instance = new UserApi(); var api_instance = new UserApi();
var body = new User(); // User | Created user object var user = new User(); // User | Created user object
try { try {
api_instance.createUser(body); api_instance.createUser(user);
} catch (e) { } catch (e) {
print("Exception when calling UserApi->createUser: $e\n"); print("Exception when calling UserApi->createUser: $e\n");
} }
@ -44,7 +44,7 @@ try {
Name | Type | Description | Notes Name | Type | Description | Notes
------------- | ------------- | ------------- | ------------- ------------- | ------------- | ------------- | -------------
**body** | [**User**](User.md)| Created user object | **user** | [**User**](User.md)| Created user object |
### Return type ### Return type
@ -57,26 +57,24 @@ No authorization required
### HTTP request headers ### HTTP request headers
- **Content-Type**: Not defined - **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) [[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**
> createUsersWithArrayInput(body) > createUsersWithArrayInput(user)
Creates list of users with given input array Creates list of users with given input array
### Example ### Example
```dart ```dart
import 'package:swagger/api.dart'; import 'package:openapi/api.dart';
var api_instance = new UserApi(); var api_instance = new UserApi();
var body = [new List&lt;User&gt;()]; // List<User> | List of user object var user = [new List&lt;User&gt;()]; // List<User> | List of user object
try { try {
api_instance.createUsersWithArrayInput(body); api_instance.createUsersWithArrayInput(user);
} catch (e) { } catch (e) {
print("Exception when calling UserApi->createUsersWithArrayInput: $e\n"); print("Exception when calling UserApi->createUsersWithArrayInput: $e\n");
} }
@ -86,7 +84,7 @@ try {
Name | Type | Description | Notes Name | Type | Description | Notes
------------- | ------------- | ------------- | ------------- ------------- | ------------- | ------------- | -------------
**body** | [**List&lt;User&gt;**](User.md)| List of user object | **user** | [**List&lt;User&gt;**](List.md)| List of user object |
### Return type ### Return type
@ -99,26 +97,24 @@ No authorization required
### HTTP request headers ### HTTP request headers
- **Content-Type**: Not defined - **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) [[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**
> createUsersWithListInput(body) > createUsersWithListInput(user)
Creates list of users with given input array Creates list of users with given input array
### Example ### Example
```dart ```dart
import 'package:swagger/api.dart'; import 'package:openapi/api.dart';
var api_instance = new UserApi(); var api_instance = new UserApi();
var body = [new List&lt;User&gt;()]; // List<User> | List of user object var user = [new List&lt;User&gt;()]; // List<User> | List of user object
try { try {
api_instance.createUsersWithListInput(body); api_instance.createUsersWithListInput(user);
} catch (e) { } catch (e) {
print("Exception when calling UserApi->createUsersWithListInput: $e\n"); print("Exception when calling UserApi->createUsersWithListInput: $e\n");
} }
@ -128,7 +124,7 @@ try {
Name | Type | Description | Notes Name | Type | Description | Notes
------------- | ------------- | ------------- | ------------- ------------- | ------------- | ------------- | -------------
**body** | [**List&lt;User&gt;**](User.md)| List of user object | **user** | [**List&lt;User&gt;**](List.md)| List of user object |
### Return type ### Return type
@ -141,7 +137,7 @@ No authorization required
### HTTP request headers ### HTTP request headers
- **Content-Type**: Not defined - **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) [[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 ### Example
```dart ```dart
import 'package:swagger/api.dart'; import 'package:openapi/api.dart';
var api_instance = new UserApi(); var api_instance = new UserApi();
var username = username_example; // String | The name that needs to be deleted var username = username_example; // String | The name that needs to be deleted
@ -183,7 +179,7 @@ No authorization required
### HTTP request headers ### HTTP request headers
- **Content-Type**: Not defined - **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) [[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 Get user by user name
### Example ### Example
```dart ```dart
import 'package:swagger/api.dart'; import 'package:openapi/api.dart';
var api_instance = new UserApi(); var api_instance = new UserApi();
var username = username_example; // String | The name that needs to be fetched. Use user1 for testing. var username = username_example; // String | The name that needs to be fetched. Use user1 for testing.
@ -235,11 +229,9 @@ No authorization required
Logs user into the system Logs user into the system
### Example ### Example
```dart ```dart
import 'package:swagger/api.dart'; import 'package:openapi/api.dart';
var api_instance = new UserApi(); var api_instance = new UserApi();
var username = username_example; // String | The user name for login var username = username_example; // String | The user name for login
@ -280,11 +272,9 @@ No authorization required
Logs out current logged in user session Logs out current logged in user session
### Example ### Example
```dart ```dart
import 'package:swagger/api.dart'; import 'package:openapi/api.dart';
var api_instance = new UserApi(); var api_instance = new UserApi();
@ -309,12 +299,12 @@ No authorization required
### HTTP request headers ### HTTP request headers
- **Content-Type**: Not defined - **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) [[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**
> updateUser(username, body) > updateUser(username, user)
Updated user Updated user
@ -322,14 +312,14 @@ This can only be done by the logged in user.
### Example ### Example
```dart ```dart
import 'package:swagger/api.dart'; import 'package:openapi/api.dart';
var api_instance = new UserApi(); var api_instance = new UserApi();
var username = username_example; // String | name that need to be deleted 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 { try {
api_instance.updateUser(username, body); api_instance.updateUser(username, user);
} catch (e) { } catch (e) {
print("Exception when calling UserApi->updateUser: $e\n"); print("Exception when calling UserApi->updateUser: $e\n");
} }
@ -340,7 +330,7 @@ try {
Name | Type | Description | Notes Name | Type | Description | Notes
------------- | ------------- | ------------- | ------------- ------------- | ------------- | ------------- | -------------
**username** | **String**| name that need to be deleted | **username** | **String**| name that need to be deleted |
**body** | [**User**](User.md)| Updated user object | **user** | [**User**](User.md)| Updated user object |
### Return type ### Return type
@ -353,7 +343,7 @@ No authorization required
### HTTP request headers ### HTTP request headers
- **Content-Type**: Not defined - **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) [[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)

View File

@ -1,7 +1,7 @@
#!/bin/sh #!/bin/sh
# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ # ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
# #
# Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update" # Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update"
git_user_id=$1 git_user_id=$1
git_repo_id=$2 git_repo_id=$2

View File

@ -1,4 +1,4 @@
library swagger.api; library openapi.api;
import 'dart:async'; import 'dart:async';
import 'dart:convert'; import 'dart:convert';

View File

@ -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 /// Add a new pet to the store
/// ///
/// ///
Future addPet(Pet body) async { Future addPet(Pet pet) async {
Object postBody = body; Object postBody = pet;
// verify required params are set // verify required params are set
if(body == null) { if(pet == null) {
throw new ApiException(400, "Missing required param: body"); throw new ApiException(400, "Missing required param: pet");
} }
// create path and map variables // create path and map variables
@ -34,7 +34,6 @@ class PetApi {
if(contentType.startsWith("multipart/form-data")) { if(contentType.startsWith("multipart/form-data")) {
bool hasFields = false; bool hasFields = false;
MultipartRequest mp = new MultipartRequest(null, null); MultipartRequest mp = new MultipartRequest(null, null);
if(hasFields) if(hasFields)
postBody = mp; postBody = mp;
} }
@ -53,9 +52,8 @@ class PetApi {
if(response.statusCode >= 400) { if(response.statusCode >= 400) {
throw new ApiException(response.statusCode, response.body); throw new ApiException(response.statusCode, response.body);
} else if(response.body != null) { } else if(response.body != null) {
return ;
} else { } else {
return ; return;
} }
} }
/// Deletes a pet /// Deletes a pet
@ -86,7 +84,6 @@ class PetApi {
if(contentType.startsWith("multipart/form-data")) { if(contentType.startsWith("multipart/form-data")) {
bool hasFields = false; bool hasFields = false;
MultipartRequest mp = new MultipartRequest(null, null); MultipartRequest mp = new MultipartRequest(null, null);
if(hasFields) if(hasFields)
postBody = mp; postBody = mp;
} }
@ -105,9 +102,8 @@ class PetApi {
if(response.statusCode >= 400) { if(response.statusCode >= 400) {
throw new ApiException(response.statusCode, response.body); throw new ApiException(response.statusCode, response.body);
} else if(response.body != null) { } else if(response.body != null) {
return ;
} else { } else {
return ; return;
} }
} }
/// Finds Pets by status /// Finds Pets by status
@ -138,7 +134,6 @@ class PetApi {
if(contentType.startsWith("multipart/form-data")) { if(contentType.startsWith("multipart/form-data")) {
bool hasFields = false; bool hasFields = false;
MultipartRequest mp = new MultipartRequest(null, null); MultipartRequest mp = new MultipartRequest(null, null);
if(hasFields) if(hasFields)
postBody = mp; postBody = mp;
} }
@ -157,7 +152,7 @@ class PetApi {
if(response.statusCode >= 400) { if(response.statusCode >= 400) {
throw new ApiException(response.statusCode, response.body); throw new ApiException(response.statusCode, response.body);
} else if(response.body != null) { } 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 { } else {
return null; return null;
} }
@ -190,7 +185,6 @@ class PetApi {
if(contentType.startsWith("multipart/form-data")) { if(contentType.startsWith("multipart/form-data")) {
bool hasFields = false; bool hasFields = false;
MultipartRequest mp = new MultipartRequest(null, null); MultipartRequest mp = new MultipartRequest(null, null);
if(hasFields) if(hasFields)
postBody = mp; postBody = mp;
} }
@ -209,7 +203,7 @@ class PetApi {
if(response.statusCode >= 400) { if(response.statusCode >= 400) {
throw new ApiException(response.statusCode, response.body); throw new ApiException(response.statusCode, response.body);
} else if(response.body != null) { } 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 { } else {
return null; return null;
} }
@ -241,7 +235,6 @@ class PetApi {
if(contentType.startsWith("multipart/form-data")) { if(contentType.startsWith("multipart/form-data")) {
bool hasFields = false; bool hasFields = false;
MultipartRequest mp = new MultipartRequest(null, null); MultipartRequest mp = new MultipartRequest(null, null);
if(hasFields) if(hasFields)
postBody = mp; postBody = mp;
} }
@ -260,7 +253,7 @@ class PetApi {
if(response.statusCode >= 400) { if(response.statusCode >= 400) {
throw new ApiException(response.statusCode, response.body); throw new ApiException(response.statusCode, response.body);
} else if(response.body != null) { } else if(response.body != null) {
return apiClient.deserialize(response.body, 'Pet') as Pet ; return apiClient.deserialize(response.body, 'Pet') as Pet;
} else { } else {
return null; return null;
} }
@ -268,12 +261,12 @@ class PetApi {
/// Update an existing pet /// Update an existing pet
/// ///
/// ///
Future updatePet(Pet body) async { Future updatePet(Pet pet) async {
Object postBody = body; Object postBody = pet;
// verify required params are set // verify required params are set
if(body == null) { if(pet == null) {
throw new ApiException(400, "Missing required param: body"); throw new ApiException(400, "Missing required param: pet");
} }
// create path and map variables // create path and map variables
@ -292,7 +285,6 @@ class PetApi {
if(contentType.startsWith("multipart/form-data")) { if(contentType.startsWith("multipart/form-data")) {
bool hasFields = false; bool hasFields = false;
MultipartRequest mp = new MultipartRequest(null, null); MultipartRequest mp = new MultipartRequest(null, null);
if(hasFields) if(hasFields)
postBody = mp; postBody = mp;
} }
@ -311,9 +303,8 @@ class PetApi {
if(response.statusCode >= 400) { if(response.statusCode >= 400) {
throw new ApiException(response.statusCode, response.body); throw new ApiException(response.statusCode, response.body);
} else if(response.body != null) { } else if(response.body != null) {
return ;
} else { } else {
return ; return;
} }
} }
/// Updates a pet in the store with form data /// Updates a pet in the store with form data
@ -343,24 +334,21 @@ class PetApi {
if(contentType.startsWith("multipart/form-data")) { if(contentType.startsWith("multipart/form-data")) {
bool hasFields = false; bool hasFields = false;
MultipartRequest mp = new MultipartRequest(null, null); MultipartRequest mp = new MultipartRequest(null, null);
if (name != null) { if (name != null) {
hasFields = true; hasFields = true;
mp.fields['name'] = parameterToString(name); mp.fields['name'] = parameterToString(name);
} }
if (status != null) { if (status != null) {
hasFields = true; hasFields = true;
mp.fields['status'] = parameterToString(status); mp.fields['status'] = parameterToString(status);
} }
if(hasFields) if(hasFields)
postBody = mp; postBody = mp;
} }
else { else {
if (name != null) if (name != null)
formParams['name'] = parameterToString(name); formParams['name'] = parameterToString(name);
if (status != null) if (status != null)
formParams['status'] = parameterToString(status); formParams['status'] = parameterToString(status);
} }
@ -376,9 +364,8 @@ if (status != null)
if(response.statusCode >= 400) { if(response.statusCode >= 400) {
throw new ApiException(response.statusCode, response.body); throw new ApiException(response.statusCode, response.body);
} else if(response.body != null) { } else if(response.body != null) {
return ;
} else { } else {
return ; return;
} }
} }
/// uploads an image /// uploads an image
@ -408,25 +395,21 @@ if (status != null)
if(contentType.startsWith("multipart/form-data")) { if(contentType.startsWith("multipart/form-data")) {
bool hasFields = false; bool hasFields = false;
MultipartRequest mp = new MultipartRequest(null, null); MultipartRequest mp = new MultipartRequest(null, null);
if (additionalMetadata != null) { if (additionalMetadata != null) {
hasFields = true; hasFields = true;
mp.fields['additionalMetadata'] = parameterToString(additionalMetadata); mp.fields['additionalMetadata'] = parameterToString(additionalMetadata);
} }
if (file != null) { if (file != null) {
hasFields = true; hasFields = true;
mp.fields['file'] = file.field; mp.fields['file'] = file.field;
mp.files.add(file); mp.files.add(file);
} }
if(hasFields) if(hasFields)
postBody = mp; postBody = mp;
} }
else { else {
if (additionalMetadata != null) if (additionalMetadata != null)
formParams['additionalMetadata'] = parameterToString(additionalMetadata); formParams['additionalMetadata'] = parameterToString(additionalMetadata);
} }
var response = await apiClient.invokeAPI(path, var response = await apiClient.invokeAPI(path,
@ -441,7 +424,7 @@ if (status != null)
if(response.statusCode >= 400) { if(response.statusCode >= 400) {
throw new ApiException(response.statusCode, response.body); throw new ApiException(response.statusCode, response.body);
} else if(response.body != null) { } else if(response.body != null) {
return apiClient.deserialize(response.body, 'ApiResponse') as ApiResponse ; return apiClient.deserialize(response.body, 'ApiResponse') as ApiResponse;
} else { } else {
return null; return null;
} }

View File

@ -1,4 +1,4 @@
part of swagger.api; part of openapi.api;
@ -34,7 +34,6 @@ class StoreApi {
if(contentType.startsWith("multipart/form-data")) { if(contentType.startsWith("multipart/form-data")) {
bool hasFields = false; bool hasFields = false;
MultipartRequest mp = new MultipartRequest(null, null); MultipartRequest mp = new MultipartRequest(null, null);
if(hasFields) if(hasFields)
postBody = mp; postBody = mp;
} }
@ -53,9 +52,8 @@ class StoreApi {
if(response.statusCode >= 400) { if(response.statusCode >= 400) {
throw new ApiException(response.statusCode, response.body); throw new ApiException(response.statusCode, response.body);
} else if(response.body != null) { } else if(response.body != null) {
return ;
} else { } else {
return ; return;
} }
} }
/// Returns pet inventories by status /// Returns pet inventories by status
@ -82,7 +80,6 @@ class StoreApi {
if(contentType.startsWith("multipart/form-data")) { if(contentType.startsWith("multipart/form-data")) {
bool hasFields = false; bool hasFields = false;
MultipartRequest mp = new MultipartRequest(null, null); MultipartRequest mp = new MultipartRequest(null, null);
if(hasFields) if(hasFields)
postBody = mp; postBody = mp;
} }
@ -101,7 +98,8 @@ class StoreApi {
if(response.statusCode >= 400) { if(response.statusCode >= 400) {
throw new ApiException(response.statusCode, response.body); throw new ApiException(response.statusCode, response.body);
} else if(response.body != null) { } 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 { } else {
return null; return null;
} }
@ -133,7 +131,6 @@ class StoreApi {
if(contentType.startsWith("multipart/form-data")) { if(contentType.startsWith("multipart/form-data")) {
bool hasFields = false; bool hasFields = false;
MultipartRequest mp = new MultipartRequest(null, null); MultipartRequest mp = new MultipartRequest(null, null);
if(hasFields) if(hasFields)
postBody = mp; postBody = mp;
} }
@ -152,7 +149,7 @@ class StoreApi {
if(response.statusCode >= 400) { if(response.statusCode >= 400) {
throw new ApiException(response.statusCode, response.body); throw new ApiException(response.statusCode, response.body);
} else if(response.body != null) { } else if(response.body != null) {
return apiClient.deserialize(response.body, 'Order') as Order ; return apiClient.deserialize(response.body, 'Order') as Order;
} else { } else {
return null; return null;
} }
@ -160,12 +157,12 @@ class StoreApi {
/// Place an order for a pet /// Place an order for a pet
/// ///
/// ///
Future<Order> placeOrder(Order body) async { Future<Order> placeOrder(Order order) async {
Object postBody = body; Object postBody = order;
// verify required params are set // verify required params are set
if(body == null) { if(order == null) {
throw new ApiException(400, "Missing required param: body"); throw new ApiException(400, "Missing required param: order");
} }
// create path and map variables // create path and map variables
@ -184,7 +181,6 @@ class StoreApi {
if(contentType.startsWith("multipart/form-data")) { if(contentType.startsWith("multipart/form-data")) {
bool hasFields = false; bool hasFields = false;
MultipartRequest mp = new MultipartRequest(null, null); MultipartRequest mp = new MultipartRequest(null, null);
if(hasFields) if(hasFields)
postBody = mp; postBody = mp;
} }
@ -203,7 +199,7 @@ class StoreApi {
if(response.statusCode >= 400) { if(response.statusCode >= 400) {
throw new ApiException(response.statusCode, response.body); throw new ApiException(response.statusCode, response.body);
} else if(response.body != null) { } else if(response.body != null) {
return apiClient.deserialize(response.body, 'Order') as Order ; return apiClient.deserialize(response.body, 'Order') as Order;
} else { } else {
return null; return null;
} }

View File

@ -1,4 +1,4 @@
part of swagger.api; part of openapi.api;
@ -10,12 +10,12 @@ class UserApi {
/// Create user /// Create user
/// ///
/// This can only be done by the logged in user. /// This can only be done by the logged in user.
Future createUser(User body) async { Future createUser(User user) async {
Object postBody = body; Object postBody = user;
// verify required params are set // verify required params are set
if(body == null) { if(user == null) {
throw new ApiException(400, "Missing required param: body"); throw new ApiException(400, "Missing required param: user");
} }
// create path and map variables // create path and map variables
@ -34,7 +34,6 @@ class UserApi {
if(contentType.startsWith("multipart/form-data")) { if(contentType.startsWith("multipart/form-data")) {
bool hasFields = false; bool hasFields = false;
MultipartRequest mp = new MultipartRequest(null, null); MultipartRequest mp = new MultipartRequest(null, null);
if(hasFields) if(hasFields)
postBody = mp; postBody = mp;
} }
@ -53,20 +52,19 @@ class UserApi {
if(response.statusCode >= 400) { if(response.statusCode >= 400) {
throw new ApiException(response.statusCode, response.body); throw new ApiException(response.statusCode, response.body);
} else if(response.body != null) { } else if(response.body != null) {
return ;
} else { } else {
return ; return;
} }
} }
/// Creates list of users with given input array /// Creates list of users with given input array
/// ///
/// ///
Future createUsersWithArrayInput(List<User> body) async { Future createUsersWithArrayInput(List<User> user) async {
Object postBody = body; Object postBody = user;
// verify required params are set // verify required params are set
if(body == null) { if(user == null) {
throw new ApiException(400, "Missing required param: body"); throw new ApiException(400, "Missing required param: user");
} }
// create path and map variables // create path and map variables
@ -85,7 +83,6 @@ class UserApi {
if(contentType.startsWith("multipart/form-data")) { if(contentType.startsWith("multipart/form-data")) {
bool hasFields = false; bool hasFields = false;
MultipartRequest mp = new MultipartRequest(null, null); MultipartRequest mp = new MultipartRequest(null, null);
if(hasFields) if(hasFields)
postBody = mp; postBody = mp;
} }
@ -104,20 +101,19 @@ class UserApi {
if(response.statusCode >= 400) { if(response.statusCode >= 400) {
throw new ApiException(response.statusCode, response.body); throw new ApiException(response.statusCode, response.body);
} else if(response.body != null) { } else if(response.body != null) {
return ;
} else { } else {
return ; return;
} }
} }
/// Creates list of users with given input array /// Creates list of users with given input array
/// ///
/// ///
Future createUsersWithListInput(List<User> body) async { Future createUsersWithListInput(List<User> user) async {
Object postBody = body; Object postBody = user;
// verify required params are set // verify required params are set
if(body == null) { if(user == null) {
throw new ApiException(400, "Missing required param: body"); throw new ApiException(400, "Missing required param: user");
} }
// create path and map variables // create path and map variables
@ -136,7 +132,6 @@ class UserApi {
if(contentType.startsWith("multipart/form-data")) { if(contentType.startsWith("multipart/form-data")) {
bool hasFields = false; bool hasFields = false;
MultipartRequest mp = new MultipartRequest(null, null); MultipartRequest mp = new MultipartRequest(null, null);
if(hasFields) if(hasFields)
postBody = mp; postBody = mp;
} }
@ -155,9 +150,8 @@ class UserApi {
if(response.statusCode >= 400) { if(response.statusCode >= 400) {
throw new ApiException(response.statusCode, response.body); throw new ApiException(response.statusCode, response.body);
} else if(response.body != null) { } else if(response.body != null) {
return ;
} else { } else {
return ; return;
} }
} }
/// Delete user /// Delete user
@ -187,7 +181,6 @@ class UserApi {
if(contentType.startsWith("multipart/form-data")) { if(contentType.startsWith("multipart/form-data")) {
bool hasFields = false; bool hasFields = false;
MultipartRequest mp = new MultipartRequest(null, null); MultipartRequest mp = new MultipartRequest(null, null);
if(hasFields) if(hasFields)
postBody = mp; postBody = mp;
} }
@ -206,9 +199,8 @@ class UserApi {
if(response.statusCode >= 400) { if(response.statusCode >= 400) {
throw new ApiException(response.statusCode, response.body); throw new ApiException(response.statusCode, response.body);
} else if(response.body != null) { } else if(response.body != null) {
return ;
} else { } else {
return ; return;
} }
} }
/// Get user by user name /// Get user by user name
@ -238,7 +230,6 @@ class UserApi {
if(contentType.startsWith("multipart/form-data")) { if(contentType.startsWith("multipart/form-data")) {
bool hasFields = false; bool hasFields = false;
MultipartRequest mp = new MultipartRequest(null, null); MultipartRequest mp = new MultipartRequest(null, null);
if(hasFields) if(hasFields)
postBody = mp; postBody = mp;
} }
@ -257,7 +248,7 @@ class UserApi {
if(response.statusCode >= 400) { if(response.statusCode >= 400) {
throw new ApiException(response.statusCode, response.body); throw new ApiException(response.statusCode, response.body);
} else if(response.body != null) { } else if(response.body != null) {
return apiClient.deserialize(response.body, 'User') as User ; return apiClient.deserialize(response.body, 'User') as User;
} else { } else {
return null; return null;
} }
@ -294,7 +285,6 @@ class UserApi {
if(contentType.startsWith("multipart/form-data")) { if(contentType.startsWith("multipart/form-data")) {
bool hasFields = false; bool hasFields = false;
MultipartRequest mp = new MultipartRequest(null, null); MultipartRequest mp = new MultipartRequest(null, null);
if(hasFields) if(hasFields)
postBody = mp; postBody = mp;
} }
@ -313,7 +303,7 @@ class UserApi {
if(response.statusCode >= 400) { if(response.statusCode >= 400) {
throw new ApiException(response.statusCode, response.body); throw new ApiException(response.statusCode, response.body);
} else if(response.body != null) { } else if(response.body != null) {
return apiClient.deserialize(response.body, 'String') as String ; return apiClient.deserialize(response.body, 'String') as String;
} else { } else {
return null; return null;
} }
@ -342,7 +332,6 @@ class UserApi {
if(contentType.startsWith("multipart/form-data")) { if(contentType.startsWith("multipart/form-data")) {
bool hasFields = false; bool hasFields = false;
MultipartRequest mp = new MultipartRequest(null, null); MultipartRequest mp = new MultipartRequest(null, null);
if(hasFields) if(hasFields)
postBody = mp; postBody = mp;
} }
@ -361,23 +350,22 @@ class UserApi {
if(response.statusCode >= 400) { if(response.statusCode >= 400) {
throw new ApiException(response.statusCode, response.body); throw new ApiException(response.statusCode, response.body);
} else if(response.body != null) { } else if(response.body != null) {
return ;
} else { } else {
return ; return;
} }
} }
/// Updated user /// Updated user
/// ///
/// This can only be done by the logged in user. /// This can only be done by the logged in user.
Future updateUser(String username, User body) async { Future updateUser(String username, User user) async {
Object postBody = body; Object postBody = user;
// verify required params are set // verify required params are set
if(username == null) { if(username == null) {
throw new ApiException(400, "Missing required param: username"); throw new ApiException(400, "Missing required param: username");
} }
if(body == null) { if(user == null) {
throw new ApiException(400, "Missing required param: body"); throw new ApiException(400, "Missing required param: user");
} }
// create path and map variables // create path and map variables
@ -396,7 +384,6 @@ class UserApi {
if(contentType.startsWith("multipart/form-data")) { if(contentType.startsWith("multipart/form-data")) {
bool hasFields = false; bool hasFields = false;
MultipartRequest mp = new MultipartRequest(null, null); MultipartRequest mp = new MultipartRequest(null, null);
if(hasFields) if(hasFields)
postBody = mp; postBody = mp;
} }
@ -415,9 +402,8 @@ class UserApi {
if(response.statusCode >= 400) { if(response.statusCode >= 400) {
throw new ApiException(response.statusCode, response.body); throw new ApiException(response.statusCode, response.body);
} else if(response.body != null) { } else if(response.body != null) {
return ;
} else { } else {
return ; return;
} }
} }
} }

View File

@ -1,4 +1,4 @@
part of swagger.api; part of openapi.api;
class QueryParam { class QueryParam {
String name; String name;
@ -18,7 +18,7 @@ class ApiClient {
final _RegList = new RegExp(r'^List<(.*)>$'); final _RegList = new RegExp(r'^List<(.*)>$');
final _RegMap = new RegExp(r'^Map<String,(.*)>$'); 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). // Setup authentications (key: authentication name, value: authentication).
_authentications['api_key'] = new ApiKeyAuth("header", "api_key"); _authentications['api_key'] = new ApiKeyAuth("header", "api_key");
_authentications['petstore_auth'] = new OAuth(); _authentications['petstore_auth'] = new OAuth();

View File

@ -1,4 +1,4 @@
part of swagger.api; part of openapi.api;
class ApiException implements Exception { class ApiException implements Exception {
int code = 0; int code = 0;

View File

@ -1,4 +1,4 @@
part of swagger.api; part of openapi.api;
const _delimiters = const {'csv': ',', 'ssv': ' ', 'tsv': '\t', 'pipes': '|'}; const _delimiters = const {'csv': ',', 'ssv': ' ', 'tsv': '\t', 'pipes': '|'};

View File

@ -1,4 +1,4 @@
part of swagger.api; part of openapi.api;
class ApiKeyAuth implements Authentication { class ApiKeyAuth implements Authentication {

Some files were not shown because too many files have changed in this diff Show More