Skip to content

Conversation

@bubu11e
Copy link
Contributor

@bubu11e bubu11e commented Oct 23, 2025

When trying to add examples for the default tonic status with the function fizz.Response like this:

routerGroup.POST(
            "", []fizz.OperationOption{
                fizz.Summary("My Summary"),
                fizz.ResponseWithExamples(
                    fmt.Sprintf("%d", http.StatusAccepted),
                    "toto", nil, nil, map[string]string{
                        "example ": "example",
                    }),
            },
            tonic.Handler(<the_handler>, http.StatusAccepted),
        )

we get the following error:

panic: error while generating OpenAPI spec on operation XXXX : response with code XXX already exists [recovered,repanicked]

This request add the possibility to set multiples examples for the default handler behavior.

@bubu11e bubu11e force-pushed the add_examples branch 2 times, most recently from de3e07d to 57431e0 Compare November 4, 2025 14:00
…vior

When trying to add examples for the default tonic status with the function fizz.Response, we get the following error:

    panic: error while generating OpenAPI spec on operation XXXX : response with code XXX already exists [recovered, repanicked]

This commit allow to define examples for the default handler behavior

Signed-off-by: julien.girard <[email protected]>
@wI2L wI2L merged commit 87b41d4 into wI2L:master Nov 5, 2025
8 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants