1.0.1 • Published 6 years ago

swagger_petstore_test_123 v1.0.1

Weekly downloads
2
License
Unlicense
Repository
-
Last release
6 years ago

swagger_petstore

SwaggerPetstore - JavaScript client for swagger_petstore A sample API that demonstrates Swagger-Express-Middleware features This SDK is automatically generated by the Swagger Codegen project:

  • API version: 1.0.0
  • Package version: 1.0.0
  • Build package: io.swagger.codegen.languages.JavascriptClientCodegen

Installation

For Node.js

npm

To publish the library as a npm, please follow the procedure in "Publishing npm packages".

npm adduser Logged in as buger72 on https://registry.npmjs.org/. verify email

(node module name must be unique) npm publish npm unpublish -force swagger_petstore_test_123

cd..

npm install swagger_petstore_test_123 --save

Then install it via:

npm install swagger_petstore --save

git

If the library is hosted at a git repository, e.g. https://github.com/YOUR_USERNAME/swagger_petstore then install it via:

    npm install YOUR_USERNAME/swagger_petstore --save

For browser

The library also works in the browser environment via npm and browserify. After following the above steps with Node.js and installing browserify with npm install -g browserify, perform the following (assuming main.js is your entry file):

browserify main.js > bundle.js

Then include bundle.js in the HTML pages.

Webpack Configuration

Using Webpack you may encounter the following error: "Module not found: Error: Cannot resolve module", most certainly you should disable AMD loader. Add/merge the following section to your webpack config:

module: {
  rules: [
    {
      parser: {
        amd: false
      }
    }
  ]
}

Getting Started

Please follow the installation instruction and execute the following JS code:

var SwaggerPetstore = require('swagger_petstore');

var api = new SwaggerPetstore.DefaultApi()

var pet = new SwaggerPetstore.Pet(); // {Pet} The pet to add to the store


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.addPet(pet, callback);

Documentation for API Endpoints

All URIs are relative to https://127.0.0.1:8000/v3

ClassMethodHTTP requestDescription
SwaggerPetstore.DefaultApiaddPetPOST /pets
SwaggerPetstore.DefaultApiaddPetPhotoPOST /pets/{petName}/photos
SwaggerPetstore.DefaultApideletePetDELETE /pets/{petName}
SwaggerPetstore.DefaultApideletePetPhotoDELETE /pets/{petName}/photos/{id}
SwaggerPetstore.DefaultApideletePetsDELETE /pets
SwaggerPetstore.DefaultApifindPetByNameGET /pets/{petName}
SwaggerPetstore.DefaultApifindPetsGET /pets
SwaggerPetstore.DefaultApigetPetPhotoGET /pets/{petName}/photos/{id}
SwaggerPetstore.DefaultApipetsPetNamePatchPATCH /pets/{petName}
SwaggerPetstore.DefaultApipetsPetNamePhotosGetGET /pets/{petName}/photos
SwaggerPetstore.DefaultApirootGetGET /

Documentation for Models

Documentation for Authorization

All endpoints do not require authorization.