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:
Dave Shanley
2022-09-17 09:57:29 -04:00
parent c17cc4a7e6
commit 649a93b008
17 changed files with 123 additions and 7 deletions

View File

@@ -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
}