feat: add support for operationId in docstring; feat: v1.120.6
This commit is contained in:
@@ -120,6 +120,19 @@ def tags(docstring: str) -> List[str]:
|
||||
return []
|
||||
|
||||
|
||||
def operation_id(docstring: str) -> str | None:
|
||||
"""
|
||||
Extract the "OperationId:" block of the docstring.
|
||||
"""
|
||||
iterator = LinesIterator(docstring)
|
||||
for line in iterator:
|
||||
if re.fullmatch("operation_?id\\s*:.*", line, re.IGNORECASE):
|
||||
iterator.rewind()
|
||||
return line.split(":")[1].strip(' ')
|
||||
|
||||
return None
|
||||
|
||||
|
||||
def operation(docstring: str) -> str:
|
||||
"""
|
||||
Extract all docstring except the "Status Code:" block.
|
||||
@@ -127,7 +140,7 @@ def operation(docstring: str) -> str:
|
||||
lines = LinesIterator(docstring)
|
||||
ret = []
|
||||
for line in lines:
|
||||
if re.fullmatch("status\\s+codes?\\s*:|tags\\s*:.*", line, re.IGNORECASE):
|
||||
if re.fullmatch("status\\s+codes?\\s*:|tags\\s*:.*|operation_?id\\s*:.*", line, re.IGNORECASE):
|
||||
lines.rewind()
|
||||
for _ in _i_extract_block(lines):
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user