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

v2: Message field in response #50

Open
dbrgn opened this issue Mar 29, 2020 · 4 comments
Open

v2: Message field in response #50

dbrgn opened this issue Mar 29, 2020 · 4 comments
Assignees

Comments

@dbrgn
Copy link
Contributor

dbrgn commented Mar 29, 2020

In ValidateUrlV2Response, the message field is optional. In ValidateJsonV2Response, it's required (and will be returned as an empty string by default). Is there a reason for that?

@gidsi
Copy link
Member

gidsi commented Mar 29, 2020

No, doesn't make any sense to me. I would assume that v1 send an empty string and i tried to comply with the v1 behavior (which seems kinda stupid in retrospective).

@dbrgn
Copy link
Contributor Author

dbrgn commented Mar 29, 2020

Ok, then the question is whether to always send a message or not. If it's required, that's easier for parsing (because you don't need to validate whether the field is there or not), but at the same time it's a bit stupid to send an empty message. I don't have a strong opinion on this 🙂

@gidsi
Copy link
Member

gidsi commented Mar 29, 2020

I would prefer to make it not required. I would assume that most people would use a lib for json parsing anyways.

@dbrgn
Copy link
Contributor Author

dbrgn commented Mar 29, 2020

Yep, but if you parse the JSON into a Python object and then call response['message'] you still get an IndexError. But leaving it out is fine 🙂

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