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
Unify how the GalaxyInteractorApi
handles JSON requests
#12152
Conversation
I'm sorry this is needed now - that is no fun. Should json=True be the default instead of json=False though? |
No worries! |
884b537
to
379fbbc
Compare
…ctorApi The GalaxyInteractorApi was defining json payloads only for the POST method using the json boolean parameter. This unifies the rest of the HTTP methods that can accept a payload to specify a json payload.
If the dictionary is empty we should set the json content to None, otherwise, if the endpoint has an optional payload (it can be None) but the schema of the payload contains required fields, the validation will fail if we provide an empty JSON ({}) instead of None.
379fbbc
to
398e849
Compare
Unfortunately, setting Unless I may have missed something when trying to make it the default, I guess the safest way to proceed is by checking each particular endpoint as they get migrated to FastAPI and to mark the corresponding Any other ideas? |
This seems like a good step forward! Thanks @davelopez |
Required by FastAPI, see comment galaxyproject#12152 (comment)
Required by FastAPI, see comment galaxyproject#12152 (comment)
Required by FastAPI, see comment galaxyproject#12152 (comment)
Required by FastAPI, see comment galaxyproject#12152 (comment)
See galaxyproject#12152 for details.
See galaxyproject#12152 for details.
See galaxyproject#12152 for details.
This is a follow up to #12136 (comment)
It basically allows the rest of the HTTP request methods in the
GalaxyInteractorApi
(that can contain a payload) to specify thejson=True
parameter. This will add the properContent-Type: application/json
to the header that is now explicitly required by FastAPI.How to test the changes?
License