Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 669D2200C89 for ; Sat, 3 Jun 2017 11:48:08 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 6588D160BCD; Sat, 3 Jun 2017 09:48:08 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id AA730160BBE for ; Sat, 3 Jun 2017 11:48:07 +0200 (CEST) Received: (qmail 30301 invoked by uid 500); 3 Jun 2017 09:48:06 -0000 Mailing-List: contact dev-help@thrift.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@thrift.apache.org Delivered-To: mailing list dev@thrift.apache.org Received: (qmail 30290 invoked by uid 99); 3 Jun 2017 09:48:06 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 03 Jun 2017 09:48:06 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 498A11806F7 for ; Sat, 3 Jun 2017 09:48:06 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -99.201 X-Spam-Level: X-Spam-Status: No, score=-99.201 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id Ps56OnKRGoiu for ; Sat, 3 Jun 2017 09:48:05 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id E2E2C5F341 for ; Sat, 3 Jun 2017 09:48:04 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 64FC0E05CE for ; Sat, 3 Jun 2017 09:48:04 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 1C1DF20DF5 for ; Sat, 3 Jun 2017 09:48:04 +0000 (UTC) Date: Sat, 3 Jun 2017 09:48:04 +0000 (UTC) From: "Jens Geyer (JIRA)" To: dev@thrift.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (THRIFT-4220) Allow Service calls to be made using TSimpleJSONProtocol (using Simple JSON) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Sat, 03 Jun 2017 09:48:08 -0000 [ https://issues.apache.org/jira/browse/THRIFT-4220?page=3Dcom.atlassia= n.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D160= 35915#comment-16035915 ]=20 Jens Geyer commented on THRIFT-4220: ------------------------------------ TSimnpleJSON was never intended to be used as means of transport in Thrift.= I don't see the value w/regard to the [Thrift Goals|http://thrift.apache.o= rg/about], especially since we already have TJSONProtocol which adheres muc= h more to them: {quote} Apache Thrift aims to embody the following values: =E2=80=A2 Simplicity Thrift code is simple and approachable, free of unnece= ssary dependencies. =E2=80=A2 Transparency Thrift conforms to the most common idioms in all lan= guages. =E2=80=A2 Consistency Niche, language-specific features belong in extension= s, not the core library. =E2=80=A2 Performance Strive for performance first, elegance second. {quote} TL;DR: I tend to disagree. > Allow Service calls to be made using TSimpleJSONProtocol (using Simple JS= ON) > -------------------------------------------------------------------------= --- > > 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 u= sing simple Human Readable JSON. This means publishing our APIs to third pa= rty 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 suppor= t. > This is not always possible. > I propose we do something like this: > {code} > exception SystemException { > 1: i32 errorCode, > 2: string message, > } > struct User { > 1: string id, > 2: string email, > 3: string name, > 4: i64 validatedAt > } > struct LoginResult { > 1: string authToken, > 2: User currentUser > } > service AuthenticationService { > LoginResult login(1: string email, 2: string password) throws(1: System= Exception err) > } > {code} > Request Format: > {code} > { > "method": "METHOD_NAME", > "arguments": { ... } > } > { > "method": "login", > "arguments": { > "email": "devansh@wi.co", > "password": "password" > } > } > {code} > RESULT: > {code} > { > "method": "login", > "result": { > "success": { > "authToken": "some_auth_token", > "currentUser": { > "id": "6a6c982b-62f9-46d2-aff9-bd3a1cdf43f9", > "email": "user1@wi.co", > "name": "user1", > "validatedAt": 0 > } > } > } > } > {code} > This uses the JSON generated by the JSON Generator as "metadata" to figur= e out the Field Keys and Types. -- This message was sent by Atlassian JIRA (v6.3.15#6346)