Documentation ¶
Overview ¶
Package loads provides document loading methods for swagger (OAI) specifications.
It is used by other go-openapi packages to load and run analysis on local or remote spec documents.
Index ¶
- func JSONDoc(path string) (json.RawMessage, error)
- type DocLoader
- type DocMatcher
- type Document
- func (d *Document) BasePath() string
- func (d *Document) Expanded(options ...*spec.ExpandOptions) (*Document, error)
- func (d *Document) Host() string
- func (d *Document) OrigSpec() *spec.Swagger
- func (d *Document) Pristine() *Document
- func (d *Document) Raw() json.RawMessage
- func (d *Document) ResetDefinitions() *Document
- func (d *Document) Schema() *spec.Schema
- func (d *Document) Spec() *spec.Swagger
- func (d *Document) SpecFilePath() string
- func (d *Document) Version() string
- type XX
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DocLoader ¶
type DocLoader func(string) (json.RawMessage, error)
DocLoader represents a doc loader type
type DocMatcher ¶
DocMatcher represents a predicate to check if a loader matches
type Document ¶
type Document struct { // specAnalyzer Analyzer *analysis.Spec // contains filtered or unexported fields }
Document represents a swagger spec document
func Analyzed ¶
func Analyzed(data json.RawMessage, version string) (*Document, error)
Analyzed creates a new analyzed spec document
func Embedded ¶
func Embedded(orig, flat json.RawMessage) (*Document, error)
Embedded returns a Document based on embedded specs. No analysis is required
func (*Document) Expanded ¶
func (d *Document) Expanded(options ...*spec.ExpandOptions) (*Document, error)
Expanded expands the ref fields in the spec document and returns a new spec document
func (*Document) Pristine ¶
Pristine creates a new pristine document instance based on the input data
func (*Document) Raw ¶
func (d *Document) Raw() json.RawMessage
Raw returns the raw swagger spec as json bytes
func (*Document) ResetDefinitions ¶
ResetDefinitions gives a shallow copy with the models reset
func (*Document) SpecFilePath ¶
SpecFilePath returns the file path of the spec if one is defined