Skip to content

Conversation

basit3407
Copy link
Collaborator

@basit3407 basit3407 commented Jul 29, 2025

This PR now includes two documentation updates:

  1. Auto-translate warning (content docs)

    • Content APIs → Introduction: Add an admonition advising developers to disable browser auto-translation on Quranic text.
    • Quick Start → Important Considerations: Add guidance and examples (HTML/CSP) to prevent auto-translation.
    • FAQ: Add a Q&A explaining why auto-translation must be disabled for Quran translations delivered by the API.
  2. OpenAPI spec corrections (used by Docusaurus)

    • File: v4.json (OpenAPI 3.x). No MDX changes; docs will be regenerated from this file.

    • Endpoint: Chapter Reciter Audio File (/docs/content_apis_versioned/chapter-reciter-audio-file)

      • Add query param segments: boolean (default false).
      • Update 200 response schema to include timestamps[] with optional segments when segments=true.
      • Add two examples: segments=false (default) and segments=true (with timestamps + segments).
      • Add/extend schemas (SegmentTriplet, VerseTimestamp, AudioFile, ChapterReciterAudioFileResponse).
    • Endpoint: List Surah Recitation (/docs/content_apis_versioned/list-surah-recitation)

      • Remove any mention of segments (param or field).

      • Ensure response is:

        {
          "audio_files": [{ "verse_key": "1:1", "url": "Alafasy/mp3/001001.mp3" }, ...],
          "pagination": { "per_page": 10, "current_page": 1, "next_page": null, "total_pages": 1, "total_records": 7 }
        }
      • Replace incorrect schema/examples that showed timestamps/segments with the correct ones above.

      • Keep/standardize the Pagination schema.

Why

  • Prevent unintended semantic distortion from browser auto-translate on sacred text.
  • Remove spec drift: previously, docs either omitted segments=true behavior or showed fields that the API doesn’t return for List Surah Recitation.

Backward compatibility

  • No breaking changes. segments is optional; default behavior is unchanged.
  • List Surah Recitation docs now match real responses (no segments).

How to review

  • Review v4.json diff only.

  • Rebuild docs from v4.json and verify:

    • “Chapter Reciter Audio File” shows both example shapes and lists the segments param.
    • “List Surah Recitation” shows only { verse_key, url } plus pagination (no timestamps/segments).

Release notes

  • Docs: Add auto-translate warning and guidance.
  • OpenAPI: Document segments=true for Chapter Reciter Audio File; fix List Surah Recitation schema/examples to remove segments.

basit3407 added 30 commits June 24, 2025 11:02
in random verse endpoint

Added missing documentation for existing query parameters supported by the random verse endpoint:

- chapter_number
- page_number
- juz_number
- hizb_number
- rub_el_hizb_number
- ruku_number
- manzil_number

These parameters were already supported in the API but not reflected in the documentation. This update ensures developers are aware of all available filtering options when using the endpoint.
/tafsirs/{resource_id}/by_ayah/{ayah_key}

Fixed the incorrect response schema shown for the /tafsirs/{resource_id}/by_ayah/{ayah_key} endpoint in the docs.

The autogenerated version via <ApiTabs> was causing runtime crashes due to unresolved OpenAPI store references. Since that approach wasn't working despite correct infoPath and operationId setup, we manually wrote the MDX documentation using standard Docusaurus components.

Tested locally – page now renders successfully and reflects the accurate response structure.
list-ayah-tafsirs and regenerate MDX

Updated the OpenAPI schema (v4.json) for the /tafsirs/{resource_id}/by_ayah/{ayah_key} endpoint to ensure the response structure reflects the actual API output.

The previous crash with <ApiTabs> was due to incorrect or incomplete schema context. After fixing the schema, we ran:

- yarn clean-all
- yarn gen-all
- yarn start

The generated docs now render correctly and reflect the accurate response, eliminating the need for manual overrides.
…aceholders-in-v4.json

Fix unrendered model placeholders
…-tokens-in-v4.json

Fix placeholder endpoints
…in-get-todays-plan-api

Fix mushafId param docs
…fields-and-word_fields

Add field reference documentation and links
…g-other-endpoints

docs: link resource references
…ushafid-in-get-todays-plan-api"

This reverts commit c498c43, reversing
changes made to 0969369.
…ation-for-docusaurus

Add JavaScript SDK docs
Copy link

vercel bot commented Jul 29, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Project Deployment Preview Comments Updated (UTC)
qf-api-docs Ready Preview Comment Aug 13, 2025 7:05am

@basit3407 basit3407 changed the title 📘 Add warning to disable browser auto-translate for Quran translations 📘 Docs: Add auto-translate warning + OpenAPI fixes for audio endpoints (document segments=true; correct List Surah Recitation schema) Aug 13, 2025
@osamasayed osamasayed merged commit 9ca75f1 into quran:main Sep 10, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants