Adding more docs to v2 swagger model.

once and done job, not much fun to be honest ;)
This commit is contained in:
Dave Shanley
2022-09-18 13:07:07 -04:00
parent 649a93b008
commit e52cc69bab
17 changed files with 219 additions and 25 deletions

View File

@@ -5,6 +5,10 @@ package v3
import low "github.com/pb33f/libopenapi/datamodel/low/v3"
// ServerVariable represents a high-level OpenAPI 3+ ServerVariable object, that is backed by a low-level one.
//
// ServerVariable is an object representing a Server Variable for server URL template substitution.
// - https://spec.openapis.org/oas/v3.1.0#server-variable-object
type ServerVariable struct {
Enum []string
Default string
@@ -12,6 +16,7 @@ type ServerVariable struct {
low *low.ServerVariable
}
// NewServerVariable will return a new high-level instance of a ServerVariable from a low-level one.
func NewServerVariable(variable *low.ServerVariable) *ServerVariable {
v := new(ServerVariable)
v.low = variable
@@ -27,6 +32,7 @@ func NewServerVariable(variable *low.ServerVariable) *ServerVariable {
return v
}
// GoLow returns the low-level ServerVariable used to to create the high\-level one.
func (s *ServerVariable) GoLow() *low.ServerVariable {
return s.low
}