abap-openapi
Generates ABAP client classes and ICF server stubs from an OpenAPI v3 document, one self-contained global class and interface per definition, through a web client, a Node.js command line or ABAP itself.
Turning an OpenAPI document into working ABAP code otherwise means writing the client class or the ICF server handler by hand. abap-openapi generates one self-contained global class and interface per OpenAPI definition, covering OpenAPI v3 documents (v2 only after converting to v3) for ABAP v702 and up, generated through a web client, a Node.js command line, or from ABAP itself. The generated code depends on ZCL_OAPI_JSON, which the README suggests copying into a local class rather than keeping as a shared dependency.
Facts
Where it sits
Who is behind it
In the atlas: maintains 1@abap-openapimaintaineraxelmohnenContributes to this
In the atlas: contributes to 4@axelmohnenJens SchwarzContributes to this
In the atlas: contributes to 4@BlackmanCCColby HemondContributes to this
In the atlas: contributes to 2@colbyhemondFrancisco MilánContributes to this
In the atlas: contributes to 5@francisco-milanGregor WolfContributes to this
In the atlas: maintains 17, contributes to 59, wrote 2@gregorwolfLars HvamContributes to this
In the atlas: maintains 13, contributes to 92, wrote 1@larshpFabianContributes to this
In the atlas: maintains 1, contributes to 3@OberstVonGatowMike PokrakaContributes to this
In the atlas: maintains 1, contributes to 11@pokrakamSamiContributes to this
In the atlas: contributes to 2@samibouge9 contributors
What it declares
Every artifact
- Type
- Generator
- Origin
- Independently maintained
- Runtime
- Node.js
As a generator
- Generates
- Code or test data
- Run with
- Its own command
- Distributed through
- npm
Connections
Handing a service description to clients and tools
Eleven abap2UI5 apps, one per open-source ABAP library
Download
README
quoted from abap-openapi/abap-openapi under MIT, readABAP OpenAPI Client & Server Generator
ABAP OpenAPI is an OpenAPI generator tool designed to create API clients, ICF server handlers, and ICF server implementation stubs from OpenAPI documents.
Generate
It is possible to generate the objects using different processes:
- Generate via our web client
- Generate via command line (NodeJS)
- Generate via ABAP
Features
| Feature | |
|---|---|
| OpenAPI File Types | JSON |
| OpenAPI Versions | v2*, v3 |
| Object Creation | one self-contained global class & interface per OpenAPI definition |
* OpenAPI v2 is currently only capable by converting the v2 file to a v3 file. This can be done manually using the Swagger Editor, or programmatically using Swagger Converter
NOTE: generated code currently uses ZCL_OAPI_JSON, suggest copying the implementation to a local class in the generated global class
Use Cases
API Creator
- Write the OpenAPI document for your API so that you can generate the ICF handler and Server Implementation boilerplate
- Use the OpenAPI document to create automatic documentation for your API
API User
- Use any OpenAPI document to create the client class to consume external APIs
Building/Developing
Prerequisites
NodeJS 16+
Setup
- clone this repository
- run
npm install
Testing
Unit Tests: npm test
Intergration Tests: npm run integration_test
You can try out the generation using Swagger's Petstore Example:
- Just run
npm run petstore - The output files will be generated in
./test_v1/generated/
Example
#!/usr/bin/env bash
rm -rf abap-openapi
git clone --depth=1 https://github.com/abap-openapi/abap-openapi
rm -rf abap-openapi/.git
cd abap-openapi
npm ci
npm run transpile
rm ../src/api/*.abap
node test_v2/index.mjs <filename> ../src/api <name>Others providing
Compare all 5 on the OpenAPI page →- @cap-js/openapi@cap-js/openapiTurns a CDS service into an OpenAPI document, derived from the model so the description cannot drift from what is served.sap official, capGenerates OpenAPI documents from a CDS servicefrom CAP
- cds-swagger-ui-expresscds-swagger-ui-expressServes a CAP service's OpenAPI definition as a browsable Swagger UI, which is the page @cap-js/openapi's document does not come with.independent, capSwagger UI for a CAP service's OpenAPI definitionfrom CAP
- ABAP OpenAPI UIABAP OpenAPI UIAn ABAP app that puts a Swagger UI in front of SAP NetWeaver Gateway services, built on Swagger UI and Odata-OpenAPI, installed through abapGit and opened from transaction ZGW_OPENAPI.independent, abapSwagger UI for SAP NetWeaver Gateway servicesfrom ABAP
- ABAP-SwaggerABAP-SwaggerAn ABAP library that exposes a class's public methods as REST services, registered through the ZIF_SWAG_HANDLER interface, with a Swagger UI on the same base path describing them.independent, abapExposes ABAP class methods as REST services with Swagger UIfrom ABAP
Details
Sources
Sources are graph entities: the same page may back several entries, and an unreachable source flags every row that rests on it.
Compatibility and provenance
abaplint
Contributors
History in the atlas
- First seen.
For your agent
- Ref
artifact:abap-openapi-abap-openapi- JSON
- /artifacts/abap-openapi-abap-openapi.json
- MCP
- Connecting an agent