Closed SBechstedt closed 2 years ago
I noticed the point "Tests" in the todo, but want to be sure I am not missing anything.
Yes, using openapi_get_spec!
is indeed the right macro for this.
If you want you can also compare it to an other OpenApi
object. Or serialize it using the serde_json
or any other crate/type.
The "Tests" todo is an old todo. Although we do not have tests at the moment. We do have compile tests with the examples. Feel free if you want to create a PR that adds some tests.
@snpschaaf
Question:
Is there any way to write a golden test for the OpenApi spec without having to launch a rocket server before?
I can generate it with the
openapi_get_spec!
macro and would like to test its content against an earlier created openapi spec stored as Json file on my system. I retrieved the Json file through the Swagger Web UI which was served using this crate.