Skip to content
This repository has been archived by the owner on Aug 29, 2023. It is now read-only.

jsonvalidate fxn, error message clarification #7

Closed
sckott opened this issue May 17, 2016 · 4 comments
Closed

jsonvalidate fxn, error message clarification #7

sckott opened this issue May 17, 2016 · 4 comments
Assignees
Milestone

Comments

@sckott
Copy link
Contributor

sckott commented May 17, 2016

@ateucher not sure how to interpret this message:

geojson_validate('{ "type": "FeatureCollection" }', error = TRUE)
#> Error: 1 error validating json:
#>  - data: no (or more than one) schemas match

what does no (or more than one) schemas match mean?

with another fxn I get

geojson_hint('{ "type": "FeatureCollection" }', error = TRUE)
#> Error: Line 1
#>     - "features" property required
@sckott sckott added this to the v0.1 milestone May 17, 2016
@sckott sckott self-assigned this May 17, 2016
@ateucher
Copy link
Contributor

It looks like it's generic message from is-my-json-valid when one of the required fields in the schema isn't there. See mafintosh/is-my-json-valid#82 and mafintosh/is-my-json-valid#38. Apparently it's when a field defined in the schema by oneOf or anyOf doesn't fit or isn't present (such as the geometry type??). Unfortunately if is-my-json-valid isn't going to be more specific, I don't think we can be either.

@sckott
Copy link
Contributor Author

sckott commented May 17, 2016

okay, but we know it is helpful for some errors at least. And I imagine we can get an improved schema at some point?

I'll add to docs that some errors won't have specific messages. But this option fast, so there's a tradeoff there

@ateucher
Copy link
Contributor

Yup, it is helpful for some errors... and it is fast. I'm not sure if the problem is with the schema, or with the reporting from is-my-json-valid - judging from the comments in those issues, it could be done better. But I'll keep my eyes out for a better schema, or ways to improve the current one...

@sckott
Copy link
Contributor Author

sckott commented May 17, 2016

I'm not sure if the problem is with the schema, or with the reporting from is-my-json-valid

Ah right! Well either way, it may improve

@sckott sckott closed this as completed in 9d611dd May 18, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants