Forum Discussion

TNeuschwanger's avatar
TNeuschwanger
Icon for Champion Level 3 rankChampion Level 3
4 years ago

Re: How encoding/Decoding of Grpc proto parameters processed in ReadAPI during .proto file import

Hello Guru2 

 

I am not familiar with grpc protocol, but your sample looks a little JSON ish...  I will just base this suggestion on what I am guessing is JSON request and response...  I could be completely off track so discard if this has nothing to do with JSON.  🙂

 

I am pretty sure JSON has no specification for order.  If you provide original JSON and send it to any JSON interpreter, you might not get the same result in its output as originally consumed.  I have seen code samples to force JSON to keep order, but if I am on the wrong track here to begin with, I don't want to spend time continuing research on that.  If this is JSON related, you would need to sort both input and output to be consistent for comparison.

 

Regards,

Todd

4 Replies

  • richie's avatar
    richie
    Community Hero
    Hey TNeuschwanger,

    Just a follow up FYI for you regarding the json order/unorder (unorder....ia that even a word? Never mind...rhetorical!)

    The definition of a json object is an "unordered list of name/value pairs".
    If you want the contents of an object in a particular sequence, you have to do things like embed it in an array, etc.

    Cheers

    Rich
      • Guru2's avatar
        Guru2
        Occasional Contributor

        Hi Sonya,

         

        Thanks for asking. My query was not solved because this is not a json request/response. Still could not understand how readyapi encodes the request data to server when the grpc request created using the unary call imported from .proto file.  So tried modifying the default request data in the grpc unary call based on how we implemented in our code. That modification did not helped, it throws "invalid input length" error after modifying. Any suggestions how to proceed further? How this request data is being set when creating grpc request using the imported API definition? Kindly let me know. 

         

         

        Thanks,

        Guru