1.0.0 • Published 6 years ago

json-schema-to-flow-type v1.0.0

Weekly downloads
1,582
License
WTFPL
Repository
github
Last release
6 years ago

Convert JSON Schema to Flow Type Definitions

Build Status NPM Dependencies License

APIs

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

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

  • schema should have id for type alias identifier
  • outside $ref will be resolve the real schema instead of $ref;
  • imports with { #: schema } will have same rule as above;

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

  • Support for string literal object type keys

0.3.0

1.0.0

6 years ago

0.4.0

6 years ago

0.3.1

6 years ago

0.3.0

6 years ago

0.2.7

6 years ago

0.2.6

7 years ago

0.2.5

7 years ago

0.2.4

7 years ago

0.2.3

7 years ago

0.2.2

7 years ago

0.2.1

7 years ago

0.2.0

7 years ago

0.1.3

8 years ago

0.1.2

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago

0.0.1

8 years ago

0.0.0

8 years ago