mirror of
https://github.com/LukeHagar/libopenapi.git
synced 2025-12-10 12:37:48 +00:00
Building out highlevel model
bit by bit, step by step.
This commit is contained in:
@@ -3,7 +3,10 @@
|
||||
|
||||
package v3
|
||||
|
||||
import low "github.com/pb33f/libopenapi/datamodel/low/3.0"
|
||||
import (
|
||||
"github.com/pb33f/libopenapi/datamodel/high"
|
||||
low "github.com/pb33f/libopenapi/datamodel/low/3.0"
|
||||
)
|
||||
|
||||
type XML struct {
|
||||
Name string
|
||||
@@ -15,6 +18,18 @@ type XML struct {
|
||||
low *low.XML
|
||||
}
|
||||
|
||||
func NewXML(xml *low.XML) *XML {
|
||||
x := new(XML)
|
||||
x.low = xml
|
||||
x.Name = xml.Name.Value
|
||||
x.Namespace = xml.Namespace.Value
|
||||
x.Prefix = xml.Namespace.Value
|
||||
x.Attribute = xml.Attribute.Value
|
||||
x.Wrapped = xml.Wrapped.Value
|
||||
x.Extensions = high.ExtractExtensions(xml.Extensions)
|
||||
return x
|
||||
}
|
||||
|
||||
func (x *XML) GoLow() *low.XML {
|
||||
return x.low
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user