Note: should we ditch vendoring? Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
28 lines
1.1 KiB
Markdown
28 lines
1.1 KiB
Markdown
# Loads OAI specs [](https://github.com/go-openapi/loads/actions?query=workflow%3A"go+test") [](https://codecov.io/gh/go-openapi/loads)
|
|
|
|
[](https://raw.githubusercontent.com/go-openapi/loads/master/LICENSE) [](http://godoc.org/github.com/go-openapi/loads)
|
|
[](https://goreportcard.com/report/github.com/go-openapi/loads)
|
|
|
|
Loading of OAI v2 API specification documents from local or remote locations. Supports JSON and YAML documents.
|
|
|
|
Primary usage:
|
|
|
|
```go
|
|
import (
|
|
"github.com/go-openapi/loads"
|
|
)
|
|
|
|
...
|
|
|
|
// loads a YAML spec from a http file
|
|
doc, err := loads.Spec(ts.URL)
|
|
|
|
...
|
|
|
|
// retrieves the object model for the API specification
|
|
spec := doc.Spec()
|
|
|
|
...
|
|
```
|
|
|
|
See also the provided [examples](https://pkg.go.dev/github.com/go-openapi/loads#pkg-examples).
|