-
Notifications
You must be signed in to change notification settings - Fork 11
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
Composer API changes for handling dict() #202
Composer API changes for handling dict() #202
Conversation
…upyter-plugin-fork into composer-api-changes
if isinstance(environments, list): | ||
self.finish(json.dumps(environments, default=lambda x: x.dict())) | ||
else: | ||
self.finish(environments) |
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.
This change is not correct, we should continue to use the json.dumps
method to ensure the written output is JSON.
What is the effect you are trying to achieve here?
The only practical difference between this and what we have now is that if the environments
value is a dictionary, then the Content-Type
header will be set to application/json
.
Is that what you are trying to do? If so, then we should set that header regardless of the type of environments
.
I.E. merely call self.set_header("Content-Type", "application/json")
prior to calling self.finish(...)
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.
Added Content-Type header will be set to 'application/json' for composer list environments.
Added Content-Type header will be set to 'application/json' for composer list environments.