From 85f11820e0b7229c47c3b109b8fa0af336767641 Mon Sep 17 00:00:00 2001 From: Jonathan Cobb Date: Thu, 3 Dec 2020 17:14:05 -0500 Subject: [PATCH] update openapi tag names and descriptions --- .../bubble/server/BubbleConfiguration.java | 5 ++- .../META-INF/bubble/openapi-tags.json | 32 +++++++++---------- 2 files changed, 20 insertions(+), 17 deletions(-) diff --git a/bubble-server/src/main/java/bubble/server/BubbleConfiguration.java b/bubble-server/src/main/java/bubble/server/BubbleConfiguration.java index efd09bd3..d8706a02 100644 --- a/bubble-server/src/main/java/bubble/server/BubbleConfiguration.java +++ b/bubble-server/src/main/java/bubble/server/BubbleConfiguration.java @@ -73,6 +73,7 @@ import static org.cobbzilla.util.io.FileUtil.abs; import static org.cobbzilla.util.io.StreamUtil.loadResourceAsStream; import static org.cobbzilla.util.io.StreamUtil.stream2string; import static org.cobbzilla.util.json.JsonUtil.json; +import static org.cobbzilla.util.reflect.ReflectionUtil.constValue; import static org.cobbzilla.util.reflect.ReflectionUtil.copy; import static org.cobbzilla.util.security.ShaUtil.sha256_file; import static org.cobbzilla.util.security.ShaUtil.sha256_hex; @@ -116,7 +117,9 @@ public class BubbleConfiguration extends PgRestServerConfiguration public BubbleConfiguration (BubbleConfiguration other) { copy(this, other); } @Override protected List initOpenApiTags () { - return Arrays.asList(json(stream2string("META-INF/bubble/openapi-tags.json"), Tag[].class)); + return Arrays.stream(json(stream2string("META-INF/bubble/openapi-tags.json"), Tag[].class)) + .map(t -> t.name(constValue(ApiConstants.class, "API_TAG_"+t.getName().toUpperCase()))) + .collect(Collectors.toList()); } @Getter @Setter private int defaultSslPort = 1443; diff --git a/bubble-server/src/main/resources/META-INF/bubble/openapi-tags.json b/bubble-server/src/main/resources/META-INF/bubble/openapi-tags.json index c6727841..da2a9bf1 100644 --- a/bubble-server/src/main/resources/META-INF/bubble/openapi-tags.json +++ b/bubble-server/src/main/resources/META-INF/bubble/openapi-tags.json @@ -1,18 +1,18 @@ [ { "name": "activation", - "description": "When first starting a Bubble from scratch, it needs to be activated. Packer images are also needed to launch new Bubbles.", + "description": "When first starting a Bubble from scratch, it needs to be activated. Packer images are also needed to launch new Bubbles.\n\nMore information about activation is available in the [Bubble Launch Guide](https://git.bubblev.org/bubblev/bubble/src/branch/master/docs/activation.md)", "externalDocs": { - "description": "More information about activation is available in the Bubble Launch Guide", - "url": "https://git.bubblev.org/bubblev/bubble/src/branch/master/docs/activation.md" + "description": "", + "url": "" } }, { "name": "auth", - "description": "These API endpoints are all about registration, login, and logout. Various actions in Bubble also require approval from a verified contact, those API calls are described here as well.", + "description": "These API endpoints are all about registration, login, and logout. Various actions in Bubble also require approval from a verified contact, those API calls are described here as well.\n\nMore information about authentication is available in the [Bubble API Guide](https://github.com/getbubblenow/bubble-docs/blob/master/api/auth.md)", "externalDocs": { - "description": "More information about authentication is available in the Bubble API Guide", - "url": "https://github.com/getbubblenow/bubble-docs/blob/master/api/auth.md" + "description": "", + "url": "" } }, { @@ -25,30 +25,30 @@ }, { "name": "apps", - "description": "These APIs are about managing your Bubble apps from your Bubble." + "description": "View and manage Bubble apps on your Bubble." }, { "name": "app_runtime", - "description": "These APIs are called by apps that your Bubble has activated for various requests." + "description": "Bubble apps call these APIs when they are running on a client device." }, { "name": "backup_restore", - "description": "APIs used during backup and restore operations." + "description": "Backup and restore operations." }, { "name": "clouds", - "description": "APIs for launching Bubbles and accessing cloud services." + "description": "Launching Bubbles and accessing cloud services." }, { "name": "debug", - "description": "APIs for debugging." + "description": "Useful for debugging during development and testing. Debug APIs are disabled (or return no data) when running outside of a development environment." }, { "name": "devices", - "description": "Device management. Add, connect, and remove devices. View device status and more.", + "description": "Device management. Add, connect, and remove devices. View device status and more.\n\nMore information about devices is available in the [Bubble API Guide](https://github.com/getbubblenow/bubble-docs/blob/master/api/devices.md)", "externalDocs": { - "description": "More information about devices is available in the Bubble API Guide", - "url": "https://github.com/getbubblenow/bubble-docs/blob/master/api/devices.md" + "description": "", + "url": "" } }, { @@ -57,7 +57,7 @@ }, { "name": "node", - "description": "Bubbles communicate with each other using these APIs." + "description": "Bubble nodes communicate with each other using these APIs." }, { "name": "node_manager", @@ -65,7 +65,7 @@ }, { "name": "payment", - "description": "Payment APIs are disabled by default. For more information about using Bubble with payments enabled, contact licensing@getbubblenow.com" + "description": "Payment APIs are disabled by default.\n\nFor more information about using Bubble with payments enabled, contact [licensing@getbubblenow.com](mailto:licensing@getbubblenow.com)" }, { "name": "search",