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:
33
datamodel/high/base/external_doc.go
Normal file
33
datamodel/high/base/external_doc.go
Normal file
@@ -0,0 +1,33 @@
|
||||
// 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 ExternalDoc struct {
|
||||
Description string
|
||||
URL string
|
||||
Extensions map[string]any
|
||||
low *low.ExternalDoc
|
||||
}
|
||||
|
||||
func NewExternalDoc(extDoc *low.ExternalDoc) *ExternalDoc {
|
||||
d := new(ExternalDoc)
|
||||
d.low = extDoc
|
||||
if !extDoc.Description.IsEmpty() {
|
||||
d.Description = extDoc.Description.Value
|
||||
}
|
||||
if !extDoc.URL.IsEmpty() {
|
||||
d.URL = extDoc.URL.Value
|
||||
}
|
||||
d.Extensions = high.ExtractExtensions(extDoc.Extensions)
|
||||
return d
|
||||
}
|
||||
|
||||
func (e *ExternalDoc) GoLow() *low.ExternalDoc {
|
||||
return e.low
|
||||
}
|
||||
Reference in New Issue
Block a user