PassFort / json-schema-to-flow-type

69 stars 17 forks source link

Convert JSON Schema to Flow Type Definitions

Build Status NPM Dependencies License

APIs

type Imports = {
  [key: string]: Schema
}

simplifySchema(schema, Schema, imports: ?Imports): Schema

convertSchema(schema: Schema): FlowSchema

convert schema to a flow schema

toFlow(flowSchema): AstObject

will export ast object export ${upperCamelCase(flowSchema.id)} == ${toFlowType(flowType)}

schemaToFlow(flowSchema): string

convert definitions and schema root by toFlow

parseSchema(schema: Schema, imports: ?Imports): string

pipe simplifySchema | convertSchema | schemaToFlow

Changelog

0.4.0

0.3.0