From b5b9b01fcce17b8368e9d9cba63ec626a2143d6b Mon Sep 17 00:00:00 2001 From: Roman Kalyakin Date: Thu, 4 Apr 2024 09:11:49 +0200 Subject: [PATCH] Update articles schema to fix UID pattern --- src/services/articles/articles.schema.ts | 16 +++++++++++++++- src/services/index.ts | 3 +-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/src/services/articles/articles.schema.ts b/src/services/articles/articles.schema.ts index bd3ab7fa..d18eb87d 100644 --- a/src/services/articles/articles.schema.ts +++ b/src/services/articles/articles.schema.ts @@ -38,7 +38,7 @@ const findParameters: QueryParameter[] = [ }, q: { type: 'string', - pattern: String(REGEX_UID), + pattern: String(REGEX_UID).slice(1, -1), }, }, }, @@ -79,5 +79,19 @@ export const docs: ServiceSwaggerOptions = { description: 'Find articles that match the given query', parameters: findParameters, }, + get: { + description: 'Get an article by its UID', + parameters: [ + { + in: 'path', + name: 'id', + required: true, + schema: { + type: 'string', + }, + description: 'UID of the article', + }, + ], + }, }, }; diff --git a/src/services/index.ts b/src/services/index.ts index 8d3c3337..2d20f65b 100644 --- a/src/services/index.ts +++ b/src/services/index.ts @@ -3,7 +3,7 @@ import { logger } from '../logger'; import media from './media'; import proxy from './proxy'; -const publicApiServices = ['search', 'articles', 'users']; +const publicApiServices = ['search', 'articles', 'users', 'collectable-items']; const internalApiServices = [ 'users', 'entities', @@ -18,7 +18,6 @@ const internalApiServices = [ 'buckets-items', 'search-exporter', 'collections', - 'collectable-items', 'topics', 'init', 'pages-timelines',