UNPKG

api-spec-converter

Version:

Convert API descriptions between popular formats such as OpenAPI(fka Swagger), RAML, API Blueprint, WADL, etc.

1,054 lines (1,053 loc) 26.1 kB
{ "components": { "requestBodies": { "Pet": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Pet" } }, "application/xml": { "schema": { "$ref": "#/components/schemas/Pet" } } }, "description": "Pet object that needs to be added to the store", "required": true }, "UserArray": { "content": { "application/json": { "schema": { "items": { "$ref": "#/components/schemas/User" }, "type": "array" } } }, "description": "List of user object", "required": true } }, "schemas": { "ApiResponse": { "properties": { "code": { "format": "int32", "type": "integer" }, "message": { "type": "string" }, "type": { "type": "string" } }, "type": "object" }, "Category": { "properties": { "id": { "format": "int64", "type": "integer" }, "name": { "type": "string" } }, "type": "object", "xml": { "name": "Category" } }, "Order": { "properties": { "complete": { "default": false, "type": "boolean" }, "id": { "format": "int64", "type": "integer" }, "petId": { "format": "int64", "type": "integer" }, "quantity": { "format": "int32", "type": "integer" }, "shipDate": { "format": "date-time", "type": "string" }, "status": { "description": "Order Status", "enum": [ "placed", "approved", "delivered" ], "type": "string" } }, "type": "object", "xml": { "name": "Order" } }, "Pet": { "properties": { "category": { "$ref": "#/components/schemas/Category" }, "id": { "format": "int64", "type": "integer" }, "name": { "example": "doggie", "type": "string" }, "photoUrls": { "items": { "type": "string" }, "type": "array", "xml": { "name": "photoUrl", "wrapped": true } }, "status": { "description": "pet status in the store", "enum": [ "available", "pending", "sold" ], "type": "string" }, "tags": { "items": { "$ref": "#/components/schemas/Tag" }, "type": "array", "xml": { "name": "tag", "wrapped": true } } }, "required": [ "name", "photoUrls" ], "type": "object", "xml": { "name": "Pet" } }, "Tag": { "properties": { "id": { "format": "int64", "type": "integer" }, "name": { "type": "string" } }, "type": "object", "xml": { "name": "Tag" } }, "User": { "properties": { "email": { "type": "string" }, "firstName": { "type": "string" }, "id": { "format": "int64", "type": "integer" }, "lastName": { "type": "string" }, "password": { "type": "string" }, "phone": { "type": "string" }, "userStatus": { "description": "User Status", "format": "int32", "type": "integer" }, "username": { "type": "string" } }, "type": "object", "xml": { "name": "User" } } }, "securitySchemes": { "api_key": { "in": "header", "name": "api_key", "type": "apiKey" }, "petstore_auth": { "flows": { "implicit": { "authorizationUrl": "http://petstore.swagger.io/oauth/dialog", "scopes": { "read:pets": "read your pets", "write:pets": "modify pets in your account" } } }, "type": "oauth2" } } }, "externalDocs": { "description": "Find out more about Swagger", "url": "http://swagger.io" }, "info": { "contact": { "email": "apiteam@swagger.io" }, "description": "This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.", "license": { "name": "Apache 2.0", "url": "http://www.apache.org/licenses/LICENSE-2.0.html" }, "termsOfService": "http://swagger.io/terms/", "title": "Swagger Petstore", "version": "1.0.0" }, "openapi": "3.0.0", "paths": { "/pet": { "post": { "description": "", "operationId": "addPet", "requestBody": { "$ref": "#/components/requestBodies/Pet" }, "responses": { "405": { "description": "Invalid input" } }, "security": [ { "petstore_auth": [ "write:pets", "read:pets" ] } ], "summary": "Add a new pet to the store", "tags": [ "pet" ] }, "put": { "description": "", "operationId": "updatePet", "requestBody": { "$ref": "#/components/requestBodies/Pet" }, "responses": { "400": { "description": "Invalid ID supplied" }, "404": { "description": "Pet not found" }, "405": { "description": "Validation exception" } }, "security": [ { "petstore_auth": [ "write:pets", "read:pets" ] } ], "summary": "Update an existing pet", "tags": [ "pet" ] } }, "/pet/findByStatus": { "get": { "description": "Multiple status values can be provided with comma separated strings", "operationId": "findPetsByStatus", "parameters": [ { "description": "Status values that need to be considered for filter", "explode": true, "in": "query", "name": "status", "required": true, "schema": { "items": { "default": "available", "enum": [ "available", "pending", "sold" ], "type": "string" }, "type": "array" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "items": { "$ref": "#/components/schemas/Pet" }, "type": "array" } }, "application/xml": { "schema": { "items": { "$ref": "#/components/schemas/Pet" }, "type": "array" } } }, "description": "successful operation" }, "400": { "description": "Invalid status value" } }, "security": [ { "petstore_auth": [ "write:pets", "read:pets" ] } ], "summary": "Finds Pets by status", "tags": [ "pet" ] } }, "/pet/findByTags": { "get": { "deprecated": true, "description": "Muliple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", "operationId": "findPetsByTags", "parameters": [ { "description": "Tags to filter by", "explode": true, "in": "query", "name": "tags", "required": true, "schema": { "items": { "type": "string" }, "type": "array" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "items": { "$ref": "#/components/schemas/Pet" }, "type": "array" } }, "application/xml": { "schema": { "items": { "$ref": "#/components/schemas/Pet" }, "type": "array" } } }, "description": "successful operation" }, "400": { "description": "Invalid tag value" } }, "security": [ { "petstore_auth": [ "write:pets", "read:pets" ] } ], "summary": "Finds Pets by tags", "tags": [ "pet" ] } }, "/pet/{petId}": { "delete": { "description": "", "operationId": "deletePet", "parameters": [ { "in": "header", "name": "api_key", "required": false, "schema": { "type": "string" } }, { "description": "Pet id to delete", "in": "path", "name": "petId", "required": true, "schema": { "format": "int64", "type": "integer" } } ], "responses": { "400": { "description": "Invalid ID supplied" }, "404": { "description": "Pet not found" } }, "security": [ { "petstore_auth": [ "write:pets", "read:pets" ] } ], "summary": "Deletes a pet", "tags": [ "pet" ] }, "get": { "description": "Returns a single pet", "operationId": "getPetById", "parameters": [ { "description": "ID of pet to return", "in": "path", "name": "petId", "required": true, "schema": { "format": "int64", "type": "integer" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Pet" } }, "application/xml": { "schema": { "$ref": "#/components/schemas/Pet" } } }, "description": "successful operation" }, "400": { "description": "Invalid ID supplied" }, "404": { "description": "Pet not found" } }, "security": [ { "api_key": [] } ], "summary": "Find pet by ID", "tags": [ "pet" ] }, "post": { "description": "", "operationId": "updatePetWithForm", "parameters": [ { "description": "ID of pet that needs to be updated", "in": "path", "name": "petId", "required": true, "schema": { "format": "int64", "type": "integer" } } ], "requestBody": { "content": { "application/x-www-form-urlencoded": { "schema": { "properties": { "name": { "description": "Updated name of the pet", "type": "string" }, "status": { "description": "Updated status of the pet", "type": "string" } }, "type": "object" } } } }, "responses": { "405": { "description": "Invalid input" } }, "security": [ { "petstore_auth": [ "write:pets", "read:pets" ] } ], "summary": "Updates a pet in the store with form data", "tags": [ "pet" ] } }, "/pet/{petId}/uploadImage": { "post": { "description": "", "operationId": "uploadFile", "parameters": [ { "description": "ID of pet to update", "in": "path", "name": "petId", "required": true, "schema": { "format": "int64", "type": "integer" } } ], "requestBody": { "content": { "application/octet-stream": { "schema": { "format": "binary", "type": "string" } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } }, "description": "successful operation" } }, "security": [ { "petstore_auth": [ "write:pets", "read:pets" ] } ], "summary": "uploads an image", "tags": [ "pet" ] } }, "/store/inventory": { "get": { "description": "Returns a map of status codes to quantities", "operationId": "getInventory", "responses": { "200": { "content": { "application/json": { "schema": { "additionalProperties": { "format": "int32", "type": "integer" }, "type": "object" } } }, "description": "successful operation" } }, "security": [ { "api_key": [] } ], "summary": "Returns pet inventories by status", "tags": [ "store" ] } }, "/store/order": { "post": { "description": "", "operationId": "placeOrder", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Order" } } }, "description": "order placed for purchasing the pet", "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Order" } }, "application/xml": { "schema": { "$ref": "#/components/schemas/Order" } } }, "description": "successful operation" }, "400": { "description": "Invalid Order" } }, "summary": "Place an order for a pet", "tags": [ "store" ] } }, "/store/order/{orderId}": { "delete": { "description": "For valid response try integer IDs with positive integer value. Negative or non-integer values will generate API errors", "operationId": "deleteOrder", "parameters": [ { "description": "ID of the order that needs to be deleted", "in": "path", "name": "orderId", "required": true, "schema": { "format": "int64", "minimum": 1, "type": "integer" } } ], "responses": { "400": { "description": "Invalid ID supplied" }, "404": { "description": "Order not found" } }, "summary": "Delete purchase order by ID", "tags": [ "store" ] }, "get": { "description": "For valid response try integer IDs with value >= 1 and <= 10. Other values will generated exceptions", "operationId": "getOrderById", "parameters": [ { "description": "ID of pet that needs to be fetched", "in": "path", "name": "orderId", "required": true, "schema": { "format": "int64", "maximum": 10, "minimum": 1, "type": "integer" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Order" } }, "application/xml": { "schema": { "$ref": "#/components/schemas/Order" } } }, "description": "successful operation" }, "400": { "description": "Invalid ID supplied" }, "404": { "description": "Order not found" } }, "summary": "Find purchase order by ID", "tags": [ "store" ] } }, "/user": { "post": { "description": "This can only be done by the logged in user.", "operationId": "createUser", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/User" } } }, "description": "Created user object", "required": true }, "responses": { "default": { "description": "successful operation" } }, "summary": "Create user", "tags": [ "user" ] } }, "/user/createWithArray": { "post": { "description": "", "operationId": "createUsersWithArrayInput", "requestBody": { "$ref": "#/components/requestBodies/UserArray" }, "responses": { "default": { "description": "successful operation" } }, "summary": "Creates list of users with given input array", "tags": [ "user" ] } }, "/user/createWithList": { "post": { "description": "", "operationId": "createUsersWithListInput", "requestBody": { "$ref": "#/components/requestBodies/UserArray" }, "responses": { "default": { "description": "successful operation" } }, "summary": "Creates list of users with given input array", "tags": [ "user" ] } }, "/user/login": { "get": { "description": "", "operationId": "loginUser", "parameters": [ { "description": "The user name for login", "in": "query", "name": "username", "required": true, "schema": { "type": "string" } }, { "description": "The password for login in clear text", "in": "query", "name": "password", "required": true, "schema": { "format": "password", "type": "string" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "type": "string" } }, "application/xml": { "schema": { "type": "string" } } }, "description": "successful operation", "headers": { "X-Expires-After": { "description": "date in UTC when token expires", "schema": { "format": "date-time", "type": "string" } }, "X-Rate-Limit": { "description": "calls per hour allowed by the user", "schema": { "format": "int32", "type": "integer" } } } }, "400": { "description": "Invalid username/password supplied" } }, "summary": "Logs user into the system", "tags": [ "user" ] } }, "/user/logout": { "get": { "description": "", "operationId": "logoutUser", "responses": { "default": { "description": "successful operation" } }, "summary": "Logs out current logged in user session", "tags": [ "user" ] } }, "/user/{username}": { "delete": { "description": "This can only be done by the logged in user.", "operationId": "deleteUser", "parameters": [ { "description": "The name that needs to be deleted", "in": "path", "name": "username", "required": true, "schema": { "type": "string" } } ], "responses": { "400": { "description": "Invalid username supplied" }, "404": { "description": "User not found" } }, "summary": "Delete user", "tags": [ "user" ] }, "get": { "description": "", "operationId": "getUserByName", "parameters": [ { "description": "The name that needs to be fetched. Use user1 for testing. ", "in": "path", "name": "username", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/User" } }, "application/xml": { "schema": { "$ref": "#/components/schemas/User" } } }, "description": "successful operation" }, "400": { "description": "Invalid username supplied" }, "404": { "description": "User not found" } }, "summary": "Get user by user name", "tags": [ "user" ] }, "put": { "description": "This can only be done by the logged in user.", "operationId": "updateUser", "parameters": [ { "description": "name that need to be updated", "in": "path", "name": "username", "required": true, "schema": { "type": "string" } } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/User" } } }, "description": "Updated user object", "required": true }, "responses": { "400": { "description": "Invalid user supplied" }, "404": { "description": "User not found" } }, "summary": "Updated user", "tags": [ "user" ] } } }, "servers": [ { "url": "http://petstore.swagger.io/v2" } ], "tags": [ { "description": "Everything about your Pets", "externalDocs": { "description": "Find out more", "url": "http://swagger.io" }, "name": "pet" }, { "description": "Access to Petstore orders", "name": "store" }, { "description": "Operations about user", "externalDocs": { "description": "Find out more about our store", "url": "http://swagger.io" }, "name": "user" } ] }