Selada
6 years agoNew Contributor
Component schema reuse with different values
Hi,
I'm using a component schema for several answers of my API. The problem is that in certain scenarios the same complex component has a different set of values for one of the attributes (It's an enumeration). If HTTP status is 200 one of the attributes has three possible values, if answer HTTP status is 400 the same attribute may have 10 different possible values.
I want to be explicit on the possible values on the answer for the different HTTP status, but AFAIK, I cannot do it without duplicating the object for each case :-( Is there any way of doing it or am I right?
Thank you very much in advance.