Clone and edit this document
Runkit
Runkit
home page
user forum
new notebook
clone notebook
download notebook
support & documentation
log in
sign up
new notebook
help & feedback
clone this notebook
download this notebook
Sign In
Sign Up
RunKit + npm: @asyncapi/modelina
node v14.20.1
version:
1.0.0
endpoint
share
tweet
var { GoGenerator } = require("@asyncapi/modelina") const generator = new GoGenerator(); const schema = { $id: "Address", type: "object", properties: { street_name: { type: "string" }, city: { type: "string", description: "City description" }, house_number: { type: "number" }, marriage: { type: "boolean", description: "Status if marriage live in given house" }, pet_names: { type: "array", items: { type: "string" } }, state: { type: "string", enum: ["Texas", "Alabama", "California", "other"] }, }, required: ["street_name", "city", "state", "house_number", "state"], }; async function generate() { const models = await generator.generate(schema); models.forEach( (model) => console.log(model.result) ); } generate();
Created from: https://npm.runkit.com/%40asyncapi%2Fmodelina
Loading…
no comments
sign in
to comment