tolgee / tolgee-platform

Developer & translator friendly web-based localization platform
https://tolgee.io
Other
2.07k stars 203 forks source link

Make application/hal+json consistent on all HTTP responses for an operation #2627

Open jdimeo opened 4 weeks ago

jdimeo commented 4 weeks ago

Is your feature request related to a problem? Please describe. Currently, some operations return a mix of application/json or application/hal+json based on the result (for example 2xx vs 4xx). While this is totally reasonable, it creates difficulties in generated API clients. When there's a mix of types, the client sends application/json which throws HttpMediaTypeNotAcceptableException since it was expecting application/hal+json.

Describe the solution you'd like If an operation, like /v2/projects to get all projects, returns application/hal+json please indicate that all other return codes like 403 might also return application/hal+json so that generated clients only work with that single content type.

Describe alternatives you've considered Patching the OpenAPI spec myself. I had just gotten to the point of using the new public API spec unchanged :-)

Additional context

{91A63D4D-7D67-4492-93E8-CF2739B7011B}

jdimeo commented 4 weeks ago

Related to #1450 and #1970