SAP / cloud-sdk-js

Use the SAP Cloud SDK for JavaScript / TypeScript to reduce development effort when building applications on SAP Business Technology Platform that communicate with SAP solutions and services such as SAP S/4HANA Cloud, SAP SuccessFactors, and many others.
Apache License 2.0
161 stars 51 forks source link

Could not convert OpenAPI specification to OpenAPI version 3. (Patchable) schema type must not be an array #4335

Closed nocin closed 7 months ago

nocin commented 7 months ago

Describe the bug

Generating an oData Client fails for SF API Specifications.

To Reproduce Steps to reproduce the behavior:

  1. Set up ... Following the docs here: https://sap.github.io/cloud-sdk/docs/js/features/openapi/generate-client npm install -D @sap-cloud-sdk/openapi-generator Downloaded PLTUserManagement.json file from api hub and uploaded it to my BAS folder: grafik

  2. Execute ... npx openapi-generator -i srv/resources/api-specs/PLTUserManagement.json -o srv/resources/api-clients/ --verbose

  3. See error grafik Could not convert OpenAPI specification to OpenAPI version 3. (Patchable) schema type must not be an array The issue occurs for .edmx, .json and .yaml

Expected behavior Client should be successfuly generated.

Used Versions:

Impact / Priority

Affected development phase: Getting Started, Development

Additional context When doing the same with cds import it is working fine. And as cds is using the cloud sdk, I would expect that this should also work?! The steps from the docs are so simple, that I really don't know what I could have done wrong.

Thanks for any help! Regards Nico

nocin commented 7 months ago

Arg,

as always, reading helps... Just noticed that there are two different generators. One for oData and one for OpenAPI.

Using the right generator, it works perfectly.