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

Incorrect check asText on ArrayNode element #44

Open
mike-podolskiy90 opened this issue Apr 22, 2023 · 1 comment
Open

Incorrect check asText on ArrayNode element #44

mike-podolskiy90 opened this issue Apr 22, 2023 · 1 comment

Comments

@mike-podolskiy90
Copy link

Here you're checking contributors are not empty:

https://github.com/frictionlessdata/datapackage-java/blob/main/src/main/java/io/frictionlessdata/datapackage/Package.java#L775

That doesn't look like a correct way to do that. Contributors is ArrayNode which derived from ContainerNode and asText implemented there as:

@Override
public String asText() { return ""; }

https://github.com/FasterXML/jackson-databind/blob/2.15/src/main/java/com/fasterxml/jackson/databind/node/ContainerNode.java#L41

I think the right way would be:

!jsonNodeSource.get(Package.JSON_KEY_CONTRIBUTORS).isEmpty()

@iSnow

@iSnow
Copy link
Contributor

iSnow commented Sep 4, 2023

  • Needs test cases
  • valid concern, unfortunately down on my list of prios.

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