Created
February 27, 2018 03:55
-
-
Save ctgardner/41a663df35c12160af314d02d856b4d7 to your computer and use it in GitHub Desktop.
JSON Schema Flow type
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Shamelessly stolen from https://github.com/tdegrunt/jsonschema/issues/184#issue-173862957 and improved by @micheal-hill | |
DISCLAIMER: Use at own risk. | |
*/ | |
type JsonSchema = {| | |
+id?: string; | |
+$schema?: string; | |
+title?: string; | |
+description?: string; | |
+multipleOf?: number; | |
+maximum?: number; | |
+exclusiveMaximum?: boolean; | |
+minimum?: number; | |
+exclusiveMinimum?: boolean; | |
+maxLength?: number; | |
+minLength?: number; | |
+pattern?: string; | |
+additionalItems?: boolean | JsonSchema; | |
+items?: JsonSchema | JsonSchema[]; | |
+maxItems?: number; | |
+minItems?: number; | |
+uniqueItems?: boolean; | |
+maxProperties?: number; | |
+minProperties?: number; | |
+required?: string[]; | |
+additionalProperties?: boolean | JsonSchema; | |
+definitions?: { | |
[name: string]: JsonSchema | |
}; | |
+properties?: { | |
[name: string]: JsonSchema | |
}; | |
+patternProperties?: { | |
[name: string]: JsonSchema | |
}; | |
+dependencies?: { | |
[name: string]: JsonSchema | string[] | |
}; | |
+enum?: any[]; | |
+type?: string | string[]; | |
+allOf?: JsonSchema[]; | |
+anyOf?: JsonSchema[]; | |
+oneOf?: JsonSchema[]; | |
+not?: JsonSchema; | |
|}; | |
export type { JsonSchema }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment