geopython / pygeoapi

pygeoapi is a Python server implementation of the OGC API suite of standards. The project emerged as part of the next generation OGC API efforts in 2018 and provides the capability for organizations to deploy a RESTful OGC API endpoint using OpenAPI, GeoJSON, and HTML. pygeoapi is open source and released under an MIT license.
https://pygeoapi.io
MIT License
460 stars 250 forks source link

Server setting to allow for bigger payloads for Processess #1619

Closed supermaro84 closed 2 months ago

supermaro84 commented 2 months ago

Description I am experiencing that there is a limitation on json payload that is sent to processess endpoint. I am sending in an object with longer list of coordinates and I get ERROR - Expecting value: line 1 column 1 (char 0) which refers to pygeoapi/process/manager/base.py:307, which suggests that json is not well formed. Is there a setting that allows for adjusting this length? The same behaviour is experienced when using both development server and docker image. Steps to Reproduce Steps to reproduce the behavior: Expected behavior A clear and concise description of what you expected to happen. dd Screenshots/Tracebacks If applicable, add screenshots to help explain your problem. Environment

Additional context Add any other context about the problem here.

tomkralidis commented 2 months ago

@supermaro84 thanks for the report. Can you provide a test case/test data which we can reproduce locally?

supermaro84 commented 2 months ago

Hi @tomkralidis. Thanks for quick reply. I have created a process plugin with inputs defined as 'inputs': { 'features': { 'title': 'features', 'description': 'Description.', 'minOccurs': 1, 'maxOccurs': 1, 'schema': { 'type': 'object' }} },

Then a json such as : {"inputs":{"features":[{"attributes":{"latitude":63.4,"longitude":8.7,"objectId":1}},{"attributes":{"latitude":63.4,"longitude":8.7,"objectId":1}}] }} the list with features works with length of 86 but it crashes with 87. I could shorten the latitude element and it works. So definitely there must be a length limit. For testing purposes the objects in the features lists are identical.

tomkralidis commented 2 months ago

Can you provide a full test case to test further (this includes a minimal Python process and a sample payload). Similar use cases work fine with much larger payloads.

supermaro84 commented 2 months ago

Hello. Sorry for late response but I have resolved this issue. It turned out that a method implemented in custom prosessor class was called and failed (due to failing request to external service). Sorry for this confusion. But i guess that this error would probably need to be intercepted. Thanks for help anyway.