git.iko.soy/typeable/openapi3
on master help sign in
Fix ref paths for components
commit6dc3170150a3c9311fa0387b1212d7f412712226 authorMaxim Koltsov <kolmax94@gmail.com> dateTue 23 Jun 2020, 22:50 (6 years ago) parentc253c9f
1 file changed+8−10
src/Data/Swagger/Internal.hs+8−10
src/Data/Swagger/Internal.hs+8−10
@@ -1257,11 +1257,10 @@ referencedToJSON :: ToJSON a => Text -> Referenced a -> Value
12571257referencedToJSON prefix (Ref (Reference ref)) = object [ "$ref" .= (prefix <> ref) ]
12581258referencedToJSON _ (Inline x) = toJSON x
12591259
1260−-- FIXME this stuff
1261−instance ToJSON (Referenced Schema) where toJSON = referencedToJSON "#/definitions/"
1262−instance ToJSON (Referenced Param) where toJSON = referencedToJSON "#/parameters/"
1263−instance ToJSON (Referenced Response) where toJSON = referencedToJSON "#/responses/"
1264−instance ToJSON (Referenced RequestBody) where toJSON = referencedToJSON "#/!!!!/"
1260+instance ToJSON (Referenced Schema) where toJSON = referencedToJSON "#/components/schemas/"
1261+instance ToJSON (Referenced Param) where toJSON = referencedToJSON "#/components/parameters/"
1262+instance ToJSON (Referenced Response) where toJSON = referencedToJSON "#/components/responses/"
1263+instance ToJSON (Referenced RequestBody) where toJSON = referencedToJSON "#/components/requestBodies/"
12651264
12661265instance ToJSON (SwaggerType t) where
12671266 toJSON SwaggerArray = "array"
@@ -1442,11 +1441,10 @@ referencedParseJSON prefix js@(Object o) = do
14421441 Just suffix -> pure (Reference suffix)
14431442referencedParseJSON _ _ = fail "referenceParseJSON: not an object"
14441443
1445−-- FIXME this stuff
1446−instance FromJSON (Referenced Schema) where parseJSON = referencedParseJSON "#/definitions/"
1447−instance FromJSON (Referenced Param) where parseJSON = referencedParseJSON "#/parameters/"
1448−instance FromJSON (Referenced Response) where parseJSON = referencedParseJSON "#/responses/"
1449−instance FromJSON (Referenced RequestBody) where parseJSON = referencedParseJSON "#/!!!!/"
1444+instance FromJSON (Referenced Schema) where parseJSON = referencedParseJSON "#/components/schemas/"
1445+instance FromJSON (Referenced Param) where parseJSON = referencedParseJSON "#/components/parameters/"
1446+instance FromJSON (Referenced Response) where parseJSON = referencedParseJSON "#/components/responses/"
1447+instance FromJSON (Referenced RequestBody) where parseJSON = referencedParseJSON "#/components/requestBodies"
14501448
14511449instance FromJSON Xml where
14521450 parseJSON = genericParseJSON (jsonPrefix "xml")