GoComply / xsd2go

Automatically generate golang xml parser based on XSD
http://isimluk.com/posts/2020/05/xsd2go-automatically-generate-golang-xml-parsers/
The Unlicense
74 stars 44 forks source link

More extensive use of omitempty #118

Open skoczko opened 6 months ago

skoczko commented 6 months ago

Add "omitempty" for attributes where "use" is empty (as it defaults to "optional" per XSD spec). Add "omitempty" for elements where minOccurs=0 Minor cleanups in the Makefile, add targets to generate schema for XML testing. Add XML un/marshal test for the example schemas: namespace changes in the test schemas are merely to avoid collisions when pre-generating Go structs. Only one test for "complex" added, more can be added later.

skoczko commented 6 months ago

@isimluk any chance to get this reviewed? This is especially problematic when the schema includes optional datetime elements for which "empty" is not a correct value.