compile-json-stringify icon indicating copy to clipboard operation
compile-json-stringify copied to clipboard

[Feature Request]: Default option?

Open dalisoft opened this issue 3 years ago • 3 comments

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

dalisoft avatar May 11 '21 18:05 dalisoft