swagger: "2.0" info: description: "Minha Api de ecommerce" version: "1.0.1" title: "AceleraDev Ecomm" termsOfService: "http://swagger.io/terms/" contact: email: "elysson@email.com" license: name: "Licença da minha API" url: "http://www.apache.org/licenses/LICENSE-2.0.html" host: "aceleradev-ecomm.com" basePath: "/api" tags: - name: "product" description: "Meus endpoints de produtos" externalDocs: description: "Saiba mais a respeito" url: "http://swagger.io" schemes: - "https" paths: /products: post: tags: - "product" summary: "Salva um novo produto no Ecomm" description: "Salva um novo produto com os dados informados" operationId: "addProduct" consumes: - "application/json" produces: - "application/json" parameters: - in: "body" name: "product" description: "Objeto com os dados do produto a ser salvo" required: true schema: $ref: "#/definitions/ProductCreate" responses: 201: description: "Produto Criado" 400: description: "Dados Inválidos" security: - token: [] get: tags: - "product" summary: "Lista os produtos cadastrados" description: "Lista todos os produtos que estão cadastrados no Ecomm" operationId: "listProduts" consumes: - "application/json" produces: - "application/json" responses: 200: description: "Lista de produtos" schema: type: "array" items: $ref: "#/definitions/Product" security: - token: [] /pet/findByStatus: get: tags: - "pet" summary: "Finds Pets by status" description: "Multiple status values can be provided with comma separated strings" operationId: "findPetsByStatus" produces: - "application/xml" - "application/json" parameters: - name: "status" in: "query" description: "Status values that need to be considered for filter" required: true type: "array" items: type: "string" enum: - "available" - "pending" - "sold" default: "available" collectionFormat: "multi" responses: 200: description: "successful operation" schema: type: "array" items: $ref: "#/definitions/Pet" 400: description: "Invalid status value" security: - token: [] /pet/findByTags: get: tags: - "pet" summary: "Finds Pets by tags" description: "Muliple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing." operationId: "findPetsByTags" produces: - "application/xml" - "application/json" parameters: - name: "tags" in: "query" description: "Tags to filter by" required: true type: "array" items: type: "string" collectionFormat: "multi" responses: 200: description: "successful operation" schema: type: "array" items: $ref: "#/definitions/Pet" 400: description: "Invalid tag value" security: - token: [] deprecated: true /pet/{petId}: get: tags: - "pet" summary: "Find pet by ID" description: "Returns a single pet" operationId: "getPetById" produces: - "application/xml" - "application/json" parameters: - name: "petId" in: "path" description: "ID of pet to return" required: true type: "integer" format: "int64" responses: 200: description: "successful operation" schema: $ref: "#/definitions/Pet" 400: description: "Invalid ID supplied" 404: description: "Pet not found" security: - token: [] post: tags: - "pet" summary: "Updates a pet in the store with form data" description: "" operationId: "updatePetWithForm" consumes: - "application/x-www-form-urlencoded" produces: - "application/xml" - "application/json" parameters: - name: "petId" in: "path" description: "ID of pet that needs to be updated" required: true type: "integer" format: "int64" - name: "name" in: "formData" description: "Updated name of the pet" required: false type: "string" - name: "status" in: "formData" description: "Updated status of the pet" required: false type: "string" responses: 405: description: "Invalid input" security: - token: [] delete: tags: - "pet" summary: "Deletes a pet" description: "" operationId: "deletePet" produces: - "application/xml" - "application/json" parameters: - name: "api_key" in: "header" required: false type: "string" - name: "petId" in: "path" description: "Pet id to delete" required: true type: "integer" format: "int64" responses: 400: description: "Invalid ID supplied" 404: description: "Pet not found" security: - token: [] /pet/{petId}/uploadImage: post: tags: - "pet" summary: "uploads an image" description: "" operationId: "uploadFile" consumes: - "multipart/form-data" produces: - "application/json" parameters: - name: "petId" in: "path" description: "ID of pet to update" required: true type: "integer" format: "int64" - name: "additionalMetadata" in: "formData" description: "Additional data to pass to server" required: false type: "string" - name: "file" in: "formData" description: "file to upload" required: false type: "file" responses: 200: description: "successful operation" schema: $ref: "#/definitions/ApiResponse" security: - token: [] securityDefinitions: token: type: "apiKey" name: "Token" in: "header" definitions: Order: type: "object" properties: id: type: "integer" format: "int64" petId: type: "integer" format: "int64" quantity: type: "integer" format: "int32" shipDate: type: "string" format: "date-time" status: type: "string" description: "Order Status" enum: - "placed" - "approved" - "delivered" complete: type: "boolean" default: false xml: name: "Order" Category: type: "object" properties: name: type: "string" example: "Produtos em Promoção" description: type: "string" example: "Descrição da Categoria" User: type: "object" properties: id: type: "integer" format: "int64" username: type: "string" firstName: type: "string" lastName: type: "string" email: type: "string" password: type: "string" phone: type: "string" userStatus: type: "integer" format: "int32" description: "User Status" xml: name: "User" Tag: type: "object" properties: id: type: "integer" format: "int64" name: type: "string" xml: name: "Tag" Pet: type: "object" required: - "name" - "photoUrls" properties: id: type: "integer" format: "int64" category: $ref: "#/definitions/Category" name: type: "string" example: "doggie" photoUrls: type: "array" xml: name: "photoUrl" wrapped: true items: type: "string" tags: type: "array" xml: name: "tag" wrapped: true items: $ref: "#/definitions/Tag" status: type: "string" description: "pet status in the store" enum: - "available" - "pending" - "sold" xml: name: "Pet" ApiResponse: type: "object" properties: code: type: "integer" format: "int32" type: type: "string" message: type: "string" Product: type: "object" required: - "name" - "description" properties: id: type: "integer" example: 1 name: type: "string" example: "Meu Produto" description: type: "string" example: "Descrição do meu produto" price: type: "number" example: 10.50 category: $ref: "#/definitions/Category" ProductCreate: type: "object" required: - "name" - "description" properties: name: type: "string" example: "Meu Produto" description: type: "string" example: "Descrição do meu produto" price: type: "number" example: 10.50 category: $ref: "#/definitions/Category" externalDocs: description: "Find out more about Swagger" url: "http://swagger.io"