sample repo for https://levelup.gitconnected.com/generate-swagger-code-for-your-flutter-app-bd0c65aaa4a4 :-)
Public APIs of the PetStore application landscape.
This Dart package is automatically generated by the OpenAPI Generator project:
- API version: 1.0
- Build package: org.openapitools.codegen.languages.DartDioClientCodegen For more information, please visit https://www.PetStoreCompany.com
Dart 1.20.0 or later OR Flutter 0.0.20 or later
If this Dart package is published to Github, please include the following in pubspec.yaml
name: openapi
version: 1.0.0
description: OpenAPI API client
dependencies:
openapi:
git: https://github.com/GIT_USER_ID/GIT_REPO_ID.git
version: 'any'
To use the package in your local drive, please include the following in pubspec.yaml
dependencies:
openapi:
path: /path/to/openapi
Please follow the installation procedure and then run the following:
import 'package:openapi/api.dart';
var api_instance = new PetStoreApi();
var apiVersion = apiVersion_example; // String |
try {
var result = api_instance.petStoreGet(apiVersion);
print(result);
} catch (e) {
print("Exception when calling PetStoreApi->petStoreGet: $e\n");
}
All URIs are relative to http://localhost
Class | Method | HTTP request | Description |
---|---|---|---|
PetStoreApi | petStoreGet | get /PetStore | |
PetStoreApi | petStoreIdGet | get /PetStore/{id} | |
PetStoreApi | petStoreIdPut | put /PetStore/{id} | |
PetStoreApi | petStorePost | post /PetStore |
- Type: API key
- API key parameter name: Authorization
- Location: HTTP header