@@ -5,6 +5,7 @@
5{-# LANGUAGE MultiParamTypeClasses #-}
5{-# LANGUAGE MultiParamTypeClasses #-}
6{-# LANGUAGE RankNTypes #-}
6{-# LANGUAGE RankNTypes #-}
7{-# LANGUAGE TemplateHaskell #-}
7{-# LANGUAGE TemplateHaskell #-}
8+{-# LANGUAGE TypeFamilies #-}
8{-# LANGUAGE UndecidableInstances #-}
9{-# LANGUAGE UndecidableInstances #-}
9module Data.Swagger.Lens where
10module Data.Swagger.Lens where
@@ -88,6 +89,18 @@ makeFields ''ExternalDocs
88-- =============================================================
89-- =============================================================
89-- More helpful instances for easier access to schema properties
90-- More helpful instances for easier access to schema properties
92+type instance Index Responses = HttpStatusCode
93+type instance Index Operation = HttpStatusCode
95+type instance IxValue Responses = Referenced Response
96+type instance IxValue Operation = Referenced Response
98+instance Ixed Responses where ix n = responses . ix n
99+instance At Responses where at n = responses . at n
101+instance Ixed Operation where ix n = responses . ix n
102+instance At Operation where at n = responses . at n
91-- HasType instances
104-- HasType instances
92instance HasType Header (SwaggerType Header) where type_ = paramSchema.type_
105instance HasType Header (SwaggerType Header) where type_ = paramSchema.type_
93instance HasType Schema (SwaggerType Schema) where type_ = paramSchema.type_
106instance HasType Schema (SwaggerType Schema) where type_ = paramSchema.type_