[
    {
        "name": "Json.Schema.Random",
        "comment": "\nGenerate random values based on JSON Schema.\n\nExperimental module.\n\n# Generator\n\n@docs value\n\n# Settings\n\n@docs GeneratorSettings, defaultSettings\n\n",
        "unions": [],
        "aliases": [
            {
                "name": "GeneratorSettings",
                "comment": "\nCustomize generator behaviour using following parameters:\n- optionalPropertyProbability : float from 0 to 1, which affects used while generating object with optional property, default 0.5\n- degradationMultiplier : used in nested objects to affect probability of optional property appearance (must have for recursive objects), default 0.2\n- defaultListLengthLimit : how many items in array to generate when limit is not set by a schema, default 100\n- defaultStringLengthLimit : how many characters in random string to generate when limit is not set by a schema, default 100\n",
                "args": [],
                "type": "{ optionalPropertyProbability : Float, degradationMultiplier : Float, defaultListLengthLimit : Int, defaultStringLengthLimit : Int }"
            }
        ],
        "values": [
            {
                "name": "defaultSettings",
                "comment": "\nDefaults for GeneratorSettings\n",
                "type": "GeneratorSettings"
            },
            {
                "name": "value",
                "comment": "\nDefault value generator.\n\n    buildSchema\n        |> withProperties\n            [ ( \"foo\", buildSchema |> withType \"integer\" ) ]\n        |> toSchema\n        |> Result.withDefault (blankSchema)\n        |> value defaultSettings\n        |> flip Random.step (Random.initialSeed 2)\n        |> \\( v, _ ) ->\n            Expect.equal v (Encode.object [ ( \"foo\", Encode.int 688281600 ) ])\n\nSee tests for more examples.\n",
                "type": "GeneratorSettings -> Schema -> Generator Value"
            }
        ],
        "binops": []
    },
    {
        "name": "Json.Schema",
        "comment": "\nThis library provides bunch of utility methods to work with JSON values using\nschemas defined in [JSON Schema](http://json-schema.org/) format.\n\nCurrently it allows to construct schemata ([draft-6](https://github.com/json-schema-org/json-schema-spec/blob/draft-06/schema.json)), validate values and generate random\nvalues based on schema (very experimental feature).\nIt supports local references, but doesn't support remote references.\n\n# Decode schema\n\nUse `fromValue` or `fromString` methods if you receive schema from external source. If you want to construct schema from elm code you might want to use `Json.Schema.Builder`, or low-level API using definitions from `Json.Schema.Definitions`\n\n@docs fromValue, fromString\n\n# Validation\n\n@docs validateValue\n\n",
        "unions": [],
        "aliases": [],
        "values": [
            {
                "name": "fromString",
                "comment": " Construct JSON Schema from string\n",
                "type": "String -> Result String Schema"
            },
            {
                "name": "fromValue",
                "comment": " Construct JSON Schema from JSON value\n",
                "type": "Value -> Result String Schema"
            },
            {
                "name": "validateValue",
                "comment": " Validate value against JSON Schema. Returns True Result if case if object is valid, or string error otherwise.\n",
                "type": "Value -> Schema -> Result (List Error) Value"
            }
        ],
        "binops": []
    },
    {
        "name": "Json.Schema.Builder",
        "comment": " Convenience API to build a valid JSON schema\n\n# Definition\n@docs SchemaBuilder\n\n# Schema builder creation\n@docs buildSchema, boolSchema, toSchema, encode\n\n# Building up schema\n\n## Type\n\nJSON Schema spec allows type to be string or array of strings. There are three\ngroups of types produced: single types (e.g. `\"string\"`), nullable types (e.g. `[\"string\", \"null\"]`)\nand union types (e.g. `[\"string\", \"object\"]`)\n\n@docs withType, withNullableType, withUnionType\n\n## Meta\n\n@docs withTitle, withDescription, withDefault, withExamples, withDefinitions\n\n## JSON-Schema\n\n@docs withId, withRef\n\n## Numeric validations\n\nThe following validations are only applicable to numeric values and\nwill always succeed for any type other than `number` and `integer`\n\n@docs withMultipleOf, withMaximum, withMinimum, withExclusiveMaximum, withExclusiveMinimum\n\n## String validations\n\n@docs withMaxLength, withMinLength, withPattern, withFormat\n\n## Array validations\n\n@docs withItems, withItem, withAdditionalItems, withMaxItems, withMinItems, withUniqueItems, withContains\n\n## Object validations\n\n@docs withMaxProperties, withMinProperties, withRequired, withProperties, withPatternProperties, withAdditionalProperties, withSchemaDependency, withPropNamesDependency, withPropertyNames\n\n## Generic validations\n\n@docs withEnum, withConst, withAllOf, withAnyOf, withOneOf, withNot\n\n\n\n# Validation\n@docs validate\n\n",
        "unions": [
            {
                "name": "SchemaBuilder",
                "comment": " Builder for JSON schema providing an API like this:\n\n    buildSchema\n        |> withTitle \"My object\"\n        |> withProperties\n            [ ( \"foo\"\n              , buildSchema\n                    |> withType \"string\" )\n            , ( \"bar\"\n              , buildSchema\n                    |> withType \"integer\"\n                    |> withMaximum 10\n              )\n            ]\n",
                "args": [],
                "cases": [
                    [
                        "SchemaBuilder",
                        [
                            "{ errors : List String, schema : Maybe SubSchema, bool : Maybe Bool }"
                        ]
                    ]
                ]
            }
        ],
        "aliases": [],
        "values": [
            {
                "name": "boolSchema",
                "comment": " Create boolean schema\n",
                "type": "Bool -> SchemaBuilder"
            },
            {
                "name": "buildSchema",
                "comment": " Create schema builder with blank schema\n",
                "type": "SchemaBuilder"
            },
            {
                "name": "encode",
                "comment": " Encode schema into a builder code (elm)\n",
                "type": "Int -> Schema -> String"
            },
            {
                "name": "toSchema",
                "comment": " Extract JSON Schema from the builder\n",
                "type": "SchemaBuilder -> Result String Schema"
            },
            {
                "name": "validate",
                "comment": " Validate value using schema controlled by builder.\n",
                "type": "Value -> SchemaBuilder -> Result (List Error) Value"
            },
            {
                "name": "withAdditionalItems",
                "comment": "\n",
                "type": "SchemaBuilder -> SchemaBuilder -> SchemaBuilder"
            },
            {
                "name": "withAdditionalProperties",
                "comment": "\n",
                "type": "SchemaBuilder -> SchemaBuilder -> SchemaBuilder"
            },
            {
                "name": "withAllOf",
                "comment": "\n",
                "type": "List SchemaBuilder -> SchemaBuilder -> SchemaBuilder"
            },
            {
                "name": "withAnyOf",
                "comment": "\n",
                "type": "List SchemaBuilder -> SchemaBuilder -> SchemaBuilder"
            },
            {
                "name": "withConst",
                "comment": "\n",
                "type": "Value -> SchemaBuilder -> SchemaBuilder"
            },
            {
                "name": "withContains",
                "comment": " Set the `contains` property of JSON schema to a sub-schema.\n\n    buildSchema\n        |> withContains\n            (buildSchema\n                |> withType \"string\"\n            )\n",
                "type": "SchemaBuilder -> SchemaBuilder -> SchemaBuilder"
            },
            {
                "name": "withDefault",
                "comment": "\n",
                "type": "Value -> SchemaBuilder -> SchemaBuilder"
            },
            {
                "name": "withDefinitions",
                "comment": "\n",
                "type": "List ( String, SchemaBuilder ) -> SchemaBuilder -> SchemaBuilder"
            },
            {
                "name": "withDescription",
                "comment": "\n",
                "type": "String -> SchemaBuilder -> SchemaBuilder"
            },
            {
                "name": "withEnum",
                "comment": "\n",
                "type": "List Value -> SchemaBuilder -> SchemaBuilder"
            },
            {
                "name": "withExamples",
                "comment": "\n",
                "type": "List Value -> SchemaBuilder -> SchemaBuilder"
            },
            {
                "name": "withExclusiveMaximum",
                "comment": "\n",
                "type": "Float -> SchemaBuilder -> SchemaBuilder"
            },
            {
                "name": "withExclusiveMinimum",
                "comment": "\n",
                "type": "Float -> SchemaBuilder -> SchemaBuilder"
            },
            {
                "name": "withFormat",
                "comment": "\n",
                "type": "String -> SchemaBuilder -> SchemaBuilder"
            },
            {
                "name": "withId",
                "comment": "\n",
                "type": "String -> SchemaBuilder -> SchemaBuilder"
            },
            {
                "name": "withItem",
                "comment": "\n",
                "type": "SchemaBuilder -> SchemaBuilder -> SchemaBuilder"
            },
            {
                "name": "withItems",
                "comment": "\n",
                "type": "List SchemaBuilder -> SchemaBuilder -> SchemaBuilder"
            },
            {
                "name": "withMaxItems",
                "comment": "\n",
                "type": "Int -> SchemaBuilder -> SchemaBuilder"
            },
            {
                "name": "withMaxLength",
                "comment": "\n",
                "type": "Int -> SchemaBuilder -> SchemaBuilder"
            },
            {
                "name": "withMaxProperties",
                "comment": "\n",
                "type": "Int -> SchemaBuilder -> SchemaBuilder"
            },
            {
                "name": "withMaximum",
                "comment": "\n",
                "type": "Float -> SchemaBuilder -> SchemaBuilder"
            },
            {
                "name": "withMinItems",
                "comment": "\n",
                "type": "Int -> SchemaBuilder -> SchemaBuilder"
            },
            {
                "name": "withMinLength",
                "comment": "\n",
                "type": "Int -> SchemaBuilder -> SchemaBuilder"
            },
            {
                "name": "withMinProperties",
                "comment": "\n",
                "type": "Int -> SchemaBuilder -> SchemaBuilder"
            },
            {
                "name": "withMinimum",
                "comment": "\n",
                "type": "Float -> SchemaBuilder -> SchemaBuilder"
            },
            {
                "name": "withMultipleOf",
                "comment": "\n",
                "type": "Float -> SchemaBuilder -> SchemaBuilder"
            },
            {
                "name": "withNot",
                "comment": "\n",
                "type": "SchemaBuilder -> SchemaBuilder -> SchemaBuilder"
            },
            {
                "name": "withNullableType",
                "comment": " Set the `type` property of JSON schema to a nullable type.\n\n    buildSchema\n        |> withNullableType \"string\"\n",
                "type": "String -> SchemaBuilder -> SchemaBuilder"
            },
            {
                "name": "withOneOf",
                "comment": "\n",
                "type": "List SchemaBuilder -> SchemaBuilder -> SchemaBuilder"
            },
            {
                "name": "withPattern",
                "comment": "\n",
                "type": "String -> SchemaBuilder -> SchemaBuilder"
            },
            {
                "name": "withPatternProperties",
                "comment": "\n",
                "type": "List ( String, SchemaBuilder ) -> SchemaBuilder -> SchemaBuilder"
            },
            {
                "name": "withPropNamesDependency",
                "comment": "\n",
                "type": "String -> List String -> SchemaBuilder -> SchemaBuilder"
            },
            {
                "name": "withProperties",
                "comment": "\n",
                "type": "List ( String, SchemaBuilder ) -> SchemaBuilder -> SchemaBuilder"
            },
            {
                "name": "withPropertyNames",
                "comment": "\n",
                "type": "SchemaBuilder -> SchemaBuilder -> SchemaBuilder"
            },
            {
                "name": "withRef",
                "comment": "\n",
                "type": "String -> SchemaBuilder -> SchemaBuilder"
            },
            {
                "name": "withRequired",
                "comment": "\n",
                "type": "List String -> SchemaBuilder -> SchemaBuilder"
            },
            {
                "name": "withSchemaDependency",
                "comment": "\n",
                "type": "String -> SchemaBuilder -> SchemaBuilder -> SchemaBuilder"
            },
            {
                "name": "withTitle",
                "comment": "\n",
                "type": "String -> SchemaBuilder -> SchemaBuilder"
            },
            {
                "name": "withType",
                "comment": " Set the `type` property of JSON schema to a specific type, accepts strings\n\n    buildSchema\n        |> withType \"boolean\"\n",
                "type": "String -> SchemaBuilder -> SchemaBuilder"
            },
            {
                "name": "withUnionType",
                "comment": " Set the `type` property of JSON schema to an union type.\n\n    buildSchema\n        |> withUnionType [ \"string\", \"object\" ]\n",
                "type": "List String -> SchemaBuilder -> SchemaBuilder"
            },
            {
                "name": "withUniqueItems",
                "comment": "\n",
                "type": "Bool -> SchemaBuilder -> SchemaBuilder"
            }
        ],
        "binops": []
    },
    {
        "name": "Json.Schema.Validation",
        "comment": "\n\n# Validate\n\nValidation fails with list of errors, one for each invalid leaf of the value object.\nWhen validation succeeds it also returns value being validated. Currently this value is the same as initial value, later version will allow options to be supplied in order to normalize value along the validation (e.g. apply defaults, remove additional properties, coerce types)\n\n@docs validate\n\n# Validation Errors\n\n@docs Error, ValidationError, JsonPath\n\n",
        "unions": [
            {
                "name": "ValidationError",
                "comment": "\nValidation errors with details. The rule of parametrized errors like `Maximum` is that first parameter is always expected value, second parameter is actual value. Most of errors named after respective validation properties, only exception from this rule for cases like `AlwaysFail` which doesn't have keyword (this is result of boolean schema false), or `AdditionalPropertiesDisallowed` which represent subset of `.additionalProperties` validation when its value equals to `false` and additional property is present.\n\nThere are keywords in JSON Schema which don't have their dedicated error codes:\n\n- items\n- additionalItems\n- properties\n- patternProperties\n- dependencies\n- allOf\n- oneOf\n\nThe reason for this is the nature of these errors is to go deeper into the nested Schema and Value.\n\nCurrent implementation of validation only creates errors for leaves of the Value, not for nodes, e.g. if one of the properties fails a validation, error list will contain an error for the property but not for the object containing it. This decision is made to reduce noise in errors, since it is obvious that all the parent objects containing invalid properties are also invalid, and this information can be derived from json path if needed.\n\n",
                "args": [],
                "cases": [
                    [
                        "MultipleOf",
                        [
                            "Float",
                            "Float"
                        ]
                    ],
                    [
                        "Maximum",
                        [
                            "Float",
                            "Float"
                        ]
                    ],
                    [
                        "Minimum",
                        [
                            "Float",
                            "Float"
                        ]
                    ],
                    [
                        "ExclusiveMaximum",
                        [
                            "Float",
                            "Float"
                        ]
                    ],
                    [
                        "ExclusiveMinimum",
                        [
                            "Float",
                            "Float"
                        ]
                    ],
                    [
                        "MaxLength",
                        [
                            "Int",
                            "Int"
                        ]
                    ],
                    [
                        "MinLength",
                        [
                            "Int",
                            "Int"
                        ]
                    ],
                    [
                        "Pattern",
                        [
                            "String",
                            "String"
                        ]
                    ],
                    [
                        "MaxItems",
                        [
                            "Int",
                            "Int"
                        ]
                    ],
                    [
                        "MinItems",
                        [
                            "Int",
                            "Int"
                        ]
                    ],
                    [
                        "UniqueItems",
                        [
                            "Value"
                        ]
                    ],
                    [
                        "Contains",
                        []
                    ],
                    [
                        "MaxProperties",
                        [
                            "Int",
                            "Int"
                        ]
                    ],
                    [
                        "MinProperties",
                        [
                            "Int",
                            "Int"
                        ]
                    ],
                    [
                        "Required",
                        [
                            "List String"
                        ]
                    ],
                    [
                        "AdditionalPropertiesDisallowed",
                        [
                            "List String"
                        ]
                    ],
                    [
                        "InvalidPropertyName",
                        [
                            "List Error"
                        ]
                    ],
                    [
                        "Enum",
                        []
                    ],
                    [
                        "Const",
                        []
                    ],
                    [
                        "InvalidType",
                        [
                            "String"
                        ]
                    ],
                    [
                        "OneOfNoneSucceed",
                        []
                    ],
                    [
                        "OneOfManySucceed",
                        [
                            "Int"
                        ]
                    ],
                    [
                        "Not",
                        []
                    ],
                    [
                        "UnresolvableReference",
                        [
                            "String"
                        ]
                    ],
                    [
                        "AlwaysFail",
                        []
                    ]
                ]
            }
        ],
        "aliases": [
            {
                "name": "Error",
                "comment": "\nAttempt to validate returns `Result` with list of `Error` instances as an `Err`.\n",
                "args": [],
                "type": "{ jsonPath : JsonPath, error : ValidationError }"
            },
            {
                "name": "JsonPath",
                "comment": "\nPath in json value.\n\nA few notes:\n\n- empty list represents root\n- indices of array items are integers encoded as string\n\n",
                "args": [],
                "type": "List String"
            }
        ],
        "values": [
            {
                "name": "validate",
                "comment": " Validate value against schema\n",
                "type": "Value -> Schema -> Result (List Error) Value"
            }
        ],
        "binops": []
    },
    {
        "name": "Json.Schema.Definitions",
        "comment": "\n\nThis module contains low-level structures JSON Schema build from.\nNormally you wouldn't need to use any of those definitions.\n\nIf you really need this low-level API you might need [JSON Schema spec](http://json-schema.org/documentation.html) as guidance.\n\nFeel free to open [issue](https://github.com/1602/json-schema) to describe your use-case, it will affect development roadmap of this library.\n\n# Definitions\n\n@docs Schema, SubSchema, Schemata, Items, Dependency, Type, SingleType, blankSchema, blankSubSchema\n\n# Decoding / encoding\n\n@docs decoder, encode\n\n# Misc\n\n@docs stringToType\n\n",
        "unions": [
            {
                "name": "Dependency",
                "comment": "\nDependency definition.\n",
                "args": [],
                "cases": [
                    [
                        "ArrayPropNames",
                        [
                            "List String"
                        ]
                    ],
                    [
                        "PropSchema",
                        [
                            "Schema"
                        ]
                    ]
                ]
            },
            {
                "name": "Items",
                "comment": "\nItems definition.\n",
                "args": [],
                "cases": [
                    [
                        "NoItems",
                        []
                    ],
                    [
                        "ItemDefinition",
                        [
                            "Schema"
                        ]
                    ],
                    [
                        "ArrayOfItems",
                        [
                            "List Schema"
                        ]
                    ]
                ]
            },
            {
                "name": "Schema",
                "comment": "\nSchema can be either boolean or actual object containing validation and meta properties\n",
                "args": [],
                "cases": [
                    [
                        "BooleanSchema",
                        [
                            "Bool"
                        ]
                    ],
                    [
                        "ObjectSchema",
                        [
                            "SubSchema"
                        ]
                    ]
                ]
            },
            {
                "name": "Schemata",
                "comment": "\nList of schema-properties used in properties, definitions and patternProperties\n",
                "args": [],
                "cases": [
                    [
                        "Schemata",
                        [
                            "List ( String, Schema )"
                        ]
                    ]
                ]
            },
            {
                "name": "SingleType",
                "comment": "\n",
                "args": [],
                "cases": [
                    [
                        "IntegerType",
                        []
                    ],
                    [
                        "NumberType",
                        []
                    ],
                    [
                        "StringType",
                        []
                    ],
                    [
                        "BooleanType",
                        []
                    ],
                    [
                        "ArrayType",
                        []
                    ],
                    [
                        "ObjectType",
                        []
                    ],
                    [
                        "NullType",
                        []
                    ]
                ]
            },
            {
                "name": "Type",
                "comment": "\nType property in json schema can be a single type or array of them, this type definition wraps up this complexity, also it introduces concept of nullable type, which is array of \"null\" type and a single type speaking JSON schema language, but also a useful concept to treat it separately from list of types.\n",
                "args": [],
                "cases": [
                    [
                        "AnyType",
                        []
                    ],
                    [
                        "SingleType",
                        [
                            "SingleType"
                        ]
                    ],
                    [
                        "NullableType",
                        [
                            "SingleType"
                        ]
                    ],
                    [
                        "UnionType",
                        [
                            "List SingleType"
                        ]
                    ]
                ]
            }
        ],
        "aliases": [
            {
                "name": "SubSchema",
                "comment": "\nThis object holds all draft-6 schema properties\n",
                "args": [],
                "type": "{ type_ : Type, id : Maybe String, ref : Maybe String, title : Maybe String, description : Maybe String, default : Maybe Value, examples : Maybe (List Value), definitions : Maybe Schemata, multipleOf : Maybe Float, maximum : Maybe Float, exclusiveMaximum : Maybe Float, minimum : Maybe Float, exclusiveMinimum : Maybe Float, maxLength : Maybe Int, minLength : Maybe Int, pattern : Maybe String, format : Maybe String, items : Items, additionalItems : Maybe Schema, maxItems : Maybe Int, minItems : Maybe Int, uniqueItems : Maybe Bool, contains : Maybe Schema, maxProperties : Maybe Int, minProperties : Maybe Int, required : Maybe (List String), properties : Maybe Schemata, patternProperties : Maybe Schemata, additionalProperties : Maybe Schema, dependencies : List ( String, Dependency ), propertyNames : Maybe Schema, enum : Maybe (List Value), const : Maybe Value, allOf : Maybe (List Schema), anyOf : Maybe (List Schema), oneOf : Maybe (List Schema), not : Maybe Schema }"
            }
        ],
        "values": [
            {
                "name": "blankSchema",
                "comment": " Create blank JSON Schema `{}`.\n",
                "type": "Schema"
            },
            {
                "name": "blankSubSchema",
                "comment": "\n",
                "type": "SubSchema"
            },
            {
                "name": "decoder",
                "comment": "\n",
                "type": "Decoder Schema"
            },
            {
                "name": "encode",
                "comment": "\n",
                "type": "Schema -> Value"
            },
            {
                "name": "stringToType",
                "comment": "\nAttempt to parse string into a single type, it recognises the following list of types:\n- integer\n- number\n- string\n- boolean\n- array\n- object\n- null\n",
                "type": "String -> Result String SingleType"
            }
        ],
        "binops": []
    }
]