search cancel

httpStatus:[452] can't be mapped to valid HttpStatus error for Json Swagger file.

book

Article ID: 254485

calendar_today

Updated On:

Products

Service Virtualization

Issue/Introduction

When trying to create a VSI from a Json Swagger file, the following error pops up in the Workstation: 
java.lang.Exception: Swagger file failed to parse
 at com.itko.lisa.vse.stateful.protocol.http.SwaggerPanel.updateUIWithAnyErrorsFromParse(SwaggerPanel.java:504)
 at com.itko.lisa.vse.stateful.protocol.http.SwaggerPanel.userChoseNewSwaggerEndpoint(SwaggerPanel.java:536)
 at com.itko.lisa.vse.stateful.protocol.http.SwaggerPanel.setSwaggerUrl(SwaggerPanel.java:835)
 at com.itko.lisa.vse.stateful.protocol.http.SwaggerPanel$4.actionPerformed(SwaggerPanel.java:193)

The workstation.log shows:
ERROR com.itko.lisa.vse.swagger.SwaggerMethodImpl - httpStatus:[452] can't be mapped to valid HttpStatus httpStatusUnparsed:[452] for 'POST /abc/def/user123'.
java.lang.Exception: httpStatus:[452] can't be mapped to valid HttpStatus

 

Environment

Release : 10.7.2

Cause

The .json file for the POST /abc/def/user123 has the following response:

          "452": {
            "description": "..."
          },

452 is not listed as valid response codes in: 
https://developer.mozilla.org/en-US/docs/Web/HTTP/Status

Resolution

Removing the invalid response code for all the different paths from the Json Swagger file allows the VSI to be created.