json-schema-remove-readonly-from-data
v1.0.0
Published
[![NPM License](https://img.shields.io/npm/l/json-schema-remove-readonly-from-data)](https://www.npmjs.com/package/json-schema-remove-readonly-from-data) [![NPM Version](https://img.shields.io/npm/v/json-schema-remove-readonly-from-data)](https://www.npmj
Downloads
38
Maintainers
Readme
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"
}