Skip to content

Commit

Permalink
Add docs for delete and update endpoints of agent (#63)
Browse files Browse the repository at this point in the history
  • Loading branch information
TalysonSoares authored Mar 22, 2024
1 parent 82c87f3 commit c3fc7db
Show file tree
Hide file tree
Showing 3 changed files with 134 additions and 2 deletions.
103 changes: 103 additions & 0 deletions public/docs/components/paths/agent/delete-and-update.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
delete:
tags:
- Agentes
summary: Apaga um agente
description: Apaga um agente
parameters:
- in: path
name: id
schema:
type: integer
required: true
description: Identificador do agente
responses:
'200':
description: Informações sobre o agente apagado
content:
application/json:
schema:
type: object
properties:
'@entityType':
type: string
example: agent
description: Tipo de entidade
id:
type: integer
example: 5
description: Um id numérico que representa o agente
name:
type: string
example: "Nome do agente"
description: Um texto que representa o nome do agente
type:
type: object
properties:
id:
type: integer
example: 1
description: ID do tipo de agente (1 - Individual, 2 - Coletivo)
name:
type: string
example: "Individual"
description: Nome do tipo de agente
status:
type: integer
example: -10
description: Status do agente
'404':
$ref: '../../responses/error/404.yaml'

patch:
tags:
- Agentes
summary: Atualiza um agente
description: Atualiza parcialmente um agente
parameters:
- in: path
name: id
schema:
type: integer
required: true
description: Identificador do agente
requestBody:
content:
application/json:
schema:
$ref: '../../requestBodies/agent/patch.yaml'
responses:
'200':
description: O agente atualizado
content:
application/json:
schema:
$ref: '../../schemas/agent.yaml'
'404':
$ref: '../../responses/error/404.yaml'

put:
tags:
- Agentes
summary: Atualiza um agente
description: Atualiza completamente um agente
parameters:
- in: path
name: id
schema:
type: integer
required: true
description: Identificador do agente
requestBody:
content:
application/json:
schema:
$ref: '../../requestBodies/agent/patch.yaml'
responses:
'200':
description: O agente atualizado
content:
application/json:
schema:
$ref: '../../schemas/agent.yaml'
'404':
$ref: '../../responses/error/404.yaml'
27 changes: 27 additions & 0 deletions public/docs/components/requestBodies/agent/patch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
type: object
properties:
name:
type: string
example: "Novo nome"
description: Um texto que representa o novo nome do agente
shortDescription:
type: string
example: "Uma breve descrição do agente"
description: Uma breve descrição do agente
status:
type: integer
example: 1
description: Status do agente
type:
type: integer
example: 2
description: ID do tipo de agente (1 - Individual, 2 - Coletivo)
terms:
type: object
properties:
area:
type: array
items:
type: string
example: [ "Antropologia" ]
description: Áreas relacionadas ao agente
6 changes: 4 additions & 2 deletions public/docs/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,18 @@ paths:
$ref: './components/paths/agent/get-types.yaml'
/agent/index:
$ref: './components/paths/agent/create.yaml'
/agente/{id}:
$ref: './components/paths/agent/delete-and-update.yaml'
/api/event/describe:
$ref: './components/paths/event/describe.yaml'
/api/event/find:
$ref: './components/paths/event/find.yaml'
/api/event/findOne:
$ref: './components/paths/event/find-one.yaml'
/api/event/getTypes:
$ref: './components/paths/event/get-types.yaml'
/api/event/getTypeGroups:
$ref: './components/paths/event/get-type-groups.yaml'
/api/event/getTypes:
$ref: './components/paths/event/get-types.yaml'
/api/opportunity/describe:
$ref: './components/paths/opportunity/describe.yaml'
/api/opportunity/find:
Expand Down

0 comments on commit c3fc7db

Please sign in to comment.