Skip to content

Fix consecutive-acronym handling in generated examples - #1530

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

Fix consecutive-acronym handling in generated examples#1530
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 in generated examples when an OpenAPI tag contains consecutive acronyms (e.g. Bits AI SRE).

The library file (api_bits_ai_sre.rs) generates correctly because cli.py snake_cases the raw tag. But the example template re-snake_cased the spaceless form BitsAISRE (set in conftest from the BDD .feature file), which produced api_bits_aisre.

Changes:

  • templates/example.j2: snake_case the raw tag (raw_tag) instead of the spaceless name, in both the format_parameters(api=…) call and the use import.
  • .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 label Jun 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant