Skip to content

Conversation

@aralovelace
Copy link
Contributor

@aralovelace aralovelace commented Jan 2, 2026

Description

WEB-4862 This is a bug reports from Matt with some issues:

1- the the curl command scripts in this page - https://ably.com/docs/api/rest-api#unenveloped I tried to correct the issues in the format of the codes

2- JSON code cant be copied and paste when clicking the copy icon

  • Looking at MDXWrapper.tsx, the UTILITY_LANGUAGES list that bypasses language processing only includes ['html', 'xml', 'css', 'sql'] - but not json. This means JSON blocks go through the SDK/language handling logic which may be interfering with the copy functionality. So I have added it back and it works

let me know what you guys think

To Test:
Review app - https://ably-docs-web-4862-fix-ic3sjks.herokuapp.com/docs/api/rest-api#unenveloped

1- Check the Unenveloped publish curl json and plain text codes

2- In this section - https://ably-docs-web-4862-fix-ic3sjks.herokuapp.com/docs/api/rest-api#update-message you should now be able to copy and paste JSON code

Checklist

Summary by CodeRabbit

  • Bug Fixes

    • Fixed warning messages that appeared for JSON code blocks in documentation.
  • Documentation

    • Standardized and simplified authentication example formatting in REST API documentation.

✏️ Tip: You can customize this high-level summary in your review settings.

@aralovelace aralovelace self-assigned this Jan 2, 2026
@coderabbitai
Copy link

coderabbitai bot commented Jan 2, 2026

Important

Review skipped

Auto reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

The changes fix documentation issues by adding 'json' as a utility language to prevent formatting warnings and standardizing curl authentication examples across REST API documentation, converting from a malformed format to proper -u syntax.

Changes

Cohort / File(s) Summary
Configuration Update
src/components/Layout/MDXWrapper.tsx
Added 'json' to UTILITY_LANGUAGES array in WrappedCodeSnippet to prevent warnings for JSON code blocks.
Documentation Fix
src/pages/docs/api/rest-api.mdx
Standardized curl command authentication examples throughout REST API documentation by converting malformed authentication string format {'{{API_KEY}}}"{""} to simplified -u "{{API_KEY}}" syntax with minor formatting adjustments.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 A JSON block now skips its warning call,
Curl commands straightened, no more broken sprawl,
Authentication flows in simpler grace,
Docs now glimmer in their proper place! ✨

Pre-merge checks and finishing touches

✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title references WEB-4862 and mentions fixing unenveloped publish code, which aligns with the curl and JSON formatting fixes in the REST API documentation and MDXWrapper changes.
Linked Issues check ✅ Passed The PR addresses all three bugs in WEB-4862: correcting curl command formatting in REST API docs, fixing API key injection for copy functionality, and ensuring JSON blocks render and copy correctly by adding 'json' to UTILITY_LANGUAGES.
Out of Scope Changes check ✅ Passed All changes are directly related to resolving the documented issues: MDXWrapper.tsx updates enable proper JSON rendering, and REST API documentation updates correct curl command formatting and authentication syntax.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

Comment @coderabbitai help to get the list of available commands and usage tips.

@aralovelace aralovelace requested review from GregHolmes, franrob-projects and m-hulbert and removed request for franrob-projects January 2, 2026 13:27
@aralovelace aralovelace added the review-app Create a Heroku review app label Jan 2, 2026
@ably-ci ably-ci temporarily deployed to ably-docs-web-4862-fix-ic3sjks January 2, 2026 13:46 Inactive
@aralovelace aralovelace temporarily deployed to ably-docs-web-4862-fix-ic3sjks January 2, 2026 14:40 Inactive
Copy link
Member

@kennethkalmer kennethkalmer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another thing Matt reported was that copying the code does not give you the full API keys, you get the masked keys back... I need to poke around some of the other code snippets just to check as well (and to see if this is a safari thing or not)

```shell
curl -X POST https://main.realtime.ably.net/channels/rest-example/messages?enveloped=false \
-H 'content-type: text/plain' --data 'some plain text' \
-u "{'{{API_KEY}}'}"{""}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would scan this file for other API keys that have this ghost {""} afterwards and remove them too

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hi @kennethkalmer I have updated let me know what you think?

@aralovelace aralovelace temporarily deployed to ably-docs-web-4862-fix-ic3sjks January 6, 2026 14:52 Inactive
@aralovelace aralovelace temporarily deployed to ably-docs-web-4862-fix-ic3sjks January 6, 2026 15:26 Inactive
@aralovelace
Copy link
Contributor Author

@coderabbitai full review

@coderabbitai
Copy link

coderabbitai bot commented Jan 6, 2026

✅ Actions performed

Full review triggered.

@aralovelace
Copy link
Contributor Author

Another thing Matt reported was that copying the code does not give you the full API keys, you get the masked keys back... I need to poke around some of the other code snippets just to check as well (and to see if this is a safari thing or not)

thanks @kennethkalmer I also checked seems its working on Safari

@aralovelace aralovelace requested a review from GregHolmes January 6, 2026 16:15
@aralovelace
Copy link
Contributor Author

hi @GregHolmes I updated the whole file with correct API key format. would you be able to re-review it if all good in your end? thanks

Copy link
Contributor

@franrob-projects franrob-projects left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@kennethkalmer kennethkalmer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spotted a tiny mistake on one of the curl lines, otherwise looking good. @aralovelace I think it might be worth asking botticus to "ensure the indentation of the all the fenced code blocks, specifically shell code blocks are consistent and will present well in a fix-width font"

@aralovelace aralovelace temporarily deployed to ably-docs-web-4862-fix-ic3sjks January 7, 2026 10:13 Inactive
@aralovelace
Copy link
Contributor Author

Spotted a tiny mistake on one of the curl lines, otherwise looking good. @aralovelace I think it might be worth asking botticus to "ensure the indentation of the all the fenced code blocks, specifically shell code blocks are consistent and will present well in a fix-width font"

thanks @kennethkalmer for the review. I have updated the indention and some remove unecessary : and \ at the end

Copy link
Member

@kennethkalmer kennethkalmer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice one @aralovelace 💅. Please squash down and rebase so we can get this out :shipit:

@aralovelace aralovelace temporarily deployed to ably-docs-web-4862-fix-ic3sjks January 7, 2026 13:13 Inactive
@aralovelace aralovelace merged commit 06d22d3 into main Jan 7, 2026
7 checks passed
@aralovelace aralovelace deleted the WEB-4862_fix branch January 7, 2026 13:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review-app Create a Heroku review app

Development

Successfully merging this pull request may close these issues.

6 participants