Devansh Gupta created THRIFT-4220:
-------------------------------------

             Summary: Allow Service calls to be made using TSimpleJSONProtocol 
(using Simple JSON)
                 Key: THRIFT-4220
                 URL: https://issues.apache.org/jira/browse/THRIFT-4220
             Project: Thrift
          Issue Type: New Feature
          Components: Wish List
    Affects Versions: 1.0
            Reporter: Devansh Gupta
             Fix For: 1.0


https://blog.parsable.com/using-human-readable-json-endpoints-with-thrift-for-free-774ba505c893

https://github.com/degupta/human_readable_json_protocol

If we publish our Services/APIs as Thrift today you can't make requests using 
simple Human Readable JSON. This means publishing our APIs to third party users 
means they have to

1. Know how to use Thrift
2. Have all the Thrift definition files or the generated code

Or we have to build Libraries for each of the platforms we want to support.

This is not always possible.

I propose we do something like this:

{code}
service AuthenticationService {
  LoginResult login(1: string email, 2: string password) throws(1: 
SystemException err)
}
{code}

Request Format:
{code}
{
  "method": "METHOD_NAME",
  "arguments": { ... }
}

{
  "method": "login",
  "arguments": {
    "email": "deva...@wi.co",
    "password": "password"
  }
}
{code}

RESULT:
{code}
{
  "method": "login",
  "result": {
    "success": {
      "authToken": "some_auth_token",
      "currentUser": {
        "id": "6a6c982b-62f9-46d2-aff9-bd3a1cdf43f9",
        "email": "us...@wi.co",
        "name": "user1",
        "validatedAt": 0
      }
    }
  }
}
{code}




--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to