Introspections
Utility object for annotation-based introspection, providing methods to process annotations for descriptions, ignore markers, and name overrides.
This object provides a configurable mechanism for recognizing annotations from multiple frameworks (kotlinx-schema, Jackson, LangChain4j, Koog, kotlinx.serialization, etc.) Configuration is loaded from kotlinx-schema.properties on the classpath.
Annotation name matching
Annotation names are matched in two ways depending on the configured name format:
Simple names (no dots): Matched case-insensitively against the annotation's simple name. Example:
"Description"matches@Description,@description,@DESCRIPTION.Fully qualified names (contains dots): Matched case-sensitively against the annotation's qualified name. Example:
"kotlinx.serialization.SerialName"matches only@kotlinx.serialization.SerialName, not a different@SerialNamefrom another package.
Configuration
The annotation detection behavior is controlled by properties in kotlinx-schema.properties:
introspector.annotations.description.names: Comma-separated list of annotation names to recognize as description providers (e.g., "Description,LLMDescription,P")introspector.annotations.description.attributes: Comma-separated list of annotation parameter names that contain description text (e.g., "value,description")introspector.annotations.ignore.names: Comma-separated list of annotation names to recognize as ignore markers (e.g., "SchemaIgnore,JsonIgnoreType")introspector.annotations.name.names: Comma-separated list of annotation names to recognize as name-override providers (e.g., "kotlinx.serialization.SerialName")introspector.annotations.name.attributes: Comma-separated list of annotation parameter names that contain name-override text (e.g., "value")
Customizing Configuration
To add support for custom annotations, create kotlinx-schema.properties in your project's src/main/resources/ directory (or src/commonMain/resources/ for multiplatform projects):
introspector.annotations.description.names=Description,MyCustomDescription
introspector.annotations.description.attributes=value,description,textYour project's properties file will take precedence over the library's default configuration.