-
-
Notifications
You must be signed in to change notification settings - Fork 79
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
restapi double parameter is broking code. #1763
Comments
How should the multiple instances of a parameter be handled?
|
They are not compatible so as the parameter must be a normal string or a normal flatten dict as I see in plone.restapi(https://github.com/plone/plone.restapi/blob/e62bea2121d929d9c35298e7e5841332bd1dcbc5/src/plone/restapi/serializer/expansion.py#L7C5-L8C1). I think the BadRequest must be returned to the user in case he uses the both of possible value types. |
Agreed. I think that doubled parameters should be rejected. I think that requests should be well-formed, and we should not guess the intent. |
Agreed that the REST API should return a BadRequest response if the input is not in a valid format. @folix-01 Can you show the full stack trace of the error to make it clearer how it is breaking? |
@folix-01 https://meta.stackoverflow.com/questions/285551/why-should-i-not-upload-images-of-code-data-errors. Images of text are difficult to read. |
Yeah, sorry, my mistake Traceback (innermost last): |
I think the search get service should be adjusted to return a 400 response if there's an exception in unflatted_dotted_dict I'm not sure why you're trying to pass |
For example if u send this type of the request to @search endpoint:
@search?expand=breadcrumbs,actions,navroot,navigation,subsite&expand.navigation.depth=2
where u have a doubleexpand
parameter(which will be interpreted like a flatten dict and a string) the site is broking atplone.restapi.search.utils:35
when it tries to execute theunflatten_dotted_dict
The text was updated successfully, but these errors were encountered: