Skip to content

Instantly share code, notes, and snippets.

@robsongomes
Created March 18, 2021 01:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save robsongomes/5d262261e3f937cae0a6f5abd1ba4e80 to your computer and use it in GitHub Desktop.
Save robsongomes/5d262261e3f937cae0a6f5abd1ba4e80 to your computer and use it in GitHub Desktop.
swagger: "2.0"
info:
description: "Serviço de Faturas"
version: "1.0.0"
title: "Serviço de Faturas"
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: "fatura"
description: "Gerenciamento de Faturas"
schemes:
- "https"
- "http"
paths:
/fatura:
post:
tags:
- "fatura"
summary: "Gerar fatura do cliente"
description: ""
operationId: "gerarFatura"
consumes:
- "application/json"
produces:
- "application/json"
parameters:
- in: "body"
name: "body"
description: "Pet object that needs to be added to the store"
required: true
schema:
$ref: "#/definitions/Fatura"
responses:
"200":
description: ""
schema:
type: object
properties:
Fatura:
type: "object"
properties:
id:
type: "integer"
format: "int64"
codigo:
type: "string"
dataLeitura:
type: "string"
format: "date-time"
dataVencimento:
type: "string"
format: "date-time"
numeroLeitura:
type: "integer"
valorConta:
type: "integer"
instalacao:
$ref: "#/definitions/Instalacao"
get:
tags:
- "fatura"
summary: "Pegar todas fatura do cliente"
description: ""
operationId: "pegarTodasFaturas"
consumes:
- "application/json"
produces:
- "application/json"
parameters:
- in: "body"
name: "body"
description: "Returna a lista de todas as faturas do cliente"
required: true
schema:
type: object
properties:
Fatura:
type: "object"
properties:
id:
type: "integer"
format: "int64"
codigo:
type: "string"
dataLeitura:
type: "string"
format: "date-time"
dataVencimento:
type: "string"
format: "date-time"
numeroLeitura:
type: "integer"
valorConta:
type: "integer"
instalacao:
$ref: "#/definitions/Instalacao"
responses:
"200":
description: ""
schema:
type: object
properties:
Fatura:
type: "object"
properties:
id:
type: "integer"
format: "int64"
codigo:
type: "string"
dataLeitura:
type: "string"
format: "date-time"
dataVencimento:
type: "string"
format: "date-time"
numeroLeitura:
type: "integer"
valorConta:
type: "integer"
instalacao:
$ref: "#/definitions/Instalacao"
security:
- petstore_auth:
- "write:pets"
- "read:pets"
/fatura/{nome}:
get:
tags:
- "fatura"
summary: "Pegar fatura do cliente pelo nome do cliente"
description: ""
operationId: "pegarFaturasEspecificaPorNome"
consumes:
- "application/json"
produces:
- "application/json"
parameters:
- name: "nome"
in: "path"
description: "CPF do cliente"
required: true
type: "string"
responses:
"200":
description: ""
schema:
type: object
properties:
Fatura:
type: "object"
properties:
id:
type: "integer"
format: "int64"
codigo:
type: "string"
dataLeitura:
type: "string"
format: "date-time"
dataVencimento:
type: "string"
format: "date-time"
numeroLeitura:
type: "integer"
valorConta:
type: "integer"
instalacao:
$ref: "#/definitions/Instalacao"
security:
- petstore_auth:
- "write:pets"
- "read:pets"
/faturaPorCpf/{cpf}:
get:
tags:
- "fatura"
summary: "Pegar fatura do cliente pelo CPF do cliente"
description: ""
operationId: "pegarFaturasEspecificaPorCPF"
consumes:
- "application/json"
produces:
- "application/json"
parameters:
- name: "cpf"
in: "path"
description: "CPF do cliente"
required: true
type: "string"
responses:
"200":
description: "Invalid input"
security:
- petstore_auth:
- "write:pets"
- "read:pets"
securityDefinitions:
petstore_auth:
type: "oauth2"
authorizationUrl: "http://petstore.swagger.io/oauth/dialog"
flow: "implicit"
scopes:
write:pets: "modify pets in your account"
read:pets: "read your pets"
api_key:
type: "apiKey"
name: "api_key"
in: "header"
definitions:
Fatura:
type: "object"
properties:
id:
type: "integer"
format: "int64"
codigo:
type: "string"
dataLeitura:
type: "string"
format: "date-time"
dataVencimento:
type: "string"
format: "date-time"
numeroLeitura:
type: "integer"
valorConta:
type: "integer"
instalacao:
$ref: "#/definitions/Instalacao"
Instalacao:
type: "object"
properties:
client:
$ref: "#/definitions/Cliente"
codigo:
type: "string"
dataInstalação:
type: "string"
format: "date-time"
enderecoInstalacao:
$ref: "#/definitions/Endereco"
id:
type: "integer"
listaFatura:
type: "array"
items:
$ref: "#/definitions/Fatura"
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"
externalDocs:
description: "Find out more about Swagger"
url: "http://swagger.io"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment