-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExo4.yml
More file actions
85 lines (81 loc) · 2.06 KB
/
Copy pathExo4.yml
File metadata and controls
85 lines (81 loc) · 2.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
openapi: 3.0.0
info:
title: API de recherche de produits
version: 1.0.0
description: API pour rechercher et gérer des produits.
servers:
- url: http://localhost:8000
description: Serveur de développement
components:
schemas:
Product:
type: object
properties:
name:
type: string
description: Nom du produit.
example: "Pommes"
expiration_datetime:
type: string
format: date-time
description: Date et heure d'expiration du produit.
example: "2025-08-25T10:00:00Z"
price:
type: number
format: float
description: Prix du produit.
example: 1.50
required:
- name
- expiration_datetime
- price
ProductsList:
type: array
items:
$ref: '#/components/schemas/Product'
examples:
multiProducts:
value:
- name: "Pommes"
expiration_datetime: "2025-08-25T10:00:00Z"
price: 1.50
- name: "Bananes"
expiration_datetime: "2025-08-28T12:30:00Z"
price: 2.75
emptyList:
value: []
parameters:
Limit:
name: limit
in: query
required: false
description: Nombre maximum d'éléments à retourner.
schema:
type: integer
examples:
defaultLimit:
value: 10
SearchQuery:
name: q
in: query
required: false
description: Terme de recherche pour filtrer les produits par nom.
schema:
type: string
examples:
searchTerm:
value: "Pommes"
paths:
/products:
get:
summary: Rechercher des produits
parameters:
- $ref: '#/components/parameters/Limit'
- $ref: '#/components/parameters/SearchQuery'
responses:
'200':
description: Une liste de produits correspondant aux critères de recherche.
content:
application/json:
schema:
$ref: '#/components/schemas/ProductsList'