Rest Endpoint Not Returning Data
kbt129434
PRODUCTIssue
In this scenario you have created a swagger definition which is supposed to return results, but when ran in the SmartObject explorer only two fields are populated in which are the HTTP Response Code and Status. If you go into the SmartObject tester and execute the SmartObject based on the swagger definition, you will see that only 2 fields are returned.
Symptoms
Due to a badly created swagger definition, there may be missing key elements.
Troubleshooting Steps
It may be a good idea to check if the swagger definition was formatted correctly. Please check that the outer responses have been populated correctly. It may be a good idea to have a look at the following document in regards Swagger reference formats: REST Swagger File Reference Format.
Please note that Swagger DOES NOT support the following:
• Defining complex objects elsewhere in the descriptor (e.g. in a Response object). Such objects must be defined here and then referenced using $ref.
• Inline definitions: Meaning that if an entity contains a property of another entity type you must declare each entity separately and then reference them for nesting purposes.
• It may be necessary to define an object to hold the response that is actually not part of the response model. See "When to Use a Root Object" for more information.
For info on deserialization, please have a look at the following document: How to use the Serialize and Deserialize functionality for Data Structures in K2 connect for SAP