Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Odata XML conversion to OpenAPI - Error in BTP Action Project

RamaniNagarajan
Explorer
0 Likes
7,521

fi-98.xml

fi-98openapi3json.txt

Dear Team,

The $metadata information on the screen shows the correct URI in the XML file. Whereas when converted to OpenAPI using 'npm' utility, the real URI is not reflected in the new JSON.

I have attached both XML & OpenAPI Json file for your reference please. Because of this, I am getting error in Action Project .

While testing the Action Project, error is thrown. Kindly please check let me know where am I missing?

1) Metadata

2) Action Project-Input Section:

3)Action Project-Output Section

4)Action Project-TEST

5) Action Project- Test Preview with Error

1 ACCEPTED SOLUTION
Read only

RamaniNagarajan
Explorer
0 Likes
7,325

Hi Ralf Handl,

[RESOLVED]

I have resolved the issue now. Once again, I thank you very much for your valuable feedback.

There was one input EntitySet Navigation from the SAP Odata was Missing in the Input Body of the Action Project. Once I added this, it started working successfully. It seems, the such entitysets are not copied to the INPUT Body. Hence, need to be added manually.

The highlighted part of the below screenshot is added:

Now the result is:

Hi Ralf Handl,

[RESOLVED]

I have resolved the issue now. Once again, I thank you very much for your valuable feedback.

There was one input EntitySet Navigation from the SAP Odata was Missing in the Input Body of the Action Project. Once I added this, it started working successfully. It seems, the such entitysets are not copied to the INPUT Body. Hence, need to be added manually.

The highlighted part of the below screenshot is added:

Now the result is:

8 REPLIES 8
Read only

RalfHandl
Product and Topic Expert
Product and Topic Expert
0 Likes
7,325

You can use the parameters --scheme, --host, and --basePath to override the default, see https://github.com/oasis-tcs/odata-openapi/tree/main/lib#usage.

The Atom self-link is a specialty of SAP NetWeaver Gateway and not recognized by the non-SAP OpenAPI converter.

Read only

0 Likes
7,325

Hi Ralf Handl,

With reference to your instruction I could able to add: --basePath --Host --scheme

I still get the error while testing the Post Method in Action Project. (Note: There is only one Post method in the odata.)

Can you please check the attached OpenApi file? And please let me know what is missing?

fi-98openapi3-copy-2.txt

Thanks, Ramani

Read only

RalfHandl
Product and Topic Expert
Product and Topic Expert
0 Likes
7,325

Just a guess: you seem to have disabled the CSRF Token dance

This probably returns a 400-something error with an error message that is not OData-conformant because CSRF Token validation is done before OData processing.

Read only

0 Likes
7,325

Hello Ralf Handl,

It seems to work fine with the status-code:201 after adding the CSRF & Input parameter as given in the below screenshot.

But the URI is supposed to call a method: "create_deep_entity".

Whereas, it is wrongly executing: "FIPOSTINGHEADERS_CREATE_ENTITY".

May I know where am I missing please?

Can you please check if the OpenAPI conversion is correct from my side?

It is appreciated if we can have meeting please.

Thanks and regards,

Ramani Nagarajan, IBM India

mail: [email protected]

Read only

RalfHandl
Product and Topic Expert
Product and Topic Expert
0 Likes
7,325

Another guess: create_deep_entity may only be called if you provide a "deep entity" in the request body, and if you provide a "shallow entity" the standard create_entity is called.

Read only

0 Likes
7,325

Already my API is working fine from Postman for the Create_deep_entity. The method is already present. But the Action Project is calling different method rather calling the above.

Read only

RalfHandl
Product and Topic Expert
Product and Topic Expert
0 Likes
7,325

Are you sending the exact same request body in both cases? And to the same backend URL?

Read only

RamaniNagarajan
Explorer
0 Likes
7,326

Hi Ralf Handl,

[RESOLVED]

I have resolved the issue now. Once again, I thank you very much for your valuable feedback.

There was one input EntitySet Navigation from the SAP Odata was Missing in the Input Body of the Action Project. Once I added this, it started working successfully. It seems, the such entitysets are not copied to the INPUT Body. Hence, need to be added manually.

The highlighted part of the below screenshot is added:

Now the result is: