Skip to content

Fix consecutive-acronym handling in generated examples - #3766

Open
pdv wants to merge 1 commit into
masterfrom
pdv/consecutive-acronyms
Open

Fix consecutive-acronym handling in generated examples#3766
pdv wants to merge 1 commit into
masterfrom
pdv/consecutive-acronyms

Conversation

@pdv

@pdv pdv commented Apr 27, 2026

Copy link
Copy Markdown

Summary

Fixes broken imports/references in generated examples when an OpenAPI tag contains consecutive acronyms (e.g. Bits AI SRE).

The library class (BitsAiSreApi) generates correctly because the per-language pipeline goes raw-tag → snake → camel. But the example template re-camel_cased the spaceless form BitsAISRE (set in conftest from the BDD .feature file) which produced BitsAisreApi.

Changes:

  • templates/example.j2: use raw_tag|camel_case|upperfirst instead of name|camel_case|upperfirst (5 sites, 6 occurrences).
  • .generator/conftest.py: stash the raw tag in context["api_instance"] so the template can use it.

Behavior is unchanged for any tag without consecutive acronyms.

Test plan

  • Renamed Bits AIBits AI SRE in .generator/schemas/v2/openapi.yaml and ran ./generate.sh.

Links

@github-actions

Copy link
Copy Markdown

This PR has been automatically marked as stale because it has not had activity in the last 30 days.
If there is no activity for another 90 days, this issue will be automatically closed.

@github-actions github-actions Bot added the stale Stale - Bot reminder label May 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog/no-changelog Changes don't appear in changelog stale Stale - Bot reminder

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant