plone / plone.restapi

RESTful API for Plone.
http://plonerestapi.readthedocs.org/
84 stars 73 forks source link

ComponentLookupError in querystring-search when query is an empty list #1646

Closed wesleybl closed 1 year ago

wesleybl commented 1 year ago

When we call the querystring-search endpoint passing an empty list in the query parameter, we get the error below:

2023-05-29 15:16:45 ERROR [Zope.SiteErrorLog:35][waitress-1] ComponentLookupError: http://localhost:8080/Plone/@querystring-search
Traceback (innermost last):
  Module ZPublisher.WSGIPublisher, line 181, in transaction_pubevents
  Module ZPublisher.WSGIPublisher, line 390, in publish_module
  Module ZPublisher.WSGIPublisher, line 285, in publish
  Module ZPublisher.mapply, line 85, in mapply
  Module ZPublisher.WSGIPublisher, line 68, in call_object
  Module plone.rest.service, line 22, in __call__
  Module plone.restapi.services, line 19, in render
  Module plone.restapi.services.querystringsearch.get, line 75, in reply
  Module plone.restapi.services.querystringsearch.get, line 64, in __call__
  Module zope.component._api, line 104, in getMultiAdapter
zope.interface.interfaces.ComponentLookupError: (([], <WSGIRequest, URL=http://localhost:8080/Plone/@querystring-search>), <InterfaceClass plone.restapi.interfaces.ISerializeToJson>, '')

To reproduce, run:

curl -i -X POST http://localhost:8080/Plone/@querystring-search -H "Accept: application/json" -H "Content-Type: application/json" --data-raw '{"query": []}'