Hi,
I have a JSON schema which has a property "InvoiceDate" of type "string" with format as "date".
"InvoiceDate" : {
"type" : "string",
"format" : "date"
}
And I have a JSON payload as below:
{
"invoiceDate":"blah"
}
I am trying to validate the json payload against the above schema , the validator succeeds but shows up a warning:
warning: format attribute "date" not supported
level: "warning"
schema: {"loadingURI":"#","pointer":"/definitions/IntegrationTest/properties/invoiceDate"}
domain: "validation"
keyword: "format"
attribute: "date"
Seems like the Json-schema-validator is not supporting 'date' format.
final Library library = DraftV4Library.get().thaw()
.addFormatAttribute("date", DateAttribute.getInstance())
.freeze();
final ValidationConfiguration cfg = ValidationConfiguration
.newBuilder()
.setDefaultLibrary("file:///Users/vidya/Desktop/DocSchema.json", library)
.freeze();
final JsonSchemaFactory factory = JsonSchemaFactory.newBuilder()
.setValidationConfiguration(cfg).freeze();
Apparantly this again is skipping the date validation , the the validator is succeeding and showing the warning.
Am I doing anything wrong here? What value needs to be provided in the setDefaultLibrary? i tried providing my schema link ("file:///Users/vidya/Desktop/DocSchema.json"), and some random URL's as well. The validator keeps succeding.
Hi, I have a JSON schema which has a property "InvoiceDate" of type "string" with format as "date". "InvoiceDate" : { "type" : "string", "format" : "date" } And I have a JSON payload as below: { "invoiceDate":"blah" } I am trying to validate the json payload against the above schema , the validator succeeds but shows up a warning:
warning: format attribute "date" not supported level: "warning" schema: {"loadingURI":"#","pointer":"/definitions/IntegrationTest/properties/invoiceDate"} domain: "validation" keyword: "format" attribute: "date"
Seems like the Json-schema-validator is not supporting 'date' format.
I tried solving the above issue by following the steps specified in the similar issue : https://github.com/java-json-tools/json-schema-validator/issues/103
This is what i gave in my code:
Apparantly this again is skipping the date validation , the the validator is succeeding and showing the warning. Am I doing anything wrong here? What value needs to be provided in the setDefaultLibrary? i tried providing my schema link ("file:///Users/vidya/Desktop/DocSchema.json"), and some random URL's as well. The validator keeps succeding.