refactor(components): update nullable types to use oneOf for better clarity

This change improves the schema definitions by replacing nullable types with oneOf, allowing for clearer API documentation and validation.
This commit is contained in:
Jérémy Munsch 2026-08-14 12:31:40 +02:00
parent 07559b87e5
commit dd7d1740ca
Signed by: forge-joniko
GPG key ID: D7EFE2F5CB6CC0E4

View file

@ -769,18 +769,21 @@ components:
preparationAdvices:
type: string
tips:
type: string
nullable: true
type:
- string
- 'null'
example: Servir chaud
sellFamilly:
type: string
nullable: true
type:
- string
- 'null'
example: Volaille
ingredients:
$ref: '#/components/schemas/IncoIngredients'
portions:
$ref: '#/components/schemas/IncoPortionAmount'
nullable: true
oneOf:
- $ref: '#/components/schemas/IncoPortionAmount'
- type: 'null'
allergens:
type: array
items:
@ -790,29 +793,35 @@ components:
isSeasonal:
type: boolean
weight:
$ref: '#/components/schemas/IncoWeight'
nullable: true
oneOf:
- $ref: '#/components/schemas/IncoWeight'
- type: 'null'
nutriscore:
$ref: '#/components/schemas/IncoNutriscore'
nullable: true
oneOf:
- $ref: '#/components/schemas/IncoNutriscore'
- type: 'null'
storageCondition:
$ref: '#/components/schemas/IncoStorageCondition'
nullable: true
oneOf:
- $ref: '#/components/schemas/IncoStorageCondition'
- type: 'null'
additives:
type: array
items:
$ref: '#/components/schemas/IncoAdditive'
compo:
type: string
nullable: true
type:
- string
- 'null'
pattern: '^\d{1,}$'
createdAt:
type: string
nullable: true
type:
- string
- 'null'
format: date-time
updatedAt:
type: string
nullable: true
type:
- string
- 'null'
format: date-time
IncoWeight:
@ -966,12 +975,14 @@ components:
type: string
example: Poulet Rôti Classe A
createdAt:
type: string
nullable: true
type:
- string
- 'null'
format: date-time
updatedAt:
type: string
nullable: true
type:
- string
- 'null'
format: date-time
IncoCompo: