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:
parent
07559b87e5
commit
dd7d1740ca
1 changed files with 33 additions and 22 deletions
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue