783 questions
0 votes
1 answer
52 views
how to verify Confluent Kafka JsonSchema Serialized message?
I’m trying to verify whether messages produced using Confluent’s KafkaJsonSchemaSerializer are correctly serialized in the expected Confluent wire format (i.e. a “magic byte” followed by a 4-byte ...
0 votes
2 answers
85 views
patternProperties is throwing an error even though it satisfies the condition in jsonschema
I have this json schema: { "$schema": "http://json-schema.org/draft-04/schema#", "description": "The description of OpenAPI v3.0.x documents, as defined by https:...
0 votes
1 answer
149 views
if string is empty or null or "", then i need to set default value in enum using json schema validation
i need to set default value in enum, if UI passing string is passing empty or null or "" "BankAccount":{ "type": "String", "enum": ["Y", &...
0 votes
1 answer
159 views
How to set custom error message in jsonschema if/else
I have a JSON schema like this: { "authentication": { // provider is an enum. Let's say it has A and B as values. // if A is chosen, jwt must have a value. // if B is chosen, ...
3 votes
0 answers
376 views
how to validate OpenAPI-specific request query parameters against corresponding open api specs in spring boot
I am using com.networknt:json-schema-validator lib to validate the incoming json request body in my spring boot server against the pre loaded schema and its working fine. Now I also want to validate ...
0 votes
1 answer
78 views
Validation fails for string property with pattern
I have a JSON schema { "type": "object", "required": ["version"], "additionalProperties": false, "properties": { "version": { ...
0 votes
1 answer
29 views
Is there any property that I can add to the MongoDB validation schema to add additional information without impacting the validation of new documents?
Is there any way I can insert a property into this validator for inserting documents into MongoDB that will not impact validation but that I can retrieve via query? To give some context: I use the ...
2 votes
4 answers
1k views
Use OpenAPI 3.1 Schema to validate an OpenAPI spec
I've been using the OpenAPI 3.0 schema to validate OpenAPI 3.0 specifications. However, I don't seem to be able to use the OpenAPI 3.1 schema to validate an OpenAPI 3.1 specification. With OpenAPI 3.0 ...
1 vote
1 answer
63 views
JSON Schema: How to Check array A contains at least all value of array B
I expect array A to contain at least all the elements of attribute array B. Here are some examples: // valid { "A": [1,2,3], "B": [1,2] } // valid { "A": [1,2], "B&...
0 votes
1 answer
125 views
How to use $ref to set conditions on objects of sub schemas using json schema draft 2020-12 in a spring boot project?
I'm trying to do json schema validation in spring boot 3.3.3, in resources folder I have put the schemas main.json, sub1.json and sub2.json. I’m using $ref to refer other schema objects from main ...
2 votes
0 answers
145 views
networknt json-schema-validator -> Can i override validation for existing Keyword?
In networknt/json-schema-validator, the maximum keyword accepts only number type as argument. In AJV json schema validator, maximum keyword accepts both number type as well as string or json pointer ...
0 votes
0 answers
69 views
Number of rules defined in everit schema using Java
I am trying to validate a JSON schema against the JSON input. I am using org.everit.json.schema-1.12.1.jar My JSON input: { "id": 200, "name": "Green Learner", "cost&...
0 votes
1 answer
60 views
Import variable as dependency from the main YAML schema to a sub-schema
I have a YAML schema splitted in two files. Like this: main.yaml type: object properties: a: description: variable a type: string b: description: variable b $ref: support.yaml and ...
1 vote
2 answers
60 views
How to enforce the condition of at most one element of a certain enumType in an array in json schema
I have this problem where I have a json schema similar to { "$schema" : "https://json-schema.org/draft-07/schema", "type" : "object", "title&...
0 votes
1 answer
137 views
How to Define JSON Schema for a JSON String Field in an Object?
I have a JSON object where one of the fields contains a JSON string. I need to write a JSON schema that validates this JSON string field. Here's an example of the JSON object I'm working with: { &...