We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Generic mechanism sometimes declares unused definitions. Below is an example of when this happens.
Declare a common type with a named schema:
>>> newtype Id = Id String deriving Generic >>> instance ToParamSchema Id where toParamSchema _ = toParamSchema (Proxy :: Proxy String) & schemaFormat ?~ "uuid" >>> instance ToSchema Id where declareNamedSchema = return . paramSchemaToNamedSchema defaultSchemaOptions
Wrap that named typed in a simple newtype:
newtype
>>> newtype UserId = UserId Id deriving Generic >>> instance ToSchema UserId
Generic mechanism does not need to produce definition for Id, but it does so nonetheless.
Id
>>> encode $ runDeclare (declareNamedSchema (Proxy :: Proxy UserId)) mempty "[{\"Id\":{\"format\":\"uuid\",\"type\":\"string\"}},[\"UserId\",{\"format\":\"uuid\",\"type\":\"string\"}]]"
Fix should be simple enough.
The text was updated successfully, but these errors were encountered:
Stop producing unused definitions for generic schemas (#37)
2fbf2ea
37525ce
Merge pull request #38 from GetShopTV/fix-unused-#37
e0437b4
Stop producing unused definitions
No branches or pull requests
Generic mechanism sometimes declares unused definitions.
Below is an example of when this happens.
Declare a common type with a named schema:
Wrap that named typed in a simple
newtype
:Generic mechanism does not need to produce definition for
Id
, but it does so nonetheless.Fix should be simple enough.
The text was updated successfully, but these errors were encountered: