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

when a configured property in returnFields points to an array the value in the response is serialized as [object Object] #36

Open
steveliles opened this issue Jun 14, 2021 · 0 comments

Comments

@steveliles
Copy link

A property in elasticsearch can be a single value or an array. When the value is an array this provider currently serializes it as

[object Object]

but could instead flatten the array to e.g.

property.0: "foo", 
property.1: "bar"

or for arrays of objects with nested properties:

property.0.a: "foo", 
property.0.b: "bar", 
property.1.a: "fizz", 
property.1.b: "buzz"

Its a super-simple fix to make this work: in src/utils/hitConverter.js: change the opts given to flatten on line 34 to {safe: false}.

The fix is so simple that it made me wonder if this was on purpose (that there's a good reason not to try to support arrays at all) and being new to koop and esri featureserver i'm missing something?

steveliles added a commit to steveliles/koop-provider-elasticsearch that referenced this issue Jun 14, 2021
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

1 participant