Skip to content

MID-10558 Avoid JAXB namespace imports in schema XSD#13

Open
kay1313 wants to merge 1 commit into
masterfrom
fix/MID-10558
Open

MID-10558 Avoid JAXB namespace imports in schema XSD#13
kay1313 wants to merge 1 commit into
masterfrom
fix/MID-10558

Conversation

@kay1313
Copy link
Copy Markdown
Contributor

@kay1313 kay1313 commented May 26, 2026

Summary

Fixes unnecessary XmlEntityResolverImpl errors when schemas with enumeration definitions are serialized and parsed.

Enum schema serialization intentionally emits JAXB customization annotations, such as jaxb:typesafeEnumClass and jaxb:typesafeEnumMember. These annotations are valid inside xsd:annotation/xsd:appinfo, but their namespace should not be emitted as an XSD import.

Before this change, the serializer generated an unnecessary import:

<xsd:import namespace="https://jakarta.ee/xml/ns/jaxb"/>

This made schema parsing try to resolve the Jakarta JAXB namespace as an external schema, producing log errors like:

Unable to resolve entity with publicID: https://jakarta.ee/xml/ns/jaxb
Unable to resolve resource of type http://www.w3.org/2001/XMLSchema, namespaceURI: https://jakarta.ee/xml/ns/jaxb

Changes

  • Added handling for non-importable schema namespaces used only in annotations/customizations.
  • Updated schema serialization so JAXB customization namespaces are not added to generated XSD imports.

JAXB customization namespaces may be used in generated schema
annotations, but they should not be emitted as schema imports.

Skip known non-importable customization namespaces when collecting
schema imports, so generated schemas no longer contain unnecessary JAXB
imports that later trigger resolver errors.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant