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

remove string cast from Page serialization #100

Closed

Conversation

adamhadani
Copy link
Contributor

Fixes this issue

@jessemyers
Copy link
Contributor

jessemyers commented Feb 6, 2017

LGTM

Approved with PullApprove

@jessemyers
Copy link
Contributor

LGTM even better

if isinstance(value, (UUID, Enum)):
return str(value)

return value
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ping @jessemyers I ended up adding this to_value method as a unit-test was failing here when trying to pass enum and UUID objects into the from_query_string factory and expect to see them serialized properly into a JSON response (as strings).

  1. I'm not sure this is a case we care about so perhaps unit-test is off?

  2. In any case, I think Enum/UUID covers most mainstream use-cases for non offset/limit parameters so this would preserve backward-compatibility pretty well. removing this might break a bunch of services in hard to debug ways.. WDYT?

@adamhadani adamhadani closed this Feb 6, 2017
@adamhadani adamhadani deleted the feature/GLOB-5923-support-postloaded-search-params branch February 6, 2017 21:33
@adamhadani adamhadani mentioned this pull request Feb 8, 2017
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

Successfully merging this pull request may close these issues.

None yet

2 participants