@@ -91,11 +91,15 @@ type TypeNode struct {
91
91
NativeDialect string `json:",omitempty"`
92
92
93
93
// Native type features by dialect name.
94
- Native map [string ]* NativeType `json:"-"`
94
+ Native map [string ]* NativeType
95
95
96
96
// Capture error if element cannot reflect.
97
97
Error string `json:",omitempty"`
98
98
99
+ // MetaKey is a tag attached to a top-level node during schema derivation.
100
+ // This can be used to attach additional metadata during rendering.
101
+ MetaKey string `json:",omitempty"`
102
+
99
103
// Pointers to Parent and Child ID strings.
100
104
Parent string `json:",omitempty"`
101
105
Children []string `json:",omitempty"`
@@ -224,6 +228,7 @@ func (t *TypeNode) Copy() *TypeNode {
224
228
n .TypeCategory = t .TypeCategory
225
229
n .TypeRef = t .TypeRef
226
230
n .Error = t .Error
231
+ n .MetaKey = t .MetaKey
227
232
228
233
// Copy Children with new element as parent.
229
234
for _ , childID := range t .Children {
@@ -546,13 +551,13 @@ type NativeType struct {
546
551
Dialect string
547
552
548
553
// Name of element if different from generic Name.
549
- Name string
554
+ Name string `json:",omitempty"`
550
555
551
556
// Native type of element if different from the generic Type.
552
- Type string
557
+ Type string `json:",omitempty"`
553
558
554
559
// TypeRef holds the native name of a type if different from the generic TypeRef.
555
- TypeRef string
560
+ TypeRef string `json:",omitempty"`
556
561
557
562
// Include indicates whether an element should be included in output for a dialect.
558
563
// Include has three value values:
@@ -568,7 +573,7 @@ type NativeType struct {
568
573
Options NativeOption
569
574
570
575
// Capture error if element cannot reflect.
571
- Error string
576
+ Error string `json:",omitempty"`
572
577
}
573
578
574
579
// NewNativeType initializes a new NativeType with default settings.
0 commit comments