@@ -5,6 +5,7 @@
55{-# LANGUAGE MultiParamTypeClasses #-}
66{-# LANGUAGE RankNTypes #-}
77{-# LANGUAGE TemplateHaskell #-}
8+{-# LANGUAGE TypeFamilies #-}
89{-# LANGUAGE UndecidableInstances #-}
910module Data.Swagger.Lens where
1011
@@ -88,6 +89,18 @@ makeFields ''ExternalDocs
8889-- =============================================================
8990-- More helpful instances for easier access to schema properties
9091
92+type instance Index Responses = HttpStatusCode
93+type instance Index Operation = HttpStatusCode
94+
95+type instance IxValue Responses = Referenced Response
96+type instance IxValue Operation = Referenced Response
97+
98+instance Ixed Responses where ix n = responses . ix n
99+instance At Responses where at n = responses . at n
100+
101+instance Ixed Operation where ix n = responses . ix n
102+instance At Operation where at n = responses . at n
103+
91104-- HasType instances
92105instance HasType Header (SwaggerType Header) where type_ = paramSchema.type_
93106instance HasType Schema (SwaggerType Schema) where type_ = paramSchema.type_