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
86
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
377
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
30
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
61
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:
{
&...
1
vote
1
answer
99
views
Unable to write JSON schema to validate properties inside an array
I am trying to write JSON schema to validate JSON file with following content:
{
"number" : "1",
"rootProperty":
[
{
"property1"...
0
votes
1
answer
79
views
extract allOf validation from json schema
I have the following json schema that I want to use to validate data. It works well when using jsonschema to validate the basic information and conditional scenarios.
But I have a specific problem ...
0
votes
1
answer
85
views
JsonSchema ValidationError for an array
Code below throws a validation error: jsonschema.exceptions.ValidationError: '[1,1]' is not of type 'array'
I've checked with online validators and they seem fine - what have I done wrong?
import json
...
0
votes
1
answer
232
views
JsonSchemaValidator module name is confused Maven vs Eclipse
I'm having trouble getting a Maven Eclipse project to build in both Maven and Eclipse. The problem appears to be that the JSON validation library com.networknt wants to be required (in module-info....
-1
votes
1
answer
274
views
NoClassDefFoundError in networknt json-schema-validator in android 5.1
With the help of networknt json-schema-validator i'm trying to validate json schema. The below code is working fine in Android 11
val mapper = ObjectMapper(YAMLFactory())
val jsonNodeReader = ...
0
votes
0
answers
81
views
io.restassured.module.jsv.JsonSchemaValidationException: com.fasterxml.jackson.core.JsonParseException: no JSON Text to read from input
I am trying to validate response body on matching the JSON schema using Rest Assured 5.4.0 and receiving:
io.restassured.module.jsv.JsonSchemaValidationException: com.fasterxml.jackson.core....
0
votes
1
answer
58
views
JsonSchema that can accept legacy and expanded payload
I am expanding an existing feature, and as such the API payload needs to be updated. Due to constraints outside of my control, I need to support the legacy payload in conjunction with the new payload. ...
0
votes
2
answers
585
views
validate json schema using NjsonSchema with ref field
I tried to validate this schema using NjsonSchema but I getting error like ": 'Could not resolve the JSON path '/defs/product' because no document path is available.'"
this is my main-schema-...
1
vote
0
answers
33
views
How to reference a property from a subschema in a conditional statement?
Imagine we have a JSON schema where one property of a subschema is mutually exclusive depending on the value of a property of another subschema. When doing the if-else statement, how can I reference ...
-1
votes
1
answer
140
views
Json Schema not evaluating if else condition properly in draft version 2020-12
I use a json schema which refers to another json schema as follows :
Schema 1 (cache_test.json)
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$...
0
votes
1
answer
282
views
"prefixItems" of JSON Schema draft 2020-12 validating only first element of the array
I am using the following schema to validate json. When I have more than one element in the array of appData, it validates only the first index of the array. The other indexes are not validated.
How ...
1
vote
1
answer
552
views
JSON Schema validation for value '0' fails
I am a bit new to using nodejs to validate a request object with the schema. As long as the value in request object for "from" is not '0' the validation passes. But the moment I use '0' ...
0
votes
2
answers
76
views
anyOf two sets of patternProperties but no additionalProperties
I am attempting to define two possible sets of patternProperties using anyOf, but I would like to exclude any properties that don't fit either of those patterns. However, when defining ...
0
votes
1
answer
471
views
Does JSON Schema Validation support custom error messages?
I'm using JSON Schema to validate a json object like below:
{
"json":
{ "is_expanded_identification": false, "identity":
...
4
votes
1
answer
226
views
Vertx(4.5.7) OutputUnit does not give validation messages when schema validation fails
I was trying to use Vertx's JSON Schema standards for validating the following schema:
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https:...
1
vote
0
answers
135
views
How to convert XSD to JSON Schema using JavaScript in Postman script
How to convert XSD to JSON Schema using JavaScript in Postman scripts to validate JSON API requests and responses?
I used the below code to fetch the XSD in the Postman script but now trying to ...
0
votes
3
answers
158
views
OpenAPI Parser (Light-4J) not working on "oneOf" criteria
Following is the schema.
Example 1)
components:
schemas:
GroupHeader114: <-- clause 1
type: object
properties:
Authstn:
type: object
oneOf:
...
0
votes
2
answers
202
views
JSON Schema Validation of a Decimal Number in a Panda Dataframe
The following Python script must validate the number of decimal places in the records. In the schema, I am trying to define that it has 3 decimal places, using "multipleOf": 0.001.
I have a ...
0
votes
0
answers
527
views
Ajv Schema validator fails to show source of compile error/warning
I have a composite json schema and I am switching over to using Ajv and have been slogging through cleaning up strict warnings. I am down to my last few but I cannot figure out the source of the ...
0
votes
1
answer
374
views
Json schema validation using Rest assured. not able perform
public class Response_SchemaValidation
{
public static void main(String [] args) throws FileNotFoundException
{
System.out.println("This is testing...");
...
1
vote
1
answer
77
views
JSON schema validation for number types in MarkLogic
I am using xdmp:json-validate-node function to validate json document before inserting it to MarkLogic. but seems json schema validation does not raise error when number typed field has NaN value. I ...
3
votes
1
answer
2k
views
Getting error as `schema with key or id "https://json-schema.org/draft/2020-12/schema" already exists when performing schema Validation using ajv?
I am working on a project using Nextjs, Reactjs and TypeScript. I have integrated Monaco editor in the website and want to validate the user provided JSON code against the draft 2020-12. I am using ...
1
vote
2
answers
261
views
Need to know the difference between contains and items keyword of json schema validation
i am using jsonschema validation library of python to perform the schema validation below are the code snippet used along with the schema version and sample json data. my question is when i am using ...
0
votes
1
answer
32
views
JSON SCHEMA Nested Array Fields Validation based on Root level Field
Following is my JSON Schema , My requirement is if MID = specificValue1 then "Investigation Request Conf Reason code" this field should be mandatory I have also added my reference Input JSON ...
0
votes
1
answer
405
views
Java - JSON schema validation does NOT fail when array elements do not follow pattern
I am trying to validate JSON strings in Java 17.
Currently I am using: com.fasterxml.jackson.core and com.networknt:json-schema-validator
The problem is that when I enter elements in the array that ...
1
vote
1
answer
150
views
JSON Schema Validator passes despite issues
my goal is to create a schema containing any number array of items where each individual item has "key" string property based on which the "data" property schema changes.
Below is ...
-2
votes
1
answer
336
views
Need Detailed Error in json schema validation Python
I have below json schema, i want to use python's library to validate the input json against given schema, it's using draft-08 version i.e., 2019-09. so i tried using below code for the same but it ...
0
votes
1
answer
164
views
How to restrict json schema to not support a particular data type
I want to restrict my application to only support "string" type values for json configuration.
Json schema by default supports a set of datatypes such as integer, boolean, etc however, the ...
0
votes
0
answers
116
views
Serialization and validation of multiple C# attributes (built-in and Custom) in JSON schema
I required a help on JSON schema and JSON validation where We have a requirement to have multiple attributes (built-in and custom) for a property in C# and then serialize them into JSON schema.
I am ...
1
vote
1
answer
556
views
Minimum value based off another value - JSON schema
I'm wanting to set a minimum amount on one field based off another field.
For example if I have a quoteAmountLower and quoteAmountUpper - I want quoteAmountUpper to be greater than quoteAmountLower.
...
0
votes
1
answer
143
views
JSON schema to check if only one of the array items contains a property
Is there a way to check whether a property is present in the array, but only in one of the items?
In the following example, the "filename" and "format" must be present at least in ...
1
vote
1
answer
735
views
Recursive items in JSON schema
I'm designing a JSON schema with a recursive element. This element is not at the root, but in a subschema:
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
&...
0
votes
0
answers
93
views
How to use jsonschema library via source code without pip install
I want to use the jsonschema library. I need to use validate function to validate the JSON schema but I can't install the library using pip command due to some restrictions on the server. How can I ...
0
votes
1
answer
117
views
Jsonschema validate if the list contains one of the three strings
I have a json like this: {"mylist": ["a", "b", "c", "d", additional_element]}
additional_element could be one of the following four strings - "w&...
0
votes
1
answer
49
views
Check if array has an odd amount of items using JSON Schema
Is it possible to check if an array of strings has an odd amount of items using JSON Schema?
This would be valid:
{
list: [
'one',
'two',
'three'
]
}
This would be valid as ...