mirror of
https://github.com/LukeHagar/libopenapi.git
synced 2025-12-09 20:47:44 +00:00
V2 low-base docs in place
refactored constants a little also to clean things up.
This commit is contained in:
@@ -1,21 +1,30 @@
|
||||
package base
|
||||
|
||||
import (
|
||||
"github.com/pb33f/libopenapi/datamodel/low"
|
||||
"github.com/pb33f/libopenapi/index"
|
||||
"gopkg.in/yaml.v3"
|
||||
"github.com/pb33f/libopenapi/datamodel/low"
|
||||
"github.com/pb33f/libopenapi/index"
|
||||
"gopkg.in/yaml.v3"
|
||||
)
|
||||
|
||||
// XML represents a low-level representation of an XML object defined by all versions of OpenAPI.
|
||||
//
|
||||
// A metadata object that allows for more fine-tuned XML model definitions.
|
||||
//
|
||||
// When using arrays, XML element names are not inferred (for singular/plural forms) and the name property SHOULD be
|
||||
// used to add that information. See examples for expected behavior.
|
||||
// v2 - https://swagger.io/specification/v2/#xmlObject
|
||||
// v3 - https://swagger.io/specification/#xml-object
|
||||
type XML struct {
|
||||
Name low.NodeReference[string]
|
||||
Namespace low.NodeReference[string]
|
||||
Prefix low.NodeReference[string]
|
||||
Attribute low.NodeReference[bool]
|
||||
Wrapped low.NodeReference[bool]
|
||||
Extensions map[low.KeyReference[string]]low.ValueReference[any]
|
||||
Name low.NodeReference[string]
|
||||
Namespace low.NodeReference[string]
|
||||
Prefix low.NodeReference[string]
|
||||
Attribute low.NodeReference[bool]
|
||||
Wrapped low.NodeReference[bool]
|
||||
Extensions map[low.KeyReference[string]]low.ValueReference[any]
|
||||
}
|
||||
|
||||
// Build will extract extensions from the XML instance.
|
||||
func (x *XML) Build(root *yaml.Node, _ *index.SpecIndex) error {
|
||||
x.Extensions = low.ExtractExtensions(root)
|
||||
return nil
|
||||
x.Extensions = low.ExtractExtensions(root)
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user