{"record":{"id":"f3c88d36d25da2e4","repo":"BoundaryML/baml","slug":"output-definitions-first-and-second-both-render-as-rendered","errorCode":null,"errorMessage":"Output definitions '{first}' and '{second}' both render as '{rendered_name}' in the output schema","messagePattern":"Output definitions '(.+?)' and '(.+?)' both render as '(.+?)' in the output schema","errorType":"exception","errorClass":"RenderError","httpStatus":null,"severity":"error","filePath":"baml_language/crates/sys_ops/src/output_format.rs","lineNumber":25,"sourceCode":"\n/// Error type for output format rendering.\n#[derive(Clone, Debug, Error)]\npub enum RenderError {\n    #[error(\"Enum '{0}' not found\")]\n    EnumNotFound(String),\n    #[error(\"Class '{0}' not found\")]\n    ClassNotFound(String),\n    #[error(\"Type '{0}' is not supported in outputs\")]\n    UnsupportedType(String),\n    #[error(\n        \"Non-regular recursive generic class '{class}' expands from '{ancestor}' to '{instantiation}'\"\n    )]\n    NonRegularRecursiveGeneric {\n        class: String,\n        ancestor: String,\n        instantiation: String,\n    },\n    #[error(\n        \"Output definitions '{first}' and '{second}' both render as '{rendered_name}' in the output schema\"\n    )]\n    RenderedClassNameCollision {\n        rendered_name: String,\n        first: String,\n        second: String,\n    },\n    #[error(\n        \"Output definitions '{first}' and '{second}' both render as '{rendered_name}' in the output schema\"\n    )]\n    RenderedEnumNameCollision {\n        rendered_name: String,\n        first: String,\n        second: String,\n    },\n    #[error(\n        \"Type alias definitions for '{rendered_name}' have non-equivalent targets '{first}' and '{second}'\"\n    )]","sourceCodeStart":7,"sourceCodeEnd":43,"githubUrl":"https://github.com/BoundaryML/baml/blob/bd85ce9dee1463ff04d27efd20531013a4ff46c1/baml_language/crates/sys_ops/src/output_format.rs#L7-L43","documentation":"Two BAML class definitions render to the same name in the generated output schema, so the schema would contain two types with one identifier. The output formatter detects the collision while assigning rendered names and refuses to emit an ambiguous schema.","triggerScenarios":"Calling the output-schema generation with two distinct classes whose rendered (renamed/shortened) names normalize to the same string; raised via OutputFormatError::RenderedClassNameCollision.","commonSituations":"Renaming or prefix-stripping logic collapsing distinct class names; two classes differing only in case or module prefix; generated schema merging multiple blocks whose classes alias to one name.","solutions":["Rename one of the conflicting classes so rendered names differ","Adjust the naming/rendering configuration (prefixes, aliases) so the two classes no longer collide","Merge the two classes if they are semantically duplicate"],"exampleFix":"// before\nclass Address { ... }\nclass address { ... }\n// after\nclass ShippingAddress { ... }\nclass BillingAddress { ... }","handlingStrategy":"validation","validationCode":"let names: Vec<_> = classes.iter().map(rendered_name).collect();\nassert_unique(&names)?; // fail fast before schema generation","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Enforce unique class names modulo rendering rules","Avoid names differing only by case/prefix","Lint schema blocks for duplicate rendered names in CI"],"tags":["baml","schema","naming-collision"],"backgroundTag":"conflicting-config-options","analyzedSha":"bd85ce9dee1463ff04d27efd20531013a4ff46c1","analyzedAt":"2026-09-12T03:38:25.718Z","contentChangedAt":"2026-09-12T03:38:25.718Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}