Added root object names for better api first code generation

This commit is contained in:
Daniel López García
2021-12-17 11:55:40 +01:00
parent f3f338ae0e
commit 0469142d05
3 changed files with 67 additions and 49 deletions
+31 -22
View File
@@ -21,25 +21,34 @@ paths:
content:
application/json:
schema:
type: array
description: 'List of similar products to a given one ordered by similarity'
minItems: 0
uniqueItems: true
items:
type: object
required:
- id
- name
- price
- availability
properties:
id:
type: string
minLength: 1
name:
type: string
minLength: 1
price:
type: number
availability:
type: boolean
$ref: '#/components/schemas/SimilarProducts'
'404':
description: Product Not found
components:
schemas:
SimilarProducts:
type: array
description: 'List of similar products to a given one ordered by similarity'
minItems: 0
uniqueItems: true
items:
$ref: '#/components/schemas/ProductDetail'
ProductDetail:
description: 'Product detail'
type: object
properties:
id:
type: string
minLength: 1
name:
type: string
minLength: 1
price:
type: number
availability:
type: boolean
required:
- id
- name
- price
- availability