eclipsesource / eclipsesource/jsonforms

Support Bundling json schema

Open
#2,334 1 comment 1 reaction 0 assignees View on GitHub
core feature
Dominant language
TypeScript
Stars
2.7k
Forks
424
Avg merge
17d 8h
Merged PRs (30d)
1

Description

### Is your feature request related to a problem? Please describe.

Hello,

I have an endpoint returning a "compound document schema" so a bundling of many schemas and I would like to render the related form accordingly.

References:
1. https://json-schema.org/understanding-json-schema/structuring#bundling
2. https://json-schema.org/blog/posts/bundling-json-schema-compound-documents

JsonSchema Example (from links above):
`{
"$id": "https://example.com/schemas/customer",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"first_name": { "type": "string" },
"last_name": { "type": "string" },
"shipping_address": { "$ref": "/schemas/address" },
"billing_address": { "$ref": "/schemas/address" }
},
"required": ["first_name", "last_name", "shipping_address", "billing_address"],
"$defs": {
"address": {
"$id": "/schemas/address",
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"street_address": { "type": "string" },
"city": { "type": "string" },
"state": { "$ref": "#/definitions/state" }
},
"required": ["street_address", "city", "state"],
"definitions": {
"state": { "enum": ["CA", "NY", "... etc ..."] }
}
}
}
}
`

Data:
`
{
"first_name": "FirstName",
"last_name": "LastName",
"shipping_address": {
"street_address": "StreetAddress",
"city": "City",
"state": "NY"
},
"billing_address": {
"street_address": "StreetAddress2",
"city": "City2",
"state": "CA"
}
}
`

Currently, only "first_name" and "last_name" are displayed. Instead, "shipping_address" and "shipping_address" are not shown at all.

### Describe the solution you'd like

I would like that JsonForm works properly and render the form according to the given json schema and data

### Describe alternatives you've considered

I have tried to use _json-refs_ and _json-schema-ref-parser_ as preprocessing the schema but it is already fine.

### Framework

Vue

### RendererSet

Vanilla

### Additional context

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.