From a79edf109839fe4de13a4446173a5820f9b05751 Mon Sep 17 00:00:00 2001 From: Lisa Cawley Date: Mon, 27 May 2024 10:15:51 -0700 Subject: [PATCH] [HTTP/OAS] Add descriptions for short URL APIs (#184267) --- .../url_service/http/short_urls/register_create_route.ts | 4 ++++ .../url_service/http/short_urls/register_delete_route.ts | 4 ++++ .../server/url_service/http/short_urls/register_get_route.ts | 4 ++++ .../url_service/http/short_urls/register_resolve_route.ts | 4 ++++ 4 files changed, 16 insertions(+) diff --git a/src/plugins/share/server/url_service/http/short_urls/register_create_route.ts b/src/plugins/share/server/url_service/http/short_urls/register_create_route.ts index 97594837f0720..0848fdfbfe605 100644 --- a/src/plugins/share/server/url_service/http/short_urls/register_create_route.ts +++ b/src/plugins/share/server/url_service/http/short_urls/register_create_route.ts @@ -15,6 +15,10 @@ export const registerCreateRoute = (router: IRouter, url: ServerUrlService) => { router.post( { path: '/api/short_url', + options: { + access: 'public', + description: `Create a short URL`, + }, validate: { body: schema.object({ locatorId: schema.string({ diff --git a/src/plugins/share/server/url_service/http/short_urls/register_delete_route.ts b/src/plugins/share/server/url_service/http/short_urls/register_delete_route.ts index ddc29117a3acc..258faff0d04a6 100644 --- a/src/plugins/share/server/url_service/http/short_urls/register_delete_route.ts +++ b/src/plugins/share/server/url_service/http/short_urls/register_delete_route.ts @@ -14,6 +14,10 @@ export const registerDeleteRoute = (router: IRouter, url: ServerUrlService) => { router.delete( { path: '/api/short_url/{id}', + options: { + access: 'public', + description: `Delete a short URL`, + }, validate: { params: schema.object({ id: schema.string({ diff --git a/src/plugins/share/server/url_service/http/short_urls/register_get_route.ts b/src/plugins/share/server/url_service/http/short_urls/register_get_route.ts index 8e783b3fcfd3d..ae108ccd11d97 100644 --- a/src/plugins/share/server/url_service/http/short_urls/register_get_route.ts +++ b/src/plugins/share/server/url_service/http/short_urls/register_get_route.ts @@ -14,6 +14,10 @@ export const registerGetRoute = (router: IRouter, url: ServerUrlService) => { router.get( { path: '/api/short_url/{id}', + options: { + access: 'public', + description: `Get a short URL`, + }, validate: { params: schema.object({ id: schema.string({ diff --git a/src/plugins/share/server/url_service/http/short_urls/register_resolve_route.ts b/src/plugins/share/server/url_service/http/short_urls/register_resolve_route.ts index 47290d5754545..6076889945f36 100644 --- a/src/plugins/share/server/url_service/http/short_urls/register_resolve_route.ts +++ b/src/plugins/share/server/url_service/http/short_urls/register_resolve_route.ts @@ -15,6 +15,10 @@ export const registerResolveRoute = (router: IRouter, url: ServerUrlService) => router.get( { path: '/api/short_url/_slug/{slug}', + options: { + access: 'public', + description: `Resolve a short URL`, + }, validate: { params: schema.object({ slug: schema.string({