Skip to content

python-type-codegen does not generate models from shapes #559

Description

@nemec

When I use the python-type-codegen plugin with the echo sample it does not generate any models at all (whereas python-client-codegen seems to work fine for the same model)

smithy-build.json:

{
    "version": "1.0",
    "sources": ["model"],
    "maven": {
        "dependencies": [
            "software.amazon.smithy:smithy-model:[1.54.0,2.0)",
            "software.amazon.smithy:smithy-aws-traits:[1.54.0,2.0)",
            "software.amazon.smithy.python.codegen:core:0.0.1",
            "software.amazon.smithy.python.codegen.plugins:types:0.0.1"
        ]
    },
    "projections": {
        "client": {
            "plugins": {
                "python-client-codegen": {
                    "service": "com.example#EchoService",
                    "module": "echo",
                    "moduleVersion": "0.0.1"
                },
                "python-type-codegen": {
                    "service": "com.example#EchoService",
                    "module": "echo",
                    "moduleVersion": "0.0.1"
                }
            }
        }
    }
}

model/main.smithy:

$version: "2.0"

namespace com.example

use aws.protocols#restJson1

@restJson1
service EchoService {
    version: "2025-09-01"
    operations: [EchoMessage]
}

@http(uri: "/echo", method: "POST")
operation EchoMessage {
    input := {
        message: String
    }
    output := {
        message: String
    }
}

contents of model/build/smithy/client/python-type-codegen/src/echo/models.py:

# Code generated by smithy-python-codegen DO NOT EDIT.

from smithy_core.exceptions import ModeledError


class ServiceError(ModeledError):
    """Base error for all errors in the service.

    Some exceptions do not extend from this class, including
    synthetic, implicit, and shared exception types.
    """

Is there something I'm missing?

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