Skip to content

Fix consecutive-acronym handling in generated examples#1530

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

Fix consecutive-acronym handling in generated examples#1530
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 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

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