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:
40
datamodel/low/v3/document.go
Normal file
40
datamodel/low/v3/document.go
Normal 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
|
||||
//}
|
||||
Reference in New Issue
Block a user