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

Allow sending cache_dir=null in PATCH request-body #568

Closed
tcompa opened this issue Sep 26, 2024 · 2 comments · Fixed by #570
Closed

Allow sending cache_dir=null in PATCH request-body #568

tcompa opened this issue Sep 26, 2024 · 2 comments · Fixed by #570

Comments

@tcompa
Copy link
Collaborator

tcompa commented Sep 26, 2024

In user's settings, we should also enable the possibility of setting cache_dir=null. Right now, if I try to set it to an empty string then the webclient sets cache_dir="" in the request body, which is then rejected from the backend.

image
image


This is a specific case, but it most likely applies to several other forms. Let's find a solution which would also work for all of them.

@zonia3000
Copy link
Collaborator

We already have a function nullifyEmptyStrings that we use in similar cases. In most of the cases we are using stripNullAndEmptyObjectsAndArrays, so the empty string are removed from the payload.

However, in this particular case if I send null to the endpoint I receive another validation error:

image

{"detail":[{"loc":["body","cache_dir"],"msg":"command=None is not a string.","type":"value_error"}]}

Is this expected?

@tcompa
Copy link
Collaborator Author

tcompa commented Sep 26, 2024

However, in this particular case if I send null to the endpoint I receive another validation error:
...
{"detail":[{"loc":["body","cache_dir"],"msg":"command=None is not a string.","type":"value_error"}]}
Is this expected?

No, it's not expected - and it's to be fixed on the backend side. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging a pull request may close this issue.

2 participants