Skip to content

Commit 618e106

Browse files
committed
feat: add struct tags to AdditionalProperties
As noted in #242, we are missing the `-` tag which allows picking up the additional properties in i.e. a JSON object. Closes #242.
1 parent d5d9fa3 commit 618e106

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

pkg/generator/schema_generator.go

+6
Original file line numberDiff line numberDiff line change
@@ -592,12 +592,18 @@ func (g *schemaGenerator) generateStructType(
592592
}
593593
}
594594

595+
tags := ""
596+
for _, tag := range g.config.Tags {
597+
tags += fmt.Sprintf(`%s:"-" `, tag)
598+
}
599+
595600
structType.AddField(
596601
codegen.StructField{
597602
Name: "AdditionalProperties",
598603
DefaultValue: defaultValue,
599604
SchemaType: &schemas.Type{},
600605
Type: fieldType,
606+
Tags: tags,
601607
},
602608
)
603609
}

0 commit comments

Comments
 (0)