json-schema-faker-cli icon indicating copy to clipboard operation
json-schema-faker-cli copied to clipboard

Option sortProperties: false reverses original order

Open Zyrix opened this issue 2 years ago • 1 comments

When I add sortProperties: false to the options.js file, the original order is reversed, see example below. The option sortProperties: true works as intended and sorts all properties.

example json schema:

{ "type": "object", "required": [], "properties": { "first": { "type": "string" }, "second": { "type": "string" }, "third": { "type": "string" } } }

example output

{"third":"sint","second":"aliquip","first":"ad"}

Zyrix avatar Oct 12 '22 06:10 Zyrix

I don't have enough time to check that but if that happens, it seems to be a bug in json-schema-faker.

https://github.com/json-schema-faker/json-schema-faker/blob/771eee7228f27eb8d914aa03e431bd69ab1bc468/docs/README.md#available-options image

oprogramador avatar Oct 13 '22 04:10 oprogramador