Skip to content

echo strict server when content-type is Text/plain #1676

@elodieapiou

Description

@elodieapiou

This previous problem has created a new problem for echo strict #1132

I create an api response with a header and a "text/plain" content.
When my api is generated with oapi-codegen, my response is malformed.
Instead of creating a structure containing my header and content, it only creates a string.

i use the version v1.13.0, which is deprecated. From v1.13.1 to v2.2.0, api does not generate correctly.

Here is my code:

file openapi.yml, my response to be generated

Capture d’écran 2024-07-02 à 10 36 31

What i want (generated with the version v1.13.0)

Capture d’écran 2024-07-02 à 10 40 14

What i have (generated with the version v2.2.0)

Capture d’écran 2024-07-02 à 10 41 12

I think the problem may be here : https://github.com/oapi-codegen/oapi-codegen/blob/v2.2.0/pkg/codegen/templates/strict/strict-interface.tmpl#L42

Capture d’écran 2024-07-02 à 11 22 05

I'm blocked.

Thank you

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions