Rest Endpoint Not Returning Data

  • 24 February 2022
  • 0 replies
  • 7 views

Userlevel 5
Badge +20
 

Rest Endpoint Not Returning Data

kbt129434

PRODUCT
K2 Cloud K2 Cloud
BASED ON
K2 Cloud K2 Cloud
TAGS
REST
End User
Designer
Cloud
This article was created in response to a support issue logged with K2. The content may include typographical errors and may be revised at any time without notice. This article is not considered official documentation for K2 software and is provided "as is" with no warranties.

Issue

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

 


0 replies

Be the first to reply!

Reply