Application Development 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: 

Odata XML conversion to OpenAPI - Error in BTP Action Project

RamaniNagarajan
Explorer
0 Kudos
1,032
  • SAP Managed Tags:

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

RamaniNagarajan
Explorer
0 Kudos
836
  • SAP Managed Tags:

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

RalfHandl
Product and Topic Expert
Product and Topic Expert
0 Kudos
836
  • SAP Managed Tags:

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.

0 Kudos
836
  • SAP Managed Tags:

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

RalfHandl
Product and Topic Expert
Product and Topic Expert
0 Kudos
836
  • SAP Managed Tags:

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.

0 Kudos
836
  • SAP Managed Tags:

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: ramani.nagarajan@in.ibm.com

RalfHandl
Product and Topic Expert
Product and Topic Expert
0 Kudos
836
  • SAP Managed Tags:

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.

0 Kudos
836
  • SAP Managed Tags:

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.

RalfHandl
Product and Topic Expert
Product and Topic Expert
0 Kudos
836
  • SAP Managed Tags:

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

RamaniNagarajan
Explorer
0 Kudos
837
  • SAP Managed Tags:

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: