OpenAPI ์คํ์ ์ ๋ ฅ์ผ๋ก ๋ฐ์ ์๋ 3๊ฐ์ง ํ๊น์ ์ฝ๋๋ฅผ ์์ฑํ๋ npm ๋ฐฐํฌ์ฉ CLI ํจํค์ง์ ๋๋ค.
- TypeScript Kubb
- Python ํ์ ์ฝ๋
- LangGraph ๋๊ตฌ ์ฝ๋
์ด ํจํค์ง๋ ํน์ ํ๋ก์ ํธ ๊ตฌ์กฐ๋ฅผ ์ ์ ํ์ง ์์ต๋๋ค.
- ์
๋ ฅ ์คํ ๊ฒฝ๋ก๋
--input์ผ๋ก ๋ฐ์ต๋๋ค. - ์ถ๋ ฅ ๋ฃจํธ ๊ฒฝ๋ก๋
--output์ผ๋ก ๋ฐ์ต๋๋ค. - ์์ฑ ํ๊น์
--target์ผ๋ก ๋ฐ์ต๋๋ค.
์ฆ, openapi/openapi.yaml, generated/... ๊ฐ์ ํ๋์ฝ๋ฉ๋ ๊ฒฝ๋ก์ ๋ฌถ์ด์ง ์๊ณ ์ฌ์ฉํ ์ ์๊ฒ ๋ง๋๋ ๊ฒ์ด ๋ชฉ์ ์
๋๋ค.
npm install -D openapi-multitarget-codegen๋๋:
pnpm add -D openapi-multitarget-codegennpm install -g openapi-multitarget-codegen- dev dependency๋ก ์ค์นํ๋ค๋ฉด ๋ค์ ํํ๋ก ์คํํ์ธ์.
npx openapi-multitarget-codegen ...pnpm exec openapi-multitarget-codegen ...
- ์ ์ญ ์ค์นํ ๊ฒฝ์ฐ์๋ง
openapi-multitarget-codegen ...๋ช ๋ น์ ์ง์ ์ฌ์ฉํ ์ ์์ต๋๋ค.
- ์คํ ์ต์ ๊ตฌ์กฐ๋ฅผ ํ์ธํฉ๋๋ค.
- ๋จ์ผ ํ๊น์ผ๋ก ๋จผ์ ์์ฑํด ๋ด ๋๋ค.
- ํ์ํ ๊ฒฝ์ฐ ์ฌ๋ฌ ํ๊น์ ํ ๋ฒ์ ์์ฑํฉ๋๋ค.
- Kubb ๊ณ ๊ธ ์ค์ ์ด ํ์ํ ๋๋ง
--kubb-config๋ชจ๋๋ก ๋์ด๊ฐ๋๋ค.
npx openapi-multitarget-codegen check-spec --input ./specs/openapi.yaml
npx openapi-multitarget-codegen generate --input ./specs/openapi.yaml --output ./generated --target kubb
npx openapi-multitarget-codegen generate --input ./specs/openapi.yaml --output ./generated --target kubb --target python --target langgraph- OpenAPI ์์ฑ ๊ฐ์ด๋:
docs/openapi-authoring-guide.md - ์์ ์คํ:
openapi/openapi.example.yaml
- Repository:
https://github.com/kht2199/openapi-multitarget-codegen - Issues:
https://github.com/kht2199/openapi-multitarget-codegen/issues
OpenAPI ์คํ์ผ๋ก๋ถํฐ TypeScript ํ์ ๋ฐ fetch client๋ฅผ ์์ฑํฉ๋๋ค.
OpenAPI ์คํ์ผ๋ก๋ถํฐ Python ํ์
์ฝ๋๋ฅผ ์์ฑํฉ๋๋ค.
๊ธฐ๋ณธ ์ถ๋ ฅ ๋ชจ๋ธ ํ์
์ pydantic_v2.BaseModel์
๋๋ค.
OpenAPI operation์ ๊ธฐ์ค์ผ๋ก LangGraph/LangChain StructuredTool ์ด์ ์ฝ๋๋ฅผ ์์ฑํฉ๋๋ค.
์ค์:
- LangGraph๋ ์ ์ ์ง์ ํ๊น์ ๋๋ค.
- ํ์ง๋ง ๊ตฌํ์ด ํน์ ํ์ผ ๊ฒฝ๋ก๋ ํน์ ํ๋ก์ ํธ ๋ ์ด์์์ ํ๋์ฝ๋ฉ๋์ด์๋ ์ ๋ฉ๋๋ค.
- ์ด CLI๋ LangGraph ํ๊น๋ ๋ค๋ฅธ ํ๊น๊ณผ ๋์ผํ๊ฒ ์ธ์ ๊ธฐ๋ฐ์ผ๋ก ์์ฑํฉ๋๋ค.
openapi-multitarget-codegen generate --input <spec> --output <dir> --target <kubb|python|langgraph> [--target ...]
openapi-multitarget-codegen check-spec --input <spec>--input <path>(ํ์): OpenAPI ํ์ผ ๊ฒฝ๋ก (.yaml,.yml,.json)--output <dir>(ํ์,generate์ ์ฉ): ์์ฑ ๊ฒฐ๊ณผ๋ฅผ ์ธ ์ถ๋ ฅ ๋ฃจํธ ๋๋ ํฐ๋ฆฌ--target <name>(ํ์,generate์ ์ฉ): ์์ฑ ํ๊น (kubb,python,langgraph)- ์ฌ๋ฌ ๊ฐ๋ฅผ ์์ฑํ๋ ค๋ฉด
--target์ ๋ฐ๋ณตํด์ ๋๊น๋๋ค.
- ์ฌ๋ฌ ๊ฐ๋ฅผ ์์ฑํ๋ ค๋ฉด
--clean(generate์ ์ฉ): ์ถ๋ ฅ ๋ฃจํธ๋ฅผ ๋จผ์ ๋น์๋๋ค.
check-spec์ ํ์ผ ์กด์ฌ ์ฌ๋ถ์ ๊ธฐ๋ณธ ๊ตฌ์กฐ(openapi,paths) ํ์ธ์ ๋ํด, OpenAPI ๋ฌธ์๋ฅผ ์ค์ ๋ก parse/validate ํฉ๋๋ค.- unresolved
$ref, ์๋ชป๋ ์คํค๋ง ๊ตฌ์กฐ, ๋ฌธ์ ์์ค์ OpenAPI ์ค๋ฅ๋ฅผ ์กฐ๊ธฐ์ ์ก๋ ์ฉ๋์ ๋๋ค. - ๋ค๋ง target๋ณ ์์ฑ๊ธฐ ํธํ์ฑ๊น์ง ์ ๋ถ ๋ณด์ฅํ๋ ๊ฒ์ ์๋๋๋ค. ์ฆ,
kubb,python,langgraph๊ฐ๊ฐ์ ์ธ๋ถ ์ ์ฝ์ ์ค์ generate ๋จ๊ณ์์ ์ถ๊ฐ ํ์ธ์ด ํ์ํ ์ ์์ต๋๋ค.
--python-model-type <type>- ๊ธฐ๋ณธ๊ฐ:
pydantic_v2.BaseModel
- ๊ธฐ๋ณธ๊ฐ:
--kubb-output-dir <path>- ๊ธฐ๋ณธ๊ฐ:
<output>/kubb - ์๋ ๊ฒฝ๋ก๋
--output๊ธฐ์ค์ผ๋ก ํด์๋ฉ๋๋ค. --kubb-config์ ํจ๊ป ์ฌ์ฉํ ์ ์์ต๋๋ค.
- ๊ธฐ๋ณธ๊ฐ:
--kubb-format <mode>- ๊ธฐ๋ณธ๊ฐ:
false - preset ๋ชจ๋์์๋ง ์ฌ์ฉํฉ๋๋ค.
- ํ์ฉ๊ฐ:
auto,prettier,biome,oxfmt,false - ๊ธฐ๋ณธ๊ฐ
false๋ Kubb ์์ฑ์ ์ ์งํ๋ formatter ๋ฏธ์ค์น๋ก ์ธํ ํผ๋์ค๋ฌ์ด ๋ฉ์์ง๋ฅผ ํผํ๊ธฐ ์ํ ์ค์ ์ ๋๋ค. --kubb-config์ ํจ๊ป ์ฌ์ฉํ ์ ์์ต๋๋ค.
- ๊ธฐ๋ณธ๊ฐ:
--python-output-file <path>- ๊ธฐ๋ณธ๊ฐ:
<output>/python/models.py - ์๋ ๊ฒฝ๋ก๋
--output๊ธฐ์ค์ผ๋ก ํด์๋ฉ๋๋ค.
- ๊ธฐ๋ณธ๊ฐ:
--langgraph-output-dir <path>- ๊ธฐ๋ณธ๊ฐ:
<output>/langgraph - ์๋ ๊ฒฝ๋ก๋
--output๊ธฐ์ค์ผ๋ก ํด์๋ฉ๋๋ค.
- ๊ธฐ๋ณธ๊ฐ:
--langgraph-file <name>- ๊ธฐ๋ณธ๊ฐ:
langgraph_tools.py
- ๊ธฐ๋ณธ๊ฐ:
--kubb-client <client>- ๊ธฐ๋ณธ๊ฐ:
fetch --kubb-config์ ํจ๊ป ์ฌ์ฉํ ์ ์์ต๋๋ค.
- ๊ธฐ๋ณธ๊ฐ:
--kubb-config <path>- Kubb native config ํ์ผ์ ๊ทธ๋๋ก ์ฌ์ฉํฉ๋๋ค.
- ์ด ๋ชจ๋์์๋ ํด๋น config ํ์ผ์ด Kubb ์์ฑ์ ๊ดํ ์ ๋ ฅ/์ถ๋ ฅ/ํ๋ฌ๊ทธ์ธ ์ค์ ์ source of truth๊ฐ ๋ฉ๋๋ค.
- ๋ค๋ง ์ด ๋ํผ CLI ์ฐจ์์์๋
--input,--output์ ๊ณ์ ์๊ตฌํฉ๋๋ค. --input์ ์ฌ์ ๊ฒ์ฆ์ ์ฌ์ฉ๋๊ณ ,--output์--clean์ฒ๋ฆฌ ๊ธฐ์ค ๋๋ ํฐ๋ฆฌ์ ๋๋ค.- ์ด ํจํค์ง๋ ๋ด์ฅ preset์ ๋ง๋ค์ง ์๊ณ
kubb generate --config ...๋ฅผ pass-through ํฉ๋๋ค.
--kubb-arg <value>- ๋ฐ๋ณต ๊ฐ๋ฅ ์ต์ ์ ๋๋ค.
--kubb-config์ ํจ๊ป๋ง ์ฌ์ฉํ ์ ์์ต๋๋ค.- ์ ๋ฌํ ๊ฐ์
kubb generate๋ค์ ๊ทธ๋๋ก ์ถ๊ฐ๋ฉ๋๋ค. - ๊ฐ์ด
--watch,--logLevel์ฒ๋ผ--๋ก ์์ํ๋ฉด--kubb-arg=--watch์ฒ๋ผ=ํ์์ผ๋ก ์ ๋ฌํ์ธ์.
์ฃผ์:
--kubb-output-dir,--python-output-file,--langgraph-output-dir์ ์ฃผ๋ ์๋ ๊ฒฝ๋ก๋ ํ์ฌ ์์ ๋๋ ํฐ๋ฆฌ๊ฐ ์๋๋ผ--output๋๋ ํฐ๋ฆฌ ๊ธฐ์ค์ผ๋ก ํด์๋ฉ๋๋ค.
์ด CLI์ Kubb ์ง์์ ๋ ๊ฐ์ง ๋ชจ๋๊ฐ ์์ต๋๋ค.
- ๊ธฐ๋ณธ preset ๋ชจ๋
- ์ด ํจํค์ง์ ํฌํจ๋ ๊ธฐ๋ณธ Kubb ๊ตฌ์ฑ์ผ๋ก ์์ฑํฉ๋๋ค.
- ๊ธฐ๋ณธ formatter ์ค์ ์
false์ ๋๋ค. - formatter๋ฅผ ์ผ๊ณ ์ถ๋ค๋ฉด
--kubb-format auto๋๋--kubb-format prettier๊ฐ์ ์์ผ๋ก ๋ช ์ํฉ๋๋ค. - ํ์ฌ ํฌํจ๋ ํต์ฌ ์์กด์ฑ:
@kubb/cli@kubb/core@kubb/plugin-oas@kubb/plugin-ts@kubb/plugin-client
- native config pass-through ๋ชจ๋
--kubb-config๋ฅผ ์ฃผ๋ฉด ์ฌ์ฉ์์ ๊ธฐ์กด Kubb config๋ฅผ ๊ทธ๋๋ก ์ฌ์ฉํฉ๋๋ค.- Kubb์ ์ค์ ์ ๋ ฅ/์ถ๋ ฅ/ํ๋ฌ๊ทธ์ธ/formatter ์ค์ ์ config ํ์ผ ๋ด์ฉ์ ๋ฐ๋ฆ ๋๋ค.
- ๋ค๋ง ์ด ๋ํผ CLI๋
--input,--output์ ๊ณ์ ์๊ตฌํฉ๋๋ค. --input์ OpenAPI ํ์ผ ์ฌ์ ๊ฒ์ฆ์ ์ฌ์ฉ๋๊ณ ,--output์--clean๊ธฐ์ค ๋ฃจํธ์ ๋๋ค.- ์ด ๋ชจ๋์์๋
--kubb-output-dir,--kubb-client,--kubb-format์ ํจ๊ป ์ฌ์ฉํ ์ ์์ต๋๋ค. - ์ด ๊ฒฝ์ฐ ์ถ๊ฐ Kubb ํ๋ฌ๊ทธ์ธ์ ์๋น์ ํ๋ก์ ํธ์์ ์ง์ ์ค์น/๊ด๋ฆฌํ๋ ๊ฒ์ ๊ถ์ฅํฉ๋๋ค.
์ฆ, ์ด ํจํค์ง๋ ๊ธฐ๋ณธ preset์ ํ์ํ ํต์ฌ Kubb ํ๋ฌ๊ทธ์ธ๋ง ํฌํจํ๊ณ , ๋๋จธ์ง Kubb ์ํ๊ณ๋ ๊ธฐ์กด Kubb CLI/config๋ฅผ ๊ทธ๋๋ก ํต๊ณผ์ํค๋ ๋ฐฉํฅ์ ๋ฐ๋ฆ ๋๋ค.
์ฃผ์:
--clean์ ํญ์--output๋ฃจํธ๋ฅผ ๋จผ์ ์ญ์ ํฉ๋๋ค.--kubb-config๋ชจ๋์์๋ ์ค์ Kubb ์ถ๋ ฅ ์์น๊ฐ config ๋ด๋ถ ์ค์ ๊ณผ ๋ค๋ฅผ ์ ์์ผ๋ฏ๋ก ์ ์คํ๊ฒ ์ฌ์ฉํ์ธ์.
์๋ ํ
ํ๋ฆฟ์ ์ด CLI๋ก Kubb / Python / LangGraph ์์ฑ์ ์์ํ ๋ ์ต์ํ์ผ๋ก ๋ณต๋ถํด ์ธ ์ ์๋ ์์์
๋๋ค.
๋ ์์ธํ ๊ธฐ์ค์ docs/openapi-authoring-guide.md๋ฅผ ์ฐธ๊ณ ํ์ธ์.
openapi: 3.0.3
info:
title: Example API
version: 0.1.0
servers:
- url: https://api.example.com
paths:
/items:
get:
operationId: listItems
summary: List items
description: Retrieve the current item catalog.
responses:
'200':
description: Successful item list response
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Item'
post:
operationId: createItem
summary: Create item
description: Create a new catalog item from the supplied payload.
requestBody:
required: true
description: Item payload to create.
content:
application/json:
schema:
$ref: '#/components/schemas/CreateItemRequest'
responses:
'200':
description: Item created successfully
content:
application/json:
schema:
$ref: '#/components/schemas/Item'
/items/{itemId}:
get:
operationId: getItem
summary: Get item by id
description: Retrieve one catalog item using its identifier.
parameters:
- in: path
name: itemId
required: true
description: Unique item identifier.
schema:
type: string
responses:
'200':
description: Matching item response
content:
application/json:
schema:
$ref: '#/components/schemas/Item'
components:
schemas:
Item:
type: object
description: Catalog item returned by the API.
required: [id, name]
properties:
id:
type: string
description: Stable item identifier.
name:
type: string
description: Display name of the item.
description:
type: string
description: Optional human-readable item details.
CreateItemRequest:
type: object
description: Payload for creating a catalog item.
required: [name]
properties:
name:
type: string
description: Name to assign to the new item.
description:
type: string
description: Optional explanatory text for the new item.์ฒดํฌ ํฌ์ธํธ:
- ๊ฐ operation์
operationId,summary,description์ ๋ฃ๊ธฐ - response
description์ ๋น์๋์ง ์๊ธฐ - parameter/property๋ง๋ค
description์ ๋ฃ๊ธฐ - request/response schema๋ ๊ฐ๋ฅํ๋ฉด
components.schemas๋ก ๋ถ๋ฆฌํ๊ธฐ
npx openapi-multitarget-codegen generate \
--input ./specs/openapi.yaml \
--output ./generated \
--target kubb์์ ์ถ๋ ฅ ์์น (--output ./generated๋ฅผ ์ค ๊ฒฝ์ฐ):
./generated/kubb/...
npx openapi-multitarget-codegen generate \
--input ./specs/openapi.yaml \
--output ./generated \
--target kubb \
--kubb-config ./kubb.config.ts \
--kubb-arg=--logLevel \
--kubb-arg=info์ด ๋ชจ๋์์๋ kubb generate --config ./kubb.config.ts --logLevel info ํํ๋ก pass-through ๋ฉ๋๋ค.
์ถ๊ฐ Kubb ํ๋ฌ๊ทธ์ธ์ด ํ์ํ๋ฉด ํด๋น ํ๋ฌ๊ทธ์ธ์ ์๋น์ ํ๋ก์ ํธ์์ ์ง์ ์ค์นํ๋ฉด ๋ฉ๋๋ค.
--input, --output์ ์ด ๋ํผ CLI์ ์ฌ์ ๊ฒ์ฆ ๋ฐ --clean ๊ธฐ์ค์ ์ํด ๊ณ์ ํ์ํ์ง๋ง, Kubb config ๋ด๋ถ์ ์ค์ input/output ์ค์ ์ ๋ฎ์ด์ฐ์ง๋ ์์ต๋๋ค.
npx openapi-multitarget-codegen generate \
--input ./specs/openapi.yaml \
--output ./generated \
--target python๊ธฐ๋ณธ ๋ชจ๋ธ ํ์
์ pydantic_v2.BaseModel์ด๋ฏ๋ก ๊ธฐ๋ณธ๊ฐ์ ๊ทธ๋๋ก ์ฌ์ฉํ ๋๋ --python-model-type์ ์๋ตํด๋ ๋ฉ๋๋ค.
์์ ์ถ๋ ฅ ์์น (--output ./generated๋ฅผ ์ค ๊ฒฝ์ฐ):
./generated/python/models.py
npx openapi-multitarget-codegen generate \
--input ./specs/openapi.yaml \
--output ./generated \
--target kubb \
--target python \
--target langgraph \
--kubb-output-dir ./sdk/ts \
--python-output-file ./sdk/python/api_models.py \
--langgraph-output-dir ./agent/tools \
--langgraph-file catalog_tools.py์ ์์๋ ๋ค์์ฒ๋ผ ์์ฑ๋ฉ๋๋ค.
./generated/sdk/ts/..../generated/sdk/python/api_models.py./generated/agent/tools/catalog_tools.py
์ฃผ์: ์ ์๋ ๊ฒฝ๋ก๋ค์ ํ์ฌ ์์
๋๋ ํฐ๋ฆฌ๊ฐ ์๋๋ผ --output ./generated ๊ธฐ์ค์ผ๋ก ํด์๋ฉ๋๋ค.
npx openapi-multitarget-codegen generate \
--input ./specs/openapi.yaml \
--output ./generated \
--target langgraph์์ ์ถ๋ ฅ ์์น (--output ./generated๋ฅผ ์ค ๊ฒฝ์ฐ):
./generated/langgraph/langgraph_tools.py
npx openapi-multitarget-codegen generate \
--input ./specs/openapi.yaml \
--output ./generated \
--target kubb \
--target python \
--target langgraph \
--clean์์ ์ถ๋ ฅ ์์น (--output ./generated๋ฅผ ์ค ๊ฒฝ์ฐ):
./generated/kubb/..../generated/python/models.py./generated/langgraph/langgraph_tools.py
npx openapi-multitarget-codegen check-spec --input ./specs/openapi.yaml์ด ๋ช ๋ น์ ๋ค์์ ๊ฒ์ฌํฉ๋๋ค.
- ํ์ผ ์กด์ฌ ์ฌ๋ถ
- ๊ธฐ๋ณธ ๊ตฌ์กฐ(
openapi,paths) ์กด์ฌ ์ฌ๋ถ - OpenAPI ๋ฌธ์ parse/validate
- unresolved
$ref, ์๋ชป๋ ์คํค๋ง ๊ตฌ์กฐ ๋ฑ ๋ฌธ์ ์์ค ์ค๋ฅ
๋ค๋ง ์ด ๋จ๊ณ๊ฐ kubb, python, langgraph ๊ฐ ํ๊น ์์ฑ๊ธฐ์ ์ธ๋ถ ํธํ์ฑ๊น์ง ๋ชจ๋ ๋ณด์ฅํ๋ ๊ฒ์ ์๋๋๋ค. ํ๊น๋ณ ์ ์ฝ์ ์ค์ generate ๋จ๊ณ์์ ์ถ๊ฐ ํ์ธ์ด ํ์ํ ์ ์์ต๋๋ค.
์ถ๋ ฅ ๋ฃจํธ๋ --output์ผ๋ก ๋ฐ๊ณ , ์๋ฌด ์ถ๊ฐ ์ต์
์ด ์์ผ๋ฉด ๊ธฐ๋ณธ๊ฐ์ ์๋์ ๊ฐ์ต๋๋ค.
kubbโ<output>/kubbpythonโ<output>/python/models.pylanggraphโ<output>/langgraph/<langgraph-file>
ํ์ํ๋ฉด ์๋ ์ต์ ์ผ๋ก ํ๊น๋ณ ๊ฒฝ๋ก๋ฅผ ๋ ์ธ๋ถํํ ์ ์์ต๋๋ค.
--kubb-output-dir--python-output-file--langgraph-output-dir
์๋ ๊ฒฝ๋ก๋ ๋ชจ๋ --output ๊ธฐ์ค์ผ๋ก ํด์๋๊ณ , ์ ๋ ๊ฒฝ๋ก๋ ์ง์ํฉ๋๋ค.
- ์์ Kubb config๋ฅผ ์์ฑํด์ ์คํํฉ๋๋ค.
- ์ ๋ ฅ ์คํ ๊ฒฝ๋ก์ ์ถ๋ ฅ ๊ฒฝ๋ก๋ฅผ ๋์ ์ผ๋ก ์ฃผ์ ํฉ๋๋ค.
- ๊ธฐ๋ณธ client๋
fetch์ ๋๋ค.
uvx --from datamodel-code-generator datamodel-codegen ...๊ธฐ๋ฐ์ผ๋ก ์คํํฉ๋๋ค.- ๋ชจ๋ธ ํ์
์
--python-model-type์ผ๋ก ๋ฐ๊ฟ ์ ์์ต๋๋ค.
- OpenAPI operation์ ์ํํ๋ฉด์ StructuredTool ์ด์ ์ฝ๋๋ฅผ ์์ฑํฉ๋๋ค.
- path/query/body๋ฅผ ๋ถ๋ฆฌํด์ ์ฒ๋ฆฌํ๋ ๊ธฐ๋ณธ ๊ณจ๊ฒฉ์ ํฌํจํฉ๋๋ค.
- ์ถ๋ ฅ ํ์ผ๋ช
์
--langgraph-file๋ก ์กฐ์ ํ ์ ์์ต๋๋ค.
์ค๋ฌด์์๋ ๊ฐ์ OpenAPI ์คํ์ ๊ธฐ์ค์ผ๋ก ์ฌ๋ฌ ์ธ์ด/ํ๋ ์์ํฌ์ฉ ์ฝ๋๋ฅผ ๋์์ ๋ง๋ค๊ณ ์ถ์ ๋๊ฐ ๋ง์ต๋๋ค.
์๋ฅผ ๋ค๋ฉด:
- ํ๋ก ํธ์๋๋ TypeScript client๊ฐ ํ์ํ๊ณ
- Python ์๋ฒ/์คํฌ๋ฆฝํธ๋ ํ์ ๋ชจ๋ธ์ด ํ์ํ๊ณ
- ์์ด์ ํธ ๊ณ์ธต์ LangGraph ๋๊ตฌ ์ฝ๋๊ฐ ํ์ํ ์ ์์ต๋๋ค.
์ด ํจํค์ง๋ ๊ทธ๋ฐ ์ํฉ์์ OpenAPI๋ฅผ ๋จ์ผ source of truth๋ก ๋๊ณ , ์ฌ๋ฌ ํ๊น์ ํ๋์ CLI ์ธํฐํ์ด์ค๋ก ์ ๋ฆฌํ๋ ๋ฐ ๋ชฉ์ ์ด ์์ต๋๋ค.
์ ์ฅ์์๋ ์์ ์คํ ๊ธฐ๋ฐ ๊ฒ์ฆ ์คํฌ๋ฆฝํธ๊ฐ ๋ค์ด ์์ต๋๋ค.
npm run check:example-spec
npm run generate:example:kubb
npm run generate:example:python
npm run generate:example:langgraph
npm run generate:example:all์์ ์ถ๋ ฅ์ ./.tmp-output ์๋์ ์์ฑ๋ฉ๋๋ค.
- Node.js 20+
- npm ๋๋ pnpm
- Python 3.11+
uvx์ฌ์ฉ ๊ฐ๋ฅ ํ๊ฒฝ (pythonํ๊น์ฉ, ์:brew install uv)
LangGraph ์์ฑ ๊ฒฐ๊ณผ๋ฅผ ์ค์ ๋ก ์คํํ๋ ค๋ฉด ๋ณ๋๋ก ์๋ Python ํจํค์ง๊ฐ ํ์ํ ์ ์์ต๋๋ค.
httpxpydanticlangchain-core
ํฅํ ์๋ ํญ๋ชฉ์ ๋ ๋ฐ์ ์ํฌ ์ ์์ต๋๋ค.
- Kubb์ React Query / Zod / MSW ํ์ฅ ์ต์
- Python ์ถ๋ ฅ์ dataclass / TypedDict preset ๋จ์ํ
- LangGraph naming / auth / filtering ์ ๋ต ์ต์ ํ
- spec lint/report ์ ์ฉ ๋ช ๋ น ์ถ๊ฐ
- dry-run / overwrite ์ ์ฑ ์ต์
openapi-multitarget-codegen์ OpenAPI ์คํ์ ์ ๋ ฅ๋ฐ์ Kubb, Python ํ์ , LangGraph ์ฝ๋๋ฅผ ์์ฑํ๋ ์ธ์ ๊ธฐ๋ฐ npm CLI ํจํค์ง์ ๋๋ค.