Executing Swagger Rest SmartObjects: "An item with the same key has already been added Source: SourceCode.HostServer.Lib" error when executing the REST Service Instance Broker SmartObject

  • 15 February 2022
  • 0 replies
  • 20 views

Userlevel 5
Badge +20
 

Executing Swagger Rest SmartObjects: "An item with the same key has already been added Source: SourceCode.HostServer.Lib" error when executing the REST Service Instance Broker SmartObject

kbt149147

PRODUCT
K2 Five
BASED ON
K2 Five (all)
TAGS
Service Broker
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

An item with the same key has already added. Source: SourceCode.HostServer.Lib error is raised when executing the REST Service Instance Broker SmartObject:

 

Image

Symptoms

This error is raised due to an incorrect configuration on the Swagger json file

 

For example (Duplicate entries):

 

Image

Troubleshooting Steps

Do a comparison of the working Swagger json file and the non-working Swagger json file and you will notice that there are duplicate or incorrect values specified.

 

To correct this:

- Rename the duplicate entries or change your Swagger json file as needed.

- Then navigate back to the SmartObject Tester Tool and refresh the REST Service instance & SmartObjects.

 

Note this comparison can be done with Win Merge or Beyond Compare to validate if there are any inconsistencies on the json file.

0 replies

Be the first to reply!

Reply