Skip to content

Axum handler support #1

@kwkelly

Description

@kwkelly

Firstly, this is an excellent project and I appreciate it being open sourced.

I am wondering if there would be any interest in accepting a PR adding support for generation of a trait for Axum handlers. The idea is that this tool gets run against an OpenAPI spec and the trait is generated, then a user implements the trait. This guarantees that the path params, query params, body, return payload all match the spec. Users benefit from not having to hand write all the structs and enums for the API layer (relying heavily on existing code here), though they don't save a ton on eliminated boilerplate for trait implementation.

The idea is based on oapi-codegen which does the same thing, but for Go.

I have a fork/branch with a basic implementation here. A lot is snapshots and examples so don't be too alarmed by the diff size

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