Skip to content

Commit 1206891

Browse files
committed
Remove obsolete implementations for sorting and email notifier tests; add shared OpenAPI helpers and notifications support for Telegram, Mattermost, and Voice Call channels. Expand silences UI with expired-filter history and improve summary navigation. Update service version to 1.0.4-beta.
1 parent 48a79ac commit 1206891

41 files changed

Lines changed: 1079 additions & 1140 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

app/api/openapi/common.py

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
"""Shared OpenAPI helper builders."""
2+
3+
ERROR_SCHEMA = {
4+
"type": "object",
5+
"properties": {
6+
"error": {"type": "string", "example": "validation_error"},
7+
"message": {"type": "string", "nullable": True},
8+
"details": {"type": "array", "items": {"type": "object"}},
9+
},
10+
}
11+
12+
13+
def path_param(name, description):
14+
"""Build an integer path parameter."""
15+
return {
16+
"name": name,
17+
"in": "path",
18+
"required": True,
19+
"description": description,
20+
"schema": {"type": "integer", "minimum": 1},
21+
}
22+
23+
24+
def query_param(name, description, schema=None, required=False):
25+
"""Build a query parameter."""
26+
return {
27+
"name": name,
28+
"in": "query",
29+
"required": required,
30+
"description": description,
31+
"schema": schema or {"type": "string"},
32+
}
33+
34+
35+
def json_body(description, schema, required=True):
36+
"""Build a JSON request body."""
37+
return {
38+
"required": required,
39+
"description": description,
40+
"content": {"application/json": {"schema": schema}},
41+
}
42+
43+
44+
def response(description, schema=None):
45+
"""Build a JSON response object."""
46+
item = {"description": description}
47+
if schema:
48+
item["content"] = {"application/json": {"schema": schema}}
49+
return item

0 commit comments

Comments
 (0)