From e8a8d9d6fd24ced06fa4fcca2b94fe36440054e4 Mon Sep 17 00:00:00 2001 From: HYOJIN Date: Thu, 2 Apr 2026 17:48:33 +0900 Subject: [PATCH] =?UTF-8?q?feat(swagger):=20Bypass=20API=20=EC=B9=B4?= =?UTF-8?q?=ED=83=88=EB=A1=9C=EA=B7=B8=20Swagger=20=EB=94=A5=EB=A7=81?= =?UTF-8?q?=ED=81=AC=20=EC=97=B0=EB=8F=99=20(#142)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Swagger UI deep-linking 활성화 (springdoc 설정) - 카탈로그 테스트 버튼 클릭 시 해당 API operation으로 딥링크 이동 - Swagger Bypass API 설명 업데이트 --- frontend/src/pages/BypassCatalog.tsx | 17 +++++++++++++---- .../snp/batch/global/config/SwaggerConfig.java | 2 +- src/main/resources/application.yml | 6 ++++++ 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/frontend/src/pages/BypassCatalog.tsx b/frontend/src/pages/BypassCatalog.tsx index e74e7f7..eb2279a 100644 --- a/frontend/src/pages/BypassCatalog.tsx +++ b/frontend/src/pages/BypassCatalog.tsx @@ -36,7 +36,16 @@ const METHOD_COLORS: Record = { DELETE: 'bg-red-100 text-red-700', }; -const SWAGGER_URL = '/snp-api/swagger-ui/index.html?urls.primaryName=3.%20Bypass%20API'; +const SWAGGER_BASE = '/snp-api/swagger-ui/index.html?urls.primaryName=3.%20Bypass%20API'; + +function buildSwaggerDeepLink(config: BypassConfig): string { + // Swagger UI deep link: #/{Tag}/{operationId} + // Tag = domainName 첫글자 대문자 (예: compliance → Compliance) + // operationId = get{EndpointName}Data (SpringDoc 기본 패턴) + const tag = config.domainName.charAt(0).toUpperCase() + config.domainName.slice(1); + const operationId = `get${config.endpointName}Data`; + return `${SWAGGER_BASE}#/${tag}/${operationId}`; +} export default function BypassCatalog() { const [configs, setConfigs] = useState([]); @@ -89,7 +98,7 @@ export default function BypassCatalog() {

{ openApi.info(new Info() .title("Bypass API") - .description("외부 연동용 S&P 데이터 Bypass API") + .description("S&P Global 선박/해운 데이터를 제공합니다.") .version("v1.0.0")); openApi.addSecurityItem(new SecurityRequirement().addList("basicAuth")); }) diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 15de717..ce28d9a 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -70,6 +70,12 @@ management: health: show-details: always +# Springdoc / Swagger UI +springdoc: + swagger-ui: + deep-linking: true + display-request-duration: true + # Logging Configuration (logback-spring.xml에서 상세 설정) logging: config: classpath:logback-spring.xml