UNPKG

api-spec-converter

Version:

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

1,145 lines (1,144 loc) 28.6 kB
{ "components": { "headers": { "X-RateLimit-Limit": { "description": "The number of allowed requests in the current period", "schema": { "format": "int32", "type": "integer" } }, "X-RateLimit-Remaining": { "description": "The number of remaining requests in the current period", "schema": { "format": "int32", "type": "integer" } }, "X-RateLimit-Reset": { "description": "The number of seconds left in the current period", "schema": { "format": "int32", "type": "integer" } } }, "requestBodies": { "UserArray": { "content": { "application/json": { "schema": { "items": { "$ref": "#/components/schemas/User" }, "type": "array" } } }, "description": "List of user object", "required": true } }, "schemas": { "Animal": { "discriminator": { "propertyName": "type" }, "properties": { "id": { "type": "integer" }, "type": { "type": "string" } }, "required": [ "id", "type" ], "type": "object" }, "Cat": { "allOf": [ { "properties": { "likesMilk": { "type": "boolean" } }, "required": [ "likesMilk" ], "type": "object" }, { "$ref": "#/components/schemas/Animal" } ] }, "Category": { "properties": { "id": { "format": "int64", "type": "integer" }, "name": { "type": "string" } }, "type": "object" }, "Order": { "properties": { "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" }, "Pet": { "properties": { "category": { "$ref": "#/components/schemas/Category" }, "id": { "default": 1, "description": "unique identifier for the pet", "format": "int64", "maximum": 100, "minimum": 0, "type": "integer" }, "name": { "type": "string" }, "photoUrls": { "items": { "type": "string" }, "type": "array" }, "status": { "description": "pet status in the store", "enum": [ "available", "pending", "sold" ], "type": "string" }, "tags": { "items": { "$ref": "#/components/schemas/Tag" }, "type": "array" } }, "required": [ "id", "name" ], "type": "object" }, "Tag": { "properties": { "id": { "format": "int64", "type": "integer" }, "name": { "type": "string" } }, "type": "object" }, "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", "enum": [ "1-registered", "2-active", "3-closed" ], "format": "int32", "type": "integer" }, "username": { "type": "string" } }, "type": "object" } }, "securitySchemes": { "httpBasic": { "type": "http", "scheme": "basic" }, "oauth2_accessCode": { "flows": { "authorizationCode": { "authorizationUrl": "http://petstore.swagger.wordnik.com/api/oauth/requestToken", "scopes": { "read:pets": "Read your pets", "write:pets": "Modify pets in your account" }, "tokenUrl": "http://petstore.swagger.wordnik.com/api/oauth/token" } }, "type": "oauth2" }, "oauth2_implicit": { "flows": { "implicit": { "authorizationUrl": "http://petstore.swagger.wordnik.com/api/oauth/dialog", "scopes": { "read:pets": "Read your pets", "write:pets": "Modify pets in your account" } } }, "type": "oauth2" } } }, "info": { "contact": { "email": "apiteam@wordnik.com" }, "description": "This is a sample server Petstore server. You can find out more about Swagger \n at <a href=\"http://swagger.wordnik.com\">http://swagger.wordnik.com</a> or on irc.freenode.net, #swagger. For this sample,\n 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://helloreverb.com/terms/", "title": "Swagger Sample App", "version": "1.0.0" }, "openapi": "3.0.0", "paths": { "/pet": { "put": { "operationId": "updatePet", "requestBody": { "content": { "application/vnd.api+json": { "schema": { "$ref": "#/components/schemas/Pet" } } }, "description": "Pet object that needs to be updated in the store", "required": true }, "responses": { "200": { "description": "No response was specified" }, "400": { "description": "Invalid ID supplied" }, "404": { "description": "Pet not found" }, "405": { "description": "Validation exception" } }, "summary": "Update an existing pet", "tags": [ "pet" ] } }, "/pet/findByStatus": { "get": { "description": "Multiple status values can be provided with comma seperated strings", "operationId": "findPetsByStatus", "parameters": [ { "description": "Status values that need to be considered for filter", "in": "query", "name": "status", "required": true, "style": "simple", "schema": { "items": { "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" } }, "text/html": { "schema": { "items": { "$ref": "#/components/schemas/Pet" }, "type": "array" } }, "text/plain": { "schema": { "items": { "$ref": "#/components/schemas/Pet" }, "type": "array" } } }, "description": "No response was specified" }, "400": { "description": "Invalid status value" } }, "summary": "Finds Pets by status", "tags": [ "pet" ] } }, "/pet/findByTags": { "get": { "deprecated": true, "description": "Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing.", "operationId": "findPetsByTags", "parameters": [ { "description": "Tags to filter by", "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" } }, "text/html": { "schema": { "items": { "$ref": "#/components/schemas/Pet" }, "type": "array" } }, "text/plain": { "schema": { "items": { "$ref": "#/components/schemas/Pet" }, "type": "array" } } }, "description": "No response was specified" }, "400": { "description": "Invalid tag value" } }, "summary": "Finds Pets by tags", "tags": [ "pet" ] } }, "/pet/uploadImage": { "post": { "operationId": "uploadFile", "requestBody": { "content": { "application/octet-stream": { "schema": { "format": "binary", "type": "string" } } } }, "responses": { "200": { "description": "No response was specified" } }, "security": [ { "oauth2_accessCode": [ "write:pets", "read:pets" ] }, { "oauth2_implicit": [ "write:pets", "read:pets" ] } ], "summary": "uploads an image", "tags": [ "pet" ] } }, "/pet/{petId}": { "delete": { "operationId": "deletePet", "parameters": [ { "description": "Pet id to delete", "in": "path", "name": "petId", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "No response was specified" }, "400": { "description": "Invalid pet value" } }, "security": [ { "oauth2_accessCode": [ "write:pets" ] }, { "oauth2_implicit": [ "write:pets" ] } ], "summary": "Deletes a pet", "tags": [ "pet" ] }, "get": { "description": "Returns a pet based on ID", "operationId": "getPetById", "parameters": [ { "description": "ID of pet that needs to be fetched", "in": "path", "name": "petId", "required": true, "schema": { "default": 1, "format": "int64", "maximum": 100000, "minimum": 1, "type": "integer" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Pet" } }, "application/xml": { "schema": { "$ref": "#/components/schemas/Pet" } }, "text/html": { "schema": { "$ref": "#/components/schemas/Pet" } }, "text/plain": { "schema": { "$ref": "#/components/schemas/Pet" } } }, "description": "No response was specified" }, "400": { "description": "Invalid ID supplied" }, "404": { "description": "Pet not found" } }, "summary": "Find pet by ID", "tags": [ "pet" ] }, "patch": { "operationId": "partialUpdate", "parameters": [ { "description": "ID of pet that needs to be fetched", "in": "path", "name": "petId", "required": true, "schema": { "type": "string" } } ], "requestBody": { "content": { "application/xml": { "schema": { "$ref": "#/components/schemas/Pet" } }, "application/json": { "schema": { "$ref": "#/components/schemas/Pet" } } }, "description": "Pet object that needs to be added to the store", "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "items": { "$ref": "#/components/schemas/Pet" }, "type": "array" } }, "application/xml": { "schema": { "items": { "$ref": "#/components/schemas/Pet" }, "type": "array" } } }, "description": "No response was specified" }, "400": { "description": "Invalid tag value" } }, "security": [ { "oauth2_accessCode": [ "write:pets" ] }, { "oauth2_implicit": [ "write:pets" ] } ], "summary": "partial updates to a pet", "tags": [ "pet" ] }, "post": { "operationId": "updatePetWithForm", "parameters": [ { "description": "ID of pet that needs to be updated", "in": "path", "name": "petId", "required": true, "schema": { "type": "string" } } ], "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": { "200": { "description": "No response was specified" }, "405": { "description": "Invalid input" } }, "security": [ { "oauth2_accessCode": [ "write:pets" ] }, { "oauth2_implicit": [ "write:pets" ] } ], "summary": "Updates a pet in the store with form data", "tags": [ "pet" ] } }, "/store/order": { "post": { "operationId": "placeOrder", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Order" } } }, "description": "order placed for purchasing the pet", "required": true }, "responses": { "200": { "description": "No response was specified" }, "400": { "description": "Invalid order" } }, "security": [ { "oauth2_accessCode": [ "write:pets" ] }, { "oauth2_implicit": [ "write:pets" ] } ], "summary": "Place an order for a pet", "tags": [ "store" ] } }, "/store/order/{orderId}": { "delete": { "description": "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", "operationId": "deleteOrder", "parameters": [ { "description": "ID of the order that needs to be deleted", "in": "path", "name": "orderId", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "No response was specified" }, "400": { "description": "Invalid ID supplied" }, "404": { "description": "Order not found" } }, "security": [ { "oauth2_accessCode": [ "write:pets" ] }, { "oauth2_implicit": [ "write:pets" ] } ], "summary": "Delete purchase order by ID", "tags": [ "store" ] }, "get": { "description": "For valid response try integer IDs with value <= 5. Anything above 5 or nonintegers will generate API errors", "operationId": "getOrderById", "parameters": [ { "description": "ID of pet that needs to be fetched", "in": "path", "name": "orderId", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Order" } } }, "description": "No response was specified" }, "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": { "200": { "description": "No response was specified" } }, "security": [ { "oauth2_accessCode": [ "test:anything" ] }, { "oauth2_implicit": [ "test:anything" ] } ], "summary": "Create user", "tags": [ "user" ] } }, "/user/createWithArray": { "post": { "operationId": "createUsersWithArrayInput", "requestBody": { "$ref": "#/components/requestBodies/UserArray" }, "responses": { "200": { "description": "No response was specified" } }, "security": [ { "oauth2_accessCode": [ "test:anything" ] }, { "oauth2_implicit": [ "test:anything" ] } ], "summary": "Creates list of users with given input array", "tags": [ "user" ] } }, "/user/createWithList": { "post": { "operationId": "createUsersWithListInput", "requestBody": { "$ref": "#/components/requestBodies/UserArray" }, "responses": { "200": { "description": "No response was specified" } }, "security": [ { "oauth2_accessCode": [ "test:anything" ] }, { "oauth2_implicit": [ "test:anything" ] } ], "summary": "Creates list of users with given list input", "tags": [ "user" ] } }, "/user/login": { "get": { "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": { "type": "string" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "type": "string" } } }, "description": "No response was specified" }, "400": { "description": "Invalid username and password combination" } }, "summary": "Logs user into the system", "tags": [ "user" ] } }, "/user/logout": { "get": { "operationId": "logoutUser", "responses": { "200": { "description": "No response was specified" } }, "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": { "200": { "description": "No response was specified" }, "400": { "description": "Invalid username supplied" }, "404": { "description": "User not found" } }, "security": [ { "oauth2_accessCode": [ "test:anything" ] }, { "oauth2_implicit": [ "test:anything" ] } ], "summary": "Delete user", "tags": [ "user" ] }, "get": { "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" } } }, "description": "No response was specified" }, "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 deleted", "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": { "200": { "description": "No response was specified", "headers": { "Retry-After": { "description": "Retry contacting the endpoint *at least* after seconds.", "schema": { "format": "int32", "type": "integer" } }, "X-RateLimit-Limit": { "$ref": "#/components/headers/X-RateLimit-Limit" }, "X-RateLimit-Remaining": { "$ref": "#/components/headers/X-RateLimit-Remaining" }, "X-RateLimit-Reset": { "$ref": "#/components/headers/X-RateLimit-Reset" } } }, "400": { "description": "Invalid username supplied" }, "404": { "description": "User not found" } }, "security": [ { "oauth2_accessCode": [ "test:anything" ] }, { "oauth2_implicit": [ "test:anything" ] } ], "summary": "Updated user", "tags": [ "user" ] } } }, "servers": [ { "url": "http://petstore.swagger.wordnik.com/api" } ], "tags": [ { "description": "Operations about pets", "name": "pet" }, { "description": "Operations about store", "name": "store" }, { "description": "Operations about user", "name": "user" } ] }