Forum Discussion
RonRatovsky
6 years agoStaff
You don't have to duplicate the entire schema, but you will have to create multiple schemas.
Create a base schema, say, BaseResponse. That schema would include everything that's fully shared among the responses. Then create a response specific for your case, and use 'allOf' to combine BaseResponse with any additional fields and restrictions you may have.
- Selada6 years agoNew Contributor
Hi Ron,
Thank you for your answer. In the meanwhile I've applied inheritance (or composition) of the answer as you suggest, which seemed fine, but I found the generated server code didn't include the attributes that didn't belong to the base response. I've delivered the possible solution and I'm not working in this case anymore. Thank you for your availability.
BR,
Selada
Related Content
- 2 years ago
- 3 months ago
- 3 years ago
- 6 years ago
Recent Discussions
- 10 days ago
- 16 days ago