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

Interface definitions are duplicated #501

Closed
dtila opened this issue Mar 29, 2024 · 1 comment
Closed

Interface definitions are duplicated #501

dtila opened this issue Mar 29, 2024 · 1 comment

Comments

@dtila
Copy link

dtila commented Mar 29, 2024

Hi,

I am using the following XSD schemas: https://op.europa.eu/documents/3938058/6560998/TED_publication_R2.0.9.S01.E01_019-20160603.zip/647c626b-72e7-9fe9-2561-87074fe0b327

When I execute
xscgen -n Test .\TED_EXPORT.xsd
I get the following error in the compiler:

image

Trying to figure it out the issue, it seems when interface generation is enabled, a member with the same name has 2 types:

interface definition:

      [System.ComponentModel.DataAnnotations.RegularExpressionAttribute("(19|20).{8}")]
      System.Collections.ObjectModel.Collection<System.DateTime> DateEnd
      {
          get;
      }

class definition (that implements the interface)

public System.DateTime DateEnd { get; set; }

If interface generation is disabled, the code is generated successfully.
I suspect there could be a bug either in XSD or in the tool.

Regards,

@mganss
Copy link
Owner

mganss commented Apr 12, 2024

This is similar to #475. A similar issue also arises with nullable vs non-nullable types that are not aligned between the interface definition and implementing classes. I've introduced a hacky fix for both issues by forcibly aligning the interface and class definitions.

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