Skip to content

Instantly share code, notes, and snippets.

@edgars
Created October 20, 2020 03:08
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 edgars/cba66df2807cebf38dd35364f49c16e7 to your computer and use it in GitHub Desktop.
Save edgars/cba66df2807cebf38dd35364f49c16e7 to your computer and use it in GitHub Desktop.
Livro_Jornada_Microservices
openapi: 3.0.2
info:
title: Jornada_Micro_Servicos
version: 1.0.0
description: API de Exemplo do Livro
paths:
/funcionarios:
summary: Path used to manage the list of funcionarios.
description: >-
The REST endpoint/path used to list and create zero or more `funcionario` entities. This path
contains a `GET` and `POST` operation to perform the list and create tasks, respectively.
get:
responses:
'200':
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/funcionario'
description: Successful response - returns an array of `funcionario` entities.
operationId: getfuncionarios
summary: List All funcionarios
description: Gets a list of all `funcionario` entities.
post:
requestBody:
description: A new `funcionario` to be created.
content:
application/json:
schema:
$ref: '#/components/schemas/funcionario'
required: true
responses:
'201':
description: Successful response.
operationId: createfuncionario
summary: Create a funcionario
description: Creates a new instance of a `funcionario`.
'/funcionarios/{funcionarioId}':
summary: Path used to manage a single funcionario.
description: >-
The REST endpoint/path used to get, update, and delete single instances of an `funcionario`. This
path contains `GET`, `PUT`, and `DELETE` operations used to perform the get, update, and delete
tasks, respectively.
get:
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/funcionario'
description: Successful response - returns a single `funcionario`.
operationId: getfuncionario
summary: Get a funcionario
description: Gets the details of a single instance of a `funcionario`.
put:
requestBody:
description: Updated `funcionario` information.
content:
application/json:
schema:
$ref: '#/components/schemas/funcionario'
required: true
responses:
'202':
description: Successful response.
operationId: updatefuncionario
summary: Update a funcionario
description: Updates an existing `funcionario`.
delete:
responses:
'204':
description: Successful response.
operationId: deletefuncionario
summary: Delete a funcionario
description: Deletes an existing `funcionario`.
parameters:
-
name: funcionarioId
description: A unique identifier for a `funcionario`.
schema:
type: string
in: path
required: true
components:
schemas:
funcionario:
title: Root Type for funcionario
description: Dados do colaboradores da empresa (funcionario)
type: object
properties:
funcionario_id:
type: string
nome:
type: string
departamento:
type: string
salario:
format: int32
type: integer
example:
funcionario_id: '11313131'
nome: Joseph Blinker
departamento: Vendas
salario: 1200
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment