-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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 'License' message to the annotation proto. #644
Conversation
Just realize this is only the first step, we track down, what needs to be done to make this appear in the final json too. |
Now it should be good to go. |
Hi, I only get the bazel build to work. |
@@ -784,6 +784,17 @@ func applyTemplate(p param) (string, error) { | |||
s.Info.Contact.Email = spb.Info.Contact.Email | |||
} | |||
} | |||
if spb.Info.License != nil { | |||
if s.Info.License == nil { | |||
s.Info.License = &swaggerLicenseObject{} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you need to add the License
field to the Info
object. I'm surprised this isn't a compile time error
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't that be generated from "message Info" define in openapiv2.proto? Also when I build it with bazel it actually works. I am getting the license fields in the generated json.
Update when I run 'make test' localy I get:
|
Hi, I really need help to understand why the tests fail. What exactly should I run locally to build/run not using bazel. I have the git rooted in my gopath: |
Did you try regenerating the
|
No, there is the dependent rule which builds protoc-gen-swagger/options/openapiv2.proto protoc-gen-swagger/options/annotations.proto and produces the respective '.pb.go' files.
I've fixed one test by updating proto-gen-go (go get -u github.com/golang/protobuf/protoc-gen-go). For the "github.com/grpc-ecosystem/grpc-gateway/examples/integration" you seem to have a mix of using the new "context" and the old "golang.org/x/net/context". I don't know how to resolve that. https://gist.github.com/ensonic/1ddd754610de01ed99bb55ab52c7579b FYI: I also get
without my change (using |
Hi @ensonic, we're made some changes to CI since you first had these problems, want to rebase and give it another go? |
Please rebase on master for new CI functionality. |
This information is used by the default html doc generator and so it is nice to be able to provide it. Add the message to openapiv2.proto and extend template.go to handle it. Tested via: bazel build //examples/proto/examplepb:expamplepb_protoc_gen_swagger more bazel-bin/examples/proto/examplepb/a_bit_of_everything.swagger.json
Still the same. For using it with bazel I can simply run:
Running
For the CI errors it looks like |
Interesting, is that because of a dependency update or something? Would you be interested in submitting a PR to regenerate the file, or, regenerate it in this PR? |
So if you look at our CI tests it's actually saying that you still need to regenerate things. Bazel doesn't use the generated files in the same way (apparently) but we still need them. The |
Don't run just |
This looks better. The part about regenerating files should be one of the commands in 'how-to-contribute' and should be done before sending a PR :) |
Codecov Report
@@ Coverage Diff @@
## master #644 +/- ##
==========================================
- Coverage 53.39% 53.27% -0.12%
==========================================
Files 30 30
Lines 3362 3369 +7
==========================================
Hits 1795 1795
- Misses 1392 1399 +7
Partials 175 175
Continue to review full report at Codecov.
|
Nice one, thanks! |
Sorry for being such a pain to get this in and thanks for merging! |
Thanks for the contribution :). Our old CI system was largely to blame, unfortunately there's still lots of good contributions like this laying around. |
This information is used by the default html doc generator and so it is nice
to be able to provide it.