compile-json-stringify
compile-json-stringify copied to clipboard
[Feature Request]: Default option?
Hi @nwoltman
Thanks for such a nice tool.
const cjs = compileJsonStringify({
type: 'object',
properties: {
status: { type: 'string' },
message: { type: 'string', default: 'OK' }, // <-- Default does not work
data: {
type: 'object',
properties: {
user: {
type: 'object',
properties: { id: { type: 'string' }, name: { type: 'string' } }
}
}
}
}
});
const data = {
status: 'success',
data: { user: { id: 'uuid', name: 'John' } }
};
cjs(data) // {"status":"success","data":{"user":{"id":"uuid","name":"John"}}}
Is there any way to get default work? Thanks