Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

openapi: Loosen anchor parameter specification to string.

Anders Kaseorg0514f92bdbda
diff --git a/zerver/openapi/openapi.py b/zerver/openapi/openapi.py
index 4258150684d..9da070d4028 100644
--- a/zerver/openapi/openapi.py
+++ b/zerver/openapi/openapi.py
@@ -486,7 +486,11 @@ def validate_request(
# against the OpenAPI documentation.
assert isinstance(data, dict)
mock_request = MockRequest(
- "http://localhost:9991/", method, "/api/v1" + url, headers=http_headers, args=data
+ "http://localhost:9991/",
+ method,
+ "/api/v1" + url,
+ headers=http_headers,
+ args={k: str(v) for k, v in data.items()},
)
try:
openapi_spec.spec().validate_request(mock_request)
diff --git a/zerver/openapi/zulip.yaml b/zerver/openapi/zulip.yaml
index 36e6f32ef2a..9d38de759e3 100644
--- a/zerver/openapi/zulip.yaml
+++ b/zerver/openapi/zulip.yaml
@@ -5994,7 +5994,7 @@ paths:
2.1.x and older in the `found_newest` return value).
schema:
$ref: "#/components/schemas/Anchor"
- example: 43
+ example: "43"
- name: include_anchor
in: query
description: |
@@ -6863,7 +6863,7 @@ paths:
query, if any; otherwise, the most recent message.
schema:
$ref: "#/components/schemas/Anchor"
- example: 43
+ example: "43"
required: true
- name: include_anchor
in: query
@@ -18147,13 +18147,7 @@ components:
The event's type, relevant both for client-side dispatch and server-side
filtering by event type in [POST /register](/api/register-queue).
Anchor:
- oneOf:
- - type: string
- enum:
- - newest
- - oldest
- - first_unread
- - type: integer
+ type: string
Attachments:
type: object
description: |