Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V1 스마트라우팅 가이드 추가 #665

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/layouts/rest-api/schema-utils/type-def.ts
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,15 @@
result.add(ref);
rootPropertyRefsCrawler.visitTypeDef(typeDef);
},
visitResponseProperties(properties: Record<string, any>) {

Check failure on line 210 in src/layouts/rest-api/schema-utils/type-def.ts

View workflow job for this annotation

GitHub Actions / Lint code and MDX files

Unexpected any. Specify a different type
for (const [_, value] of Object.entries(properties)) {
if (value.$ref) {

Check failure on line 212 in src/layouts/rest-api/schema-utils/type-def.ts

View workflow job for this annotation

GitHub Actions / Lint code and MDX files

Unsafe member access .$ref on an `any` value
this.visitResponseRef(value.$ref || "");

Check failure on line 213 in src/layouts/rest-api/schema-utils/type-def.ts

View workflow job for this annotation

GitHub Actions / Lint code and MDX files

Unsafe argument of type `any` assigned to a parameter of type `string`

Check failure on line 213 in src/layouts/rest-api/schema-utils/type-def.ts

View workflow job for this annotation

GitHub Actions / Lint code and MDX files

Unsafe member access .$ref on an `any` value
} else if (value.properties) {

Check failure on line 214 in src/layouts/rest-api/schema-utils/type-def.ts

View workflow job for this annotation

GitHub Actions / Lint code and MDX files

Unsafe member access .properties on an `any` value
this.visitResponseProperties(value.properties);

Check failure on line 215 in src/layouts/rest-api/schema-utils/type-def.ts

View workflow job for this annotation

GitHub Actions / Lint code and MDX files

Unsafe argument of type `any` assigned to a parameter of type `Record<string, any>`

Check failure on line 215 in src/layouts/rest-api/schema-utils/type-def.ts

View workflow job for this annotation

GitHub Actions / Lint code and MDX files

Unsafe member access .properties on an `any` value
}
}
},
};
for (const group of endpointGroups) {
for (const { path, method } of group.endpoints) {
Expand Down
18 changes: 13 additions & 5 deletions src/layouts/rest-api/schema-utils/visitor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,19 @@
visitRequestRef(_ref: string) {},
visitResponse(_statusCode: string, response: Response) {
if (response.schema) {
this.visitResponseRef(response.schema.$ref || "");
} else if (response.content?.["application/json"]?.schema.$ref) {
if (response.schema.$ref) {
this.visitResponseRef(response.schema.$ref || "" );

Check failure on line 41 in src/layouts/rest-api/schema-utils/visitor.ts

View workflow job for this annotation

GitHub Actions / Lint code and MDX files

Delete `·`
} else if (response.schema.properties) { // schema 하위 properties가 있는 경우 처리

Check failure on line 42 in src/layouts/rest-api/schema-utils/visitor.ts

View workflow job for this annotation

GitHub Actions / Lint code and MDX files

Insert `⏎·······`
this.visitResponseProperties(response.schema.properties);
}
} else if (response.content?.["application/json"]?.schema) {
const schema = response.content["application/json"].schema;
// TODO: handle others (e.g. "text/csv")
this.visitResponseRef(
response.content["application/json"].schema.$ref || "",
);
if (schema.$ref) {
this.visitResponseRef(schema.$ref || "" );

Check failure on line 49 in src/layouts/rest-api/schema-utils/visitor.ts

View workflow job for this annotation

GitHub Actions / Lint code and MDX files

Delete `·`
} else if (schema.properties) {
this.visitResponseProperties(schema.properties);
}
}
},
visitResponseRef(_ref: string) {},
Expand All @@ -63,4 +70,5 @@
}
},
visitProperty(_name: string, _property: Property) {},
visitResponseProperties(_properties: Record<string, any>) {},
} as const;
4 changes: 4 additions & 0 deletions src/routes/(root)/opi/ko/_nav.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,10 @@
- /ko/extra/identity-verification/v1/credit-auth/3
- /ko/extra/identity-verification/v1/credit-auth/4
- /ko/extra/confirm-process/readme-v1
- slug: /ko/extra/smart-routing/intro
items:
- /ko/extra/smart-routing/console-guide
- /ko/extra/smart-routing/integration
- slug: /ko/extra/promotion/intro
items:
- /ko/extra/promotion/console-guide
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: 스마트 라우팅 - 콘솔 가이드
description: >-
멀티PG 환경을 클릭 한 번으로 쉽게 만들 수 있는 결제 트래픽 분산 자동화 서비스 입니다.
targetVersions: ["v2"]
targetVersions: ["v1", "v2"]
---

import Figure from "~/components/Figure";
Expand All @@ -17,7 +17,6 @@ import Image5 from "./_assets/sr_console_5.png";
<Hint style="info">
스마트 라우팅 기능이 궁금하다면 [스마트 라우팅 기능 소개](/opi/ko/extra/smart-routing/intro)를 확인해 보세요!

스마트 라우팅은 **V2 결제 서비스 이용시**에만 사용이 가능합니다.
</Hint>

## 스마트 라우팅 그룹 생성하기
Expand Down
Loading
Loading