Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do we support polymorphic associations? #799

Open
notfelineit opened this issue Nov 1, 2022 · 0 comments
Open

How do we support polymorphic associations? #799

notfelineit opened this issue Nov 1, 2022 · 0 comments
Labels

Comments

@notfelineit
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants