-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes introduced by aeson-1 #69
Comments
We should change these instance ToSchema a => ToSchema (Map T.Text a)
instance ToSchema a => ToSchema (Map TL.Text a)
instance ToSchema a => ToSchema (HashMap String a)
instance ToSchema a => ToSchema (HashMap T.Text a)
instance ToSchema a => ToSchema (HashMap TL.Text a) To do that we have to either introduce a new The rest of the changes we can probably safely ignore. |
From instance (ToJSONKey k, ToSchema a) => ToSchema (Map k a) where
declareNamedSchema _ | isObjectEncoding (Proxy :: Proxy k) = do
schema <- declareSchemaRef (Proxy :: Proxy a)
return $ unnamed $ mempty
& type_ .~ SwaggerObject
& additionalProperties ?~ schema
where
isObjectEncoding p = ... |
Hmm, you're right, instance (ToJSONKey k, ToSchema a) => ToSchema (Map k a) where
declareNamedSchema _ = case toJSONKey :: ToJSONKeyFunction a of
ToJSONKeyText _ _ -> declareObjectMapSchema
ToJSONKeyValue _ _ -> declareNamedSchema (Proxy :: Proxy [(k, a)])
where
declareObjectMapSchema = do
schema <- declareSchemaRef (Proxy :: Proxy a)
return $ unnamed $ mempty
& type_ .~ SwaggerObject
& additionalProperties ?~ schema |
@phadej do we need to address any of the other changes |
Hmm, that instance above requires also |
I'm not sure if we should take them into account. At least how
Map
andHashMap
can be serialised inaeson-1
.Please discuss.
The text was updated successfully, but these errors were encountered: