Skip to content

log4j-docgen: Set all attributes type as union of their strict type and String #136

@ppkarwasz

Description

@ppkarwasz

As suggested by @krallus in apache/logging-log4j2#1441 (comment) we can use unions of types to allow any string in attributes and still benefit from IDE suggestions.

For example:

	<xs:simpleType name="levelOrSubstitution">
		<xs:union>
			<xs:simpleType>
				<xs:restriction base="xs:string">
					<xs:enumeration value="TRACE" />
					<xs:enumeration value="DEBUG" />
					<xs:enumeration value="INFO" />
					<xs:enumeration value="WARN" />
				</xs:restriction>
			</xs:simpleType>
			<xs:simpleType>
				<xs:restriction base="xs:string">
					<xs:pattern value=".+" />
				</xs:restriction>
			</xs:simpleType>
		</xs:union>
	</xs:simpleType>

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions