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

wjecli validation -- suboptimal results #86

Open
lzsiga opened this issue Jan 22, 2020 · 4 comments
Open

wjecli validation -- suboptimal results #86

lzsiga opened this issue Jan 22, 2020 · 4 comments

Comments

@lzsiga
Copy link
Contributor

lzsiga commented Jan 22, 2020

Hi, I've just tried schema-validation, the results were suboptimal:

echo 'validate json-schema-draft-04.json' | wjecli json-schema-draft-04.json
definitions: extra property 'schemaArray' found.
definitions: extra property 'positiveInteger' found.
definitions: extra property 'positiveIntegerDefault0' found.
definitions: extra property 'simpleTypes' found.
definitions: extra property 'stringArray' found.
definitions failed validation
properties: extra property 'id' found.
properties: extra property '$schema' found.
...

As a start, the schema should be valid against itself, but even if it isn't, the error message should at least contain a line-number...

@penduin
Copy link
Member

penduin commented Jan 23, 2020

WJE's schema support is very outdated (even v4 isn't fully supported, clearly :^) and as much as I'd like to, I can't promise I'll have the time to bring it up to date. Patches welcome, of course!

Line numbers might be more tricky; WJReader itself doesn't keep track of lines at all, simply chomping through and ignoring all whitespace completely (as determined by isspace()). WJReader would need a new set of line-aware interfaces (for which the existing functions could become thin wrappers). Above that, it would be easey to add properties in WJElement for line and character from which an element was originally read.

...once again this sounds like fun and I hope I get some time to do it, but in the meantime feel free and encouraged to dive in and take a crack at it yourself!

@minego
Copy link
Member

minego commented Jan 23, 2020 via email

@penduin
Copy link
Member

penduin commented Jan 23, 2020

true, it's nothing difficult. just have to make sure it gets exposed back up to wjelement in a sane way, then make a pass through wjeschema's error reporting.

@lzsiga
Copy link
Contributor Author

lzsiga commented Jan 24, 2020

Thank you for you replies, maybe I'll able to offer some suggestions later.
Yours: L. Zs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants