Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jdimeo opened this issue Oct 25, 2024 · 1 comment
Open
Assignees

Comments

@jdimeo
Copy link
Contributor

jdimeo commented Oct 25, 2024

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
Copy link
Contributor Author

jdimeo commented Oct 25, 2024

Related to #1450 and #1970

@JanCizmar JanCizmar self-assigned this Nov 1, 2024
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

No branches or pull requests

2 participants