feat(swagger): Bypass API 카탈로그 Swagger 딥링크 연동 (#142)
- Swagger UI deep-linking 활성화 (springdoc 설정) - 카탈로그 테스트 버튼 클릭 시 해당 API operation으로 딥링크 이동 - Swagger Bypass API 설명 업데이트
This commit is contained in:
부모
7212566b9f
커밋
e8a8d9d6fd
@ -36,7 +36,16 @@ const METHOD_COLORS: Record<string, string> = {
|
||||
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<BypassConfig[]>([]);
|
||||
@ -89,7 +98,7 @@ export default function BypassCatalog() {
|
||||
</p>
|
||||
</div>
|
||||
<a
|
||||
href={SWAGGER_URL}
|
||||
href={SWAGGER_BASE}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="px-4 py-2 text-sm font-medium text-white bg-wing-accent hover:bg-wing-accent/80 rounded-lg transition-colors no-underline"
|
||||
@ -236,7 +245,7 @@ export default function BypassCatalog() {
|
||||
)}
|
||||
<div className="pt-1 border-t border-wing-border mt-auto">
|
||||
<a
|
||||
href={SWAGGER_URL}
|
||||
href={buildSwaggerDeepLink(config)}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="text-xs font-medium text-blue-500 hover:text-blue-600 no-underline transition-colors"
|
||||
@ -291,7 +300,7 @@ export default function BypassCatalog() {
|
||||
</td>
|
||||
<td className="px-4 py-3 text-right">
|
||||
<a
|
||||
href={SWAGGER_URL}
|
||||
href={buildSwaggerDeepLink(config)}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="text-xs font-medium text-blue-500 hover:text-blue-600 no-underline transition-colors"
|
||||
|
||||
@ -88,7 +88,7 @@ public class SwaggerConfig {
|
||||
.addOpenApiCustomizer(openApi -> {
|
||||
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"));
|
||||
})
|
||||
|
||||
@ -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
|
||||
|
||||
불러오는 중...
Reference in New Issue
Block a user