Documentation
¶
Overview ¶
Package document lowers what a document says about itself rather than its types or operations: its info, root externalDocs and servers, and, kept verbatim, what the objects around them write that lowers to no node (docs/compilers/openapi.md#document-metadata, docs/compilers/openapi.md#unreferenced-components).
It runs after every other lowering, which alone know the components they reached, and returns a Meta for the compiler to assign.
Servers are lowered here while the IR holds only the document's. A field for a path item's or an operation's (GitHub #285) may move their lowering to a package both walks reach, or have the operation walk reach this one.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Meta ¶
type Meta struct {
Name string
Version string
TermsOfService string
Docs ir.Docs
Contact *ir.Contact
License *ir.License
Servers []ir.Server
Unmodeled ir.Unmodeled
}
Meta is the document-level metadata: what ir.Document carries that belongs to neither the type graph nor the service graph.
It exists so the lowering can return what it read instead of writing into the document as it goes. The caller owns the document and does the assigning, which is what lets every lowering in this package be checked against a literal context and nothing else.
func Lower ¶
func Lower(c lowering.Ctx) (Meta, []ir.Diagnostic)
Lower lowers the document-level metadata that is not part of the type or service graph: info, servers, and what the document writes that lowers to no node of its own, kept verbatim (ir-design §10, §12).
It must run after every other lowering: which components it keeps depends on what they reached (lowering.Ctx.Reached).