Forum Discussion
abhijitjadhav67
New Contributor
---
openapi: 3.0.1
info:
title: Test
version: v1
paths:
/v1/getList:
get:
summary: get List.
description: get List.
operationId: getList
responses:
default:
description: get List
content:
application/json:
schema:
$ref: '#/components/schemas/B'
components:
schemas:
A:
title: A
type: object
properties:
field1:
type: string
field2:
type: string
B:
title: B
type: object
properties:
field3:
maxLength: 80
type: string
aList:
type: array
items:
$ref: '#/components/schemas/A'
properties:
field1:
type: string
field2:
type: string
HKosova
4 years agoSmartBear Alumni (Retired)
Try this:
B:
title: B
type: object
properties:
field3:
maxLength: 80
type: string
aList:
type: array
items:
$ref: '#/components/schemas/A'
When you use $ref, there's no need to redefine the referenced properties alongside the $ref.
- abhijitjadhav674 years agoNew Contributor
I see,Thank you
Related Content
- 5 years agoVitamin
- 11 years agotomerw
- 4 years agovelmurugan
- 5 years agoharryboy