Skip to content

Calendly spec breaks generated CLI (string escaping + auth block + param mapping) #1

@kesslerio

Description

@kesslerio

Hey! I ran openapi2cli against Calendly’s OpenAPI spec and hit a few generator bugs.

Spec:
https://raw.githubusercontent.com/robomotionio/openapi-specs/master/calendly.json

Environment:

  • openapi2cli: 1.0.0
  • Python: 3.12.12
  • OS: Linux (NixOS)

Repro:

uvx openapi2cli generate https://raw.githubusercontent.com/robomotionio/openapi-specs/master/calendly.json --name calendly_openapi --output calendly_openapi.py
python calendly_openapi.py --help

What I saw:

  1. SyntaxError in generated @click.option(... help="...") when descriptions include quotes/newlines.
  2. IndentationError in get_auth_headers() when template emits an empty elif key: block.
  3. Param mapping issues from heuristics:
    • query params get converted to kebab-case keys (invitee-email) instead of OpenAPI names (invitee_email)
    • path param routing depends on "id" in the name, which misses params like uuid

Expected behavior:

  • generated CLI should compile reliably
  • help text should be safely escaped
  • params should map by OpenAPI location + original name

I prepared a PR with fixes + tests and will link it here.

Cheers, Art

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions