How do I reference the same schema as a property?
SOLVED- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-09-2020
07:14 PM
05-09-2020
07:14 PM
How do I reference the same schema as a property?
I have the following in my oas.yaml file:
components: schemas: ServiceError: type: object properties: Message: type: string description: "The exception message." ExceptionMessage: type: string Type: type: string description: "The exception type."" InnerError: $ref: '#/components/schemas/ServiceError' description: "If there's an inner exception, the InnerException. Property: type: object properties: Name: type: string description: Name of the property.
It does not like the line "description: "If there's an inner exception, the InnerException." and if I remove that, it does not like the line "Property:". I've tried a lot of things and nothing works. What am I not understanding?
thanks - dave
Solved! Go to Solution.
2 REPLIES 2
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-11-2020
08:00 AM
05-11-2020
08:00 AM
The Type.description line has an extra quote at the end. The InnerError.description line is missing an ending quote and also has extra indent.
Here's the correct version:
components:
schemas:
ServiceError:
type: object
properties:
Message:
type: string
description: "The exception message."
ExceptionMessage:
type: string
Type:
type: string
description: "The exception type."
InnerError:
$ref: '#/components/schemas/ServiceError'
description: "If there's an inner exception, the InnerException."
Property:
type: object
properties:
Name:
type: string
description: Name of the property.
Helen Kosova
SmartBear Documentation Team Lead
________________________
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-11-2020
08:18 AM
05-11-2020
08:18 AM
Thank you!
ps - That was stupid on my part.
