mirror of
https://github.com/ilyakooo0/deriving-openapi3.git
synced 2024-09-11 10:25:55 +03:00
Let's add toParamSchema also?
This commit is contained in:
parent
ca2f807868
commit
4d656fdcb7
@ -40,6 +40,7 @@ import Control.Lens
|
||||
import qualified Data.Aeson.Types as A
|
||||
import Data.OpenApi
|
||||
import Data.OpenApi.Internal.Schema
|
||||
import Data.OpenApi.Internal.ParamSchema
|
||||
import Data.Proxy
|
||||
import Data.Typeable
|
||||
import Deriving.Aeson
|
||||
@ -77,6 +78,13 @@ instance
|
||||
openApiSchemaModifier @xs
|
||||
<$> genericDeclareNamedSchema (openApiOptionsModifier @xs defaultSchemaOptions) (Proxy @x)
|
||||
|
||||
instance
|
||||
(OpenApiOptionModifier xs, GToParamSchema (Rep x), Generic x) =>
|
||||
ToParamSchema (CustomJSON (xs :: k) x)
|
||||
where
|
||||
toParamSchema Proxy =
|
||||
genericToParamSchema (openApiOptionsModifier @xs defaultSchemaOptions) (Proxy @x)
|
||||
|
||||
class OpenApiOptionModifier x where
|
||||
openApiOptionsModifier :: SchemaOptions -> SchemaOptions
|
||||
openApiOptionsModifier = id
|
||||
|
Loading…
Reference in New Issue
Block a user