K5I      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H )Nickolay Kudasov <nickolay@getshoptv.com> experimentalSafe?Options that specify how to encode your type to Swagger schema.XFunction applied to field labels. Handy for removing common record prefixes for example.\Function applied to constructor tags which could be handy for lower-casing them for example."Function applied to datatype name.If I the constructors of a datatype, with all nullary constructors, will be encoded to a string enumeration schema with the constructor tags as possible values.QHide the field name when a record constructor has only one field, like a newtype.Default encoding .  {  = id ,  = id ,  = id ,  = True ,  = False } None 1345IKLN  !"#$%&  &%$# "!    !"#$%&)Nickolay Kudasov <nickolay@getshoptv.com> experimentalSafe-3579 ' A declare monad parametrized by d+  the output to accumulate (declarations).NThis monad is similar to both state and writer monads. Thus it can be seen as4a restricted append-only version of a state monad orBa writer monad with the extra ability to read all previous output.(Definitions of declare and look! must satisfy the following laws: monoid homomorphism (mempty)) mempty == return ()monoid homomorphism (mappend)) x >> ) y == ) (x <> y) for every x, ydeclare-look) x >> * == J (<> x) * <* ) x for every xlook as left identity* >> m == m for every m)) x' is an action that produces the output x.**1 is an action that returns all the output so far.+,A declare monad transformer parametrized by:d+  the output to accumulate (declarations);m  the inner monad.fThis monad transformer is similar to both state and writer monad transformers. Thus it can be seen as@a restricted append-only version of a state monad transformer orNa writer monad transformer with the extra ability to read all previous output..-Retrieve a function of all the output so far./ Evaluate + d m a# computation, ignoring new output d.0Execute DeclateT d m a= computation, ignoring result and only producing new output d.1 Evaluate + d m a2 computation, starting with empty output history.2Run ' d a! computation with output history d, producing result a and new output d.3 Evaluate ' d a computation, ignoring output d.4Execute Declate d a9 computation, ignoring result and only producing output d.5 Evaluate + d m a2 computation, starting with empty output history.'()*+,-./0123456789'()*+,-./012345+,-987()*6./01'2345'()*+,-./0123456789None!"*+-./0345CNi@A simple object to allow referencing other definitions in the specification. It can be used to reference parameters and responses that are defined at the top level for reuse.CCAllows referencing an external resource for extended documentation.EfA short description of the target documentation. GFM syntax can be used for rich text representation.F%The URL for the target documentation.G8Allows adding meta data to a single tag that is used by  Operation!. It is not mandatory to have a Tag per tag used there.IThe name of the tag.JVA short description for the tag. GFM syntax can be used for rich text representation.K/Additional external documentation for this tag.L Tag name.MLists the required security schemes to execute this operation. The object can have multiple security schemes declared in it which are all required (that is, there is a logical AND between the schemes).R The type of the security scheme.S(A short description for security scheme.Z,The flow used by the OAuth2 security scheme.[4The available scopes for the OAuth2 security scheme.aNThe token URL to be used for OAuth2 flow. This SHOULD be in the form of a URL.bVThe authorization URL to be used for OAuth2 flow. This SHOULD be in the form of a URL.e5The name of the header or query parameter to be used.fThe location of the API key.gThe location of the API key.o"A short description of the header.r2Describes a single response from an API Operation.tZA short description of the response. GFM syntax can be used for rich text representation.u;A definition of the response structure. It can be a primitive, an array or an object. If this field does not exist, it means no content is returned as part of the response. As an extension to the Schema Object, its root type value may also be "file". This SHOULD be accompanied by a relevant produces mime-type.v2A list of headers that are sent with the response.w#An example of the response message.ytA container for the expected responses of an operation. The container maps a HTTP response code to the expected response. It is not expected from the documentation to necessarily cover all possible HTTP response codes, since they may not be known in advance. However, it is expected from the documentation to cover a successful operation response and any known errors.{The documentation of responses other than the ones declared for specific HTTP response codes. It can be used to cover undeclared responses.|Any HTTP status code can be used as the property name (one property per HTTP status code). Describes the expected response for those HTTP status codes.lReplaces the name of the element/attribute used for the described schema property. When defined within the  (items), it will affect the name of the individual XML elements within the list. When defined alongside type being array (outside the items), it will affect the wrapping element and only if wrapped is true. If wrapped is false, it will be ignored.KThe URL of the namespace definition. Value SHOULD be in the form of a URL.#The prefix to be used for the name.mDeclares whether the property definition translates to an attribute instead of an element. Default value is False.aMAY be used only for an array definition. Signifies whether the array is wrapped (for example,  <books><book><book ></books>) or unwrapped (<book><book>). Default value is False`. The definition takes effect only when defined alongside type being array (outside the items).aDeclares the value of the parameter that the server will use if none is provided, for example a "count"< to control the number of results per page might default to 100 if not supplied by the client in the request. (Note: "default" has no meaning for required parameters.) Unlike JSON Schema this value MUST conform to the defined type for this parameter.Regex pattern for string type.A = with an optional name. This name can be used in references.#Determines the format of the array.:Parameters that are appended to the URL. For example, in  /items?id=###, the query parameter is id.8Custom headers that are expected as part of the request.Used together with Path Templating, where the parameter value is actually part of the operation's URL. This does not include the host or base path of the API. For example, in items{itemId}, the path parameter is itemId.<Used to describe the payload of an HTTP request when either !application/x-www-form-urlencoded or multipart/form-dataL are used as the content type of the request (in Swagger's definition, the consumesq property of an operation). This is the only parameter type that can be used to send files, thus supporting the  ParamFile type. Since form parameters are sent in the payload, they cannot be declared together with a body parameter for the same operation. Form parameters have a different format based on the content-type used (for further details, consult  :http://www.w3.org/TR/html401/interact/forms.html#h-17.13.4). Items for  schemas.E should be used only for query params, headers and path pieces. The  tN parameter specifies how elements of an array should be displayed. Note that fmt in  fmt schema' specifies format for elements of type schema1. This is different from the original Swagger's  ,http://swagger.io/specification/#itemsObject Items Object., should be used to specify homogenous array s.! should be used to specify tuple s.The location of the parameter.QSets the ability to pass empty-valued parameters. This is valid only for either  or [ and allows you to send a parameter with a name only or an empty value. Default value is False.oDescribes a single operation parameter. A unique parameter is defined by a combination of a name and location.?The name of the parameter. Parameter names are case sensitive.A brief description of the parameter. This could contain examples of use. GFM syntax can be used for rich text representation.Determines whether this parameter is mandatory. If the parameter is in "path", this property is required and its value MUST be true. Otherwise, the property MAY be included and its default value is False.Parameter schema.+Describes a single API operation on a path.A list of tags for API documentation control. Tags can be used for logical grouping of operations by resources or any other qualifier.A short summary of what the operation does. For maximum readability in the swagger-ui, this field SHOULD be less than 120 characters.fA verbose explanation of the operation behavior. GFM syntax can be used for rich text representation.5Additional external documentation for this operation.Unique string used to identify the operation. The id MUST be unique among all operations described in the API. Tools and libraries MAY use the it to uniquely identify an operation, therefore, it is recommended to follow common programming naming conventions.DA list of MIME types the operation can consume. This overrides the consumes. Just [], MAY be used to clear the global definition.DA list of MIME types the operation can produce. This overrides the produces. Just [], MAY be used to clear the global definition.gA list of parameters that are applicable for this operation. If a parameter is already defined at the , the new definition will override it, but can never remove it. The list MUST NOT include duplicated parameters. A unique parameter is defined by a combination of a name and location.RThe list of possible responses as they are returned from executing this operation.>The transfer protocol for the operation. The value overrides schemes.rDeclares this operation to be deprecated. Usage of the declared operation should be refrained. Default value is False.BA declaration of which security schemes are applied for this operation. The list of values describes alternative security schemes that can be used (that is, there is a logical OR between the security requirements). This definition overrides any declared top-level security. To remove a top-level security declaration, Just [] can be used.8Describes the operations available on a single path. A  may be empty, due to ACL constraints. The path itself is still exposed to the documentation viewer but they will not know which operations and parameters are available.-A definition of a GET operation on this path.-A definition of a PUT operation on this path..A definition of a POST operation on this path.0A definition of a DELETE operation on this path.1A definition of a OPTIONS operation on this path..A definition of a HEAD operation on this path./A definition of a PATCH operation on this path.-A list of parameters that are applicable for all the operations described under this path. These parameters can be overridden at the operation level, but cannot be removed there. The list MUST NOT include duplicated parameters. A unique parameter is defined by a combination of a name and location.!The transfer protocol of the API.=The host (name or ip) serving the API. It MAY include a port. Host name.Optional port.(License information for the exposed API."The license name used for the API.&A URL to the license used for the API.(Contact information for the exposed API.8The identifying name of the contact person/organization.,The URL pointing to the contact information.5The email address of the contact person/organization.The object provides metadata about the API. The metadata can be used by the clients if needed, and can be presented in the Swagger-UI for convenience.The title of the application.]A short description of the application. GFM syntax can be used for rich text representation.!The Terms of Service for the API.,The contact information for the exposed API.,The license information for the exposed API.aProvides the version of the application API (not to be confused with the specification version).;This is the root document object for the API specification. TProvides metadata about the API. The metadata can be used by the clients if needed. The host (name or ip) serving the API. It MAY include a port. If the host is not included, the host serving the documentation is to be used (including the port). The base path on which the API is served, which is relative to the host. If it is not included, the API is served directly under the host. The value MUST start with a leading slash (/). The transfer protocol of the API. If the schemes is not included, the default scheme to be used is the one used to access the Swagger definition itself.sA list of MIME types the APIs can consume. This is global to all APIs but can be overridden on specific API calls.sA list of MIME types the APIs can produce. This is global to all APIs but can be overridden on specific API calls.The available paths and operations for the API. Holds the relative paths to the individual endpoints. The path is appended to the basePath$ in order to construct the full URL.AAn object to hold data types produced and consumed by operations.An object to hold parameters that can be used across operations. This property does not define global parameters for all operations.An object to hold responses that can be used across operations. This property does not define global responses for all operations.FSecurity scheme definitions that can be used across the specification.A declaration of which security schemes are applied for the API as a whole. The list of values describes alternative security schemes that can be used (that is, there is a logical OR between the security requirements). Individual operations can override this definition.^A list of tags used by the specification with additional metadata. The order of the tags can be used to reflect on their order by the parsing tools. Not all tags that are used by the Operation Object must be declared. The tags that are not declared may be organized randomly or based on the tools' logic. Each tag name in the list MUST be unique."Additional external documentation.5A list of definitions that can be used in references.g:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+g      !"#$%&'}~yz{|xrstuvwqmnopjkl()ghicdefba\]^_`XYZ[TUVWPQRSMNOLGHIJKCDEF@AB=>?:;<~}|{zyxwvutsrqponmlkjihgfedcba`_^]\[ZYXWVUTSRQP*ONMLKJIHGFEDCBA@?>=<;:9876+543210/.-,:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~       !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~)Nickolay Kudasov <nickolay@getshoptv.com> experimentalNone!"34579>ILN      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcKLMN    !"#$%&'()*+,-/01234569:;<@ABCDEFGHI                   ,-*+()&'$%"# !................563412/07777788;<9:====>>??A@DCBFEGHIcba`_^]\[ZYXWVUTSRQPONMLKJ      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcKLMNNone '1345>KLMN jConvert a type into a plain .An example type and instance: 8{-# LANGUAGE OverloadedStrings #-} -- allows to write O literals import Control.Lens data Direction = Up | Down instance ToParamSchema Direction where toParamSchema = mempty & type_ .~ SwaggerString & enum_ .~ [ "Up", "Down" ] !Instead of manually writing your j; instance you can use a default generic implementation of k.To do that, simply add  deriving P( clause to your datatype and declare a j; instance for your datatype without giving definition for k.?For instance, the previous example can be simplified into this: {-# LANGUAGE DeriveGeneric #-} import GHC.Generics (Generic) data Direction = Up | Down deriving Generic instance ToParamSchema Direction k-Convert a type into a plain parameter schema./encode $ toParamSchema (Proxy :: Proxy Integer)"{\"type\":\"integer\"}"l8Default schema for binary data (any sequence of octets).m0Default schema for binary data (base64 encoded).n%Default schema for password string.  "password"; format is used to hint UIs the input needs to be obscured.oDefault plain schema for Q, R types.;encode $ toParamSchemaBoundedIntegral (Proxy :: Proxy Int8)9"{\"maximum\":127,\"minimum\":-128,\"type\":\"integer\"}"qA configurable generic  creator.:set -XDeriveGeneric(data Color = Red | Blue deriving GenericIencode $ genericToParamSchema defaultSchemaOptions (Proxy :: Proxy Color)3"{\"type\":\"string\",\"enum\":[\"Red\",\"Blue\"]}"y*encode $ toParamSchema (Proxy :: Proxy ())("{\"type\":\"string\",\"enum\":[\"_\"]}"0toParamSchema (Proxy :: Proxy UTCTime) ^. formatJust "yyyy-mm-ddThh:MM:ssZ"2toParamSchema (Proxy :: Proxy ZonedTime) ^. formatJust "yyyy-mm-ddThh:MM:ss+hhMM"2toParamSchema (Proxy :: Proxy LocalTime) ^. formatJust "yyyy-mm-ddThh:MM:ss"Format "date" corresponds to  yyyy-mm-dd format.<defghijklmnopqrstuvwxyz{|}~defghijklmnopq<lmnjkop~}|{zyqhixwvutfgsrde8defghijklmnopqrstuvwxyz{|}~ )Nickolay Kudasov <nickolay@getshoptv.com> experimentalNonejklmnoqjkqonlmNone'1345>FKLMN Convert a type into .An example type and instance: 8{-# LANGUAGE OverloadedStrings #-} -- allows to write OB literals {-# LANGUAGE OverloadedLists #-} -- allows to write S and T as lists import Control.Lens data Coord = Coord { x :: Double, y :: Double } instance ToSchema Coord where declareNamedSchema = pure (Just "Coord", schema) where schema = mempty & type_ .~ SwaggerObject & properties .~ [ ("x", toSchemaRef (Proxy :: Proxy Double)) , ("y", toSchemaRef (Proxy :: Proxy Double)) ] & required .~ [ "x", "y" ] !Instead of manually writing your ; instance you can use a default generic implementation of .To do that, simply add  deriving P( clause to your datatype and declare a ; instance for your datatype without giving definition for .?For instance, the previous example can be simplified into this: {-# LANGUAGE DeriveGeneric #-} import GHC.Generics (Generic) data Coord = Coord { x :: Double, y :: Double } deriving Generic instance ToSchema Coord Convert a type into an optionally named schema together with all used definitions. Note that the schema itself is included in definitions only if it is recursive (and thus needs its definition in scope).EConvert a type into a schema and declare all used schema definitions./Convert a type into an optionally named schema.-toNamedSchema (Proxy :: Proxy String) ^. nameNothing8encode (toNamedSchema (Proxy :: Proxy String) ^. schema)"{\"type\":\"string\"}"*toNamedSchema (Proxy :: Proxy Day) ^. name Just "Day"5encode (toNamedSchema (Proxy :: Proxy Day) ^. schema)+"{\"format\":\"date\",\"type\":\"string\"}"(Get type's schema name according to its  instance.schemaName (Proxy :: Proxy Int)Nothing#schemaName (Proxy :: Proxy UTCTime)Just "UTCTime"Convert a type into a schema.'encode $ toSchema (Proxy :: Proxy Int8)9"{\"maximum\":127,\"minimum\":-128,\"type\":\"integer\"}"(encode $ toSchema (Proxy :: Proxy [Day])A"{\"items\":{\"$ref\":\"#/definitions/Day\"},\"type\":\"array\"}"yConvert a type into a referenced schema if possible. Only named schemas can be referenced, nameless schemas are inlined.-encode $ toSchemaRef (Proxy :: Proxy Integer)"{\"type\":\"integer\"}")encode $ toSchemaRef (Proxy :: Proxy Day)""{\"$ref\":\"#/definitions/Day\"}"Convert a type into a referenced schema if possible and declare all used schema definitions. Only named schemas can be referenced, nameless schemas are inlined.KSchema definitions are typically declared for every referenced schema. If m returns a reference, a corresponding schema will be declared (regardless of whether it is recusive or not).CInline any referenced schema if its name satisfies given predicate.NOTE:j if a referenced schema is not found in definitions the predicate is ignored and schema stays referenced.WARNING: @ will produce infinite schemas when inlining recursive schemas.>Inline any referenced schema if its name is in the given list.NOTE:q if a referenced schema is not found in definitions it stays referenced even if it appears in the list of names.WARNING: @ will produce infinite schemas when inlining recursive schemas.GInline all schema references for which the definition can be found in .WARNING: @ will produce infinite schemas when inlining recursive schemas.0Convert a type into a schema without references./encode $ toInlinedSchema (Proxy :: Proxy [Day])J"{\"items\":{\"format\":\"date\",\"type\":\"string\"},\"type\":\"array\"}"WARNING: ? will produce infinite schema when inlining recursive schemas. Inline all  non-recursive3 schemas for which the definition can be found in .8Default schema for binary data (any sequence of octets).0Default schema for binary data (base64 encoded).%Default schema for password string.  "password"; format is used to hint UIs the input needs to be obscured."Make an unrestrictive sketch of a  based on a U? instance. Produced schema can be used for further refinement.encode $ sketchSchema "hello"-"{\"example\":\"hello\",\"type\":\"string\"}"encode $ sketchSchema (1, 2, 3)J"{\"example\":[1,2,3],\"items\":{\"type\":\"number\"},\"type\":\"array\"}""encode $ sketchSchema ("Jack", 25)h"{\"example\":[\"Jack\",25],\"items\":[{\"type\":\"string\"},{\"type\":\"number\"}],\"type\":\"array\"}"Fdata Person = Person { name :: String, age :: Int } deriving (Generic)instance ToJSON Person(encode $ sketchSchema (Person "Jack" 25)"{\"example\":{\"age\":25,\"name\":\"Jack\"},\"required\":[\"age\",\"name\"],\"type\":\"object\",\"properties\":{\"age\":{\"type\":\"number\"},\"name\":{\"type\":\"string\"}}}"Make a restrictive sketch of a  based on a UA instance. Produced schema uses as much constraints as possible.#encode $ sketchStrictSchema "hello"b"{\"maxLength\":5,\"pattern\":\"hello\",\"minLength\":5,\"type\":\"string\",\"enum\":[\"hello\"]}"%encode $ sketchStrictSchema (1, 2, 3)X"{\"minItems\":3,\"uniqueItems\":true,\"items\":[{\"maximum\":1,\"minimum\":1,\"multipleOf\":1,\"type\":\"number\",\"enum\":[1]},{\"maximum\":2,\"minimum\":2,\"multipleOf\":2,\"type\":\"number\",\"enum\":[2]},{\"maximum\":3,\"minimum\":3,\"multipleOf\":3,\"type\":\"number\",\"enum\":[3]}],\"maxItems\":3,\"type\":\"array\",\"enum\":[[1,2,3]]}"(encode $ sketchStrictSchema ("Jack", 25)!"{\"minItems\":2,\"uniqueItems\":true,\"items\":[{\"maxLength\":4,\"pattern\":\"Jack\",\"minLength\":4,\"type\":\"string\",\"enum\":[\"Jack\"]},{\"maximum\":25,\"minimum\":25,\"multipleOf\":25,\"type\":\"number\",\"enum\":[25]}],\"maxItems\":2,\"type\":\"array\",\"enum\":[[\"Jack\",25]]}"Fdata Person = Person { name :: String, age :: Int } deriving (Generic)instance ToJSON Person.encode $ sketchStrictSchema (Person "Jack" 25)^"{\"minProperties\":2,\"required\":[\"age\",\"name\"],\"maxProperties\":2,\"type\":\"object\",\"enum\":[{\"age\":25,\"name\":\"Jack\"}],\"properties\":{\"age\":{\"maximum\":25,\"minimum\":25,\"multipleOf\":25,\"type\":\"number\",\"enum\":[25]},\"name\":{\"maxLength\":4,\"pattern\":\"Jack\",\"minLength\":4,\"type\":\"string\",\"enum\":[\"Jack\"]}}}"Default schema for Q, R types.7encode $ toSchemaBoundedIntegral (Proxy :: Proxy Int16)="{\"maximum\":32767,\"minimum\":-32768,\"type\":\"integer\"}"!Default generic named schema for Q, R types.A configurable generic  creator.A configurable generic $ creator. This function applied to  is used as the default for " when the type is an instance of P. Lift a plain  into a model . Lift a plain  into a model .Record fields.Optional record fields.Single field constructor.>NOTE: This schema does not account for the uniqueness of keys.+toSchema (Proxy :: Proxy UTCTime) ^. formatJust "yyyy-mm-ddThh:MM:ssZ"Format "date" corresponds to yyyy-mm-ddThh:MM:ss(Z|+hh:MM) format.-toSchema (Proxy :: Proxy LocalTime) ^. formatJust "yyyy-mm-ddThh:MM:ss"Format "date" corresponds to  yyyy-mm-dd format.v     1v     q      )Nickolay Kudasov <nickolay@getshoptv.com> experimentalNone)Nickolay Kudasov <nickolay@getshoptv.com> experimentalNoneIN pPrepend path piece to all operations of the spec. Leading and trailing slashes are trimmed/added automatically.<let api = (mempty :: Swagger) & paths .~ [("/info", mempty)]2encode $ prependPath "user/{user_id}" api ^. paths"{\"/user/{user_id}/info\":{}}"!All operations of a Swagger spec. sub: will traverse only those operations that are present in sub . Note that ( is determined by both path and method./let ok = (mempty :: Operation) & at 200 ?~ "OK"Ulet api = (mempty :: Swagger) & paths .~ [("/user", mempty & get ?~ ok & post ?~ ok)]Llet sub = (mempty :: Swagger) & paths .~ [("/user", mempty & get ?~ mempty)] encode api"{\"swagger\":\"2.0\",\"info\":{\"version\":\"\",\"title\":\"\"},\"paths\":{\"/user\":{\"post\":{\"responses\":{\"200\":{\"description\":\"OK\"}}},\"get\":{\"responses\":{\"200\":{\"description\":\"OK\"}}}}}}"7encode $ api & operationsOf sub . at 404 ?~ "Not found""{\"swagger\":\"2.0\",\"info\":{\"version\":\"\",\"title\":\"\"},\"paths\":{\"/user\":{\"post\":{\"responses\":{\"200\":{\"description\":\"OK\"}}},\"get\":{\"responses\":{\"404\":{\"description\":\"Not found\"},\"200\":{\"description\":\"OK\"}}}}}}"@Apply tags to all operations and update the global list of tags.  =   IApply tags to a part of Swagger spec and update the global list of tags.Construct a response with 3 while declaring all necessary schema definitions.Aencode $ runDeclare (declareResponse (Proxy :: Proxy Day)) memptyz"[{\"Day\":{\"format\":\"date\",\"type\":\"string\"}},{\"schema\":{\"$ref\":\"#/definitions/Day\"},\"description\":\"\"}]"RSet response for all operations. This will also update global schema definitions.6If the response already exists it will be overwritten.  =   Example:Llet api = (mempty :: Swagger) & paths .~ [("/user", mempty & get ?~ mempty)].let res = declareResponse (Proxy :: Proxy Day)"encode $ api & setResponse 200 res"{\"swagger\":\"2.0\",\"info\":{\"version\":\"\",\"title\":\"\"},\"definitions\":{\"Day\":{\"format\":\"date\",\"type\":\"string\"}},\"paths\":{\"/user\":{\"get\":{\"responses\":{\"200\":{\"schema\":{\"$ref\":\"#/definitions/Day\"},\"description\":\"\"}}}}}}" See also .\Set or update response for all operations. This will also update global schema definitions.FIf the response already exists, but it can't be dereferenced (invalid $ref'), then just the new response is used.  =    See also .XSet response for specified operations. This will also update global schema definitions.6If the response already exists it will be overwritten. See also .bSet or update response for specified operations. This will also update global schema definitions.FIf the response already exists, but it can't be dereferenced (invalid $ref'), then just the new response is used. See also .     (c) 2015 GetShopTVBSD3)Nickolay Kudasov <nickolay@getshoptv.com> experimentalNone!"-3579CIMNU Value validation.#Validation configuration.%Pattern checker for  validation.&2Schema definitions in scope to resolve references.'Validation result type.(0Validation failed with a list of error messages.)Validation passed.*Validation error message.+ Validate U instance matches ] for a given value. This can be used with QuickCheck to ensure those instances are coherent:validateToJSON (x :: Int) == []NOTE: +2 does not perform string pattern validation. See ,., Validate U instance matches q for a given value and pattern checker. This can be used with QuickCheck to ensure those instances are coherent.$For validation without patterns see +.-Default #: defaultConfig = # { % = \_pattern _str -> True , & = mempty } 0Issue an error message.1Validation passed.2QValidate schema's property given a lens into that property and property checker.3*Validate same value with different schema.47Validate same value with a part of the original schema.5OValidate value against a schema given schema reference and validation function.7Validate JSON V with Swagger .8Validate JSON V with Swagger .) !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGH! !"#$%&'()*+,-./0123456789:;<=>?@)+,*'()HGF#$%&- !"EDCBA./0123456789:;<=>?@" !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGH )Nickolay Kudasov <nickolay@getshoptv.com> experimentalNone*+,+,* )Nickolay Kudasov <nickolay@getshoptv.com> experimentalNone:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~         !"#$%&'()*+,-/01234569:;<@ABCDEFGHIjklmnoq*+,     GHIJKLmnopqjkl}~yz{|rstuvwxPQRSTUVWMNOcdefghiXYZ[\]^_`baCDEF@AB=>?:;<W !"#$%&'()*+,-./01234567889:;<=>?@ABCDEFFGHIJKKLMMNOPPQRSTUUVWWXYZ[\]^^_`abcdefghhijklmnnoppqrsttuvwxyzz{|}}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghi,jklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~UU                          ! " # $ % & ' ( ) * + , - . / 0 1 2 3456789:;<=>?@7AB7CD7EFGHIJKLMNOMPQRswagg_HHb28eQHOFrLcPc6HbTSP6Data.Swagger.SchemaOptionsData.Swagger.Internal.UtilsData.Swagger.DeclareData.Swagger.InternalData.Swagger.Lens!Data.Swagger.Internal.ParamSchemaData.Swagger.Internal.SchemaData.Swagger.Operation'Data.Swagger.Internal.Schema.ValidationData.Swagger.ParamSchemaData.Swagger.SchemaData.Swagger.Schema.Validation Data.Swagger SchemaOptionsfieldLabelModifierconstructorTagModifierdatatypeNameModifierallNullaryToStringTagunwrapUnaryRecordsdefaultSchemaOptions SwaggerMonoid swaggerMemptyswaggerMappendGMonoidgmemptygmappendswaggerFieldRules gunfoldEnumhashMapMapKeyshashMapTraverseKeyshashMapReadKeys jsonPrefix parseOneOfomitEmptiesExcept omitEmptiesgenericToJSONWithSubgenericParseJSONWithSub<+> withDefaults genericMemptygenericMappend$fSwaggerMonoidMaybe$fSwaggerMonoidText$fSwaggerMonoidHashMap$fSwaggerMonoidMap$fSwaggerMonoidSet$fSwaggerMonoid[] $fGMonoidM1 $fGMonoidK1 $fGMonoid:*: $fGMonoidU1Declare MonadDeclaredeclarelookDeclareT runDeclareTlooks evalDeclareT execDeclareT undeclareT runDeclare evalDeclare execDeclare undeclare$fMonadDeclaredDeclareT$fMonadTransDeclareT$fMonadDeclareT$fApplicativeDeclareTURLgetUrl ReferencedRefInline Reference getReference ExternalDocs_externalDocsDescription_externalDocsUrlTag_tagName_tagDescription_tagExternalDocsTagNameSecurityRequirementgetSecurityRequirementSecurityScheme_securitySchemeType_securitySchemeDescriptionSecuritySchemeTypeSecuritySchemeBasicSecuritySchemeApiKeySecuritySchemeOAuth2 OAuth2Params _oauth2Flow _oauth2Scopes OAuth2FlowOAuth2ImplicitOAuth2PasswordOAuth2ApplicationOAuth2AccessCodeTokenURLAuthorizationURL ApiKeyParams _apiKeyName _apiKeyInApiKeyLocation ApiKeyQuery ApiKeyHeaderExample getExampleHeader_headerDescription_headerParamSchema HeaderNameResponse_responseDescription_responseSchema_responseHeaders_responseExamplesHttpStatusCode Responses_responsesDefault_responsesResponsesXml_xmlName _xmlNamespace _xmlPrefix _xmlAttribute _xmlWrapped ParamSchema_paramSchemaDefault_paramSchemaType_paramSchemaFormat_paramSchemaItems_paramSchemaMaximum_paramSchemaExclusiveMaximum_paramSchemaMinimum_paramSchemaExclusiveMinimum_paramSchemaMaxLength_paramSchemaMinLength_paramSchemaPattern_paramSchemaMaxItems_paramSchemaMinItems_paramSchemaUniqueItems_paramSchemaEnum_paramSchemaMultipleOfPattern NamedSchema_namedSchemaName_namedSchemaSchemaSchema _schemaTitle_schemaDescription_schemaRequired _schemaAllOf_schemaProperties_schemaAdditionalProperties_schemaDiscriminator_schemaReadOnly _schemaXml_schemaExternalDocs_schemaExample_schemaMaxProperties_schemaMinProperties_schemaParamSchema ParamNameCollectionFormat CollectionCSV CollectionSSV CollectionTSVCollectionPipesCollectionMultiFormat ParamLocation ParamQuery ParamHeader ParamPath ParamFormData SwaggerType SwaggerString SwaggerNumberSwaggerIntegerSwaggerBoolean SwaggerArray SwaggerFile SwaggerNull SwaggerObject SwaggerItemsSwaggerItemsPrimitiveSwaggerItemsObjectSwaggerItemsArrayParamOtherSchema_paramOtherSchemaIn _paramOtherSchemaAllowEmptyValue_paramOtherSchemaParamSchemaParamAnySchema ParamBody ParamOtherParam _paramName_paramDescription_paramRequired _paramSchemaMimeList getMimeList Operation_operationTags_operationSummary_operationDescription_operationExternalDocs_operationOperationId_operationConsumes_operationProduces_operationParameters_operationResponses_operationSchemes_operationDeprecated_operationSecurityPathItem _pathItemGet _pathItemPut _pathItemPost_pathItemDelete_pathItemOptions _pathItemHead_pathItemPatch_pathItemParametersSchemeHttpHttpsWsWssHost _hostName _hostPortLicense _licenseName _licenseUrlContact _contactName _contactUrl _contactEmailInfo _infoTitle_infoDescription_infoTermsOfService _infoContact _infoLicense _infoVersionSwagger _swaggerInfo _swaggerHost_swaggerBasePath_swaggerSchemes_swaggerConsumes_swaggerProduces _swaggerPaths_swaggerDefinitions_swaggerParameters_swaggerResponses_swaggerSecurityDefinitions_swaggerSecurity _swaggerTags_swaggerExternalDocs Definitions hostConstr hostDataTypemimeListConstrmimeListDataTypeswaggerItemsPrimitiveConstrswaggerItemsDataTypeswaggerTypeConstrswaggerTypeDataTypeswaggerCommonTypesswaggerParamTypesswaggerSchemaTypesswaggerTypeConstrscollectionFormatConstrcollectionFormatDataTypecollectionCommonFormats exampleConstrexampleDataTypereferencedToJSONreferencedParseJSON$fFromJSONParamSchema$fFromJSONCollectionFormat$fFromJSONCollectionFormat0$fFromJSONSwaggerType$fFromJSONSwaggerType0$fFromJSONSwaggerType1 $fFromJSONXml$fFromJSONReferenced$fFromJSONReferenced0$fFromJSONReferenced1$fFromJSONReference$fFromJSONPathItem$fFromJSONOperation$fFromJSONResponse$fFromJSONExample$fFromJSONResponses$fFromJSONParamOtherSchema$fFromJSONParamAnySchema$fFromJSONParam$fFromJSONMimeList$fFromJSONHost$fFromJSONSwaggerItems$fFromJSONSwaggerItems0$fFromJSONHeader$fFromJSONSchema$fFromJSONSecurityScheme$fFromJSONSwagger$fFromJSONSecuritySchemeType$fFromJSONOAuth2Params$fFromJSONOAuth2Flow$fToJSONParamSchema$fToJSONCollectionFormat$fToJSONSwaggerType$fToJSONReferenced$fToJSONReferenced0$fToJSONReferenced1$fToJSONReference$fToJSONExample$fToJSONPathItem$fToJSONOperation$fToJSONResponse$fToJSONResponses$fToJSONParamOtherSchema$fToJSONParamAnySchema $fToJSONParam$fToJSONMimeList $fToJSONHost$fToJSONSwaggerItems$fToJSONHeader$fToJSONSchema$fToJSONSecurityScheme$fToJSONSwagger$fToJSONSecuritySchemeType$fToJSONOAuth2Params$fToJSONOAuth2Flow$fFromJSONExternalDocs $fFromJSONTag$fFromJSONScheme$fFromJSONApiKeyParams$fFromJSONApiKeyLocation$fFromJSONLicense$fFromJSONContact$fFromJSONInfo$fFromJSONParamLocation $fToJSONXml$fToJSONExternalDocs $fToJSONTag$fToJSONScheme$fToJSONApiKeyParams$fToJSONApiKeyLocation$fToJSONLicense$fToJSONContact $fToJSONInfo$fToJSONParamLocation$fSwaggerMonoidParamAnySchema$fSwaggerMonoidReferenced$fSwaggerMonoidParamLocation$fSwaggerMonoidSwaggerType$fSwaggerMonoidMimeList$fSwaggerMonoidOperation$fSwaggerMonoidExternalDocs$fSwaggerMonoidResponse$fSwaggerMonoidResponses$fSwaggerMonoidParamOtherSchema$fSwaggerMonoidParam$fSwaggerMonoidParamSchema$fSwaggerMonoidSchema$fSwaggerMonoidPathItem$fSwaggerMonoidInfo$fMonoidExample$fMonoidOperation$fMonoidExternalDocs$fMonoidResponse$fMonoidResponses$fMonoidHeader$fMonoidParamOtherSchema $fMonoidParam$fMonoidParamSchema$fMonoidSchema$fMonoidPathItem$fMonoidContact $fMonoidInfo$fMonoidSwagger$fIsStringReferenced $fIsStringTag $fDataExample$fIsStringResponse$fDataCollectionFormat$fDataSwaggerType$fDataSwaggerType0$fDataSwaggerType1$fDataSwaggerItems$fDataMimeList $fDataHost$fIsStringHost$fIsStringLicenseHasTagstagsHasSecurityDefinitionssecurityDefinitions HasSecuritysecurity HasSchemesschemes HasResponses responses HasProducesproducesHasPathspaths HasParameters parametersHasInfoinfoHasHosthostHasExternalDocs externalDocsHasDefinitions definitions HasConsumesconsumes HasBasePathbasePath$fHasTagsSwaggerSetHasPortportHasNamename$fHasPortHostMaybe HasVersionversionHasTitletitleHasTermsOfServicetermsOfService HasLicenselicenseHasDescription description HasContactcontact$fHasVersionInfoTextHasUrlurlHasEmailemail$fHasUrlContactMaybe$fHasUrlLicenseMaybeHasPutputHasPostpostHasPatchpatch HasOptionsoptionsHasHeadhead_HasGetget HasDeletedelete$fHasPutPathItemMaybe$fHasNameTagText HasSummarysummaryHasOperationId operationId HasDeprecated deprecated$fHasTagsOperationSet HasSchemaschema HasRequiredrequired$fHasSchemaParamParamAnySchemaHasParamSchema paramSchemaHasInin_HasAllowEmptyValueallowEmptyValue+$fHasParamSchemaParamOtherSchemaParamSchema!$fHasParamSchemaHeaderParamSchemaHasXmlxml HasReadOnlyreadOnly HasProperties propertiesHasMinProperties minPropertiesHasMaxProperties maxProperties HasExampleexampleHasDiscriminator discriminatorHasAllOfallOfHasAdditionalPropertiesadditionalProperties$fHasXmlSchemaMaybe$fHasSchemaNamedSchemaSchemaHasUniqueItems uniqueItemsHasTypetype_ HasPatternpattern HasMultipleOf multipleOf HasMinimumminimum_ HasMinLength minLength HasMinItemsminItems HasMaximummaximum_ HasMaxLength maxLength HasMaxItemsmaxItemsHasItemsitems HasFormatformatHasExclusiveMinimumexclusiveMinimumHasExclusiveMaximumexclusiveMaximumHasEnumenum_ HasDefaultdefault_ $fHasUniqueItemsParamSchemaMaybe HasWrappedwrapped HasPrefixprefix HasNamespace namespace HasAttribute attribute$fHasWrappedXmlMaybe$fHasResponsesResponsesHashMap HasHeadersheaders HasExamplesexamples$fHasSchemaResponseMaybe)$fHasTypeSecuritySchemeSecuritySchemeType$fHasUrlExternalDocsURL _ParamBody _ParamOther_SecuritySchemeBasic_SecuritySchemeApiKey_SecuritySchemeOAuth2_Ref_Inline_SwaggerItemsArray_SwaggerItemsObject_SwaggerItemsPrimitive$fHasMultipleOfsMaybe$fHasEnumsMaybe$fHasUniqueItemssMaybe$fHasMinItemssMaybe$fHasMaxItemssMaybe$fHasPatternsMaybe$fHasMinLengthsMaybe$fHasMaxLengthsMaybe$fHasExclusiveMinimumsMaybe$fHasMinimumsMaybe$fHasExclusiveMaximumsMaybe$fHasMaximumsMaybe$fHasItemssMaybe$fHasFormatsMaybe!$fHasDefaultParamOtherSchemaMaybe$fHasDefaultSchemaMaybe$fHasDefaultHeaderMaybe$$fHasTypeParamOtherSchemaSwaggerType$fHasTypeNamedSchemaSwaggerType$fHasTypeSchemaSwaggerType$fHasTypeHeaderSwaggerType&$fHasParamSchemaNamedSchemaParamSchema $fAtOperation$fIxedOperation $fAtResponses$fIxedResponsesProxy3GEnumParamSchemagenumParamSchemaGToParamSchemagtoParamSchema ToParamSchema toParamSchemabinaryParamSchemabyteParamSchemapasswordParamSchematoParamSchemaBoundedIntegraltimeParamSchemagenericToParamSchema$fGEnumParamSchemaM1$fGEnumParamSchema:+:$fGToParamSchema:+:$fGToParamSchemaK1$fGToParamSchemaM1$fGToParamSchemaM10$fGToParamSchemaM11$fToParamSchema()$fToParamSchemaHashSet$fToParamSchemaSet$fToParamSchemaVector$fToParamSchemaVector0$fToParamSchemaVector1$fToParamSchemaVector2$fToParamSchema[]$fToParamSchemaDual$fToParamSchemaLast$fToParamSchemaFirst$fToParamSchemaProduct$fToParamSchemaSum$fToParamSchemaAny$fToParamSchemaAll$fToParamSchemaText$fToParamSchemaText0$fToParamSchemaNominalDiffTime$fToParamSchemaUTCTime$fToParamSchemaZonedTime$fToParamSchemaLocalTime$fToParamSchemaDay$fToParamSchemaFloat$fToParamSchemaDouble$fToParamSchemaScientific$fToParamSchemaChar$fToParamSchemaWord64$fToParamSchemaWord32$fToParamSchemaWord16$fToParamSchemaWord8$fToParamSchemaWord$fToParamSchemaInt64$fToParamSchemaInt32$fToParamSchemaInt16$fToParamSchemaInt8$fToParamSchemaInt$fToParamSchemaInteger$fToParamSchemaBool$fToParamSchema[]0Proxy2 GSumToSchema gsumToSchema AllNullary GToSchemagdeclareNamedSchemaToSchemadeclareNamedSchemaunnamednamedplainunnamerename declareSchema toNamedSchema schemaNametoSchema toSchemaRefdeclareSchemaRefinlineSchemasWhen inlineSchemasinlineAllSchemastoInlinedSchemainlineNonRecursiveSchemas binarySchema byteSchemapasswordSchema sketchSchemasketchStrictSchema timeSchematoSchemaBoundedIntegral#genericToNamedSchemaBoundedIntegralgenericDeclareSchemagenericDeclareNamedSchemagdatatypeSchemaNameparamSchemaToNamedSchemaparamSchemaToSchema nullarySchemagtoNamedSchemagdeclareSchemagdeclareSchemaRef appendItemwithFieldSchemagdeclareNamedSumSchemagsumConToSchemaWithgsumConToSchema$fGSumToSchema(->)M1$fGSumToSchema(->)M10$fGSumToSchema(->)M11$fGSumToSchema(->):+:$fGToSchema:+: $fGToSchemaK1$fGToSchemaK10 $fGToSchemaM1$fGToSchemaM10$fGToSchemaM11$fGToSchemaM12$fGToSchemaM13$fGToSchemaM14$fGToSchema:*:$fToSchemaDual$fToSchemaLast$fToSchemaFirst$fToSchemaProduct $fToSchemaSum $fToSchemaAny $fToSchemaAll$fToSchemaHashSet $fToSchemaSet$fToSchemaVector$fToSchemaVector0$fToSchemaVector1$fToSchemaVector2$fToSchemaHashMap$fToSchemaHashMap0$fToSchemaHashMap1 $fToSchemaMap$fToSchemaMap0$fToSchemaMap1$fToSchemaIntMap$fToSchemaIntSet$fToSchemaText$fToSchemaText0$fToSchemaUTCTime$fToSchemaNominalDiffTime$fToSchemaZonedTime$fToSchemaLocalTime $fToSchemaDay$fToSchema(,,,,,,)$fToSchema(,,,,,)$fToSchema(,,,,)$fToSchema(,,,)$fToSchema(,,) $fToSchema(,) $fToSchema()$fToSchemaEither$fToSchemaMaybe$fToSchemaFloat$fToSchemaDouble$fToSchemaScientific$fToSchemaChar$fToSchemaWord64$fToSchemaWord32$fToSchemaWord16$fToSchemaWord8$fToSchemaWord$fToSchemaInt64$fToSchemaInt32$fToSchemaInt16$fToSchemaInt8 $fToSchemaInt$fToSchemaInteger$fToSchemaBool $fToSchema[] $fToSchema[]0 prependPath allOperations operationsOf applyTags applyTagsFordeclareResponse setResponsesetResponseWithsetResponseForsetResponseForWith Validation runValidationConfigconfigPatternCheckerconfigDefinitionsResultFailedPassedValidationErrorvalidateToJSON validateToJSONWithPatternChecker defaultConfig withConfig withSchemainvalidvalidchecksubsub_withRefvalidateWithSchemaRefvalidateWithSchemavalidateWithParamSchemavalidateIntegervalidateNumbervalidateString validateArrayvalidateObject validateEnumvalidateSchemaTypevalidateParamSchemaType$fMonadValidation$fChoiceValidation$fProfunctorValidation$fAlternativeValidation$fApplicativeValidation $fMonadResult$fAlternativeResult$fApplicativeResultghc-prim GHC.TypesTruebaseGHC.BasefmapTFCo:R:IxValueOperationTFCo:R:IxValueResponsesTFCo:R:IndexOperationTFCo:R:IndexResponsestext_5c7VCmRXJenGcMPs3kwpkIData.Text.InternalText GHC.GenericsGenericGHC.EnumBoundedGHC.RealIntegralconta_2C3ZI8RgPO2LBMidXKTvIU Data.Map.BaseMapunord_8BVO2aaPxdK7U6ObhjDGGEData.HashMap.BaseHashMapaeson_1MzmS1HzophHVfuEBYhMrRData.Aeson.Types.ClassToJSONData.Aeson.Types.InternalValue