I'm creating an API using http4k and I have a ques...
# http4k
m
I'm creating an API using http4k and I have a question regarding the contracts. Basically, I need to have an automatically generated Swagger UI. For the Swagger UI, I need a
contract {}
block that will be sitting at the root of my API and I have to add manually all the `ContractRoute`s by using
routes += xxxRoute
. Does this mean that I can't really split the API into separate pieces the same way I could nest routes with the normal routing? Like if I have a URL
/api/v1/cars/
and then four CRUD methods in there, they cannot lie inside a single route inside the
contract {}
block, they will have to be four separate routes inside the huge
contract {}
?
d
that is correct - the routes have to be separate with the current API