This commit is contained in:
@@ -31,6 +31,7 @@ class ParameterChange:
|
||||
required: Optional[bool] = None
|
||||
old_required: Optional[bool] = None
|
||||
detail: Optional[str] = None
|
||||
description: Optional[str] = None
|
||||
|
||||
def to_markdown_line(self, *, plain: bool = False) -> str:
|
||||
"""
|
||||
@@ -46,7 +47,8 @@ class ParameterChange:
|
||||
if req_required
|
||||
else '<font color="comment">可选</font>'
|
||||
)
|
||||
return f'> `{self.param_type}` **{self.param_name}** · {tag}'
|
||||
desc = f" <font color=\"comment\">{self.description}</font>" if self.description else ""
|
||||
return f'> `{self.param_type}` **{self.param_name}** · {tag}{desc}'
|
||||
|
||||
if self.change_type == ChangeType.REMOVED:
|
||||
return (
|
||||
@@ -59,9 +61,10 @@ class ParameterChange:
|
||||
if req_required
|
||||
else '<font color="comment">可选</font>'
|
||||
)
|
||||
desc = f" <font color=\"comment\">{self.description}</font>" if self.description else ""
|
||||
return (
|
||||
f'<font color="info">【新增】</font> '
|
||||
f'`{self.param_type}` **{self.param_name}** · {tag}'
|
||||
f'`{self.param_type}` **{self.param_name}** · {tag}{desc}'
|
||||
)
|
||||
if self.change_type == ChangeType.RENAMED:
|
||||
return (
|
||||
@@ -209,6 +212,7 @@ def compare_parameters(
|
||||
param_name=param.name,
|
||||
param_type=param.type,
|
||||
required=param.required,
|
||||
description=param.description,
|
||||
)
|
||||
)
|
||||
|
||||
@@ -365,6 +369,7 @@ def compare_endpoints(
|
||||
param_name=p.name,
|
||||
param_type=p.type,
|
||||
required=p.required,
|
||||
description=p.description,
|
||||
)
|
||||
for p in ep.parameters
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user