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
1
vote
0 answers

Cleaning object with JSON schema

with JSON schema I can validate object, but can I do clean it? For example I have schema const s = { "type": "object", "properties": { "p1": {"type": "string"} } } And Object const o = {p1: 345, p_not_is_schema: '3333'}, then I…
Maksim Zarechnyi
  • 407
  • 3
  • 16
1
vote
1 answer

json schema maximize value based on other property

I have a draft7 schema. Two required properties are totalSizeOfFarm and totalAreaGrass, both are type number and have exclusiveMinimum of 0. I want the maximum of totalAreaGrass not to exceed the value of totalSizeOfFarm. Can this be done? I've been…
Paul Meems
  • 3,002
  • 4
  • 35
  • 66
1
vote
2 answers

Pick any element from JSON schema while streaming data to parse

I'm writing a de-serializer which reads a huge json file and puts records matching a filter (logic in my application) into database. The json file has a fixed schema as follows: { "cityDetails": { "name": "String", "pinCodes":…
1
vote
0 answers

How do I validate multiple schema using Json.net?

I have following scenario of incoming messages from different devices to processing unit which shall process the messages based on message type. Messages with following Schema definition for hobbies, say schema-hobbies JSchema hobbiesSchema =…
kudlatiger
  • 3,028
  • 8
  • 48
  • 98
1
vote
2 answers

jsonschema Draft 0.7 required properties in nested object depending on a value

I have a json file with nested objects. { "apiVersion":"0.0.9b", "apiDate":"18.01.19", "general":{ "documentType": "invoice", "references":{ "invoiceId":"123", "invoiceDate":"01.01.1970", …
Franzi
  • 21
  • 6
1
vote
1 answer

AJV Multilevel/Nested JSON schema validation

Using the schema { "type": "object", "required": [ "person", "animal" ], "person": { "title": "person", "type": "object", "required": [ "name" ], "properties": { "name": { …
tkalis
  • 557
  • 1
  • 5
  • 5
1
vote
0 answers

JSON schema definitions validation for internal reference

I am creating thousands of definitions and making it available on remote so that any one can reuse the defined schema by referring remote ref. at the time of definition creation i want something which can check the $ref and throw error if it is not…
eagle
  • 312
  • 1
  • 13
1
vote
1 answer

Getting "Please add error message" while validating form element in angular schema form

I'm currently using angular-schema-form (https://github.com/json-schema-form/angular-schema-form) to generate forms based on json schema. The form generates as expected but while validating it gives me an error "Please add error message for tv4-xxx"…
1
vote
1 answer

Botframework v4: Can't render cards

This is the sample on Botframework v4 docs. But it does not work. It says "Can't Render Card" on the Microsoft bot emulator. What i'm trying to do is a carouselCard but this simple card from Microsoft's sample is already not working. { …
user10860402
  • 912
  • 1
  • 10
  • 34
1
vote
0 answers

Json array not serializing properly

I am trying to Json serialize and deserialize LocalDate array in my Java class but when i generate json schema for the web service, the parameter still shows up as LocalDate rather than String. Following is the code : @JsonSerialize( …
Lokesh
  • 7,810
  • 6
  • 48
  • 78
1
vote
1 answer

jsonschema validate by keys with different name or type

I am a in a transition from this type of jsons: { "id": 1, "data": { "item_number": "4", ... } } to { "id": 1, "data": { "itemNumbers": [4], ... } } and I would need a jsonschema that…
Amir
  • 5,996
  • 13
  • 48
  • 61
1
vote
1 answer

How to "lock" a field value based on default value in a react Json Schema form?

We have a json schema that includes a field, for which we want to control the value via the schema (rather than having the user specify the value). We can set a default value - but this is simply overwritten by the formData that the user parses. Is…
Martin
  • 149
  • 3
  • 12
1
vote
1 answer

Expressjs Sync/Asynchronous Middleware Issues -- How to fix?

I have an Expressjs route which does a db INSERT (using Sequelize) based on some JSON Body params in the request. The bodyParser middleware does a JSON-schema validation on the body and returns an error if it doesn't validate. The issue here is that…
Drew
  • 15
  • 3
1
vote
2 answers

jsonschema not throwing error on missing required property

I have the following schema: const LIST_EVENTS = { "id": "/listEvents", "type": "object", "properties": { "filter": { "$ref": "/MarketFilter", "required": true }, "locale": { …
wmash
  • 4,032
  • 3
  • 31
  • 69
1
vote
1 answer

How to write a function that loops thru deeply nested json schema form object?

I'm working with json schema form objects, and we have very deeply nested ones. In order to add new features, sometimes we need to 'do the same thing' to every child object that matches certain criteria. The root object is like …
hansel ke
  • 21
  • 5
1 2 3
99
100