Skip to content

Key examples/operation-map.json by spec operationId (camelCase) like the other SDKs #406

Open

Description

@jwulf

Summary

Key examples/operation-map.json by the spec operationId (camelCase), like the other six orchestration-cluster-api-* SDKs, instead of the snake_case method name.

Why

Every SDK publishes examples/operation-map.json with the same shape, { <key>: [{ file, region, label }] }. Six of them key it by the OpenAPI operationId:

SDK Key example
csharp, js, go, rust, java, php activateAdHocSubProcessActivities
python activate_ad_hoc_sub_process_activities

camunda/api-test-generator is moving to consume the SDK-published maps directly (camunda/api-test-generator#812, option B), looked up by spec operationId. With snake_case keys, no Python lookup matches, so the Python map can't be used as-is, and every consumer has to know a Python-specific naming rule.

What changes

  1. examples/operation-map.json: rename every key from the snake_case method name to its spec operationId. The entries (file, region, label) stay the same. A one-off script can do this from the bundled spec. Don't reverse _to_snake_case, because not every name round-trips.
  2. scripts/check_example_coverage.py: compare op["operationId"] with the map keys directly and drop the _to_snake_case lookup (lines ~16, 66–67).
  3. hooks/post_gen/1350_inject_examples.py: it currently looks up operation_map[method_node.name] (lines ~125, 143). Resolve each generated method back to its operationId (for example from the generator's operation metadata, or a reverse index built with the same _to_snake_case once at load), and then look up by that.
  4. scripts/check_method_example_completeness.py, AGENTS.md and .github/prompts/add-missing-examples.prompt.md: update any key-format wording or lookups to match.
  5. Optional: add a guard that fails if a map key isn't a spec operationId, so the format can't drift back.

Reference implementation

camunda/orchestration-cluster-api-csharp is the reference:

Acceptance

  • Every key in examples/operation-map.json is a spec operationId, and there are still 247 entries.
  • The coverage check passes in CI without a snake_case conversion.
  • The generated docstrings still contain the same injected examples. A diff of the generated output before and after shows no example lost.

Activity

  1. rahulsjha commented on Nov 21, 2026

    @rahulsjha

    Hi @jwulf, I'd like to work on this. I'd key examples/operation-map.json by the spec operationId (camelCase) like the other six SDKs, and update the generator and its tests. Okay if I pick it up?

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions