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

What's correct way to allow multiple types within a list type #569

Open
naphta opened this issue Sep 27, 2018 · 3 comments
Open

What's correct way to allow multiple types within a list type #569

naphta opened this issue Sep 27, 2018 · 3 comments

Comments

@naphta
Copy link

naphta commented Sep 27, 2018

I've been trying to figure it out and I've been through a few iterations and the documentation isn't really offering me much insight into how to do it.

Essentially I want a list type to allow data input from a number of predefined models, I've tried using UnionType, subclassing my models and using PolyModelType, and using MultiType. I'm not sure what I'm doing wrong but I'd just like to be able to give a complex data structure to a base model and have all the different lists of data validated.

@naphta
Copy link
Author

naphta commented Sep 27, 2018

From what I can tell looking into it; UnionType is what I should be using but the conversions from ModelTypes regularly end up in DataErrors for rogue fields, really these rogue fields should be returning a ConversionError at a glance?

@rishub
Copy link

rishub commented Jan 8, 2020

@naphta did you land on anything here?

@naphta
Copy link
Author

naphta commented Jan 8, 2020

@naphta did you land on anything here?

I didn't actually get around to trying to put a fix in place. I haven't really wanted to create user facing API validations since.

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

No branches or pull requests

2 participants