Skip to main content
Filter by
Sorted by
Tagged with
5 votes
7 answers
1k views

I have a large JSON that I do not want to load into memory. I would like to validate it against a JSON schema in a streaming fashion. All libraries I could find so far, only validate completely loaded ...
Anton Daneyko's user avatar
0 votes
1 answer
37 views

I have some jsonschema for a dictionary Resource, containing a $defs PartialResource. { "title": "resource", "type": "object", "allOf": [ ...
Eva Lott's user avatar
1 vote
1 answer
63 views

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&...
clove682's user avatar
0 votes
1 answer
359 views

I am trying to create a custom jsonschema keyword for some basic evaluation. An example would be "parallelArrays" where the provided lists would be checked to make sure they are the same ...
Sahil Patel's user avatar
0 votes
1 answer
60 views

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 ...
Joao Pedro P.P's user avatar
1 vote
2 answers
261 views

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 ...
MykG's user avatar
  • 143
1 vote
1 answer
714 views

I have a pydantic model that has fields with dependent allowable values which I would like to be properly represented in the JSON Schema. Think of this as a category / subcategory relationship like: ...
dino's user avatar
  • 3,336
0 votes
1 answer
73 views

I have one top-level schema content.json { "title": "Program content schema", "$id": "https://example.com/schemas/program", "type": "...
harsh's user avatar
  • 979
3 votes
2 answers
3k views

I've been trying to move some python code I've written into AWS Lambda. It's a CSV validator that uses the 'pycsvschema' library, and works perfectly on my local PC. I had to do some finicking with ...
Carmen Navarro's user avatar
1 vote
1 answer
440 views

I'm trying to implement JSON validation using Python jsonschema library. I want to have at least one of the three properties to be required in my JSON. I'm using anyOf subschema to achieve that. This ...
matetam's user avatar
  • 145
0 votes
2 answers
1k views

I have two JSON schemas - publisher and article, such that there could be multiple articles in a single publisher. This is the article schema (in a.json): { "$schema": "https://json-...
Shod's user avatar
  • 955
2 votes
2 answers
697 views

I try to validate JSON in python using jsonschema library. What I want to achieve is a dictionary with keys conststing of json keys causing trouble and messages from validator as values. There is no ...
MrHutnik's user avatar
  • 132
0 votes
1 answer
375 views

I have a schema where a property should comply to a pattern that only can be checked programmatically: type: object properties: unit: description: Unit of this column. Must be FITS conform. ...
olebole's user avatar
  • 593
3 votes
0 answers
235 views

I'm trying to use jsonschema for a schema which uses "pattern". However in this application, the "pattern" needs to be able to match unicode characters, which is not support by ...
user1751825's user avatar
  • 4,337
0 votes
2 answers
3k views

How do I generate a JSON schema in Python for the below JSON and validate every json against the schema? Requirements: There is a type which can be CSV or JSON or JSON There is a list of properties. ...
Harish's user avatar
  • 613
0 votes
1 answer
790 views

Root Schema: { "$schema": "https://json-schema.org/draft/2020-12/schema", "properties": { "deviceId": { "description": &...
Daemon's user avatar
  • 1,675
7 votes
1 answer
8k views

As far as I understand Pydantic and Json Schemas provide similar functionality - both can be used for validating data outputs. I am interested to understand the pros and cons of using each one. A few ...
David Butler's user avatar
0 votes
2 answers
151 views

I want to describe a network graph of vertices and edges with JSON Schema. An example JSON could look like this: { "V": [ "1", "2", "3" ], &...
jonas-l-b's user avatar
  • 291
0 votes
1 answer
196 views

I am a big fan of python jsonshema. I recently found the if/then/else options which I really like. However, I have a huge problem with it. Let's say I have: { "required": ["PROP1&...
Greg7000's user avatar
  • 435
1 vote
1 answer
1k views

I am trying to reference all nested properties as string regardless of name. An example of the data looks like this (except with a bunch of columns): [ { "var_1": "...
alexb523's user avatar
  • 748
1 vote
2 answers
2k views

A simple example: import json from jsonschema import validate schema = { "type" : "object", "properties" : { "description" : {"type" :...
JoyfulPanda's user avatar
  • 1,077
0 votes
1 answer
507 views

So I am working on this problem where I have to validate the json schema based on some conditions. If xy-ac is in the schema then I want source to be present there as well. It is required. Currenlty, ...
GlobeTrotter's user avatar
1 vote
0 answers
406 views

Im trying to find a way to validate flattened json-keys. For example, lets say I have a schema defined as below: { "$schema":"http://json-schema.org/draft-04/schema#", "...
V1666's user avatar
  • 225
1 vote
1 answer
49 views

I am trying to read a table from the Central Statistics Office for Ireland. I am reading it into a collection and successfully displaying the first dataset dataset = collection.dataset(0) print(...
David Graham's user avatar
0 votes
0 answers
835 views

I'm trying to create a pydantic model of a json schema I'm using with oneOf. The basic schema is as follows: { "$schema": "https://json-schema.org/draft/2019-09/schema", &...
Cole's user avatar
  • 116
0 votes
2 answers
1k views

I'm looking for help in defining the JSON schema which would validate the below sample JSON. I don't know the country codes before hand, so they can be any country code actually. In other words, I ...
museshad's user avatar
  • 498
3 votes
2 answers
925 views

I try to make a validator that would set defaults from a JSON schema during validation. I found this question: Trying to make JSON Schema validator in Python to set default values and adjusted it a ...
hidden's user avatar
  • 202
0 votes
1 answer
1k views

I have this primary schema for each one of my data points: data_schema = { "type": "object", "properties": { "name": {"type": "string"}, ...
KZiovas's user avatar
  • 5,029
0 votes
1 answer
882 views

I want to log a warning when a deprecated property is being used or when the value of that property is in a deprecated format. I'm using the deprecated annotation for that but it doesn't do anything. ...
Felipe Hsu's user avatar
2 votes
2 answers
3k views

I'm writing a unit test whereby I want to assert that the error I get: <ValidationError: "'a list' is not of type 'array'"> is equal too assert ValidationError(message="'a list' ...
Blue Moon's user avatar
  • 4,791
2 votes
1 answer
903 views

I would like to create a JSON schema that defines two entities: region and country. The JSON schema for country is as follows: { "$id":"https://example.com/arrays.schema.json", ...
jwa's user avatar
  • 3,307
0 votes
0 answers
1k views

So we're using pydantic and python-jsonschema to validate user input. Pydantic for internal validation, and python-jsonschema for validation on the portal. And I've come across an interesting issue, ...
thevoiddancer's user avatar
0 votes
1 answer
695 views

I have a json that uses object of objects in place of an array, to easily search through the data with json keys. How can I validate this against a schema, without hardcoding the key into the schema ? ...
Vipin Joshi's user avatar
0 votes
1 answer
2k views

Is it possible to get a list of all additionalProperties found by json-schema ? For example, if my schema looks like this : { "type": "object", "properties": { &...
Vipin Joshi's user avatar
1 vote
0 answers
1k views

I am developing a system where we create documents that are created from json-files. The json files are described by a json schema of the following kind, where a key either could have a static default ...
NiklasR's user avatar
  • 523
0 votes
1 answer
1k views

I am trying to validate all rows in my JSON data file against the schema without looping through each data entry in the JSON file. However when just passing in the entire JSON file no validation ...
PonderingPanda's user avatar
1 vote
2 answers
3k views

I am trying to get proper validation error from oneof or anyof pattern. I have json schema with two or more oneof/anyof condition as mentioned below: json_schema = { "type": "...
Simon Mathai's user avatar
0 votes
1 answer
710 views

I'm using json-schema to validate a schema. I wanted to customize the date-time type. So, redefined the type accordingly and extended the validator. But, it's not returning the error the way I'm ...
Farshid's user avatar
  • 604
2 votes
1 answer
1k views

I have a list of dictionaries like this: list_of_dictionaries = [{'key1': True}, {'key2': 0.2}] And I want to validate it using jsonschema package. I created a schema like this: schema = { "...
Claudio Ciccarone's user avatar
6 votes
0 answers
2k views

I am trying to generate a new class in Python starting from a JSON Schema previously defined and created. Then I would like to use the autogenerated class to read a JSON file. My problem is that I ...
Zaba96's user avatar
  • 61
3 votes
1 answer
2k views

Are there any python libraries or tools that check if a JSON schema is valid? I do not want to validate an instance against a JSON schema, but I would like to check if the JSON schema itself is valid ...
M.M's user avatar
  • 620
0 votes
1 answer
357 views

I am writing a JSON schema validation. I have an ID field whose values are imported from a table in SQL Server. These values are large and are frequently updated, so is there a way to dynamically ...
Arcanesaw's user avatar
4 votes
1 answer
2k views

I am trying to learn json schema, but something isn't working out for me. I'm trying to run the example from http://json-schema.org/understanding-json-schema/reference/conditionals.html#id4 for ...
SaBe's user avatar
  • 43
1 vote
1 answer
3k views

I am trying to define a valid JSON Schema and I am not sure how to structure the reference ("$ref") values when referenced components are in sub-directories. I have read (at length) the ...
Eric Broda's user avatar
  • 7,351
1 vote
0 answers
169 views

I scraped a website and I get all the data from it and I want store it in json file so I could use it as an API the problem is that when it tries to write maps in JSON file it get duplicated because ...
ABD JALIL Danane's user avatar
6 votes
1 answer
2k views

I'm trying to validate my complex json schema definition file to be sure that there is no typo in the schema. I use the jsonschema script provided by python jsonschema library. I use meta-schema files ...
eNca's user avatar
  • 1,343
2 votes
0 answers
414 views

I have been trying so hard to figure out how to get a schema that is nested in a definition with a $ref. If I hard code the jsonschema object I have no problems whatsoever, however I need to use a ...
Gabriel Clark's user avatar
0 votes
1 answer
747 views

The form is rendering properly if I give ID as a static value in forms.py, it wont render properly when I use the ID that I got from form call views.py def assetAddJsonView(request,pk): form = ...
siddik bharath's user avatar
1 vote
1 answer
712 views

I am trying to validate a JSON schema using jsonschema lib. scenario: I need to make sure if a specific value in a property is sent in the parent object, the child(sub-schema) should also get the same ...
Murtaza's user avatar
  • 53
1 vote
1 answer
575 views

I have a JSON object like this. { "test": bla bla bla } This test can be a number between 0 and 120 or an empty string. I want to validate this JSON object using a JSON schema like this. {...
Hirusha Fernando's user avatar