mirror of
https://github.com/LukeHagar/libopenapi.git
synced 2025-12-09 20:47:44 +00:00
Refactored version directory names
3.0 and 2.0 do not work, there are multiple versions and anything with a period in it sucks from my point of view, v2 and v3 feel much better from a DX perspective.
This commit is contained in:
28
datamodel/high/v2/examples.go
Normal file
28
datamodel/high/v2/examples.go
Normal file
@@ -0,0 +1,28 @@
|
||||
// Copyright 2022 Princess B33f Heavy Industries / Dave Shanley
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package v2
|
||||
|
||||
import low "github.com/pb33f/libopenapi/datamodel/low/v2"
|
||||
|
||||
type Examples struct {
|
||||
Values map[string]any
|
||||
low *low.Examples
|
||||
}
|
||||
|
||||
func NewExamples(examples *low.Examples) *Examples {
|
||||
e := new(Examples)
|
||||
e.low = examples
|
||||
if len(examples.Values) > 0 {
|
||||
values := make(map[string]any)
|
||||
for k := range examples.Values {
|
||||
values[k.Value] = examples.Values[k].Value
|
||||
}
|
||||
e.Values = values
|
||||
}
|
||||
return e
|
||||
}
|
||||
|
||||
func (e *Examples) GoLow() *low.Examples {
|
||||
return e.low
|
||||
}
|
||||
Reference in New Issue
Block a user