1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
|
# 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).
|