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

Imported namespace conflicts with a target namespace #1075

Closed
navozenko opened this issue Jul 9, 2024 · 0 comments · Fixed by #1076
Closed

Imported namespace conflicts with a target namespace #1075

navozenko opened this issue Jul 9, 2024 · 0 comments · Fixed by #1076

Comments

@navozenko
Copy link
Contributor

navozenko commented Jul 9, 2024

Hi. I found a problem with schema generation for arrays of system types. In the resulting schema, the name of the targetNamespace is the same as the name of one of the imported namespaces. This causes a validation error in some applications.

<xs:schema elementFormDefault="qualified"
           targetNamespace="http://schemas.datacontract.org/2004/07/System"
           xmlns:xs="http://www.w3.org/2001/XMLSchema"
           xmlns:tns="http://schemas.datacontract.org/2004/07/System"
           xmlns:ser="http://schemas.microsoft.com/2003/10/Serialization/">
  <xs:import namespace="http://schemas.datacontract.org/2004/07/System" />
  <xs:import namespace="http://schemas.microsoft.com/2003/10/Serialization/Arrays" />
  <xs:complexType name="ArrayOfByte" xmlns:ser="http://schemas.microsoft.com/2003/10/Serialization/">
    <xs:sequence>...</xs:sequence>
  </xs:complexType>
  ...
</xs:schema>

Could we disable namespace import if it matches the targetNamespace?
I made a pull-request #1076

@navozenko navozenko changed the title Imported namespace is same as a target namespace Imported namespace conflicts with a target namespace Jul 10, 2024
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

Successfully merging a pull request may close this issue.

1 participant