Skip to content

failed to generate code when defined components/requestBodies have multiple content types #1881

Closed

Description

@ibbema

Generating code with components/requestBodies xtype which have multiple content types are failing with
error generating code for type definitions: duplicate typename xtype

providing example here server-types and openapi spec in attachment
running command
oapi-codegen -config server-types.yaml patch-me-api.yaml
give me error
error generating code: error generating type definitions: error generating code for type definitions: duplicate typename 'AddressRequest' detected, can't auto-rename, please use x-go-name to specify your own name for one of them

exampefiles.zip

Activity

  1. mromaszewicz commented on Mar 2, 2026

    @mromaszewicz
    Member

    This was addressed in #2213, please enable name conflict resolution via the output options and file a new issue if it doesn't work for you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions