mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-11-02 17:53:56 +00:00
* [dart-dio+time_machine] Add missing import, serializer
* [dart-dio] Remove bad import from `http` package
* [dart-dio] Use raw strings for those that contain variable name.
This should eliminate potential issue with variables like `$ref`.
* [dart-dio] Use `_path` instead of `path` to avoid potential conflict with op params.
See 1bec0b47b1/Kubernetes.json, there are a few with `{path}` param.
* [dart-dio+time_machine] Use `OffsetXxx` classes for date time values
openapi
This is a sample server Petstore server. 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 project:
- API version: 1.0.0
- Build package: org.openapitools.codegen.languages.DartDioClientCodegen
Requirements
Dart 1.20.0 or later OR Flutter 0.0.20 or later
Installation & Usage
Github
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'
Local
To use the package in your local drive, please include the following in pubspec.yaml
dependencies:
openapi:
path: /path/to/openapi
Getting Started
Please follow the installation procedure and then run the following:
import 'package:openapi/api.dart';
var api_instance = new PetApi();
var body = new Pet(); // Pet | Pet object that needs to be added to the store
try {
api_instance.addPet(body);
} catch (e) {
print("Exception when calling PetApi->addPet: $e\n");
}
Documentation for API Endpoints
All URIs are relative to http://petstore.swagger.io/v2
| Class | Method | HTTP request | Description |
|---|---|---|---|
| PetApi | addPet | post /pet | Add a new pet to the store |
| PetApi | deletePet | delete /pet/{petId} | Deletes a pet |
| PetApi | findPetsByStatus | get /pet/findByStatus | Finds Pets by status |
| PetApi | findPetsByTags | get /pet/findByTags | Finds Pets by tags |
| PetApi | getPetById | get /pet/{petId} | Find pet by ID |
| PetApi | updatePet | put /pet | Update an existing pet |
| PetApi | updatePetWithForm | post /pet/{petId} | Updates a pet in the store with form data |
| PetApi | uploadFile | post /pet/{petId}/uploadImage | uploads an image |
| StoreApi | deleteOrder | delete /store/order/{orderId} | Delete purchase order by ID |
| StoreApi | getInventory | get /store/inventory | Returns pet inventories by status |
| StoreApi | getOrderById | get /store/order/{orderId} | Find purchase order by ID |
| StoreApi | placeOrder | post /store/order | Place an order for a pet |
| UserApi | createUser | post /user | Create user |
| UserApi | createUsersWithArrayInput | post /user/createWithArray | Creates list of users with given input array |
| UserApi | createUsersWithListInput | post /user/createWithList | Creates list of users with given input array |
| UserApi | deleteUser | delete /user/{username} | Delete user |
| UserApi | getUserByName | get /user/{username} | Get user by user name |
| UserApi | loginUser | get /user/login | Logs user into the system |
| UserApi | logoutUser | get /user/logout | Logs out current logged in user session |
| UserApi | updateUser | put /user/{username} | Updated user |
Documentation For Models
Documentation For Authorization
api_key
- Type: API key
- API key parameter name: api_key
- Location: HTTP header
petstore_auth
- Type: OAuth
- Flow: implicit
- Authorization URL: http://petstore.swagger.io/api/oauth/dialog
- Scopes:
- write:pets: modify pets in your account
- read:pets: read your pets