Skip to content

Conversation

@groob
Copy link
Contributor

@groob groob commented Oct 18, 2016

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.

Adds two headers X-Test2Doc-Description and
X-Test2Doc-Title to as an alternative to GetTitle and
GetDescription methods.
@s-mang
Copy link
Owner

s-mang commented Oct 28, 2016

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.

@olivoil
Copy link

olivoil commented Aug 2, 2017

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?

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

Successfully merging this pull request may close these issues.

3 participants