Skip to content
This repository has been archived by the owner on Nov 13, 2021. It is now read-only.

Add guidelines about content negotiation #86

Open
MassimoC opened this issue Jan 28, 2019 · 4 comments
Open

Add guidelines about content negotiation #86

MassimoC opened this issue Jan 28, 2019 · 4 comments

Comments

@MassimoC
Copy link
Collaborator

provide guidelines on content negotiation (accept / content-type).

@MassimoC
Copy link
Collaborator Author

MassimoC commented Mar 9, 2019

Introduce ConsumesAttribute and ProducesAttribute

Having the operations decorated with these attributes should also affect the Swagger documentation.

For example:

[SwaggerResponse((int)HttpStatusCode.OK, "Player data object")]
[SwaggerResponse((int)HttpStatusCode.NotFound, "Player not found")]	        
[SwaggerResponse((int)HttpStatusCode.InternalServerError, "API is not available")]
[Produces("application/json")]
public async Task<IActionResult> GetPlayer(int id) {}

What's the point to have application/json and text/json?
We should remove text/json

@fgheysels
Copy link
Contributor

Regarding text/json, application/json: I just took that over from the code at hand. Also to show how multiple contenttypes can be specified.
But for me, it is OK to drop text/json.

@MassimoC MassimoC assigned MassimoC and fgheysels and unassigned MassimoC Mar 18, 2019
@MassimoC
Copy link
Collaborator Author

MassimoC commented Mar 18, 2019

Ref #102 and #103

@tomkerkhove
Copy link
Contributor

@FilipVanRaemdonck is working on this. Pending invite to assign to him.

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

No branches or pull requests

3 participants