openapi-to-abap
БесплатноБез исполняемых скриптовНе проверенGenerate an ABAP REST client from an OpenAPI document using the v2 pipeline (3 interfaces + 1 class + bundled locals). USE WHEN the user wants to convert…
от abapify★ 20 звёзд на GitHubОб этом скилле
OpenAPI → ABAP Client Codegen (v2)
This skill guides work on the abap-ast and openai-codegen packages:
generating ABAP REST client classes from OpenAPI 3.0/3.1 documents,
adding new target profiles, extending JSON-Schema → ABAP type mappings,
and deploying the generated output to a live BTP Steampunk system.
When to use
Invoke this skill when the user asks to:
- Convert an OpenAPI / Swagger document into an ABAP client.
- Work inside
packages/abap-ast/orpackages/openai-codegen/. - Add a new target profile (for example
s4-onprem-modern,on-prem-classic). - Add or change a JSON-Schema → ABAP type mapping rule.
- Deploy a generated client (e.g. Petstore3) to a BTP Steampunk tenant
via
adt-cli. - Debug parser errors reported by
@abaplint/coreagainst the generated source.
Do not use this skill for generic ADT endpoint work (use
add-endpoint), object CRUD plumbing (use add-object-type), or
format plugins (use adt-export).
Architecture summary (v2)
ZIF_<BASE>_TYPES ── all schemas as ABAP TYPES (+ @openapi-schema markers)
▲
│ zif_<base>_types=>…
│
ZIF_<BASE> ── all operations as typed METHODS (+ @openapi-operation markers)
│ RAISING ZCX_<BASE>_ERROR
│
ZCL_<BASE> ── implements ZIF_<BASE>
one private attribute: client TYPE REF TO lcl_http
each method = fetch(...) + CASE response->status( )
─────────────────────────────────────────────
local classes (in the same .clas, locals_def/imp):
lcl_http, lcl_response, json, lcl_json_parser
ZCX_<BASE>_ERROR ── inherits cx_static_check
carries status / description / body / headers
Pipeline (one direction only):
loadSpec (oas/) ─► planTypes (types/) ─► resolveNames (emit/naming.ts)
─► emitTypesInterface / emitOperationsInterface / emitExceptionClass
─► emitImplementationClass / emitLocalClasses
─► print (abap-ast) ─► writeClientBundle (format/)
Two packages:
abap-ast— zero-dependency typed AST + deterministic pretty-printer. Emit-only. Declaration nodes carry an optionalabapDoc: readonly string[]field; the printer emits"! <line>above each declaration.openai-codegen— pipeline + profile registry + CLI (packages/openai-codegen/src/cli.ts). Depends only onabap-ast.
Reference example: samples/petstore3-client/ — the generator output
is the 11-file abapGit layout in samples/petstore3-client/generated/abapgit/.
Adding a new target profile
The locals bundle is shared in v2, so adding a profile is now mostly a registry + dispatcher change:
- Create
packages/openai-codegen/src/profiles/<id>.tsexporting aTargetProfile(id, ABAP language version, allowed kernel classes). Mirrorcloud.ts. - Register it in
packages/openai-codegen/src/profiles/registry.ts(PROFILES,ALL_PROFILES) and add the id toTargetProfileIdinprofiles/types.ts. - Remove the short-circuit in
packages/openai-codegen/src/generate.ts(assertSupportedTarget) or extend it to accept the new id. - If the new profile needs a different kernel class (e.g.
cl_http_clientfor classic on-prem), branch insidepackages/openai-codegen/src/emit/templates/locals-*.abap.ts. Avoid forking the whole bundle — prefer a small conditional. - Update the CLI whitelist in
packages/openai-codegen/src/cli.ts(parseTarget) if needed. - Add a Vitest suite under
packages/openai-codegen/tests/that runs the pipeline with--target <id>and parse-checks the output via@abaplint/core.
Adding a new JSON-Schema → ABAP mapping rule
Type mapping lives in packages/openai-codegen/src/types/map.ts. To
add a rule (e.g. format: "uuid" → sysuuid_x16):
- Extend the mapping in
src/types/map.ts. Keep it pure:JsonSchema → AbapTypeRef | AbapTypeDef, no side effects. - If the new shape introduces a named
TypeDef, allocate via the planner'sNameAllocatorinsrc/types/plan.ts. - If cycles are possible, confirm the back-edge handling: the planner
breaks cycles with
REF TO dataand attaches a `"! @openapi-ref
marker. Add a fixture. 4. Add a test inpackages/openai-codegen/tests/types-emit.test.ts asserting both the AST shape and the printed ABAP. 5. Update the mapping table inpackages/openai-codegen/README.md`.
Adding a new CLI flag
- Extend
RawCliOptions+buildCliRunOptionsinpackages/openai-codegen/src/cli.ts. - Thread through
GenerateOptionsinpackages/openai-codegen/src/generate.tsif it affects emission. - Add help text and a unit test in the CLI test suite.
Deploying to BTP Steampunk
Short recipe:
bunx adt auth login
bunx @abapify/openai-codegen \
--input ./spec/openapi.json \
--out ./generated/abapgit \
--f
Установить openapi-to-abap в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл openapi-to-abap?
Generate an ABAP REST client from an OpenAPI document using the v2 pipeline (3 interfaces + 1 class + bundled locals). USE WHEN the user wants to convert OpenAPI / Swagger into ABAP, work on the abap-ast or openai-codegen packages, add a new target profile, add a JSON-Schema to ABAP type mapping, or deploy a generated client to BTP Steampunk. Trigger phrases - openapi to abap, generate abap client from openapi, openai-codegen, abap rest client, swagger abap client, petstore abap, abap-ast, typed ABAP AST, ABAP pretty printer, add target profile, add schema mapping, ZIF_types, ZIF_ops, ZCX_error.
Как установить скилл openapi-to-abap?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл openapi-to-abap запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
docx
Use this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files) or Word templates (.dotx files). Triggers include…
от AnthropicUse this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple…
от Anthropicxlsx
Use this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing…
от Anthropicpptx
Use this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or…
от Anthropic