1

I am rather new to the API testing world and I have a question about testing against swagger definitions.

I created the API using the swagger.json already and I have something like this now:

Specification of APIs

With rightclicking the API that I loaded with the swagger.json it automatically creates 2 tests for each of the calls one Request and one Post.

Is there a way to automatically create tests, that have an assertion against the Model definition of the call in swagger?

Example Swagger API call

This is my example call /config/test/showcase which has a Model called T_general. I can find the T_general under the Specification > definitions. Now my question is if I can somehow auto generate the tests to automatically assert against those structures as we need it for the future to avoid that our 3rd party tools send us wrong formats

I hope it's clear what I mean.

I tried creating Functional Tests from the API and also adding manual assertions, but I do not find the definitions that I loaded to test against them, neither manual, nor automated

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Lagencie
  • 11
  • 2
  • If you follow [this guide](https://support.smartbear.com/readyapi/docs/functional/tutorial/your-first-test/create-project.html), on step 4 "Add Assertions" there's a checkbox for "Swagger Compliance Assertion". That's probably what you need. – Helen Jul 04 '23 at 11:11
  • Thanks I think that's exactly what I was looking for, will try it out :) – Lagencie Jul 04 '23 at 13:40

0 Answers0