mirror of
https://github.com/LukeHagar/libopenapi.git
synced 2025-12-10 04:20:24 +00:00
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.
29 lines
537 B
Go
29 lines
537 B
Go
// Copyright 2022 Princess B33f Heavy Industries / Dave Shanley
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
package v2
|
|
|
|
import (
|
|
low "github.com/pb33f/libopenapi/datamodel/low/v2"
|
|
)
|
|
|
|
type Scopes struct {
|
|
Values map[string]string
|
|
low *low.Scopes
|
|
}
|
|
|
|
func NewScopes(scopes *low.Scopes) *Scopes {
|
|
s := new(Scopes)
|
|
s.low = scopes
|
|
scopeValues := make(map[string]string)
|
|
for k := range scopes.Values {
|
|
scopeValues[k.Value] = scopes.Values[k].Value
|
|
}
|
|
s.Values = scopeValues
|
|
return s
|
|
}
|
|
|
|
func (s *Scopes) GoLow() *low.Scopes {
|
|
return s.low
|
|
}
|