Refactoring core structure of datamodel to accomodate v2 model.

There is a lot of overlap on these models, to create a much more sensible design, a new 'base' package has been added which contains shared models that both versions make use of.
This commit is contained in:
Dave Shanley
2022-09-01 08:53:16 -04:00
parent 990ba78ca8
commit 68743113ed
45 changed files with 246 additions and 125 deletions

20
datamodel/low/base/xml.go Normal file
View File

@@ -0,0 +1,20 @@
package base
import (
"github.com/pb33f/libopenapi/datamodel/low"
"gopkg.in/yaml.v3"
)
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]
}
func (x *XML) Build(root *yaml.Node) error {
x.Extensions = low.ExtractExtensions(root)
return nil
}