Skip to content

Generation crashes on dotted/hyphenated names; --mcp emits nothing; generated package doesn't import (findings from real-world specs) #1

Open

Description

@kinlane

Hi Samuel! Kin Lane here, from API Evangelist / APIs.io.

What this work is. The same as on cdd-ts: APIs.io is adding SDK and MCP generation from a user's API stack, powered by Offscale. We build-check every package before delivering it. These are from cdd-python-all at 5259b4e (v0.0.5), run as cdd-python-all from_openapi to_sdk -i <spec.json> -o <dir> [--mcp] on slices of live Twilio, Stripe, GitHub, Adyen and Shopify specs.

1. Crash on schema and tag names that aren't Python identifiers. It succeeded on 2 of 5 slices. The other three crash in libcst:

libcst._nodes.base.CSTValidationError: Name 'messaging.v1.brand_registrations' is not a valid identifier.
libcst._nodes.base.CSTValidationError: Name 'test_helpers.test_clock' is not a valid identifier.
libcst._nodes.base.CSTValidationError: Name 'actions-cache-retention-limit-for-enterprise' is not a valid identifier.

Dotted and hyphenated component names are very common in published specs (Twilio, Stripe and GitHub all use them), so sanitising names to identifiers would unblock most of our catalog.

2. --mcp produces no MCP server. With and without --mcp, the output is the same apart from pyproject.toml. No MCP module is emitted.

3. The generated package doesn't import as packaged. src/client.py does from models import *, but pyproject.toml builds packages = ["src"]. Installed, it's src.client, and import src.client fails with No module named 'models'. It only works with src itself on sys.path (as the pytest config sets it). A relative import (from .models import *) or a named package directory would fix it. Also, [project.urls] points at github.com/offscale/<generated-name>, which doesn't exist.

4. Input and packaging details.

  • YAML input is rejected (Invalid OpenAPI JSON), even though the README describes OpenAPI and Swagger generally. Most published specs are YAML.
  • pyproject.toml says requires-python >=3.9, but arazzo/parse.py uses OpenAPI | Arazzo at runtime, which needs 3.10+. Under 3.9 the import fails with unsupported operand type(s) for |.

We're glad to send PRs or share the test slices. We'll keep re-running against new commits.

Kin Lane, API Evangelist / APIs.io

Activity

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions