Skip to content

Specify content-type properly in REST APIs #7456

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

Closed
ali-jalaal opened this issue Mar 19, 2025 · 2 comments · Fixed by #7524
Closed

Specify content-type properly in REST APIs #7456

ali-jalaal opened this issue Mar 19, 2025 · 2 comments · Fixed by #7524
Assignees

Comments

@ali-jalaal
Copy link
Contributor

ali-jalaal commented Mar 19, 2025

What is the underlying problem you're trying to solve?

It seems content-type request header in REST APIs is not well-documented and documentations could become more clear. Some APIs do not mention content-type request header and some of them do not specify all possible options.

Describe the ideal solution

Ideally all REST APIs could be reviewed to:

  • add missing headers
  • specify required/optional request headers and query parameters

Describe a "Good Enough" solution

1. Missing application/json content-type headers
The following APIs:

specified in the Request Headers section:

Content-Type: application/yaml: Indicates the request body is a YAML encoded object.

This description could be misleading, since:

  • application/json content-type is not mentioned
  • almost all examples in this page are based on JSON

This could be improved by specifying application/json as a valid content-type.

2. Missing headers
The following APIs:

Additional Context

@anderseknert
Copy link
Member

Thanks! We'd be more than happy to get some help with this, if someone wants to step up to the challenge 🙂

@ali-jalaal
Copy link
Contributor Author

I'll try to work on that. 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants