Toolbox for property based testing of an API specified with swagger
Swagger is a nice way to specify REST APIs, but it just can not keep up with all the different libraries commonly (or not so commonly) used to implement this API.
If you generate your Swagger specifications automatically you probably do not need
this toolbox. But if you write your Swagger specifications by hand and implement
them later you might encounter the problem how to ensure that the specification
matches reality in the long term. swagger-check
might help you in this case.
swagger-check
is build around Scala Check and contains two main additions:
As an additional party gimmic there is also ein generator to generate matches to a regex that you might consider useful for other things.
Add the following to your build.sbt
libraryDependencies += "de.leanovate.swaggercheck" %% "swagger-check-core" % "0.99.13" % "test"
You can find an example Play2 project in the examples folder.
The project is now separated in modules to (eventually) support a multiple frameworks without ending in a dependency hell.
NodeAdapter
for each json implementationjson-schema-model
from a json filejson-schema-model
with ScalaCheck generatorsjackson-core
for json parsing and generation