You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "ppkarwasz (via GitHub)" <gi...@apache.org> on 2024/08/09 06:24:48 UTC

[I] log4j-docgen: Set all attributes type as union of their strict type and String [logging-log4j-tools]

ppkarwasz opened a new issue, #136:
URL: https://github.com/apache/logging-log4j-tools/issues/136

   As suggested by @krallus in https://github.com/apache/logging-log4j2/pull/1441#issuecomment-2276619307 we can use unions of types to allow any string in attributes and still benefit from IDE suggestions.
   
   For example:
   
   ```xml
   	<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>
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@logging.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org