API Designer/swagger generation: Distinct description for every method

I wonder if there's a way to tell the generation process to use a description per HTTP method, not (only) per endpoint

Example:

builder.AddMethod(
    Method.Define("test")
        .Handle<TestData>("PUT", (t, r) => { })
        .Handle<TestData>("PATCH", (t, r) => { })
        .Handle("DELETE", r => { })
);

I want to have a description for PUT /test, one for PATCH /test and completly different description for DELETE /test here.

But I'm only able to find a global WithDescription() to set a value for the whole endpoint. What am I missing?

  • Hi Wolfgang,

    This is not available in 8.1, unfortunately.

    With 8.2 you can write the following

    builder.AddMethod(
        Method.Define("test")
            .Handle<TestData>("PUT", (t, r) => { })
            .WithVerbDescription("The description for PUT")
            .Handle<TestData>("PATCH", (t, r) => { })
            .WithVerbDescription("The description for PATCH")
            .Handle("DELETE", r => { })
            .WithVerbDescription("The description for DELETE")
    );

    Regards

    Hanno