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

FeatureServer handle empty query parameter values #441

Closed
despainm opened this issue Dec 19, 2022 · 2 comments
Closed

FeatureServer handle empty query parameter values #441

despainm opened this issue Dec 19, 2022 · 2 comments
Assignees

Comments

@despainm
Copy link

Some of our arcgis/esri clients provide requests that contain query parameters with empty values. We've noticed that two parameters in particular cause errors for our clients.

resultRecordCount=&groupByFieldsForStatistics=

When resultRecordCount= is provided the route.js query param validation does not handle empty/null values which causes a 400 to be returned. This is a reasonable response given that the arcgis documentation says The minimum value entered for this parameter cannot be below 1 and one can assume that an empty value does not meet this requirement.

When groupByFieldsForStatistics= is provided the filter-and-transform.js query call fails with Cannot convert undefined or null to object.

Is it possible to treat the empty values of these two parameters as if they weren't provided at all?

@rgwozdz
Copy link
Member

rgwozdz commented Dec 19, 2022

Thanks @despainm. We should be able to make the changes you need. My preference would probably be to change the validator so that empty strings are valid, but then remove the empty string in followup normalization step. That way our validation schema aligns with all acceptable received values, rather than having us mutating responses in order to fit a validation schema we already control. If you could start a PR for this, that would probably expedite development. Thanks!

@rgwozdz
Copy link
Member

rgwozdz commented Jan 19, 2023

Fixed, closing.

@rgwozdz rgwozdz closed this as completed Jan 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants