Skip to content
This repository has been archived by the owner on Apr 21, 2020. It is now read-only.

Add support (or documentation) for overloads by accept header. #14

Open
MicahZoltu opened this issue Aug 13, 2017 · 2 comments
Open

Add support (or documentation) for overloads by accept header. #14

MicahZoltu opened this issue Aug 13, 2017 · 2 comments
Assignees
Labels
Projects
Milestone

Comments

@MicahZoltu
Copy link

It would be great if the following worked and the proper method was called based on what Accept header the caller supplied.

@Path('')
class Controller {
	@GET
	@Path('/getFruit')
	@Produces('application/json')
	async getFruitAsJson(): Promise<Response> {
		const repsonse = new Repsonse();
		response.body = { fruit: "apple" };
		return response;
	}
	@GET
	@Path('/getFruit')
	@Produces('text/plain')
	async getFruitAsString(): Promise<Response> {
		const repsonse = new Repsonse();
		response.body = "apple";
		return response;
	}

If this is currently supported and just undocumented, then consider this ticket a request for documentation.

@joesonw joesonw self-assigned this Aug 14, 2017
@joesonw
Copy link
Contributor

joesonw commented Aug 14, 2017

This currently is not supported. This feature goes into V1.1 plan, which also including identify routes by @Consumes where handles request Content-Type header.

@joesonw
Copy link
Contributor

joesonw commented Aug 14, 2017

You can also leave other suggestions in #7. Thanks again for the contributions. Contributions.md is on the way.

@joesonw joesonw added this to the v1.1 milestone Aug 14, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
v1.1
Awaiting triage
Development

No branches or pull requests

2 participants