petstore-pkg
v6.22.3
Published
This is a sample Pet Store Server based on the OpenAPI 3.0 specification. You can find out more about Swagger at [https://swagger.io](https://swagger.io). In the third iteration of the pet store, we've switched to the design first approach! You can now h
Readme
Getting Started with Swagger Petstore - OpenAPI 3.0
Introduction
This is a sample Pet Store Server based on the OpenAPI 3.0 specification. You can find out more about Swagger at https://swagger.io. In the third iteration of the pet store, we've switched to the design first approach! You can now help us improve the API whether it's by making changes to the definition itself or to the code. That way, with time, we can improve the API in general, and expose some of the new features in OAS3.
Some useful links:
Find out more about Swagger: https://swagger.io
Install the Package
Run the following command from your project directory to install the package from npm:
npm install [email protected]For additional package details, see the Npm page for the [email protected] npm.
Test the SDK
To validate the functionality of this SDK, you can execute all tests located in the test directory. This SDK utilizes Jest as both the testing framework and test runner.
To run the tests, navigate to the root directory of the SDK and execute the following command:
npm run testOr you can also run tests with coverage report:
npm run test:coverageInitialize the API Client
Note: Documentation for the client can be found here.
The following parameters are configurable for the API Client:
| Parameter | Type | Description |
| --- | --- | --- |
| environment | Environment | The API environment. Default: Environment.Production |
| timeout | number | Timeout for API calls.Default: 0 |
| httpClientOptions | Partial<HttpClientOptions> | Stable configurable http client options. |
| unstableHttpClientOptions | any | Unstable configurable http client options. |
| petstoreAuthCredentials | PetstoreAuthCredentials | The credential object for petstoreAuth |
| apiKeyCredentials | ApiKeyCredentials | The credential object for apiKey |
The API client can be initialized as follows:
import {
Client,
Environment,
OAuthScopePetstoreAuthEnum,
} from 'petstore-pkg';
const client = new Client({
petstoreAuthCredentials: {
oAuthClientId: 'OAuthClientId',
oAuthRedirectUri: 'OAuthRedirectUri',
oAuthScopes: [
OAuthScopePetstoreAuthEnum.Writepets,
OAuthScopePetstoreAuthEnum.Readpets
]
},
apiKeyCredentials: {
'api_key': 'api_key'
},
timeout: 0,
environment: Environment.Production,
});Authorization
This API uses the following authentication schemes.
