Created
March 18, 2021 00:51
-
-
Save robsongomes/37adb27b9c4d6f841ca26028a229412b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
swagger: "2.0" | |
info: | |
description: "Serviço de Clientes" | |
version: "1.0.0" | |
title: "Serviço de Clientes" | |
termsOfService: "http://swagger.io/terms/" | |
contact: | |
email: "apiteam@swagger.io" | |
license: | |
name: "Apache 2.0" | |
url: "http://www.apache.org/licenses/LICENSE-2.0.html" | |
host: "igti.com.br" | |
basePath: "/v1" | |
tags: | |
- name: "cliente" | |
description: "Gerenciamento de Clientes" | |
schemes: | |
- "https" | |
- "http" | |
paths: | |
/clientes: | |
post: | |
tags: | |
- "cliente" | |
summary: "Adiciona um novo cliente ao sistema" | |
description: "" | |
operationId: "criarCliente" | |
consumes: | |
- "application/json" | |
- "application/xml" | |
produces: | |
- "application/xml" | |
- "application/json" | |
parameters: | |
- in: "body" | |
name: "dados do cliente" | |
description: "Informações de cadastro do cliente" | |
required: true | |
schema: | |
$ref: "#/definitions/Cliente" | |
responses: | |
"405": | |
description: "Invalid input" | |
get: | |
tags: | |
- "cliente" | |
summary: "Exibe a lista de Clientes" | |
description: "Retorna uma lista de clientes" | |
operationId: "getAllClientes" | |
produces: | |
- "application/xml" | |
- "application/json" | |
responses: | |
"200": | |
description: "successful operation" | |
schema: | |
$ref: "#/definitions/Cliente" | |
/clientes/{cpf}: | |
get: | |
tags: | |
- "cliente" | |
summary: "Busca um cliente por CPF" | |
description: "Retorna um único cliente" | |
operationId: "getClienteByCpf" | |
produces: | |
- "application/xml" | |
- "application/json" | |
parameters: | |
- name: "cpf" | |
in: "path" | |
description: "CPF do cliente" | |
required: true | |
type: "string" | |
responses: | |
"200": | |
description: "successful operation" | |
schema: | |
$ref: "#/definitions/Cliente" | |
"400": | |
description: "Invalid ID supplied" | |
"404": | |
description: "Cliente não encontrado" | |
definitions: | |
Cliente: | |
type: "object" | |
properties: | |
id: | |
type: "integer" | |
format: "int64" | |
cpf: | |
type: "string" | |
data_nascimento: | |
type: "string" | |
nome: | |
type: "string" | |
endereco: | |
$ref: "#/definitions/Endereco" | |
Endereco: | |
type: "object" | |
properties: | |
id: | |
type: "integer" | |
format: "int64" | |
logradouro: | |
type: "string" | |
numero: | |
type: "integer" | |
bairro: | |
type: "string" | |
cidade: | |
type: "string" | |
uf: | |
type: "string" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment