import { FromSchema } from "json-schema-to-ts"; const dogSchema = { type: "object", properties: { name: { type: "string" }, age: { type: "integer" }, hobbies: { type: "array", items: { type: "string" } }, favoriteFood: { enum: ["pizza", "taco", "fries"] }, }, ...
Actions: fastify/fastify-type-provider-json-schema-to-ts Actions All workflows CI CodeQL Dependabot Updates Management Caches All workflows Showing runs from all workflows 210 workflow runs Event Status Branch Actor Scheduled CodeQL #140: by github-advanced-security bot main ...
import { toJsonSchema } from "@ts-to-json-schema/core"; interface MyType { foo: string; bar?: number; } const schema = toJsonSchema<MyType>(); console.log(schema); /* * Output: * { * type: 'object', * properties: { * foo: { type: 'string' }, * bar: { type: 'number...
constesbuild=require('esbuild');const{tsToJsonSchemaPlugin}=require('@ts-to-json-schema/esbuild-plugin');esbuild.build({entryPoints:['src/index.ts'],bundle:true,outfile:'dist/index.js',plugins:[tsToJsonSchemaPlugin()// Add here],}).catch(()=>process.exit(1)); ...
First, we use TS to implement a simple JSON schema builder, which only supports the construction of number type schemas: class TypeBuilder { public Number() { return this.Create({ type: "number" }); } protected Create<T>(schema: T): T { ...
associated with the enclosing JSON schema"object"type.For optional fields, an additional field is generated with a suffix of_numadded to the element name.At run time this is zero to indicate the value was absent from the JSON data, and non-zero if the value was present in the JSON data...
The DFHLS2JS utility program supports mappings between PL/I data structures and JSON schema definitions. Because the Enterprise PL/I compiler and older PL/I compilers differ, two language options are supported: PLI-ENTERPRISE and PLI-OTHER.
import { FromSchema } from "json-schema-to-ts"; const dogSchema = { type: "object", properties: { name: { type: "string" }, age: { type: "integer" }, hobbies: { type: "array", items: { type: "string" } }, favoriteFood: { enum: ["pizza", "taco", "fries"] }, }, ...
A Type Provider for json-schema-to-ts. Contribute to fastify/fastify-type-provider-json-schema-to-ts development by creating an account on GitHub.
A Type Provider for json-schema-to-ts. Contribute to fastify/fastify-type-provider-json-schema-to-ts development by creating an account on GitHub.