Skip to content

Commit ab1c566

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 ab1c566

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

pkg/generator/schema_generator.go

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

595+
tags := ""
596+
for _, tag := range g.config.Tags {
597+
tags += fmt.Sprintf(`%s:"-" `, tag)
598+
}
595599
structType.AddField(
596600
codegen.StructField{
597601
Name: "AdditionalProperties",
598602
DefaultValue: defaultValue,
599603
SchemaType: &schemas.Type{},
600604
Type: fieldType,
605+
Tags: tags,
601606
},
602607
)
603608
}

0 commit comments

Comments
 (0)