Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

since version 2.0.894 enum is incorrected #421

Open
dlasvazi opened this issue Oct 12, 2023 · 3 comments
Open

since version 2.0.894 enum is incorrected #421

dlasvazi opened this issue Oct 12, 2023 · 3 comments

Comments

@dlasvazi
Copy link

dlasvazi commented Oct 12, 2023

Version 2.0.878

/// <summary>
/// <para>Исключительные права на результат интеллектуальной деятельности</para>
/// </summary>
[System.ComponentModel.DescriptionAttribute("Исключительные права на результат интеллектуальной деятельности")]
[System.Xml.Serialization.XmlEnumAttribute("11")]
Item11,

/// <summary>
/// <para>Произведение науки, литературы или искусства</para>
/// </summary>
[System.ComponentModel.DescriptionAttribute("Произведение науки, литературы или искусства")]
[System.Xml.Serialization.XmlEnumAttribute("11.1")]
Item11Period1,

Version > 2.0.878

/// <summary>
/// <para>Исключительные права на результат интеллектуальной деятельности</para>
/// </summary>
[System.ComponentModel.DescriptionAttribute("Исключительные права на результат интеллектуальной деятельности")]
[System.Xml.Serialization.XmlEnumAttribute("11")]
Item111,

/// <summary>
/// <para>Произведение науки, литературы или искусства</para>
/// </summary>
[System.ComponentModel.DescriptionAttribute("Произведение науки, литературы или искусства")]
[System.Xml.Serialization.XmlEnumAttribute("11.1")]
Item111,

enum with xml attribute 11 and 11.1 was value Item111

xsd

<xs:enumeration value="11">
  <xs:annotation>
    <xs:documentation>Исключительные права на результат интеллектуальной деятельности</xs:documentation>
  </xs:annotation>
</xs:enumeration>
<xs:enumeration value="11.1">
  <xs:annotation>
    <xs:documentation>Произведение науки, литературы или искусства</xs:documentation>
  </xs:annotation>
</xs:enumeration>
@dlasvazi dlasvazi changed the title since version 2.0.878 enum is incorrected since version 2.0.894 enum is incorrected Oct 12, 2023
@mganss
Copy link
Owner

mganss commented Oct 12, 2023

I think this is due to #413. Sorry for the confusion. This is just a naming issue, not a functional one, right?

@dlasvazi
Copy link
Author

Yeah! Value '11' converted into Item111 enum name and Value '11.1' is converted into Item111 enum
and there is conflict in c# code

@mganss
Copy link
Owner

mganss commented Oct 13, 2023

Using the following as the whole XSD I'm unable to repro:

<xs:simpleType name="EnumTest">
<xs:restriction base="xs:string">
	<xs:enumeration value="11">
		<xs:annotation>
			<xs:documentation>Исключительные права на результат интеллектуальной деятельности</xs:documentation>
		</xs:annotation>
	</xs:enumeration>
	<xs:enumeration value="11.1">
		<xs:annotation>
			<xs:documentation>Произведение науки, литературы или искусства</xs:documentation>
		</xs:annotation>
	</xs:enumeration>
</xs:restriction>
</xs:simpleType>

I suspect that in your XSD there is another enum value that gets the name Item11 which causes the enum member for "11" to get a "1" added to the end which in turn conflicts with Item111 for "11.1". Can you share all of the enum members in your XSD?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants