Safe Haskell | None |
---|---|
Language | Haskell2010 |
Proto3.Suite.DotProto.Generate.Swagger
Contents
Description
This module provides helper functions to generate Swagger schemas that describe JSONPB encodings for protobuf types.
Synopsis
- ppSchema :: ToSchema a => Proxy a -> IO ()
- newtype OverrideToSchema a = OverrideToSchema {
- unOverride :: a
- asProxy :: (Proxy (OverrideToSchema a) -> b) -> Proxy a
- insOrdFromList :: (Eq k, Hashable k) => [(k, v)] -> InsOrdHashMap k v
Documentation
ppSchema :: ToSchema a => Proxy a -> IO () Source #
Pretty-prints a schema. Useful when playing around with schemas in the REPL.
newtype OverrideToSchema a Source #
This is a hack to work around the swagger2
library forbidding ToSchema
instances for ByteString
s
Constructors
OverrideToSchema | |
Fields
|
Instances
asProxy :: (Proxy (OverrideToSchema a) -> b) -> Proxy a Source #
This is a convenience function that uses type inference to select the
correct instance of ToSchema
to use for fields of a message
insOrdFromList :: (Eq k, Hashable k) => [(k, v)] -> InsOrdHashMap k v Source #
Convenience re-export so that users of generated code don't have to add
an explicit dependency on insert-ordered-containers
Orphan instances
(Finite e, Named e) => ToSchema (Enumerated e) Source # | JSONPB schemas for protobuf enumerations |
Methods declareNamedSchema :: Proxy (Enumerated e) -> Declare (Definitions Schema) NamedSchema # | |
ToSchema (Fixed Int32) Source # | |
Methods declareNamedSchema :: Proxy (Fixed Int32) -> Declare (Definitions Schema) NamedSchema # | |
ToSchema (Fixed Int64) Source # | |
Methods declareNamedSchema :: Proxy (Fixed Int64) -> Declare (Definitions Schema) NamedSchema # | |
ToSchema (Fixed Word32) Source # | |
Methods declareNamedSchema :: Proxy (Fixed Word32) -> Declare (Definitions Schema) NamedSchema # | |
ToSchema (Fixed Word64) Source # | |
Methods declareNamedSchema :: Proxy (Fixed Word64) -> Declare (Definitions Schema) NamedSchema # |