feat: API docs for service api (#24425)
Signed-off-by: -LAN- <laipz8200@outlook.com>
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
from flask_restx import fields
|
||||
from flask_restx import Api, Namespace, fields
|
||||
|
||||
from libs.helper import TimestampField
|
||||
|
||||
@@ -11,6 +11,12 @@ annotation_fields = {
|
||||
# 'account': fields.Nested(simple_account_fields, allow_null=True)
|
||||
}
|
||||
|
||||
|
||||
def build_annotation_model(api_or_ns: Api | Namespace):
|
||||
"""Build the annotation model for the API or Namespace."""
|
||||
return api_or_ns.model("Annotation", annotation_fields)
|
||||
|
||||
|
||||
annotation_list_fields = {
|
||||
"data": fields.List(fields.Nested(annotation_fields)),
|
||||
}
|
||||
|
Reference in New Issue
Block a user