json-schema-remove-readonly-from-data
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

NPM License NPM Version Last Commit

json-schema-remove-readonly-from-data

Removes readOnly fields from data as defined by a json-schema. Often needed before sending Data to the Server.

Uses information from a JSON-Schema to process the data.

    >>> SCHEMA = { 'type': 'object',
    ...            'properties': {
    ...                'ro': {'type': 'string', 'readOnly': True},
    ...                'rw': {'type': 'boolean'}}}
    >>> removeReadonly(SCHEMA, {rw: 'TST10001', ro: true})
    {
      "rw": "TST10001"
    }

See also:

Package Sidebar

Install

npm i json-schema-remove-readonly-from-data

Weekly Downloads

1

Version

1.0.0

License

MIT

Unpacked Size

16.1 kB

Total Files

14

Last publish

Collaborators

  • mdornseif