From e548414eddacd6aada18299f97b0626edafdd998 Mon Sep 17 00:00:00 2001
From: chris48s <chris48s@users.noreply.github.com>
Date: Sat, 30 Dec 2023 17:38:42 +0000
Subject: [PATCH] convert 'style' param to enum (#9853)

* convert 'style' param to enum

* update test
---
 core/base-service/openapi.js      | 4 ++--
 core/base-service/openapi.spec.js | 8 +++++---
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/core/base-service/openapi.js b/core/base-service/openapi.js
index a43c08eea4..44f61242e9 100644
--- a/core/base-service/openapi.js
+++ b/core/base-service/openapi.js
@@ -241,10 +241,10 @@ function category2openapi(category, services) {
           name: 'style',
           in: 'query',
           required: false,
-          description:
-            'One of: flat (default), flat-square, plastic, for-the-badge, social',
+          description: 'If not specified, the defautl style is "flat".',
           schema: {
             type: 'string',
+            enum: ['flat', 'flat-square', 'plastic', 'for-the-badge', 'social'],
           },
           example: 'flat',
         },
diff --git a/core/base-service/openapi.spec.js b/core/base-service/openapi.spec.js
index 13968bea7a..7c97ed90a4 100644
--- a/core/base-service/openapi.spec.js
+++ b/core/base-service/openapi.spec.js
@@ -88,9 +88,11 @@ const expected = {
         name: 'style',
         in: 'query',
         required: false,
-        description:
-          'One of: flat (default), flat-square, plastic, for-the-badge, social',
-        schema: { type: 'string' },
+        description: 'If not specified, the defautl style is "flat".',
+        schema: {
+          enum: ['flat', 'flat-square', 'plastic', 'for-the-badge', 'social'],
+          type: 'string',
+        },
         example: 'flat',
       },
       logo: {
-- 
GitLab