# ut-form-jsonschema

> ## Usage

Latest version **7.1.7** (published 2022-06-27) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install ut-form-jsonschema
pnpm add ut-form-jsonschema
yarn add ut-form-jsonschema
bun add ut-form-jsonschema
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 7.1.7 |
| Published | 2022-06-27 |
| First published | 2019-07-25 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 768.7 KB |
| Known vulnerabilities | 0 (+2 in 2 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | kalin.krustev |

## Links

- npm: https://www.npmjs.com/package/ut-form-jsonschema
- Repository: https://github.com/softwaregroup-bg/ut-form-jsonschema
- Homepage: https://github.com/softwaregroup-bg/ut-form-jsonschema#readme
- Issues: https://github.com/softwaregroup-bg/ut-form-jsonschema/issues
- npm.io page: https://npm.io/package/ut-form-jsonschema

## Dependencies (3)

- [uuid](https://npm.io/package/uuid.md) 8.3.2
- [@hapi/hapi](https://npm.io/package/@hapi/hapi.md) 20.2.1
- [@hapi/inert](https://npm.io/package/@hapi/inert.md) 6.0.5

## Recent versions

- 7.1.7 (latest) — 2022-06-27
- 7.1.6 — 2020-10-28
- 7.1.5 — 2020-01-17
- 7.1.4 — 2019-10-24
- 7.1.3 — 2019-09-05
- 7.1.2 — 2019-07-25

## README

# ut-form-jsonschema

## Usage

* Method `edit(options)`

  ```js
  const {edit} = return require('ut-form-jsonschema');
  ```

  Where `options` is object with the following properties:
  * `schema` - JSON schema passed to [react-jsonschema-form](https://www.npmjs.com/package/react-jsonschema-form)
  * `uiSchema` - UI schema passed to [react-jsonschema-form](https://www.npmjs.com/package/react-jsonschema-form)
  * `formData` - form data passed to [react-jsonschema-form](https://www.npmjs.com/package/react-jsonschema-form)
  * `buttons` - array of `MaterialUI <Button>` configuration properties
  * `handler` - function, that handles custom API calls
  * `submit` - function, that handles form submit
  * `server` - configuration object for Hapi server, can have properties
    `host`, `port` and `address`
  * `id` - unique identifier of the form / api, uuid.v4 will be used if left empty
  * `autoStop` - pass `false` to avoid autostopping http server after all forms
    have been handled
  * `log` - logger

## Example

```js
async function login() {
    const {url, id} = await edit({server: {host: 'localhost'}});
    console.log('Login at', url.href);
    const {user, password} = await edit({
        id,
        schema: {
            title: 'Login',
            type: 'object',
            properties: {
                user: {
                    type: 'string',
                    title: 'User name'
                },
                password: {
                    type: 'string',
                    title: 'Password'
                }
            },
            required: ['user', 'password']
        },
        uiSchema: {
            password: {
                'ui:widget': 'password'
            }
        }
    });
    console.log(user, password);
}

login();
```

---
_Source: https://npm.io/package/ut-form-jsonschema · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
