tdegrunt / jsonschema

JSON Schema validation
Other
1.83k stars 262 forks source link

Generate schema from JSON Data #306

Closed ghost closed 4 years ago

ghost commented 4 years ago

Hi,

Do you know if this module can generate a schema from JSON data ?

Thx

tdegrunt commented 4 years ago

It doesn’t, sorry.

ghost commented 4 years ago

It's possible with this Library. 👍

Package: NJsonSchema Type: NJsonSchema.Generation.SampleJsonSchemaGenerator The SampleJsonSchemaGenerator generates a JSON Schema from sample JSON data.

var schema = JsonSchema.FromSampleJson("..."); var schemaJson = schema.ToJson();

awwright commented 4 years ago

Also check out https://json-schema.org/implementations.html#generators-from-schemas on the official JSON Schema website