@@ -176,50 +176,50 @@ func NewSchema(schema *base.Schema) *Schema {
176176 s .UniqueItems = & schema .UniqueItems .Value
177177 }
178178 if ! schema .Contains .IsEmpty () {
179- s .Contains = & SchemaProxy { schema : & lowmodel.NodeReference [* base.SchemaProxy ]{
179+ s .Contains = NewSchemaProxy ( & lowmodel.NodeReference [* base.SchemaProxy ]{
180180 ValueNode : schema .Contains .ValueNode ,
181181 Value : schema .Contains .Value ,
182- }}
182+ })
183183 }
184184 if ! schema .If .IsEmpty () {
185- s .If = & SchemaProxy { schema : & lowmodel.NodeReference [* base.SchemaProxy ]{
185+ s .If = NewSchemaProxy ( & lowmodel.NodeReference [* base.SchemaProxy ]{
186186 ValueNode : schema .If .ValueNode ,
187187 Value : schema .If .Value ,
188- }}
188+ })
189189 }
190190 if ! schema .Else .IsEmpty () {
191- s .Else = & SchemaProxy { schema : & lowmodel.NodeReference [* base.SchemaProxy ]{
191+ s .Else = NewSchemaProxy ( & lowmodel.NodeReference [* base.SchemaProxy ]{
192192 ValueNode : schema .Else .ValueNode ,
193193 Value : schema .Else .Value ,
194- }}
194+ })
195195 }
196196 if ! schema .Then .IsEmpty () {
197- s .Then = & SchemaProxy { schema : & lowmodel.NodeReference [* base.SchemaProxy ]{
197+ s .Then = NewSchemaProxy ( & lowmodel.NodeReference [* base.SchemaProxy ]{
198198 ValueNode : schema .Then .ValueNode ,
199199 Value : schema .Then .Value ,
200- }}
200+ })
201201 }
202202 if ! schema .PropertyNames .IsEmpty () {
203- s .PropertyNames = & SchemaProxy { schema : & lowmodel.NodeReference [* base.SchemaProxy ]{
203+ s .PropertyNames = NewSchemaProxy ( & lowmodel.NodeReference [* base.SchemaProxy ]{
204204 ValueNode : schema .PropertyNames .ValueNode ,
205205 Value : schema .PropertyNames .Value ,
206- }}
206+ })
207207 }
208208 if ! schema .UnevaluatedItems .IsEmpty () {
209- s .UnevaluatedItems = & SchemaProxy { schema : & lowmodel.NodeReference [* base.SchemaProxy ]{
209+ s .UnevaluatedItems = NewSchemaProxy ( & lowmodel.NodeReference [* base.SchemaProxy ]{
210210 ValueNode : schema .UnevaluatedItems .ValueNode ,
211211 Value : schema .UnevaluatedItems .Value ,
212- }}
212+ })
213213 }
214214 // check if unevaluated properties is a schema
215215 if ! schema .UnevaluatedProperties .IsEmpty () && schema .UnevaluatedProperties .Value .IsA () {
216216 s .UnevaluatedProperties = & DynamicValue [* SchemaProxy , * bool ]{
217- A : & SchemaProxy {
218- schema : & lowmodel.NodeReference [* base.SchemaProxy ]{
217+ A : NewSchemaProxy (
218+ & lowmodel.NodeReference [* base.SchemaProxy ]{
219219 ValueNode : schema .UnevaluatedProperties .ValueNode ,
220220 Value : schema .UnevaluatedProperties .Value .A ,
221221 },
222- } ,
222+ ) ,
223223 N : 0 ,
224224 }
225225 }
@@ -325,11 +325,11 @@ func NewSchema(schema *base.Schema) *Schema {
325325
326326 // for every item, build schema async
327327 buildSchema := func (sch lowmodel.ValueReference [* base.SchemaProxy ], idx int , bChan chan buildResult ) {
328- p := & SchemaProxy { schema : & lowmodel.NodeReference [* base.SchemaProxy ]{
328+ p := NewSchemaProxy ( & lowmodel.NodeReference [* base.SchemaProxy ]{
329329 ValueNode : sch .ValueNode ,
330330 Value : sch .Value ,
331331 Reference : sch .GetReference (),
332- }}
332+ })
333333
334334 bChan <- buildResult {idx : idx , s : p }
335335 }
@@ -358,13 +358,12 @@ func NewSchema(schema *base.Schema) *Schema {
358358 buildProps := func (k lowmodel.KeyReference [string ], v lowmodel.ValueReference [* base.SchemaProxy ],
359359 props map [string ]* SchemaProxy , sw int ,
360360 ) {
361- props [k .Value ] = & SchemaProxy {
362- schema : & lowmodel.NodeReference [* base.SchemaProxy ]{
363- Value : v .Value ,
364- KeyNode : k .KeyNode ,
365- ValueNode : v .ValueNode ,
366- },
367- }
361+ props [k .Value ] = NewSchemaProxy (& lowmodel.NodeReference [* base.SchemaProxy ]{
362+ Value : v .Value ,
363+ KeyNode : k .KeyNode ,
364+ ValueNode : v .ValueNode ,
365+ },
366+ )
368367
369368 switch sw {
370369 case 0 :
@@ -418,11 +417,13 @@ func NewSchema(schema *base.Schema) *Schema {
418417 }
419418 if ! schema .Items .IsEmpty () {
420419 if schema .Items .Value .IsA () {
421- items = & DynamicValue [* SchemaProxy , bool ]{A : & SchemaProxy {schema : & lowmodel.NodeReference [* base.SchemaProxy ]{
422- ValueNode : schema .Items .ValueNode ,
423- Value : schema .Items .Value .A ,
424- KeyNode : schema .Items .KeyNode ,
425- }}}
420+ items = & DynamicValue [* SchemaProxy , bool ]{
421+ A : NewSchemaProxy (& lowmodel.NodeReference [* base.SchemaProxy ]{
422+ ValueNode : schema .Items .ValueNode ,
423+ Value : schema .Items .Value .A ,
424+ KeyNode : schema .Items .KeyNode ,
425+ },
426+ )}
426427 } else {
427428 items = & DynamicValue [* SchemaProxy , bool ]{N : 1 , B : schema .Items .Value .B }
428429 }
0 commit comments