Skip to content

Commit 632c224

Browse files
afrankeAlexandre Franke
authored andcommitted
✨ Warn of untagged operations (#3699)
Signed-off-by: Alexandre Franke <[email protected]> Co-authored-by: Alexandre Franke <[email protected]>
1 parent 9b0bd09 commit 632c224

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

scripts/dump-swagger.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ def edit_links(node, base_url):
168168
except FileNotFoundError:
169169
print("No security definitions available for this API")
170170

171+
untagged = 0
171172
for filename in os.listdir(selected_api_dir):
172173
if not filename.endswith(".yaml"):
173174
continue
@@ -185,6 +186,11 @@ def edit_links(node, base_url):
185186
if path not in output["paths"]:
186187
output["paths"][path] = {}
187188
output["paths"][path][method] = spec
189+
if "tags" not in spec.keys():
190+
print("Warning: {} {} is not tagged ({}).".format(method.upper(), path, filename))
191+
untagged +=1
192+
if untagged != 0:
193+
print("{} untagged operations, you may want to look into fixing that.".format(untagged))
188194

189195
edit_links(output, base_url)
190196

0 commit comments

Comments
 (0)