1.0.0 • Published 7 months ago

json-schema-remove-readonly-from-data v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

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: