Skip to content

Add support for path custom type conversion #539

@SentryMan

Description

@SentryMan

From the discord:

image

I'm thinking we could make it so that:

@Get("/something")
public void getMetadata(@QueryParam("id") Foo foo) {
  //
}

could generate something like:

    var id = asType(ctx.pathParam("id"), Foo::new);
    var result = controller.getMetadata(id);

Where asType would be a new method added that takes a reference to a constructor/valueOf method

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions