mirror of
https://github.com/LukeHagar/libopenapi.git
synced 2025-12-09 20:47:44 +00:00
More v2 high-level docs
started including content from the schema to make it easier to understand when using the code as a complete guide, without pivoting to the spec.
This commit is contained in:
@@ -8,6 +8,8 @@ import (
|
||||
low "github.com/pb33f/libopenapi/datamodel/low/v3"
|
||||
)
|
||||
|
||||
// OAuthFlow represents a high-level OpenAPI 3+ OAuthFlow object that is backed by a low-level one.
|
||||
// - https://spec.openapis.org/oas/v3.1.0#oauth-flow-object
|
||||
type OAuthFlow struct {
|
||||
AuthorizationUrl string
|
||||
TokenUrl string
|
||||
@@ -17,6 +19,7 @@ type OAuthFlow struct {
|
||||
low *low.OAuthFlow
|
||||
}
|
||||
|
||||
// NewOAuthFlow creates a new high-level OAuthFlow instance from a low-level one.
|
||||
func NewOAuthFlow(flow *low.OAuthFlow) *OAuthFlow {
|
||||
o := new(OAuthFlow)
|
||||
o.low = flow
|
||||
@@ -32,6 +35,7 @@ func NewOAuthFlow(flow *low.OAuthFlow) *OAuthFlow {
|
||||
return o
|
||||
}
|
||||
|
||||
// GoLow returns the low-level OAuthFlow instance used to create the high-level one.
|
||||
func (o *OAuthFlow) GoLow() *low.OAuthFlow {
|
||||
return o.low
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user