Forum Discussion
HKosova
5 years agoSmartBear Alumni (Retired)
You can define a base schema with common properties and use allOf+$ref to "inherit" from that base schema.
In your example, you can inherit the sessionOpenResponse schema from sessionCloseRequest as follows:
"sessionOpenResponse": { "allOf": [ { "$ref": "#/definitions/sessionCloseRequest" }, { "type": "object", "properties": { "oauthToken": { "description": "This token is valid for 60 mins. and should be passed as 'Authorization: Bearer oauthToken' header when invoking the APIs", "example": "0efb61f4-3b06-3502-8987-c6e2e187244c", "type": "string" } } } ] }
- HareeshKota5 years agoNew Contributor
Thank You Helen Kosova for the response.
That's helpful, but how to handle this when I have few more properties in "sessionCloseRequest" and i don't want all of them to be referred in to the "sessionOpenResponse" ? How to refere a few particular properties ?
Regards,
Hareesh
- HKosova5 years agoSmartBear Alumni (Retired)
Define a base schema with common properties and inherit both sessionCloseRequest and sessionOpenResponse from that base schema.
Related Content
- 4 years ago
Recent Discussions
- 19 hours ago
- 8 days ago