Report number of checked endpoints in the result and warn if the number of specified endpoints in FTL and the OpenAPI specs do not match

Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
DL6ER
2023-11-02 05:38:19 +01:00
parent 253feef597
commit 3a67a77a08
5 changed files with 56 additions and 29 deletions
+21 -20
View File
@@ -71,29 +71,30 @@ if __name__ == "__main__":
# Verify that all the endpoint defined by GET /api/endpoints are documented
# and that there are no undocumented endpoints
print("Verifying the /api/endpoints endpoint...")
verifyer = ResponseVerifyer(ftl, openapi)
errors = verifyer.verify_endpoints()
if len(errors) == 0:
print(" GET /api/endpoints: OK")
else:
print(" Errors:")
for error in errors:
print(" - " + error)
errs[2] += len(errors)
print("Comparing all endpoints defined in FTL against the OpenAPI specs...")
with ResponseVerifyer(ftl, openapi) as verifyer:
errors, checked = verifyer.verify_endpoints()
if len(errors) == 0:
print(" OK (" + str(checked) + " endpoints checked)")
else:
print(" Errors (" + str(checked) + " endpoints checked):")
for error in errors:
print(" - " + error)
errs[2] += len(errors)
print("")
# Verify FTL Teleporter import
print("Verifying FTL Teleporter import...")
verifyer = ResponseVerifyer(ftl, openapi)
errors = verifyer.verify_teleporter_zip(teleporter)
if len(errors) == 0:
print(" POST /api/teleporter: OK")
else:
print(" Errors:")
for error in errors:
print(" - " + error)
errs[2] += len(errors)
with ResponseVerifyer(ftl, openapi) as verifyer:
errors = verifyer.verify_teleporter_zip(teleporter)
if len(errors) == 0:
print(" POST /api/teleporter: OK")
else:
print(" Errors:")
for error in errors:
print(" - " + error)
errs[2] += len(errors)
print("")
# Print the number error (if any)
if errs[0] > 0: