From 3becf1b8a4ad6a6a2b49d44e31c366cfb481c3f2 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Mon, 7 Mar 2022 13:21:30 +0000 Subject: [PATCH 1/2] Adding the tenant ID to the Budibase Cloud URL, as well as setting up variables for them all as part of the server URL. --- packages/server/specs/generate.js | 21 +++++++++++++++++++-- packages/server/specs/openapi.json | 24 ++++++++++++++++++++---- packages/server/specs/openapi.yaml | 16 ++++++++++++++-- 3 files changed, 53 insertions(+), 8 deletions(-) diff --git a/packages/server/specs/generate.js b/packages/server/specs/generate.js index d037eb8e59..97a2abb71c 100644 --- a/packages/server/specs/generate.js +++ b/packages/server/specs/generate.js @@ -17,12 +17,29 @@ const options = { }, servers: [ { - url: "http://budibase.app/api/public/v1", + url: "https://{organisationId}.budibase.app/api/public/v1", description: "Budibase Cloud API", + variables: { + organisationId: { + default: "organisation", + description: "The organisation you are attempting to access.", + }, + }, }, { - url: "{protocol}://{hostname}:10000/api/public/v1", + url: "{protocol}://{hostname}/api/public/v1", description: "Budibase self hosted API", + variables: { + protocol: { + default: "http", + description: + "Whether HTTP or HTTPS should be used to communicate with your Budibase instance.", + }, + hostname: { + default: "localhost:10000", + description: "The URL of your Budibase instance.", + }, + }, }, ], components: { diff --git a/packages/server/specs/openapi.json b/packages/server/specs/openapi.json index 3e68d3edca..00f69f2815 100644 --- a/packages/server/specs/openapi.json +++ b/packages/server/specs/openapi.json @@ -7,12 +7,28 @@ }, "servers": [ { - "url": "http://budibase.app/api/public/v1", - "description": "Budibase Cloud API" + "url": "https://{organisationId}.budibase.app/api/public/v1", + "description": "Budibase Cloud API", + "variables": { + "organisationId": { + "default": "organisation", + "description": "The organisation you are attempting to access." + } + } }, { - "url": "{protocol}://{hostname}:10000/api/public/v1", - "description": "Budibase self hosted API" + "url": "{protocol}://{hostname}/api/public/v1", + "description": "Budibase self hosted API", + "variables": { + "protocol": { + "default": "http", + "description": "Whether HTTP or HTTPS should be used to communicate with your Budibase instance." + }, + "hostname": { + "default": "localhost:10000", + "description": "The URL of your Budibase instance." + } + } } ], "components": { diff --git a/packages/server/specs/openapi.yaml b/packages/server/specs/openapi.yaml index 298eb73636..5decd65f6d 100644 --- a/packages/server/specs/openapi.yaml +++ b/packages/server/specs/openapi.yaml @@ -4,10 +4,22 @@ info: description: The public API for Budibase apps and its services. version: 1.0.0 servers: - - url: http://budibase.app/api/public/v1 + - url: https://{organisationId}.budibase.app/api/public/v1 description: Budibase Cloud API - - url: "{protocol}://{hostname}:10000/api/public/v1" + variables: + organisationId: + default: organisation + description: The organisation you are attempting to access. + - url: "{protocol}://{hostname}/api/public/v1" description: Budibase self hosted API + variables: + protocol: + default: http + description: Whether HTTP or HTTPS should be used to communicate with your + Budibase instance. + hostname: + default: localhost:10000 + description: The URL of your Budibase instance. components: parameters: tableId: From 5bbbcde97808db0cd8e09fe1774fc8f00ce4dad2 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Mon, 7 Mar 2022 16:41:22 +0000 Subject: [PATCH 2/2] Removing org ID from cloud spec. --- packages/server/specs/generate.js | 8 +------- packages/server/specs/openapi.json | 10 ++-------- packages/server/specs/openapi.yaml | 6 +----- 3 files changed, 4 insertions(+), 20 deletions(-) diff --git a/packages/server/specs/generate.js b/packages/server/specs/generate.js index 97a2abb71c..f6a055f683 100644 --- a/packages/server/specs/generate.js +++ b/packages/server/specs/generate.js @@ -17,14 +17,8 @@ const options = { }, servers: [ { - url: "https://{organisationId}.budibase.app/api/public/v1", + url: "https://budibase.app/api/public/v1", description: "Budibase Cloud API", - variables: { - organisationId: { - default: "organisation", - description: "The organisation you are attempting to access.", - }, - }, }, { url: "{protocol}://{hostname}/api/public/v1", diff --git a/packages/server/specs/openapi.json b/packages/server/specs/openapi.json index 00f69f2815..229c82230f 100644 --- a/packages/server/specs/openapi.json +++ b/packages/server/specs/openapi.json @@ -7,14 +7,8 @@ }, "servers": [ { - "url": "https://{organisationId}.budibase.app/api/public/v1", - "description": "Budibase Cloud API", - "variables": { - "organisationId": { - "default": "organisation", - "description": "The organisation you are attempting to access." - } - } + "url": "https://budibase.app/api/public/v1", + "description": "Budibase Cloud API" }, { "url": "{protocol}://{hostname}/api/public/v1", diff --git a/packages/server/specs/openapi.yaml b/packages/server/specs/openapi.yaml index 5decd65f6d..6dd1607ae8 100644 --- a/packages/server/specs/openapi.yaml +++ b/packages/server/specs/openapi.yaml @@ -4,12 +4,8 @@ info: description: The public API for Budibase apps and its services. version: 1.0.0 servers: - - url: https://{organisationId}.budibase.app/api/public/v1 + - url: https://budibase.app/api/public/v1 description: Budibase Cloud API - variables: - organisationId: - default: organisation - description: The organisation you are attempting to access. - url: "{protocol}://{hostname}/api/public/v1" description: Budibase self hosted API variables: