Skip to content

Fix consecutive-acronym handling in generated examples#3766

Open
pdv wants to merge 1 commit intomasterfrom
pdv/consecutive-acronyms
Open

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

Conversation

@pdv
Copy link
Copy Markdown

@pdv pdv commented Apr 27, 2026

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

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant