test2doc icon indicating copy to clipboard operation
test2doc copied to clipboard

use headers to provide title and description params

Open groob opened this issue 7 years ago • 2 comments

This PR adds the ability to set the Description and Title used by test2doc by setting custom request headers.

Sometimes the HTTP Handler is not a function or method in the code, but is created using a factory function.

groob avatar Oct 18 '16 13:10 groob

This is an interesting idea. But it does take away a lot from the simplicity and intention of the project. I think I'll leave it here for folks to upvote. If anyone else would use this feature, I'll think more seriously about merging.

Thanks for breaking all these changes up into many PRs.

s-mang avatar Oct 28 '16 20:10 s-mang

I use gokit.io to generate the handlers, so it looks something like this:

r.Methods("POST").Path("/profiles/").Handler(httptransport.NewServer(
	e.PostProfileEndpoint,
	decodePostProfileRequest,
	encodeResponse,
	options...,
))

I love the simplicity of test2doc, but maybe custom headers are a good compromise to give it more flexibility?

olivoil avatar Aug 02 '17 02:08 olivoil