-
Notifications
You must be signed in to change notification settings - Fork 31
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
Change the type of config data between client and gateway #1285
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think these changes are good but to avoid to use QueryDict
in the request we need to specify that a request is a json and that's changing in requests
the field data
by json
from what I could read here:
https://requests.readthedocs.io/en/latest/user/quickstart/#more-complicated-post-requests
Please note that the above code will NOT add the Content-Type header (so in particular it will NOT set it to application/json).
If you need that header set and you don’t want to encode the dict yourself, you can also pass it directly using the json parameter (added in version 2.4.2) and it will be encoded automatically:
url = 'https://api.github.com/some/endpoint'
payload = {'some': 'data'}
r = requests.post(url, json=payload)
Note, the json parameter is ignored if either data or files is passed.
This PR is separated from the issue now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM @akihikokuroda , should we open issues to do the same for arguments
and env_vars
?
Thanks! No, we don't unless we want to change the field type of in the models. I don't know if it's a good thing to do changing the field type at this moment. WDYT? |
Mmm... Maybe we can open a discussion for this because I don't want to add too many comments in the PR. My proposal would be something like:
|
@Tansito Yes, new issue or discussion is good. Would you create one? |
Summary
Fix mismatch between the data type of the
config
in the post data and the data type in the data modelFix #1268
Details and comments
The mismatch made some special handling for the config data in the serializer.