From 754993e4f30678a4ab556410496ad3147fed97dd Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 5 Sep 2024 14:58:12 +0000 Subject: [PATCH 1/4] Update from https://github.com/glideapps/glide/commit/6dc70d8651aa556db3175ad03fe80de4b4b3102d --- openapi/swagger.json | 44 ++++++++++++++++++++++++++++++++++---------- 1 file changed, 34 insertions(+), 10 deletions(-) diff --git a/openapi/swagger.json b/openapi/swagger.json index 292dcc6..82044c3 100644 --- a/openapi/swagger.json +++ b/openapi/swagger.json @@ -215,8 +215,17 @@ } } }, - "description": "Creates a new Big Table", "parameters": [ + { + "name": "name", + "in": "query", + "schema": { + "type": "string", + "description": "Name of the table. Required when the name is not passed in the request body. It is an error to pass a name in both this query parameter and the request body.", + "example": "Invoices" + }, + "required": false + }, { "name": "onSchemaError", "in": "query", @@ -386,9 +395,24 @@ ], "additionalProperties": false } + }, + "text/csv": { + "schema": { + "type": "string", + "description": "A CSV string. The first line is column IDs, and each subsequent line is a row of data. The schema will be inferred from the data. The name of the table must be passed in the query parameter `name`.", + "example": "Name,Age,Birthday\nAlice,25,2024-08-29T09:46:16.722Z\nBob,30,2020-01-15T09:00:16.722Z" + } + }, + "text/tab-separated-values": { + "schema": { + "type": "string", + "description": "A TSV string. The first line is column IDs, and each subsequent line is a row of data. The schema will be inferred from the data. The name of the table must be passed in the query parameter `name`.", + "example": "Name\tAge\tBirthday\nAlice\t25\t2024-08-29T09:46:16.722Z\nBob\t30\t2020-01-15T09:00:16.722Z" + } } } - } + }, + "description": "Creates a new Big Table" } }, "/tables/{tableID}": { @@ -537,7 +561,6 @@ } } }, - "description": "Overwrites a Big Table with new schema and/or data", "parameters": [ { "name": "tableID", @@ -714,7 +737,8 @@ } } } - } + }, + "description": "Overwrites a Big Table with new schema and/or data" } }, "/tables/{tableID}/rows": { @@ -862,7 +886,6 @@ } } }, - "description": "Adds rows to a Big Table", "parameters": [ { "name": "tableID", @@ -937,7 +960,8 @@ } } } - } + }, + "description": "Adds rows to a Big Table" } }, "/stashes/{stashID}/{serial}": { @@ -989,7 +1013,6 @@ } } }, - "description": "Sets the content of a chunk of data inside a stash", "parameters": [ { "name": "stashID", @@ -1041,7 +1064,8 @@ } } } - } + }, + "description": "Sets the content of a chunk of data inside a stash" } }, "/stashes/{stashID}": { @@ -1093,7 +1117,6 @@ } } }, - "description": "Deletes a stash and all its data", "parameters": [ { "name": "stashID", @@ -1106,7 +1129,8 @@ }, "required": true } - ] + ], + "description": "Deletes a stash and all its data" } } }, From 54455fc2ec0f7cc1fc2fe22e01ab49a7c5234be5 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 16 Sep 2024 15:29:09 +0000 Subject: [PATCH 2/4] Update from https://github.com/glideapps/glide/commit/905b43572394c979718e88e1064616b54def67ba --- openapi/swagger.json | 44 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/openapi/swagger.json b/openapi/swagger.json index 82044c3..fbd97ae 100644 --- a/openapi/swagger.json +++ b/openapi/swagger.json @@ -735,10 +735,24 @@ ], "additionalProperties": false } + }, + "text/csv": { + "schema": { + "type": "string", + "description": "A CSV string. The first line is column IDs, and each subsequent line is a row of data.", + "example": "Name,Age,Birthday\nAlice,25,2024-08-29T09:46:16.722Z\nBob,30,2020-01-15T09:00:16.722Z" + } + }, + "text/tab-separated-values": { + "schema": { + "type": "string", + "description": "A TSV string. The first line is column IDs, and each subsequent line is a row of data.", + "example": "Name\tAge\tBirthday\nAlice\t25\t2024-08-29T09:46:16.722Z\nBob\t30\t2020-01-15T09:00:16.722Z" + } } } }, - "description": "Overwrites a Big Table with new schema and/or data" + "description": "Replaces the schema and/or data of a Big Table" } }, "/tables/{tableID}/rows": { @@ -958,6 +972,20 @@ } ] } + }, + "text/csv": { + "schema": { + "type": "string", + "description": "A CSV string. The first line is column IDs, and each subsequent line is a row of data.", + "example": "Name,Age,Birthday\nAlice,25,2024-08-29T09:46:16.722Z\nBob,30,2020-01-15T09:00:16.722Z" + } + }, + "text/tab-separated-values": { + "schema": { + "type": "string", + "description": "A TSV string. The first line is column IDs, and each subsequent line is a row of data.", + "example": "Name\tAge\tBirthday\nAlice\t25\t2024-08-29T09:46:16.722Z\nBob\t30\t2020-01-15T09:00:16.722Z" + } } } }, @@ -1062,6 +1090,20 @@ } ] } + }, + "text/csv": { + "schema": { + "type": "string", + "description": "A CSV string. The first line is column IDs, and each subsequent line is a row of data.", + "example": "Name,Age,Birthday\nAlice,25,2024-08-29T09:46:16.722Z\nBob,30,2020-01-15T09:00:16.722Z" + } + }, + "text/tab-separated-values": { + "schema": { + "type": "string", + "description": "A TSV string. The first line is column IDs, and each subsequent line is a row of data.", + "example": "Name\tAge\tBirthday\nAlice\t25\t2024-08-29T09:46:16.722Z\nBob\t30\t2020-01-15T09:00:16.722Z" + } } } }, From 4eed1e97df56bc4c497471163fdc4078843d47f8 Mon Sep 17 00:00:00 2001 From: Alex Corrado Date: Tue, 17 Sep 2024 15:44:14 +0100 Subject: [PATCH 3/4] Update changelog.mdx --- api-reference/v2/resources/changelog.mdx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/api-reference/v2/resources/changelog.mdx b/api-reference/v2/resources/changelog.mdx index 4c3e3db..051622b 100644 --- a/api-reference/v2/resources/changelog.mdx +++ b/api-reference/v2/resources/changelog.mdx @@ -3,6 +3,10 @@ title: Glide API Changelog sidebarTitle: Changelog --- +### September 18, 2024 + +- Endpoints that receive tabular data can now accept CSV and TSV request bodies. + ### September 13, 2024 - Introduced a new "Limits" document that outlines rate and operational limits for the API. From 05b6569cecaae98194b04d0b09f1c826d32f24eb Mon Sep 17 00:00:00 2001 From: Alex Corrado Date: Tue, 17 Sep 2024 16:01:24 +0100 Subject: [PATCH 4/4] Add info about using CSV and TSV request bodies --- api-reference/v2/stashing/put-stashes-serial.mdx | 2 ++ api-reference/v2/tables/post-table-rows.mdx | 2 ++ api-reference/v2/tables/post-tables.mdx | 2 ++ api-reference/v2/tables/put-tables.mdx | 2 ++ 4 files changed, 8 insertions(+) diff --git a/api-reference/v2/stashing/put-stashes-serial.mdx b/api-reference/v2/stashing/put-stashes-serial.mdx index e1f1077..a619f4c 100644 --- a/api-reference/v2/stashing/put-stashes-serial.mdx +++ b/api-reference/v2/stashing/put-stashes-serial.mdx @@ -5,6 +5,8 @@ openapi: put /stashes/{stashID}/{serial} When using large datasets with the Glide API, it may be necessary to break them into smaller chunks for performance and reliability. We call this process "stashing." +Tabular data may be stashed in JSON, CSV, or TSV format. + To learn more about stashing and how to use it to work with large datasets, please see our [introduction to stashing](/api-reference/v2/stashing/introduction). diff --git a/api-reference/v2/tables/post-table-rows.mdx b/api-reference/v2/tables/post-table-rows.mdx index 9e3239f..47899ca 100644 --- a/api-reference/v2/tables/post-table-rows.mdx +++ b/api-reference/v2/tables/post-table-rows.mdx @@ -5,6 +5,8 @@ openapi: post /tables/{tableID}/rows Add row data to an existing Big Table. +Row data may be passed in JSON, CSV, or TSV format. + ## Examples diff --git a/api-reference/v2/tables/post-tables.mdx b/api-reference/v2/tables/post-tables.mdx index a947b17..1d2249c 100644 --- a/api-reference/v2/tables/post-tables.mdx +++ b/api-reference/v2/tables/post-tables.mdx @@ -5,6 +5,8 @@ openapi: post /tables Create a new Big Table, define its structure, and (optionally) populate it with data. +When using a CSV or TSV request body, the name of the table must be passed as a query parameter and the schema of the table is inferred from the content. Alternatively, the CSV/TSV content may be [stashed](/api-reference/v2/stashing/introduction), and then the schema and name may be passed in the regular JSON payload. + ## Examples diff --git a/api-reference/v2/tables/put-tables.mdx b/api-reference/v2/tables/put-tables.mdx index b119370..eaf42a7 100644 --- a/api-reference/v2/tables/put-tables.mdx +++ b/api-reference/v2/tables/put-tables.mdx @@ -5,6 +5,8 @@ openapi: put /tables/{tableID} Overwrite an existing Big Table by clearing all rows and adding new data. You can also update the table schema. +When using a CSV or TSV request body, you cannot pass a schema. The current schema will be used. If you need to update the schema, use the `onSchemaError=updateSchema` query parameter, or [stash](/api-reference/v2/stashing/introduction) the CSV/TSV data and pass a JSON request body. + This is a destructive operation that cannot be undone.