Request: export org.everit.json.schema.{Visitor, ValidationFailureReporter}
See original GitHub issueIt would be great if org.everit.json.schema.Visitor
and org.everit.json.schema.ValidationFailureReporter
are made public. This would allow custom schema traversals like:
CustomFailureReporter reporter = new CustomFailureReporter(schema);
CustomVisitor visitor = new CustomVisitor(reporter);
visitor.visit(schema);
Issue Analytics
- State:
- Created 5 years ago
- Reactions:4
- Comments:5 (2 by maintainers)
Top Results From Across the Web
NullPointerException on visitSchemaOnAdditionalItems with ...
Hello, I discovered a strange case when I tried to validate my inputs to Google Json Schema for VOD Contents :
Read more >org.everit.json.schema.ValidationFailureReporter Maven / Gradle / Ivy
org.everit.json.schema.ValidationFailureReporter maven / gradle build tool code. The class is part of the package ➦ Group: com.github.erosb ➦ Artifact: ...
Read more >org.everit.json.schema : 1.1.0 - Maven Central
Official search by the maintainers of Maven Central Repository.
Read more >org.everit.json.schema.ValidatingVisitor java code examples
ValidatingVisitor visitor = new ValidatingVisitor(input, failureReporter, readWriteValidator, validationListener);... visitor.visit(schema);... visitor.
Read more >Import/export JSON schema for models - DatoCMS community
I noticed that dato uses a json-schema definition for validating the structure of your own API. I also love the ERD export of...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hello @dmitry-shkolnik !
Is this a blocking issue for you or just nice-to-have? The reason why these classes are currently package-private is that they might change in upcoming releases, and we don’t want to break the backward-compatibility of the public API. They are still fairly new (introduced in last Dec, version 1.8.0), and I simply don’t feel the visitor interface mature enough yet.
Good idea anyway, the visitor pattern aims arbitary processing of the visited classes, so the library should do it too. We just need a bit better visitors for this. Maintaining the backward-compatibility with deprecated but public classes causes enough headache already, I don’t want to increase these troubles.
Hello @erosb, thanks for your suggestion. I think that if I copy the
Visitor
class, I also need to simulate theSchema.accept()
method with a series ofinstanceof
, like the following:Other than that, I have some doubts about the recursion of the
Visitor
class, in particular for nested object properties. The methodVisitor.visitObjectSchema
has an interesting loopI don’t see any further call to
Schema.accept()
method (for example inObjectSchemaValidatingVisitor
), so how does this algorithm dig down the object hierarchy?Thanks