polyglot icon indicating copy to clipboard operation
polyglot copied to clipboard

JSON Option for List Command

Open peteboothroyd opened this issue 8 years ago • 6 comments

JSON Output

  • Adding JSON option to list command to allow easy parsing of output.
  • Altering with_message output to be json which can be copy and pasted straight into a call command.
  • Now printing response message template as this may be useful for users to determine which service they want to call.
  • Updating tests to reflect this update.

peteboothroyd avatar Aug 04 '17 14:08 peteboothroyd

I've updated with your suggestions. The merging process went a little awry on my end, the main changes are in the ServiceList, Main, and CommandLineArgs.

Changes:

  • There is now a list_output_format flag with two options, json or the default readable option
  • Tests updated and added for command line argument parsing
  • Listing the methods now reports true/false for client & server streaming
  • Tests updated for ServiceList

peteboothroyd avatar Aug 17 '17 17:08 peteboothroyd

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

:memo: Please visit https://cla.developers.google.com/ to sign.

Once you've signed, please reply here (e.g. I signed it!) and we'll verify. Thanks.


  • If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address. Check your existing CLA data and verify that your email is set on your git commits.
  • If your company signed a CLA, they designated a Point of Contact who decides which employees are authorized to participate. You may need to contact the Point of Contact for your company and ask to be added to the group of authorized contributors. If you don't know who your Point of Contact is, direct the project maintainer to go/cla#troubleshoot.
  • In order to pass this check, please resolve this problem and have the pull request author add another comment and the bot will run again.

googlebot avatar Aug 17 '17 17:08 googlebot

done

On 17 Aug 2017, at 18:54, googlebot [email protected] wrote:

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ https://cla.developers.google.com/ to sign.

Once you've signed, please reply here (e.g. I signed it!) and we'll verify. Thanks.

If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address. Check your existing CLA data https://cla.developers.google.com/clas and verify that your email is set on your git commits https://help.github.com/articles/setting-your-email-in-git/. If your company signed a CLA, they designated a Point of Contact who decides which employees are authorized to participate. You may need to contact the Point of Contact for your company and ask to be added to the group of authorized contributors. If you don't know who your Point of Contact is, direct the project maintainer to go/cla#troubleshoot. In order to pass this check, please resolve this problem and have the pull request author add another comment and the bot will run again. — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/grpc-ecosystem/polyglot/pull/57#issuecomment-323147114, or mute the thread https://github.com/notifications/unsubscribe-auth/AM1d-aNMeoRuRPBdpcDbrmHQFvBDnLHrks5sZH5WgaJpZM4OtxP7.

peteboothroyd avatar Aug 17 '17 19:08 peteboothroyd

CLAs look good, thanks!

googlebot avatar Aug 17 '17 19:08 googlebot

Changes

  • JSON output now prints out the service protos, and dependency file protos.
  • JSON output structure is
{
  serviceProtos: [//list of serviceDescriptorProtos],
  fileProtos: [//list of fileDescriptorProtos]
}

See src/test/java/me/dinowernli/grpc/polyglot/command/jsonOutputGold.txt for more illustrative example

  • MessageWriter can use custom separator string.
  • Separator string only used in between messages.

Notes

  • Services are filtered according to the serviceFilter flag, but the methodFilter flag is ignored for json output

peteboothroyd avatar Sep 05 '17 14:09 peteboothroyd

Ok the things you mentioned should be addressed now. Formatting is almost definitely not correct, can you advise of an automated way to share whatever settings you have as doing this manually is soul destroying.

peteboothroyd avatar Sep 20 '17 14:09 peteboothroyd