This package is still under development, so the API will be changed without any notification
This is an implementation of OpenAPI Specification 3.0 object model with some usable functions.
package main
import (
"fmt"
"github.com/nasa9084/go-openapi"
)
func main() {
doc, _ := openapi.LoadFile("path/to/spec")
fmt.Print(doc.Version)
}
- Model definition
- Load OpenAPI 3.0 spec file
- Resolve Reference object
- Resolve #/component reference
- Resolve other file reference
- Validation
- Validate spec values
- test for validation
- Document
- Info
- Contact
- License
- Server
- ServerVariable
- Paths
- PathItem
- Operation
- Parameter
- RequestBody
- Responses
- Response
- Callbacks
- Callback
- Schema
- Example
- MediaType
- Header
- Link
- Encoding
- Discriminator
- XML
- Components
- SecurityScheme
- OAuthFlows
- OAuthFlow
- SecurityRequirement
- Tag
- ExternalDocumentation
- test for validation
- Validate HTTP Request
- Validate HTTP Response
- Validate spec values