typia 13.0.0-dev.20260514 → 13.0.0-dev.20260519

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,9 +1,9 @@
1
1
  package factories
2
2
 
3
3
  import (
4
- nativechecker "github.com/microsoft/typescript-go/shim/checker"
5
- nativemetadata "github.com/samchon/typia/packages/typia/native/core/factories/internal/metadata"
6
- schemametadata "github.com/samchon/typia/packages/typia/native/core/schemas/metadata"
4
+ nativechecker "github.com/microsoft/typescript-go/shim/checker"
5
+ nativemetadata "github.com/samchon/typia/packages/typia/native/core/factories/internal/metadata"
6
+ schemametadata "github.com/samchon/typia/packages/typia/native/core/schemas/metadata"
7
7
  )
8
8
 
9
9
  type metadataFactoryNamespace struct{}
@@ -11,48 +11,48 @@ type metadataFactoryNamespace struct{}
11
11
  var MetadataFactory = metadataFactoryNamespace{}
12
12
 
13
13
  func init() {
14
- nativemetadata.MetadataTypeTagAnalyzer = func(props struct {
15
- Errors *[]nativemetadata.MetadataFactory_IError
16
- Type string
17
- Objects []*schemametadata.MetadataObjectType
18
- Explore nativemetadata.MetadataFactory_IExplore
19
- }) []schemametadata.IMetadataTypeTag {
20
- return MetadataTypeTagFactory.Analyze(struct {
21
- Errors *[]MetadataFactory_IError
22
- Type string
23
- Objects []*schemametadata.MetadataObjectType
24
- Explore MetadataFactory_IExplore
25
- }{
26
- Errors: props.Errors,
27
- Type: props.Type,
28
- Objects: props.Objects,
29
- Explore: props.Explore,
30
- })
31
- }
32
- nativemetadata.MetadataCommentTagAnalyzer = func(props struct {
33
- Errors *[]nativemetadata.MetadataFactory_IError
34
- Metadata *schemametadata.MetadataSchema
35
- Tags []schemametadata.IJsDocTagInfo
36
- Explore nativemetadata.MetadataFactory_IExplore
37
- }) {
38
- MetadataCommentTagFactory.Analyze(struct {
39
- Errors *[]MetadataFactory_IError
40
- Metadata *schemametadata.MetadataSchema
41
- Tags []schemametadata.IJsDocTagInfo
42
- Explore MetadataFactory_IExplore
43
- }{
44
- Errors: props.Errors,
45
- Metadata: props.Metadata,
46
- Tags: props.Tags,
47
- Explore: props.Explore,
48
- })
49
- }
14
+ nativemetadata.MetadataTypeTagAnalyzer = func(props struct {
15
+ Errors *[]nativemetadata.MetadataFactory_IError
16
+ Type string
17
+ Objects []*schemametadata.MetadataObjectType
18
+ Explore nativemetadata.MetadataFactory_IExplore
19
+ }) []schemametadata.IMetadataTypeTag {
20
+ return MetadataTypeTagFactory.Analyze(struct {
21
+ Errors *[]MetadataFactory_IError
22
+ Type string
23
+ Objects []*schemametadata.MetadataObjectType
24
+ Explore MetadataFactory_IExplore
25
+ }{
26
+ Errors: props.Errors,
27
+ Type: props.Type,
28
+ Objects: props.Objects,
29
+ Explore: props.Explore,
30
+ })
31
+ }
32
+ nativemetadata.MetadataCommentTagAnalyzer = func(props struct {
33
+ Errors *[]nativemetadata.MetadataFactory_IError
34
+ Metadata *schemametadata.MetadataSchema
35
+ Tags []schemametadata.IJsDocTagInfo
36
+ Explore nativemetadata.MetadataFactory_IExplore
37
+ }) {
38
+ MetadataCommentTagFactory.Analyze(struct {
39
+ Errors *[]MetadataFactory_IError
40
+ Metadata *schemametadata.MetadataSchema
41
+ Tags []schemametadata.IJsDocTagInfo
42
+ Explore MetadataFactory_IExplore
43
+ }{
44
+ Errors: props.Errors,
45
+ Metadata: props.Metadata,
46
+ Tags: props.Tags,
47
+ Explore: props.Explore,
48
+ })
49
+ }
50
50
  }
51
51
 
52
52
  type MetadataFactory_Validator = func(props struct {
53
- Metadata *schemametadata.MetadataSchema
54
- Explore MetadataFactory_IExplore
55
- Top *schemametadata.MetadataSchema
53
+ Metadata *schemametadata.MetadataSchema
54
+ Explore MetadataFactory_IExplore
55
+ Top *schemametadata.MetadataSchema
56
56
  }) []string
57
57
 
58
58
  type MetadataFactory_IOptions = nativemetadata.MetadataFactory_IOptions
@@ -60,488 +60,488 @@ type MetadataFactory_IExplore = nativemetadata.MetadataFactory_IExplore
60
60
  type MetadataFactory_IError = nativemetadata.MetadataFactory_IError
61
61
 
62
62
  type MetadataFactory_IProps struct {
63
- Checker *nativechecker.Checker
64
- Transformer any
65
- Options MetadataFactory_IOptions
66
- Components *schemametadata.MetadataCollection
67
- Type *nativechecker.Type
63
+ Checker *nativechecker.Checker
64
+ Transformer any
65
+ Options MetadataFactory_IOptions
66
+ Components *schemametadata.MetadataCollection
67
+ Type *nativechecker.Type
68
68
  }
69
69
 
70
70
  type MetadataFactory_ValidationPipe struct {
71
- Success bool
72
- Data *schemametadata.MetadataSchema
73
- Errors []MetadataFactory_IError
71
+ Success bool
72
+ Data *schemametadata.MetadataSchema
73
+ Errors []MetadataFactory_IError
74
74
  }
75
75
 
76
76
  func (metadataFactoryNamespace) Analyze(props MetadataFactory_IProps) MetadataFactory_ValidationPipe {
77
- errors := []MetadataFactory_IError{}
78
- metadata := nativemetadata.Explore_metadata(nativemetadata.Explore_metadata_IProps{
79
- Options: props.Options,
80
- Checker: props.Checker,
81
- Components: props.Components,
82
- Errors: &errors,
83
- Type: props.Type,
84
- Explore: MetadataFactory_IExplore{
85
- Top: true,
86
- Object: nil,
87
- Property: nil,
88
- Parameter: nil,
89
- Nested: nil,
90
- Aliased: false,
91
- Escaped: false,
92
- Output: false,
93
- },
94
- Intersected: false,
95
- })
96
- nativemetadata.Iterate_metadata_collection(struct {
97
- Errors *[]MetadataFactory_IError
98
- Collection *schemametadata.MetadataCollection
99
- }{
100
- Errors: &errors,
101
- Collection: props.Components,
102
- })
103
- nativemetadata.Iterate_metadata_sort(struct {
104
- Collection *schemametadata.MetadataCollection
105
- Metadata *schemametadata.MetadataSchema
106
- }{
107
- Collection: props.Components,
108
- Metadata: metadata,
109
- })
77
+ errors := []MetadataFactory_IError{}
78
+ metadata := nativemetadata.Explore_metadata(nativemetadata.Explore_metadata_IProps{
79
+ Options: props.Options,
80
+ Checker: props.Checker,
81
+ Components: props.Components,
82
+ Errors: &errors,
83
+ Type: props.Type,
84
+ Explore: MetadataFactory_IExplore{
85
+ Top: true,
86
+ Object: nil,
87
+ Property: nil,
88
+ Parameter: nil,
89
+ Nested: nil,
90
+ Aliased: false,
91
+ Escaped: false,
92
+ Output: false,
93
+ },
94
+ Intersected: false,
95
+ })
96
+ nativemetadata.Iterate_metadata_collection(struct {
97
+ Errors *[]MetadataFactory_IError
98
+ Collection *schemametadata.MetadataCollection
99
+ }{
100
+ Errors: &errors,
101
+ Collection: props.Components,
102
+ })
103
+ nativemetadata.Iterate_metadata_sort(struct {
104
+ Collection *schemametadata.MetadataCollection
105
+ Metadata *schemametadata.MetadataSchema
106
+ }{
107
+ Collection: props.Components,
108
+ Metadata: metadata,
109
+ })
110
110
 
111
- if props.Options.Validate != nil {
112
- errors = append(errors, MetadataFactory.Validate(struct {
113
- Transformer any
114
- Options MetadataFactory_IOptions
115
- Functor MetadataFactory_Validator
116
- Metadata *schemametadata.MetadataSchema
117
- }{
118
- Transformer: props.Transformer,
119
- Options: props.Options,
120
- Functor: props.Options.Validate,
121
- Metadata: metadata,
122
- })...)
123
- }
124
- if len(errors) != 0 {
125
- return MetadataFactory_ValidationPipe{
126
- Success: false,
127
- Errors: errors,
128
- }
129
- }
130
- return MetadataFactory_ValidationPipe{
131
- Success: true,
132
- Data: metadata,
133
- }
111
+ if props.Options.Validate != nil {
112
+ errors = append(errors, MetadataFactory.Validate(struct {
113
+ Transformer any
114
+ Options MetadataFactory_IOptions
115
+ Functor MetadataFactory_Validator
116
+ Metadata *schemametadata.MetadataSchema
117
+ }{
118
+ Transformer: props.Transformer,
119
+ Options: props.Options,
120
+ Functor: props.Options.Validate,
121
+ Metadata: metadata,
122
+ })...)
123
+ }
124
+ if len(errors) != 0 {
125
+ return MetadataFactory_ValidationPipe{
126
+ Success: false,
127
+ Errors: errors,
128
+ }
129
+ }
130
+ return MetadataFactory_ValidationPipe{
131
+ Success: true,
132
+ Data: metadata,
133
+ }
134
134
  }
135
135
 
136
136
  func (metadataFactoryNamespace) SoleLiteral(value string) *schemametadata.MetadataSchema {
137
- meta := schemametadata.MetadataSchema_initialize()
138
- meta.Constants = append(meta.Constants, schemametadata.MetadataConstant_create(schemametadata.MetadataConstant{
139
- Values: []*schemametadata.MetadataConstantValue{
140
- schemametadata.MetadataConstantValue_create(schemametadata.MetadataConstantValue{
141
- Value: value,
142
- Tags: [][]schemametadata.IMetadataTypeTag{},
143
- }),
144
- },
145
- Type: "string",
146
- }))
147
- return meta
137
+ meta := schemametadata.MetadataSchema_initialize()
138
+ meta.Constants = append(meta.Constants, schemametadata.MetadataConstant_create(schemametadata.MetadataConstant{
139
+ Values: []*schemametadata.MetadataConstantValue{
140
+ schemametadata.MetadataConstantValue_create(schemametadata.MetadataConstantValue{
141
+ Value: value,
142
+ Tags: [][]schemametadata.IMetadataTypeTag{},
143
+ }),
144
+ },
145
+ Type: "string",
146
+ }))
147
+ return meta
148
148
  }
149
149
 
150
150
  func (metadataFactoryNamespace) Validate(props struct {
151
- Transformer any
152
- Options MetadataFactory_IOptions
153
- Functor MetadataFactory_Validator
154
- Metadata *schemametadata.MetadataSchema
151
+ Transformer any
152
+ Options MetadataFactory_IOptions
153
+ Functor MetadataFactory_Validator
154
+ Metadata *schemametadata.MetadataSchema
155
155
  }) []MetadataFactory_IError {
156
- visitor := &metadataFactory_IValidationVisitor{
157
- Functor: props.Functor,
158
- Errors: []MetadataFactory_IError{},
159
- Objects: map[*schemametadata.MetadataObjectType]bool{},
160
- Arrays: map[*schemametadata.MetadataArrayType]bool{},
161
- Tuples: map[*schemametadata.MetadataTupleType]bool{},
162
- Aliases: map[*schemametadata.MetadataAliasType]bool{},
163
- Functions: map[*schemametadata.MetadataFunction]bool{},
164
- }
165
- MetadataFactory.validateMeta(struct {
166
- Options MetadataFactory_IOptions
167
- Visitor *metadataFactory_IValidationVisitor
168
- Metadata *schemametadata.MetadataSchema
169
- Top *schemametadata.MetadataSchema
170
- Explore MetadataFactory_IExplore
171
- }{
172
- Options: props.Options,
173
- Visitor: visitor,
174
- Metadata: props.Metadata,
175
- Top: props.Metadata,
176
- Explore: MetadataFactory_IExplore{
177
- Object: nil,
178
- Property: nil,
179
- Parameter: nil,
180
- Nested: nil,
181
- Top: true,
182
- Aliased: false,
183
- Escaped: false,
184
- Output: false,
185
- },
186
- })
187
- return visitor.Errors
156
+ visitor := &metadataFactory_IValidationVisitor{
157
+ Functor: props.Functor,
158
+ Errors: []MetadataFactory_IError{},
159
+ Objects: map[*schemametadata.MetadataObjectType]bool{},
160
+ Arrays: map[*schemametadata.MetadataArrayType]bool{},
161
+ Tuples: map[*schemametadata.MetadataTupleType]bool{},
162
+ Aliases: map[*schemametadata.MetadataAliasType]bool{},
163
+ Functions: map[*schemametadata.MetadataFunction]bool{},
164
+ }
165
+ MetadataFactory.validateMeta(struct {
166
+ Options MetadataFactory_IOptions
167
+ Visitor *metadataFactory_IValidationVisitor
168
+ Metadata *schemametadata.MetadataSchema
169
+ Top *schemametadata.MetadataSchema
170
+ Explore MetadataFactory_IExplore
171
+ }{
172
+ Options: props.Options,
173
+ Visitor: visitor,
174
+ Metadata: props.Metadata,
175
+ Top: props.Metadata,
176
+ Explore: MetadataFactory_IExplore{
177
+ Object: nil,
178
+ Property: nil,
179
+ Parameter: nil,
180
+ Nested: nil,
181
+ Top: true,
182
+ Aliased: false,
183
+ Escaped: false,
184
+ Output: false,
185
+ },
186
+ })
187
+ return visitor.Errors
188
188
  }
189
189
 
190
190
  func (metadataFactoryNamespace) validateMeta(props struct {
191
- Options MetadataFactory_IOptions
192
- Visitor *metadataFactory_IValidationVisitor
193
- Metadata *schemametadata.MetadataSchema
194
- Top *schemametadata.MetadataSchema
195
- Explore MetadataFactory_IExplore
191
+ Options MetadataFactory_IOptions
192
+ Visitor *metadataFactory_IValidationVisitor
193
+ Metadata *schemametadata.MetadataSchema
194
+ Top *schemametadata.MetadataSchema
195
+ Explore MetadataFactory_IExplore
196
196
  }) {
197
- result := []string{}
198
- if props.Visitor.Functor != nil {
199
- result = append(result, props.Visitor.Functor(struct {
200
- Metadata *schemametadata.MetadataSchema
201
- Explore MetadataFactory_IExplore
202
- Top *schemametadata.MetadataSchema
203
- }{
204
- Metadata: props.Metadata,
205
- Explore: props.Explore,
206
- Top: props.Top,
207
- })...)
208
- }
209
- if len(result) != 0 {
210
- props.Visitor.Errors = append(props.Visitor.Errors, MetadataFactory_IError{
211
- Name: props.Metadata.GetName(),
212
- Explore: props.Explore,
213
- Messages: metadataFactory_unique(result),
214
- })
215
- }
197
+ result := []string{}
198
+ if props.Visitor.Functor != nil {
199
+ result = append(result, props.Visitor.Functor(struct {
200
+ Metadata *schemametadata.MetadataSchema
201
+ Explore MetadataFactory_IExplore
202
+ Top *schemametadata.MetadataSchema
203
+ }{
204
+ Metadata: props.Metadata,
205
+ Explore: props.Explore,
206
+ Top: props.Top,
207
+ })...)
208
+ }
209
+ if len(result) != 0 {
210
+ props.Visitor.Errors = append(props.Visitor.Errors, MetadataFactory_IError{
211
+ Name: props.Metadata.GetName(),
212
+ Explore: props.Explore,
213
+ Messages: metadataFactory_unique(result),
214
+ })
215
+ }
216
216
 
217
- for _, alias := range props.Metadata.Aliases {
218
- MetadataFactory.validateAlias(struct {
219
- Options MetadataFactory_IOptions
220
- Visitor *metadataFactory_IValidationVisitor
221
- Alias *schemametadata.MetadataAliasType
222
- Explore MetadataFactory_IExplore
223
- Top *schemametadata.MetadataSchema
224
- }{
225
- Options: props.Options,
226
- Visitor: props.Visitor,
227
- Alias: alias.Type,
228
- Explore: props.Explore,
229
- Top: props.Top,
230
- })
231
- }
232
- for _, array := range props.Metadata.Arrays {
233
- MetadataFactory.validateArray(struct {
234
- Options MetadataFactory_IOptions
235
- Visitor *metadataFactory_IValidationVisitor
236
- Array *schemametadata.MetadataArrayType
237
- Explore MetadataFactory_IExplore
238
- Top *schemametadata.MetadataSchema
239
- }{
240
- Options: props.Options,
241
- Visitor: props.Visitor,
242
- Array: array.Type,
243
- Explore: props.Explore,
244
- Top: props.Top,
245
- })
246
- }
247
- for _, tuple := range props.Metadata.Tuples {
248
- MetadataFactory.validateTuple(struct {
249
- Options MetadataFactory_IOptions
250
- Visitor *metadataFactory_IValidationVisitor
251
- Tuple *schemametadata.MetadataTupleType
252
- Explore MetadataFactory_IExplore
253
- Top *schemametadata.MetadataSchema
254
- }{
255
- Options: props.Options,
256
- Visitor: props.Visitor,
257
- Tuple: tuple.Type,
258
- Explore: props.Explore,
259
- Top: props.Top,
260
- })
261
- }
262
- for _, object := range props.Metadata.Objects {
263
- MetadataFactory.validateObject(struct {
264
- Options MetadataFactory_IOptions
265
- Visitor *metadataFactory_IValidationVisitor
266
- Object *schemametadata.MetadataObjectType
267
- Top *schemametadata.MetadataSchema
268
- }{
269
- Options: props.Options,
270
- Visitor: props.Visitor,
271
- Object: object.Type,
272
- Top: props.Top,
273
- })
274
- }
275
- for _, function := range props.Metadata.Functions {
276
- MetadataFactory.validateFunction(struct {
277
- Options MetadataFactory_IOptions
278
- Visitor *metadataFactory_IValidationVisitor
279
- Function *schemametadata.MetadataFunction
280
- Explore MetadataFactory_IExplore
281
- Top *schemametadata.MetadataSchema
282
- }{
283
- Options: props.Options,
284
- Visitor: props.Visitor,
285
- Function: function,
286
- Explore: props.Explore,
287
- Top: props.Top,
288
- })
289
- }
290
- for _, set := range props.Metadata.Sets {
291
- MetadataFactory.validateMeta(struct {
292
- Options MetadataFactory_IOptions
293
- Visitor *metadataFactory_IValidationVisitor
294
- Metadata *schemametadata.MetadataSchema
295
- Top *schemametadata.MetadataSchema
296
- Explore MetadataFactory_IExplore
297
- }{
298
- Options: props.Options,
299
- Visitor: props.Visitor,
300
- Metadata: set.Value,
301
- Top: props.Top,
302
- Explore: props.Explore,
303
- })
304
- }
305
- for _, m := range props.Metadata.Maps {
306
- MetadataFactory.validateMeta(struct {
307
- Options MetadataFactory_IOptions
308
- Visitor *metadataFactory_IValidationVisitor
309
- Metadata *schemametadata.MetadataSchema
310
- Top *schemametadata.MetadataSchema
311
- Explore MetadataFactory_IExplore
312
- }{Options: props.Options, Visitor: props.Visitor, Metadata: m.Key, Top: props.Top, Explore: props.Explore})
313
- MetadataFactory.validateMeta(struct {
314
- Options MetadataFactory_IOptions
315
- Visitor *metadataFactory_IValidationVisitor
316
- Metadata *schemametadata.MetadataSchema
317
- Top *schemametadata.MetadataSchema
318
- Explore MetadataFactory_IExplore
319
- }{Options: props.Options, Visitor: props.Visitor, Metadata: m.Value, Top: props.Top, Explore: props.Explore})
320
- }
321
- if props.Options.Escape == true && props.Metadata.Escaped != nil {
322
- explore := props.Explore
323
- explore.Escaped = true
324
- MetadataFactory.validateMeta(struct {
325
- Options MetadataFactory_IOptions
326
- Visitor *metadataFactory_IValidationVisitor
327
- Metadata *schemametadata.MetadataSchema
328
- Top *schemametadata.MetadataSchema
329
- Explore MetadataFactory_IExplore
330
- }{Options: props.Options, Visitor: props.Visitor, Metadata: props.Metadata.Escaped.Returns, Top: props.Top, Explore: explore})
331
- }
217
+ for _, alias := range props.Metadata.Aliases {
218
+ MetadataFactory.validateAlias(struct {
219
+ Options MetadataFactory_IOptions
220
+ Visitor *metadataFactory_IValidationVisitor
221
+ Alias *schemametadata.MetadataAliasType
222
+ Explore MetadataFactory_IExplore
223
+ Top *schemametadata.MetadataSchema
224
+ }{
225
+ Options: props.Options,
226
+ Visitor: props.Visitor,
227
+ Alias: alias.Type,
228
+ Explore: props.Explore,
229
+ Top: props.Top,
230
+ })
231
+ }
232
+ for _, array := range props.Metadata.Arrays {
233
+ MetadataFactory.validateArray(struct {
234
+ Options MetadataFactory_IOptions
235
+ Visitor *metadataFactory_IValidationVisitor
236
+ Array *schemametadata.MetadataArrayType
237
+ Explore MetadataFactory_IExplore
238
+ Top *schemametadata.MetadataSchema
239
+ }{
240
+ Options: props.Options,
241
+ Visitor: props.Visitor,
242
+ Array: array.Type,
243
+ Explore: props.Explore,
244
+ Top: props.Top,
245
+ })
246
+ }
247
+ for _, tuple := range props.Metadata.Tuples {
248
+ MetadataFactory.validateTuple(struct {
249
+ Options MetadataFactory_IOptions
250
+ Visitor *metadataFactory_IValidationVisitor
251
+ Tuple *schemametadata.MetadataTupleType
252
+ Explore MetadataFactory_IExplore
253
+ Top *schemametadata.MetadataSchema
254
+ }{
255
+ Options: props.Options,
256
+ Visitor: props.Visitor,
257
+ Tuple: tuple.Type,
258
+ Explore: props.Explore,
259
+ Top: props.Top,
260
+ })
261
+ }
262
+ for _, object := range props.Metadata.Objects {
263
+ MetadataFactory.validateObject(struct {
264
+ Options MetadataFactory_IOptions
265
+ Visitor *metadataFactory_IValidationVisitor
266
+ Object *schemametadata.MetadataObjectType
267
+ Top *schemametadata.MetadataSchema
268
+ }{
269
+ Options: props.Options,
270
+ Visitor: props.Visitor,
271
+ Object: object.Type,
272
+ Top: props.Top,
273
+ })
274
+ }
275
+ for _, function := range props.Metadata.Functions {
276
+ MetadataFactory.validateFunction(struct {
277
+ Options MetadataFactory_IOptions
278
+ Visitor *metadataFactory_IValidationVisitor
279
+ Function *schemametadata.MetadataFunction
280
+ Explore MetadataFactory_IExplore
281
+ Top *schemametadata.MetadataSchema
282
+ }{
283
+ Options: props.Options,
284
+ Visitor: props.Visitor,
285
+ Function: function,
286
+ Explore: props.Explore,
287
+ Top: props.Top,
288
+ })
289
+ }
290
+ for _, set := range props.Metadata.Sets {
291
+ MetadataFactory.validateMeta(struct {
292
+ Options MetadataFactory_IOptions
293
+ Visitor *metadataFactory_IValidationVisitor
294
+ Metadata *schemametadata.MetadataSchema
295
+ Top *schemametadata.MetadataSchema
296
+ Explore MetadataFactory_IExplore
297
+ }{
298
+ Options: props.Options,
299
+ Visitor: props.Visitor,
300
+ Metadata: set.Value,
301
+ Top: props.Top,
302
+ Explore: props.Explore,
303
+ })
304
+ }
305
+ for _, m := range props.Metadata.Maps {
306
+ MetadataFactory.validateMeta(struct {
307
+ Options MetadataFactory_IOptions
308
+ Visitor *metadataFactory_IValidationVisitor
309
+ Metadata *schemametadata.MetadataSchema
310
+ Top *schemametadata.MetadataSchema
311
+ Explore MetadataFactory_IExplore
312
+ }{Options: props.Options, Visitor: props.Visitor, Metadata: m.Key, Top: props.Top, Explore: props.Explore})
313
+ MetadataFactory.validateMeta(struct {
314
+ Options MetadataFactory_IOptions
315
+ Visitor *metadataFactory_IValidationVisitor
316
+ Metadata *schemametadata.MetadataSchema
317
+ Top *schemametadata.MetadataSchema
318
+ Explore MetadataFactory_IExplore
319
+ }{Options: props.Options, Visitor: props.Visitor, Metadata: m.Value, Top: props.Top, Explore: props.Explore})
320
+ }
321
+ if props.Options.Escape == true && props.Metadata.Escaped != nil {
322
+ explore := props.Explore
323
+ explore.Escaped = true
324
+ MetadataFactory.validateMeta(struct {
325
+ Options MetadataFactory_IOptions
326
+ Visitor *metadataFactory_IValidationVisitor
327
+ Metadata *schemametadata.MetadataSchema
328
+ Top *schemametadata.MetadataSchema
329
+ Explore MetadataFactory_IExplore
330
+ }{Options: props.Options, Visitor: props.Visitor, Metadata: props.Metadata.Escaped.Returns, Top: props.Top, Explore: explore})
331
+ }
332
332
  }
333
333
 
334
334
  func (metadataFactoryNamespace) validateAlias(props struct {
335
- Options MetadataFactory_IOptions
336
- Visitor *metadataFactory_IValidationVisitor
337
- Alias *schemametadata.MetadataAliasType
338
- Explore MetadataFactory_IExplore
339
- Top *schemametadata.MetadataSchema
335
+ Options MetadataFactory_IOptions
336
+ Visitor *metadataFactory_IValidationVisitor
337
+ Alias *schemametadata.MetadataAliasType
338
+ Explore MetadataFactory_IExplore
339
+ Top *schemametadata.MetadataSchema
340
340
  }) {
341
- if props.Visitor.Aliases[props.Alias] {
342
- return
343
- }
344
- props.Visitor.Aliases[props.Alias] = true
345
- explore := props.Explore
346
- explore.Nested = props.Alias
347
- explore.Aliased = true
348
- MetadataFactory.validateMeta(struct {
349
- Options MetadataFactory_IOptions
350
- Visitor *metadataFactory_IValidationVisitor
351
- Metadata *schemametadata.MetadataSchema
352
- Top *schemametadata.MetadataSchema
353
- Explore MetadataFactory_IExplore
354
- }{Options: props.Options, Visitor: props.Visitor, Metadata: props.Alias.Value, Top: props.Top, Explore: explore})
341
+ if props.Visitor.Aliases[props.Alias] {
342
+ return
343
+ }
344
+ props.Visitor.Aliases[props.Alias] = true
345
+ explore := props.Explore
346
+ explore.Nested = props.Alias
347
+ explore.Aliased = true
348
+ MetadataFactory.validateMeta(struct {
349
+ Options MetadataFactory_IOptions
350
+ Visitor *metadataFactory_IValidationVisitor
351
+ Metadata *schemametadata.MetadataSchema
352
+ Top *schemametadata.MetadataSchema
353
+ Explore MetadataFactory_IExplore
354
+ }{Options: props.Options, Visitor: props.Visitor, Metadata: props.Alias.Value, Top: props.Top, Explore: explore})
355
355
  }
356
356
 
357
357
  func (metadataFactoryNamespace) validateArray(props struct {
358
- Options MetadataFactory_IOptions
359
- Visitor *metadataFactory_IValidationVisitor
360
- Array *schemametadata.MetadataArrayType
361
- Explore MetadataFactory_IExplore
362
- Top *schemametadata.MetadataSchema
358
+ Options MetadataFactory_IOptions
359
+ Visitor *metadataFactory_IValidationVisitor
360
+ Array *schemametadata.MetadataArrayType
361
+ Explore MetadataFactory_IExplore
362
+ Top *schemametadata.MetadataSchema
363
363
  }) {
364
- if props.Visitor.Arrays[props.Array] {
365
- return
366
- }
367
- props.Visitor.Arrays[props.Array] = true
368
- explore := props.Explore
369
- explore.Nested = props.Array
370
- explore.Top = false
371
- MetadataFactory.validateMeta(struct {
372
- Options MetadataFactory_IOptions
373
- Visitor *metadataFactory_IValidationVisitor
374
- Metadata *schemametadata.MetadataSchema
375
- Top *schemametadata.MetadataSchema
376
- Explore MetadataFactory_IExplore
377
- }{Options: props.Options, Visitor: props.Visitor, Metadata: props.Array.Value, Top: props.Top, Explore: explore})
364
+ if props.Visitor.Arrays[props.Array] {
365
+ return
366
+ }
367
+ props.Visitor.Arrays[props.Array] = true
368
+ explore := props.Explore
369
+ explore.Nested = props.Array
370
+ explore.Top = false
371
+ MetadataFactory.validateMeta(struct {
372
+ Options MetadataFactory_IOptions
373
+ Visitor *metadataFactory_IValidationVisitor
374
+ Metadata *schemametadata.MetadataSchema
375
+ Top *schemametadata.MetadataSchema
376
+ Explore MetadataFactory_IExplore
377
+ }{Options: props.Options, Visitor: props.Visitor, Metadata: props.Array.Value, Top: props.Top, Explore: explore})
378
378
  }
379
379
 
380
380
  func (metadataFactoryNamespace) validateTuple(props struct {
381
- Options MetadataFactory_IOptions
382
- Visitor *metadataFactory_IValidationVisitor
383
- Tuple *schemametadata.MetadataTupleType
384
- Explore MetadataFactory_IExplore
385
- Top *schemametadata.MetadataSchema
381
+ Options MetadataFactory_IOptions
382
+ Visitor *metadataFactory_IValidationVisitor
383
+ Tuple *schemametadata.MetadataTupleType
384
+ Explore MetadataFactory_IExplore
385
+ Top *schemametadata.MetadataSchema
386
386
  }) {
387
- if props.Visitor.Tuples[props.Tuple] {
388
- return
389
- }
390
- props.Visitor.Tuples[props.Tuple] = true
391
- for _, elem := range props.Tuple.Elements {
392
- explore := props.Explore
393
- explore.Nested = props.Tuple
394
- explore.Top = false
395
- MetadataFactory.validateMeta(struct {
396
- Options MetadataFactory_IOptions
397
- Visitor *metadataFactory_IValidationVisitor
398
- Metadata *schemametadata.MetadataSchema
399
- Top *schemametadata.MetadataSchema
400
- Explore MetadataFactory_IExplore
401
- }{Options: props.Options, Visitor: props.Visitor, Metadata: elem, Top: props.Top, Explore: explore})
402
- }
387
+ if props.Visitor.Tuples[props.Tuple] {
388
+ return
389
+ }
390
+ props.Visitor.Tuples[props.Tuple] = true
391
+ for _, elem := range props.Tuple.Elements {
392
+ explore := props.Explore
393
+ explore.Nested = props.Tuple
394
+ explore.Top = false
395
+ MetadataFactory.validateMeta(struct {
396
+ Options MetadataFactory_IOptions
397
+ Visitor *metadataFactory_IValidationVisitor
398
+ Metadata *schemametadata.MetadataSchema
399
+ Top *schemametadata.MetadataSchema
400
+ Explore MetadataFactory_IExplore
401
+ }{Options: props.Options, Visitor: props.Visitor, Metadata: elem, Top: props.Top, Explore: explore})
402
+ }
403
403
  }
404
404
 
405
405
  func (metadataFactoryNamespace) validateObject(props struct {
406
- Options MetadataFactory_IOptions
407
- Visitor *metadataFactory_IValidationVisitor
408
- Object *schemametadata.MetadataObjectType
409
- Top *schemametadata.MetadataSchema
406
+ Options MetadataFactory_IOptions
407
+ Visitor *metadataFactory_IValidationVisitor
408
+ Object *schemametadata.MetadataObjectType
409
+ Top *schemametadata.MetadataSchema
410
410
  }) {
411
- if props.Visitor.Objects[props.Object] {
412
- return
413
- }
414
- props.Visitor.Objects[props.Object] = true
415
- if props.Options.Validate != nil {
416
- explore := MetadataFactory_IExplore{
417
- Object: props.Object,
418
- Top: false,
419
- Property: nil,
420
- Parameter: nil,
421
- Nested: nil,
422
- Aliased: false,
423
- Escaped: false,
424
- Output: false,
425
- }
426
- metadata := schemametadata.MetadataSchema_create(schemametadata.MetadataSchema{
427
- Any: false,
428
- Nullable: false,
429
- Required: true,
430
- Optional: false,
431
- Constants: []*schemametadata.MetadataConstant{},
432
- Atomics: []*schemametadata.MetadataAtomic{},
433
- Templates: []*schemametadata.MetadataTemplate{},
434
- Arrays: []*schemametadata.MetadataArray{},
435
- Tuples: []*schemametadata.MetadataTuple{},
436
- Objects: []*schemametadata.MetadataObject{
437
- schemametadata.MetadataObject_create(schemametadata.MetadataObject{Type: props.Object, Tags: [][]schemametadata.IMetadataTypeTag{}}),
438
- },
439
- Aliases: []*schemametadata.MetadataAlias{},
440
- Functions: []*schemametadata.MetadataFunction{},
441
- Rest: nil,
442
- Natives: []*schemametadata.MetadataNative{},
443
- Sets: []*schemametadata.MetadataSet{},
444
- Maps: []*schemametadata.MetadataMap{},
445
- })
446
- errors := props.Options.Validate(struct {
447
- Metadata *schemametadata.MetadataSchema
448
- Explore MetadataFactory_IExplore
449
- Top *schemametadata.MetadataSchema
450
- }{Metadata: metadata, Top: props.Top, Explore: explore})
451
- if len(errors) != 0 {
452
- props.Visitor.Errors = append(props.Visitor.Errors, MetadataFactory_IError{
453
- Name: props.Object.Name,
454
- Explore: explore,
455
- Messages: metadataFactory_unique(errors),
456
- })
457
- }
458
- }
411
+ if props.Visitor.Objects[props.Object] {
412
+ return
413
+ }
414
+ props.Visitor.Objects[props.Object] = true
415
+ if props.Options.Validate != nil {
416
+ explore := MetadataFactory_IExplore{
417
+ Object: props.Object,
418
+ Top: false,
419
+ Property: nil,
420
+ Parameter: nil,
421
+ Nested: nil,
422
+ Aliased: false,
423
+ Escaped: false,
424
+ Output: false,
425
+ }
426
+ metadata := schemametadata.MetadataSchema_create(schemametadata.MetadataSchema{
427
+ Any: false,
428
+ Nullable: false,
429
+ Required: true,
430
+ Optional: false,
431
+ Constants: []*schemametadata.MetadataConstant{},
432
+ Atomics: []*schemametadata.MetadataAtomic{},
433
+ Templates: []*schemametadata.MetadataTemplate{},
434
+ Arrays: []*schemametadata.MetadataArray{},
435
+ Tuples: []*schemametadata.MetadataTuple{},
436
+ Objects: []*schemametadata.MetadataObject{
437
+ schemametadata.MetadataObject_create(schemametadata.MetadataObject{Type: props.Object, Tags: [][]schemametadata.IMetadataTypeTag{}}),
438
+ },
439
+ Aliases: []*schemametadata.MetadataAlias{},
440
+ Functions: []*schemametadata.MetadataFunction{},
441
+ Rest: nil,
442
+ Natives: []*schemametadata.MetadataNative{},
443
+ Sets: []*schemametadata.MetadataSet{},
444
+ Maps: []*schemametadata.MetadataMap{},
445
+ })
446
+ errors := props.Options.Validate(struct {
447
+ Metadata *schemametadata.MetadataSchema
448
+ Explore MetadataFactory_IExplore
449
+ Top *schemametadata.MetadataSchema
450
+ }{Metadata: metadata, Top: props.Top, Explore: explore})
451
+ if len(errors) != 0 {
452
+ props.Visitor.Errors = append(props.Visitor.Errors, MetadataFactory_IError{
453
+ Name: props.Object.Name,
454
+ Explore: explore,
455
+ Messages: metadataFactory_unique(errors),
456
+ })
457
+ }
458
+ }
459
459
 
460
- for _, property := range props.Object.Properties {
461
- var key any = struct{}{}
462
- if sole := property.Key.GetSoleLiteral(); sole != nil {
463
- key = *sole
464
- }
465
- explore := MetadataFactory_IExplore{
466
- Object: props.Object,
467
- Property: key,
468
- Parameter: nil,
469
- Nested: nil,
470
- Top: false,
471
- Aliased: false,
472
- Escaped: false,
473
- Output: false,
474
- }
475
- MetadataFactory.validateMeta(struct {
476
- Options MetadataFactory_IOptions
477
- Visitor *metadataFactory_IValidationVisitor
478
- Metadata *schemametadata.MetadataSchema
479
- Top *schemametadata.MetadataSchema
480
- Explore MetadataFactory_IExplore
481
- }{Options: props.Options, Visitor: props.Visitor, Metadata: property.Value, Top: props.Top, Explore: explore})
482
- }
460
+ for _, property := range props.Object.Properties {
461
+ var key any = struct{}{}
462
+ if sole := property.Key.GetSoleLiteral(); sole != nil {
463
+ key = *sole
464
+ }
465
+ explore := MetadataFactory_IExplore{
466
+ Object: props.Object,
467
+ Property: key,
468
+ Parameter: nil,
469
+ Nested: nil,
470
+ Top: false,
471
+ Aliased: false,
472
+ Escaped: false,
473
+ Output: false,
474
+ }
475
+ MetadataFactory.validateMeta(struct {
476
+ Options MetadataFactory_IOptions
477
+ Visitor *metadataFactory_IValidationVisitor
478
+ Metadata *schemametadata.MetadataSchema
479
+ Top *schemametadata.MetadataSchema
480
+ Explore MetadataFactory_IExplore
481
+ }{Options: props.Options, Visitor: props.Visitor, Metadata: property.Value, Top: props.Top, Explore: explore})
482
+ }
483
483
  }
484
484
 
485
485
  func (metadataFactoryNamespace) validateFunction(props struct {
486
- Options MetadataFactory_IOptions
487
- Visitor *metadataFactory_IValidationVisitor
488
- Function *schemametadata.MetadataFunction
489
- Explore MetadataFactory_IExplore
490
- Top *schemametadata.MetadataSchema
486
+ Options MetadataFactory_IOptions
487
+ Visitor *metadataFactory_IValidationVisitor
488
+ Function *schemametadata.MetadataFunction
489
+ Explore MetadataFactory_IExplore
490
+ Top *schemametadata.MetadataSchema
491
491
  }) {
492
- if props.Visitor.Functions[props.Function] {
493
- return
494
- }
495
- props.Visitor.Functions[props.Function] = true
496
- for _, param := range props.Function.Parameters {
497
- explore := props.Explore
498
- explore.Parameter = param.Name
499
- explore.Nested = nil
500
- explore.Top = false
501
- explore.Output = false
502
- MetadataFactory.validateMeta(struct {
503
- Options MetadataFactory_IOptions
504
- Visitor *metadataFactory_IValidationVisitor
505
- Metadata *schemametadata.MetadataSchema
506
- Top *schemametadata.MetadataSchema
507
- Explore MetadataFactory_IExplore
508
- }{Options: props.Options, Visitor: props.Visitor, Metadata: param.Type, Top: props.Top, Explore: explore})
509
- }
510
- if props.Function.Output != nil {
511
- explore := props.Explore
512
- explore.Parameter = nil
513
- explore.Nested = nil
514
- explore.Top = false
515
- explore.Output = true
516
- MetadataFactory.validateMeta(struct {
517
- Options MetadataFactory_IOptions
518
- Visitor *metadataFactory_IValidationVisitor
519
- Metadata *schemametadata.MetadataSchema
520
- Top *schemametadata.MetadataSchema
521
- Explore MetadataFactory_IExplore
522
- }{Options: props.Options, Visitor: props.Visitor, Metadata: props.Function.Output, Top: props.Top, Explore: explore})
523
- }
492
+ if props.Visitor.Functions[props.Function] {
493
+ return
494
+ }
495
+ props.Visitor.Functions[props.Function] = true
496
+ for _, param := range props.Function.Parameters {
497
+ explore := props.Explore
498
+ explore.Parameter = param.Name
499
+ explore.Nested = nil
500
+ explore.Top = false
501
+ explore.Output = false
502
+ MetadataFactory.validateMeta(struct {
503
+ Options MetadataFactory_IOptions
504
+ Visitor *metadataFactory_IValidationVisitor
505
+ Metadata *schemametadata.MetadataSchema
506
+ Top *schemametadata.MetadataSchema
507
+ Explore MetadataFactory_IExplore
508
+ }{Options: props.Options, Visitor: props.Visitor, Metadata: param.Type, Top: props.Top, Explore: explore})
509
+ }
510
+ if props.Function.Output != nil {
511
+ explore := props.Explore
512
+ explore.Parameter = nil
513
+ explore.Nested = nil
514
+ explore.Top = false
515
+ explore.Output = true
516
+ MetadataFactory.validateMeta(struct {
517
+ Options MetadataFactory_IOptions
518
+ Visitor *metadataFactory_IValidationVisitor
519
+ Metadata *schemametadata.MetadataSchema
520
+ Top *schemametadata.MetadataSchema
521
+ Explore MetadataFactory_IExplore
522
+ }{Options: props.Options, Visitor: props.Visitor, Metadata: props.Function.Output, Top: props.Top, Explore: explore})
523
+ }
524
524
  }
525
525
 
526
526
  type metadataFactory_IValidationVisitor struct {
527
- Functor MetadataFactory_Validator
528
- Errors []MetadataFactory_IError
529
- Objects map[*schemametadata.MetadataObjectType]bool
530
- Arrays map[*schemametadata.MetadataArrayType]bool
531
- Tuples map[*schemametadata.MetadataTupleType]bool
532
- Aliases map[*schemametadata.MetadataAliasType]bool
533
- Functions map[*schemametadata.MetadataFunction]bool
527
+ Functor MetadataFactory_Validator
528
+ Errors []MetadataFactory_IError
529
+ Objects map[*schemametadata.MetadataObjectType]bool
530
+ Arrays map[*schemametadata.MetadataArrayType]bool
531
+ Tuples map[*schemametadata.MetadataTupleType]bool
532
+ Aliases map[*schemametadata.MetadataAliasType]bool
533
+ Functions map[*schemametadata.MetadataFunction]bool
534
534
  }
535
535
 
536
536
  func metadataFactory_unique(input []string) []string {
537
- visited := map[string]bool{}
538
- output := []string{}
539
- for _, str := range input {
540
- if visited[str] {
541
- continue
542
- }
543
- visited[str] = true
544
- output = append(output, str)
545
- }
546
- return output
537
+ visited := map[string]bool{}
538
+ output := []string{}
539
+ for _, str := range input {
540
+ if visited[str] {
541
+ continue
542
+ }
543
+ visited[str] = true
544
+ output = append(output, str)
545
+ }
546
+ return output
547
547
  }