mirror of
https://github.com/LukeHagar/libopenapi.git
synced 2025-12-09 20:47:44 +00:00
Swagger 2.0 high level model going in now
Shifting a few high level models around that are also shared. now it's just a churn game to flesh the high level model and test it up.
This commit is contained in:
35
datamodel/high/base/xml.go
Normal file
35
datamodel/high/base/xml.go
Normal file
@@ -0,0 +1,35 @@
|
||||
// Copyright 2022 Princess B33f Heavy Industries / Dave Shanley
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package base
|
||||
|
||||
import (
|
||||
"github.com/pb33f/libopenapi/datamodel/high"
|
||||
low "github.com/pb33f/libopenapi/datamodel/low/base"
|
||||
)
|
||||
|
||||
type XML struct {
|
||||
Name string
|
||||
Namespace string
|
||||
Prefix string
|
||||
Attribute bool
|
||||
Wrapped bool
|
||||
Extensions map[string]any
|
||||
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