zulip/templates/zerver/api
Anders Kaseorg bd9a1dc971 tests: Consistently JSON-encode ‘to’ parameter
Although our POST /messages handler accepts the ‘to’ parameter with or
without JSON encoding, there are two problems with passing it as an
unencoded string.

Firstly, you’d fail to send a message to a stream named ‘true’ or
‘false’ or ‘null’ or ‘2022’, as the JSON interpretation is prioritized
over the plain string interpretation.

Secondly, and more importantly for our tests, it violates our OpenAPI
schema, which requires the parameter to be JSON-encoded.  This is
because OpenAPI has no concept of a parameter that’s “optionally
JSON-encoded”, nor should it: such a parameter cannot be unambiguously
decoded for the reason above.

Our version of openapi-core doesn’t currently detect this schema
violation, but after the next upgrade it will.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-09-13 11:05:37 -07:00
..
api-doc-template.md openapi: Fuse generate_api_title with generate_api_description. 2022-07-22 16:41:55 -07:00
api-keys.md help: Update help pages according to profile page redesign. 2021-06-30 16:56:03 -07:00
changelog.md user_settings: Add user setting to control the user list style. 2022-09-09 16:30:54 -07:00
client-libraries.md external links: Migrate the rest of /developer-community links. 2021-12-09 12:14:26 -08:00
configuring-python-bindings.md docs: Fix more capitalization issues. 2020-10-23 11:46:55 -07:00
construct-narrow.md docs: Correct “webapp” to “web app”. 2021-05-14 13:15:38 -07:00
create-stream.md api docs: Correct errors in the stream creation documentation. 2020-06-25 14:34:10 -07:00
deploying-bots.md docs: Update links for other repository branch renames. 2021-08-31 15:28:01 -07:00
incoming-webhooks-overview.md docs: Fix many spelling mistakes. 2022-02-07 18:51:06 -08:00
incoming-webhooks-walkthrough.md docs: Update WIP PR convention to GitHub draft PRs. 2022-06-28 13:16:38 -07:00
index.md openapi: Make api-docs filename match with operationIds. 2020-06-18 22:38:05 -07:00
installation-instructions.md api docs: Fix link to client libraries. 2019-11-22 11:08:44 -08:00
integrations-overview.md Rename default branch to ‘main’. 2021-09-06 12:56:35 -07:00
mark-all-as-read.md openapi: Move endpoint URL to generator. 2022-07-22 16:41:55 -07:00
missing.md
non-webhook-integrations.md docs: Update links for other repository branch renames. 2021-08-31 15:28:01 -07:00
outgoing-webhooks.md outgoing webhooks: Fix inconsistencies with Slack's API. 2021-09-23 11:19:20 -07:00
real-time-events.md docs: Allow passing additional params to `call_on_each_event`. 2021-04-06 08:40:32 -07:00
rest-error-handling.md api_documentation: Update rate limit error description. 2022-01-26 12:51:02 -08:00
rest.md help: Add newline after admonition header for Prettier compatibility. 2021-09-10 10:39:25 -07:00
roles-and-permissions.md api_docs: Add roles and permissions page to API documentation. 2022-04-04 17:09:05 -07:00
running-bots.md external links: Migrate the rest of /developer-community links. 2021-12-09 12:14:26 -08:00
send-message.md tests: Consistently JSON-encode ‘to’ parameter 2022-09-13 11:05:37 -07:00
sidebar_index.md api_docs: Add roles and permissions page to API documentation. 2022-04-04 17:09:05 -07:00
writing-bots.md bot docs: Migrate script name from zulip-terminal to zulip-bot-shell. 2021-11-19 11:49:06 -08:00