Skip to content
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

Add Echo router extractor and method parser. #17

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

piotrekmonko
Copy link

No description provided.

Copy link
Owner

@s-mang s-mang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey! Thanks for the pull! I have some initial comments right off the bat but I'll review in more detail later today or tomorrow.
Cheers -

@@ -4,6 +4,9 @@

Generate documentation for your REST/HTTP API from your Go unit tests - a simple addition to Go's testing package.

This fork adds `MakeEchoRouterExtractor` to extract query params from labstack.Echo server
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please delete these lines

@@ -1,4 +1,79 @@
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

go.sum got a bit out of control here! can you clean this up?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh my bad, i guess echo just imports a ton of external libraries huh.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's correct. Lots of useless dependencies. I'll try to "interfacerize" if you'd like that?

fn.Doc = strings.Replace(fn.Doc, "\t", " ", -1)
funcsMap["("+fn.Recv+")"+fn.Name] = fn
}
}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested this locally and I get the same doc generated for a method handler with and without your code change.
Can you add an example in examples/widgets/* or foos/* to demonstrate that the change works?

@@ -0,0 +1,26 @@
package vars

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am hesitant to add this change because of the enormous amount of dependencies that echo brings in.
I would prefer to see this URL Var extractor added as documentation in the Readme.

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.

2 participants