Forum Discussion

jrforeman's avatar
jrforeman
Occasional Contributor
3 years ago
Solved

Swagger compliance assertion seems to be prefixing url with a local path

I allowed ReadyAPI 3.20.0 to generate tests for a new Spring Boot application, pointing it to the swagger api-docs for the service.

The generated Swagger Compliance assertion fails with a message that I find a bit confusing: "-> Swagger Compliance check failed: [Illegal char <:> at index 52: C:/Program Files/SmartBear/ReadyAPI-3.20.0/bin/http:/myhost:30102/myappname/v2/api-docs]"

 

The response content it is evaluating is:

My Spring Boot App w REST API! Date is now 2022-01-20T01:32:14.189791Z

 

I note two strange items in the swagger compliance check error message:

1. Why is it prefixing the URL with the local path to the ReadyAPI installation's bin folder?

2. Why does the message show the URL with only a single slash?

 

The colon '<:>' that is close to index 52 is the second one in the error message's broken URL, rather than one in the response content.

 

Whether or not this is a real compliance failure (I am guessing that it wants JSON or something), the assertion failure message seems to be messed up and is therefore not helpful.   Am I missing something obvious?

  • I don't know how the corruption got introduced to the Swagger Compliance Assertion. Editing the URL was to no avail, but I could work around the problem by removing the assertion and then adding a new one.   My guess is that the corruption happened when I updated the project definition.  There's a bug there somewhere, I think, but not going to worry about it for now.

1 Reply

  • jrforeman's avatar
    jrforeman
    Occasional Contributor

    I don't know how the corruption got introduced to the Swagger Compliance Assertion. Editing the URL was to no avail, but I could work around the problem by removing the assertion and then adding a new one.   My guess is that the corruption happened when I updated the project definition.  There's a bug there somewhere, I think, but not going to worry about it for now.