Marton Greber has posted comments on this change. ( 
http://gerrit.cloudera.org:8080/23904 )

Change subject: KUDU-3700 Add swagger verification script docs
......................................................................


Patch Set 1: Code-Review+1

(2 comments)

http://gerrit.cloudera.org:8080/#/c/23904/1/build-support/verify_swagger_spec.py
File build-support/verify_swagger_spec.py:

http://gerrit.cloudera.org:8080/#/c/23904/1/build-support/verify_swagger_spec.py@47
PS1, Line 47: REGISTER_HANDLER_RE = re.compile(
            :     
r"Register(?:Prerendered)?PathHandler\(\s*(?P<args>.*?)\);\s*",
            :     re.DOTALL,
            : )
            : PATH_RE = re.compile(r'"(?P<path>/api/[^"]+)"')
            : HANDLER_RE = re.compile(r"this->(?P<handler>\w+)\s*\(")
            : METHOD_EQ_RE = 
re.compile(r'req\.request_method\s*==\s*"(?P<method>[A-Z]+)"')
            : METHOD_NE_RE = 
re.compile(r'req\.request_method\s*!=\s*"(?P<method>[A-Z]+)"')
            : FUNC_DEF_RE = re.compile(
            :     
r"void\s+RestCatalogPathHandlers::(?P<name>\w+)\s*\([^)]*\)\s*\{",
            :     re.DOTALL,
            : )
nit: just for readabilitys sake can you please add comments above the regexes 
about what they do. makes reading this script easier.


http://gerrit.cloudera.org:8080/#/c/23904/1/build-support/verify_swagger_spec.py@178
PS1, Line 178:       errors.append("Unable to infer HTTP methods for source 
path: {}".format(path))
The method inference is best?effort and only scans for direct 
req.request_method checks in the handler body. If a handler delegates method 
checks to helper functions or uses other patterns, this will report “unable to 
infer”. Consider adding a hint to the error message so users know this 
limitation.

something like: "Unable to infer HTTP methods for source path: {path} (checker 
only scans direct req.request_method checks in the handler body; nested helpers 
are not detected)"



--
To view, visit http://gerrit.cloudera.org:8080/23904
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I3ca60becef11eb2170544f87fafc5d9aa4110a31
Gerrit-Change-Number: 23904
Gerrit-PatchSet: 1
Gerrit-Owner: Gabriella Lotz <[email protected]>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Marton Greber <[email protected]>
Gerrit-Comment-Date: Mon, 09 Feb 2026 17:10:54 +0000
Gerrit-HasComments: Yes

Reply via email to