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

Swagger definitions now have type set to object. #133

Merged
merged 4 commits into from
Apr 19, 2016

Conversation

ivucica
Copy link
Collaborator

@ivucica ivucica commented Apr 16, 2016

While the spec does not seem to require this, the Swagger editor at
http://editor.swagger.io/ gets confused and does not display the
'Try this operation' UI correctly.

Many of the examples found around also specify "type": "object",
so this should be the right thing to do.

While the spec does not seem to require this, the Swagger editor at
http://editor.swagger.io/ gets confused and does not display the
'Try this operation' UI correctly.

Many of the examples found around also specify `"type": "object"`,
so this *should* be the right thing to do.
@achew22
Copy link
Collaborator

achew22 commented Apr 16, 2016

Ivan,

Thanks for contributing to grpc-gateway! Your patch looks interesting. I think that in a second the build is going to fail because you need to regenerate the examples. Could you go ahead and do that to satisfy the build monster? After that happens an example of this will be available on github on a public URL and we can create a link to test it out.

Looking forward to helping get this merged!

@ivucica
Copy link
Collaborator Author

ivucica commented Apr 16, 2016

(Un)amusingly, when I fire up

make realclean
make examples

protoc-gen-go seems to be dumping out protos without protobuf:"....:,json=protojsonfieldnamehere". That should be the old behavior -- so I'm not sure why that's going on.

However, after a bit of fighting with the gopath set up just for this purpose :-) the golden JSONs have been rebaked and they seem similar to the output from the failed Travis job. There seems to be no other differences related to the aforementioned protoc-gen-go issue. Update coming up.

@ivucica
Copy link
Collaborator Author

ivucica commented Apr 16, 2016

Alright, I'm not sure how to tackle this. Travis build on Go 1.5 passes, but fails on tip, with a diff on gzipped FileDescriptorProtos.

I'm almost certain that trying to push my local copy won't help much, given the aforementioned even-larger diff (completely lacking the json field in the protobuf annotations of generated Go structs).

Thoughts?

@achew22
Copy link
Collaborator

achew22 commented Apr 16, 2016

My understanding of that test is that if you git add those files and upload it that it should start working. Would you mind trying that really quick since it shouldn't be too painful to try?

@ivucica
Copy link
Collaborator Author

ivucica commented Apr 16, 2016

This is the same symptom witnessed by @kazegusuri in pull request #129. I'd say this is a broken test?

EDIT: I can try, but there will be a diff.

@ivucica
Copy link
Collaborator Author

ivucica commented Apr 16, 2016

Pushed. I'll be going to sleep now; however I would expect that both 1.5 and tip will be broken with b31478d.

@achew22
Copy link
Collaborator

achew22 commented Apr 17, 2016

@yugui I have been playing with this for a couple of hours and I'm unable to get it to compile the same on tip vs 1.5.

Would you be willing to take a look at that test and see if there is a better way to do it? Can we maybe whitelist the byte arrays or something? I'm not sure how to fix it

@yugui
Copy link
Member

yugui commented Apr 18, 2016

@achew22, @ivucica
Thank you for your contributions. I've fixed the build issue in ivucica#1. Could you take a look?

@achew22
Copy link
Collaborator

achew22 commented Apr 18, 2016

@yugui Would you be willing to propose that as a PR to the grpc-gateway repo? That way travis will fire on it and we can get it committed

@yugui
Copy link
Member

yugui commented Apr 18, 2016

@achew22

I made a PR #136. It contains only Travis configuration change.
You still need to update .pb.go with protoc-gen-go after golang/protobuf@001690d.

Do you want me to create another PR which contains the .pb.go changes?

@achew22
Copy link
Collaborator

achew22 commented Apr 18, 2016

I don't think it is worthwhile to do the .pb.go changes since everyone will have do them anyway. Looks like it passes on both 1.5 and tip. I LGTM'd your PR over there. @ivucica this should clear the path for you. Thanks for pushing back on me. @yugui thanks for your timely response!

@ivucica
Copy link
Collaborator Author

ivucica commented Apr 18, 2016

Thanks, all, for your work on this! I've updated this pull request by merging master. Looks like it passes now.

@achew22
Copy link
Collaborator

achew22 commented Apr 19, 2016

LGTM 👍

@yugui
Copy link
Member

yugui commented Apr 19, 2016

Thank you for your contributions.

@yugui yugui merged commit 98578bc into grpc-ecosystem:master Apr 19, 2016
adasari pushed a commit to adasari/grpc-gateway that referenced this pull request Apr 9, 2020
…object

Swagger definitions now have `type` set to `object`.
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