Skip to content

[codex] Fix content API v4 doc parity and add Quran Reflect 200 examples#112

Merged
basit3407 merged 3 commits intomainfrom
fix/content-v4-doc-parity
Apr 9, 2026
Merged

[codex] Fix content API v4 doc parity and add Quran Reflect 200 examples#112
basit3407 merged 3 commits intomainfrom
fix/content-v4-doc-parity

Conversation

@basit3407
Copy link
Copy Markdown
Collaborator

Summary

This PR updates the content API v4 OpenAPI source of truth and regenerates the content docs to match the actual API surface.

The work comes from a full static audit of openAPI/content/v4.json against quran.com-api, plus Quran Reflect read-endpoint response shapes from quran.com-users-backend.

Why

The audit found multiple contract mismatches between the published content API docs and the implementation, including:

  • incorrect top-level response wrappers for some resource endpoints
  • incorrect field names and missing nested fields
  • missing query parameters in shared endpoint families
  • wrong response shape for /quran/verses/{script}
  • wrong response shape details for /quran/translations/{translation_id}
  • missing alias operations for rub al hizb endpoints
  • missing 200 response schemas/examples for the 5 Quran Reflect read endpoints included in this spec

Because the generated docs are driven from v4.json, the fixes needed to happen at the spec level and then be regenerated into both current and versioned content docs.

What Changed

OpenAPI parity fixes

Updated openAPI/content/v4.json so the documented contracts now match the API implementation for:

  • /resources/recitations
  • /resources/languages
  • /resources/chapter_reciters
  • /resources/chapter_infos
  • /resources/translations/{translation_id}/info
  • /resources/recitations/{recitation_id}/info
  • /quran/translations/{translation_id}
  • /quran/verses/{script} and the explicit script endpoints

Family-level normalization

Standardized and corrected shared content API docs by:

  • replacing rub_number with rub_el_hizb_number in the relevant shared schemas/examples
  • normalizing pagination keys to per_page, current_page, next_page, total_pages, and total_records
  • adding missing fields, page, and per_page params where supported across translations, tafsirs, and recitations
  • fixing chapter_recitations path params to use reciter_id
  • removing the unused language query param from the chapter recitation list endpoint
  • adding the missing rub alias operations so the docs reflect the routed surface consistently

Quran Reflect coverage

Added full 200 response schemas and examples for all five Quran Reflect endpoints included in this spec:

  • /quran-reflect/v1/posts/feed
  • /quran-reflect/v1/posts/{id}
  • /quran-reflect/v1/posts/user-posts/{id}
  • /quran-reflect/v1/posts/{id}/comments
  • /quran-reflect/v1/posts/{id}/all-comments

These response shapes were mirrored from quran.com-users-backend.

Generated docs

Regenerated:

  • current docs/content_apis_versioned/*
  • versioned docs/content_apis_versioned/4.0.0/*
  • content API sidebar/version metadata affected by regeneration

Impact

  • the published content API docs now align much more closely with the actual v4 implementation
  • current and versioned content docs are in sync with the corrected spec
  • Quran Reflect endpoints included in the content docs now have concrete 200 examples instead of incomplete read paths

Validation

Ran successfully:

  • targeted content API doc regeneration
  • versioned content API doc regeneration
  • yarn postgen-api-sidebars
  • yarn build

The docs build completed successfully after regeneration, which confirms the updated spec renders cleanly through the docs pipeline.

@basit3407 basit3407 marked this pull request as ready for review April 3, 2026 03:47
@basit3407 basit3407 requested a review from Copilot April 3, 2026 03:50
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the Content API v4 OpenAPI “source of truth” and regenerates the Docusaurus OpenAPI docs to bring published contracts back in parity with the actual API surface, including adding complete 200-response examples for Quran Reflect read endpoints.

Changes:

  • Regenerated current and v4.0.0 versioned Content API docs/sidebars to reflect updated v4 spec parity.
  • Added alias-route documentation entries for Rub el Hizb endpoint families (recitations/tafsirs/etc.).
  • Added concrete 200 response examples for Quran Reflect comments endpoints in the generated docs.

Reviewed changes

Copilot reviewed 15 out of 125 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
docs/content_apis_versioned/sidebar.js Regenerated current docs sidebar; includes new alias-route doc entries.
docs/content_apis_versioned/posts-controller-get-comments.api.mdx Adds/updates 200 response example content for “Get post comments”.
docs/content_apis_versioned/posts-controller-get-all-comment.api.mdx Adds/updates 200 response example content for “Get all post comments”.
docs/content_apis_versioned/list-rub-el-hizb-tafsirs-rub.api.mdx New alias-route doc page for rub-el-hizb tafsirs endpoint variant.
docs/content_apis_versioned/list-rub-el-hizb-recitation-rub-el-hizb.api.mdx New alias-route doc page for rub-el-hizb recitation endpoint variant.
docs/content_apis_versioned/4.0.0/sidebar.js Regenerated v4.0.0 sidebar; includes new alias-route doc entries.
docs/content_apis_versioned/4.0.0/posts-controller-get-comments.api.mdx Adds/updates 200 response example content for “Get post comments” (v4.0.0 docs).
docs/content_apis_versioned/4.0.0/posts-controller-get-all-comment.api.mdx Adds/updates 200 response example content for “Get all post comments” (v4.0.0 docs).
docs/content_apis_versioned/4.0.0/list-rub-el-hizb-tafsirs-rub.api.mdx New alias-route doc page for rub-el-hizb tafsirs endpoint variant (v4.0.0 docs).
docs/content_apis_versioned/4.0.0/list-rub-el-hizb-recitation-rub-el-hizb.api.mdx New alias-route doc page for rub-el-hizb recitation endpoint variant (v4.0.0 docs).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread docs/content_apis_versioned/posts-controller-get-all-comment.api.mdx Outdated
Comment thread docs/content_apis_versioned/4.0.0/posts-controller-get-all-comment.api.mdx Outdated
Comment thread docs/content_apis_versioned/sidebar.js Outdated
Comment thread docs/content_apis_versioned/4.0.0/sidebar.js Outdated
Comment thread docs/content_apis_versioned/list-rub-el-hizb-recitation-rub-el-hizb.api.mdx Outdated
Comment thread docs/content_apis_versioned/list-rub-el-hizb-tafsirs-rub.api.mdx Outdated
@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented Apr 3, 2026

Deploying qf-api-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 8a85934
Status:⚡️  Build in progress...

View logs

@basit3407 basit3407 requested a review from osamasayed April 3, 2026 04:21
…rity

# Conflicts:
#	docs/content_apis_versioned/4.0.0/posts-controller-feed.api.mdx
#	docs/content_apis_versioned/posts-controller-feed.api.mdx
@basit3407 basit3407 merged commit 701a68e into main Apr 9, 2026
1 check was pending
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants