{"id":13554243,"url":"https://github.com/brutusin/json-forms","last_synced_at":"2025-04-13T00:47:33.684Z","repository":{"id":57741742,"uuid":"43070991","full_name":"brutusin/json-forms","owner":"brutusin","description":"JSON Schema to HTML form generator, supporting dynamic subschemas (on the fly resolution). Extensible and customizable library with zero dependencies. Bootstrap add-ons provided ","archived":false,"fork":false,"pushed_at":"2023-07-15T12:43:31.000Z","size":1140,"stargazers_count":617,"open_issues_count":63,"forks_count":169,"subscribers_count":44,"default_branch":"master","last_synced_at":"2025-04-13T00:47:27.253Z","etag":null,"topics":["form","html","json","json-form","json-schema"],"latest_commit_sha":null,"homepage":"http://brutusin.org/json-forms","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/brutusin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2015-09-24T14:13:28.000Z","updated_at":"2025-03-19T18:50:24.000Z","dependencies_parsed_at":"2024-01-07T18:57:13.742Z","dependency_job_id":null,"html_url":"https://github.com/brutusin/json-forms","commit_stats":null,"previous_names":[],"tags_count":28,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brutusin%2Fjson-forms","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brutusin%2Fjson-forms/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brutusin%2Fjson-forms/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brutusin%2Fjson-forms/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/brutusin","download_url":"https://codeload.github.com/brutusin/json-forms/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248650434,"owners_count":21139672,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["form","html","json","json-form","json-schema"],"created_at":"2024-08-01T12:02:43.018Z","updated_at":"2025-04-13T00:47:33.662Z","avatar_url":"https://github.com/brutusin.png","language":"JavaScript","readme":"# json-forms\r\n[![bower version](https://img.shields.io/bower/v/json-forms.svg?style=flat-square)](#bower)\r\n[![Build Status](https://api.travis-ci.org/brutusin/json-forms.svg?branch=master)](https://travis-ci.org/brutusin/json-forms)\r\n\r\n`org.brutusin:json-forms` is a javascript library that generates HTML forms from [JSON Schemas](http://json-schema.org).\r\n\r\n## Status\r\n\u003e I am currently not having time to maintain this project, so first of all my apologies if some issues have been unresponded.\r\nBranch v2 contains a completely new rearchitecture of the project, that I started several months ago but left unfinished. If someone is interested in continuing my work I will be happy to guide them\r\n\r\n---\r\n**Table of Contents:** \r\n\r\n- [org.brutusin:json-forms](#)\r\n  - [Features](#features)\r\n  - [Usage](#usage)\r\n  - [Demo](#demo)\r\n  - [Dynamic schemas](#dynamic-schemas)\r\n  - [API](#api)\r\n  - [CDN](#cdn)\r\n  - [Support, bugs and requests](#support-bugs-and-requests)\r\n  - [Authors](#authors)\r\n  - [License](#license)\r\n\r\n## Features\r\n* Dynamic schemas support\r\n* Extensible and customizable\r\n* No external libraries needed\r\n* Validation\r\n* Multiple forms per document supported\r\n\r\n## Usage\r\nInclude the main library dependencies:\r\n```html\r\n\u003clink rel=\"stylesheet\" href='dist/css/brutusin-json-forms.min.css'/\u003e\r\n\u003cscript src=\"dist/js/brutusin-json-forms.min.js\"\u003e\u003c/script\u003e\r\n```\r\nOptionally, include the bootstrap extension (requires bootstrap):\r\n```html\r\n\u003cscript src=\"dist/js/brutusin-json-forms-bootstrap.min.js\"\u003e\u003c/script\u003e\r\n```\r\nCreate the javascript `BrutusinForms` instance, `schema` being a javascript `object` representing the schema structure:\r\n```javascript\r\nvar schema = {\"type\": \"boolean\"}\r\nvar BrutusinForms = brutusin[\"json-forms\"];\r\nvar bf = BrutusinForms.create(schema);\r\n```\r\nAnd finally render the form inside a container with optional preloaded JSON initial data, `data`:\r\n```javascript\r\nvar container = document.getElementById('container');\r\nbf.render(container, data);\r\n```\r\n\r\n## Demo\r\n[![demo](http://brutusin.org/json-forms/img/json-forms.png)](http://brutusin.org/json-forms/)\r\nhttp://brutusin.org/json-forms/\r\n\r\n## Dynamic schemas\r\nThis library supports dynamic schemas, that is, subschemas that can change depending on the value of other parts of the data.\r\n\r\nThis lets creating **dynamic forms** that vary their shape depending on the values entered by the user. This is extremely useful for big autogenerated schemas, that aggregates lots of subschemas and have functional bindings, given that it allows to show the user a simpler, non-error-prone form, also avoiding asking for unneeded data.\r\n\r\nDynamic schemas are built upon two main blocks: \r\n* Custom (non-standard) schema property called `dependsOn`, to build the subschemas dependency graph \r\n* [Brutusin DSL for path expressions](https://github.com/brutusin/json#path-expressions), for identifying subschemas.\r\n\r\n### `dependsOn` schema extension\r\n### Dynamic schema resolution\r\n\r\n## API\r\n### Static members:\r\n\r\nMember|Description\r\n------| -------\r\n`BrutusinForms.create(schema)`|BrutusinForms factory method\r\n`BrutusinForms.addDecorator(f(htmlElement, schema))`| Register a callback function to be notified after an HTML element has been rendered (passed as parameter). See [brutusin-json-forms-bootstrap.js](src/js/brutusin-json-forms-bootstrap.js) for an example of *bootstrap* decorator.\r\n`BrutusinForms.postRender(instance)`|Callback function to be notified after a BrutusinForms instance has been rendered (passed as parameter)\r\n`BrutusinForms.instances`|Array containing all the BrutusinForms instances created in the document by the factory method.\r\n\r\n### Instance members:\r\n\r\nMember|Description\r\n------| -------\r\n`bf.render(container, data)`| Renders the form inside the the container, with the specified data preloaded\r\n`bf.validate()`| Returns `true` if the input data entered by the user passes validation\r\n`bf.getData()`| Returns the javascript object with the data entered by the user\r\n`bf.schemaResolver(schemaIdArray, data)`| Schema resolver for [dynamic schemas](#dynamic-schemas)\r\n\r\n## CDN\r\n\r\nhttp://www.jsdelivr.com/projects/brutusin.json-forms\r\n\r\n## Support bugs and requests\r\nhttps://github.com/brutusin/json-forms/issues\r\n\r\n## Authors\r\n\r\n- Ignacio del Valle Alles (\u003chttps://github.com/idelvall/\u003e)\r\n\r\nContributions are always welcome and greatly appreciated!\r\n\r\n## License\r\nApache License, Version 2.0\r\n","funding_links":[],"categories":["JavaScript","json","Tools"],"sub_categories":["WebTools"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrutusin%2Fjson-forms","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrutusin%2Fjson-forms","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrutusin%2Fjson-forms/lists"}