Closed jods4 closed 3 years ago
A few tests are failing but it seems to me they were failing before and a quick debug of the first test (EnumAtNamespaceLevelGenerationTest
) seems to indicate that the test might just be old/incorrect (for instance in this test, the expected number of 46 enums just doesn't seem right when looking at the codegen).
Hi thanks for this. And yes the EnumAtNamespaceLevelGenerationTest
has faulty logic for the time being, so its safe to ignore.
Fixes #20
The problem was that enums are strings with restrictions in the XSD, and because string is a ref type, this evaluated to false in ClrTypeInfo (514):
So I made sure
ClrTypeInfo
considers enums as value types as well, which only seem to impactClrPropertyInfo
codegen.I did a before/after on the large pain.002.001.03.xsd that I referred to in my bug report.
The only differences are optional / choice enum properties, which now look like this:![image](https://user-images.githubusercontent.com/3832820/106797814-66588100-665d-11eb-8c9b-1f9e4cd0cbeb.png)
This is perfectly in line with the codegen for similar value types such as
DateTime
(unchanged):I'm attaching the schema and a before/after for your convenience. Test.zip