-
Notifications
You must be signed in to change notification settings - Fork 59
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
ToParamSchema class #17
Conversation
So here's some design problem: We have
So we can probably factor out the common part ( |
Okay, so I've moved At this moment I realize that class ToSchemaCommon a t i where
toSchemaCommon :: proxy a -> SchemaCommon t i
-- | Generate a 'NamedSchema' for a type with 'ToSchemaCommon' instance.
-- This can be used as an implementation of `toNamedSchema` for plain types.
toNamedSchemaCommon ::
(..., ToSchemaCommon a (SwaggerType Schema) SchemaItems)
=> proxy a -> NamedSchema
toNamedSchemaCommon _ =
( genericToName (Proxy :: Proxy a)
, mempty & schemaSchemaCommon .~ toSchemaCommon (Proxy :: Proxy a) ) With instance ToSchemaCommon Bool t i where ...
instance ToSchema Bool where toNamedSchema = toNamedSchemaCommon |
That's fine with me. |
schemaCommonType now is of type (SwaggerType t)
👍 |
Closes #16.
This PR is incomplete.