diff --git a/README.md b/README.md
--- a/README.md
+++ b/README.md
@@ -70,6 +70,7 @@
 | generateFormUrlEncodedInstances | Generate FromForm/ToForm instances for models used by x-www-form-urlencoded operations (model fields must be primitive types) | true     | true |
 | generateLenses                  | Generate Lens optics for Models                                                                                               | true     | true                  |
 | generateModelConstructors       | Generate smart constructors (only supply required fields) for models                                                          | true     | true       |
+| inlineConsumesContentTypes      | Inline (hardcode) the content-type on operations that do not have multiple content-types (Consumes)                           | false    | false      |
 | modelDeriving                   | Additional classes to include in the deriving() clause of Models                                                              |          |                    |
 | strictFields                    | Add strictness annotations to all model fields                                                                                | true     | true                  |
 | useMonadLogger                  | Use the monad-logger package to provide logging (if instead false, use the katip logging package)                             | false    | false                |
@@ -109,10 +110,11 @@
 | MODULE              | NOTES                                               |
 | ------------------- | --------------------------------------------------- |
 | SwaggerPetstore.Client    | use the "dispatch" functions to send requests       |
-| SwaggerPetstore.API       | construct requetss                                  |
-| SwaggerPetstore.Model     | describes models                                    |
+| SwaggerPetstore.Core      | core funcions, config and request types             |
+| SwaggerPetstore.API       | construct api requests                              |
+| SwaggerPetstore.Model     | describes api models                                |
 | SwaggerPetstore.MimeTypes | encoding/decoding MIME types (content-types/accept) |
-| SwaggerPetstore.Lens      | lenses for model fields                             |
+| SwaggerPetstore.ModelLens | lenses for model fields                             |
 | SwaggerPetstore.Logging   | logging functions and utils                         |
 
 
diff --git a/lib/SwaggerPetstore.hs b/lib/SwaggerPetstore.hs
--- a/lib/SwaggerPetstore.hs
+++ b/lib/SwaggerPetstore.hs
@@ -14,17 +14,19 @@
 -}
 
 module SwaggerPetstore
-  ( module SwaggerPetstore.Client
-  , module SwaggerPetstore.API
-  , module SwaggerPetstore.Model
-  , module SwaggerPetstore.MimeTypes
-  , module SwaggerPetstore.Lens
+  ( module SwaggerPetstore.API
+  , module SwaggerPetstore.Client
+  , module SwaggerPetstore.Core
   , module SwaggerPetstore.Logging
+  , module SwaggerPetstore.MimeTypes
+  , module SwaggerPetstore.Model
+  , module SwaggerPetstore.ModelLens
   ) where
 
 import SwaggerPetstore.API
 import SwaggerPetstore.Client
-import SwaggerPetstore.Model
-import SwaggerPetstore.MimeTypes
-import SwaggerPetstore.Lens
+import SwaggerPetstore.Core
 import SwaggerPetstore.Logging
+import SwaggerPetstore.MimeTypes
+import SwaggerPetstore.Model
+import SwaggerPetstore.ModelLens
diff --git a/lib/SwaggerPetstore/API.hs b/lib/SwaggerPetstore/API.hs
--- a/lib/SwaggerPetstore/API.hs
+++ b/lib/SwaggerPetstore/API.hs
@@ -14,6 +14,7 @@
 -}
 
 {-# LANGUAGE ConstraintKinds #-}
+{-# LANGUAGE ExistentialQuantification #-}
 {-# LANGUAGE FlexibleContexts #-}
 {-# LANGUAGE FlexibleInstances #-}
 {-# LANGUAGE GeneralizedNewtypeDeriving #-}
@@ -23,49 +24,38 @@
 {-# LANGUAGE OverloadedStrings #-}
 {-# LANGUAGE RecordWildCards #-}
 {-# LANGUAGE ScopedTypeVariables #-}
-{-# LANGUAGE ExistentialQuantification #-}
 {-# OPTIONS_GHC -fno-warn-name-shadowing -fno-warn-unused-binds -fno-warn-unused-imports #-}
 
 module SwaggerPetstore.API where
 
-
-import SwaggerPetstore.Model as M
+import SwaggerPetstore.Core
 import SwaggerPetstore.MimeTypes
-import SwaggerPetstore.Lens
+import SwaggerPetstore.Model as M
 
 import qualified Data.Aeson as A
-
-import qualified Data.Time as TI
-
 import qualified Data.ByteString as B
-import qualified Data.ByteString.Lazy as BL
-import qualified Data.ByteString.Builder as BB
-import qualified Data.ByteString.Char8 as BC
-import qualified Data.ByteString.Lazy.Char8 as BCL
 import qualified Data.ByteString.Base64 as B64
-
-import qualified Network.HTTP.Client.MultipartFormData as NH
-import qualified Network.HTTP.Media as ME
-import qualified Network.HTTP.Types as NH
-
-import qualified Web.HttpApiData as WH
-import qualified Web.FormUrlEncoded as WH
-
-import qualified Data.CaseInsensitive as CI
+import qualified Data.ByteString.Char8 as BC
+import qualified Data.ByteString.Lazy as BL
 import qualified Data.Data as P (Typeable, TypeRep, typeOf, typeRep)
 import qualified Data.Foldable as P
 import qualified Data.Map as Map
-import qualified Data.Set as Set
 import qualified Data.Maybe as P
 import qualified Data.Proxy as P (Proxy(..))
+import qualified Data.Set as Set
+import qualified Data.String as P
 import qualified Data.Text as T
 import qualified Data.Text.Encoding as T
 import qualified Data.Text.Lazy as TL
 import qualified Data.Text.Lazy.Encoding as TL
+import qualified Data.Time as TI
 import qualified GHC.Base as P (Alternative)
-import qualified Control.Arrow as P (left)
-
 import qualified Lens.Micro as L
+import qualified Network.HTTP.Client.MultipartFormData as NH
+import qualified Network.HTTP.Media as ME
+import qualified Network.HTTP.Types as NH
+import qualified Web.FormUrlEncoded as WH
+import qualified Web.HttpApiData as WH
 
 import Data.Monoid ((<>))
 import Data.Function ((&))
@@ -993,240 +983,46 @@
 
 
 
--- * HasBodyParam
-
--- | Designates the body parameter of a request
-class HasBodyParam req param where
-  setBodyParam :: forall contentType res. (Consumes req contentType, MimeRender contentType param) => SwaggerPetstoreRequest req contentType res -> param -> SwaggerPetstoreRequest req contentType res
-  setBodyParam req xs =
-    req `_setBodyLBS` mimeRender (P.Proxy :: P.Proxy contentType) xs & _setContentTypeHeader
-
--- * HasOptionalParam
-
--- | Designates the optional parameters of a request
-class HasOptionalParam req param where
-  {-# MINIMAL applyOptionalParam | (-&-) #-}
-
-  -- | Apply an optional parameter to a request
-  applyOptionalParam :: SwaggerPetstoreRequest req contentType res -> param -> SwaggerPetstoreRequest req contentType res
-  applyOptionalParam = (-&-)
-  {-# INLINE applyOptionalParam #-}
-
-  -- | infix operator \/ alias for 'addOptionalParam'
-  (-&-) :: SwaggerPetstoreRequest req contentType res -> param -> SwaggerPetstoreRequest req contentType res
-  (-&-) = applyOptionalParam
-  {-# INLINE (-&-) #-}
-
-infixl 2 -&-
- 
--- * SwaggerPetstoreRequest
-
--- | Represents a request. The "req" type variable is the request type. The "res" type variable is the response type.
-data SwaggerPetstoreRequest req contentType res = SwaggerPetstoreRequest
-  { rMethod  :: NH.Method   -- ^ Method of SwaggerPetstoreRequest
-  , rUrlPath :: [BCL.ByteString] -- ^ Endpoint of SwaggerPetstoreRequest
-  , rParams   :: Params -- ^ params of SwaggerPetstoreRequest
-  , rAuthTypes :: [P.TypeRep] -- ^ types of auth methods
-  }
-  deriving (P.Show)
-
--- | 'rMethod' Lens
-rMethodL :: Lens_' (SwaggerPetstoreRequest req contentType res) NH.Method
-rMethodL f SwaggerPetstoreRequest{..} = (\rMethod -> SwaggerPetstoreRequest { rMethod, ..} ) <$> f rMethod
-{-# INLINE rMethodL #-}
-
--- | 'rUrlPath' Lens
-rUrlPathL :: Lens_' (SwaggerPetstoreRequest req contentType res) [BCL.ByteString]
-rUrlPathL f SwaggerPetstoreRequest{..} = (\rUrlPath -> SwaggerPetstoreRequest { rUrlPath, ..} ) <$> f rUrlPath
-{-# INLINE rUrlPathL #-}
-
--- | 'rParams' Lens
-rParamsL :: Lens_' (SwaggerPetstoreRequest req contentType res) Params
-rParamsL f SwaggerPetstoreRequest{..} = (\rParams -> SwaggerPetstoreRequest { rParams, ..} ) <$> f rParams
-{-# INLINE rParamsL #-}
-
--- | 'rParams' Lens
-rAuthTypesL :: Lens_' (SwaggerPetstoreRequest req contentType res) [P.TypeRep]
-rAuthTypesL f SwaggerPetstoreRequest{..} = (\rAuthTypes -> SwaggerPetstoreRequest { rAuthTypes, ..} ) <$> f rAuthTypes
-{-# INLINE rAuthTypesL #-}
-
--- | Request Params
-data Params = Params
-  { paramsQuery :: NH.Query
-  , paramsHeaders :: NH.RequestHeaders
-  , paramsBody :: ParamBody
-  }
-  deriving (P.Show)
-
--- | 'paramsQuery' Lens
-paramsQueryL :: Lens_' Params NH.Query
-paramsQueryL f Params{..} = (\paramsQuery -> Params { paramsQuery, ..} ) <$> f paramsQuery
-{-# INLINE paramsQueryL #-}
-
--- | 'paramsHeaders' Lens
-paramsHeadersL :: Lens_' Params NH.RequestHeaders
-paramsHeadersL f Params{..} = (\paramsHeaders -> Params { paramsHeaders, ..} ) <$> f paramsHeaders
-{-# INLINE paramsHeadersL #-}
-
--- | 'paramsBody' Lens
-paramsBodyL :: Lens_' Params ParamBody
-paramsBodyL f Params{..} = (\paramsBody -> Params { paramsBody, ..} ) <$> f paramsBody
-{-# INLINE paramsBodyL #-}
-
--- | Request Body
-data ParamBody
-  = ParamBodyNone
-  | ParamBodyB B.ByteString
-  | ParamBodyBL BL.ByteString
-  | ParamBodyFormUrlEncoded WH.Form
-  | ParamBodyMultipartFormData [NH.Part]
-  deriving (P.Show)
-
--- ** SwaggerPetstoreRequest Utils
-
-_mkRequest :: NH.Method -- ^ Method 
-          -> [BCL.ByteString] -- ^ Endpoint
-          -> SwaggerPetstoreRequest req contentType res -- ^ req: Request Type, res: Response Type
-_mkRequest m u = SwaggerPetstoreRequest m u _mkParams []
-
-_mkParams :: Params
-_mkParams = Params [] [] ParamBodyNone
-
-setHeader :: SwaggerPetstoreRequest req contentType res -> [NH.Header] -> SwaggerPetstoreRequest req contentType res
-setHeader req header =
-  req `removeHeader` P.fmap P.fst header &
-  L.over (rParamsL . paramsHeadersL) (header P.++)
-
-removeHeader :: SwaggerPetstoreRequest req contentType res -> [NH.HeaderName] -> SwaggerPetstoreRequest req contentType res
-removeHeader req header =
-  req &
-  L.over
-    (rParamsL . paramsHeadersL)
-    (P.filter (\h -> cifst h `P.notElem` P.fmap CI.mk header))
-  where
-    cifst = CI.mk . P.fst
-
-
-_setContentTypeHeader :: forall req contentType res. MimeType contentType => SwaggerPetstoreRequest req contentType res -> SwaggerPetstoreRequest req contentType res
-_setContentTypeHeader req =
-    case mimeType (P.Proxy :: P.Proxy contentType) of 
-        Just m -> req `setHeader` [("content-type", BC.pack $ P.show m)]
-        Nothing -> req `removeHeader` ["content-type"]
-
-_setAcceptHeader :: forall req contentType res accept. MimeType accept => SwaggerPetstoreRequest req contentType res -> accept -> SwaggerPetstoreRequest req contentType res
-_setAcceptHeader req accept =
-    case mimeType' accept of 
-        Just m -> req `setHeader` [("accept", BC.pack $ P.show m)]
-        Nothing -> req `removeHeader` ["accept"]
-
-setQuery :: SwaggerPetstoreRequest req contentType res -> [NH.QueryItem] -> SwaggerPetstoreRequest req contentType res
-setQuery req query = 
-  req &
-  L.over
-    (rParamsL . paramsQueryL)
-    ((query P.++) . P.filter (\q -> cifst q `P.notElem` P.fmap cifst query))
-  where
-    cifst = CI.mk . P.fst
-
-addForm :: SwaggerPetstoreRequest req contentType res -> WH.Form -> SwaggerPetstoreRequest req contentType res
-addForm req newform = 
-    let form = case paramsBody (rParams req) of
-            ParamBodyFormUrlEncoded _form -> _form
-            _ -> mempty
-    in req & L.set (rParamsL . paramsBodyL) (ParamBodyFormUrlEncoded (newform <> form))
-
-_addMultiFormPart :: SwaggerPetstoreRequest req contentType res -> NH.Part -> SwaggerPetstoreRequest req contentType res
-_addMultiFormPart req newpart = 
-    let parts = case paramsBody (rParams req) of
-            ParamBodyMultipartFormData _parts -> _parts
-            _ -> []
-    in req & L.set (rParamsL . paramsBodyL) (ParamBodyMultipartFormData (newpart : parts))
-
-_setBodyBS :: SwaggerPetstoreRequest req contentType res -> B.ByteString -> SwaggerPetstoreRequest req contentType res
-_setBodyBS req body = 
-    req & L.set (rParamsL . paramsBodyL) (ParamBodyB body)
-
-_setBodyLBS :: SwaggerPetstoreRequest req contentType res -> BL.ByteString -> SwaggerPetstoreRequest req contentType res
-_setBodyLBS req body = 
-    req & L.set (rParamsL . paramsBodyL) (ParamBodyBL body)
-
-_hasAuthType :: AuthMethod authMethod => SwaggerPetstoreRequest req contentType res -> P.Proxy authMethod -> SwaggerPetstoreRequest req contentType res
-_hasAuthType req proxy =
-  req & L.over rAuthTypesL (P.typeRep proxy :)
-
--- ** Params Utils
-
-toPath
-  :: WH.ToHttpApiData a
-  => a -> BCL.ByteString
-toPath = BB.toLazyByteString . WH.toEncodedUrlPiece
-
-toHeader :: WH.ToHttpApiData a => (NH.HeaderName, a) -> [NH.Header]
-toHeader x = [fmap WH.toHeader x]
-
-toForm :: WH.ToHttpApiData v => (BC.ByteString, v) -> WH.Form
-toForm (k,v) = WH.toForm [(BC.unpack k,v)]
-
-toQuery :: WH.ToHttpApiData a => (BC.ByteString, Maybe a) -> [NH.QueryItem]
-toQuery x = [(fmap . fmap) toQueryParam x]
-  where toQueryParam = T.encodeUtf8 . WH.toQueryParam
-
--- *** Swagger `CollectionFormat` Utils
-
--- | Determines the format of the array if type array is used.
-data CollectionFormat
-  = CommaSeparated -- ^ CSV format for multiple parameters.
-  | SpaceSeparated -- ^ Also called "SSV"
-  | TabSeparated -- ^ Also called "TSV"
-  | PipeSeparated -- ^ `value1|value2|value2`
-  | MultiParamArray -- ^ Using multiple GET parameters, e.g. `foo=bar&foo=baz`. This is valid only for parameters in "query" ('NH.Query') or "formData" ('WH.Form')
-
-toHeaderColl :: WH.ToHttpApiData a => CollectionFormat -> (NH.HeaderName, [a]) -> [NH.Header]
-toHeaderColl c xs = _toColl c toHeader xs
-
-toFormColl :: WH.ToHttpApiData v => CollectionFormat -> (BC.ByteString, [v]) -> WH.Form
-toFormColl c xs = WH.toForm $ fmap unpack $ _toColl c toHeader $ pack xs
-  where
-    pack (k,v) = (CI.mk k, v)
-    unpack (k,v) = (BC.unpack (CI.original k), BC.unpack v)
-
-toQueryColl :: WH.ToHttpApiData a => CollectionFormat -> (BC.ByteString, Maybe [a]) -> NH.Query
-toQueryColl c xs = _toCollA c toQuery xs
-
-_toColl :: P.Traversable f => CollectionFormat -> (f a -> [(b, BC.ByteString)]) -> f [a] -> [(b, BC.ByteString)]
-_toColl c encode xs = fmap (fmap P.fromJust) (_toCollA' c fencode BC.singleton (fmap Just xs))
-  where fencode = fmap (fmap Just) . encode . fmap P.fromJust
-        {-# INLINE fencode #-}
-
-_toCollA :: (P.Traversable f, P.Traversable t, P.Alternative t) => CollectionFormat -> (f (t a) -> [(b, t BC.ByteString)]) -> f (t [a]) -> [(b, t BC.ByteString)]
-_toCollA c encode xs = _toCollA' c encode BC.singleton xs
-
-_toCollA' :: (P.Monoid c, P.Traversable f, P.Traversable t, P.Alternative t) => CollectionFormat -> (f (t a) -> [(b, t c)]) -> (Char -> c) -> f (t [a]) -> [(b, t c)]
-_toCollA' c encode one xs = case c of
-  CommaSeparated -> go (one ',')
-  SpaceSeparated -> go (one ' ')
-  TabSeparated -> go (one '\t')
-  PipeSeparated -> go (one '|')
-  MultiParamArray -> expandList
-  where
-    go sep =
-      [P.foldl1 (\(sk, sv) (_, v) -> (sk, (combine sep <$> sv <*> v) <|> sv <|> v)) expandList]
-    combine sep x y = x <> sep <> y
-    expandList = (P.concatMap encode . (P.traverse . P.traverse) P.toList) xs
-    {-# INLINE go #-}
-    {-# INLINE expandList #-}
-    {-# INLINE combine #-}
-  
--- * AuthMethods
-
--- | Provides a method to apply auth methods to requests
-class P.Typeable a => AuthMethod a where
-  applyAuthMethod :: SwaggerPetstoreRequest req contentType res -> a -> SwaggerPetstoreRequest req contentType res
+-- * Parameter newtypes
 
--- | An existential wrapper for any AuthMethod
-data AnyAuthMethod = forall a. AuthMethod a => AnyAuthMethod a deriving (P.Typeable)
+newtype AdditionalMetadata = AdditionalMetadata { unAdditionalMetadata :: Text } deriving (P.Eq, P.Show)
+newtype ApiKey = ApiKey { unApiKey :: Text } deriving (P.Eq, P.Show)
+newtype Body = Body { unBody :: [User] } deriving (P.Eq, P.Show, A.ToJSON)
+newtype Byte = Byte { unByte :: ByteArray } deriving (P.Eq, P.Show)
+newtype Callback = Callback { unCallback :: Text } deriving (P.Eq, P.Show)
+newtype EnumFormString = EnumFormString { unEnumFormString :: Text } deriving (P.Eq, P.Show)
+newtype EnumFormStringArray = EnumFormStringArray { unEnumFormStringArray :: [Text] } deriving (P.Eq, P.Show)
+newtype EnumHeaderString = EnumHeaderString { unEnumHeaderString :: Text } deriving (P.Eq, P.Show)
+newtype EnumHeaderStringArray = EnumHeaderStringArray { unEnumHeaderStringArray :: [Text] } deriving (P.Eq, P.Show)
+newtype EnumQueryDouble = EnumQueryDouble { unEnumQueryDouble :: Double } deriving (P.Eq, P.Show)
+newtype EnumQueryInteger = EnumQueryInteger { unEnumQueryInteger :: Int } deriving (P.Eq, P.Show)
+newtype EnumQueryString = EnumQueryString { unEnumQueryString :: Text } deriving (P.Eq, P.Show)
+newtype EnumQueryStringArray = EnumQueryStringArray { unEnumQueryStringArray :: [Text] } deriving (P.Eq, P.Show)
+newtype File = File { unFile :: FilePath } deriving (P.Eq, P.Show)
+newtype Int32 = Int32 { unInt32 :: Int } deriving (P.Eq, P.Show)
+newtype Int64 = Int64 { unInt64 :: Integer } deriving (P.Eq, P.Show)
+newtype Name2 = Name2 { unName2 :: Text } deriving (P.Eq, P.Show)
+newtype Number = Number { unNumber :: Double } deriving (P.Eq, P.Show)
+newtype OrderId = OrderId { unOrderId :: Integer } deriving (P.Eq, P.Show)
+newtype OrderIdText = OrderIdText { unOrderIdText :: Text } deriving (P.Eq, P.Show)
+newtype Param = Param { unParam :: Text } deriving (P.Eq, P.Show)
+newtype Param2 = Param2 { unParam2 :: Text } deriving (P.Eq, P.Show)
+newtype ParamBinary = ParamBinary { unParamBinary :: Binary } deriving (P.Eq, P.Show)
+newtype ParamDate = ParamDate { unParamDate :: Date } deriving (P.Eq, P.Show)
+newtype ParamDateTime = ParamDateTime { unParamDateTime :: DateTime } deriving (P.Eq, P.Show)
+newtype ParamDouble = ParamDouble { unParamDouble :: Double } deriving (P.Eq, P.Show)
+newtype ParamFloat = ParamFloat { unParamFloat :: Float } deriving (P.Eq, P.Show)
+newtype ParamInteger = ParamInteger { unParamInteger :: Int } deriving (P.Eq, P.Show)
+newtype ParamString = ParamString { unParamString :: Text } deriving (P.Eq, P.Show)
+newtype Password = Password { unPassword :: Text } deriving (P.Eq, P.Show)
+newtype PatternWithoutDelimiter = PatternWithoutDelimiter { unPatternWithoutDelimiter :: Text } deriving (P.Eq, P.Show)
+newtype PetId = PetId { unPetId :: Integer } deriving (P.Eq, P.Show)
+newtype Status = Status { unStatus :: [Text] } deriving (P.Eq, P.Show)
+newtype StatusText = StatusText { unStatusText :: Text } deriving (P.Eq, P.Show)
+newtype Tags = Tags { unTags :: [Text] } deriving (P.Eq, P.Show)
+newtype Username = Username { unUsername :: Text } deriving (P.Eq, P.Show)
 
-instance AuthMethod AnyAuthMethod where applyAuthMethod req (AnyAuthMethod a) = applyAuthMethod req a
+-- * Auth Methods
 
 -- ** AuthApiKeyApiKey
 data AuthApiKeyApiKey =
@@ -1234,9 +1030,11 @@
   deriving (P.Eq, P.Show, P.Typeable)
 
 instance AuthMethod AuthApiKeyApiKey where
-  applyAuthMethod req a@(AuthApiKeyApiKey secret) =
+  applyAuthMethod _ a@(AuthApiKeyApiKey secret) req =
+    P.pure $
     if (P.typeOf a `P.elem` rAuthTypes req)
       then req `setHeader` toHeader ("api_key", secret)
+           & L.over rAuthTypesL (P.filter (/= P.typeOf a))
       else req
 
 -- ** AuthApiKeyApiKeyQuery
@@ -1245,9 +1043,11 @@
   deriving (P.Eq, P.Show, P.Typeable)
 
 instance AuthMethod AuthApiKeyApiKeyQuery where
-  applyAuthMethod req a@(AuthApiKeyApiKeyQuery secret) =
+  applyAuthMethod _ a@(AuthApiKeyApiKeyQuery secret) req =
+    P.pure $
     if (P.typeOf a `P.elem` rAuthTypes req)
       then req `setQuery` toQuery ("api_key_query", Just secret)
+           & L.over rAuthTypesL (P.filter (/= P.typeOf a))
       else req
 
 -- ** AuthBasicHttpBasicTest
@@ -1256,9 +1056,11 @@
   deriving (P.Eq, P.Show, P.Typeable)
 
 instance AuthMethod AuthBasicHttpBasicTest where
-  applyAuthMethod req a@(AuthBasicHttpBasicTest user pw) =
+  applyAuthMethod _ a@(AuthBasicHttpBasicTest user pw) req =
+    P.pure $
     if (P.typeOf a `P.elem` rAuthTypes req)
       then req `setHeader` toHeader ("Authorization", T.decodeUtf8 cred)
+           & L.over rAuthTypesL (P.filter (/= P.typeOf a))
       else req
     where cred = BC.append "Basic " (B64.encode $ BC.concat [ user, ":", pw ])
 
@@ -1268,9 +1070,37 @@
   deriving (P.Eq, P.Show, P.Typeable)
 
 instance AuthMethod AuthOAuthPetstoreAuth where
-  applyAuthMethod req a@(AuthOAuthPetstoreAuth secret) =
+  applyAuthMethod _ a@(AuthOAuthPetstoreAuth secret) req =
+    P.pure $
     if (P.typeOf a `P.elem` rAuthTypes req)
       then req `setHeader` toHeader ("Authorization", "Bearer " <> secret) 
+           & L.over rAuthTypesL (P.filter (/= P.typeOf a))
       else req
+
+
+
+-- * Custom Mime Types
+
+-- ** MimeJsonCharsetutf8
+
+data MimeJsonCharsetutf8 = MimeJsonCharsetutf8 deriving (P.Typeable)
+
+-- | @application/json; charset=utf-8@
+instance MimeType MimeJsonCharsetutf8 where
+  mimeType _ = Just $ P.fromString "application/json; charset=utf-8"
+instance A.ToJSON a => MimeRender MimeJsonCharsetutf8 a where mimeRender _ = A.encode
+instance A.FromJSON a => MimeUnrender MimeJsonCharsetutf8 a where mimeUnrender _ = A.eitherDecode
+-- instance MimeRender MimeJsonCharsetutf8 T.Text where mimeRender _ = undefined
+-- instance MimeUnrender MimeJsonCharsetutf8 T.Text where mimeUnrender _ = undefined
+
+-- ** MimeXmlCharsetutf8
+
+data MimeXmlCharsetutf8 = MimeXmlCharsetutf8 deriving (P.Typeable)
+
+-- | @application/xml; charset=utf-8@
+instance MimeType MimeXmlCharsetutf8 where
+  mimeType _ = Just $ P.fromString "application/xml; charset=utf-8"
+-- instance MimeRender MimeXmlCharsetutf8 T.Text where mimeRender _ = undefined
+-- instance MimeUnrender MimeXmlCharsetutf8 T.Text where mimeUnrender _ = undefined
 
 
diff --git a/lib/SwaggerPetstore/Client.hs b/lib/SwaggerPetstore/Client.hs
--- a/lib/SwaggerPetstore/Client.hs
+++ b/lib/SwaggerPetstore/Client.hs
@@ -25,102 +25,30 @@
 
 module SwaggerPetstore.Client where
 
-import SwaggerPetstore.Model
-import SwaggerPetstore.API
-import SwaggerPetstore.MimeTypes
+import SwaggerPetstore.Core
 import SwaggerPetstore.Logging
+import SwaggerPetstore.MimeTypes
 
+import qualified Control.Exception.Safe as E
 import qualified Control.Monad.IO.Class as P
-import qualified Data.Aeson as A
+import qualified Control.Monad as P
 import qualified Data.Aeson.Types as A
+import qualified Data.ByteString.Char8 as BC
+import qualified Data.ByteString.Lazy as BL
+import qualified Data.ByteString.Lazy.Char8 as BCL
 import qualified Data.Proxy as P (Proxy(..))
-import Data.Function ((&))
-import Data.Monoid ((<>))
-import Data.Text (Text)
-import GHC.Exts (IsString(..))
-import Web.FormUrlEncoded as WH
-import Web.HttpApiData as WH
-import Control.Monad.Catch (MonadThrow)
-
-import qualified Data.Time as TI
-import qualified Data.Map as Map
 import qualified Data.Text as T
 import qualified Data.Text.Encoding as T
-import qualified Text.Printf as T
-
-import qualified Data.ByteString as B
-import qualified Data.ByteString.Lazy as BL
-import qualified Data.ByteString.Char8 as BC
-import qualified Data.ByteString.Lazy.Char8 as BCL
-import qualified Data.ByteString.Builder as BB
 import qualified Network.HTTP.Client as NH
-import qualified Network.HTTP.Client.TLS as NH
 import qualified Network.HTTP.Client.MultipartFormData as NH
-import qualified Network.HTTP.Types.Method as NH
 import qualified Network.HTTP.Types as NH
-import qualified Network.HTTP.Types.URI as NH
-
-import qualified Control.Exception.Safe as E
--- * Config
-
--- | 
-data SwaggerPetstoreConfig = SwaggerPetstoreConfig
-  { configHost  :: BCL.ByteString -- ^ host supplied in the Request
-  , configUserAgent :: Text -- ^ user-agent supplied in the Request
-  , configLogExecWithContext :: LogExecWithContext -- ^ Run a block using a Logger instance
-  , configLogContext :: LogContext -- ^ Configures the logger
-  , configAuthMethods :: [AnyAuthMethod] -- ^ List of configured auth methods
-  }
-
--- | display the config
-instance Show SwaggerPetstoreConfig where
-  show c =
-    T.printf
-      "{ configHost = %v, configUserAgent = %v, ..}"
-      (show (configHost c))
-      (show (configUserAgent c))
-
--- | constructs a default SwaggerPetstoreConfig
---
--- configHost:
---
--- @http://petstore.swagger.io:80/v2@
---
--- configUserAgent:
---
--- @"swagger-haskell-http-client/1.0.0"@
---
-newConfig :: IO SwaggerPetstoreConfig
-newConfig = do
-    logCxt <- initLogContext
-    return $ SwaggerPetstoreConfig
-        { configHost = "http://petstore.swagger.io:80/v2"
-        , configUserAgent = "swagger-haskell-http-client/1.0.0"
-        , configLogExecWithContext = runDefaultLogExecWithContext
-        , configLogContext = logCxt
-        , configAuthMethods = []
-        }  
-
--- | updates config use AuthMethod on matching requests
-addAuthMethod :: AuthMethod auth => SwaggerPetstoreConfig -> auth -> SwaggerPetstoreConfig
-addAuthMethod config@SwaggerPetstoreConfig {configAuthMethods = as} a =
-  config { configAuthMethods = AnyAuthMethod a : as}
-
--- | updates the config to use stdout logging
-withStdoutLogging :: SwaggerPetstoreConfig -> IO SwaggerPetstoreConfig
-withStdoutLogging p = do
-    logCxt <- stdoutLoggingContext (configLogContext p)
-    return $ p { configLogExecWithContext = stdoutLoggingExec, configLogContext = logCxt }
-
--- | updates the config to use stderr logging
-withStderrLogging :: SwaggerPetstoreConfig -> IO SwaggerPetstoreConfig
-withStderrLogging p = do
-    logCxt <- stderrLoggingContext (configLogContext p)
-    return $ p { configLogExecWithContext = stderrLoggingExec, configLogContext = logCxt }
+import qualified Web.FormUrlEncoded as WH
+import qualified Web.HttpApiData as WH
 
--- | updates the config to disable logging
-withNoLogging :: SwaggerPetstoreConfig -> SwaggerPetstoreConfig
-withNoLogging p = p { configLogExecWithContext =  runNullLogExec}
+import Data.Function ((&))
+import Data.Monoid ((<>))
+import Data.Text (Text)
+import GHC.Exts (IsString(..))
 
 -- * Dispatch
 
@@ -243,35 +171,28 @@
   -> SwaggerPetstoreRequest req contentType res -- ^ request
   -> accept -- ^ "accept" 'MimeType'
   -> IO (InitRequest req contentType res accept) -- ^ initialized request
-_toInitRequest config req0 accept = do
-  parsedReq <- NH.parseRequest $ BCL.unpack $ BCL.append (configHost config) (BCL.concat (rUrlPath req0))
-  let req1 = _applyAuthMethods req0 config
-                & _setContentTypeHeader
-                & flip _setAcceptHeader accept
-      reqHeaders = ("User-Agent", WH.toHeader (configUserAgent config)) : paramsHeaders (rParams req1)
-      reqQuery = NH.renderQuery True (paramsQuery (rParams req1))
-      pReq = parsedReq { NH.method = (rMethod req1)
-                       , NH.requestHeaders = reqHeaders
-                       , NH.queryString = reqQuery
-                       }
-  outReq <- case paramsBody (rParams req1) of
-    ParamBodyNone -> pure (pReq { NH.requestBody = mempty })
-    ParamBodyB bs -> pure (pReq { NH.requestBody = NH.RequestBodyBS bs })
-    ParamBodyBL bl -> pure (pReq { NH.requestBody = NH.RequestBodyLBS bl })
-    ParamBodyFormUrlEncoded form -> pure (pReq { NH.requestBody = NH.RequestBodyLBS (WH.urlEncodeForm form) })
-    ParamBodyMultipartFormData parts -> NH.formDataBody parts pReq
-
-  pure (InitRequest outReq)
+_toInitRequest config req0 accept = 
+  runConfigLogWithExceptions "Client" config $ do
+    parsedReq <- P.liftIO $ NH.parseRequest $ BCL.unpack $ BCL.append (configHost config) (BCL.concat (rUrlPath req0))
+    req1 <- P.liftIO $ _applyAuthMethods req0 config
+    P.when
+        (configValidateAuthMethods config && (not . null . rAuthTypes) req1)
+        (E.throwString $ "AuthMethod not configured: " <> (show . head . rAuthTypes) req1)
+    let req2 = req1 & _setContentTypeHeader & flip _setAcceptHeader accept
+        reqHeaders = ("User-Agent", WH.toHeader (configUserAgent config)) : paramsHeaders (rParams req2)
+        reqQuery = NH.renderQuery True (paramsQuery (rParams req2))
+        pReq = parsedReq { NH.method = (rMethod req2)
+                        , NH.requestHeaders = reqHeaders
+                        , NH.queryString = reqQuery
+                        }
+    outReq <- case paramsBody (rParams req2) of
+        ParamBodyNone -> pure (pReq { NH.requestBody = mempty })
+        ParamBodyB bs -> pure (pReq { NH.requestBody = NH.RequestBodyBS bs })
+        ParamBodyBL bl -> pure (pReq { NH.requestBody = NH.RequestBodyLBS bl })
+        ParamBodyFormUrlEncoded form -> pure (pReq { NH.requestBody = NH.RequestBodyLBS (WH.urlEncodeForm form) })
+        ParamBodyMultipartFormData parts -> NH.formDataBody parts pReq
 
--- | apply all matching AuthMethods in config to request
-_applyAuthMethods
-  :: SwaggerPetstoreRequest req contentType res
-  -> SwaggerPetstoreConfig
-  -> SwaggerPetstoreRequest req contentType res
-_applyAuthMethods req SwaggerPetstoreConfig {configAuthMethods = as} =
-  foldl go req as
-  where
-    go r (AnyAuthMethod a) = r `applyAuthMethod` a
+    pure (InitRequest outReq)
 
 -- | modify the underlying Request
 modifyInitRequest :: InitRequest req contentType res accept -> (NH.Request -> NH.Request) -> InitRequest req contentType res accept 
diff --git a/lib/SwaggerPetstore/Core.hs b/lib/SwaggerPetstore/Core.hs
new file mode 100644
--- /dev/null
+++ b/lib/SwaggerPetstore/Core.hs
@@ -0,0 +1,532 @@
+{-
+   Swagger Petstore
+
+   This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+   OpenAPI spec version: 2.0
+   Swagger Petstore API version: 1.0.0
+   Contact: apiteam@swagger.io
+   Generated by Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
+-}
+
+{-|
+Module : SwaggerPetstore.Core
+-}
+
+{-# LANGUAGE DeriveDataTypeable #-}
+{-# LANGUAGE ExistentialQuantification #-}
+{-# LANGUAGE GeneralizedNewtypeDeriving #-}
+{-# LANGUAGE MultiParamTypeClasses #-}
+{-# LANGUAGE NamedFieldPuns #-}
+{-# LANGUAGE OverloadedStrings #-}
+{-# LANGUAGE RankNTypes #-}
+{-# LANGUAGE RecordWildCards #-}
+{-# LANGUAGE ScopedTypeVariables #-}
+{-# LANGUAGE TupleSections #-}
+{-# LANGUAGE TypeFamilies #-}
+{-# OPTIONS_GHC -fno-warn-name-shadowing -fno-warn-unused-binds #-}
+
+module SwaggerPetstore.Core where
+
+import SwaggerPetstore.MimeTypes
+import SwaggerPetstore.Logging
+
+import qualified Control.Arrow as P (left)
+import qualified Control.DeepSeq as NF
+import qualified Data.Aeson as A
+import qualified Data.ByteString as B
+import qualified Data.ByteString.Base64.Lazy as BL64
+import qualified Data.ByteString.Builder as BB
+import qualified Data.ByteString.Char8 as BC
+import qualified Data.ByteString.Lazy as BL
+import qualified Data.ByteString.Lazy.Char8 as BCL
+import qualified Data.CaseInsensitive as CI
+import qualified Data.Data as P (Data, Typeable, TypeRep, typeRep)
+import qualified Data.Foldable as P
+import qualified Data.Ix as P
+import qualified Data.Maybe as P
+import qualified Data.Proxy as P (Proxy(..))
+import qualified Data.Text as T
+import qualified Data.Text.Encoding as T
+import qualified Data.Time as TI
+import qualified Data.Time.ISO8601 as TI
+import qualified GHC.Base as P (Alternative)
+import qualified Lens.Micro as L
+import qualified Network.HTTP.Client.MultipartFormData as NH
+import qualified Network.HTTP.Types as NH
+import qualified Prelude as P
+import qualified Web.FormUrlEncoded as WH
+import qualified Web.HttpApiData as WH
+import qualified Text.Printf as T
+
+import Control.Applicative ((<|>))
+import Control.Applicative (Alternative)
+import Data.Function ((&))
+import Data.Foldable(foldlM)
+import Data.Monoid ((<>))
+import Data.Text (Text)
+import Prelude (($), (.), (<$>), (<*>), Maybe(..), Bool(..), Char, String, fmap, mempty, pure, return, show, IO, Monad, Functor)
+
+-- * SwaggerPetstoreConfig
+
+-- | 
+data SwaggerPetstoreConfig = SwaggerPetstoreConfig
+  { configHost  :: BCL.ByteString -- ^ host supplied in the Request
+  , configUserAgent :: Text -- ^ user-agent supplied in the Request
+  , configLogExecWithContext :: LogExecWithContext -- ^ Run a block using a Logger instance
+  , configLogContext :: LogContext -- ^ Configures the logger
+  , configAuthMethods :: [AnyAuthMethod] -- ^ List of configured auth methods
+  , configValidateAuthMethods :: Bool -- ^ throw exceptions if auth methods are not configured
+  }
+
+-- | display the config
+instance P.Show SwaggerPetstoreConfig where
+  show c =
+    T.printf
+      "{ configHost = %v, configUserAgent = %v, ..}"
+      (show (configHost c))
+      (show (configUserAgent c))
+
+-- | constructs a default SwaggerPetstoreConfig
+--
+-- configHost:
+--
+-- @http://petstore.swagger.io:80/v2@
+--
+-- configUserAgent:
+--
+-- @"swagger-haskell-http-client/1.0.0"@
+--
+newConfig :: IO SwaggerPetstoreConfig
+newConfig = do
+    logCxt <- initLogContext
+    return $ SwaggerPetstoreConfig
+        { configHost = "http://petstore.swagger.io:80/v2"
+        , configUserAgent = "swagger-haskell-http-client/1.0.0"
+        , configLogExecWithContext = runDefaultLogExecWithContext
+        , configLogContext = logCxt
+        , configAuthMethods = []
+        , configValidateAuthMethods = True
+        }  
+
+-- | updates config use AuthMethod on matching requests
+addAuthMethod :: AuthMethod auth => SwaggerPetstoreConfig -> auth -> SwaggerPetstoreConfig
+addAuthMethod config@SwaggerPetstoreConfig {configAuthMethods = as} a =
+  config { configAuthMethods = AnyAuthMethod a : as}
+
+-- | updates the config to use stdout logging
+withStdoutLogging :: SwaggerPetstoreConfig -> IO SwaggerPetstoreConfig
+withStdoutLogging p = do
+    logCxt <- stdoutLoggingContext (configLogContext p)
+    return $ p { configLogExecWithContext = stdoutLoggingExec, configLogContext = logCxt }
+
+-- | updates the config to use stderr logging
+withStderrLogging :: SwaggerPetstoreConfig -> IO SwaggerPetstoreConfig
+withStderrLogging p = do
+    logCxt <- stderrLoggingContext (configLogContext p)
+    return $ p { configLogExecWithContext = stderrLoggingExec, configLogContext = logCxt }
+
+-- | updates the config to disable logging
+withNoLogging :: SwaggerPetstoreConfig -> SwaggerPetstoreConfig
+withNoLogging p = p { configLogExecWithContext =  runNullLogExec}
+ 
+-- * SwaggerPetstoreRequest
+
+-- | Represents a request. The "req" type variable is the request type. The "res" type variable is the response type.
+data SwaggerPetstoreRequest req contentType res = SwaggerPetstoreRequest
+  { rMethod  :: NH.Method   -- ^ Method of SwaggerPetstoreRequest
+  , rUrlPath :: [BCL.ByteString] -- ^ Endpoint of SwaggerPetstoreRequest
+  , rParams   :: Params -- ^ params of SwaggerPetstoreRequest
+  , rAuthTypes :: [P.TypeRep] -- ^ types of auth methods
+  }
+  deriving (P.Show)
+
+-- | 'rMethod' Lens
+rMethodL :: Lens_' (SwaggerPetstoreRequest req contentType res) NH.Method
+rMethodL f SwaggerPetstoreRequest{..} = (\rMethod -> SwaggerPetstoreRequest { rMethod, ..} ) <$> f rMethod
+{-# INLINE rMethodL #-}
+
+-- | 'rUrlPath' Lens
+rUrlPathL :: Lens_' (SwaggerPetstoreRequest req contentType res) [BCL.ByteString]
+rUrlPathL f SwaggerPetstoreRequest{..} = (\rUrlPath -> SwaggerPetstoreRequest { rUrlPath, ..} ) <$> f rUrlPath
+{-# INLINE rUrlPathL #-}
+
+-- | 'rParams' Lens
+rParamsL :: Lens_' (SwaggerPetstoreRequest req contentType res) Params
+rParamsL f SwaggerPetstoreRequest{..} = (\rParams -> SwaggerPetstoreRequest { rParams, ..} ) <$> f rParams
+{-# INLINE rParamsL #-}
+
+-- | 'rParams' Lens
+rAuthTypesL :: Lens_' (SwaggerPetstoreRequest req contentType res) [P.TypeRep]
+rAuthTypesL f SwaggerPetstoreRequest{..} = (\rAuthTypes -> SwaggerPetstoreRequest { rAuthTypes, ..} ) <$> f rAuthTypes
+{-# INLINE rAuthTypesL #-}
+
+-- * HasBodyParam
+
+-- | Designates the body parameter of a request
+class HasBodyParam req param where
+  setBodyParam :: forall contentType res. (Consumes req contentType, MimeRender contentType param) => SwaggerPetstoreRequest req contentType res -> param -> SwaggerPetstoreRequest req contentType res
+  setBodyParam req xs =
+    req `_setBodyLBS` mimeRender (P.Proxy :: P.Proxy contentType) xs & _setContentTypeHeader
+
+-- * HasOptionalParam
+
+-- | Designates the optional parameters of a request
+class HasOptionalParam req param where
+  {-# MINIMAL applyOptionalParam | (-&-) #-}
+
+  -- | Apply an optional parameter to a request
+  applyOptionalParam :: SwaggerPetstoreRequest req contentType res -> param -> SwaggerPetstoreRequest req contentType res
+  applyOptionalParam = (-&-)
+  {-# INLINE applyOptionalParam #-}
+
+  -- | infix operator \/ alias for 'addOptionalParam'
+  (-&-) :: SwaggerPetstoreRequest req contentType res -> param -> SwaggerPetstoreRequest req contentType res
+  (-&-) = applyOptionalParam
+  {-# INLINE (-&-) #-}
+
+infixl 2 -&-
+
+-- | Request Params
+data Params = Params
+  { paramsQuery :: NH.Query
+  , paramsHeaders :: NH.RequestHeaders
+  , paramsBody :: ParamBody
+  }
+  deriving (P.Show)
+
+-- | 'paramsQuery' Lens
+paramsQueryL :: Lens_' Params NH.Query
+paramsQueryL f Params{..} = (\paramsQuery -> Params { paramsQuery, ..} ) <$> f paramsQuery
+{-# INLINE paramsQueryL #-}
+
+-- | 'paramsHeaders' Lens
+paramsHeadersL :: Lens_' Params NH.RequestHeaders
+paramsHeadersL f Params{..} = (\paramsHeaders -> Params { paramsHeaders, ..} ) <$> f paramsHeaders
+{-# INLINE paramsHeadersL #-}
+
+-- | 'paramsBody' Lens
+paramsBodyL :: Lens_' Params ParamBody
+paramsBodyL f Params{..} = (\paramsBody -> Params { paramsBody, ..} ) <$> f paramsBody
+{-# INLINE paramsBodyL #-}
+
+-- | Request Body
+data ParamBody
+  = ParamBodyNone
+  | ParamBodyB B.ByteString
+  | ParamBodyBL BL.ByteString
+  | ParamBodyFormUrlEncoded WH.Form
+  | ParamBodyMultipartFormData [NH.Part]
+  deriving (P.Show)
+
+-- ** SwaggerPetstoreRequest Utils
+
+_mkRequest :: NH.Method -- ^ Method 
+          -> [BCL.ByteString] -- ^ Endpoint
+          -> SwaggerPetstoreRequest req contentType res -- ^ req: Request Type, res: Response Type
+_mkRequest m u = SwaggerPetstoreRequest m u _mkParams []
+
+_mkParams :: Params
+_mkParams = Params [] [] ParamBodyNone
+
+setHeader :: SwaggerPetstoreRequest req contentType res -> [NH.Header] -> SwaggerPetstoreRequest req contentType res
+setHeader req header =
+  req `removeHeader` P.fmap P.fst header &
+  L.over (rParamsL . paramsHeadersL) (header P.++)
+
+removeHeader :: SwaggerPetstoreRequest req contentType res -> [NH.HeaderName] -> SwaggerPetstoreRequest req contentType res
+removeHeader req header =
+  req &
+  L.over
+    (rParamsL . paramsHeadersL)
+    (P.filter (\h -> cifst h `P.notElem` P.fmap CI.mk header))
+  where
+    cifst = CI.mk . P.fst
+
+
+_setContentTypeHeader :: forall req contentType res. MimeType contentType => SwaggerPetstoreRequest req contentType res -> SwaggerPetstoreRequest req contentType res
+_setContentTypeHeader req =
+    case mimeType (P.Proxy :: P.Proxy contentType) of 
+        Just m -> req `setHeader` [("content-type", BC.pack $ P.show m)]
+        Nothing -> req `removeHeader` ["content-type"]
+
+_setAcceptHeader :: forall req contentType res accept. MimeType accept => SwaggerPetstoreRequest req contentType res -> accept -> SwaggerPetstoreRequest req contentType res
+_setAcceptHeader req accept =
+    case mimeType' accept of 
+        Just m -> req `setHeader` [("accept", BC.pack $ P.show m)]
+        Nothing -> req `removeHeader` ["accept"]
+
+setQuery :: SwaggerPetstoreRequest req contentType res -> [NH.QueryItem] -> SwaggerPetstoreRequest req contentType res
+setQuery req query = 
+  req &
+  L.over
+    (rParamsL . paramsQueryL)
+    ((query P.++) . P.filter (\q -> cifst q `P.notElem` P.fmap cifst query))
+  where
+    cifst = CI.mk . P.fst
+
+addForm :: SwaggerPetstoreRequest req contentType res -> WH.Form -> SwaggerPetstoreRequest req contentType res
+addForm req newform = 
+    let form = case paramsBody (rParams req) of
+            ParamBodyFormUrlEncoded _form -> _form
+            _ -> mempty
+    in req & L.set (rParamsL . paramsBodyL) (ParamBodyFormUrlEncoded (newform <> form))
+
+_addMultiFormPart :: SwaggerPetstoreRequest req contentType res -> NH.Part -> SwaggerPetstoreRequest req contentType res
+_addMultiFormPart req newpart = 
+    let parts = case paramsBody (rParams req) of
+            ParamBodyMultipartFormData _parts -> _parts
+            _ -> []
+    in req & L.set (rParamsL . paramsBodyL) (ParamBodyMultipartFormData (newpart : parts))
+
+_setBodyBS :: SwaggerPetstoreRequest req contentType res -> B.ByteString -> SwaggerPetstoreRequest req contentType res
+_setBodyBS req body = 
+    req & L.set (rParamsL . paramsBodyL) (ParamBodyB body)
+
+_setBodyLBS :: SwaggerPetstoreRequest req contentType res -> BL.ByteString -> SwaggerPetstoreRequest req contentType res
+_setBodyLBS req body = 
+    req & L.set (rParamsL . paramsBodyL) (ParamBodyBL body)
+
+_hasAuthType :: AuthMethod authMethod => SwaggerPetstoreRequest req contentType res -> P.Proxy authMethod -> SwaggerPetstoreRequest req contentType res
+_hasAuthType req proxy =
+  req & L.over rAuthTypesL (P.typeRep proxy :)
+
+-- ** Params Utils
+
+toPath
+  :: WH.ToHttpApiData a
+  => a -> BCL.ByteString
+toPath = BB.toLazyByteString . WH.toEncodedUrlPiece
+
+toHeader :: WH.ToHttpApiData a => (NH.HeaderName, a) -> [NH.Header]
+toHeader x = [fmap WH.toHeader x]
+
+toForm :: WH.ToHttpApiData v => (BC.ByteString, v) -> WH.Form
+toForm (k,v) = WH.toForm [(BC.unpack k,v)]
+
+toQuery :: WH.ToHttpApiData a => (BC.ByteString, Maybe a) -> [NH.QueryItem]
+toQuery x = [(fmap . fmap) toQueryParam x]
+  where toQueryParam = T.encodeUtf8 . WH.toQueryParam
+
+-- *** Swagger `CollectionFormat` Utils
+
+-- | Determines the format of the array if type array is used.
+data CollectionFormat
+  = CommaSeparated -- ^ CSV format for multiple parameters.
+  | SpaceSeparated -- ^ Also called "SSV"
+  | TabSeparated -- ^ Also called "TSV"
+  | PipeSeparated -- ^ `value1|value2|value2`
+  | MultiParamArray -- ^ Using multiple GET parameters, e.g. `foo=bar&foo=baz`. This is valid only for parameters in "query" ('NH.Query') or "formData" ('WH.Form')
+
+toHeaderColl :: WH.ToHttpApiData a => CollectionFormat -> (NH.HeaderName, [a]) -> [NH.Header]
+toHeaderColl c xs = _toColl c toHeader xs
+
+toFormColl :: WH.ToHttpApiData v => CollectionFormat -> (BC.ByteString, [v]) -> WH.Form
+toFormColl c xs = WH.toForm $ fmap unpack $ _toColl c toHeader $ pack xs
+  where
+    pack (k,v) = (CI.mk k, v)
+    unpack (k,v) = (BC.unpack (CI.original k), BC.unpack v)
+
+toQueryColl :: WH.ToHttpApiData a => CollectionFormat -> (BC.ByteString, Maybe [a]) -> NH.Query
+toQueryColl c xs = _toCollA c toQuery xs
+
+_toColl :: P.Traversable f => CollectionFormat -> (f a -> [(b, BC.ByteString)]) -> f [a] -> [(b, BC.ByteString)]
+_toColl c encode xs = fmap (fmap P.fromJust) (_toCollA' c fencode BC.singleton (fmap Just xs))
+  where fencode = fmap (fmap Just) . encode . fmap P.fromJust
+        {-# INLINE fencode #-}
+
+_toCollA :: (P.Traversable f, P.Traversable t, P.Alternative t) => CollectionFormat -> (f (t a) -> [(b, t BC.ByteString)]) -> f (t [a]) -> [(b, t BC.ByteString)]
+_toCollA c encode xs = _toCollA' c encode BC.singleton xs
+
+_toCollA' :: (P.Monoid c, P.Traversable f, P.Traversable t, P.Alternative t) => CollectionFormat -> (f (t a) -> [(b, t c)]) -> (Char -> c) -> f (t [a]) -> [(b, t c)]
+_toCollA' c encode one xs = case c of
+  CommaSeparated -> go (one ',')
+  SpaceSeparated -> go (one ' ')
+  TabSeparated -> go (one '\t')
+  PipeSeparated -> go (one '|')
+  MultiParamArray -> expandList
+  where
+    go sep =
+      [P.foldl1 (\(sk, sv) (_, v) -> (sk, (combine sep <$> sv <*> v) <|> sv <|> v)) expandList]
+    combine sep x y = x <> sep <> y
+    expandList = (P.concatMap encode . (P.traverse . P.traverse) P.toList) xs
+    {-# INLINE go #-}
+    {-# INLINE expandList #-}
+    {-# INLINE combine #-}
+  
+-- * AuthMethods
+
+-- | Provides a method to apply auth methods to requests
+class P.Typeable a =>
+      AuthMethod a  where
+  applyAuthMethod
+    :: SwaggerPetstoreConfig
+    -> a
+    -> SwaggerPetstoreRequest req contentType res
+    -> IO (SwaggerPetstoreRequest req contentType res)
+
+-- | An existential wrapper for any AuthMethod
+data AnyAuthMethod = forall a. AuthMethod a => AnyAuthMethod a deriving (P.Typeable)
+
+instance AuthMethod AnyAuthMethod where applyAuthMethod config (AnyAuthMethod a) req = applyAuthMethod config a req
+
+-- | apply all matching AuthMethods in config to request
+_applyAuthMethods
+  :: SwaggerPetstoreRequest req contentType res
+  -> SwaggerPetstoreConfig
+  -> IO (SwaggerPetstoreRequest req contentType res)
+_applyAuthMethods req config@(SwaggerPetstoreConfig {configAuthMethods = as}) =
+  foldlM go req as
+  where
+    go r (AnyAuthMethod a) = applyAuthMethod config a r
+  
+-- * Utils
+
+-- | Removes Null fields.  (OpenAPI-Specification 2.0 does not allow Null in JSON)
+_omitNulls :: [(Text, A.Value)] -> A.Value
+_omitNulls = A.object . P.filter notNull
+  where
+    notNull (_, A.Null) = False
+    notNull _ = True
+
+-- | Encodes fields using WH.toQueryParam
+_toFormItem :: (WH.ToHttpApiData a, Functor f) => t -> f a -> f (t, [Text])
+_toFormItem name x = (name,) . (:[]) . WH.toQueryParam <$> x
+
+-- | Collapse (Just "") to Nothing
+_emptyToNothing :: Maybe String -> Maybe String
+_emptyToNothing (Just "") = Nothing
+_emptyToNothing x = x
+{-# INLINE _emptyToNothing #-}
+
+-- | Collapse (Just mempty) to Nothing
+_memptyToNothing :: (P.Monoid a, P.Eq a) => Maybe a -> Maybe a
+_memptyToNothing (Just x) | x P.== P.mempty = Nothing
+_memptyToNothing x = x
+{-# INLINE _memptyToNothing #-}
+
+-- * DateTime Formatting
+
+newtype DateTime = DateTime { unDateTime :: TI.UTCTime }
+  deriving (P.Eq,P.Data,P.Ord,P.Typeable,NF.NFData,TI.ParseTime,TI.FormatTime)
+instance A.FromJSON DateTime where
+  parseJSON = A.withText "DateTime" (_readDateTime . T.unpack)
+instance A.ToJSON DateTime where
+  toJSON (DateTime t) = A.toJSON (_showDateTime t)
+instance WH.FromHttpApiData DateTime where
+  parseUrlPiece = P.left T.pack . _readDateTime . T.unpack
+instance WH.ToHttpApiData DateTime where
+  toUrlPiece (DateTime t) = T.pack (_showDateTime t)
+instance P.Show DateTime where
+  show (DateTime t) = _showDateTime t
+instance MimeRender MimeMultipartFormData DateTime where
+  mimeRender _ = mimeRenderDefaultMultipartFormData
+
+-- | @_parseISO8601@
+_readDateTime :: (TI.ParseTime t, Monad m, Alternative m) => String -> m t
+_readDateTime =
+  _parseISO8601
+{-# INLINE _readDateTime #-}
+
+-- | @TI.formatISO8601Millis@
+_showDateTime :: (t ~ TI.UTCTime, TI.FormatTime t) => t -> String
+_showDateTime =
+  TI.formatISO8601Millis
+{-# INLINE _showDateTime #-}
+
+-- | parse an ISO8601 date-time string
+_parseISO8601 :: (TI.ParseTime t, Monad m, Alternative m) => String -> m t
+_parseISO8601 t =
+  P.asum $
+  P.flip (TI.parseTimeM True TI.defaultTimeLocale) t <$>
+  ["%FT%T%QZ", "%FT%T%Q%z", "%FT%T%Q%Z"]
+{-# INLINE _parseISO8601 #-}
+
+-- * Date Formatting
+
+newtype Date = Date { unDate :: TI.Day }
+  deriving (P.Enum,P.Eq,P.Data,P.Ord,P.Ix,NF.NFData,TI.ParseTime,TI.FormatTime)
+instance A.FromJSON Date where
+  parseJSON = A.withText "Date" (_readDate . T.unpack)
+instance A.ToJSON Date where
+  toJSON (Date t) = A.toJSON (_showDate t)
+instance WH.FromHttpApiData Date where
+  parseUrlPiece = P.left T.pack . _readDate . T.unpack
+instance WH.ToHttpApiData Date where
+  toUrlPiece (Date t) = T.pack (_showDate t)
+instance P.Show Date where
+  show (Date t) = _showDate t
+instance MimeRender MimeMultipartFormData Date where
+  mimeRender _ = mimeRenderDefaultMultipartFormData
+
+-- | @TI.parseTimeM True TI.defaultTimeLocale "%Y-%m-%d"@
+_readDate :: (TI.ParseTime t, Monad m) => String -> m t
+_readDate =
+  TI.parseTimeM True TI.defaultTimeLocale "%Y-%m-%d"
+{-# INLINE _readDate #-}
+
+-- | @TI.formatTime TI.defaultTimeLocale "%Y-%m-%d"@
+_showDate :: TI.FormatTime t => t -> String
+_showDate =
+  TI.formatTime TI.defaultTimeLocale "%Y-%m-%d"
+{-# INLINE _showDate #-}
+
+-- * Byte/Binary Formatting
+
+  
+-- | base64 encoded characters
+newtype ByteArray = ByteArray { unByteArray :: BL.ByteString }
+  deriving (P.Eq,P.Data,P.Ord,P.Typeable,NF.NFData)
+
+instance A.FromJSON ByteArray where
+  parseJSON = A.withText "ByteArray" _readByteArray
+instance A.ToJSON ByteArray where
+  toJSON = A.toJSON . _showByteArray
+instance WH.FromHttpApiData ByteArray where
+  parseUrlPiece = P.left T.pack . _readByteArray
+instance WH.ToHttpApiData ByteArray where
+  toUrlPiece = _showByteArray
+instance P.Show ByteArray where
+  show = T.unpack . _showByteArray
+instance MimeRender MimeMultipartFormData ByteArray where
+  mimeRender _ = mimeRenderDefaultMultipartFormData
+
+-- | read base64 encoded characters
+_readByteArray :: Monad m => Text -> m ByteArray
+_readByteArray = P.either P.fail (pure . ByteArray) . BL64.decode . BL.fromStrict . T.encodeUtf8
+{-# INLINE _readByteArray #-}
+
+-- | show base64 encoded characters
+_showByteArray :: ByteArray -> Text
+_showByteArray = T.decodeUtf8 . BL.toStrict . BL64.encode . unByteArray
+{-# INLINE _showByteArray #-}
+
+-- | any sequence of octets
+newtype Binary = Binary { unBinary :: BL.ByteString }
+  deriving (P.Eq,P.Data,P.Ord,P.Typeable,NF.NFData)
+
+instance A.FromJSON Binary where
+  parseJSON = A.withText "Binary" _readBinaryBase64
+instance A.ToJSON Binary where
+  toJSON = A.toJSON . _showBinaryBase64
+instance WH.FromHttpApiData Binary where
+  parseUrlPiece = P.left T.pack . _readBinaryBase64
+instance WH.ToHttpApiData Binary where
+  toUrlPiece = _showBinaryBase64
+instance P.Show Binary where
+  show = T.unpack . _showBinaryBase64
+instance MimeRender MimeMultipartFormData Binary where
+  mimeRender _ = unBinary
+
+_readBinaryBase64 :: Monad m => Text -> m Binary
+_readBinaryBase64 = P.either P.fail (pure . Binary) . BL64.decode . BL.fromStrict . T.encodeUtf8
+{-# INLINE _readBinaryBase64 #-}
+
+_showBinaryBase64 :: Binary -> Text
+_showBinaryBase64 = T.decodeUtf8 . BL.toStrict . BL64.encode . unBinary
+{-# INLINE _showBinaryBase64 #-}
+
+-- * Lens Type Aliases
+
+type Lens_' s a = Lens_ s s a a
+type Lens_ s t a b = forall (f :: * -> *). Functor f => (a -> f b) -> s -> f t
diff --git a/lib/SwaggerPetstore/Lens.hs b/lib/SwaggerPetstore/Lens.hs
deleted file mode 100644
--- a/lib/SwaggerPetstore/Lens.hs
+++ /dev/null
@@ -1,641 +0,0 @@
-{-
-   Swagger Petstore
-
-   This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
-
-   OpenAPI spec version: 2.0
-   Swagger Petstore API version: 1.0.0
-   Contact: apiteam@swagger.io
-   Generated by Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
--}
-
-{-|
-Module : SwaggerPetstore.Lens
--}
-
-{-# LANGUAGE KindSignatures #-}
-{-# LANGUAGE NamedFieldPuns #-}
-{-# LANGUAGE RankNTypes #-}
-{-# LANGUAGE RecordWildCards #-}
-{-# OPTIONS_GHC -fno-warn-name-shadowing -fno-warn-unused-matches -fno-warn-unused-binds -fno-warn-unused-imports #-}
-
-module SwaggerPetstore.Lens where
-
-import qualified Data.Aeson as A
-import qualified Data.ByteString.Lazy as BL
-import qualified Data.Data as P (Data, Typeable)
-import qualified Data.Map as Map
-import qualified Data.Set as Set
-import qualified Data.Time as TI
-
-import Data.Text (Text)
-
-import Prelude (($), (.),(<$>),(<*>),(=<<),Maybe(..),Bool(..),Char,Double,FilePath,Float,Int,Integer,String,fmap,undefined,mempty,maybe,pure,Monad,Applicative,Functor)
-import qualified Prelude as P
-
-import SwaggerPetstore.Model
-
--- * Type Aliases
-
-type Lens_' s a = Lens_ s s a a
-type Lens_ s t a b = forall (f :: * -> *). Functor f => (a -> f b) -> s -> f t
-
-
--- * AdditionalPropertiesClass
-
--- | 'additionalPropertiesClassMapProperty' Lens
-additionalPropertiesClassMapPropertyL :: Lens_' AdditionalPropertiesClass (Maybe (Map.Map String Text))
-additionalPropertiesClassMapPropertyL f AdditionalPropertiesClass{..} = (\additionalPropertiesClassMapProperty -> AdditionalPropertiesClass { additionalPropertiesClassMapProperty, ..} ) <$> f additionalPropertiesClassMapProperty
-{-# INLINE additionalPropertiesClassMapPropertyL #-}
-
--- | 'additionalPropertiesClassMapOfMapProperty' Lens
-additionalPropertiesClassMapOfMapPropertyL :: Lens_' AdditionalPropertiesClass (Maybe (Map.Map String (Map.Map String Text)))
-additionalPropertiesClassMapOfMapPropertyL f AdditionalPropertiesClass{..} = (\additionalPropertiesClassMapOfMapProperty -> AdditionalPropertiesClass { additionalPropertiesClassMapOfMapProperty, ..} ) <$> f additionalPropertiesClassMapOfMapProperty
-{-# INLINE additionalPropertiesClassMapOfMapPropertyL #-}
-
-
-
--- * Animal
-
--- | 'animalClassName' Lens
-animalClassNameL :: Lens_' Animal (Text)
-animalClassNameL f Animal{..} = (\animalClassName -> Animal { animalClassName, ..} ) <$> f animalClassName
-{-# INLINE animalClassNameL #-}
-
--- | 'animalColor' Lens
-animalColorL :: Lens_' Animal (Maybe Text)
-animalColorL f Animal{..} = (\animalColor -> Animal { animalColor, ..} ) <$> f animalColor
-{-# INLINE animalColorL #-}
-
-
-
--- * AnimalFarm
-
-
-
--- * ApiResponse
-
--- | 'apiResponseCode' Lens
-apiResponseCodeL :: Lens_' ApiResponse (Maybe Int)
-apiResponseCodeL f ApiResponse{..} = (\apiResponseCode -> ApiResponse { apiResponseCode, ..} ) <$> f apiResponseCode
-{-# INLINE apiResponseCodeL #-}
-
--- | 'apiResponseType' Lens
-apiResponseTypeL :: Lens_' ApiResponse (Maybe Text)
-apiResponseTypeL f ApiResponse{..} = (\apiResponseType -> ApiResponse { apiResponseType, ..} ) <$> f apiResponseType
-{-# INLINE apiResponseTypeL #-}
-
--- | 'apiResponseMessage' Lens
-apiResponseMessageL :: Lens_' ApiResponse (Maybe Text)
-apiResponseMessageL f ApiResponse{..} = (\apiResponseMessage -> ApiResponse { apiResponseMessage, ..} ) <$> f apiResponseMessage
-{-# INLINE apiResponseMessageL #-}
-
-
-
--- * ArrayOfArrayOfNumberOnly
-
--- | 'arrayOfArrayOfNumberOnlyArrayArrayNumber' Lens
-arrayOfArrayOfNumberOnlyArrayArrayNumberL :: Lens_' ArrayOfArrayOfNumberOnly (Maybe [[Double]])
-arrayOfArrayOfNumberOnlyArrayArrayNumberL f ArrayOfArrayOfNumberOnly{..} = (\arrayOfArrayOfNumberOnlyArrayArrayNumber -> ArrayOfArrayOfNumberOnly { arrayOfArrayOfNumberOnlyArrayArrayNumber, ..} ) <$> f arrayOfArrayOfNumberOnlyArrayArrayNumber
-{-# INLINE arrayOfArrayOfNumberOnlyArrayArrayNumberL #-}
-
-
-
--- * ArrayOfNumberOnly
-
--- | 'arrayOfNumberOnlyArrayNumber' Lens
-arrayOfNumberOnlyArrayNumberL :: Lens_' ArrayOfNumberOnly (Maybe [Double])
-arrayOfNumberOnlyArrayNumberL f ArrayOfNumberOnly{..} = (\arrayOfNumberOnlyArrayNumber -> ArrayOfNumberOnly { arrayOfNumberOnlyArrayNumber, ..} ) <$> f arrayOfNumberOnlyArrayNumber
-{-# INLINE arrayOfNumberOnlyArrayNumberL #-}
-
-
-
--- * ArrayTest
-
--- | 'arrayTestArrayOfString' Lens
-arrayTestArrayOfStringL :: Lens_' ArrayTest (Maybe [Text])
-arrayTestArrayOfStringL f ArrayTest{..} = (\arrayTestArrayOfString -> ArrayTest { arrayTestArrayOfString, ..} ) <$> f arrayTestArrayOfString
-{-# INLINE arrayTestArrayOfStringL #-}
-
--- | 'arrayTestArrayArrayOfInteger' Lens
-arrayTestArrayArrayOfIntegerL :: Lens_' ArrayTest (Maybe [[Integer]])
-arrayTestArrayArrayOfIntegerL f ArrayTest{..} = (\arrayTestArrayArrayOfInteger -> ArrayTest { arrayTestArrayArrayOfInteger, ..} ) <$> f arrayTestArrayArrayOfInteger
-{-# INLINE arrayTestArrayArrayOfIntegerL #-}
-
--- | 'arrayTestArrayArrayOfModel' Lens
-arrayTestArrayArrayOfModelL :: Lens_' ArrayTest (Maybe [[ReadOnlyFirst]])
-arrayTestArrayArrayOfModelL f ArrayTest{..} = (\arrayTestArrayArrayOfModel -> ArrayTest { arrayTestArrayArrayOfModel, ..} ) <$> f arrayTestArrayArrayOfModel
-{-# INLINE arrayTestArrayArrayOfModelL #-}
-
-
-
--- * Capitalization
-
--- | 'capitalizationSmallCamel' Lens
-capitalizationSmallCamelL :: Lens_' Capitalization (Maybe Text)
-capitalizationSmallCamelL f Capitalization{..} = (\capitalizationSmallCamel -> Capitalization { capitalizationSmallCamel, ..} ) <$> f capitalizationSmallCamel
-{-# INLINE capitalizationSmallCamelL #-}
-
--- | 'capitalizationCapitalCamel' Lens
-capitalizationCapitalCamelL :: Lens_' Capitalization (Maybe Text)
-capitalizationCapitalCamelL f Capitalization{..} = (\capitalizationCapitalCamel -> Capitalization { capitalizationCapitalCamel, ..} ) <$> f capitalizationCapitalCamel
-{-# INLINE capitalizationCapitalCamelL #-}
-
--- | 'capitalizationSmallSnake' Lens
-capitalizationSmallSnakeL :: Lens_' Capitalization (Maybe Text)
-capitalizationSmallSnakeL f Capitalization{..} = (\capitalizationSmallSnake -> Capitalization { capitalizationSmallSnake, ..} ) <$> f capitalizationSmallSnake
-{-# INLINE capitalizationSmallSnakeL #-}
-
--- | 'capitalizationCapitalSnake' Lens
-capitalizationCapitalSnakeL :: Lens_' Capitalization (Maybe Text)
-capitalizationCapitalSnakeL f Capitalization{..} = (\capitalizationCapitalSnake -> Capitalization { capitalizationCapitalSnake, ..} ) <$> f capitalizationCapitalSnake
-{-# INLINE capitalizationCapitalSnakeL #-}
-
--- | 'capitalizationScaEthFlowPoints' Lens
-capitalizationScaEthFlowPointsL :: Lens_' Capitalization (Maybe Text)
-capitalizationScaEthFlowPointsL f Capitalization{..} = (\capitalizationScaEthFlowPoints -> Capitalization { capitalizationScaEthFlowPoints, ..} ) <$> f capitalizationScaEthFlowPoints
-{-# INLINE capitalizationScaEthFlowPointsL #-}
-
--- | 'capitalizationAttName' Lens
-capitalizationAttNameL :: Lens_' Capitalization (Maybe Text)
-capitalizationAttNameL f Capitalization{..} = (\capitalizationAttName -> Capitalization { capitalizationAttName, ..} ) <$> f capitalizationAttName
-{-# INLINE capitalizationAttNameL #-}
-
-
-
--- * Category
-
--- | 'categoryId' Lens
-categoryIdL :: Lens_' Category (Maybe Integer)
-categoryIdL f Category{..} = (\categoryId -> Category { categoryId, ..} ) <$> f categoryId
-{-# INLINE categoryIdL #-}
-
--- | 'categoryName' Lens
-categoryNameL :: Lens_' Category (Maybe Text)
-categoryNameL f Category{..} = (\categoryName -> Category { categoryName, ..} ) <$> f categoryName
-{-# INLINE categoryNameL #-}
-
-
-
--- * ClassModel
-
--- | 'classModelClass' Lens
-classModelClassL :: Lens_' ClassModel (Maybe Text)
-classModelClassL f ClassModel{..} = (\classModelClass -> ClassModel { classModelClass, ..} ) <$> f classModelClass
-{-# INLINE classModelClassL #-}
-
-
-
--- * Client
-
--- | 'clientClient' Lens
-clientClientL :: Lens_' Client (Maybe Text)
-clientClientL f Client{..} = (\clientClient -> Client { clientClient, ..} ) <$> f clientClient
-{-# INLINE clientClientL #-}
-
-
-
--- * EnumArrays
-
--- | 'enumArraysJustSymbol' Lens
-enumArraysJustSymbolL :: Lens_' EnumArrays (Maybe Text)
-enumArraysJustSymbolL f EnumArrays{..} = (\enumArraysJustSymbol -> EnumArrays { enumArraysJustSymbol, ..} ) <$> f enumArraysJustSymbol
-{-# INLINE enumArraysJustSymbolL #-}
-
--- | 'enumArraysArrayEnum' Lens
-enumArraysArrayEnumL :: Lens_' EnumArrays (Maybe [Text])
-enumArraysArrayEnumL f EnumArrays{..} = (\enumArraysArrayEnum -> EnumArrays { enumArraysArrayEnum, ..} ) <$> f enumArraysArrayEnum
-{-# INLINE enumArraysArrayEnumL #-}
-
-
-
--- * EnumClass
-
-
-
--- * EnumTest
-
--- | 'enumTestEnumString' Lens
-enumTestEnumStringL :: Lens_' EnumTest (Maybe Text)
-enumTestEnumStringL f EnumTest{..} = (\enumTestEnumString -> EnumTest { enumTestEnumString, ..} ) <$> f enumTestEnumString
-{-# INLINE enumTestEnumStringL #-}
-
--- | 'enumTestEnumInteger' Lens
-enumTestEnumIntegerL :: Lens_' EnumTest (Maybe Int)
-enumTestEnumIntegerL f EnumTest{..} = (\enumTestEnumInteger -> EnumTest { enumTestEnumInteger, ..} ) <$> f enumTestEnumInteger
-{-# INLINE enumTestEnumIntegerL #-}
-
--- | 'enumTestEnumNumber' Lens
-enumTestEnumNumberL :: Lens_' EnumTest (Maybe Double)
-enumTestEnumNumberL f EnumTest{..} = (\enumTestEnumNumber -> EnumTest { enumTestEnumNumber, ..} ) <$> f enumTestEnumNumber
-{-# INLINE enumTestEnumNumberL #-}
-
--- | 'enumTestOuterEnum' Lens
-enumTestOuterEnumL :: Lens_' EnumTest (Maybe OuterEnum)
-enumTestOuterEnumL f EnumTest{..} = (\enumTestOuterEnum -> EnumTest { enumTestOuterEnum, ..} ) <$> f enumTestOuterEnum
-{-# INLINE enumTestOuterEnumL #-}
-
-
-
--- * FormatTest
-
--- | 'formatTestInteger' Lens
-formatTestIntegerL :: Lens_' FormatTest (Maybe Int)
-formatTestIntegerL f FormatTest{..} = (\formatTestInteger -> FormatTest { formatTestInteger, ..} ) <$> f formatTestInteger
-{-# INLINE formatTestIntegerL #-}
-
--- | 'formatTestInt32' Lens
-formatTestInt32L :: Lens_' FormatTest (Maybe Int)
-formatTestInt32L f FormatTest{..} = (\formatTestInt32 -> FormatTest { formatTestInt32, ..} ) <$> f formatTestInt32
-{-# INLINE formatTestInt32L #-}
-
--- | 'formatTestInt64' Lens
-formatTestInt64L :: Lens_' FormatTest (Maybe Integer)
-formatTestInt64L f FormatTest{..} = (\formatTestInt64 -> FormatTest { formatTestInt64, ..} ) <$> f formatTestInt64
-{-# INLINE formatTestInt64L #-}
-
--- | 'formatTestNumber' Lens
-formatTestNumberL :: Lens_' FormatTest (Double)
-formatTestNumberL f FormatTest{..} = (\formatTestNumber -> FormatTest { formatTestNumber, ..} ) <$> f formatTestNumber
-{-# INLINE formatTestNumberL #-}
-
--- | 'formatTestFloat' Lens
-formatTestFloatL :: Lens_' FormatTest (Maybe Float)
-formatTestFloatL f FormatTest{..} = (\formatTestFloat -> FormatTest { formatTestFloat, ..} ) <$> f formatTestFloat
-{-# INLINE formatTestFloatL #-}
-
--- | 'formatTestDouble' Lens
-formatTestDoubleL :: Lens_' FormatTest (Maybe Double)
-formatTestDoubleL f FormatTest{..} = (\formatTestDouble -> FormatTest { formatTestDouble, ..} ) <$> f formatTestDouble
-{-# INLINE formatTestDoubleL #-}
-
--- | 'formatTestString' Lens
-formatTestStringL :: Lens_' FormatTest (Maybe Text)
-formatTestStringL f FormatTest{..} = (\formatTestString -> FormatTest { formatTestString, ..} ) <$> f formatTestString
-{-# INLINE formatTestStringL #-}
-
--- | 'formatTestByte' Lens
-formatTestByteL :: Lens_' FormatTest (ByteArray)
-formatTestByteL f FormatTest{..} = (\formatTestByte -> FormatTest { formatTestByte, ..} ) <$> f formatTestByte
-{-# INLINE formatTestByteL #-}
-
--- | 'formatTestBinary' Lens
-formatTestBinaryL :: Lens_' FormatTest (Maybe Binary)
-formatTestBinaryL f FormatTest{..} = (\formatTestBinary -> FormatTest { formatTestBinary, ..} ) <$> f formatTestBinary
-{-# INLINE formatTestBinaryL #-}
-
--- | 'formatTestDate' Lens
-formatTestDateL :: Lens_' FormatTest (Date)
-formatTestDateL f FormatTest{..} = (\formatTestDate -> FormatTest { formatTestDate, ..} ) <$> f formatTestDate
-{-# INLINE formatTestDateL #-}
-
--- | 'formatTestDateTime' Lens
-formatTestDateTimeL :: Lens_' FormatTest (Maybe DateTime)
-formatTestDateTimeL f FormatTest{..} = (\formatTestDateTime -> FormatTest { formatTestDateTime, ..} ) <$> f formatTestDateTime
-{-# INLINE formatTestDateTimeL #-}
-
--- | 'formatTestUuid' Lens
-formatTestUuidL :: Lens_' FormatTest (Maybe Text)
-formatTestUuidL f FormatTest{..} = (\formatTestUuid -> FormatTest { formatTestUuid, ..} ) <$> f formatTestUuid
-{-# INLINE formatTestUuidL #-}
-
--- | 'formatTestPassword' Lens
-formatTestPasswordL :: Lens_' FormatTest (Text)
-formatTestPasswordL f FormatTest{..} = (\formatTestPassword -> FormatTest { formatTestPassword, ..} ) <$> f formatTestPassword
-{-# INLINE formatTestPasswordL #-}
-
-
-
--- * HasOnlyReadOnly
-
--- | 'hasOnlyReadOnlyBar' Lens
-hasOnlyReadOnlyBarL :: Lens_' HasOnlyReadOnly (Maybe Text)
-hasOnlyReadOnlyBarL f HasOnlyReadOnly{..} = (\hasOnlyReadOnlyBar -> HasOnlyReadOnly { hasOnlyReadOnlyBar, ..} ) <$> f hasOnlyReadOnlyBar
-{-# INLINE hasOnlyReadOnlyBarL #-}
-
--- | 'hasOnlyReadOnlyFoo' Lens
-hasOnlyReadOnlyFooL :: Lens_' HasOnlyReadOnly (Maybe Text)
-hasOnlyReadOnlyFooL f HasOnlyReadOnly{..} = (\hasOnlyReadOnlyFoo -> HasOnlyReadOnly { hasOnlyReadOnlyFoo, ..} ) <$> f hasOnlyReadOnlyFoo
-{-# INLINE hasOnlyReadOnlyFooL #-}
-
-
-
--- * MapTest
-
--- | 'mapTestMapMapOfString' Lens
-mapTestMapMapOfStringL :: Lens_' MapTest (Maybe (Map.Map String (Map.Map String Text)))
-mapTestMapMapOfStringL f MapTest{..} = (\mapTestMapMapOfString -> MapTest { mapTestMapMapOfString, ..} ) <$> f mapTestMapMapOfString
-{-# INLINE mapTestMapMapOfStringL #-}
-
--- | 'mapTestMapOfEnumString' Lens
-mapTestMapOfEnumStringL :: Lens_' MapTest (Maybe (Map.Map String Text))
-mapTestMapOfEnumStringL f MapTest{..} = (\mapTestMapOfEnumString -> MapTest { mapTestMapOfEnumString, ..} ) <$> f mapTestMapOfEnumString
-{-# INLINE mapTestMapOfEnumStringL #-}
-
-
-
--- * MixedPropertiesAndAdditionalPropertiesClass
-
--- | 'mixedPropertiesAndAdditionalPropertiesClassUuid' Lens
-mixedPropertiesAndAdditionalPropertiesClassUuidL :: Lens_' MixedPropertiesAndAdditionalPropertiesClass (Maybe Text)
-mixedPropertiesAndAdditionalPropertiesClassUuidL f MixedPropertiesAndAdditionalPropertiesClass{..} = (\mixedPropertiesAndAdditionalPropertiesClassUuid -> MixedPropertiesAndAdditionalPropertiesClass { mixedPropertiesAndAdditionalPropertiesClassUuid, ..} ) <$> f mixedPropertiesAndAdditionalPropertiesClassUuid
-{-# INLINE mixedPropertiesAndAdditionalPropertiesClassUuidL #-}
-
--- | 'mixedPropertiesAndAdditionalPropertiesClassDateTime' Lens
-mixedPropertiesAndAdditionalPropertiesClassDateTimeL :: Lens_' MixedPropertiesAndAdditionalPropertiesClass (Maybe DateTime)
-mixedPropertiesAndAdditionalPropertiesClassDateTimeL f MixedPropertiesAndAdditionalPropertiesClass{..} = (\mixedPropertiesAndAdditionalPropertiesClassDateTime -> MixedPropertiesAndAdditionalPropertiesClass { mixedPropertiesAndAdditionalPropertiesClassDateTime, ..} ) <$> f mixedPropertiesAndAdditionalPropertiesClassDateTime
-{-# INLINE mixedPropertiesAndAdditionalPropertiesClassDateTimeL #-}
-
--- | 'mixedPropertiesAndAdditionalPropertiesClassMap' Lens
-mixedPropertiesAndAdditionalPropertiesClassMapL :: Lens_' MixedPropertiesAndAdditionalPropertiesClass (Maybe (Map.Map String Animal))
-mixedPropertiesAndAdditionalPropertiesClassMapL f MixedPropertiesAndAdditionalPropertiesClass{..} = (\mixedPropertiesAndAdditionalPropertiesClassMap -> MixedPropertiesAndAdditionalPropertiesClass { mixedPropertiesAndAdditionalPropertiesClassMap, ..} ) <$> f mixedPropertiesAndAdditionalPropertiesClassMap
-{-# INLINE mixedPropertiesAndAdditionalPropertiesClassMapL #-}
-
-
-
--- * Model200Response
-
--- | 'model200ResponseName' Lens
-model200ResponseNameL :: Lens_' Model200Response (Maybe Int)
-model200ResponseNameL f Model200Response{..} = (\model200ResponseName -> Model200Response { model200ResponseName, ..} ) <$> f model200ResponseName
-{-# INLINE model200ResponseNameL #-}
-
--- | 'model200ResponseClass' Lens
-model200ResponseClassL :: Lens_' Model200Response (Maybe Text)
-model200ResponseClassL f Model200Response{..} = (\model200ResponseClass -> Model200Response { model200ResponseClass, ..} ) <$> f model200ResponseClass
-{-# INLINE model200ResponseClassL #-}
-
-
-
--- * ModelList
-
--- | 'modelList123List' Lens
-modelList123ListL :: Lens_' ModelList (Maybe Text)
-modelList123ListL f ModelList{..} = (\modelList123List -> ModelList { modelList123List, ..} ) <$> f modelList123List
-{-# INLINE modelList123ListL #-}
-
-
-
--- * ModelReturn
-
--- | 'modelReturnReturn' Lens
-modelReturnReturnL :: Lens_' ModelReturn (Maybe Int)
-modelReturnReturnL f ModelReturn{..} = (\modelReturnReturn -> ModelReturn { modelReturnReturn, ..} ) <$> f modelReturnReturn
-{-# INLINE modelReturnReturnL #-}
-
-
-
--- * Name
-
--- | 'nameName' Lens
-nameNameL :: Lens_' Name (Int)
-nameNameL f Name{..} = (\nameName -> Name { nameName, ..} ) <$> f nameName
-{-# INLINE nameNameL #-}
-
--- | 'nameSnakeCase' Lens
-nameSnakeCaseL :: Lens_' Name (Maybe Int)
-nameSnakeCaseL f Name{..} = (\nameSnakeCase -> Name { nameSnakeCase, ..} ) <$> f nameSnakeCase
-{-# INLINE nameSnakeCaseL #-}
-
--- | 'nameProperty' Lens
-namePropertyL :: Lens_' Name (Maybe Text)
-namePropertyL f Name{..} = (\nameProperty -> Name { nameProperty, ..} ) <$> f nameProperty
-{-# INLINE namePropertyL #-}
-
--- | 'name123Number' Lens
-name123NumberL :: Lens_' Name (Maybe Int)
-name123NumberL f Name{..} = (\name123Number -> Name { name123Number, ..} ) <$> f name123Number
-{-# INLINE name123NumberL #-}
-
-
-
--- * NumberOnly
-
--- | 'numberOnlyJustNumber' Lens
-numberOnlyJustNumberL :: Lens_' NumberOnly (Maybe Double)
-numberOnlyJustNumberL f NumberOnly{..} = (\numberOnlyJustNumber -> NumberOnly { numberOnlyJustNumber, ..} ) <$> f numberOnlyJustNumber
-{-# INLINE numberOnlyJustNumberL #-}
-
-
-
--- * Order
-
--- | 'orderId' Lens
-orderIdL :: Lens_' Order (Maybe Integer)
-orderIdL f Order{..} = (\orderId -> Order { orderId, ..} ) <$> f orderId
-{-# INLINE orderIdL #-}
-
--- | 'orderPetId' Lens
-orderPetIdL :: Lens_' Order (Maybe Integer)
-orderPetIdL f Order{..} = (\orderPetId -> Order { orderPetId, ..} ) <$> f orderPetId
-{-# INLINE orderPetIdL #-}
-
--- | 'orderQuantity' Lens
-orderQuantityL :: Lens_' Order (Maybe Int)
-orderQuantityL f Order{..} = (\orderQuantity -> Order { orderQuantity, ..} ) <$> f orderQuantity
-{-# INLINE orderQuantityL #-}
-
--- | 'orderShipDate' Lens
-orderShipDateL :: Lens_' Order (Maybe DateTime)
-orderShipDateL f Order{..} = (\orderShipDate -> Order { orderShipDate, ..} ) <$> f orderShipDate
-{-# INLINE orderShipDateL #-}
-
--- | 'orderStatus' Lens
-orderStatusL :: Lens_' Order (Maybe Text)
-orderStatusL f Order{..} = (\orderStatus -> Order { orderStatus, ..} ) <$> f orderStatus
-{-# INLINE orderStatusL #-}
-
--- | 'orderComplete' Lens
-orderCompleteL :: Lens_' Order (Maybe Bool)
-orderCompleteL f Order{..} = (\orderComplete -> Order { orderComplete, ..} ) <$> f orderComplete
-{-# INLINE orderCompleteL #-}
-
-
-
--- * OuterBoolean
-
-
-
--- * OuterComposite
-
--- | 'outerCompositeMyNumber' Lens
-outerCompositeMyNumberL :: Lens_' OuterComposite (Maybe OuterNumber)
-outerCompositeMyNumberL f OuterComposite{..} = (\outerCompositeMyNumber -> OuterComposite { outerCompositeMyNumber, ..} ) <$> f outerCompositeMyNumber
-{-# INLINE outerCompositeMyNumberL #-}
-
--- | 'outerCompositeMyString' Lens
-outerCompositeMyStringL :: Lens_' OuterComposite (Maybe OuterString)
-outerCompositeMyStringL f OuterComposite{..} = (\outerCompositeMyString -> OuterComposite { outerCompositeMyString, ..} ) <$> f outerCompositeMyString
-{-# INLINE outerCompositeMyStringL #-}
-
--- | 'outerCompositeMyBoolean' Lens
-outerCompositeMyBooleanL :: Lens_' OuterComposite (Maybe OuterBoolean)
-outerCompositeMyBooleanL f OuterComposite{..} = (\outerCompositeMyBoolean -> OuterComposite { outerCompositeMyBoolean, ..} ) <$> f outerCompositeMyBoolean
-{-# INLINE outerCompositeMyBooleanL #-}
-
-
-
--- * OuterEnum
-
-
-
--- * OuterNumber
-
-
-
--- * OuterString
-
-
-
--- * Pet
-
--- | 'petId' Lens
-petIdL :: Lens_' Pet (Maybe Integer)
-petIdL f Pet{..} = (\petId -> Pet { petId, ..} ) <$> f petId
-{-# INLINE petIdL #-}
-
--- | 'petCategory' Lens
-petCategoryL :: Lens_' Pet (Maybe Category)
-petCategoryL f Pet{..} = (\petCategory -> Pet { petCategory, ..} ) <$> f petCategory
-{-# INLINE petCategoryL #-}
-
--- | 'petName' Lens
-petNameL :: Lens_' Pet (Text)
-petNameL f Pet{..} = (\petName -> Pet { petName, ..} ) <$> f petName
-{-# INLINE petNameL #-}
-
--- | 'petPhotoUrls' Lens
-petPhotoUrlsL :: Lens_' Pet ([Text])
-petPhotoUrlsL f Pet{..} = (\petPhotoUrls -> Pet { petPhotoUrls, ..} ) <$> f petPhotoUrls
-{-# INLINE petPhotoUrlsL #-}
-
--- | 'petTags' Lens
-petTagsL :: Lens_' Pet (Maybe [Tag])
-petTagsL f Pet{..} = (\petTags -> Pet { petTags, ..} ) <$> f petTags
-{-# INLINE petTagsL #-}
-
--- | 'petStatus' Lens
-petStatusL :: Lens_' Pet (Maybe Text)
-petStatusL f Pet{..} = (\petStatus -> Pet { petStatus, ..} ) <$> f petStatus
-{-# INLINE petStatusL #-}
-
-
-
--- * ReadOnlyFirst
-
--- | 'readOnlyFirstBar' Lens
-readOnlyFirstBarL :: Lens_' ReadOnlyFirst (Maybe Text)
-readOnlyFirstBarL f ReadOnlyFirst{..} = (\readOnlyFirstBar -> ReadOnlyFirst { readOnlyFirstBar, ..} ) <$> f readOnlyFirstBar
-{-# INLINE readOnlyFirstBarL #-}
-
--- | 'readOnlyFirstBaz' Lens
-readOnlyFirstBazL :: Lens_' ReadOnlyFirst (Maybe Text)
-readOnlyFirstBazL f ReadOnlyFirst{..} = (\readOnlyFirstBaz -> ReadOnlyFirst { readOnlyFirstBaz, ..} ) <$> f readOnlyFirstBaz
-{-# INLINE readOnlyFirstBazL #-}
-
-
-
--- * SpecialModelName
-
--- | 'specialModelNameSpecialPropertyName' Lens
-specialModelNameSpecialPropertyNameL :: Lens_' SpecialModelName (Maybe Integer)
-specialModelNameSpecialPropertyNameL f SpecialModelName{..} = (\specialModelNameSpecialPropertyName -> SpecialModelName { specialModelNameSpecialPropertyName, ..} ) <$> f specialModelNameSpecialPropertyName
-{-# INLINE specialModelNameSpecialPropertyNameL #-}
-
-
-
--- * Tag
-
--- | 'tagId' Lens
-tagIdL :: Lens_' Tag (Maybe Integer)
-tagIdL f Tag{..} = (\tagId -> Tag { tagId, ..} ) <$> f tagId
-{-# INLINE tagIdL #-}
-
--- | 'tagName' Lens
-tagNameL :: Lens_' Tag (Maybe Text)
-tagNameL f Tag{..} = (\tagName -> Tag { tagName, ..} ) <$> f tagName
-{-# INLINE tagNameL #-}
-
-
-
--- * User
-
--- | 'userId' Lens
-userIdL :: Lens_' User (Maybe Integer)
-userIdL f User{..} = (\userId -> User { userId, ..} ) <$> f userId
-{-# INLINE userIdL #-}
-
--- | 'userUsername' Lens
-userUsernameL :: Lens_' User (Maybe Text)
-userUsernameL f User{..} = (\userUsername -> User { userUsername, ..} ) <$> f userUsername
-{-# INLINE userUsernameL #-}
-
--- | 'userFirstName' Lens
-userFirstNameL :: Lens_' User (Maybe Text)
-userFirstNameL f User{..} = (\userFirstName -> User { userFirstName, ..} ) <$> f userFirstName
-{-# INLINE userFirstNameL #-}
-
--- | 'userLastName' Lens
-userLastNameL :: Lens_' User (Maybe Text)
-userLastNameL f User{..} = (\userLastName -> User { userLastName, ..} ) <$> f userLastName
-{-# INLINE userLastNameL #-}
-
--- | 'userEmail' Lens
-userEmailL :: Lens_' User (Maybe Text)
-userEmailL f User{..} = (\userEmail -> User { userEmail, ..} ) <$> f userEmail
-{-# INLINE userEmailL #-}
-
--- | 'userPassword' Lens
-userPasswordL :: Lens_' User (Maybe Text)
-userPasswordL f User{..} = (\userPassword -> User { userPassword, ..} ) <$> f userPassword
-{-# INLINE userPasswordL #-}
-
--- | 'userPhone' Lens
-userPhoneL :: Lens_' User (Maybe Text)
-userPhoneL f User{..} = (\userPhone -> User { userPhone, ..} ) <$> f userPhone
-{-# INLINE userPhoneL #-}
-
--- | 'userUserStatus' Lens
-userUserStatusL :: Lens_' User (Maybe Int)
-userUserStatusL f User{..} = (\userUserStatus -> User { userUserStatus, ..} ) <$> f userUserStatus
-{-# INLINE userUserStatusL #-}
-
-
-
--- * Cat
-
--- | 'catClassName' Lens
-catClassNameL :: Lens_' Cat (Text)
-catClassNameL f Cat{..} = (\catClassName -> Cat { catClassName, ..} ) <$> f catClassName
-{-# INLINE catClassNameL #-}
-
--- | 'catColor' Lens
-catColorL :: Lens_' Cat (Maybe Text)
-catColorL f Cat{..} = (\catColor -> Cat { catColor, ..} ) <$> f catColor
-{-# INLINE catColorL #-}
-
--- | 'catDeclawed' Lens
-catDeclawedL :: Lens_' Cat (Maybe Bool)
-catDeclawedL f Cat{..} = (\catDeclawed -> Cat { catDeclawed, ..} ) <$> f catDeclawed
-{-# INLINE catDeclawedL #-}
-
-
-
--- * Dog
-
--- | 'dogClassName' Lens
-dogClassNameL :: Lens_' Dog (Text)
-dogClassNameL f Dog{..} = (\dogClassName -> Dog { dogClassName, ..} ) <$> f dogClassName
-{-# INLINE dogClassNameL #-}
-
--- | 'dogColor' Lens
-dogColorL :: Lens_' Dog (Maybe Text)
-dogColorL f Dog{..} = (\dogColor -> Dog { dogColor, ..} ) <$> f dogColor
-{-# INLINE dogColorL #-}
-
--- | 'dogBreed' Lens
-dogBreedL :: Lens_' Dog (Maybe Text)
-dogBreedL f Dog{..} = (\dogBreed -> Dog { dogBreed, ..} ) <$> f dogBreed
-{-# INLINE dogBreedL #-}
-
-
diff --git a/lib/SwaggerPetstore/Logging.hs b/lib/SwaggerPetstore/Logging.hs
--- a/lib/SwaggerPetstore/Logging.hs
+++ b/lib/SwaggerPetstore/Logging.hs
@@ -20,15 +20,15 @@
 
 module SwaggerPetstore.Logging where
 
-import Data.Text (Text)
-import GHC.Exts (IsString(..))
-
 import qualified Control.Exception.Safe as E
 import qualified Control.Monad.IO.Class as P
 import qualified Control.Monad.Trans.Reader as P
 import qualified Data.Text as T
 import qualified Lens.Micro as L
 import qualified System.IO as IO
+
+import Data.Text (Text)
+import GHC.Exts (IsString(..))
 
 import qualified Katip as LG
 
diff --git a/lib/SwaggerPetstore/MimeTypes.hs b/lib/SwaggerPetstore/MimeTypes.hs
--- a/lib/SwaggerPetstore/MimeTypes.hs
+++ b/lib/SwaggerPetstore/MimeTypes.hs
@@ -23,40 +23,36 @@
 
 module SwaggerPetstore.MimeTypes where
 
-import SwaggerPetstore.Model as M
-
+import qualified Control.Arrow as P (left)
 import qualified Data.Aeson as A
-
 import qualified Data.ByteString as B
-import qualified Data.ByteString.Lazy as BL
 import qualified Data.ByteString.Builder as BB
 import qualified Data.ByteString.Char8 as BC
+import qualified Data.ByteString.Lazy as BL
 import qualified Data.ByteString.Lazy.Char8 as BCL
-
-
-import qualified Network.HTTP.Media as ME
-
-import qualified Web.FormUrlEncoded as WH
-import qualified Web.HttpApiData as WH
-
 import qualified Data.Data as P (Typeable)
 import qualified Data.Proxy as P (Proxy(..))
-import qualified Data.Text as T
 import qualified Data.String as P
+import qualified Data.Text as T
 import qualified Data.Text.Encoding as T
-import qualified Control.Arrow as P (left)
+import qualified Network.HTTP.Media as ME
+import qualified Web.FormUrlEncoded as WH
+import qualified Web.HttpApiData as WH
 
 import Prelude (($), (.),(<$>),(<*>),Maybe(..),Bool(..),Char,Double,FilePath,Float,Int,Integer,String,fmap,undefined,mempty)
 import qualified Prelude as P
 
--- * Content Negotiation
 
--- | A type for responses without content-body.
-data NoContent = NoContent
-  deriving (P.Show, P.Eq)
+-- * Consumes Class
 
--- ** Mime Types
+class MimeType mtype => Consumes req mtype where
 
+-- * Produces Class
+
+class MimeType mtype => Produces req mtype where
+
+-- * Default Mime Types
+
 data MimeJSON = MimeJSON deriving (P.Typeable)
 data MimeXML = MimeXML deriving (P.Typeable)
 data MimePlainText = MimePlainText deriving (P.Typeable)
@@ -66,11 +62,13 @@
 data MimeNoContent = MimeNoContent deriving (P.Typeable)
 data MimeAny = MimeAny deriving (P.Typeable)
 
-data MimeJsonCharsetutf8 = MimeJsonCharsetutf8 deriving (P.Typeable)
-data MimeXmlCharsetutf8 = MimeXmlCharsetutf8 deriving (P.Typeable)
+-- | A type for responses without content-body.
+data NoContent = NoContent
+  deriving (P.Show, P.Eq, P.Typeable)
 
--- ** MimeType Class
 
+-- * MimeType Class
+
 class P.Typeable mtype => MimeType mtype  where
   {-# MINIMAL mimeType | mimeTypes #-}
 
@@ -91,7 +89,7 @@
   mimeTypes' :: mtype -> [ME.MediaType]
   mimeTypes' _ = mimeTypes (P.Proxy :: P.Proxy mtype)
 
--- ** MimeType Instances
+-- Default MimeType Instances
 
 -- | @application/json; charset=utf-8@
 instance MimeType MimeJSON where
@@ -117,18 +115,7 @@
 instance MimeType MimeNoContent where
   mimeType _ = Nothing
 
--- | @application/json; charset=utf-8@
-instance MimeType MimeJsonCharsetutf8 where
-  mimeType _ = Just $ P.fromString "application/json; charset=utf-8"
-instance A.ToJSON a => MimeRender MimeJsonCharsetutf8 a where mimeRender _ = A.encode
-instance A.FromJSON a => MimeUnrender MimeJsonCharsetutf8 a where mimeUnrender _ = A.eitherDecode
-
--- | @application/xml; charset=utf-8@
-instance MimeType MimeXmlCharsetutf8 where
-  mimeType _ = Just $ P.fromString "application/xml; charset=utf-8"
-
-
--- ** MimeRender Class
+-- * MimeRender Class
 
 class MimeType mtype => MimeRender mtype x where
     mimeRender  :: P.Proxy mtype -> x -> BL.ByteString
@@ -136,8 +123,11 @@
     mimeRender' _ x = mimeRender (P.Proxy :: P.Proxy mtype) x
 
 
--- ** MimeRender Instances
+mimeRenderDefaultMultipartFormData :: WH.ToHttpApiData a => a -> BL.ByteString
+mimeRenderDefaultMultipartFormData = BL.fromStrict . T.encodeUtf8 . WH.toQueryParam
 
+-- Default MimeRender Instances
+
 -- | `A.encode`
 instance A.ToJSON a => MimeRender MimeJSON a where mimeRender _ = A.encode
 -- | @WH.urlEncodeAsForm@
@@ -158,13 +148,9 @@
 instance MimeRender MimeOctetStream String where mimeRender _ = BCL.pack
 
 instance MimeRender MimeMultipartFormData BL.ByteString where mimeRender _ = P.id
-instance MimeRender MimeMultipartFormData Binary where mimeRender _ = unBinary
 
-instance MimeRender MimeMultipartFormData ByteArray where mimeRender _ = mimeRenderDefaultMultipartFormData
 instance MimeRender MimeMultipartFormData Bool where mimeRender _ = mimeRenderDefaultMultipartFormData
 instance MimeRender MimeMultipartFormData Char where mimeRender _ = mimeRenderDefaultMultipartFormData
-instance MimeRender MimeMultipartFormData Date where mimeRender _ = mimeRenderDefaultMultipartFormData
-instance MimeRender MimeMultipartFormData DateTime where mimeRender _ = mimeRenderDefaultMultipartFormData
 instance MimeRender MimeMultipartFormData Double where mimeRender _ = mimeRenderDefaultMultipartFormData
 instance MimeRender MimeMultipartFormData Float where mimeRender _ = mimeRenderDefaultMultipartFormData
 instance MimeRender MimeMultipartFormData Int where mimeRender _ = mimeRenderDefaultMultipartFormData
@@ -172,28 +158,18 @@
 instance MimeRender MimeMultipartFormData String where mimeRender _ = mimeRenderDefaultMultipartFormData
 instance MimeRender MimeMultipartFormData T.Text where mimeRender _ = mimeRenderDefaultMultipartFormData
 
-mimeRenderDefaultMultipartFormData :: WH.ToHttpApiData a => a -> BL.ByteString
-mimeRenderDefaultMultipartFormData = BL.fromStrict . T.encodeUtf8 . WH.toQueryParam
-
 -- | @P.Right . P.const NoContent@
 instance MimeRender MimeNoContent NoContent where mimeRender _ = P.const BCL.empty
 
--- instance MimeRender MimeOctetStream Double where mimeRender _ = BB.toLazyByteString . BB.doubleDec
--- instance MimeRender MimeOctetStream Float where mimeRender _ = BB.toLazyByteString . BB.floatDec
--- instance MimeRender MimeOctetStream Int where mimeRender _ = BB.toLazyByteString . BB.intDec
--- instance MimeRender MimeOctetStream Integer where mimeRender _ = BB.toLazyByteString . BB.integerDec
 
--- instance MimeRender MimeJsonCharsetutf8 T.Text where mimeRender _ = undefined
--- instance MimeRender MimeXmlCharsetutf8 T.Text where mimeRender _ = undefined
-
--- ** MimeUnrender Class
+-- * MimeUnrender Class
 
 class MimeType mtype => MimeUnrender mtype o where
     mimeUnrender :: P.Proxy mtype -> BL.ByteString -> P.Either String o
     mimeUnrender' :: mtype -> BL.ByteString -> P.Either String o
     mimeUnrender' _ x = mimeUnrender (P.Proxy :: P.Proxy mtype) x
 
--- ** MimeUnrender Instances
+-- Default MimeUnrender Instances
 
 -- | @A.eitherDecode@
 instance A.FromJSON a => MimeUnrender MimeJSON a where mimeUnrender _ = A.eitherDecode
@@ -216,14 +192,3 @@
 
 -- | @P.Right . P.const NoContent@
 instance MimeUnrender MimeNoContent NoContent where mimeUnrender _ = P.Right . P.const NoContent
-
--- instance MimeUnrender MimeJsonCharsetutf8 T.Text where mimeUnrender _ = undefined
--- instance MimeUnrender MimeXmlCharsetutf8 T.Text where mimeUnrender _ = undefined
-
--- ** Request Consumes
-
-class MimeType mtype => Consumes req mtype where
-
--- ** Request Produces
-
-class MimeType mtype => Produces req mtype where
diff --git a/lib/SwaggerPetstore/Model.hs b/lib/SwaggerPetstore/Model.hs
--- a/lib/SwaggerPetstore/Model.hs
+++ b/lib/SwaggerPetstore/Model.hs
@@ -27,33 +27,30 @@
 
 module SwaggerPetstore.Model where
 
+import SwaggerPetstore.Core
+
 import Data.Aeson ((.:),(.:!),(.:?),(.=))
 
 import qualified Data.Aeson as A
 import qualified Data.ByteString as B
 import qualified Data.ByteString.Lazy as BL
-import qualified Data.ByteString.Base64.Lazy as BL64
 import qualified Data.Data as P (Data, Typeable)
+import qualified Data.Foldable as P
 import qualified Data.HashMap.Lazy as HM
 import qualified Data.Map as Map
-import qualified Data.Set as Set
 import qualified Data.Maybe as P
-import qualified Data.Foldable as P
-import qualified Web.FormUrlEncoded as WH
-import qualified Web.HttpApiData as WH
-import qualified Control.DeepSeq as NF
-import qualified Data.Ix as P
+import qualified Data.Set as Set
 import qualified Data.Text as T
 import qualified Data.Text.Encoding as T
-import qualified Control.Arrow as P (left)
-import Data.Text (Text)
-
 import qualified Data.Time as TI
-import qualified Data.Time.ISO8601 as TI
+import qualified Web.FormUrlEncoded as WH
+import qualified Web.HttpApiData as WH
 
 import Control.Applicative ((<|>))
 import Control.Applicative (Alternative)
+import Data.Text (Text)
 import Prelude (($), (.),(<$>),(<*>),(>>=),Maybe(..),Bool(..),Char,Double,FilePath,Float,Int,Integer,String,fmap,undefined,mempty,maybe,pure,Monad,Applicative,Functor)
+
 import qualified Prelude as P
 
 
@@ -66,8 +63,7 @@
 data AdditionalPropertiesClass = AdditionalPropertiesClass
   { additionalPropertiesClassMapProperty :: !(Maybe (Map.Map String Text)) -- ^ "map_property"
   , additionalPropertiesClassMapOfMapProperty :: !(Maybe (Map.Map String (Map.Map String Text))) -- ^ "map_of_map_property"
-  } deriving (P.Show,P.Eq,P.Typeable)
-
+  } deriving (P.Show, P.Eq, P.Typeable)
 
 -- | FromJSON AdditionalPropertiesClass
 instance A.FromJSON AdditionalPropertiesClass where
@@ -93,15 +89,14 @@
   { additionalPropertiesClassMapProperty = Nothing
   , additionalPropertiesClassMapOfMapProperty = Nothing
   }
-  
 
+
 -- ** Animal
 -- | Animal
 data Animal = Animal
   { animalClassName :: !(Text) -- ^ /Required/ "className"
   , animalColor :: !(Maybe Text) -- ^ "color"
-  } deriving (P.Show,P.Eq,P.Typeable)
-
+  } deriving (P.Show, P.Eq, P.Typeable)
 
 -- | FromJSON Animal
 instance A.FromJSON Animal where
@@ -128,14 +123,13 @@
   { animalClassName
   , animalColor = Nothing
   }
-  
 
+
 -- ** AnimalFarm
 -- | AnimalFarm
 data AnimalFarm = AnimalFarm
   { 
-  } deriving (P.Show,P.Eq,P.Typeable)
-
+  } deriving (P.Show, P.Eq, P.Typeable)
 
 -- | FromJSON AnimalFarm
 instance A.FromJSON AnimalFarm where
@@ -158,16 +152,15 @@
   AnimalFarm
   { 
   }
-  
 
+
 -- ** ApiResponse
 -- | ApiResponse
 data ApiResponse = ApiResponse
   { apiResponseCode :: !(Maybe Int) -- ^ "code"
   , apiResponseType :: !(Maybe Text) -- ^ "type"
   , apiResponseMessage :: !(Maybe Text) -- ^ "message"
-  } deriving (P.Show,P.Eq,P.Typeable)
-
+  } deriving (P.Show, P.Eq, P.Typeable)
 
 -- | FromJSON ApiResponse
 instance A.FromJSON ApiResponse where
@@ -196,14 +189,13 @@
   , apiResponseType = Nothing
   , apiResponseMessage = Nothing
   }
-  
 
+
 -- ** ArrayOfArrayOfNumberOnly
 -- | ArrayOfArrayOfNumberOnly
 data ArrayOfArrayOfNumberOnly = ArrayOfArrayOfNumberOnly
   { arrayOfArrayOfNumberOnlyArrayArrayNumber :: !(Maybe [[Double]]) -- ^ "ArrayArrayNumber"
-  } deriving (P.Show,P.Eq,P.Typeable)
-
+  } deriving (P.Show, P.Eq, P.Typeable)
 
 -- | FromJSON ArrayOfArrayOfNumberOnly
 instance A.FromJSON ArrayOfArrayOfNumberOnly where
@@ -226,14 +218,13 @@
   ArrayOfArrayOfNumberOnly
   { arrayOfArrayOfNumberOnlyArrayArrayNumber = Nothing
   }
-  
 
+
 -- ** ArrayOfNumberOnly
 -- | ArrayOfNumberOnly
 data ArrayOfNumberOnly = ArrayOfNumberOnly
   { arrayOfNumberOnlyArrayNumber :: !(Maybe [Double]) -- ^ "ArrayNumber"
-  } deriving (P.Show,P.Eq,P.Typeable)
-
+  } deriving (P.Show, P.Eq, P.Typeable)
 
 -- | FromJSON ArrayOfNumberOnly
 instance A.FromJSON ArrayOfNumberOnly where
@@ -256,16 +247,15 @@
   ArrayOfNumberOnly
   { arrayOfNumberOnlyArrayNumber = Nothing
   }
-  
 
+
 -- ** ArrayTest
 -- | ArrayTest
 data ArrayTest = ArrayTest
   { arrayTestArrayOfString :: !(Maybe [Text]) -- ^ "array_of_string"
   , arrayTestArrayArrayOfInteger :: !(Maybe [[Integer]]) -- ^ "array_array_of_integer"
   , arrayTestArrayArrayOfModel :: !(Maybe [[ReadOnlyFirst]]) -- ^ "array_array_of_model"
-  } deriving (P.Show,P.Eq,P.Typeable)
-
+  } deriving (P.Show, P.Eq, P.Typeable)
 
 -- | FromJSON ArrayTest
 instance A.FromJSON ArrayTest where
@@ -294,8 +284,8 @@
   , arrayTestArrayArrayOfInteger = Nothing
   , arrayTestArrayArrayOfModel = Nothing
   }
-  
 
+
 -- ** Capitalization
 -- | Capitalization
 data Capitalization = Capitalization
@@ -305,8 +295,7 @@
   , capitalizationCapitalSnake :: !(Maybe Text) -- ^ "Capital_Snake"
   , capitalizationScaEthFlowPoints :: !(Maybe Text) -- ^ "SCA_ETH_Flow_Points"
   , capitalizationAttName :: !(Maybe Text) -- ^ "ATT_NAME" - Name of the pet 
-  } deriving (P.Show,P.Eq,P.Typeable)
-
+  } deriving (P.Show, P.Eq, P.Typeable)
 
 -- | FromJSON Capitalization
 instance A.FromJSON Capitalization where
@@ -344,15 +333,14 @@
   , capitalizationScaEthFlowPoints = Nothing
   , capitalizationAttName = Nothing
   }
-  
 
+
 -- ** Category
 -- | Category
 data Category = Category
   { categoryId :: !(Maybe Integer) -- ^ "id"
   , categoryName :: !(Maybe Text) -- ^ "name"
-  } deriving (P.Show,P.Eq,P.Typeable)
-
+  } deriving (P.Show, P.Eq, P.Typeable)
 
 -- | FromJSON Category
 instance A.FromJSON Category where
@@ -378,15 +366,14 @@
   { categoryId = Nothing
   , categoryName = Nothing
   }
-  
 
+
 -- ** ClassModel
 -- | ClassModel
 -- Model for testing model with \"_class\" property
 data ClassModel = ClassModel
   { classModelClass :: !(Maybe Text) -- ^ "_class"
-  } deriving (P.Show,P.Eq,P.Typeable)
-
+  } deriving (P.Show, P.Eq, P.Typeable)
 
 -- | FromJSON ClassModel
 instance A.FromJSON ClassModel where
@@ -409,14 +396,13 @@
   ClassModel
   { classModelClass = Nothing
   }
-  
 
+
 -- ** Client
 -- | Client
 data Client = Client
   { clientClient :: !(Maybe Text) -- ^ "client"
-  } deriving (P.Show,P.Eq,P.Typeable)
-
+  } deriving (P.Show, P.Eq, P.Typeable)
 
 -- | FromJSON Client
 instance A.FromJSON Client where
@@ -439,15 +425,14 @@
   Client
   { clientClient = Nothing
   }
-  
 
+
 -- ** EnumArrays
 -- | EnumArrays
 data EnumArrays = EnumArrays
   { enumArraysJustSymbol :: !(Maybe Text) -- ^ "just_symbol"
   , enumArraysArrayEnum :: !(Maybe [Text]) -- ^ "array_enum"
-  } deriving (P.Show,P.Eq,P.Typeable)
-
+  } deriving (P.Show, P.Eq, P.Typeable)
 
 -- | FromJSON EnumArrays
 instance A.FromJSON EnumArrays where
@@ -473,14 +458,13 @@
   { enumArraysJustSymbol = Nothing
   , enumArraysArrayEnum = Nothing
   }
-  
 
+
 -- ** EnumClass
 -- | EnumClass
 data EnumClass = EnumClass
   { 
-  } deriving (P.Show,P.Eq,P.Typeable)
-
+  } deriving (P.Show, P.Eq, P.Typeable)
 
 -- | FromJSON EnumClass
 instance A.FromJSON EnumClass where
@@ -503,8 +487,8 @@
   EnumClass
   { 
   }
-  
 
+
 -- ** EnumTest
 -- | EnumTest
 data EnumTest = EnumTest
@@ -512,8 +496,7 @@
   , enumTestEnumInteger :: !(Maybe Int) -- ^ "enum_integer"
   , enumTestEnumNumber :: !(Maybe Double) -- ^ "enum_number"
   , enumTestOuterEnum :: !(Maybe OuterEnum) -- ^ "outerEnum"
-  } deriving (P.Show,P.Eq,P.Typeable)
-
+  } deriving (P.Show, P.Eq, P.Typeable)
 
 -- | FromJSON EnumTest
 instance A.FromJSON EnumTest where
@@ -545,8 +528,8 @@
   , enumTestEnumNumber = Nothing
   , enumTestOuterEnum = Nothing
   }
-  
 
+
 -- ** FormatTest
 -- | FormatTest
 data FormatTest = FormatTest
@@ -563,8 +546,7 @@
   , formatTestDateTime :: !(Maybe DateTime) -- ^ "dateTime"
   , formatTestUuid :: !(Maybe Text) -- ^ "uuid"
   , formatTestPassword :: !(Text) -- ^ /Required/ "password"
-  } deriving (P.Show,P.Eq,P.Typeable)
-
+  } deriving (P.Show, P.Eq, P.Typeable)
 
 -- | FromJSON FormatTest
 instance A.FromJSON FormatTest where
@@ -627,15 +609,14 @@
   , formatTestUuid = Nothing
   , formatTestPassword
   }
-  
 
+
 -- ** HasOnlyReadOnly
 -- | HasOnlyReadOnly
 data HasOnlyReadOnly = HasOnlyReadOnly
   { hasOnlyReadOnlyBar :: !(Maybe Text) -- ^ "bar"
   , hasOnlyReadOnlyFoo :: !(Maybe Text) -- ^ "foo"
-  } deriving (P.Show,P.Eq,P.Typeable)
-
+  } deriving (P.Show, P.Eq, P.Typeable)
 
 -- | FromJSON HasOnlyReadOnly
 instance A.FromJSON HasOnlyReadOnly where
@@ -661,15 +642,14 @@
   { hasOnlyReadOnlyBar = Nothing
   , hasOnlyReadOnlyFoo = Nothing
   }
-  
 
+
 -- ** MapTest
 -- | MapTest
 data MapTest = MapTest
   { mapTestMapMapOfString :: !(Maybe (Map.Map String (Map.Map String Text))) -- ^ "map_map_of_string"
   , mapTestMapOfEnumString :: !(Maybe (Map.Map String Text)) -- ^ "map_of_enum_string"
-  } deriving (P.Show,P.Eq,P.Typeable)
-
+  } deriving (P.Show, P.Eq, P.Typeable)
 
 -- | FromJSON MapTest
 instance A.FromJSON MapTest where
@@ -695,16 +675,15 @@
   { mapTestMapMapOfString = Nothing
   , mapTestMapOfEnumString = Nothing
   }
-  
 
+
 -- ** MixedPropertiesAndAdditionalPropertiesClass
 -- | MixedPropertiesAndAdditionalPropertiesClass
 data MixedPropertiesAndAdditionalPropertiesClass = MixedPropertiesAndAdditionalPropertiesClass
   { mixedPropertiesAndAdditionalPropertiesClassUuid :: !(Maybe Text) -- ^ "uuid"
   , mixedPropertiesAndAdditionalPropertiesClassDateTime :: !(Maybe DateTime) -- ^ "dateTime"
   , mixedPropertiesAndAdditionalPropertiesClassMap :: !(Maybe (Map.Map String Animal)) -- ^ "map"
-  } deriving (P.Show,P.Eq,P.Typeable)
-
+  } deriving (P.Show, P.Eq, P.Typeable)
 
 -- | FromJSON MixedPropertiesAndAdditionalPropertiesClass
 instance A.FromJSON MixedPropertiesAndAdditionalPropertiesClass where
@@ -733,16 +712,15 @@
   , mixedPropertiesAndAdditionalPropertiesClassDateTime = Nothing
   , mixedPropertiesAndAdditionalPropertiesClassMap = Nothing
   }
-  
 
+
 -- ** Model200Response
 -- | Model200Response
 -- Model for testing model name starting with number
 data Model200Response = Model200Response
   { model200ResponseName :: !(Maybe Int) -- ^ "name"
   , model200ResponseClass :: !(Maybe Text) -- ^ "class"
-  } deriving (P.Show,P.Eq,P.Typeable)
-
+  } deriving (P.Show, P.Eq, P.Typeable)
 
 -- | FromJSON Model200Response
 instance A.FromJSON Model200Response where
@@ -768,14 +746,13 @@
   { model200ResponseName = Nothing
   , model200ResponseClass = Nothing
   }
-  
 
+
 -- ** ModelList
 -- | ModelList
 data ModelList = ModelList
   { modelList123List :: !(Maybe Text) -- ^ "123-list"
-  } deriving (P.Show,P.Eq,P.Typeable)
-
+  } deriving (P.Show, P.Eq, P.Typeable)
 
 -- | FromJSON ModelList
 instance A.FromJSON ModelList where
@@ -798,15 +775,14 @@
   ModelList
   { modelList123List = Nothing
   }
-  
 
+
 -- ** ModelReturn
 -- | ModelReturn
 -- Model for testing reserved words
 data ModelReturn = ModelReturn
   { modelReturnReturn :: !(Maybe Int) -- ^ "return"
-  } deriving (P.Show,P.Eq,P.Typeable)
-
+  } deriving (P.Show, P.Eq, P.Typeable)
 
 -- | FromJSON ModelReturn
 instance A.FromJSON ModelReturn where
@@ -829,8 +805,8 @@
   ModelReturn
   { modelReturnReturn = Nothing
   }
-  
 
+
 -- ** Name
 -- | Name
 -- Model for testing model name same as property name
@@ -839,8 +815,7 @@
   , nameSnakeCase :: !(Maybe Int) -- ^ "snake_case"
   , nameProperty :: !(Maybe Text) -- ^ "property"
   , name123Number :: !(Maybe Int) -- ^ "123Number"
-  } deriving (P.Show,P.Eq,P.Typeable)
-
+  } deriving (P.Show, P.Eq, P.Typeable)
 
 -- | FromJSON Name
 instance A.FromJSON Name where
@@ -873,14 +848,13 @@
   , nameProperty = Nothing
   , name123Number = Nothing
   }
-  
 
+
 -- ** NumberOnly
 -- | NumberOnly
 data NumberOnly = NumberOnly
   { numberOnlyJustNumber :: !(Maybe Double) -- ^ "JustNumber"
-  } deriving (P.Show,P.Eq,P.Typeable)
-
+  } deriving (P.Show, P.Eq, P.Typeable)
 
 -- | FromJSON NumberOnly
 instance A.FromJSON NumberOnly where
@@ -903,8 +877,8 @@
   NumberOnly
   { numberOnlyJustNumber = Nothing
   }
-  
 
+
 -- ** Order
 -- | Order
 data Order = Order
@@ -914,8 +888,7 @@
   , orderShipDate :: !(Maybe DateTime) -- ^ "shipDate"
   , orderStatus :: !(Maybe Text) -- ^ "status" - Order Status
   , orderComplete :: !(Maybe Bool) -- ^ "complete"
-  } deriving (P.Show,P.Eq,P.Typeable)
-
+  } deriving (P.Show, P.Eq, P.Typeable)
 
 -- | FromJSON Order
 instance A.FromJSON Order where
@@ -953,46 +926,23 @@
   , orderStatus = Nothing
   , orderComplete = Nothing
   }
-  
 
+
 -- ** OuterBoolean
 -- | OuterBoolean
-data OuterBoolean = OuterBoolean
-  { 
-  } deriving (P.Show,P.Eq,P.Typeable)
+newtype OuterBoolean = OuterBoolean
+  { unOuterBoolean :: Bool
+  } deriving (P.Eq, P.Show, P.Typeable, A.ToJSON, A.FromJSON, WH.ToHttpApiData, WH.FromHttpApiData)
 
 
--- | FromJSON OuterBoolean
-instance A.FromJSON OuterBoolean where
-  parseJSON = A.withObject "OuterBoolean" $ \o ->
-    pure OuterBoolean
-      
 
--- | ToJSON OuterBoolean
-instance A.ToJSON OuterBoolean where
-  toJSON OuterBoolean  =
-   _omitNulls
-      [ 
-      ]
-
-
--- | Construct a value of type 'OuterBoolean' (by applying it's required fields, if any)
-mkOuterBoolean
-  :: OuterBoolean
-mkOuterBoolean =
-  OuterBoolean
-  { 
-  }
-  
-
 -- ** OuterComposite
 -- | OuterComposite
 data OuterComposite = OuterComposite
   { outerCompositeMyNumber :: !(Maybe OuterNumber) -- ^ "my_number"
   , outerCompositeMyString :: !(Maybe OuterString) -- ^ "my_string"
   , outerCompositeMyBoolean :: !(Maybe OuterBoolean) -- ^ "my_boolean"
-  } deriving (P.Show,P.Eq,P.Typeable)
-
+  } deriving (P.Show, P.Eq, P.Typeable)
 
 -- | FromJSON OuterComposite
 instance A.FromJSON OuterComposite where
@@ -1021,14 +971,13 @@
   , outerCompositeMyString = Nothing
   , outerCompositeMyBoolean = Nothing
   }
-  
 
+
 -- ** OuterEnum
 -- | OuterEnum
 data OuterEnum = OuterEnum
   { 
-  } deriving (P.Show,P.Eq,P.Typeable)
-
+  } deriving (P.Show, P.Eq, P.Typeable)
 
 -- | FromJSON OuterEnum
 instance A.FromJSON OuterEnum where
@@ -1051,68 +1000,24 @@
   OuterEnum
   { 
   }
-  
 
+
 -- ** OuterNumber
 -- | OuterNumber
-data OuterNumber = OuterNumber
-  { 
-  } deriving (P.Show,P.Eq,P.Typeable)
+newtype OuterNumber = OuterNumber
+  { unOuterNumber :: Double
+  } deriving (P.Eq, P.Show, P.Typeable, A.ToJSON, A.FromJSON, WH.ToHttpApiData, WH.FromHttpApiData)
 
 
--- | FromJSON OuterNumber
-instance A.FromJSON OuterNumber where
-  parseJSON = A.withObject "OuterNumber" $ \o ->
-    pure OuterNumber
-      
 
--- | ToJSON OuterNumber
-instance A.ToJSON OuterNumber where
-  toJSON OuterNumber  =
-   _omitNulls
-      [ 
-      ]
-
-
--- | Construct a value of type 'OuterNumber' (by applying it's required fields, if any)
-mkOuterNumber
-  :: OuterNumber
-mkOuterNumber =
-  OuterNumber
-  { 
-  }
-  
-
 -- ** OuterString
 -- | OuterString
-data OuterString = OuterString
-  { 
-  } deriving (P.Show,P.Eq,P.Typeable)
+newtype OuterString = OuterString
+  { unOuterString :: Text
+  } deriving (P.Eq, P.Show, P.Typeable, A.ToJSON, A.FromJSON, WH.ToHttpApiData, WH.FromHttpApiData)
 
 
--- | FromJSON OuterString
-instance A.FromJSON OuterString where
-  parseJSON = A.withObject "OuterString" $ \o ->
-    pure OuterString
-      
 
--- | ToJSON OuterString
-instance A.ToJSON OuterString where
-  toJSON OuterString  =
-   _omitNulls
-      [ 
-      ]
-
-
--- | Construct a value of type 'OuterString' (by applying it's required fields, if any)
-mkOuterString
-  :: OuterString
-mkOuterString =
-  OuterString
-  { 
-  }
-  
-
 -- ** Pet
 -- | Pet
 data Pet = Pet
@@ -1122,8 +1027,7 @@
   , petPhotoUrls :: !([Text]) -- ^ /Required/ "photoUrls"
   , petTags :: !(Maybe [Tag]) -- ^ "tags"
   , petStatus :: !(Maybe Text) -- ^ "status" - pet status in the store
-  } deriving (P.Show,P.Eq,P.Typeable)
-
+  } deriving (P.Show, P.Eq, P.Typeable)
 
 -- | FromJSON Pet
 instance A.FromJSON Pet where
@@ -1163,15 +1067,14 @@
   , petTags = Nothing
   , petStatus = Nothing
   }
-  
 
+
 -- ** ReadOnlyFirst
 -- | ReadOnlyFirst
 data ReadOnlyFirst = ReadOnlyFirst
   { readOnlyFirstBar :: !(Maybe Text) -- ^ "bar"
   , readOnlyFirstBaz :: !(Maybe Text) -- ^ "baz"
-  } deriving (P.Show,P.Eq,P.Typeable)
-
+  } deriving (P.Show, P.Eq, P.Typeable)
 
 -- | FromJSON ReadOnlyFirst
 instance A.FromJSON ReadOnlyFirst where
@@ -1197,14 +1100,13 @@
   { readOnlyFirstBar = Nothing
   , readOnlyFirstBaz = Nothing
   }
-  
 
+
 -- ** SpecialModelName
 -- | SpecialModelName
 data SpecialModelName = SpecialModelName
   { specialModelNameSpecialPropertyName :: !(Maybe Integer) -- ^ "$special[property.name]"
-  } deriving (P.Show,P.Eq,P.Typeable)
-
+  } deriving (P.Show, P.Eq, P.Typeable)
 
 -- | FromJSON SpecialModelName
 instance A.FromJSON SpecialModelName where
@@ -1227,15 +1129,14 @@
   SpecialModelName
   { specialModelNameSpecialPropertyName = Nothing
   }
-  
 
+
 -- ** Tag
 -- | Tag
 data Tag = Tag
   { tagId :: !(Maybe Integer) -- ^ "id"
   , tagName :: !(Maybe Text) -- ^ "name"
-  } deriving (P.Show,P.Eq,P.Typeable)
-
+  } deriving (P.Show, P.Eq, P.Typeable)
 
 -- | FromJSON Tag
 instance A.FromJSON Tag where
@@ -1261,8 +1162,8 @@
   { tagId = Nothing
   , tagName = Nothing
   }
-  
 
+
 -- ** User
 -- | User
 data User = User
@@ -1274,8 +1175,7 @@
   , userPassword :: !(Maybe Text) -- ^ "password"
   , userPhone :: !(Maybe Text) -- ^ "phone"
   , userUserStatus :: !(Maybe Int) -- ^ "userStatus" - User Status
-  } deriving (P.Show,P.Eq,P.Typeable)
-
+  } deriving (P.Show, P.Eq, P.Typeable)
 
 -- | FromJSON User
 instance A.FromJSON User where
@@ -1319,16 +1219,15 @@
   , userPhone = Nothing
   , userUserStatus = Nothing
   }
-  
 
+
 -- ** Cat
 -- | Cat
 data Cat = Cat
   { catClassName :: !(Text) -- ^ /Required/ "className"
   , catColor :: !(Maybe Text) -- ^ "color"
   , catDeclawed :: !(Maybe Bool) -- ^ "declawed"
-  } deriving (P.Show,P.Eq,P.Typeable)
-
+  } deriving (P.Show, P.Eq, P.Typeable)
 
 -- | FromJSON Cat
 instance A.FromJSON Cat where
@@ -1358,16 +1257,15 @@
   , catColor = Nothing
   , catDeclawed = Nothing
   }
-  
 
+
 -- ** Dog
 -- | Dog
 data Dog = Dog
   { dogClassName :: !(Text) -- ^ /Required/ "className"
   , dogColor :: !(Maybe Text) -- ^ "color"
   , dogBreed :: !(Maybe Text) -- ^ "breed"
-  } deriving (P.Show,P.Eq,P.Typeable)
-
+  } deriving (P.Show, P.Eq, P.Typeable)
 
 -- | FromJSON Dog
 instance A.FromJSON Dog where
@@ -1397,181 +1295,6 @@
   , dogColor = Nothing
   , dogBreed = Nothing
   }
-  
 
--- * Parameter newtypes
 
-newtype AdditionalMetadata = AdditionalMetadata { unAdditionalMetadata :: Text } deriving (P.Eq, P.Show)
-newtype ApiKey = ApiKey { unApiKey :: Text } deriving (P.Eq, P.Show)
-newtype Body = Body { unBody :: [User] } deriving (P.Eq, P.Show, A.ToJSON)
-newtype Byte = Byte { unByte :: ByteArray } deriving (P.Eq, P.Show)
-newtype Callback = Callback { unCallback :: Text } deriving (P.Eq, P.Show)
-newtype EnumFormString = EnumFormString { unEnumFormString :: Text } deriving (P.Eq, P.Show)
-newtype EnumFormStringArray = EnumFormStringArray { unEnumFormStringArray :: [Text] } deriving (P.Eq, P.Show)
-newtype EnumHeaderString = EnumHeaderString { unEnumHeaderString :: Text } deriving (P.Eq, P.Show)
-newtype EnumHeaderStringArray = EnumHeaderStringArray { unEnumHeaderStringArray :: [Text] } deriving (P.Eq, P.Show)
-newtype EnumQueryDouble = EnumQueryDouble { unEnumQueryDouble :: Double } deriving (P.Eq, P.Show)
-newtype EnumQueryInteger = EnumQueryInteger { unEnumQueryInteger :: Int } deriving (P.Eq, P.Show)
-newtype EnumQueryString = EnumQueryString { unEnumQueryString :: Text } deriving (P.Eq, P.Show)
-newtype EnumQueryStringArray = EnumQueryStringArray { unEnumQueryStringArray :: [Text] } deriving (P.Eq, P.Show)
-newtype File = File { unFile :: FilePath } deriving (P.Eq, P.Show)
-newtype Int32 = Int32 { unInt32 :: Int } deriving (P.Eq, P.Show)
-newtype Int64 = Int64 { unInt64 :: Integer } deriving (P.Eq, P.Show)
-newtype Name2 = Name2 { unName2 :: Text } deriving (P.Eq, P.Show)
-newtype Number = Number { unNumber :: Double } deriving (P.Eq, P.Show)
-newtype OrderId = OrderId { unOrderId :: Integer } deriving (P.Eq, P.Show)
-newtype OrderIdText = OrderIdText { unOrderIdText :: Text } deriving (P.Eq, P.Show)
-newtype Param = Param { unParam :: Text } deriving (P.Eq, P.Show)
-newtype Param2 = Param2 { unParam2 :: Text } deriving (P.Eq, P.Show)
-newtype ParamBinary = ParamBinary { unParamBinary :: Binary } deriving (P.Eq, P.Show)
-newtype ParamDate = ParamDate { unParamDate :: Date } deriving (P.Eq, P.Show)
-newtype ParamDateTime = ParamDateTime { unParamDateTime :: DateTime } deriving (P.Eq, P.Show)
-newtype ParamDouble = ParamDouble { unParamDouble :: Double } deriving (P.Eq, P.Show)
-newtype ParamFloat = ParamFloat { unParamFloat :: Float } deriving (P.Eq, P.Show)
-newtype ParamInteger = ParamInteger { unParamInteger :: Int } deriving (P.Eq, P.Show)
-newtype ParamString = ParamString { unParamString :: Text } deriving (P.Eq, P.Show)
-newtype Password = Password { unPassword :: Text } deriving (P.Eq, P.Show)
-newtype PatternWithoutDelimiter = PatternWithoutDelimiter { unPatternWithoutDelimiter :: Text } deriving (P.Eq, P.Show)
-newtype PetId = PetId { unPetId :: Integer } deriving (P.Eq, P.Show)
-newtype Status = Status { unStatus :: [Text] } deriving (P.Eq, P.Show)
-newtype StatusText = StatusText { unStatusText :: Text } deriving (P.Eq, P.Show)
-newtype Tags = Tags { unTags :: [Text] } deriving (P.Eq, P.Show)
-newtype Username = Username { unUsername :: Text } deriving (P.Eq, P.Show)
 
--- * Utils
-
--- | Removes Null fields.  (OpenAPI-Specification 2.0 does not allow Null in JSON)
-_omitNulls :: [(Text, A.Value)] -> A.Value
-_omitNulls = A.object . P.filter notNull
-  where
-    notNull (_, A.Null) = False
-    notNull _ = True
-
--- | Encodes fields using WH.toQueryParam
-_toFormItem :: (WH.ToHttpApiData a, Functor f) => t -> f a -> f (t, [Text])
-_toFormItem name x = (name,) . (:[]) . WH.toQueryParam <$> x
-
--- | Collapse (Just "") to Nothing
-_emptyToNothing :: Maybe String -> Maybe String
-_emptyToNothing (Just "") = Nothing
-_emptyToNothing x = x
-{-# INLINE _emptyToNothing #-}
-
--- | Collapse (Just mempty) to Nothing
-_memptyToNothing :: (P.Monoid a, P.Eq a) => Maybe a -> Maybe a
-_memptyToNothing (Just x) | x P.== P.mempty = Nothing
-_memptyToNothing x = x
-{-# INLINE _memptyToNothing #-}
-
--- * DateTime Formatting
-
-newtype DateTime = DateTime { unDateTime :: TI.UTCTime }
-  deriving (P.Eq,P.Data,P.Ord,P.Typeable,NF.NFData,TI.ParseTime,TI.FormatTime)
-instance A.FromJSON DateTime where
-  parseJSON = A.withText "DateTime" (_readDateTime . T.unpack)
-instance A.ToJSON DateTime where
-  toJSON (DateTime t) = A.toJSON (_showDateTime t)
-instance WH.FromHttpApiData DateTime where
-  parseUrlPiece = P.left T.pack . _readDateTime . T.unpack
-instance WH.ToHttpApiData DateTime where
-  toUrlPiece (DateTime t) = T.pack (_showDateTime t)
-instance P.Show DateTime where
-  show (DateTime t) = _showDateTime t
-
--- | @_parseISO8601@
-_readDateTime :: (TI.ParseTime t, Monad m, Alternative m) => String -> m t
-_readDateTime =
-  _parseISO8601
-{-# INLINE _readDateTime #-}
-
--- | @TI.formatISO8601Millis@
-_showDateTime :: (t ~ TI.UTCTime, TI.FormatTime t) => t -> String
-_showDateTime =
-  TI.formatISO8601Millis
-{-# INLINE _showDateTime #-}
-
--- | parse an ISO8601 date-time string
-_parseISO8601 :: (TI.ParseTime t, Monad m, Alternative m) => String -> m t
-_parseISO8601 t =
-  P.asum $
-  P.flip (TI.parseTimeM True TI.defaultTimeLocale) t <$>
-  ["%FT%T%QZ", "%FT%T%Q%z", "%FT%T%Q%Z"]
-{-# INLINE _parseISO8601 #-}
-
--- * Date Formatting
-
-newtype Date = Date { unDate :: TI.Day }
-  deriving (P.Enum,P.Eq,P.Data,P.Ord,P.Ix,NF.NFData,TI.ParseTime,TI.FormatTime)
-instance A.FromJSON Date where
-  parseJSON = A.withText "Date" (_readDate . T.unpack)
-instance A.ToJSON Date where
-  toJSON (Date t) = A.toJSON (_showDate t)
-instance WH.FromHttpApiData Date where
-  parseUrlPiece = P.left T.pack . _readDate . T.unpack
-instance WH.ToHttpApiData Date where
-  toUrlPiece (Date t) = T.pack (_showDate t)
-instance P.Show Date where
-  show (Date t) = _showDate t
-
--- | @TI.parseTimeM True TI.defaultTimeLocale "%Y-%m-%d"@
-_readDate :: (TI.ParseTime t, Monad m) => String -> m t
-_readDate =
-  TI.parseTimeM True TI.defaultTimeLocale "%Y-%m-%d"
-{-# INLINE _readDate #-}
-
--- | @TI.formatTime TI.defaultTimeLocale "%Y-%m-%d"@
-_showDate :: TI.FormatTime t => t -> String
-_showDate =
-  TI.formatTime TI.defaultTimeLocale "%Y-%m-%d"
-{-# INLINE _showDate #-}
-
--- * Byte/Binary Formatting
-
-  
--- | base64 encoded characters
-newtype ByteArray = ByteArray { unByteArray :: BL.ByteString }
-  deriving (P.Eq,P.Data,P.Ord,P.Typeable,NF.NFData)
-
-instance A.FromJSON ByteArray where
-  parseJSON = A.withText "ByteArray" _readByteArray
-instance A.ToJSON ByteArray where
-  toJSON = A.toJSON . _showByteArray
-instance WH.FromHttpApiData ByteArray where
-  parseUrlPiece = P.left T.pack . _readByteArray
-instance WH.ToHttpApiData ByteArray where
-  toUrlPiece = _showByteArray
-instance P.Show ByteArray where
-  show = T.unpack . _showByteArray
-
--- | read base64 encoded characters
-_readByteArray :: Monad m => Text -> m ByteArray
-_readByteArray = P.either P.fail (pure . ByteArray) . BL64.decode . BL.fromStrict . T.encodeUtf8
-{-# INLINE _readByteArray #-}
-
--- | show base64 encoded characters
-_showByteArray :: ByteArray -> Text
-_showByteArray = T.decodeUtf8 . BL.toStrict . BL64.encode . unByteArray
-{-# INLINE _showByteArray #-}
-
--- | any sequence of octets
-newtype Binary = Binary { unBinary :: BL.ByteString }
-  deriving (P.Eq,P.Data,P.Ord,P.Typeable,NF.NFData)
-
-instance A.FromJSON Binary where
-  parseJSON = A.withText "Binary" _readBinaryBase64
-instance A.ToJSON Binary where
-  toJSON = A.toJSON . _showBinaryBase64
-instance WH.FromHttpApiData Binary where
-  parseUrlPiece = P.left T.pack . _readBinaryBase64
-instance WH.ToHttpApiData Binary where
-  toUrlPiece = _showBinaryBase64
-instance P.Show Binary where
-  show = T.unpack . _showBinaryBase64
-
-_readBinaryBase64 :: Monad m => Text -> m Binary
-_readBinaryBase64 = P.either P.fail (pure . Binary) . BL64.decode . BL.fromStrict . T.encodeUtf8
-{-# INLINE _readBinaryBase64 #-}
-
-_showBinaryBase64 :: Binary -> Text
-_showBinaryBase64 = T.decodeUtf8 . BL.toStrict . BL64.encode . unBinary
-{-# INLINE _showBinaryBase64 #-}
diff --git a/lib/SwaggerPetstore/ModelLens.hs b/lib/SwaggerPetstore/ModelLens.hs
new file mode 100644
--- /dev/null
+++ b/lib/SwaggerPetstore/ModelLens.hs
@@ -0,0 +1,637 @@
+{-
+   Swagger Petstore
+
+   This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+   OpenAPI spec version: 2.0
+   Swagger Petstore API version: 1.0.0
+   Contact: apiteam@swagger.io
+   Generated by Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
+-}
+
+{-|
+Module : SwaggerPetstore.Lens
+-}
+
+{-# LANGUAGE KindSignatures #-}
+{-# LANGUAGE NamedFieldPuns #-}
+{-# LANGUAGE RankNTypes #-}
+{-# LANGUAGE RecordWildCards #-}
+{-# OPTIONS_GHC -fno-warn-name-shadowing -fno-warn-unused-matches -fno-warn-unused-binds -fno-warn-unused-imports #-}
+
+module SwaggerPetstore.ModelLens where
+
+import qualified Data.Aeson as A
+import qualified Data.ByteString.Lazy as BL
+import qualified Data.Data as P (Data, Typeable)
+import qualified Data.Map as Map
+import qualified Data.Set as Set
+import qualified Data.Time as TI
+
+import Data.Text (Text)
+
+import Prelude (($), (.),(<$>),(<*>),(=<<),Maybe(..),Bool(..),Char,Double,FilePath,Float,Int,Integer,String,fmap,undefined,mempty,maybe,pure,Monad,Applicative,Functor)
+import qualified Prelude as P
+
+import SwaggerPetstore.Model
+import SwaggerPetstore.Core
+
+
+-- * AdditionalPropertiesClass
+
+-- | 'additionalPropertiesClassMapProperty' Lens
+additionalPropertiesClassMapPropertyL :: Lens_' AdditionalPropertiesClass (Maybe (Map.Map String Text))
+additionalPropertiesClassMapPropertyL f AdditionalPropertiesClass{..} = (\additionalPropertiesClassMapProperty -> AdditionalPropertiesClass { additionalPropertiesClassMapProperty, ..} ) <$> f additionalPropertiesClassMapProperty
+{-# INLINE additionalPropertiesClassMapPropertyL #-}
+
+-- | 'additionalPropertiesClassMapOfMapProperty' Lens
+additionalPropertiesClassMapOfMapPropertyL :: Lens_' AdditionalPropertiesClass (Maybe (Map.Map String (Map.Map String Text)))
+additionalPropertiesClassMapOfMapPropertyL f AdditionalPropertiesClass{..} = (\additionalPropertiesClassMapOfMapProperty -> AdditionalPropertiesClass { additionalPropertiesClassMapOfMapProperty, ..} ) <$> f additionalPropertiesClassMapOfMapProperty
+{-# INLINE additionalPropertiesClassMapOfMapPropertyL #-}
+
+
+
+-- * Animal
+
+-- | 'animalClassName' Lens
+animalClassNameL :: Lens_' Animal (Text)
+animalClassNameL f Animal{..} = (\animalClassName -> Animal { animalClassName, ..} ) <$> f animalClassName
+{-# INLINE animalClassNameL #-}
+
+-- | 'animalColor' Lens
+animalColorL :: Lens_' Animal (Maybe Text)
+animalColorL f Animal{..} = (\animalColor -> Animal { animalColor, ..} ) <$> f animalColor
+{-# INLINE animalColorL #-}
+
+
+
+-- * AnimalFarm
+
+
+
+-- * ApiResponse
+
+-- | 'apiResponseCode' Lens
+apiResponseCodeL :: Lens_' ApiResponse (Maybe Int)
+apiResponseCodeL f ApiResponse{..} = (\apiResponseCode -> ApiResponse { apiResponseCode, ..} ) <$> f apiResponseCode
+{-# INLINE apiResponseCodeL #-}
+
+-- | 'apiResponseType' Lens
+apiResponseTypeL :: Lens_' ApiResponse (Maybe Text)
+apiResponseTypeL f ApiResponse{..} = (\apiResponseType -> ApiResponse { apiResponseType, ..} ) <$> f apiResponseType
+{-# INLINE apiResponseTypeL #-}
+
+-- | 'apiResponseMessage' Lens
+apiResponseMessageL :: Lens_' ApiResponse (Maybe Text)
+apiResponseMessageL f ApiResponse{..} = (\apiResponseMessage -> ApiResponse { apiResponseMessage, ..} ) <$> f apiResponseMessage
+{-# INLINE apiResponseMessageL #-}
+
+
+
+-- * ArrayOfArrayOfNumberOnly
+
+-- | 'arrayOfArrayOfNumberOnlyArrayArrayNumber' Lens
+arrayOfArrayOfNumberOnlyArrayArrayNumberL :: Lens_' ArrayOfArrayOfNumberOnly (Maybe [[Double]])
+arrayOfArrayOfNumberOnlyArrayArrayNumberL f ArrayOfArrayOfNumberOnly{..} = (\arrayOfArrayOfNumberOnlyArrayArrayNumber -> ArrayOfArrayOfNumberOnly { arrayOfArrayOfNumberOnlyArrayArrayNumber, ..} ) <$> f arrayOfArrayOfNumberOnlyArrayArrayNumber
+{-# INLINE arrayOfArrayOfNumberOnlyArrayArrayNumberL #-}
+
+
+
+-- * ArrayOfNumberOnly
+
+-- | 'arrayOfNumberOnlyArrayNumber' Lens
+arrayOfNumberOnlyArrayNumberL :: Lens_' ArrayOfNumberOnly (Maybe [Double])
+arrayOfNumberOnlyArrayNumberL f ArrayOfNumberOnly{..} = (\arrayOfNumberOnlyArrayNumber -> ArrayOfNumberOnly { arrayOfNumberOnlyArrayNumber, ..} ) <$> f arrayOfNumberOnlyArrayNumber
+{-# INLINE arrayOfNumberOnlyArrayNumberL #-}
+
+
+
+-- * ArrayTest
+
+-- | 'arrayTestArrayOfString' Lens
+arrayTestArrayOfStringL :: Lens_' ArrayTest (Maybe [Text])
+arrayTestArrayOfStringL f ArrayTest{..} = (\arrayTestArrayOfString -> ArrayTest { arrayTestArrayOfString, ..} ) <$> f arrayTestArrayOfString
+{-# INLINE arrayTestArrayOfStringL #-}
+
+-- | 'arrayTestArrayArrayOfInteger' Lens
+arrayTestArrayArrayOfIntegerL :: Lens_' ArrayTest (Maybe [[Integer]])
+arrayTestArrayArrayOfIntegerL f ArrayTest{..} = (\arrayTestArrayArrayOfInteger -> ArrayTest { arrayTestArrayArrayOfInteger, ..} ) <$> f arrayTestArrayArrayOfInteger
+{-# INLINE arrayTestArrayArrayOfIntegerL #-}
+
+-- | 'arrayTestArrayArrayOfModel' Lens
+arrayTestArrayArrayOfModelL :: Lens_' ArrayTest (Maybe [[ReadOnlyFirst]])
+arrayTestArrayArrayOfModelL f ArrayTest{..} = (\arrayTestArrayArrayOfModel -> ArrayTest { arrayTestArrayArrayOfModel, ..} ) <$> f arrayTestArrayArrayOfModel
+{-# INLINE arrayTestArrayArrayOfModelL #-}
+
+
+
+-- * Capitalization
+
+-- | 'capitalizationSmallCamel' Lens
+capitalizationSmallCamelL :: Lens_' Capitalization (Maybe Text)
+capitalizationSmallCamelL f Capitalization{..} = (\capitalizationSmallCamel -> Capitalization { capitalizationSmallCamel, ..} ) <$> f capitalizationSmallCamel
+{-# INLINE capitalizationSmallCamelL #-}
+
+-- | 'capitalizationCapitalCamel' Lens
+capitalizationCapitalCamelL :: Lens_' Capitalization (Maybe Text)
+capitalizationCapitalCamelL f Capitalization{..} = (\capitalizationCapitalCamel -> Capitalization { capitalizationCapitalCamel, ..} ) <$> f capitalizationCapitalCamel
+{-# INLINE capitalizationCapitalCamelL #-}
+
+-- | 'capitalizationSmallSnake' Lens
+capitalizationSmallSnakeL :: Lens_' Capitalization (Maybe Text)
+capitalizationSmallSnakeL f Capitalization{..} = (\capitalizationSmallSnake -> Capitalization { capitalizationSmallSnake, ..} ) <$> f capitalizationSmallSnake
+{-# INLINE capitalizationSmallSnakeL #-}
+
+-- | 'capitalizationCapitalSnake' Lens
+capitalizationCapitalSnakeL :: Lens_' Capitalization (Maybe Text)
+capitalizationCapitalSnakeL f Capitalization{..} = (\capitalizationCapitalSnake -> Capitalization { capitalizationCapitalSnake, ..} ) <$> f capitalizationCapitalSnake
+{-# INLINE capitalizationCapitalSnakeL #-}
+
+-- | 'capitalizationScaEthFlowPoints' Lens
+capitalizationScaEthFlowPointsL :: Lens_' Capitalization (Maybe Text)
+capitalizationScaEthFlowPointsL f Capitalization{..} = (\capitalizationScaEthFlowPoints -> Capitalization { capitalizationScaEthFlowPoints, ..} ) <$> f capitalizationScaEthFlowPoints
+{-# INLINE capitalizationScaEthFlowPointsL #-}
+
+-- | 'capitalizationAttName' Lens
+capitalizationAttNameL :: Lens_' Capitalization (Maybe Text)
+capitalizationAttNameL f Capitalization{..} = (\capitalizationAttName -> Capitalization { capitalizationAttName, ..} ) <$> f capitalizationAttName
+{-# INLINE capitalizationAttNameL #-}
+
+
+
+-- * Category
+
+-- | 'categoryId' Lens
+categoryIdL :: Lens_' Category (Maybe Integer)
+categoryIdL f Category{..} = (\categoryId -> Category { categoryId, ..} ) <$> f categoryId
+{-# INLINE categoryIdL #-}
+
+-- | 'categoryName' Lens
+categoryNameL :: Lens_' Category (Maybe Text)
+categoryNameL f Category{..} = (\categoryName -> Category { categoryName, ..} ) <$> f categoryName
+{-# INLINE categoryNameL #-}
+
+
+
+-- * ClassModel
+
+-- | 'classModelClass' Lens
+classModelClassL :: Lens_' ClassModel (Maybe Text)
+classModelClassL f ClassModel{..} = (\classModelClass -> ClassModel { classModelClass, ..} ) <$> f classModelClass
+{-# INLINE classModelClassL #-}
+
+
+
+-- * Client
+
+-- | 'clientClient' Lens
+clientClientL :: Lens_' Client (Maybe Text)
+clientClientL f Client{..} = (\clientClient -> Client { clientClient, ..} ) <$> f clientClient
+{-# INLINE clientClientL #-}
+
+
+
+-- * EnumArrays
+
+-- | 'enumArraysJustSymbol' Lens
+enumArraysJustSymbolL :: Lens_' EnumArrays (Maybe Text)
+enumArraysJustSymbolL f EnumArrays{..} = (\enumArraysJustSymbol -> EnumArrays { enumArraysJustSymbol, ..} ) <$> f enumArraysJustSymbol
+{-# INLINE enumArraysJustSymbolL #-}
+
+-- | 'enumArraysArrayEnum' Lens
+enumArraysArrayEnumL :: Lens_' EnumArrays (Maybe [Text])
+enumArraysArrayEnumL f EnumArrays{..} = (\enumArraysArrayEnum -> EnumArrays { enumArraysArrayEnum, ..} ) <$> f enumArraysArrayEnum
+{-# INLINE enumArraysArrayEnumL #-}
+
+
+
+-- * EnumClass
+
+
+
+-- * EnumTest
+
+-- | 'enumTestEnumString' Lens
+enumTestEnumStringL :: Lens_' EnumTest (Maybe Text)
+enumTestEnumStringL f EnumTest{..} = (\enumTestEnumString -> EnumTest { enumTestEnumString, ..} ) <$> f enumTestEnumString
+{-# INLINE enumTestEnumStringL #-}
+
+-- | 'enumTestEnumInteger' Lens
+enumTestEnumIntegerL :: Lens_' EnumTest (Maybe Int)
+enumTestEnumIntegerL f EnumTest{..} = (\enumTestEnumInteger -> EnumTest { enumTestEnumInteger, ..} ) <$> f enumTestEnumInteger
+{-# INLINE enumTestEnumIntegerL #-}
+
+-- | 'enumTestEnumNumber' Lens
+enumTestEnumNumberL :: Lens_' EnumTest (Maybe Double)
+enumTestEnumNumberL f EnumTest{..} = (\enumTestEnumNumber -> EnumTest { enumTestEnumNumber, ..} ) <$> f enumTestEnumNumber
+{-# INLINE enumTestEnumNumberL #-}
+
+-- | 'enumTestOuterEnum' Lens
+enumTestOuterEnumL :: Lens_' EnumTest (Maybe OuterEnum)
+enumTestOuterEnumL f EnumTest{..} = (\enumTestOuterEnum -> EnumTest { enumTestOuterEnum, ..} ) <$> f enumTestOuterEnum
+{-# INLINE enumTestOuterEnumL #-}
+
+
+
+-- * FormatTest
+
+-- | 'formatTestInteger' Lens
+formatTestIntegerL :: Lens_' FormatTest (Maybe Int)
+formatTestIntegerL f FormatTest{..} = (\formatTestInteger -> FormatTest { formatTestInteger, ..} ) <$> f formatTestInteger
+{-# INLINE formatTestIntegerL #-}
+
+-- | 'formatTestInt32' Lens
+formatTestInt32L :: Lens_' FormatTest (Maybe Int)
+formatTestInt32L f FormatTest{..} = (\formatTestInt32 -> FormatTest { formatTestInt32, ..} ) <$> f formatTestInt32
+{-# INLINE formatTestInt32L #-}
+
+-- | 'formatTestInt64' Lens
+formatTestInt64L :: Lens_' FormatTest (Maybe Integer)
+formatTestInt64L f FormatTest{..} = (\formatTestInt64 -> FormatTest { formatTestInt64, ..} ) <$> f formatTestInt64
+{-# INLINE formatTestInt64L #-}
+
+-- | 'formatTestNumber' Lens
+formatTestNumberL :: Lens_' FormatTest (Double)
+formatTestNumberL f FormatTest{..} = (\formatTestNumber -> FormatTest { formatTestNumber, ..} ) <$> f formatTestNumber
+{-# INLINE formatTestNumberL #-}
+
+-- | 'formatTestFloat' Lens
+formatTestFloatL :: Lens_' FormatTest (Maybe Float)
+formatTestFloatL f FormatTest{..} = (\formatTestFloat -> FormatTest { formatTestFloat, ..} ) <$> f formatTestFloat
+{-# INLINE formatTestFloatL #-}
+
+-- | 'formatTestDouble' Lens
+formatTestDoubleL :: Lens_' FormatTest (Maybe Double)
+formatTestDoubleL f FormatTest{..} = (\formatTestDouble -> FormatTest { formatTestDouble, ..} ) <$> f formatTestDouble
+{-# INLINE formatTestDoubleL #-}
+
+-- | 'formatTestString' Lens
+formatTestStringL :: Lens_' FormatTest (Maybe Text)
+formatTestStringL f FormatTest{..} = (\formatTestString -> FormatTest { formatTestString, ..} ) <$> f formatTestString
+{-# INLINE formatTestStringL #-}
+
+-- | 'formatTestByte' Lens
+formatTestByteL :: Lens_' FormatTest (ByteArray)
+formatTestByteL f FormatTest{..} = (\formatTestByte -> FormatTest { formatTestByte, ..} ) <$> f formatTestByte
+{-# INLINE formatTestByteL #-}
+
+-- | 'formatTestBinary' Lens
+formatTestBinaryL :: Lens_' FormatTest (Maybe Binary)
+formatTestBinaryL f FormatTest{..} = (\formatTestBinary -> FormatTest { formatTestBinary, ..} ) <$> f formatTestBinary
+{-# INLINE formatTestBinaryL #-}
+
+-- | 'formatTestDate' Lens
+formatTestDateL :: Lens_' FormatTest (Date)
+formatTestDateL f FormatTest{..} = (\formatTestDate -> FormatTest { formatTestDate, ..} ) <$> f formatTestDate
+{-# INLINE formatTestDateL #-}
+
+-- | 'formatTestDateTime' Lens
+formatTestDateTimeL :: Lens_' FormatTest (Maybe DateTime)
+formatTestDateTimeL f FormatTest{..} = (\formatTestDateTime -> FormatTest { formatTestDateTime, ..} ) <$> f formatTestDateTime
+{-# INLINE formatTestDateTimeL #-}
+
+-- | 'formatTestUuid' Lens
+formatTestUuidL :: Lens_' FormatTest (Maybe Text)
+formatTestUuidL f FormatTest{..} = (\formatTestUuid -> FormatTest { formatTestUuid, ..} ) <$> f formatTestUuid
+{-# INLINE formatTestUuidL #-}
+
+-- | 'formatTestPassword' Lens
+formatTestPasswordL :: Lens_' FormatTest (Text)
+formatTestPasswordL f FormatTest{..} = (\formatTestPassword -> FormatTest { formatTestPassword, ..} ) <$> f formatTestPassword
+{-# INLINE formatTestPasswordL #-}
+
+
+
+-- * HasOnlyReadOnly
+
+-- | 'hasOnlyReadOnlyBar' Lens
+hasOnlyReadOnlyBarL :: Lens_' HasOnlyReadOnly (Maybe Text)
+hasOnlyReadOnlyBarL f HasOnlyReadOnly{..} = (\hasOnlyReadOnlyBar -> HasOnlyReadOnly { hasOnlyReadOnlyBar, ..} ) <$> f hasOnlyReadOnlyBar
+{-# INLINE hasOnlyReadOnlyBarL #-}
+
+-- | 'hasOnlyReadOnlyFoo' Lens
+hasOnlyReadOnlyFooL :: Lens_' HasOnlyReadOnly (Maybe Text)
+hasOnlyReadOnlyFooL f HasOnlyReadOnly{..} = (\hasOnlyReadOnlyFoo -> HasOnlyReadOnly { hasOnlyReadOnlyFoo, ..} ) <$> f hasOnlyReadOnlyFoo
+{-# INLINE hasOnlyReadOnlyFooL #-}
+
+
+
+-- * MapTest
+
+-- | 'mapTestMapMapOfString' Lens
+mapTestMapMapOfStringL :: Lens_' MapTest (Maybe (Map.Map String (Map.Map String Text)))
+mapTestMapMapOfStringL f MapTest{..} = (\mapTestMapMapOfString -> MapTest { mapTestMapMapOfString, ..} ) <$> f mapTestMapMapOfString
+{-# INLINE mapTestMapMapOfStringL #-}
+
+-- | 'mapTestMapOfEnumString' Lens
+mapTestMapOfEnumStringL :: Lens_' MapTest (Maybe (Map.Map String Text))
+mapTestMapOfEnumStringL f MapTest{..} = (\mapTestMapOfEnumString -> MapTest { mapTestMapOfEnumString, ..} ) <$> f mapTestMapOfEnumString
+{-# INLINE mapTestMapOfEnumStringL #-}
+
+
+
+-- * MixedPropertiesAndAdditionalPropertiesClass
+
+-- | 'mixedPropertiesAndAdditionalPropertiesClassUuid' Lens
+mixedPropertiesAndAdditionalPropertiesClassUuidL :: Lens_' MixedPropertiesAndAdditionalPropertiesClass (Maybe Text)
+mixedPropertiesAndAdditionalPropertiesClassUuidL f MixedPropertiesAndAdditionalPropertiesClass{..} = (\mixedPropertiesAndAdditionalPropertiesClassUuid -> MixedPropertiesAndAdditionalPropertiesClass { mixedPropertiesAndAdditionalPropertiesClassUuid, ..} ) <$> f mixedPropertiesAndAdditionalPropertiesClassUuid
+{-# INLINE mixedPropertiesAndAdditionalPropertiesClassUuidL #-}
+
+-- | 'mixedPropertiesAndAdditionalPropertiesClassDateTime' Lens
+mixedPropertiesAndAdditionalPropertiesClassDateTimeL :: Lens_' MixedPropertiesAndAdditionalPropertiesClass (Maybe DateTime)
+mixedPropertiesAndAdditionalPropertiesClassDateTimeL f MixedPropertiesAndAdditionalPropertiesClass{..} = (\mixedPropertiesAndAdditionalPropertiesClassDateTime -> MixedPropertiesAndAdditionalPropertiesClass { mixedPropertiesAndAdditionalPropertiesClassDateTime, ..} ) <$> f mixedPropertiesAndAdditionalPropertiesClassDateTime
+{-# INLINE mixedPropertiesAndAdditionalPropertiesClassDateTimeL #-}
+
+-- | 'mixedPropertiesAndAdditionalPropertiesClassMap' Lens
+mixedPropertiesAndAdditionalPropertiesClassMapL :: Lens_' MixedPropertiesAndAdditionalPropertiesClass (Maybe (Map.Map String Animal))
+mixedPropertiesAndAdditionalPropertiesClassMapL f MixedPropertiesAndAdditionalPropertiesClass{..} = (\mixedPropertiesAndAdditionalPropertiesClassMap -> MixedPropertiesAndAdditionalPropertiesClass { mixedPropertiesAndAdditionalPropertiesClassMap, ..} ) <$> f mixedPropertiesAndAdditionalPropertiesClassMap
+{-# INLINE mixedPropertiesAndAdditionalPropertiesClassMapL #-}
+
+
+
+-- * Model200Response
+
+-- | 'model200ResponseName' Lens
+model200ResponseNameL :: Lens_' Model200Response (Maybe Int)
+model200ResponseNameL f Model200Response{..} = (\model200ResponseName -> Model200Response { model200ResponseName, ..} ) <$> f model200ResponseName
+{-# INLINE model200ResponseNameL #-}
+
+-- | 'model200ResponseClass' Lens
+model200ResponseClassL :: Lens_' Model200Response (Maybe Text)
+model200ResponseClassL f Model200Response{..} = (\model200ResponseClass -> Model200Response { model200ResponseClass, ..} ) <$> f model200ResponseClass
+{-# INLINE model200ResponseClassL #-}
+
+
+
+-- * ModelList
+
+-- | 'modelList123List' Lens
+modelList123ListL :: Lens_' ModelList (Maybe Text)
+modelList123ListL f ModelList{..} = (\modelList123List -> ModelList { modelList123List, ..} ) <$> f modelList123List
+{-# INLINE modelList123ListL #-}
+
+
+
+-- * ModelReturn
+
+-- | 'modelReturnReturn' Lens
+modelReturnReturnL :: Lens_' ModelReturn (Maybe Int)
+modelReturnReturnL f ModelReturn{..} = (\modelReturnReturn -> ModelReturn { modelReturnReturn, ..} ) <$> f modelReturnReturn
+{-# INLINE modelReturnReturnL #-}
+
+
+
+-- * Name
+
+-- | 'nameName' Lens
+nameNameL :: Lens_' Name (Int)
+nameNameL f Name{..} = (\nameName -> Name { nameName, ..} ) <$> f nameName
+{-# INLINE nameNameL #-}
+
+-- | 'nameSnakeCase' Lens
+nameSnakeCaseL :: Lens_' Name (Maybe Int)
+nameSnakeCaseL f Name{..} = (\nameSnakeCase -> Name { nameSnakeCase, ..} ) <$> f nameSnakeCase
+{-# INLINE nameSnakeCaseL #-}
+
+-- | 'nameProperty' Lens
+namePropertyL :: Lens_' Name (Maybe Text)
+namePropertyL f Name{..} = (\nameProperty -> Name { nameProperty, ..} ) <$> f nameProperty
+{-# INLINE namePropertyL #-}
+
+-- | 'name123Number' Lens
+name123NumberL :: Lens_' Name (Maybe Int)
+name123NumberL f Name{..} = (\name123Number -> Name { name123Number, ..} ) <$> f name123Number
+{-# INLINE name123NumberL #-}
+
+
+
+-- * NumberOnly
+
+-- | 'numberOnlyJustNumber' Lens
+numberOnlyJustNumberL :: Lens_' NumberOnly (Maybe Double)
+numberOnlyJustNumberL f NumberOnly{..} = (\numberOnlyJustNumber -> NumberOnly { numberOnlyJustNumber, ..} ) <$> f numberOnlyJustNumber
+{-# INLINE numberOnlyJustNumberL #-}
+
+
+
+-- * Order
+
+-- | 'orderId' Lens
+orderIdL :: Lens_' Order (Maybe Integer)
+orderIdL f Order{..} = (\orderId -> Order { orderId, ..} ) <$> f orderId
+{-# INLINE orderIdL #-}
+
+-- | 'orderPetId' Lens
+orderPetIdL :: Lens_' Order (Maybe Integer)
+orderPetIdL f Order{..} = (\orderPetId -> Order { orderPetId, ..} ) <$> f orderPetId
+{-# INLINE orderPetIdL #-}
+
+-- | 'orderQuantity' Lens
+orderQuantityL :: Lens_' Order (Maybe Int)
+orderQuantityL f Order{..} = (\orderQuantity -> Order { orderQuantity, ..} ) <$> f orderQuantity
+{-# INLINE orderQuantityL #-}
+
+-- | 'orderShipDate' Lens
+orderShipDateL :: Lens_' Order (Maybe DateTime)
+orderShipDateL f Order{..} = (\orderShipDate -> Order { orderShipDate, ..} ) <$> f orderShipDate
+{-# INLINE orderShipDateL #-}
+
+-- | 'orderStatus' Lens
+orderStatusL :: Lens_' Order (Maybe Text)
+orderStatusL f Order{..} = (\orderStatus -> Order { orderStatus, ..} ) <$> f orderStatus
+{-# INLINE orderStatusL #-}
+
+-- | 'orderComplete' Lens
+orderCompleteL :: Lens_' Order (Maybe Bool)
+orderCompleteL f Order{..} = (\orderComplete -> Order { orderComplete, ..} ) <$> f orderComplete
+{-# INLINE orderCompleteL #-}
+
+
+
+-- * OuterBoolean
+
+
+
+-- * OuterComposite
+
+-- | 'outerCompositeMyNumber' Lens
+outerCompositeMyNumberL :: Lens_' OuterComposite (Maybe OuterNumber)
+outerCompositeMyNumberL f OuterComposite{..} = (\outerCompositeMyNumber -> OuterComposite { outerCompositeMyNumber, ..} ) <$> f outerCompositeMyNumber
+{-# INLINE outerCompositeMyNumberL #-}
+
+-- | 'outerCompositeMyString' Lens
+outerCompositeMyStringL :: Lens_' OuterComposite (Maybe OuterString)
+outerCompositeMyStringL f OuterComposite{..} = (\outerCompositeMyString -> OuterComposite { outerCompositeMyString, ..} ) <$> f outerCompositeMyString
+{-# INLINE outerCompositeMyStringL #-}
+
+-- | 'outerCompositeMyBoolean' Lens
+outerCompositeMyBooleanL :: Lens_' OuterComposite (Maybe OuterBoolean)
+outerCompositeMyBooleanL f OuterComposite{..} = (\outerCompositeMyBoolean -> OuterComposite { outerCompositeMyBoolean, ..} ) <$> f outerCompositeMyBoolean
+{-# INLINE outerCompositeMyBooleanL #-}
+
+
+
+-- * OuterEnum
+
+
+
+-- * OuterNumber
+
+
+
+-- * OuterString
+
+
+
+-- * Pet
+
+-- | 'petId' Lens
+petIdL :: Lens_' Pet (Maybe Integer)
+petIdL f Pet{..} = (\petId -> Pet { petId, ..} ) <$> f petId
+{-# INLINE petIdL #-}
+
+-- | 'petCategory' Lens
+petCategoryL :: Lens_' Pet (Maybe Category)
+petCategoryL f Pet{..} = (\petCategory -> Pet { petCategory, ..} ) <$> f petCategory
+{-# INLINE petCategoryL #-}
+
+-- | 'petName' Lens
+petNameL :: Lens_' Pet (Text)
+petNameL f Pet{..} = (\petName -> Pet { petName, ..} ) <$> f petName
+{-# INLINE petNameL #-}
+
+-- | 'petPhotoUrls' Lens
+petPhotoUrlsL :: Lens_' Pet ([Text])
+petPhotoUrlsL f Pet{..} = (\petPhotoUrls -> Pet { petPhotoUrls, ..} ) <$> f petPhotoUrls
+{-# INLINE petPhotoUrlsL #-}
+
+-- | 'petTags' Lens
+petTagsL :: Lens_' Pet (Maybe [Tag])
+petTagsL f Pet{..} = (\petTags -> Pet { petTags, ..} ) <$> f petTags
+{-# INLINE petTagsL #-}
+
+-- | 'petStatus' Lens
+petStatusL :: Lens_' Pet (Maybe Text)
+petStatusL f Pet{..} = (\petStatus -> Pet { petStatus, ..} ) <$> f petStatus
+{-# INLINE petStatusL #-}
+
+
+
+-- * ReadOnlyFirst
+
+-- | 'readOnlyFirstBar' Lens
+readOnlyFirstBarL :: Lens_' ReadOnlyFirst (Maybe Text)
+readOnlyFirstBarL f ReadOnlyFirst{..} = (\readOnlyFirstBar -> ReadOnlyFirst { readOnlyFirstBar, ..} ) <$> f readOnlyFirstBar
+{-# INLINE readOnlyFirstBarL #-}
+
+-- | 'readOnlyFirstBaz' Lens
+readOnlyFirstBazL :: Lens_' ReadOnlyFirst (Maybe Text)
+readOnlyFirstBazL f ReadOnlyFirst{..} = (\readOnlyFirstBaz -> ReadOnlyFirst { readOnlyFirstBaz, ..} ) <$> f readOnlyFirstBaz
+{-# INLINE readOnlyFirstBazL #-}
+
+
+
+-- * SpecialModelName
+
+-- | 'specialModelNameSpecialPropertyName' Lens
+specialModelNameSpecialPropertyNameL :: Lens_' SpecialModelName (Maybe Integer)
+specialModelNameSpecialPropertyNameL f SpecialModelName{..} = (\specialModelNameSpecialPropertyName -> SpecialModelName { specialModelNameSpecialPropertyName, ..} ) <$> f specialModelNameSpecialPropertyName
+{-# INLINE specialModelNameSpecialPropertyNameL #-}
+
+
+
+-- * Tag
+
+-- | 'tagId' Lens
+tagIdL :: Lens_' Tag (Maybe Integer)
+tagIdL f Tag{..} = (\tagId -> Tag { tagId, ..} ) <$> f tagId
+{-# INLINE tagIdL #-}
+
+-- | 'tagName' Lens
+tagNameL :: Lens_' Tag (Maybe Text)
+tagNameL f Tag{..} = (\tagName -> Tag { tagName, ..} ) <$> f tagName
+{-# INLINE tagNameL #-}
+
+
+
+-- * User
+
+-- | 'userId' Lens
+userIdL :: Lens_' User (Maybe Integer)
+userIdL f User{..} = (\userId -> User { userId, ..} ) <$> f userId
+{-# INLINE userIdL #-}
+
+-- | 'userUsername' Lens
+userUsernameL :: Lens_' User (Maybe Text)
+userUsernameL f User{..} = (\userUsername -> User { userUsername, ..} ) <$> f userUsername
+{-# INLINE userUsernameL #-}
+
+-- | 'userFirstName' Lens
+userFirstNameL :: Lens_' User (Maybe Text)
+userFirstNameL f User{..} = (\userFirstName -> User { userFirstName, ..} ) <$> f userFirstName
+{-# INLINE userFirstNameL #-}
+
+-- | 'userLastName' Lens
+userLastNameL :: Lens_' User (Maybe Text)
+userLastNameL f User{..} = (\userLastName -> User { userLastName, ..} ) <$> f userLastName
+{-# INLINE userLastNameL #-}
+
+-- | 'userEmail' Lens
+userEmailL :: Lens_' User (Maybe Text)
+userEmailL f User{..} = (\userEmail -> User { userEmail, ..} ) <$> f userEmail
+{-# INLINE userEmailL #-}
+
+-- | 'userPassword' Lens
+userPasswordL :: Lens_' User (Maybe Text)
+userPasswordL f User{..} = (\userPassword -> User { userPassword, ..} ) <$> f userPassword
+{-# INLINE userPasswordL #-}
+
+-- | 'userPhone' Lens
+userPhoneL :: Lens_' User (Maybe Text)
+userPhoneL f User{..} = (\userPhone -> User { userPhone, ..} ) <$> f userPhone
+{-# INLINE userPhoneL #-}
+
+-- | 'userUserStatus' Lens
+userUserStatusL :: Lens_' User (Maybe Int)
+userUserStatusL f User{..} = (\userUserStatus -> User { userUserStatus, ..} ) <$> f userUserStatus
+{-# INLINE userUserStatusL #-}
+
+
+
+-- * Cat
+
+-- | 'catClassName' Lens
+catClassNameL :: Lens_' Cat (Text)
+catClassNameL f Cat{..} = (\catClassName -> Cat { catClassName, ..} ) <$> f catClassName
+{-# INLINE catClassNameL #-}
+
+-- | 'catColor' Lens
+catColorL :: Lens_' Cat (Maybe Text)
+catColorL f Cat{..} = (\catColor -> Cat { catColor, ..} ) <$> f catColor
+{-# INLINE catColorL #-}
+
+-- | 'catDeclawed' Lens
+catDeclawedL :: Lens_' Cat (Maybe Bool)
+catDeclawedL f Cat{..} = (\catDeclawed -> Cat { catDeclawed, ..} ) <$> f catDeclawed
+{-# INLINE catDeclawedL #-}
+
+
+
+-- * Dog
+
+-- | 'dogClassName' Lens
+dogClassNameL :: Lens_' Dog (Text)
+dogClassNameL f Dog{..} = (\dogClassName -> Dog { dogClassName, ..} ) <$> f dogClassName
+{-# INLINE dogClassNameL #-}
+
+-- | 'dogColor' Lens
+dogColorL :: Lens_' Dog (Maybe Text)
+dogColorL f Dog{..} = (\dogColor -> Dog { dogColor, ..} ) <$> f dogColor
+{-# INLINE dogColorL #-}
+
+-- | 'dogBreed' Lens
+dogBreedL :: Lens_' Dog (Maybe Text)
+dogBreedL f Dog{..} = (\dogBreed -> Dog { dogBreed, ..} ) <$> f dogBreed
+{-# INLINE dogBreedL #-}
+
+
diff --git a/swagger-petstore.cabal b/swagger-petstore.cabal
--- a/swagger-petstore.cabal
+++ b/swagger-petstore.cabal
@@ -1,5 +1,5 @@
 name:           swagger-petstore
-version:        0.0.1.3
+version:        0.0.1.4
 synopsis:       Auto-generated swagger-petstore API Client
 description:    .
                 Client library for calling the swagger-petstore API based on http-client.
@@ -25,7 +25,7 @@
 
 extra-source-files:
     README.md
-    swagger.json
+    swagger.yaml
 
 library
   hs-source-dirs:
@@ -61,10 +61,11 @@
       SwaggerPetstore
       SwaggerPetstore.API
       SwaggerPetstore.Client
-      SwaggerPetstore.Model
-      SwaggerPetstore.MimeTypes
-      SwaggerPetstore.Lens
+      SwaggerPetstore.Core
       SwaggerPetstore.Logging
+      SwaggerPetstore.MimeTypes
+      SwaggerPetstore.Model
+      SwaggerPetstore.ModelLens
   other-modules:
       Paths_swagger_petstore
   default-language: Haskell2010
diff --git a/swagger.json b/swagger.json
deleted file mode 100644
--- a/swagger.json
+++ /dev/null
@@ -1,1693 +0,0 @@
-{
-  "swagger" : "2.0",
-  "info" : {
-    "description" : "This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\",
-    "version" : "1.0.0",
-    "title" : "Swagger Petstore",
-    "termsOfService" : "http://swagger.io/terms/",
-    "contact" : {
-      "email" : "apiteam@swagger.io"
-    },
-    "license" : {
-      "name" : "Apache-2.0",
-      "url" : "http://www.apache.org/licenses/LICENSE-2.0.html"
-    }
-  },
-  "host" : "petstore.swagger.io:80",
-  "basePath" : "/v2",
-  "tags" : [ {
-    "name" : "pet",
-    "description" : "Everything about your Pets",
-    "externalDocs" : {
-      "description" : "Find out more",
-      "url" : "http://swagger.io"
-    }
-  }, {
-    "name" : "store",
-    "description" : "Access to Petstore orders"
-  }, {
-    "name" : "user",
-    "description" : "Operations about user",
-    "externalDocs" : {
-      "description" : "Find out more about our store",
-      "url" : "http://swagger.io"
-    }
-  } ],
-  "schemes" : [ "http" ],
-  "paths" : {
-    "/pet" : {
-      "post" : {
-        "tags" : [ "pet" ],
-        "summary" : "Add a new pet to the store",
-        "description" : "",
-        "operationId" : "addPet",
-        "consumes" : [ "application/json", "application/xml" ],
-        "produces" : [ "application/xml", "application/json" ],
-        "parameters" : [ {
-          "in" : "body",
-          "name" : "body",
-          "description" : "Pet object that needs to be added to the store",
-          "required" : true,
-          "schema" : {
-            "$ref" : "#/definitions/Pet"
-          }
-        } ],
-        "responses" : {
-          "405" : {
-            "description" : "Invalid input"
-          }
-        },
-        "security" : [ {
-          "petstore_auth" : [ "write:pets", "read:pets" ]
-        } ]
-      },
-      "put" : {
-        "tags" : [ "pet" ],
-        "summary" : "Update an existing pet",
-        "description" : "",
-        "operationId" : "updatePet",
-        "consumes" : [ "application/json", "application/xml" ],
-        "produces" : [ "application/xml", "application/json" ],
-        "parameters" : [ {
-          "in" : "body",
-          "name" : "body",
-          "description" : "Pet object that needs to be added to the store",
-          "required" : true,
-          "schema" : {
-            "$ref" : "#/definitions/Pet"
-          }
-        } ],
-        "responses" : {
-          "400" : {
-            "description" : "Invalid ID supplied"
-          },
-          "404" : {
-            "description" : "Pet not found"
-          },
-          "405" : {
-            "description" : "Validation exception"
-          }
-        },
-        "security" : [ {
-          "petstore_auth" : [ "write:pets", "read:pets" ]
-        } ]
-      }
-    },
-    "/pet/findByStatus" : {
-      "get" : {
-        "tags" : [ "pet" ],
-        "summary" : "Finds Pets by status",
-        "description" : "Multiple status values can be provided with comma separated strings",
-        "operationId" : "findPetsByStatus",
-        "produces" : [ "application/xml", "application/json" ],
-        "parameters" : [ {
-          "name" : "status",
-          "in" : "query",
-          "description" : "Status values that need to be considered for filter",
-          "required" : true,
-          "type" : "array",
-          "items" : {
-            "type" : "string",
-            "enum" : [ "available", "pending", "sold" ],
-            "default" : "available"
-          },
-          "collectionFormat" : "csv"
-        } ],
-        "responses" : {
-          "200" : {
-            "description" : "successful operation",
-            "schema" : {
-              "type" : "array",
-              "items" : {
-                "$ref" : "#/definitions/Pet"
-              }
-            }
-          },
-          "400" : {
-            "description" : "Invalid status value"
-          }
-        },
-        "security" : [ {
-          "petstore_auth" : [ "write:pets", "read:pets" ]
-        } ]
-      }
-    },
-    "/pet/findByTags" : {
-      "get" : {
-        "tags" : [ "pet" ],
-        "summary" : "Finds Pets by tags",
-        "description" : "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.",
-        "operationId" : "findPetsByTags",
-        "produces" : [ "application/xml", "application/json" ],
-        "parameters" : [ {
-          "name" : "tags",
-          "in" : "query",
-          "description" : "Tags to filter by",
-          "required" : true,
-          "type" : "array",
-          "items" : {
-            "type" : "string"
-          },
-          "collectionFormat" : "csv"
-        } ],
-        "responses" : {
-          "200" : {
-            "description" : "successful operation",
-            "schema" : {
-              "type" : "array",
-              "items" : {
-                "$ref" : "#/definitions/Pet"
-              }
-            }
-          },
-          "400" : {
-            "description" : "Invalid tag value"
-          }
-        },
-        "security" : [ {
-          "petstore_auth" : [ "write:pets", "read:pets" ]
-        } ],
-        "deprecated" : true
-      }
-    },
-    "/pet/{petId}" : {
-      "get" : {
-        "tags" : [ "pet" ],
-        "summary" : "Find pet by ID",
-        "description" : "Returns a single pet",
-        "operationId" : "getPetById",
-        "produces" : [ "application/xml", "application/json" ],
-        "parameters" : [ {
-          "name" : "petId",
-          "in" : "path",
-          "description" : "ID of pet to return",
-          "required" : true,
-          "type" : "integer",
-          "format" : "int64"
-        } ],
-        "responses" : {
-          "200" : {
-            "description" : "successful operation",
-            "schema" : {
-              "$ref" : "#/definitions/Pet"
-            }
-          },
-          "400" : {
-            "description" : "Invalid ID supplied"
-          },
-          "404" : {
-            "description" : "Pet not found"
-          }
-        },
-        "security" : [ {
-          "api_key" : [ ]
-        } ]
-      },
-      "post" : {
-        "tags" : [ "pet" ],
-        "summary" : "Updates a pet in the store with form data",
-        "description" : "",
-        "operationId" : "updatePetWithForm",
-        "consumes" : [ "application/x-www-form-urlencoded" ],
-        "produces" : [ "application/xml", "application/json" ],
-        "parameters" : [ {
-          "name" : "petId",
-          "in" : "path",
-          "description" : "ID of pet that needs to be updated",
-          "required" : true,
-          "type" : "integer",
-          "format" : "int64"
-        }, {
-          "name" : "name",
-          "in" : "formData",
-          "description" : "Updated name of the pet",
-          "required" : false,
-          "type" : "string"
-        }, {
-          "name" : "status",
-          "in" : "formData",
-          "description" : "Updated status of the pet",
-          "required" : false,
-          "type" : "string"
-        } ],
-        "responses" : {
-          "405" : {
-            "description" : "Invalid input"
-          }
-        },
-        "security" : [ {
-          "petstore_auth" : [ "write:pets", "read:pets" ]
-        } ]
-      },
-      "delete" : {
-        "tags" : [ "pet" ],
-        "summary" : "Deletes a pet",
-        "description" : "",
-        "operationId" : "deletePet",
-        "produces" : [ "application/xml", "application/json" ],
-        "parameters" : [ {
-          "name" : "api_key",
-          "in" : "header",
-          "required" : false,
-          "type" : "string"
-        }, {
-          "name" : "petId",
-          "in" : "path",
-          "description" : "Pet id to delete",
-          "required" : true,
-          "type" : "integer",
-          "format" : "int64"
-        } ],
-        "responses" : {
-          "400" : {
-            "description" : "Invalid pet value"
-          }
-        },
-        "security" : [ {
-          "petstore_auth" : [ "write:pets", "read:pets" ]
-        } ]
-      }
-    },
-    "/pet/{petId}/uploadImage" : {
-      "post" : {
-        "tags" : [ "pet" ],
-        "summary" : "uploads an image",
-        "description" : "",
-        "operationId" : "uploadFile",
-        "consumes" : [ "multipart/form-data" ],
-        "produces" : [ "application/json" ],
-        "parameters" : [ {
-          "name" : "petId",
-          "in" : "path",
-          "description" : "ID of pet to update",
-          "required" : true,
-          "type" : "integer",
-          "format" : "int64"
-        }, {
-          "name" : "additionalMetadata",
-          "in" : "formData",
-          "description" : "Additional data to pass to server",
-          "required" : false,
-          "type" : "string"
-        }, {
-          "name" : "file",
-          "in" : "formData",
-          "description" : "file to upload",
-          "required" : false,
-          "type" : "file"
-        } ],
-        "responses" : {
-          "200" : {
-            "description" : "successful operation",
-            "schema" : {
-              "$ref" : "#/definitions/ApiResponse"
-            }
-          }
-        },
-        "security" : [ {
-          "petstore_auth" : [ "write:pets", "read:pets" ]
-        } ]
-      }
-    },
-    "/store/inventory" : {
-      "get" : {
-        "tags" : [ "store" ],
-        "summary" : "Returns pet inventories by status",
-        "description" : "Returns a map of status codes to quantities",
-        "operationId" : "getInventory",
-        "produces" : [ "application/json" ],
-        "parameters" : [ ],
-        "responses" : {
-          "200" : {
-            "description" : "successful operation",
-            "schema" : {
-              "type" : "object",
-              "additionalProperties" : {
-                "type" : "integer",
-                "format" : "int32"
-              }
-            }
-          }
-        },
-        "security" : [ {
-          "api_key" : [ ]
-        } ]
-      }
-    },
-    "/store/order" : {
-      "post" : {
-        "tags" : [ "store" ],
-        "summary" : "Place an order for a pet",
-        "description" : "",
-        "operationId" : "placeOrder",
-        "produces" : [ "application/xml", "application/json" ],
-        "parameters" : [ {
-          "in" : "body",
-          "name" : "body",
-          "description" : "order placed for purchasing the pet",
-          "required" : true,
-          "schema" : {
-            "$ref" : "#/definitions/Order"
-          }
-        } ],
-        "responses" : {
-          "200" : {
-            "description" : "successful operation",
-            "schema" : {
-              "$ref" : "#/definitions/Order"
-            }
-          },
-          "400" : {
-            "description" : "Invalid Order"
-          }
-        }
-      }
-    },
-    "/store/order/{order_id}" : {
-      "get" : {
-        "tags" : [ "store" ],
-        "summary" : "Find purchase order by ID",
-        "description" : "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions",
-        "operationId" : "getOrderById",
-        "produces" : [ "application/xml", "application/json" ],
-        "parameters" : [ {
-          "name" : "order_id",
-          "in" : "path",
-          "description" : "ID of pet that needs to be fetched",
-          "required" : true,
-          "type" : "integer",
-          "maximum" : 5,
-          "minimum" : 1,
-          "format" : "int64"
-        } ],
-        "responses" : {
-          "200" : {
-            "description" : "successful operation",
-            "schema" : {
-              "$ref" : "#/definitions/Order"
-            }
-          },
-          "400" : {
-            "description" : "Invalid ID supplied"
-          },
-          "404" : {
-            "description" : "Order not found"
-          }
-        }
-      },
-      "delete" : {
-        "tags" : [ "store" ],
-        "summary" : "Delete purchase order by ID",
-        "description" : "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors",
-        "operationId" : "deleteOrder",
-        "produces" : [ "application/xml", "application/json" ],
-        "parameters" : [ {
-          "name" : "order_id",
-          "in" : "path",
-          "description" : "ID of the order that needs to be deleted",
-          "required" : true,
-          "type" : "string"
-        } ],
-        "responses" : {
-          "400" : {
-            "description" : "Invalid ID supplied"
-          },
-          "404" : {
-            "description" : "Order not found"
-          }
-        }
-      }
-    },
-    "/user" : {
-      "post" : {
-        "tags" : [ "user" ],
-        "summary" : "Create user",
-        "description" : "This can only be done by the logged in user.",
-        "operationId" : "createUser",
-        "produces" : [ "application/xml", "application/json" ],
-        "parameters" : [ {
-          "in" : "body",
-          "name" : "body",
-          "description" : "Created user object",
-          "required" : true,
-          "schema" : {
-            "$ref" : "#/definitions/User"
-          }
-        } ],
-        "responses" : {
-          "default" : {
-            "description" : "successful operation"
-          }
-        }
-      }
-    },
-    "/user/createWithArray" : {
-      "post" : {
-        "tags" : [ "user" ],
-        "summary" : "Creates list of users with given input array",
-        "description" : "",
-        "operationId" : "createUsersWithArrayInput",
-        "produces" : [ "application/xml", "application/json" ],
-        "parameters" : [ {
-          "in" : "body",
-          "name" : "body",
-          "description" : "List of user object",
-          "required" : true,
-          "schema" : {
-            "type" : "array",
-            "items" : {
-              "$ref" : "#/definitions/User"
-            }
-          }
-        } ],
-        "responses" : {
-          "default" : {
-            "description" : "successful operation"
-          }
-        }
-      }
-    },
-    "/user/createWithList" : {
-      "post" : {
-        "tags" : [ "user" ],
-        "summary" : "Creates list of users with given input array",
-        "description" : "",
-        "operationId" : "createUsersWithListInput",
-        "produces" : [ "application/xml", "application/json" ],
-        "parameters" : [ {
-          "in" : "body",
-          "name" : "body",
-          "description" : "List of user object",
-          "required" : true,
-          "schema" : {
-            "type" : "array",
-            "items" : {
-              "$ref" : "#/definitions/User"
-            }
-          }
-        } ],
-        "responses" : {
-          "default" : {
-            "description" : "successful operation"
-          }
-        }
-      }
-    },
-    "/user/login" : {
-      "get" : {
-        "tags" : [ "user" ],
-        "summary" : "Logs user into the system",
-        "description" : "",
-        "operationId" : "loginUser",
-        "produces" : [ "application/xml", "application/json" ],
-        "parameters" : [ {
-          "name" : "username",
-          "in" : "query",
-          "description" : "The user name for login",
-          "required" : true,
-          "type" : "string"
-        }, {
-          "name" : "password",
-          "in" : "query",
-          "description" : "The password for login in clear text",
-          "required" : true,
-          "type" : "string"
-        } ],
-        "responses" : {
-          "200" : {
-            "description" : "successful operation",
-            "schema" : {
-              "type" : "string"
-            },
-            "headers" : {
-              "X-Rate-Limit" : {
-                "type" : "integer",
-                "format" : "int32",
-                "description" : "calls per hour allowed by the user"
-              },
-              "X-Expires-After" : {
-                "type" : "string",
-                "format" : "date-time",
-                "description" : "date in UTC when toekn expires"
-              }
-            }
-          },
-          "400" : {
-            "description" : "Invalid username/password supplied"
-          }
-        }
-      }
-    },
-    "/user/logout" : {
-      "get" : {
-        "tags" : [ "user" ],
-        "summary" : "Logs out current logged in user session",
-        "description" : "",
-        "operationId" : "logoutUser",
-        "produces" : [ "application/xml", "application/json" ],
-        "parameters" : [ ],
-        "responses" : {
-          "default" : {
-            "description" : "successful operation"
-          }
-        }
-      }
-    },
-    "/user/{username}" : {
-      "get" : {
-        "tags" : [ "user" ],
-        "summary" : "Get user by user name",
-        "description" : "",
-        "operationId" : "getUserByName",
-        "produces" : [ "application/xml", "application/json" ],
-        "parameters" : [ {
-          "name" : "username",
-          "in" : "path",
-          "description" : "The name that needs to be fetched. Use user1 for testing. ",
-          "required" : true,
-          "type" : "string"
-        } ],
-        "responses" : {
-          "200" : {
-            "description" : "successful operation",
-            "schema" : {
-              "$ref" : "#/definitions/User"
-            }
-          },
-          "400" : {
-            "description" : "Invalid username supplied"
-          },
-          "404" : {
-            "description" : "User not found"
-          }
-        }
-      },
-      "put" : {
-        "tags" : [ "user" ],
-        "summary" : "Updated user",
-        "description" : "This can only be done by the logged in user.",
-        "operationId" : "updateUser",
-        "produces" : [ "application/xml", "application/json" ],
-        "parameters" : [ {
-          "name" : "username",
-          "in" : "path",
-          "description" : "name that need to be deleted",
-          "required" : true,
-          "type" : "string"
-        }, {
-          "in" : "body",
-          "name" : "body",
-          "description" : "Updated user object",
-          "required" : true,
-          "schema" : {
-            "$ref" : "#/definitions/User"
-          }
-        } ],
-        "responses" : {
-          "400" : {
-            "description" : "Invalid user supplied"
-          },
-          "404" : {
-            "description" : "User not found"
-          }
-        }
-      },
-      "delete" : {
-        "tags" : [ "user" ],
-        "summary" : "Delete user",
-        "description" : "This can only be done by the logged in user.",
-        "operationId" : "deleteUser",
-        "produces" : [ "application/xml", "application/json" ],
-        "parameters" : [ {
-          "name" : "username",
-          "in" : "path",
-          "description" : "The name that needs to be deleted",
-          "required" : true,
-          "type" : "string"
-        } ],
-        "responses" : {
-          "400" : {
-            "description" : "Invalid username supplied"
-          },
-          "404" : {
-            "description" : "User not found"
-          }
-        }
-      }
-    },
-    "/fake_classname_test" : {
-      "patch" : {
-        "tags" : [ "fake_classname_tags 123#$%^" ],
-        "summary" : "To test class name in snake case",
-        "operationId" : "testClassname",
-        "consumes" : [ "application/json" ],
-        "produces" : [ "application/json" ],
-        "parameters" : [ {
-          "in" : "body",
-          "name" : "body",
-          "description" : "client model",
-          "required" : true,
-          "schema" : {
-            "$ref" : "#/definitions/Client"
-          }
-        } ],
-        "responses" : {
-          "200" : {
-            "description" : "successful operation",
-            "schema" : {
-              "$ref" : "#/definitions/Client"
-            }
-          }
-        },
-        "security" : [ {
-          "api_key_query" : [ ]
-        } ]
-      }
-    },
-    "/fake" : {
-      "get" : {
-        "tags" : [ "fake" ],
-        "summary" : "To test enum parameters",
-        "description" : "To test enum parameters",
-        "operationId" : "testEnumParameters",
-        "consumes" : [ "*/*" ],
-        "produces" : [ "*/*" ],
-        "parameters" : [ {
-          "name" : "enum_form_string_array",
-          "in" : "formData",
-          "description" : "Form parameter enum test (string array)",
-          "required" : false,
-          "type" : "array",
-          "items" : {
-            "type" : "string",
-            "enum" : [ ">", "$" ],
-            "default" : "$"
-          }
-        }, {
-          "name" : "enum_form_string",
-          "in" : "formData",
-          "description" : "Form parameter enum test (string)",
-          "required" : false,
-          "type" : "string",
-          "default" : "-efg",
-          "enum" : [ "_abc", "-efg", "(xyz)" ]
-        }, {
-          "name" : "enum_header_string_array",
-          "in" : "header",
-          "description" : "Header parameter enum test (string array)",
-          "required" : false,
-          "type" : "array",
-          "items" : {
-            "type" : "string",
-            "enum" : [ ">", "$" ],
-            "default" : "$"
-          }
-        }, {
-          "name" : "enum_header_string",
-          "in" : "header",
-          "description" : "Header parameter enum test (string)",
-          "required" : false,
-          "type" : "string",
-          "default" : "-efg",
-          "enum" : [ "_abc", "-efg", "(xyz)" ]
-        }, {
-          "name" : "enum_query_string_array",
-          "in" : "query",
-          "description" : "Query parameter enum test (string array)",
-          "required" : false,
-          "type" : "array",
-          "items" : {
-            "type" : "string",
-            "enum" : [ ">", "$" ],
-            "default" : "$"
-          }
-        }, {
-          "name" : "enum_query_string",
-          "in" : "query",
-          "description" : "Query parameter enum test (string)",
-          "required" : false,
-          "type" : "string",
-          "default" : "-efg",
-          "enum" : [ "_abc", "-efg", "(xyz)" ]
-        }, {
-          "name" : "enum_query_integer",
-          "in" : "query",
-          "description" : "Query parameter enum test (double)",
-          "required" : false,
-          "type" : "integer",
-          "format" : "int32",
-          "enum" : [ 1, -2 ]
-        }, {
-          "name" : "enum_query_double",
-          "in" : "formData",
-          "description" : "Query parameter enum test (double)",
-          "required" : false,
-          "type" : "number",
-          "format" : "double",
-          "enum" : [ 1.1, -1.2 ]
-        } ],
-        "responses" : {
-          "400" : {
-            "description" : "Invalid request"
-          },
-          "404" : {
-            "description" : "Not found"
-          }
-        }
-      },
-      "post" : {
-        "tags" : [ "fake" ],
-        "summary" : "Fake endpoint for testing various parameters\n假端點\n偽のエンドポイント\n가짜 엔드 포인트\n",
-        "description" : "Fake endpoint for testing various parameters\n假端點\n偽のエンドポイント\n가짜 엔드 포인트\n",
-        "operationId" : "testEndpointParameters",
-        "consumes" : [ "application/xml; charset=utf-8", "application/json; charset=utf-8" ],
-        "produces" : [ "application/xml; charset=utf-8", "application/json; charset=utf-8" ],
-        "parameters" : [ {
-          "name" : "integer",
-          "in" : "formData",
-          "description" : "None",
-          "required" : false,
-          "type" : "integer",
-          "maximum" : 100,
-          "minimum" : 10
-        }, {
-          "name" : "int32",
-          "in" : "formData",
-          "description" : "None",
-          "required" : false,
-          "type" : "integer",
-          "maximum" : 200,
-          "minimum" : 20,
-          "format" : "int32"
-        }, {
-          "name" : "int64",
-          "in" : "formData",
-          "description" : "None",
-          "required" : false,
-          "type" : "integer",
-          "format" : "int64"
-        }, {
-          "name" : "number",
-          "in" : "formData",
-          "description" : "None",
-          "required" : true,
-          "type" : "number",
-          "maximum" : 543.2,
-          "minimum" : 32.1
-        }, {
-          "name" : "float",
-          "in" : "formData",
-          "description" : "None",
-          "required" : false,
-          "type" : "number",
-          "maximum" : 987.6,
-          "format" : "float"
-        }, {
-          "name" : "double",
-          "in" : "formData",
-          "description" : "None",
-          "required" : true,
-          "type" : "number",
-          "maximum" : 123.4,
-          "minimum" : 67.8,
-          "format" : "double"
-        }, {
-          "name" : "string",
-          "in" : "formData",
-          "description" : "None",
-          "required" : false,
-          "type" : "string",
-          "pattern" : "/[a-z]/i"
-        }, {
-          "name" : "pattern_without_delimiter",
-          "in" : "formData",
-          "description" : "None",
-          "required" : true,
-          "type" : "string",
-          "pattern" : "^[A-Z].*"
-        }, {
-          "name" : "byte",
-          "in" : "formData",
-          "description" : "None",
-          "required" : true,
-          "type" : "string",
-          "format" : "byte"
-        }, {
-          "name" : "binary",
-          "in" : "formData",
-          "description" : "None",
-          "required" : false,
-          "type" : "string",
-          "format" : "binary"
-        }, {
-          "name" : "date",
-          "in" : "formData",
-          "description" : "None",
-          "required" : false,
-          "type" : "string",
-          "format" : "date"
-        }, {
-          "name" : "dateTime",
-          "in" : "formData",
-          "description" : "None",
-          "required" : false,
-          "type" : "string",
-          "format" : "date-time"
-        }, {
-          "name" : "password",
-          "in" : "formData",
-          "description" : "None",
-          "required" : false,
-          "type" : "string",
-          "maxLength" : 64,
-          "minLength" : 10,
-          "format" : "password"
-        }, {
-          "name" : "callback",
-          "in" : "formData",
-          "description" : "None",
-          "required" : false,
-          "type" : "string"
-        } ],
-        "responses" : {
-          "400" : {
-            "description" : "Invalid username supplied"
-          },
-          "404" : {
-            "description" : "User not found"
-          }
-        },
-        "security" : [ {
-          "http_basic_test" : [ ]
-        } ]
-      },
-      "patch" : {
-        "tags" : [ "fake" ],
-        "summary" : "To test \"client\" model",
-        "description" : "To test \"client\" model",
-        "operationId" : "testClientModel",
-        "consumes" : [ "application/json" ],
-        "produces" : [ "application/json" ],
-        "parameters" : [ {
-          "in" : "body",
-          "name" : "body",
-          "description" : "client model",
-          "required" : true,
-          "schema" : {
-            "$ref" : "#/definitions/Client"
-          }
-        } ],
-        "responses" : {
-          "200" : {
-            "description" : "successful operation",
-            "schema" : {
-              "$ref" : "#/definitions/Client"
-            }
-          }
-        }
-      }
-    },
-    "/fake/outer/number" : {
-      "post" : {
-        "tags" : [ "fake" ],
-        "description" : "Test serialization of outer number types",
-        "operationId" : "fakeOuterNumberSerialize",
-        "parameters" : [ {
-          "in" : "body",
-          "name" : "body",
-          "description" : "Input number as post body",
-          "required" : false,
-          "schema" : {
-            "$ref" : "#/definitions/OuterNumber"
-          }
-        } ],
-        "responses" : {
-          "200" : {
-            "description" : "Output number",
-            "schema" : {
-              "$ref" : "#/definitions/OuterNumber"
-            }
-          }
-        }
-      }
-    },
-    "/fake/outer/string" : {
-      "post" : {
-        "tags" : [ "fake" ],
-        "description" : "Test serialization of outer string types",
-        "operationId" : "fakeOuterStringSerialize",
-        "parameters" : [ {
-          "in" : "body",
-          "name" : "body",
-          "description" : "Input string as post body",
-          "required" : false,
-          "schema" : {
-            "$ref" : "#/definitions/OuterString"
-          }
-        } ],
-        "responses" : {
-          "200" : {
-            "description" : "Output string",
-            "schema" : {
-              "$ref" : "#/definitions/OuterString"
-            }
-          }
-        }
-      }
-    },
-    "/fake/outer/boolean" : {
-      "post" : {
-        "tags" : [ "fake" ],
-        "description" : "Test serialization of outer boolean types",
-        "operationId" : "fakeOuterBooleanSerialize",
-        "parameters" : [ {
-          "in" : "body",
-          "name" : "body",
-          "description" : "Input boolean as post body",
-          "required" : false,
-          "schema" : {
-            "$ref" : "#/definitions/OuterBoolean"
-          }
-        } ],
-        "responses" : {
-          "200" : {
-            "description" : "Output boolean",
-            "schema" : {
-              "$ref" : "#/definitions/OuterBoolean"
-            }
-          }
-        }
-      }
-    },
-    "/fake/outer/composite" : {
-      "post" : {
-        "tags" : [ "fake" ],
-        "description" : "Test serialization of object with outer number type",
-        "operationId" : "fakeOuterCompositeSerialize",
-        "parameters" : [ {
-          "in" : "body",
-          "name" : "body",
-          "description" : "Input composite as post body",
-          "required" : false,
-          "schema" : {
-            "$ref" : "#/definitions/OuterComposite"
-          }
-        } ],
-        "responses" : {
-          "200" : {
-            "description" : "Output composite",
-            "schema" : {
-              "$ref" : "#/definitions/OuterComposite"
-            }
-          }
-        }
-      }
-    },
-    "/fake/jsonFormData" : {
-      "get" : {
-        "tags" : [ "fake" ],
-        "summary" : "test json serialization of form data",
-        "description" : "",
-        "operationId" : "testJsonFormData",
-        "consumes" : [ "application/json" ],
-        "parameters" : [ {
-          "name" : "param",
-          "in" : "formData",
-          "description" : "field1",
-          "required" : true,
-          "type" : "string"
-        }, {
-          "name" : "param2",
-          "in" : "formData",
-          "description" : "field2",
-          "required" : true,
-          "type" : "string"
-        } ],
-        "responses" : {
-          "200" : {
-            "description" : "successful operation"
-          }
-        }
-      }
-    },
-    "/another-fake/dummy" : {
-      "patch" : {
-        "tags" : [ "$another-fake?" ],
-        "summary" : "To test special tags",
-        "description" : "To test special tags",
-        "operationId" : "test_special_tags",
-        "consumes" : [ "application/json" ],
-        "produces" : [ "application/json" ],
-        "parameters" : [ {
-          "in" : "body",
-          "name" : "body",
-          "description" : "client model",
-          "required" : true,
-          "schema" : {
-            "$ref" : "#/definitions/Client"
-          }
-        } ],
-        "responses" : {
-          "200" : {
-            "description" : "successful operation",
-            "schema" : {
-              "$ref" : "#/definitions/Client"
-            }
-          }
-        }
-      }
-    }
-  },
-  "securityDefinitions" : {
-    "petstore_auth" : {
-      "type" : "oauth2",
-      "authorizationUrl" : "http://petstore.swagger.io/api/oauth/dialog",
-      "flow" : "implicit",
-      "scopes" : {
-        "write:pets" : "modify pets in your account",
-        "read:pets" : "read your pets"
-      }
-    },
-    "api_key" : {
-      "type" : "apiKey",
-      "name" : "api_key",
-      "in" : "header"
-    },
-    "api_key_query" : {
-      "type" : "apiKey",
-      "name" : "api_key_query",
-      "in" : "query"
-    },
-    "http_basic_test" : {
-      "type" : "basic"
-    }
-  },
-  "definitions" : {
-    "Order" : {
-      "type" : "object",
-      "properties" : {
-        "id" : {
-          "type" : "integer",
-          "format" : "int64"
-        },
-        "petId" : {
-          "type" : "integer",
-          "format" : "int64"
-        },
-        "quantity" : {
-          "type" : "integer",
-          "format" : "int32"
-        },
-        "shipDate" : {
-          "type" : "string",
-          "format" : "date-time"
-        },
-        "status" : {
-          "type" : "string",
-          "description" : "Order Status",
-          "enum" : [ "placed", "approved", "delivered" ]
-        },
-        "complete" : {
-          "type" : "boolean",
-          "default" : false
-        }
-      },
-      "xml" : {
-        "name" : "Order"
-      }
-    },
-    "Category" : {
-      "type" : "object",
-      "properties" : {
-        "id" : {
-          "type" : "integer",
-          "format" : "int64"
-        },
-        "name" : {
-          "type" : "string"
-        }
-      },
-      "xml" : {
-        "name" : "Category"
-      }
-    },
-    "User" : {
-      "type" : "object",
-      "properties" : {
-        "id" : {
-          "type" : "integer",
-          "format" : "int64",
-          "x-is-unique" : true
-        },
-        "username" : {
-          "type" : "string"
-        },
-        "firstName" : {
-          "type" : "string"
-        },
-        "lastName" : {
-          "type" : "string"
-        },
-        "email" : {
-          "type" : "string"
-        },
-        "password" : {
-          "type" : "string"
-        },
-        "phone" : {
-          "type" : "string"
-        },
-        "userStatus" : {
-          "type" : "integer",
-          "format" : "int32",
-          "description" : "User Status"
-        }
-      },
-      "xml" : {
-        "name" : "User"
-      }
-    },
-    "Tag" : {
-      "type" : "object",
-      "properties" : {
-        "id" : {
-          "type" : "integer",
-          "format" : "int64"
-        },
-        "name" : {
-          "type" : "string"
-        }
-      },
-      "xml" : {
-        "name" : "Tag"
-      }
-    },
-    "Pet" : {
-      "type" : "object",
-      "required" : [ "name", "photoUrls" ],
-      "properties" : {
-        "id" : {
-          "type" : "integer",
-          "format" : "int64",
-          "x-is-unique" : true
-        },
-        "category" : {
-          "$ref" : "#/definitions/Category"
-        },
-        "name" : {
-          "type" : "string",
-          "example" : "doggie"
-        },
-        "photoUrls" : {
-          "type" : "array",
-          "xml" : {
-            "name" : "photoUrl",
-            "wrapped" : true
-          },
-          "items" : {
-            "type" : "string"
-          }
-        },
-        "tags" : {
-          "type" : "array",
-          "xml" : {
-            "name" : "tag",
-            "wrapped" : true
-          },
-          "items" : {
-            "$ref" : "#/definitions/Tag"
-          }
-        },
-        "status" : {
-          "type" : "string",
-          "description" : "pet status in the store",
-          "enum" : [ "available", "pending", "sold" ]
-        }
-      },
-      "xml" : {
-        "name" : "Pet"
-      }
-    },
-    "ApiResponse" : {
-      "type" : "object",
-      "properties" : {
-        "code" : {
-          "type" : "integer",
-          "format" : "int32"
-        },
-        "type" : {
-          "type" : "string"
-        },
-        "message" : {
-          "type" : "string"
-        }
-      }
-    },
-    "$special[model.name]" : {
-      "properties" : {
-        "$special[property.name]" : {
-          "type" : "integer",
-          "format" : "int64"
-        }
-      },
-      "xml" : {
-        "name" : "$special[model.name]"
-      }
-    },
-    "Return" : {
-      "properties" : {
-        "return" : {
-          "type" : "integer",
-          "format" : "int32"
-        }
-      },
-      "description" : "Model for testing reserved words",
-      "xml" : {
-        "name" : "Return"
-      }
-    },
-    "Name" : {
-      "required" : [ "name" ],
-      "properties" : {
-        "name" : {
-          "type" : "integer",
-          "format" : "int32"
-        },
-        "snake_case" : {
-          "type" : "integer",
-          "format" : "int32",
-          "readOnly" : true
-        },
-        "property" : {
-          "type" : "string"
-        },
-        "123Number" : {
-          "type" : "integer",
-          "readOnly" : true
-        }
-      },
-      "description" : "Model for testing model name same as property name",
-      "xml" : {
-        "name" : "Name"
-      }
-    },
-    "200_response" : {
-      "properties" : {
-        "name" : {
-          "type" : "integer",
-          "format" : "int32"
-        },
-        "class" : {
-          "type" : "string"
-        }
-      },
-      "description" : "Model for testing model name starting with number",
-      "xml" : {
-        "name" : "Name"
-      }
-    },
-    "ClassModel" : {
-      "properties" : {
-        "_class" : {
-          "type" : "string"
-        }
-      },
-      "description" : "Model for testing model with \"_class\" property"
-    },
-    "Dog" : {
-      "allOf" : [ {
-        "$ref" : "#/definitions/Animal"
-      }, {
-        "type" : "object",
-        "properties" : {
-          "breed" : {
-            "type" : "string"
-          }
-        }
-      } ]
-    },
-    "Cat" : {
-      "allOf" : [ {
-        "$ref" : "#/definitions/Animal"
-      }, {
-        "type" : "object",
-        "properties" : {
-          "declawed" : {
-            "type" : "boolean"
-          }
-        }
-      } ]
-    },
-    "Animal" : {
-      "type" : "object",
-      "required" : [ "className" ],
-      "discriminator" : "className",
-      "properties" : {
-        "className" : {
-          "type" : "string"
-        },
-        "color" : {
-          "type" : "string",
-          "default" : "red"
-        }
-      }
-    },
-    "AnimalFarm" : {
-      "type" : "array",
-      "items" : {
-        "$ref" : "#/definitions/Animal"
-      }
-    },
-    "format_test" : {
-      "type" : "object",
-      "required" : [ "byte", "date", "number", "password" ],
-      "properties" : {
-        "integer" : {
-          "type" : "integer",
-          "minimum" : 10,
-          "maximum" : 100
-        },
-        "int32" : {
-          "type" : "integer",
-          "format" : "int32",
-          "minimum" : 20,
-          "maximum" : 200
-        },
-        "int64" : {
-          "type" : "integer",
-          "format" : "int64"
-        },
-        "number" : {
-          "type" : "number",
-          "minimum" : 32.1,
-          "maximum" : 543.2
-        },
-        "float" : {
-          "type" : "number",
-          "format" : "float",
-          "minimum" : 54.3,
-          "maximum" : 987.6
-        },
-        "double" : {
-          "type" : "number",
-          "format" : "double",
-          "minimum" : 67.8,
-          "maximum" : 123.4
-        },
-        "string" : {
-          "type" : "string",
-          "pattern" : "/[a-z]/i"
-        },
-        "byte" : {
-          "type" : "string",
-          "format" : "byte",
-          "pattern" : "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$"
-        },
-        "binary" : {
-          "type" : "string",
-          "format" : "binary"
-        },
-        "date" : {
-          "type" : "string",
-          "format" : "date"
-        },
-        "dateTime" : {
-          "type" : "string",
-          "format" : "date-time"
-        },
-        "uuid" : {
-          "type" : "string",
-          "format" : "uuid"
-        },
-        "password" : {
-          "type" : "string",
-          "format" : "password",
-          "minLength" : 10,
-          "maxLength" : 64
-        }
-      }
-    },
-    "EnumClass" : {
-      "type" : "string",
-      "enum" : [ "_abc", "-efg", "(xyz)" ],
-      "default" : "-efg"
-    },
-    "Enum_Test" : {
-      "type" : "object",
-      "properties" : {
-        "enum_string" : {
-          "type" : "string",
-          "enum" : [ "UPPER", "lower", "" ]
-        },
-        "enum_integer" : {
-          "type" : "integer",
-          "format" : "int32",
-          "enum" : [ 1, -1 ]
-        },
-        "enum_number" : {
-          "type" : "number",
-          "format" : "double",
-          "enum" : [ 1.1, -1.2 ]
-        },
-        "outerEnum" : {
-          "$ref" : "#/definitions/OuterEnum"
-        }
-      }
-    },
-    "AdditionalPropertiesClass" : {
-      "type" : "object",
-      "properties" : {
-        "map_property" : {
-          "type" : "object",
-          "additionalProperties" : {
-            "type" : "string"
-          }
-        },
-        "map_of_map_property" : {
-          "type" : "object",
-          "additionalProperties" : {
-            "type" : "object",
-            "additionalProperties" : {
-              "type" : "string"
-            }
-          }
-        }
-      }
-    },
-    "MixedPropertiesAndAdditionalPropertiesClass" : {
-      "type" : "object",
-      "properties" : {
-        "uuid" : {
-          "type" : "string",
-          "format" : "uuid"
-        },
-        "dateTime" : {
-          "type" : "string",
-          "format" : "date-time"
-        },
-        "map" : {
-          "type" : "object",
-          "additionalProperties" : {
-            "$ref" : "#/definitions/Animal"
-          }
-        }
-      }
-    },
-    "List" : {
-      "type" : "object",
-      "properties" : {
-        "123-list" : {
-          "type" : "string"
-        }
-      }
-    },
-    "Client" : {
-      "type" : "object",
-      "properties" : {
-        "client" : {
-          "type" : "string"
-        }
-      }
-    },
-    "ReadOnlyFirst" : {
-      "type" : "object",
-      "properties" : {
-        "bar" : {
-          "type" : "string",
-          "readOnly" : true
-        },
-        "baz" : {
-          "type" : "string"
-        }
-      }
-    },
-    "hasOnlyReadOnly" : {
-      "type" : "object",
-      "properties" : {
-        "bar" : {
-          "type" : "string",
-          "readOnly" : true
-        },
-        "foo" : {
-          "type" : "string",
-          "readOnly" : true
-        }
-      }
-    },
-    "Capitalization" : {
-      "type" : "object",
-      "properties" : {
-        "smallCamel" : {
-          "type" : "string"
-        },
-        "CapitalCamel" : {
-          "type" : "string"
-        },
-        "small_Snake" : {
-          "type" : "string"
-        },
-        "Capital_Snake" : {
-          "type" : "string"
-        },
-        "SCA_ETH_Flow_Points" : {
-          "type" : "string"
-        },
-        "ATT_NAME" : {
-          "type" : "string",
-          "description" : "Name of the pet\n"
-        }
-      }
-    },
-    "MapTest" : {
-      "type" : "object",
-      "properties" : {
-        "map_map_of_string" : {
-          "type" : "object",
-          "additionalProperties" : {
-            "type" : "object",
-            "additionalProperties" : {
-              "type" : "string"
-            }
-          }
-        },
-        "map_of_enum_string" : {
-          "type" : "object",
-          "additionalProperties" : {
-            "type" : "string",
-            "enum" : [ "UPPER", "lower" ]
-          }
-        }
-      }
-    },
-    "ArrayTest" : {
-      "type" : "object",
-      "properties" : {
-        "array_of_string" : {
-          "type" : "array",
-          "items" : {
-            "type" : "string"
-          }
-        },
-        "array_array_of_integer" : {
-          "type" : "array",
-          "items" : {
-            "type" : "array",
-            "items" : {
-              "type" : "integer",
-              "format" : "int64"
-            }
-          }
-        },
-        "array_array_of_model" : {
-          "type" : "array",
-          "items" : {
-            "type" : "array",
-            "items" : {
-              "$ref" : "#/definitions/ReadOnlyFirst"
-            }
-          }
-        }
-      }
-    },
-    "NumberOnly" : {
-      "type" : "object",
-      "properties" : {
-        "JustNumber" : {
-          "type" : "number"
-        }
-      }
-    },
-    "ArrayOfNumberOnly" : {
-      "type" : "object",
-      "properties" : {
-        "ArrayNumber" : {
-          "type" : "array",
-          "items" : {
-            "type" : "number"
-          }
-        }
-      }
-    },
-    "ArrayOfArrayOfNumberOnly" : {
-      "type" : "object",
-      "properties" : {
-        "ArrayArrayNumber" : {
-          "type" : "array",
-          "items" : {
-            "type" : "array",
-            "items" : {
-              "type" : "number"
-            }
-          }
-        }
-      }
-    },
-    "EnumArrays" : {
-      "type" : "object",
-      "properties" : {
-        "just_symbol" : {
-          "type" : "string",
-          "enum" : [ ">=", "$" ]
-        },
-        "array_enum" : {
-          "type" : "array",
-          "items" : {
-            "type" : "string",
-            "enum" : [ "fish", "crab" ]
-          }
-        }
-      }
-    },
-    "OuterEnum" : {
-      "type" : "string",
-      "enum" : [ "placed", "approved", "delivered" ]
-    },
-    "OuterComposite" : {
-      "type" : "object",
-      "properties" : {
-        "my_number" : {
-          "$ref" : "#/definitions/OuterNumber"
-        },
-        "my_string" : {
-          "$ref" : "#/definitions/OuterString"
-        },
-        "my_boolean" : {
-          "$ref" : "#/definitions/OuterBoolean"
-        }
-      }
-    },
-    "OuterNumber" : {
-      "type" : "number"
-    },
-    "OuterString" : {
-      "type" : "string"
-    },
-    "OuterBoolean" : {
-      "type" : "boolean"
-    }
-  },
-  "externalDocs" : {
-    "description" : "Find out more about Swagger",
-    "url" : "http://swagger.io"
-  }
-}
diff --git a/swagger.yaml b/swagger.yaml
new file mode 100644
--- /dev/null
+++ b/swagger.yaml
@@ -0,0 +1,1471 @@
+---
+swagger: "2.0"
+info:
+  description: "This spec is mainly for testing Petstore server and contains fake\
+    \ endpoints, models. Please do not use this for any other purpose. Special characters:\
+    \ \" \\"
+  version: "1.0.0"
+  title: "Swagger Petstore"
+  termsOfService: "http://swagger.io/terms/"
+  contact:
+    email: "apiteam@swagger.io"
+  license:
+    name: "Apache-2.0"
+    url: "http://www.apache.org/licenses/LICENSE-2.0.html"
+host: "petstore.swagger.io:80"
+basePath: "/v2"
+tags:
+- name: "pet"
+  description: "Everything about your Pets"
+  externalDocs:
+    description: "Find out more"
+    url: "http://swagger.io"
+- name: "store"
+  description: "Access to Petstore orders"
+- name: "user"
+  description: "Operations about user"
+  externalDocs:
+    description: "Find out more about our store"
+    url: "http://swagger.io"
+schemes:
+- "http"
+paths:
+  /pet:
+    post:
+      tags:
+      - "pet"
+      summary: "Add a new pet to the store"
+      description: ""
+      operationId: "addPet"
+      consumes:
+      - "application/json"
+      - "application/xml"
+      produces:
+      - "application/xml"
+      - "application/json"
+      parameters:
+      - in: "body"
+        name: "body"
+        description: "Pet object that needs to be added to the store"
+        required: true
+        schema:
+          $ref: "#/definitions/Pet"
+      responses:
+        405:
+          description: "Invalid input"
+      security:
+      - petstore_auth:
+        - "write:pets"
+        - "read:pets"
+    put:
+      tags:
+      - "pet"
+      summary: "Update an existing pet"
+      description: ""
+      operationId: "updatePet"
+      consumes:
+      - "application/json"
+      - "application/xml"
+      produces:
+      - "application/xml"
+      - "application/json"
+      parameters:
+      - in: "body"
+        name: "body"
+        description: "Pet object that needs to be added to the store"
+        required: true
+        schema:
+          $ref: "#/definitions/Pet"
+      responses:
+        400:
+          description: "Invalid ID supplied"
+        404:
+          description: "Pet not found"
+        405:
+          description: "Validation exception"
+      security:
+      - petstore_auth:
+        - "write:pets"
+        - "read:pets"
+  /pet/findByStatus:
+    get:
+      tags:
+      - "pet"
+      summary: "Finds Pets by status"
+      description: "Multiple status values can be provided with comma separated strings"
+      operationId: "findPetsByStatus"
+      produces:
+      - "application/xml"
+      - "application/json"
+      parameters:
+      - name: "status"
+        in: "query"
+        description: "Status values that need to be considered for filter"
+        required: true
+        type: "array"
+        items:
+          type: "string"
+          enum:
+          - "available"
+          - "pending"
+          - "sold"
+          default: "available"
+        collectionFormat: "csv"
+      responses:
+        200:
+          description: "successful operation"
+          schema:
+            type: "array"
+            items:
+              $ref: "#/definitions/Pet"
+        400:
+          description: "Invalid status value"
+      security:
+      - petstore_auth:
+        - "write:pets"
+        - "read:pets"
+  /pet/findByTags:
+    get:
+      tags:
+      - "pet"
+      summary: "Finds Pets by tags"
+      description: "Multiple tags can be provided with comma separated strings. Use\
+        \ tag1, tag2, tag3 for testing."
+      operationId: "findPetsByTags"
+      produces:
+      - "application/xml"
+      - "application/json"
+      parameters:
+      - name: "tags"
+        in: "query"
+        description: "Tags to filter by"
+        required: true
+        type: "array"
+        items:
+          type: "string"
+        collectionFormat: "csv"
+      responses:
+        200:
+          description: "successful operation"
+          schema:
+            type: "array"
+            items:
+              $ref: "#/definitions/Pet"
+        400:
+          description: "Invalid tag value"
+      security:
+      - petstore_auth:
+        - "write:pets"
+        - "read:pets"
+      deprecated: true
+  /pet/{petId}:
+    get:
+      tags:
+      - "pet"
+      summary: "Find pet by ID"
+      description: "Returns a single pet"
+      operationId: "getPetById"
+      produces:
+      - "application/xml"
+      - "application/json"
+      parameters:
+      - name: "petId"
+        in: "path"
+        description: "ID of pet to return"
+        required: true
+        type: "integer"
+        format: "int64"
+      responses:
+        200:
+          description: "successful operation"
+          schema:
+            $ref: "#/definitions/Pet"
+        400:
+          description: "Invalid ID supplied"
+        404:
+          description: "Pet not found"
+      security:
+      - api_key: []
+    post:
+      tags:
+      - "pet"
+      summary: "Updates a pet in the store with form data"
+      description: ""
+      operationId: "updatePetWithForm"
+      consumes:
+      - "application/x-www-form-urlencoded"
+      produces:
+      - "application/xml"
+      - "application/json"
+      parameters:
+      - name: "petId"
+        in: "path"
+        description: "ID of pet that needs to be updated"
+        required: true
+        type: "integer"
+        format: "int64"
+      - name: "name"
+        in: "formData"
+        description: "Updated name of the pet"
+        required: false
+        type: "string"
+      - name: "status"
+        in: "formData"
+        description: "Updated status of the pet"
+        required: false
+        type: "string"
+      responses:
+        405:
+          description: "Invalid input"
+      security:
+      - petstore_auth:
+        - "write:pets"
+        - "read:pets"
+    delete:
+      tags:
+      - "pet"
+      summary: "Deletes a pet"
+      description: ""
+      operationId: "deletePet"
+      produces:
+      - "application/xml"
+      - "application/json"
+      parameters:
+      - name: "api_key"
+        in: "header"
+        required: false
+        type: "string"
+      - name: "petId"
+        in: "path"
+        description: "Pet id to delete"
+        required: true
+        type: "integer"
+        format: "int64"
+      responses:
+        400:
+          description: "Invalid pet value"
+      security:
+      - petstore_auth:
+        - "write:pets"
+        - "read:pets"
+  /pet/{petId}/uploadImage:
+    post:
+      tags:
+      - "pet"
+      summary: "uploads an image"
+      description: ""
+      operationId: "uploadFile"
+      consumes:
+      - "multipart/form-data"
+      produces:
+      - "application/json"
+      parameters:
+      - name: "petId"
+        in: "path"
+        description: "ID of pet to update"
+        required: true
+        type: "integer"
+        format: "int64"
+      - name: "additionalMetadata"
+        in: "formData"
+        description: "Additional data to pass to server"
+        required: false
+        type: "string"
+      - name: "file"
+        in: "formData"
+        description: "file to upload"
+        required: false
+        type: "file"
+      responses:
+        200:
+          description: "successful operation"
+          schema:
+            $ref: "#/definitions/ApiResponse"
+      security:
+      - petstore_auth:
+        - "write:pets"
+        - "read:pets"
+  /store/inventory:
+    get:
+      tags:
+      - "store"
+      summary: "Returns pet inventories by status"
+      description: "Returns a map of status codes to quantities"
+      operationId: "getInventory"
+      produces:
+      - "application/json"
+      parameters: []
+      responses:
+        200:
+          description: "successful operation"
+          schema:
+            type: "object"
+            additionalProperties:
+              type: "integer"
+              format: "int32"
+      security:
+      - api_key: []
+  /store/order:
+    post:
+      tags:
+      - "store"
+      summary: "Place an order for a pet"
+      description: ""
+      operationId: "placeOrder"
+      produces:
+      - "application/xml"
+      - "application/json"
+      parameters:
+      - in: "body"
+        name: "body"
+        description: "order placed for purchasing the pet"
+        required: true
+        schema:
+          $ref: "#/definitions/Order"
+      responses:
+        200:
+          description: "successful operation"
+          schema:
+            $ref: "#/definitions/Order"
+        400:
+          description: "Invalid Order"
+  /store/order/{order_id}:
+    get:
+      tags:
+      - "store"
+      summary: "Find purchase order by ID"
+      description: "For valid response try integer IDs with value <= 5 or > 10. Other\
+        \ values will generated exceptions"
+      operationId: "getOrderById"
+      produces:
+      - "application/xml"
+      - "application/json"
+      parameters:
+      - name: "order_id"
+        in: "path"
+        description: "ID of pet that needs to be fetched"
+        required: true
+        type: "integer"
+        maximum: 5
+        minimum: 1
+        format: "int64"
+      responses:
+        200:
+          description: "successful operation"
+          schema:
+            $ref: "#/definitions/Order"
+        400:
+          description: "Invalid ID supplied"
+        404:
+          description: "Order not found"
+    delete:
+      tags:
+      - "store"
+      summary: "Delete purchase order by ID"
+      description: "For valid response try integer IDs with value < 1000. Anything\
+        \ above 1000 or nonintegers will generate API errors"
+      operationId: "deleteOrder"
+      produces:
+      - "application/xml"
+      - "application/json"
+      parameters:
+      - name: "order_id"
+        in: "path"
+        description: "ID of the order that needs to be deleted"
+        required: true
+        type: "string"
+      responses:
+        400:
+          description: "Invalid ID supplied"
+        404:
+          description: "Order not found"
+  /user:
+    post:
+      tags:
+      - "user"
+      summary: "Create user"
+      description: "This can only be done by the logged in user."
+      operationId: "createUser"
+      produces:
+      - "application/xml"
+      - "application/json"
+      parameters:
+      - in: "body"
+        name: "body"
+        description: "Created user object"
+        required: true
+        schema:
+          $ref: "#/definitions/User"
+      responses:
+        default:
+          description: "successful operation"
+  /user/createWithArray:
+    post:
+      tags:
+      - "user"
+      summary: "Creates list of users with given input array"
+      description: ""
+      operationId: "createUsersWithArrayInput"
+      produces:
+      - "application/xml"
+      - "application/json"
+      parameters:
+      - in: "body"
+        name: "body"
+        description: "List of user object"
+        required: true
+        schema:
+          type: "array"
+          items:
+            $ref: "#/definitions/User"
+      responses:
+        default:
+          description: "successful operation"
+  /user/createWithList:
+    post:
+      tags:
+      - "user"
+      summary: "Creates list of users with given input array"
+      description: ""
+      operationId: "createUsersWithListInput"
+      produces:
+      - "application/xml"
+      - "application/json"
+      parameters:
+      - in: "body"
+        name: "body"
+        description: "List of user object"
+        required: true
+        schema:
+          type: "array"
+          items:
+            $ref: "#/definitions/User"
+      responses:
+        default:
+          description: "successful operation"
+  /user/login:
+    get:
+      tags:
+      - "user"
+      summary: "Logs user into the system"
+      description: ""
+      operationId: "loginUser"
+      produces:
+      - "application/xml"
+      - "application/json"
+      parameters:
+      - name: "username"
+        in: "query"
+        description: "The user name for login"
+        required: true
+        type: "string"
+      - name: "password"
+        in: "query"
+        description: "The password for login in clear text"
+        required: true
+        type: "string"
+      responses:
+        200:
+          description: "successful operation"
+          schema:
+            type: "string"
+          headers:
+            X-Rate-Limit:
+              type: "integer"
+              format: "int32"
+              description: "calls per hour allowed by the user"
+            X-Expires-After:
+              type: "string"
+              format: "date-time"
+              description: "date in UTC when toekn expires"
+        400:
+          description: "Invalid username/password supplied"
+  /user/logout:
+    get:
+      tags:
+      - "user"
+      summary: "Logs out current logged in user session"
+      description: ""
+      operationId: "logoutUser"
+      produces:
+      - "application/xml"
+      - "application/json"
+      parameters: []
+      responses:
+        default:
+          description: "successful operation"
+  /user/{username}:
+    get:
+      tags:
+      - "user"
+      summary: "Get user by user name"
+      description: ""
+      operationId: "getUserByName"
+      produces:
+      - "application/xml"
+      - "application/json"
+      parameters:
+      - name: "username"
+        in: "path"
+        description: "The name that needs to be fetched. Use user1 for testing. "
+        required: true
+        type: "string"
+      responses:
+        200:
+          description: "successful operation"
+          schema:
+            $ref: "#/definitions/User"
+        400:
+          description: "Invalid username supplied"
+        404:
+          description: "User not found"
+    put:
+      tags:
+      - "user"
+      summary: "Updated user"
+      description: "This can only be done by the logged in user."
+      operationId: "updateUser"
+      produces:
+      - "application/xml"
+      - "application/json"
+      parameters:
+      - name: "username"
+        in: "path"
+        description: "name that need to be deleted"
+        required: true
+        type: "string"
+      - in: "body"
+        name: "body"
+        description: "Updated user object"
+        required: true
+        schema:
+          $ref: "#/definitions/User"
+      responses:
+        400:
+          description: "Invalid user supplied"
+        404:
+          description: "User not found"
+    delete:
+      tags:
+      - "user"
+      summary: "Delete user"
+      description: "This can only be done by the logged in user."
+      operationId: "deleteUser"
+      produces:
+      - "application/xml"
+      - "application/json"
+      parameters:
+      - name: "username"
+        in: "path"
+        description: "The name that needs to be deleted"
+        required: true
+        type: "string"
+      responses:
+        400:
+          description: "Invalid username supplied"
+        404:
+          description: "User not found"
+  /fake_classname_test:
+    patch:
+      tags:
+      - "fake_classname_tags 123#$%^"
+      summary: "To test class name in snake case"
+      operationId: "testClassname"
+      consumes:
+      - "application/json"
+      produces:
+      - "application/json"
+      parameters:
+      - in: "body"
+        name: "body"
+        description: "client model"
+        required: true
+        schema:
+          $ref: "#/definitions/Client"
+      responses:
+        200:
+          description: "successful operation"
+          schema:
+            $ref: "#/definitions/Client"
+      security:
+      - api_key_query: []
+  /fake:
+    get:
+      tags:
+      - "fake"
+      summary: "To test enum parameters"
+      description: "To test enum parameters"
+      operationId: "testEnumParameters"
+      consumes:
+      - "*/*"
+      produces:
+      - "*/*"
+      parameters:
+      - name: "enum_form_string_array"
+        in: "formData"
+        description: "Form parameter enum test (string array)"
+        required: false
+        type: "array"
+        items:
+          type: "string"
+          enum:
+          - ">"
+          - "$"
+          default: "$"
+      - name: "enum_form_string"
+        in: "formData"
+        description: "Form parameter enum test (string)"
+        required: false
+        type: "string"
+        default: "-efg"
+        enum:
+        - "_abc"
+        - "-efg"
+        - "(xyz)"
+      - name: "enum_header_string_array"
+        in: "header"
+        description: "Header parameter enum test (string array)"
+        required: false
+        type: "array"
+        items:
+          type: "string"
+          enum:
+          - ">"
+          - "$"
+          default: "$"
+      - name: "enum_header_string"
+        in: "header"
+        description: "Header parameter enum test (string)"
+        required: false
+        type: "string"
+        default: "-efg"
+        enum:
+        - "_abc"
+        - "-efg"
+        - "(xyz)"
+      - name: "enum_query_string_array"
+        in: "query"
+        description: "Query parameter enum test (string array)"
+        required: false
+        type: "array"
+        items:
+          type: "string"
+          enum:
+          - ">"
+          - "$"
+          default: "$"
+      - name: "enum_query_string"
+        in: "query"
+        description: "Query parameter enum test (string)"
+        required: false
+        type: "string"
+        default: "-efg"
+        enum:
+        - "_abc"
+        - "-efg"
+        - "(xyz)"
+      - name: "enum_query_integer"
+        in: "query"
+        description: "Query parameter enum test (double)"
+        required: false
+        type: "integer"
+        format: "int32"
+        enum:
+        - 1
+        - -2
+      - name: "enum_query_double"
+        in: "formData"
+        description: "Query parameter enum test (double)"
+        required: false
+        type: "number"
+        format: "double"
+        enum:
+        - 1.1
+        - -1.2
+      responses:
+        400:
+          description: "Invalid request"
+        404:
+          description: "Not found"
+    post:
+      tags:
+      - "fake"
+      summary: "Fake endpoint for testing various parameters\n假端點\n偽のエンドポイント\n가짜 엔\
+        드 포인트\n"
+      description: "Fake endpoint for testing various parameters\n假端點\n偽のエンドポイント\n\
+        가짜 엔드 포인트\n"
+      operationId: "testEndpointParameters"
+      consumes:
+      - "application/xml; charset=utf-8"
+      - "application/json; charset=utf-8"
+      produces:
+      - "application/xml; charset=utf-8"
+      - "application/json; charset=utf-8"
+      parameters:
+      - name: "integer"
+        in: "formData"
+        description: "None"
+        required: false
+        type: "integer"
+        maximum: 100
+        minimum: 10
+      - name: "int32"
+        in: "formData"
+        description: "None"
+        required: false
+        type: "integer"
+        maximum: 200
+        minimum: 20
+        format: "int32"
+      - name: "int64"
+        in: "formData"
+        description: "None"
+        required: false
+        type: "integer"
+        format: "int64"
+      - name: "number"
+        in: "formData"
+        description: "None"
+        required: true
+        type: "number"
+        maximum: 543.2
+        minimum: 32.1
+      - name: "float"
+        in: "formData"
+        description: "None"
+        required: false
+        type: "number"
+        maximum: 987.6
+        format: "float"
+      - name: "double"
+        in: "formData"
+        description: "None"
+        required: true
+        type: "number"
+        maximum: 123.4
+        minimum: 67.8
+        format: "double"
+      - name: "string"
+        in: "formData"
+        description: "None"
+        required: false
+        type: "string"
+        pattern: "/[a-z]/i"
+      - name: "pattern_without_delimiter"
+        in: "formData"
+        description: "None"
+        required: true
+        type: "string"
+        pattern: "^[A-Z].*"
+      - name: "byte"
+        in: "formData"
+        description: "None"
+        required: true
+        type: "string"
+        format: "byte"
+      - name: "binary"
+        in: "formData"
+        description: "None"
+        required: false
+        type: "string"
+        format: "binary"
+      - name: "date"
+        in: "formData"
+        description: "None"
+        required: false
+        type: "string"
+        format: "date"
+      - name: "dateTime"
+        in: "formData"
+        description: "None"
+        required: false
+        type: "string"
+        format: "date-time"
+      - name: "password"
+        in: "formData"
+        description: "None"
+        required: false
+        type: "string"
+        maxLength: 64
+        minLength: 10
+        format: "password"
+      - name: "callback"
+        in: "formData"
+        description: "None"
+        required: false
+        type: "string"
+      responses:
+        400:
+          description: "Invalid username supplied"
+        404:
+          description: "User not found"
+      security:
+      - http_basic_test: []
+    patch:
+      tags:
+      - "fake"
+      summary: "To test \"client\" model"
+      description: "To test \"client\" model"
+      operationId: "testClientModel"
+      consumes:
+      - "application/json"
+      produces:
+      - "application/json"
+      parameters:
+      - in: "body"
+        name: "body"
+        description: "client model"
+        required: true
+        schema:
+          $ref: "#/definitions/Client"
+      responses:
+        200:
+          description: "successful operation"
+          schema:
+            $ref: "#/definitions/Client"
+  /fake/outer/number:
+    post:
+      tags:
+      - "fake"
+      description: "Test serialization of outer number types"
+      operationId: "fakeOuterNumberSerialize"
+      parameters:
+      - in: "body"
+        name: "body"
+        description: "Input number as post body"
+        required: false
+        schema:
+          $ref: "#/definitions/OuterNumber"
+      responses:
+        200:
+          description: "Output number"
+          schema:
+            $ref: "#/definitions/OuterNumber"
+  /fake/outer/string:
+    post:
+      tags:
+      - "fake"
+      description: "Test serialization of outer string types"
+      operationId: "fakeOuterStringSerialize"
+      parameters:
+      - in: "body"
+        name: "body"
+        description: "Input string as post body"
+        required: false
+        schema:
+          $ref: "#/definitions/OuterString"
+      responses:
+        200:
+          description: "Output string"
+          schema:
+            $ref: "#/definitions/OuterString"
+  /fake/outer/boolean:
+    post:
+      tags:
+      - "fake"
+      description: "Test serialization of outer boolean types"
+      operationId: "fakeOuterBooleanSerialize"
+      parameters:
+      - in: "body"
+        name: "body"
+        description: "Input boolean as post body"
+        required: false
+        schema:
+          $ref: "#/definitions/OuterBoolean"
+      responses:
+        200:
+          description: "Output boolean"
+          schema:
+            $ref: "#/definitions/OuterBoolean"
+  /fake/outer/composite:
+    post:
+      tags:
+      - "fake"
+      description: "Test serialization of object with outer number type"
+      operationId: "fakeOuterCompositeSerialize"
+      parameters:
+      - in: "body"
+        name: "body"
+        description: "Input composite as post body"
+        required: false
+        schema:
+          $ref: "#/definitions/OuterComposite"
+      responses:
+        200:
+          description: "Output composite"
+          schema:
+            $ref: "#/definitions/OuterComposite"
+  /fake/jsonFormData:
+    get:
+      tags:
+      - "fake"
+      summary: "test json serialization of form data"
+      description: ""
+      operationId: "testJsonFormData"
+      consumes:
+      - "application/json"
+      parameters:
+      - name: "param"
+        in: "formData"
+        description: "field1"
+        required: true
+        type: "string"
+      - name: "param2"
+        in: "formData"
+        description: "field2"
+        required: true
+        type: "string"
+      responses:
+        200:
+          description: "successful operation"
+  /another-fake/dummy:
+    patch:
+      tags:
+      - "$another-fake?"
+      summary: "To test special tags"
+      description: "To test special tags"
+      operationId: "test_special_tags"
+      consumes:
+      - "application/json"
+      produces:
+      - "application/json"
+      parameters:
+      - in: "body"
+        name: "body"
+        description: "client model"
+        required: true
+        schema:
+          $ref: "#/definitions/Client"
+      responses:
+        200:
+          description: "successful operation"
+          schema:
+            $ref: "#/definitions/Client"
+securityDefinitions:
+  petstore_auth:
+    type: "oauth2"
+    authorizationUrl: "http://petstore.swagger.io/api/oauth/dialog"
+    flow: "implicit"
+    scopes:
+      write:pets: "modify pets in your account"
+      read:pets: "read your pets"
+  api_key:
+    type: "apiKey"
+    name: "api_key"
+    in: "header"
+  api_key_query:
+    type: "apiKey"
+    name: "api_key_query"
+    in: "query"
+  http_basic_test:
+    type: "basic"
+definitions:
+  Order:
+    type: "object"
+    properties:
+      id:
+        type: "integer"
+        format: "int64"
+      petId:
+        type: "integer"
+        format: "int64"
+      quantity:
+        type: "integer"
+        format: "int32"
+      shipDate:
+        type: "string"
+        format: "date-time"
+      status:
+        type: "string"
+        description: "Order Status"
+        enum:
+        - "placed"
+        - "approved"
+        - "delivered"
+      complete:
+        type: "boolean"
+        default: false
+    example:
+      petId: 6
+      quantity: 1
+      id: 0
+      shipDate: "2000-01-23T04:56:07.000+00:00"
+      complete: false
+      status: "placed"
+    xml:
+      name: "Order"
+    x-mimeTypes:
+    - "MimeJSON"
+    - "MimeXML"
+  Category:
+    type: "object"
+    properties:
+      id:
+        type: "integer"
+        format: "int64"
+      name:
+        type: "string"
+    example:
+      name: "name"
+      id: 6
+    xml:
+      name: "Category"
+  User:
+    type: "object"
+    properties:
+      id:
+        type: "integer"
+        format: "int64"
+        x-is-unique: true
+      username:
+        type: "string"
+      firstName:
+        type: "string"
+      lastName:
+        type: "string"
+      email:
+        type: "string"
+      password:
+        type: "string"
+      phone:
+        type: "string"
+      userStatus:
+        type: "integer"
+        format: "int32"
+        description: "User Status"
+    example:
+      firstName: "firstName"
+      lastName: "lastName"
+      password: "password"
+      userStatus: 6
+      phone: "phone"
+      id: 0
+      email: "email"
+      username: "username"
+    xml:
+      name: "User"
+    x-mimeTypes:
+    - "MimeJSON"
+    - "MimeXML"
+  Tag:
+    type: "object"
+    properties:
+      id:
+        type: "integer"
+        format: "int64"
+      name:
+        type: "string"
+    example:
+      name: "name"
+      id: 1
+    xml:
+      name: "Tag"
+  Pet:
+    type: "object"
+    required:
+    - "name"
+    - "photoUrls"
+    properties:
+      id:
+        type: "integer"
+        format: "int64"
+        x-is-unique: true
+      category:
+        $ref: "#/definitions/Category"
+      name:
+        type: "string"
+        example: "doggie"
+      photoUrls:
+        type: "array"
+        xml:
+          name: "photoUrl"
+          wrapped: true
+        items:
+          type: "string"
+      tags:
+        type: "array"
+        xml:
+          name: "tag"
+          wrapped: true
+        items:
+          $ref: "#/definitions/Tag"
+      status:
+        type: "string"
+        description: "pet status in the store"
+        enum:
+        - "available"
+        - "pending"
+        - "sold"
+    example:
+      photoUrls:
+      - "photoUrls"
+      - "photoUrls"
+      name: "doggie"
+      id: 0
+      category:
+        name: "name"
+        id: 6
+      tags:
+      - name: "name"
+        id: 1
+      - name: "name"
+        id: 1
+      status: "available"
+    xml:
+      name: "Pet"
+    x-mimeTypes:
+    - "MimeJSON"
+    - "MimeXML"
+  ApiResponse:
+    type: "object"
+    properties:
+      code:
+        type: "integer"
+        format: "int32"
+      type:
+        type: "string"
+      message:
+        type: "string"
+    example:
+      code: 0
+      type: "type"
+      message: "message"
+  $special[model.name]:
+    properties:
+      $special[property.name]:
+        type: "integer"
+        format: "int64"
+    xml:
+      name: "$special[model.name]"
+  Return:
+    properties:
+      return:
+        type: "integer"
+        format: "int32"
+    description: "Model for testing reserved words"
+    xml:
+      name: "Return"
+  Name:
+    required:
+    - "name"
+    properties:
+      name:
+        type: "integer"
+        format: "int32"
+      snake_case:
+        type: "integer"
+        format: "int32"
+        readOnly: true
+      property:
+        type: "string"
+      123Number:
+        type: "integer"
+        readOnly: true
+    description: "Model for testing model name same as property name"
+    xml:
+      name: "Name"
+  200_response:
+    properties:
+      name:
+        type: "integer"
+        format: "int32"
+      class:
+        type: "string"
+    description: "Model for testing model name starting with number"
+    xml:
+      name: "Name"
+  ClassModel:
+    properties:
+      _class:
+        type: "string"
+    description: "Model for testing model with \"_class\" property"
+  Dog:
+    allOf:
+    - $ref: "#/definitions/Animal"
+    - type: "object"
+      properties:
+        breed:
+          type: "string"
+  Cat:
+    allOf:
+    - $ref: "#/definitions/Animal"
+    - type: "object"
+      properties:
+        declawed:
+          type: "boolean"
+  Animal:
+    type: "object"
+    required:
+    - "className"
+    discriminator: "className"
+    properties:
+      className:
+        type: "string"
+      color:
+        type: "string"
+        default: "red"
+  AnimalFarm:
+    type: "array"
+    items:
+      $ref: "#/definitions/Animal"
+  format_test:
+    type: "object"
+    required:
+    - "byte"
+    - "date"
+    - "number"
+    - "password"
+    properties:
+      integer:
+        type: "integer"
+        minimum: 10
+        maximum: 100
+      int32:
+        type: "integer"
+        format: "int32"
+        minimum: 20
+        maximum: 200
+      int64:
+        type: "integer"
+        format: "int64"
+      number:
+        type: "number"
+        minimum: 32.1
+        maximum: 543.2
+      float:
+        type: "number"
+        format: "float"
+        minimum: 54.3
+        maximum: 987.6
+      double:
+        type: "number"
+        format: "double"
+        minimum: 67.8
+        maximum: 123.4
+      string:
+        type: "string"
+        pattern: "/[a-z]/i"
+      byte:
+        type: "string"
+        format: "byte"
+        pattern: "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$"
+      binary:
+        type: "string"
+        format: "binary"
+      date:
+        type: "string"
+        format: "date"
+      dateTime:
+        type: "string"
+        format: "date-time"
+      uuid:
+        type: "string"
+        format: "uuid"
+      password:
+        type: "string"
+        format: "password"
+        minLength: 10
+        maxLength: 64
+  EnumClass:
+    type: "string"
+    enum:
+    - "_abc"
+    - "-efg"
+    - "(xyz)"
+    default: "-efg"
+  Enum_Test:
+    type: "object"
+    properties:
+      enum_string:
+        type: "string"
+        enum:
+        - "UPPER"
+        - "lower"
+        - ""
+      enum_integer:
+        type: "integer"
+        format: "int32"
+        enum:
+        - 1
+        - -1
+      enum_number:
+        type: "number"
+        format: "double"
+        enum:
+        - 1.1
+        - -1.2
+      outerEnum:
+        $ref: "#/definitions/OuterEnum"
+  AdditionalPropertiesClass:
+    type: "object"
+    properties:
+      map_property:
+        type: "object"
+        additionalProperties:
+          type: "string"
+      map_of_map_property:
+        type: "object"
+        additionalProperties:
+          type: "object"
+          additionalProperties:
+            type: "string"
+  MixedPropertiesAndAdditionalPropertiesClass:
+    type: "object"
+    properties:
+      uuid:
+        type: "string"
+        format: "uuid"
+      dateTime:
+        type: "string"
+        format: "date-time"
+      map:
+        type: "object"
+        additionalProperties:
+          $ref: "#/definitions/Animal"
+  List:
+    type: "object"
+    properties:
+      123-list:
+        type: "string"
+  Client:
+    type: "object"
+    properties:
+      client:
+        type: "string"
+    example:
+      client: "client"
+    x-mimeTypes:
+    - "MimeJSON"
+  ReadOnlyFirst:
+    type: "object"
+    properties:
+      bar:
+        type: "string"
+        readOnly: true
+      baz:
+        type: "string"
+  hasOnlyReadOnly:
+    type: "object"
+    properties:
+      bar:
+        type: "string"
+        readOnly: true
+      foo:
+        type: "string"
+        readOnly: true
+  Capitalization:
+    type: "object"
+    properties:
+      smallCamel:
+        type: "string"
+      CapitalCamel:
+        type: "string"
+      small_Snake:
+        type: "string"
+      Capital_Snake:
+        type: "string"
+      SCA_ETH_Flow_Points:
+        type: "string"
+      ATT_NAME:
+        type: "string"
+        description: "Name of the pet\n"
+  MapTest:
+    type: "object"
+    properties:
+      map_map_of_string:
+        type: "object"
+        additionalProperties:
+          type: "object"
+          additionalProperties:
+            type: "string"
+      map_of_enum_string:
+        type: "object"
+        additionalProperties:
+          type: "string"
+          enum:
+          - "UPPER"
+          - "lower"
+  ArrayTest:
+    type: "object"
+    properties:
+      array_of_string:
+        type: "array"
+        items:
+          type: "string"
+      array_array_of_integer:
+        type: "array"
+        items:
+          type: "array"
+          items:
+            type: "integer"
+            format: "int64"
+      array_array_of_model:
+        type: "array"
+        items:
+          type: "array"
+          items:
+            $ref: "#/definitions/ReadOnlyFirst"
+  NumberOnly:
+    type: "object"
+    properties:
+      JustNumber:
+        type: "number"
+  ArrayOfNumberOnly:
+    type: "object"
+    properties:
+      ArrayNumber:
+        type: "array"
+        items:
+          type: "number"
+  ArrayOfArrayOfNumberOnly:
+    type: "object"
+    properties:
+      ArrayArrayNumber:
+        type: "array"
+        items:
+          type: "array"
+          items:
+            type: "number"
+  EnumArrays:
+    type: "object"
+    properties:
+      just_symbol:
+        type: "string"
+        enum:
+        - ">="
+        - "$"
+      array_enum:
+        type: "array"
+        items:
+          type: "string"
+          enum:
+          - "fish"
+          - "crab"
+  OuterEnum:
+    type: "string"
+    enum:
+    - "placed"
+    - "approved"
+    - "delivered"
+  OuterComposite:
+    type: "object"
+    properties:
+      my_number:
+        $ref: "#/definitions/OuterNumber"
+      my_string:
+        $ref: "#/definitions/OuterString"
+      my_boolean:
+        $ref: "#/definitions/OuterBoolean"
+    example:
+      my_string: {}
+      my_number: {}
+      my_boolean: {}
+  OuterNumber:
+    type: "number"
+  OuterString:
+    type: "string"
+  OuterBoolean:
+    type: "boolean"
+externalDocs:
+  description: "Find out more about Swagger"
+  url: "http://swagger.io"
diff --git a/tests/Instances.hs b/tests/Instances.hs
--- a/tests/Instances.hs
+++ b/tests/Instances.hs
@@ -2,10 +2,9 @@
 
 module Instances where
 
-import Control.Monad
-import Data.Char (isSpace)
-import Data.List (sort)
-import Test.QuickCheck
+import SwaggerPetstore.Model
+import SwaggerPetstore.Core
+
 import qualified Data.Aeson as A
 import qualified Data.ByteString.Lazy as BL
 import qualified Data.HashMap.Strict as HM
@@ -14,8 +13,12 @@
 import qualified Data.Time as TI
 import qualified Data.Vector as V
 
+import Control.Monad
+import Data.Char (isSpace)
+import Data.List (sort)
+import Test.QuickCheck
+
 import ApproxEq
-import SwaggerPetstore.Model
 
 instance Arbitrary T.Text where
   arbitrary = T.pack <$> arbitrary
@@ -102,6 +105,7 @@
 
 instance Arbitrary AnimalFarm where
   arbitrary =
+    
     pure AnimalFarm
      
 
@@ -172,6 +176,7 @@
 
 instance Arbitrary EnumClass where
   arbitrary =
+    
     pure EnumClass
      
 
@@ -271,8 +276,7 @@
 
 instance Arbitrary OuterBoolean where
   arbitrary =
-    pure OuterBoolean
-     
+    OuterBoolean <$> arbitrary
 
 instance Arbitrary OuterComposite where
   arbitrary =
@@ -284,18 +288,17 @@
 
 instance Arbitrary OuterEnum where
   arbitrary =
+    
     pure OuterEnum
      
 
 instance Arbitrary OuterNumber where
   arbitrary =
-    pure OuterNumber
-     
+    OuterNumber <$> arbitrary
 
 instance Arbitrary OuterString where
   arbitrary =
-    pure OuterString
-     
+    OuterString <$> arbitrary
 
 instance Arbitrary Pet where
   arbitrary =
