Re: [httpapi] Discussion about JSON payloads and code generation
Darrel Miller <Darrel.Miller@microsoft.com> Sun, 17 January 2021 21:17 UTC
Return-Path: <Darrel.Miller@microsoft.com>
X-Original-To: httpapi@ietfa.amsl.com
Delivered-To: httpapi@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id F02433A083B for <httpapi@ietfa.amsl.com>; Sun, 17 Jan 2021 13:17:43 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.35
X-Spam-Level:
X-Spam-Status: No, score=-2.35 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.25, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=0.001, RCVD_IN_MSPIKE_H2=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=microsoft.com
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id kE1nroC5WtuL for <httpapi@ietfa.amsl.com>; Sun, 17 Jan 2021 13:17:42 -0800 (PST)
Received: from NAM06-DM3-obe.outbound.protection.outlook.com (mail-eopbgr640136.outbound.protection.outlook.com [40.107.64.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id EB6A73A0813 for <httpapi@ietf.org>; Sun, 17 Jan 2021 13:17:41 -0800 (PST)
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=elmwn/46YTbZFxjez+NP4F1Bl0iJ+2X7q9DuLZRWegADqfth+WQlowRchjoOpCMNe718abaSX/IhqoiA8Jq/hf6yXZ3jLAh1nnloFsd7oiit+4iUqZjvYyjSb95Up7vx0vK9RUKKMaYTF2pVJJe/IXRLqxfNKxWJWqfcM2/3rCVU3mq573Om+tRXa2YElah6GOZDARkxl3v2P4kExjfgk3un5cxfTwRUFRHoAmwi/IrgjcROCBzA1/nGwAUN3EGpOecyuvGEA8/RGVpaeOCc9LpnbkkCeL8gVNUZj7xETmANDS863+vsIQokCrP8BH53+O++jlu0YrcLca5FKJt4sg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=eRlaBNnI4/rLm9Ar5CdA78CBaqNT/S0QUTemdMi35VQ=; b=jGcoedV7RNv6JFZRfNgunzNMEma4xkTuKw5WARlGUZDR6UlYKrWrx/6EG3d83drXuXsC9hnsDlxrFUU4WLL4UImzD6SQaRp7EGCJyn/FIgqJU8XrY4BSDQ19OtAeq6aEaMKSas44DeQFkrkqpvWh1glGCT6iCmXnDe/knZQAh3TRiWcv3cV2+NojZ0llZReOtCbkXwbAeDAvrybpGUDsP27TR3YWeDTRBtKySKu0655jZMCVF1ieCrlFXtD81mwvvStVnLZXtOtfOcqy4J4AoS/mGrwbhwfNw7NdAZQ2y2rYXJZ63M+KVp6j5d1vk7XqAgqt6gndRkpXyCgpjz2yAg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=microsoft.com; dmarc=pass action=none header.from=microsoft.com; dkim=pass header.d=microsoft.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=eRlaBNnI4/rLm9Ar5CdA78CBaqNT/S0QUTemdMi35VQ=; b=FHnK2fImLjCn2r93u19jlzUawV88gCtajRxijXAPKyhRm+HnLuy/SGDjEU2WFMx8/K9GSDal5QjmfWfjbz/y2poofkIJRs2jaCtuPAWSqF7zDZTem6sOBX9Fx092RNNH25R8YKR2mgPXMFaiXeE8T173znMOYGKsswb9Ea6E8hY=
Received: from (2603:10b6:208:1c1::19) by BL0PR00MB0753.namprd00.prod.outlook.com (2603:10b6:208:1c2::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3814.0; Sun, 17 Jan 2021 21:17:28 +0000
Received: from BL0PR00MB0836.namprd00.prod.outlook.com ([fe80::f8d2:c96e:f99d:a228]) by BL0PR00MB0836.namprd00.prod.outlook.com ([fe80::f8d2:c96e:f99d:a228%9]) with mapi id 15.20.3814.000; Sun, 17 Jan 2021 21:17:28 +0000
From: Darrel Miller <Darrel.Miller@microsoft.com>
To: "christoph.kappestein@gmail.com" <christoph.kappestein@gmail.com>
CC: "httpapi@ietf.org" <httpapi@ietf.org>
Thread-Topic: [httpapi] Discussion about JSON payloads and code generation
Thread-Index: AQHW7AmIPyJ32zvjfE6Ci8mHOwNnYKoqynhfgADqNICAAI74Bw==
Date: Sun, 17 Jan 2021 21:17:28 +0000
Message-ID: <BL0PR00MB083637DAD075EC8E5342A0A9F0A59@BL0PR00MB0836.namprd00.prod.outlook.com>
References: <CALcRZn6-ojAAdJcMWFHef70Xp32O2iFatuw-YjGLKtr8VnbmYQ@mail.gmail.com> <DM6PR00MB0845824BE38945071F9774A5F0A69@DM6PR00MB0845.namprd00.prod.outlook.com>, <CALcRZn6HdXE2WAn0vSod0XDY_yJd7jV7m5JnRWKWGDJaDaag-A@mail.gmail.com>
In-Reply-To: <CALcRZn6HdXE2WAn0vSod0XDY_yJd7jV7m5JnRWKWGDJaDaag-A@mail.gmail.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
msip_labels: MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Enabled=True; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SiteId=72f988bf-86f1-41af-91ab-2d7cd011db47; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SetDate=2021-01-17T21:17:27.318Z; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Name=General; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ContentBits=0; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Method=Standard;
authentication-results: gmail.com; dkim=none (message not signed) header.d=none;gmail.com; dmarc=none action=none header.from=microsoft.com;
x-originating-ip: [74.15.147.35]
x-ms-publictraffictype: Email
x-ms-office365-filtering-ht: Tenant
x-ms-office365-filtering-correlation-id: b397278c-b663-4763-daea-08d8bb2d4b4b
x-ms-traffictypediagnostic: BL0PR00MB0753:
x-microsoft-antispam-prvs: <BL0PR00MB07533C30F20E888103B5D9FAF0A59@BL0PR00MB0753.namprd00.prod.outlook.com>
x-ms-oob-tlc-oobclassifiers: OLM:10000;
x-ms-exchange-senderadcheck: 1
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: b1Vi+LEbEDYVD4btqdzrsholjb1fVkdrWYL4zPzNEJx06K+cEi08xFXPosEIIBUVUnnGY/AjtyrxH0Ru3EZ/yasUG4CObFZSR/fvGuJkExs6NxzB4Z1DXGDcDQhjMDwBhyHO8wDsbJ1LugvisOp9yTPLRFvrKnbVwKf7HzcFfM9jB8lJ1jqDtq06Om+iMBD6wu7xmEHNrv3YlHTsqSWzrBIcvHqj53VV5SbBVS7J8cHKW5U5dBp3WDq49u442zfLaT+fwFB+ZGMTPOpz8G2c39CAtr5Rqn6aWOJ8PSvVcYZa/39c4vAs1jVf4LznvVFJjGeAmToPfvTyzHBhlUM7gcSYBQs+K9nuPmtIrjDiM0ICluJCFxI6kMvevNi7fju7tkLmoCuDqYJAdXbObeQJdIi7iHZi9PNGGnCVOT9+jGPZu/Mr3cROz54QT0SPTTkJ+Mcm7ajOfWeofSZjaQsTo2KeVwVO35MW/hn0GQNmhoL+JveCMm4vmgOlbMWWqp/VAxuM31YSgjwFTAbykQbwH4HAhl85DE4IGOgL0XFZLRqfOAOGuiz55iQQdyoZScpwsHhmw5pENG8RSxOtv8gX4spck+soi1HgptTOxM187pI=
x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BL0PR00MB0836.namprd00.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(396003)(346002)(136003)(39860400002)(376002)(366004)(6916009)(82960400001)(82950400001)(33656002)(8936002)(8676002)(7696005)(8990500004)(6506007)(2906002)(55016002)(9686003)(19627405001)(52536014)(5660300002)(71200400001)(76116006)(66446008)(478600001)(966005)(64756008)(66476007)(10290500003)(4326008)(186003)(26005)(166002)(83380400001)(316002)(66946007)(86362001)(66556008); DIR:OUT; SFP:1102;
x-ms-exchange-antispam-messagedata: lyORd8qefNTG1U8yMpy5vrOXlozqLz8vEKP3f/gVO34Z6ErRUhgemdz/6lkJYggHTFS3HFsgJRGPZLWJzb5fL3c67SAqHvX4iZPLRzh5K/P7ZXwC23PRiRgHvVp5ZBAQja7bj+luuR7ExwBZGvaPyClqP7pj5KJ81gxB/poSw/pOJlIpxC6a3YG8K2dpC6P7uWhTpAeBqCX4558wSNphiyZ/cVoChCwTCRSZqQgCtdwTEv66BpsHzaOb5HGlWfPeVwiVMdDI2XQlRgJ7hdS1MnKWyRK+IIjxA50EHHEifP4yaNt0vnF8XNv5m3QwJ0Gc5begeQFxUNsIapqLG0o7hpQMO49A4Tv1yxlSCCYvvyphlORJ+/g5Es7Q2945rptIngIg6kxcDqJe0HZP4TMW/5ozWXSjrxT/X86VQfWcTNsl67Jzu0+jS6IYos2yB7hT6izFL1HXVMgPiQCt/4IDZZaZy8mOiv06JXJ8nZY7IzN0/8J04JwLY3i8glBnSyUaSR4WMbDi8BFz4UxEh9+2E5TUvB5HTOoeI/wv7/n7ckQJeMo2q4ZDC/3nqafQZLtiBdCt5veDg+9JHY4bFfMgv9c00iDd2c9xj7SrIWLw5vfC/WRhwKAT3DdyXRbrD1fUBdXFiBbKTW7qEQkmFdQ5defhi+54TxTeW6y25uumHJ6edMO1KQDug3NgwYV677XtE/MKye0AarEQfRC7Xcy1xoaAT7FAG5/6jxv3DfdspOqlazG1iaGEBBDoGwWOchI7TbGmGsSvFctknkvQL3uwdA4+Oycj4aetaiy2bVS4tEREU628FwI3088wr01QWZ6tLvIWOvvET7+Sa8Qcg5MANt2kD/K/yvGV7PHb1PMEoBfjd3PsDiEmAaWgaxQ4JUxXvIrXyBiimvoZgqLP2e6m2+PyNQeKeUJf61MMFBTiRE5YyDWownX3coN1RUb0nIOGdtWTarR4iY2BYSt6STB3BJ3F3vlcxQ2uu+3QLR95gTYBwVqNpqPpafqPdDNfqC5DPsZ2XWt8WCGrb9mt02Xi3JulAWYI1jxnzRUeUtkk8z8=
x-ms-exchange-transport-forked: True
Content-Type: multipart/alternative; boundary="_000_BL0PR00MB083637DAD075EC8E5342A0A9F0A59BL0PR00MB0836namp_"
MIME-Version: 1.0
X-OriginatorOrg: microsoft.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: BL0PR00MB0836.namprd00.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: b397278c-b663-4763-daea-08d8bb2d4b4b
X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Jan 2021 21:17:28.3721 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: 8dGWFjqQ8d41zb0swhS7JBf3usHdireTdUvJ38LNdpclH5AyAUx0+pxbQo6qlh4b0R0zbDKPzEsrh61jVXQdPQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL0PR00MB0753
Archived-At: <https://mailarchive.ietf.org/arch/msg/httpapi/aUY9wl7Qlns5_8lsd7v95TRcnqs>
Subject: Re: [httpapi] Discussion about JSON payloads and code generation
X-BeenThere: httpapi@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Building Blocks for HTTP APIs <httpapi.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/httpapi>, <mailto:httpapi-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/httpapi/>
List-Post: <mailto:httpapi@ietf.org>
List-Help: <mailto:httpapi-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/httpapi>, <mailto:httpapi-request@ietf.org?subject=subscribe>
X-List-Received-Date: Sun, 17 Jan 2021 21:17:44 -0000
Christoph, From: Christoph Kappestein <christoph.kappestein@gmail.com> Thank you for the feedback. I understand that it is not easy possible to change the schema specification but I had the hope that the OpenAPI spec will be in future versions more JSON schema independent. I.e. that a user could use XSD, JTD, Protobuf or any other specification to describe the request/response payload, also for payloads in the future which are not JSON. So that a user is not forced to use JSON schema and that an alternative could emerge. There is a proposal for supporting an "Alternative Schema" https://github.com/OAI/OpenAPI-Specification/blob/master/proposals/001_Alternative%20Schema%20Proposal.md Implementation feedback was that that the current proposal is too complex to implement, so we likely will be revisiting it once OpenAPI 3.1 is released. A core editor from the JSON schema spec has already approached me regarding a vocabulary, but from my point of view I think that those vocabularies inherit many properties from JSON schema which are not ideal for code generation. In the spirit of "do one thing and do it well" we could have different specifications for specific use cases, which would be a much more flexible framework than forcing every schema to be a vocabulary. A generator could then support only specific schema types. Speaking purely as an individual, I think extending JSON Schema would be a better first step. Getting traction in this space is hard, and successfully mapping to the type systems of multiple platforms is a problem that people have been failing at for decades, no matter how focused the effort was. Having said that. I wonder if this working group would be the right place to create a specification that describes an extended set of primitive data types and corresponding text-based wire representations. JSON Schema completely punts on anything beyond what JSON defines for type, and format is left as implementation dependent. I could imagine this kind of standardization would be helpful for query parameter values, header values as well as a range of media types used as payloads. I'm thinking of a single RFC that describes a set of serializations used in HTTP APIs. Things like date-time, times, durations, currency, coordinates, language identifiers, etc. It could also provide a standardized type identifier to use in complex type definition/validation specifications I think it would be useful when writing specifications to be able to reference a single spec and say primitive values are serialized as per RFCXXXX. Looking at the structured headers spec, they have done this work for a few core data types that are common in headers. https://httpwg.org/http-extensions/draft-ietf-httpbis-header-structure.html#section-4.1.3.1 So, bringing this back to TypeSchema. Do you think that it would be useful for TypeSchema if there existed a standardized rich set of primitive data types for HTTP APIs that were platform independent and optimized for wire representations? I'm pretty sure the JSON Schema folks would be delighted if there were some well known values that could be used with format keyword. The OpenAPI specification defines a few formats (https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.1.0.md#data-types) and we continue to get requests for more, but I'm not convinced the OpenAPI specification is the right place to do that. OData defines a bunch of their own https://docs.oasis-open.org/odata/odata-csdl-json/v4.01/odata-csdl-json-v4.01.html#_Toc38466396 The feels like something that if properly scoped and standardized could make life easier for a bunch of different efforts. Thoughts? Darrel
- [httpapi] Discussion about JSON payloads and code… Christoph Kappestein
- Re: [httpapi] Discussion about JSON payloads and … Darrel Miller
- Re: [httpapi] Discussion about JSON payloads and … Christoph Kappestein
- Re: [httpapi] Discussion about JSON payloads and … Jason Desrosiers
- Re: [httpapi] Discussion about JSON payloads and … Darrel Miller
- Re: [httpapi] Discussion about JSON payloads and … Asbjørn Ulsberg
- Re: [httpapi] Discussion about JSON payloads and … Christoph Kappestein
- Re: [httpapi] Discussion about JSON payloads and … Darrel Miller