Skip to content

Commit

Permalink
created docs on create, patch and delete event (#65)
Browse files Browse the repository at this point in the history
  • Loading branch information
saracamilo authored Mar 22, 2024
1 parent f58e7c4 commit cd67c1b
Show file tree
Hide file tree
Showing 6 changed files with 139 additions and 0 deletions.
17 changes: 17 additions & 0 deletions public/docs/components/paths/event/create.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
post:
tags:
- Eventos
summary: Cria um evento
description: Cria um novo evento com as informações fornecidas
requestBody:
content:
application/json:
schema:
$ref: '../../requestBodies/event/post-minimal.yaml'
responses:
'201':
description: Evento criado com sucesso
content:
application/json:
schema:
$ref: '../../schemas/event.yaml'
38 changes: 38 additions & 0 deletions public/docs/components/paths/event/delete.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
delete:
tags:
- Eventos
summary: Apaga um evento
description: Apaga um evento baseado no ID fornecido.
parameters:
- in: path
name: id
schema:
type: integer
required: true
description: Identificador único do evento.
responses:
'200':
description: Informações sobre o evento apagado.
content:
application/json:
schema:
type: object
properties:
'@entityType':
type: string
example: event
description: Tipo de entidade.
id:
type: integer
example: 10
description: Um id numérico que representa o evento.
name:
type: string
example: "Festival de Verão"
description: Nome do evento.
status:
type: integer
example: -10
description: Status do evento após ser apagado.
'404':
$ref: '../../responses/error/404.yaml'
29 changes: 29 additions & 0 deletions public/docs/components/paths/event/patch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
patch:
tags:
- Eventos
summary: Atualiza um evento
description: Atualiza os detalhes de um evento existente.
parameters:
- in: path
name: id
schema:
type: integer
required: true
description: Identificador único do evento.
requestBody:
content:
application/json:
schema:
$ref: '../../requestBodies/event/post-minimal.yaml'
responses:
'200':
description: Evento atualizado com sucesso.
content:
application/json:
schema:
$ref: '../../schemas/event.yaml'
'400':
description: Requisição inválida, por exemplo, campos não preenchidos corretamente.
'404':
description: Evento não encontrado.
$ref: '../../responses/error/404.yaml'
6 changes: 6 additions & 0 deletions public/docs/components/paths/event/route-single-id.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
tags:
- Eventos
patch:
$ref: './patch.yaml'
delete:
$ref: './delete.yaml'
45 changes: 45 additions & 0 deletions public/docs/components/requestBodies/event/post-minimal.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
post:
tags:
- Eventos
summary: Cria um evento
description: Cria um novo evento com as informações fornecidas
requestBody:
required: true
content:
application/json:
schema:
type: object
required:
- name
- shortDescription
- classificacaoEtaria
properties:
name:
type: string
description: "Nome do evento"
shortDescription:
type: string
description: "Descrição curta do evento"
classificacaoEtaria:
type: object
properties:
options:
type: array
items:
type: string
description: "Classificação etária do evento"
term-linguagem:
type: array
items:
type: string
description: "Linguagens do evento"
responses:
'201':
description: Evento criado com sucesso
content:
application/json:
schema:
$ref: '../../schemas/event.yaml'
'400':
description: Dados inválidos fornecidos

4 changes: 4 additions & 0 deletions public/docs/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ paths:
$ref: './components/paths/event/get-type-groups.yaml'
/api/event/getTypes:
$ref: './components/paths/event/get-types.yaml'
/api/event/create:
$ref: './components/paths/event/create.yaml'
/event/single/{id}:
$ref: './components/paths/event/route-single-id.yaml'
/api/opportunity/describe:
$ref: './components/paths/opportunity/describe.yaml'
/api/opportunity/find:
Expand Down

0 comments on commit cd67c1b

Please sign in to comment.