Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Bundling json schema #2334

Open
roy20021 opened this issue May 8, 2024 · 1 comment
Open

Support Bundling json schema #2334

roy20021 opened this issue May 8, 2024 · 1 comment
Milestone

Comments

@roy20021
Copy link

roy20021 commented May 8, 2024

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

@sdirix
Copy link
Member

sdirix commented May 8, 2024

Hi @roy20021,

Thanks for the suggestion. Currently we don't support compound document schemas. I will add this request to "next". However we will not work on this feature in the foreseeable future except it's requested via sponsored development. If you, or someone else, is willing to contribute support for compound schemas then we are definitely interested. In that case I would like to suggest to build a small POC to evaluate the impact on the code base before diving into the full implementation,

@sdirix sdirix added this to the next milestone May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants