1
0
Fork 0

improve openapi verification

This commit is contained in:
Cyborus 2024-01-29 21:56:20 -05:00
parent 2c467ea6cf
commit 19a0dc3a60
No known key found for this signature in database
4 changed files with 500 additions and 64 deletions

View file

@ -21,6 +21,7 @@ fn get_spec() -> eyre::Result<OpenApiV2> {
.unwrap_or_else(|| OsString::from("./swagger.v1.json"));
let file = std::fs::read(path)?;
let spec = serde_json::from_slice::<OpenApiV2>(&file)?;
spec.validate()?;
Ok(spec)
}