If you take a look at JSON schema site, there are only two libraries for validation in Java.
- The one that Jorge Campos suggested is mature, but looking for new maintainer: https://github.com/fge/json-schema-validator
- Second one is relatively new: http://github.com/everit-org/json-schema
I was recently in situation where I had to choose one or the other and I picked first option. It is being used also by Rest Assured library under the hood.
Answer from luboskrnac on Stack OverflowIf you take a look at JSON schema site, there are only two libraries for validation in Java.
- The one that Jorge Campos suggested is mature, but looking for new maintainer: https://github.com/fge/json-schema-validator
- Second one is relatively new: http://github.com/everit-org/json-schema
I was recently in situation where I had to choose one or the other and I picked first option. It is being used also by Rest Assured library under the hood.
You can also look at Rest Assured Json Schema validator
https://www.baeldung.com/rest-assured-json-schema
How to validate incoming request body JSON fields and POJO class fields in the endpoint
does anyone know the JSON schema for application.yaml for spring boot?
Videos
Found the Bug
JsonSchemaFactory.getInstance() was using the default Version 4.
Fix
JsonSchemaFactory.getInstance(VersionFlag.V7).getSchema(schemaPath.getInputStream());
Remove the s from https for the URI of draft-07.
The URI for draft-07 is http://....
The URI used to identify a schema dialect is not necessarily network addressable... in other words, "It's just a string", which should match completely.