When ASP.NET generates OpenAPI schema names, it uses only the class name by default, which causes conflicts when multiple classes share the same name across different namespaces. The fix is to customize the `CreateSchemaReferenceId` option so that schema names include the full namespace, ensuring uniqueness in the generated OpenAPI document and preventing issues with code generation tools.

2m read timeFrom timdeschryver.dev
Post cover image
Table of contents
Setting up OpenAPI in ASP.NETNaming Conflicts in OpenAPI SchemasResolving Naming Conflicts using CreateSchemaReferenceId