You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some of our APIs return polymorphic associations, as in, the return value could be one of a few different models.
It would be nice to be able to do some kind of "OR", "anyOf", or "oneOf" action, something like:
def_param_group :user do
# some params here
end
def_param_group :robot do
# some params here
end
# later on in in a returns block
property :entity, Hash, oneOf: [:user, :robot]
is that possible today?
The text was updated successfully, but these errors were encountered:
Did you ever find a good answer to this question? We have a similar situation where there is an array of items returned and based on the type they have a different structure. I'd like to document each structure separately.
@nathanpalmer we did not! We ended up inserting our own code into Apipie in our codebase to support different cases. We haven't implemented a solution for this specific issue, however. Maybe soon!
Some of our APIs return polymorphic associations, as in, the return value could be one of a few different models.
It would be nice to be able to do some kind of "OR", "anyOf", or "oneOf" action, something like:
is that possible today?
The text was updated successfully, but these errors were encountered: