See json-to-json-schema for transforming JSON to JSON schema.
Use json-to-mobx-state-tree to transform a JSON data structure to MobX State Tree model (first transforms JSON to JSON Schema)
var schema = {
type: "object",
properties: {
name: {
type: "string",
faker: "name.findName"
},
email: {
type: "string",
format: "email",
faker: "internet.email"
}
},
required: ["name", "email"]
}
};
jsf.resolve(schema).then(function(sample) {
console.log(sample);
// "[object Object]"
console.log(sample.name);
// "John Doe"
});
Convert JSON Objects to MySQL Table Schema, JSON Schema, Mongoose Schema, ClickHouse Schema, Google BigQuery, or a Generic template for documentation, code generation, and more.
- json-schema-to-typescript
- @gql2ts/from-schema generate a namespace for a GraphQL Schema with all possible interfaces/types included.
- mongoose-schema-jsonschema
- json-schema-to-mongoose
- ... many alternatives
entitySchemas: [
Object.assign({ target: Post }, require(__dirname + "/Schemas/Post.json"))
];