You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 : #103
This is what i gave in my code:
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.
The text was updated successfully, but these errors were encountered:
Uh oh!
There was an error while loading. Please reload this page.
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 : #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.
The text was updated successfully, but these errors were encountered: