What problem does it solve?
This Skill resolves the issue of redundant Java classes generated by TypeSpec that duplicate models already present in the openai-java library, preventing code bloat and simplifying maintenance.
Core Features & Use Cases
- Model Suppression: Identifies and suppresses generated Java classes that are structurally identical to
openai-java models.
- Type Mapping: Uses TypeSpec's
@@alternateType directive to map generated types to their openai-java equivalents, ensuring correct serialization and deserialization.
- Serialization Bridging: Provides helper methods (
OpenAIJsonHelper) to correctly serialize and deserialize openai-java objects, bypassing Jackson's limitations with Kotlin internals.
- Use Case: When generating an Azure SDK client that interacts with OpenAI APIs, this skill ensures that you don't generate duplicate model classes for common OpenAI entities like
Reasoning or ComparisonFilter, instead leveraging the existing openai-java library.
Quick Start
Use the dedup-openai skill after dup-classes has identified actionable duplicates to suppress generated Java classes and bridge to openai-java equivalents.