jsonform / jsonform

Build forms from JSON Schema. Easily template-able. Compatible with Bootstrap 3 out of the box.
https://jsonform.github.io/jsonform/playground/index.html
MIT License
2.72k stars 553 forks source link

Rendering fails if property name contains dots #439

Closed chaehni closed 4 months ago

chaehni commented 6 months ago

I'm trying to render a JSON schema which contains properties that contain a dot. Rendering fails with the following error message:

Entered content is not yet a valid JSON Form object.

The JSON Form library returned: Error: The JSONForm object references the schema key "name.with.dot" but that key does not exist in the JSON schema

According to JSON schema specification, my schema is valid and should be rendered correctly.

A minimal example is this schema:

{ "schema": { "name.with.dot": { "title": "Name", "description": "Nickname allowed", "type": "string" } } }

sdetweil commented 6 months ago

we do not support the use of '.' in the keyname field , as we use this value to differentiate nesting levels.

I just updated the documentation to indicate this restriction

The schema property is required. It describes the structured data model that must be created when the form is submitted. It is a JSON object that follows the [properties](http://tools.ietf.org/html/draft-zyp-json-schema-04#section-5.2) definition of the JSON Schema specification. JSON Schema lets you describe the data structure that you'd like to generate from the form as well as constraints on possible values, such as the maximum number of characters that a string may contain. Check [Using JSON Schema to describe your data model](https://github.com/jsonform/jsonform/wiki#schema) below for more info.

note: the '.' (dot) character is not allowed in schema element names, as JSONFORM uses this character to denote nesting, like Javascript.