API_Microservices/swagger/swagger.yaml
2024-03-27 17:07:47 +01:00

252 lines
5.1 KiB
YAML

openapi: '3.0.2'
info:
title: API Jo
version: '1.0'
servers:
- url: http://localhost/
components:
schemas:
Athlete:
type: object
properties:
name:
type: string
surname:
type: string
email:
type: string
country:
type: string
isDisabled:
type: boolean
default: false
Sport:
type: object
properties:
name:
type: string
place:
type: string
category:
type: string
Medal:
type: object
properties:
rank:
type: string
enum:
- gold
- silver
- bronze
sportID:
type: integer
athleteID:
type: integer
paths:
/athlete:
get:
tags:
- Athletes
summary: Display athletes list
responses:
'200':
description: OK
post:
tags:
- Athletes
summary: Add a new athlete
responses:
'200':
description: OK
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/Athlete'
/athlete/{id}:
parameters:
- name: id
in: path
required: true
schema:
type: integer
example: 1
get:
tags:
- Athletes
summary: Display one athlete using the ID
responses:
'200':
description: 'OK'
content:
application/json:
schema:
$ref: '#/components/schemas/Athlete'
'404':
description: 'Athlete not found'
patch:
tags:
- Athletes
summary: Modify a athlete using the ID
requestBody:
required: false
content:
application/json:
schema:
$ref: '#/components/schemas/Athlete'
responses:
'200':
description: 'OK'
'404':
description: 'Athlete not found'
delete:
tags:
- Athletes
summary: Delete an athlete using the ID
responses:
'200':
description: 'OK'
'404':
description: 'Athete not found'
/sport:
get:
tags:
- Sports
summary: List all available sports
responses:
'200':
description: OK
post:
tags:
- Sports
summary: Add a sport
responses:
'200':
description: OK
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/Sport'
/sport/{id}:
parameters:
- name: id
in: path
required: true
schema:
type: integer
example: 1
get:
tags:
- Sports
summary: Display a specific sport using the ID
responses:
'200':
description: 'OK'
content:
application/json:
schema:
$ref: '#/components/schemas/Sport'
'404':
description: 'Sport not found'
patch:
tags:
- Sports
summary: Edit a specific sport using the ID
requestBody:
required: false
content:
application/json:
schema:
$ref: '#/components/schemas/Sport'
responses:
'200':
description: 'OK'
'404':
description: 'Sport not found'
delete:
tags:
- Sports
summary: Delete a specific sport using the ID
responses:
'200':
description: 'OK'
'404':
description: 'Sport not found'
/medal:
get:
tags:
- Medal
summary: Display medals list
responses:
'200':
description: OK
post:
tags:
- Medal
summary: Add a new medal
responses:
'200':
description: OK
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/Medal'
/medal/{id}:
parameters:
- name: id
in: path
required: true
schema:
type: integer
example: 1
get:
tags:
- Medal
summary: Display a medal
responses:
'200':
description: 'OK'
content:
application/json:
schema:
$ref: '#/components/schemas/Medal'
'404':
description: 'Not found'
patch:
tags:
- Medal
summary: Modify element from medal
requestBody:
required: false
content:
application/json:
schema:
$ref: '#/components/schemas/Medal'
responses:
'200':
description: 'OK'
'404':
description: 'Medal not found'
delete:
tags:
- Medal
summary: Delete medal from Id
responses:
'200':
description: 'OK'
'404':
description: 'Medal not found'