Documentation
¶
Overview ¶
Package openapi translates OpenAPI 3.x and Swagger 2.0 into callable operations.
The translator does not write a parser: `kin-openapi` already resolves `$ref` (nested and external included), reads JSON and YAML, and understands 3.0 and 3.1; Swagger 2.0 comes in converted to 3. Writing that by hand costs a partial model — and whatever the model does not cover arrives impoverished at the other end.
Here each parameter's schema is handed over AS IT IS in the spec (enum, format, array items, nested objects): the reader is an LLM, and every field lost along the way is a call it has to guess at.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Options ¶
type Options struct {
BaseURL string // beats the spec's `servers`
Auth auth.Applier
Client *http.Client
IncludePaths []*regexp.Regexp
ExcludePaths []*regexp.Regexp
// ExcludeOps casa contra `MÉTODO /caminho` — é o filtro que os outros quatro não conseguem
// expressar, porque eles decidem por caminho OU por método, nunca pelos dois juntos.
//
// O caso que o pediu: um conector de leitura que precisa alcançar as escritas de UMA área.
// A eToro tem 87 leituras espalhadas por toda a API e 85 escritas; deixar passar as de
// `watchlists` e `price-alerts` sem deixar passar as de `trading` e `posts` exige olhar o par.
// Por caminho perderia os GETs de trading, que são metade do valor do conector.
ExcludeOps []*regexp.Regexp
// ServerFills are parameter names this server supplies itself (signature fields, mostly),
// lowercased. They disappear from the schema the model sees.
ServerFills map[string]bool
IncludeMethods []string
ExcludeMethods []string
Headers map[string]string // fixed headers on every call
}
Options are decisions made by whoever starts the server, not by the spec.