Wireform.Core.Schema
Cross-format schema representation. The Schema tree is the
common ground every IDL parser produces (.proto,
.avsc, .thrift, .fbs, etc.) and
every codegen consumes.
Synopsis
data Schemadata FieldlookupField :: Text -> Schema -> Maybe Field
Top-level types
Section titled “Top-level types”data SchemaSource
A schema is a name plus a list of fields, each field having a wire
tag, a type, and optional metadata. This is intentionally a small
lowest-common-denominator: format-specific extensions are carried in
annotations.
Constructors
Schema { name :: !Text, fields :: !(Vector Field), annotations :: !(Map Text Text) }data FieldSource
A single field in a schema.
Fields
fieldName :: !TextIdentifier as it appears in the IDL.
fieldTag :: !Word32Wire tag (where applicable).
fieldType :: !PrimTypeResolved primitive type.
fieldOptional :: !BoolLookup helpers
Section titled “Lookup helpers”lookupField :: Text -> Schema -> Maybe FieldSource
O(log n) field lookup by name.