Forum Discussion
RonRatovsky
Staff
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.
Selada
6 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
- 4 months ago
- 3 years ago
- 4 months ago
Recent Discussions
- 4 days ago
- 4 days ago
- 21 days ago