Questions tagged [jsonschema]

A JSON Schema is a JSON document (an object) which defines constraints on what other JSON documents (the instances) should obey; it can also be used to interpret instances so as to provide links to external resources (hyper schema).

JSON (JavaScript Object Notation) Schema defines the media type application/schema+json, a JSON based format for defining the structure of JSON data.

JSON Schema provides a contract for what JSON data is required for a given application and how to interact with it. JSON Schema is intended to define validation, documentation, hyperlink navigation, and interaction control of JSON data.

References:

For the latest Internet Draft documents, see the specification section of the website.

3348 questions
7
votes
1 answer

How can I create a section of fields with angular2 json schema form?

I'm using https://github.com/dschnelldavis/angular2-json-schema-form and my form HTML is: My schema is: this.schema = { type: "object", properties:…
Shamoon
  • 41,293
  • 91
  • 306
  • 570
7
votes
1 answer

How do I make a jsonschema so that it validates all objects in array?

I'm trying to validate a JSON input using json-schema but it does not work like I need it to. I have the following input JSON (part of it): [ { "admin_state": "disabled" }, { "state": "disabled" } ] And the following json-schema…
calvinvinz
  • 73
  • 3
7
votes
3 answers

How to use react-jsonschema-form with material-ui?

I am doing a form using react-jsonschema-form, but i really want to customize my application (including the form) with the Material-UI. I am having trouble to use both together because react-jsonchema-form uses a uiSchema for styling and the…
Lucio Zenir
  • 365
  • 2
  • 8
  • 18
7
votes
1 answer

Use object property keys as enum in JSON schema

I'm trying to validate a JSON file using JSON Schema, in order to find cases of "broken references". Essentially my file consists of items and groups, with each item belonging to a single group referenced by the groups property key, like so: { …
Simon
  • 3,667
  • 1
  • 35
  • 49
7
votes
2 answers

JSONSchema validation failure with $ref (Draft v3)

I have created a JSON schema following the draft v3 specifications. Schema looks like this: { "$schema": "http://json-schema.org/draft-03/schema#", "additionalProperties": false, "type": "object", "properties": { "ExecutionPlanList": { …
YetAnother
  • 1,045
  • 1
  • 9
  • 27
7
votes
3 answers

Fully expanding $ref references in a json schema with Python

We have a fairly large and complex json schema with many includes via $ref references. Ideally using Python and jsonschema I'd like to take those schema and fully expand the references (recursively) to get the full schema. Output in the form of a…
fuzzyman
  • 8,271
  • 2
  • 30
  • 32
7
votes
2 answers

JSONSchema and validating sub-object properties

Given this JSON object: { "objects": { "foo": { "id": 1, "name": "Foo" }, "bar": { "id": 2, "name": "Bar" } } } This is an object containing sub objects where…
mgldev
  • 101
  • 1
  • 4
7
votes
1 answer

Customize JsonSchemaValidation Error Messages

I am using a Json Schema to validate a json Object. I am getting the error messages correctly. But it looks more of a developer friendly error message. Is there any way to customize the error message so that I can make it more user friendly. I have…
Midhun Mathew
  • 2,147
  • 8
  • 28
  • 45
7
votes
1 answer

How to convert JSON schema to mongoose schema

Is there a way to take valid JSON schema like the one below and turn it into mongoose schema? { "$schema": "http://json-schema.org/draft-04/schema#", "description": "some desc", "title": "Product", "type": "object", "properties": { …
veich
  • 501
  • 1
  • 6
  • 15
7
votes
1 answer

How to reference json schema definition from another schema

I have a json schema representing a geometry as a Point or a MultiPoint. Each is defined within the schema in "definitions": { "$schema": "http://json-schema.org/draft-04/schema#", "id": "http://schema.my-site.org/geometry.json#", …
MojioMS
  • 1,583
  • 4
  • 17
  • 42
7
votes
1 answer

Json schema to validate object's values against content of another object

I'm trying to create json schema for a document where field values in some object should validate against a enum defined in another object in the same document. More specifically, in the example below, I'd like to be able to define "properties" with…
Mikhail
  • 844
  • 8
  • 18
7
votes
0 answers

IntelliJ 2016.2 - JSON Schema Validation

I have configured intelliJ for JSON Schema. https://www.jetbrains.com/help/idea/2016.2/json-schema.html such that my valid JSON schema should check JSON against it - however if I write invalid json (syntactically correct, not semantically against…
Kurt Maile
  • 1,171
  • 3
  • 13
  • 29
7
votes
1 answer

How to use references in JustinRainbow JsonValidator

Can someone tell me how to make the JustinRainbow Json schema validator be able to find references. This is the schema of foobar I'm trying to validate: { "title": "foobar schema", "type": "object", "properties": { "pagination": { …
Danack
  • 24,939
  • 16
  • 90
  • 122
7
votes
1 answer

How to validate empty array of strings with ajv?

I make json validation with ajv. I need to validate array of strings. I know which elements can be placed there so I make appropriate 'enum'. But in some case enum can be empty and array can be empty too. Here is simple test: var schema = { …
NtsDK
  • 951
  • 1
  • 9
  • 19
7
votes
1 answer

JSON Schema for tree structure

I have to build tree like structure of Json data.Each node has an id (an integer, required), a label (a string, optional), and an array of child nodes (optional). Can you help me how to write JSON schema for this Json data. I need to set Id as…
Ganesh Inbarajan
  • 71
  • 1
  • 1
  • 4