Forum Discussion

vloffet's avatar
vloffet
New Member
10 months ago

REST API Definition not updating properly

Hello !

A few months ago we started working on a new definition for our endpoints using stoplight, but the definition went through a lot of different variations as we learned because it was one of the first ones we worked on.

In ReadyAPI, I had created test plans using the first version of the definition, and then used the definition updating functionality to update my endpoints.

The testing part works properly, however when I want to use the project coverage, my responses all show as 1/1 covered with no content in the message coverage window, and when I look into the "Specification" window I can see that it's not consistent with the new definition .json file.

Using "definition refactoring" also does not correct the problem.

Importing the definition .json file into a fresh project will create a proper service with the right specifications and unlock the ability to use project coverage, but it will be difficult to adapt transfer all the tests manually to a new service.

For example, in the old updated/refactored service I would have :

"responses" : {
               "200" : {
                  "description" : "OK",
                  "content" : {
                     "application/json" : {
                        "example" : ""
                     }
                  }
               },
}

and in the freshly create service with the same definition file I would have :

"responses" : {
               "200" : {
                  "description" : "OK",
                  "content" : {
                     "application/json" : {
                        "schema" : {
                           "$ref" : "#/components/schemas/PlaceholderAPIBR"
                        }
                     }
                  }
               },
}

Is there a way to update the old service API with the new definition and force it to use the new response format ? The definition file also changed location and name when we started sourcing the project using Git, but I can see that the "original definition path" in the specification window and the "definition" service property are still showing the old file path.

I'd rather not have to change all the tests, considering the main ReadyAPI project consume multiple services and not all of them have the issue.

  • nmrao's avatar
    nmrao
    Champion Level 3

    May be you can contact Smartbear customer support to get this addressed quickly if the tool is not working as desired.