Skip to content

gen: convenient errors not generated for JSON-like content-types #1632

@zguydev

Description

@zguydev

What version of ogen are you using?

v1.20.0 (latest)

Can this issue be reproduced with the latest version?

Yes

What did you do?

I came up with a case, where a service uses application/problem+json (per RFC 7807) as the default response content-type for endpoints. ogen supports both things: application/problem+json as a special case and convenient errors generation for default responses.

The issue is that convenient error generation logic currently strictly checks for application/json only - leaving JSON-like types, f.e. application/problem+json, to be unsupported in such a case.

To reproduce this I prepared an example config and spec:

What did you expect to see?

I expected all JSON-like content types to be supported for default responses, including application/problem+json.

What did you see instead?

Generation error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions