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:
Dave Shanley
2022-09-16 08:33:39 -04:00
parent 849074d0bc
commit 3d5ecf0efb
104 changed files with 48 additions and 48 deletions

View File

@@ -0,0 +1,40 @@
// Copyright 2022 Princess B33f Heavy Industries / Dave Shanley
// SPDX-License-Identifier: MIT
package v3
import (
"github.com/pb33f/libopenapi/datamodel/low"
"github.com/pb33f/libopenapi/datamodel/low/base"
"github.com/pb33f/libopenapi/index"
)
type Document struct {
Version low.ValueReference[string]
Info low.NodeReference[*base.Info]
JsonSchemaDialect low.NodeReference[string] // 3.1
Webhooks low.NodeReference[map[low.KeyReference[string]]low.ValueReference[*PathItem]] // 3.1
Servers low.NodeReference[[]low.ValueReference[*Server]]
Paths low.NodeReference[*Paths]
Components low.NodeReference[*Components]
Security low.NodeReference[*SecurityRequirement]
Tags low.NodeReference[[]low.ValueReference[*base.Tag]]
ExternalDocs low.NodeReference[*base.ExternalDoc]
Extensions map[low.KeyReference[string]]low.ValueReference[any]
Index *index.SpecIndex
}
//
//func (d *Document) AddTag() *base.Tag {
// t := base.NewTag()
// //d.Tags.KeyNode
// t.Name.Value = "nice new tag"
//
// dat, _ := yaml.Marshal(t)
// var inject yaml.Node
// _ = yaml.Unmarshal(dat, &inject)
//
// d.Tags.ValueNode.Content = append(d.Tags.ValueNode.Content, inject.Content[0])
//
// return t
//}