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

requesting standard support of Dict fields type #251

Closed
Dowwie opened this Issue Jul 28, 2015 · 7 comments

Comments

Projects
None yet
4 participants
@Dowwie

Dowwie commented Jul 28, 2015

Please accept this request to adopt native support of a dictionary field type

@sloria

This comment has been minimized.

Member

sloria commented Aug 25, 2015

What would a Dict field support that isn't already supported by a Nested field?

@Dowwie

This comment has been minimized.

Dowwie commented Aug 26, 2015

Nested is sufficient for dicts whose schema is known in advance of use, but what about cases where the elements to serialize aren't known in advance?

@dwieeb

This comment has been minimized.

Contributor

dwieeb commented Sep 3, 2015

Sounds like Dict would just be Raw with a type check.

@mcandre

This comment has been minimized.

mcandre commented Sep 3, 2015

+1

@sloria

This comment has been minimized.

Member

sloria commented Sep 25, 2015

I would be open to a PR adding this. So would the interface be similar to DRF, where you can pass an inner field for validating values?

foo = fields.Dict(fields.Int())
@dwieeb

This comment has been minimized.

Contributor

dwieeb commented Sep 25, 2015

But, as @Dowwie said, there are cases where the schema of the elements inside the dict aren't known in advance. I could take a look at creating a PR.

@dwieeb dwieeb referenced this issue Sep 26, 2015

Merged

Dict #286

@sloria

This comment has been minimized.

Member

sloria commented Sep 30, 2015

The Dict field has been added on dev.

@sloria sloria closed this Sep 30, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment