mirror of
https://github.com/LukeHagar/libopenapi.git
synced 2025-12-07 04:20:14 +00:00
Add dummy parameter to conform to Buildable
This commit is contained in:
@@ -23,7 +23,7 @@ type Contact struct {
|
||||
}
|
||||
|
||||
// Build is not implemented for Contact (there is nothing to build).
|
||||
func (c *Contact) Build(_ *yaml.Node, _ *index.SpecIndex) error {
|
||||
func (c *Contact) Build(_, _ *yaml.Node, _ *index.SpecIndex) error {
|
||||
c.Reference = new(low.Reference)
|
||||
// not implemented.
|
||||
return nil
|
||||
|
||||
@@ -60,7 +60,7 @@ func (ex *Example) Hash() [32]byte {
|
||||
}
|
||||
|
||||
// Build extracts extensions and example value
|
||||
func (ex *Example) Build(root *yaml.Node, idx *index.SpecIndex) error {
|
||||
func (ex *Example) Build(_, root *yaml.Node, idx *index.SpecIndex) error {
|
||||
root = utils.NodeAlias(root)
|
||||
utils.CheckForMergeNodes(root)
|
||||
ex.Reference = new(low.Reference)
|
||||
|
||||
@@ -33,7 +33,7 @@ func (ex *ExternalDoc) FindExtension(ext string) *low.ValueReference[any] {
|
||||
}
|
||||
|
||||
// Build will extract extensions from the ExternalDoc instance.
|
||||
func (ex *ExternalDoc) Build(root *yaml.Node, idx *index.SpecIndex) error {
|
||||
func (ex *ExternalDoc) Build(_, root *yaml.Node, idx *index.SpecIndex) error {
|
||||
root = utils.NodeAlias(root)
|
||||
utils.CheckForMergeNodes(root)
|
||||
ex.Reference = new(low.Reference)
|
||||
|
||||
@@ -45,7 +45,7 @@ func (i *Info) GetExtensions() map[low.KeyReference[string]]low.ValueReference[a
|
||||
}
|
||||
|
||||
// Build will extract out the Contact and Info objects from the supplied root node.
|
||||
func (i *Info) Build(root *yaml.Node, idx *index.SpecIndex) error {
|
||||
func (i *Info) Build(_, root *yaml.Node, idx *index.SpecIndex) error {
|
||||
root = utils.NodeAlias(root)
|
||||
utils.CheckForMergeNodes(root)
|
||||
i.Reference = new(low.Reference)
|
||||
|
||||
@@ -25,7 +25,7 @@ type License struct {
|
||||
}
|
||||
|
||||
// Build out a license, complain if both a URL and identifier are present as they are mutually exclusive
|
||||
func (l *License) Build(root *yaml.Node, idx *index.SpecIndex) error {
|
||||
func (l *License) Build(_, root *yaml.Node, idx *index.SpecIndex) error {
|
||||
root = utils.NodeAlias(root)
|
||||
utils.CheckForMergeNodes(root)
|
||||
l.Reference = new(low.Reference)
|
||||
|
||||
@@ -752,7 +752,7 @@ func (s *Schema) Build(root *yaml.Node, idx *index.SpecIndex) error {
|
||||
if extDocNode != nil {
|
||||
var exDoc ExternalDoc
|
||||
_ = low.BuildModel(extDocNode, &exDoc)
|
||||
_ = exDoc.Build(extDocNode, idx) // throws no errors, can't check for one.
|
||||
_ = exDoc.Build(extDocLabel, extDocNode, idx) // throws no errors, can't check for one.
|
||||
s.ExternalDocs = low.NodeReference[*ExternalDoc]{Value: &exDoc, KeyNode: extDocLabel, ValueNode: extDocNode}
|
||||
}
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ type SecurityRequirement struct {
|
||||
}
|
||||
|
||||
// Build will extract security requirements from the node (the structure is odd, to be honest)
|
||||
func (s *SecurityRequirement) Build(root *yaml.Node, _ *index.SpecIndex) error {
|
||||
func (s *SecurityRequirement) Build(_, root *yaml.Node, _ *index.SpecIndex) error {
|
||||
root = utils.NodeAlias(root)
|
||||
utils.CheckForMergeNodes(root)
|
||||
s.Reference = new(low.Reference)
|
||||
|
||||
@@ -34,7 +34,7 @@ func (t *Tag) FindExtension(ext string) *low.ValueReference[any] {
|
||||
}
|
||||
|
||||
// Build will extract extensions and external docs for the Tag.
|
||||
func (t *Tag) Build(root *yaml.Node, idx *index.SpecIndex) error {
|
||||
func (t *Tag) Build(_, root *yaml.Node, idx *index.SpecIndex) error {
|
||||
root = utils.NodeAlias(root)
|
||||
utils.CheckForMergeNodes(root)
|
||||
t.Reference = new(low.Reference)
|
||||
|
||||
@@ -71,7 +71,7 @@ func (s *SecurityDefinitions) FindSecurityDefinition(securityDef string) *low.Va
|
||||
}
|
||||
|
||||
// Build will extract all definitions into SchemaProxy instances.
|
||||
func (d *Definitions) Build(root *yaml.Node, idx *index.SpecIndex) error {
|
||||
func (d *Definitions) Build(_, root *yaml.Node, idx *index.SpecIndex) error {
|
||||
root = utils.NodeAlias(root)
|
||||
utils.CheckForMergeNodes(root)
|
||||
errorChan := make(chan error)
|
||||
@@ -87,7 +87,7 @@ func (d *Definitions) Build(root *yaml.Node, idx *index.SpecIndex) error {
|
||||
var buildFunc = func(label *yaml.Node, value *yaml.Node, idx *index.SpecIndex,
|
||||
r chan definitionResult[*base.SchemaProxy], e chan error) {
|
||||
|
||||
obj, err, _, rv := low.ExtractObjectRaw[*base.SchemaProxy](value, idx)
|
||||
obj, err, _, rv := low.ExtractObjectRaw[*base.SchemaProxy](defLabel, value, idx)
|
||||
if err != nil {
|
||||
e <- err
|
||||
}
|
||||
@@ -133,7 +133,7 @@ func (d *Definitions) Hash() [32]byte {
|
||||
}
|
||||
|
||||
// Build will extract all ParameterDefinitions into Parameter instances.
|
||||
func (pd *ParameterDefinitions) Build(root *yaml.Node, idx *index.SpecIndex) error {
|
||||
func (pd *ParameterDefinitions) Build(_, root *yaml.Node, idx *index.SpecIndex) error {
|
||||
errorChan := make(chan error)
|
||||
resultChan := make(chan definitionResult[*Parameter])
|
||||
var defLabel *yaml.Node
|
||||
@@ -147,7 +147,7 @@ func (pd *ParameterDefinitions) Build(root *yaml.Node, idx *index.SpecIndex) err
|
||||
var buildFunc = func(label *yaml.Node, value *yaml.Node, idx *index.SpecIndex,
|
||||
r chan definitionResult[*Parameter], e chan error) {
|
||||
|
||||
obj, err, _, rv := low.ExtractObjectRaw[*Parameter](value, idx)
|
||||
obj, err, _, rv := low.ExtractObjectRaw[*Parameter](defLabel, value, idx)
|
||||
if err != nil {
|
||||
e <- err
|
||||
}
|
||||
@@ -182,7 +182,7 @@ type definitionResult[T any] struct {
|
||||
}
|
||||
|
||||
// Build will extract all ResponsesDefinitions into Response instances.
|
||||
func (r *ResponsesDefinitions) Build(root *yaml.Node, idx *index.SpecIndex) error {
|
||||
func (r *ResponsesDefinitions) Build(_, root *yaml.Node, idx *index.SpecIndex) error {
|
||||
errorChan := make(chan error)
|
||||
resultChan := make(chan definitionResult[*Response])
|
||||
var defLabel *yaml.Node
|
||||
@@ -196,7 +196,7 @@ func (r *ResponsesDefinitions) Build(root *yaml.Node, idx *index.SpecIndex) erro
|
||||
var buildFunc = func(label *yaml.Node, value *yaml.Node, idx *index.SpecIndex,
|
||||
r chan definitionResult[*Response], e chan error) {
|
||||
|
||||
obj, err, _, rv := low.ExtractObjectRaw[*Response](value, idx)
|
||||
obj, err, _, rv := low.ExtractObjectRaw[*Response](defLabel, value, idx)
|
||||
if err != nil {
|
||||
e <- err
|
||||
}
|
||||
@@ -225,7 +225,7 @@ func (r *ResponsesDefinitions) Build(root *yaml.Node, idx *index.SpecIndex) erro
|
||||
}
|
||||
|
||||
// Build will extract all SecurityDefinitions into SecurityScheme instances.
|
||||
func (s *SecurityDefinitions) Build(root *yaml.Node, idx *index.SpecIndex) error {
|
||||
func (s *SecurityDefinitions) Build(_, root *yaml.Node, idx *index.SpecIndex) error {
|
||||
errorChan := make(chan error)
|
||||
resultChan := make(chan definitionResult[*SecurityScheme])
|
||||
var defLabel *yaml.Node
|
||||
@@ -239,7 +239,7 @@ func (s *SecurityDefinitions) Build(root *yaml.Node, idx *index.SpecIndex) error
|
||||
var buildFunc = func(label *yaml.Node, value *yaml.Node, idx *index.SpecIndex,
|
||||
r chan definitionResult[*SecurityScheme], e chan error) {
|
||||
|
||||
obj, err, _, rv := low.ExtractObjectRaw[*SecurityScheme](value, idx)
|
||||
obj, err, _, rv := low.ExtractObjectRaw[*SecurityScheme](defLabel, value, idx)
|
||||
if err != nil {
|
||||
e <- err
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ func (e *Examples) FindExample(name string) *low.ValueReference[any] {
|
||||
}
|
||||
|
||||
// Build will extract all examples and will attempt to unmarshal content into a map or slice based on type.
|
||||
func (e *Examples) Build(root *yaml.Node, _ *index.SpecIndex) error {
|
||||
func (e *Examples) Build(_, root *yaml.Node, _ *index.SpecIndex) error {
|
||||
root = utils.NodeAlias(root)
|
||||
utils.CheckForMergeNodes(root)
|
||||
var keyNode, currNode *yaml.Node
|
||||
|
||||
@@ -51,7 +51,7 @@ func (h *Header) GetExtensions() map[low.KeyReference[string]]low.ValueReference
|
||||
}
|
||||
|
||||
// Build will build out items, extensions and default value from the supplied node.
|
||||
func (h *Header) Build(root *yaml.Node, idx *index.SpecIndex) error {
|
||||
func (h *Header) Build(_, root *yaml.Node, idx *index.SpecIndex) error {
|
||||
root = utils.NodeAlias(root)
|
||||
utils.CheckForMergeNodes(root)
|
||||
h.Extensions = low.ExtractExtensions(root)
|
||||
|
||||
@@ -102,7 +102,7 @@ func (i *Items) Hash() [32]byte {
|
||||
}
|
||||
|
||||
// Build will build out items and default value.
|
||||
func (i *Items) Build(root *yaml.Node, idx *index.SpecIndex) error {
|
||||
func (i *Items) Build(_, root *yaml.Node, idx *index.SpecIndex) error {
|
||||
root = utils.NodeAlias(root)
|
||||
utils.CheckForMergeNodes(root)
|
||||
i.Extensions = low.ExtractExtensions(root)
|
||||
|
||||
@@ -36,7 +36,7 @@ type Operation struct {
|
||||
}
|
||||
|
||||
// Build will extract external docs, extensions, parameters, responses and security requirements.
|
||||
func (o *Operation) Build(root *yaml.Node, idx *index.SpecIndex) error {
|
||||
func (o *Operation) Build(_, root *yaml.Node, idx *index.SpecIndex) error {
|
||||
root = utils.NodeAlias(root)
|
||||
utils.CheckForMergeNodes(root)
|
||||
o.Extensions = low.ExtractExtensions(root)
|
||||
|
||||
@@ -94,7 +94,7 @@ func (p *Parameter) GetExtensions() map[low.KeyReference[string]]low.ValueRefere
|
||||
}
|
||||
|
||||
// Build will extract out extensions, schema, items and default value
|
||||
func (p *Parameter) Build(root *yaml.Node, idx *index.SpecIndex) error {
|
||||
func (p *Parameter) Build(_, root *yaml.Node, idx *index.SpecIndex) error {
|
||||
root = utils.NodeAlias(root)
|
||||
utils.CheckForMergeNodes(root)
|
||||
p.Extensions = low.ExtractExtensions(root)
|
||||
|
||||
@@ -47,7 +47,7 @@ func (p *PathItem) GetExtensions() map[low.KeyReference[string]]low.ValueReferen
|
||||
|
||||
// Build will extract extensions, parameters and operations for all methods. Every method is handled
|
||||
// asynchronously, in order to keep things moving quickly for complex operations.
|
||||
func (p *PathItem) Build(root *yaml.Node, idx *index.SpecIndex) error {
|
||||
func (p *PathItem) Build(_, root *yaml.Node, idx *index.SpecIndex) error {
|
||||
root = utils.NodeAlias(root)
|
||||
utils.CheckForMergeNodes(root)
|
||||
p.Extensions = low.ExtractExtensions(root)
|
||||
|
||||
@@ -51,7 +51,7 @@ func (p *Paths) FindExtension(ext string) *low.ValueReference[any] {
|
||||
}
|
||||
|
||||
// Build will extract extensions and paths from node.
|
||||
func (p *Paths) Build(root *yaml.Node, idx *index.SpecIndex) error {
|
||||
func (p *Paths) Build(_, root *yaml.Node, idx *index.SpecIndex) error {
|
||||
root = utils.NodeAlias(root)
|
||||
utils.CheckForMergeNodes(root)
|
||||
p.Extensions = low.ExtractExtensions(root)
|
||||
|
||||
@@ -39,7 +39,7 @@ func (cb *Callback) FindExpression(exp string) *low.ValueReference[*PathItem] {
|
||||
}
|
||||
|
||||
// Build will extract extensions, expressions and PathItem objects for Callback
|
||||
func (cb *Callback) Build(root *yaml.Node, idx *index.SpecIndex) error {
|
||||
func (cb *Callback) Build(_, root *yaml.Node, idx *index.SpecIndex) error {
|
||||
root = utils.NodeAlias(root)
|
||||
utils.CheckForMergeNodes(root)
|
||||
cb.Reference = new(low.Reference)
|
||||
|
||||
@@ -58,7 +58,7 @@ func (en *Encoding) Hash() [32]byte {
|
||||
}
|
||||
|
||||
// Build will extract all Header objects from supplied node.
|
||||
func (en *Encoding) Build(root *yaml.Node, idx *index.SpecIndex) error {
|
||||
func (en *Encoding) Build(_, root *yaml.Node, idx *index.SpecIndex) error {
|
||||
root = utils.NodeAlias(root)
|
||||
utils.CheckForMergeNodes(root)
|
||||
en.Reference = new(low.Reference)
|
||||
|
||||
@@ -95,7 +95,7 @@ func (h *Header) Hash() [32]byte {
|
||||
}
|
||||
|
||||
// Build will extract extensions, examples, schema and content/media types from node.
|
||||
func (h *Header) Build(root *yaml.Node, idx *index.SpecIndex) error {
|
||||
func (h *Header) Build(_, root *yaml.Node, idx *index.SpecIndex) error {
|
||||
root = utils.NodeAlias(root)
|
||||
utils.CheckForMergeNodes(root)
|
||||
h.Reference = new(low.Reference)
|
||||
|
||||
@@ -53,7 +53,7 @@ func (l *Link) FindExtension(ext string) *low.ValueReference[any] {
|
||||
}
|
||||
|
||||
// Build will extract extensions and servers from the node.
|
||||
func (l *Link) Build(root *yaml.Node, idx *index.SpecIndex) error {
|
||||
func (l *Link) Build(_, root *yaml.Node, idx *index.SpecIndex) error {
|
||||
root = utils.NodeAlias(root)
|
||||
utils.CheckForMergeNodes(root)
|
||||
l.Reference = new(low.Reference)
|
||||
|
||||
@@ -54,7 +54,7 @@ func (mt *MediaType) GetAllExamples() map[low.KeyReference[string]]low.ValueRefe
|
||||
}
|
||||
|
||||
// Build will extract examples, extensions, schema and encoding from node.
|
||||
func (mt *MediaType) Build(root *yaml.Node, idx *index.SpecIndex) error {
|
||||
func (mt *MediaType) Build(_, root *yaml.Node, idx *index.SpecIndex) error {
|
||||
root = utils.NodeAlias(root)
|
||||
utils.CheckForMergeNodes(root)
|
||||
mt.Reference = new(low.Reference)
|
||||
|
||||
@@ -36,7 +36,7 @@ func (o *OAuthFlows) FindExtension(ext string) *low.ValueReference[any] {
|
||||
}
|
||||
|
||||
// Build will extract extensions and all OAuthFlow types from the supplied node.
|
||||
func (o *OAuthFlows) Build(root *yaml.Node, idx *index.SpecIndex) error {
|
||||
func (o *OAuthFlows) Build(_, root *yaml.Node, idx *index.SpecIndex) error {
|
||||
root = utils.NodeAlias(root)
|
||||
utils.CheckForMergeNodes(root)
|
||||
o.Reference = new(low.Reference)
|
||||
@@ -116,7 +116,7 @@ func (o *OAuthFlow) FindExtension(ext string) *low.ValueReference[any] {
|
||||
}
|
||||
|
||||
// Build will extract extensions from the node.
|
||||
func (o *OAuthFlow) Build(root *yaml.Node, idx *index.SpecIndex) error {
|
||||
func (o *OAuthFlow) Build(_, root *yaml.Node, idx *index.SpecIndex) error {
|
||||
o.Reference = new(low.Reference)
|
||||
o.Extensions = low.ExtractExtensions(root)
|
||||
return nil
|
||||
|
||||
@@ -55,7 +55,7 @@ func (o *Operation) FindSecurityRequirement(name string) []low.ValueReference[st
|
||||
}
|
||||
|
||||
// Build will extract external docs, parameters, request body, responses, callbacks, security and servers.
|
||||
func (o *Operation) Build(root *yaml.Node, idx *index.SpecIndex) error {
|
||||
func (o *Operation) Build(_, root *yaml.Node, idx *index.SpecIndex) error {
|
||||
root = utils.NodeAlias(root)
|
||||
utils.CheckForMergeNodes(root)
|
||||
o.Reference = new(low.Reference)
|
||||
|
||||
@@ -58,7 +58,7 @@ func (p *Parameter) GetExtensions() map[low.KeyReference[string]]low.ValueRefere
|
||||
}
|
||||
|
||||
// Build will extract examples, extensions and content/media types.
|
||||
func (p *Parameter) Build(root *yaml.Node, idx *index.SpecIndex) error {
|
||||
func (p *Parameter) Build(_, root *yaml.Node, idx *index.SpecIndex) error {
|
||||
root = utils.NodeAlias(root)
|
||||
utils.CheckForMergeNodes(root)
|
||||
p.Reference = new(low.Reference)
|
||||
|
||||
@@ -108,7 +108,7 @@ func (p *PathItem) GetExtensions() map[low.KeyReference[string]]low.ValueReferen
|
||||
|
||||
// Build extracts extensions, parameters, servers and each http method defined.
|
||||
// everything is extracted asynchronously for speed.
|
||||
func (p *PathItem) Build(root *yaml.Node, idx *index.SpecIndex) error {
|
||||
func (p *PathItem) Build(_, root *yaml.Node, idx *index.SpecIndex) error {
|
||||
root = utils.NodeAlias(root)
|
||||
utils.CheckForMergeNodes(root)
|
||||
p.Reference = new(low.Reference)
|
||||
|
||||
@@ -58,7 +58,7 @@ func (p *Paths) GetExtensions() map[low.KeyReference[string]]low.ValueReference[
|
||||
}
|
||||
|
||||
// Build will extract extensions and all PathItems. This happens asynchronously for speed.
|
||||
func (p *Paths) Build(root *yaml.Node, idx *index.SpecIndex) error {
|
||||
func (p *Paths) Build(_, root *yaml.Node, idx *index.SpecIndex) error {
|
||||
root = utils.NodeAlias(root)
|
||||
utils.CheckForMergeNodes(root)
|
||||
p.Reference = new(low.Reference)
|
||||
|
||||
@@ -40,7 +40,7 @@ func (rb *RequestBody) FindContent(cType string) *low.ValueReference[*MediaType]
|
||||
}
|
||||
|
||||
// Build will extract extensions and MediaType objects from the node.
|
||||
func (rb *RequestBody) Build(root *yaml.Node, idx *index.SpecIndex) error {
|
||||
func (rb *RequestBody) Build(_, root *yaml.Node, idx *index.SpecIndex) error {
|
||||
root = utils.NodeAlias(root)
|
||||
utils.CheckForMergeNodes(root)
|
||||
rb.Reference = new(low.Reference)
|
||||
|
||||
@@ -54,7 +54,7 @@ func (r *Response) FindLink(hType string) *low.ValueReference[*Link] {
|
||||
}
|
||||
|
||||
// Build will extract headers, extensions, content and links from node.
|
||||
func (r *Response) Build(root *yaml.Node, idx *index.SpecIndex) error {
|
||||
func (r *Response) Build(_, root *yaml.Node, idx *index.SpecIndex) error {
|
||||
root = utils.NodeAlias(root)
|
||||
utils.CheckForMergeNodes(root)
|
||||
r.Reference = new(low.Reference)
|
||||
|
||||
@@ -45,7 +45,7 @@ func (r *Responses) GetExtensions() map[low.KeyReference[string]]low.ValueRefere
|
||||
}
|
||||
|
||||
// Build will extract default response and all Response objects for each code
|
||||
func (r *Responses) Build(root *yaml.Node, idx *index.SpecIndex) error {
|
||||
func (r *Responses) Build(_, root *yaml.Node, idx *index.SpecIndex) error {
|
||||
root = utils.NodeAlias(root)
|
||||
r.Reference = new(low.Reference)
|
||||
r.Extensions = low.ExtractExtensions(root)
|
||||
|
||||
@@ -48,7 +48,7 @@ func (ss *SecurityScheme) GetExtensions() map[low.KeyReference[string]]low.Value
|
||||
}
|
||||
|
||||
// Build will extract OAuthFlows and extensions from the node.
|
||||
func (ss *SecurityScheme) Build(root *yaml.Node, idx *index.SpecIndex) error {
|
||||
func (ss *SecurityScheme) Build(_, root *yaml.Node, idx *index.SpecIndex) error {
|
||||
root = utils.NodeAlias(root)
|
||||
utils.CheckForMergeNodes(root)
|
||||
ss.Reference = new(low.Reference)
|
||||
|
||||
@@ -34,7 +34,7 @@ func (s *Server) FindVariable(serverVar string) *low.ValueReference[*ServerVaria
|
||||
}
|
||||
|
||||
// Build will extract server variables from the supplied node.
|
||||
func (s *Server) Build(root *yaml.Node, idx *index.SpecIndex) error {
|
||||
func (s *Server) Build(_, root *yaml.Node, idx *index.SpecIndex) error {
|
||||
root = utils.NodeAlias(root)
|
||||
utils.CheckForMergeNodes(root)
|
||||
s.Reference = new(low.Reference)
|
||||
|
||||
Reference in New Issue
Block a user