Documentation
¶
Overview ¶
Package importer turns a vendored OpenAPI document into definitions, the way Pandora's importer-rest-api-specs does for Azure: load the document, apply the named workarounds for its known bugs, then normalise it into the definitions model (Go names, types, status codes, paging, and which tag owns each model).
The importer is strict. Anything it cannot normalise faithfully (an undeclared path parameter, a GET that does not say what it answers, a duplicate operationId) fails the import with every problem listed, and the fix is a workaround that documents the bug (see the workarounds package).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FromSpec ¶
func FromSpec(cfg config.Service, spec *openapi.Spec, applied []string, log func(string)) (*definitions.Service, error)
FromSpec normalises an already patched document.
func Import ¶
func Import(cfg config.Service, all []workarounds.Workaround, log func(string)) (*definitions.Service, error)
Import loads a service's document, applies the workarounds among all that are for it and returns the definitions. log receives one line per workaround applied and per warning.
func VerifyIDs ¶ added in v0.7.0
VerifyIDs is the test a service's IDs and Plain must pass against its document, with its workarounds already applied: every kind reaches a place, no two kinds claim one, every In and Except matches, and no name is both in a kind and in Plain. It is what the import refuses, as an error a test can read; a repository calls it from the test it already has.
Types ¶
This section is empty.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package workarounds is how a repository fixes the bugs in the OpenAPI documents it vendors, one named workaround per bug, after Pandora's dataworkarounds.
|
Package workarounds is how a repository fixes the bugs in the OpenAPI documents it vendors, one named workaround per bug, after Pandora's dataworkarounds. |