Skip to content

Latest commit

 

History

History
130 lines (93 loc) · 4.63 KB

File metadata and controls

130 lines (93 loc) · 4.63 KB

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 Open API Codegen project:

  • API version: 1.0.0
  • Build package: org.openapitools.codegen.languages.DartJaguarClientCodegen

Requirements

Dart 2 or later OR Flutter 0.7.0 or later.

Once your code is generated, you need to run the build_runner command to let Jaguar implement your API:

flutter packages pub run build_runner build
or
pub run build_runner build

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

Tests

TODO

Getting Started

Please follow the installation procedure and then run the following:

import 'package:openapi/api.dart';

// TODO Configure OAuth2 access token for authorization: petstore_auth
//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN';

final jaguarApiGen = Openapi();
var api_instance = jaguarApiGen.getPetApi();
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

Author