Skip to content

Conversation

@dompagoj
Copy link

@dompagoj dompagoj commented Dec 9, 2025

Adds a configuration parameter for the generated ContentType enum to avoid name clashing when the openapi schema already has a type called ContentType, this results in the generated enum called ContentType and an interface of the same name, which is a compile error in typescript


Note

Introduce configurable contentTypeEnumName and update templates to use it, preventing enum/name clashes.

  • Config:
    • Add config.contentTypeEnumName (default: "ContentType") in src/configuration.ts.
  • Templates:
    • Replace hardcoded ContentType with config.contentTypeEnumName in templates/base/http-clients/axios-http-client.ejs and fetch-http-client.ejs (enum declaration, request param type, formatters, header handling).
    • Update templates/default/procedure-call.ejs and templates/modular/procedure-call.ejs to reference the configurable enum when setting request type.
  • Types:
    • Extend GenerateApiConfiguration["config"] with contentTypeEnumName in types/index.ts (with JSDoc/default).
  • Changeset:
    • Add patch changeset describing the new configuration option.

Written by Cursor Bugbot for commit 667c8a3. This will update automatically on new commits. Configure here.

@changeset-bot
Copy link

changeset-bot bot commented Dec 9, 2025

🦋 Changeset detected

Latest commit: 667c8a3

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
swagger-typescript-api Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@smorimoto
Copy link
Collaborator

bugbot run

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no bugs!


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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants