Skip to content

[codex] document canonical /api base URL for Search API#140

Closed
basit3407 wants to merge 1 commit intomainfrom
codex/document-search-api-canonical-base-url
Closed

[codex] document canonical /api base URL for Search API#140
basit3407 wants to merge 1 commit intomainfrom
codex/document-search-api-canonical-base-url

Conversation

@basit3407
Copy link
Copy Markdown
Collaborator

@basit3407 basit3407 commented Apr 22, 2026

Summary

  • update the Search API OpenAPI spec to publish /search/api as the canonical base URL
  • add an explicit backward-compatibility note explaining that the legacy /search base URL still works
  • regenerate the affected search API docs pages for both latest and 1.0.0

Why

The Search API docs were the outlier among the QF API families because they omitted the /api segment from the published base URL. That inconsistency has been confusing developers who expect the same URL shape used by the other APIs.

This PR updates the docs to point developers at the canonical /api form while still documenting that the old base URL remains valid.

Reviewer Notes

  • This PR only includes the search spec and the generated search docs pages tied to that spec.
  • Companion PRs:
    • quran/search-service#21
    • quran/qf-api-gateway#64

Validation

  • regenerated search docs with Docusaurus from openAPI/search/v1.json
  • verified the generated latest and 1.0.0 search docs now reference the canonical /search/api base URL
@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying qf-api-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: c9244cc
Status: ✅  Deploy successful!
Preview URL: https://0bd3a1ef.qf-api-docs.pages.dev
Branch Preview URL: https://codex-document-search-api-ca.qf-api-docs.pages.dev

View logs

@basit3407 basit3407 marked this pull request as ready for review April 22, 2026 04:19
@basit3407 basit3407 requested a review from Copilot April 22, 2026 04:19
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

Updates the Quran.Foundation Search API documentation to publish /search/api as the canonical base URL (aligning with other API families) while explicitly noting that the legacy /search base URL remains supported for backward compatibility.

Changes:

  • Updated the Search API OpenAPI servers URLs to use /search/api for both production and pre-production.
  • Added a canonical-base-URL + backward-compatibility note to the Search API description/introduction.
  • Regenerated the affected “latest” and 1.0.0 Search API docs pages to reflect the new canonical base URL.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
openAPI/search/v1.json Sets canonical server base URLs to /search/api and documents legacy /search support.
docs/search_apis_versioned/search-controller-search.api.mdx Regenerated operation doc to reference /search/api servers and include canonical URL note.
docs/search_apis_versioned/quran-foundation-search-api.info.mdx Regenerated intro doc to include canonical base URL + backward-compat note.
docs/search_apis_versioned/1.0.0/search-controller-search.api.mdx Same regeneration for version 1.0.0 operation doc with /search/api servers.
docs/search_apis_versioned/1.0.0/quran-foundation-search-api.info.mdx Same regeneration for version 1.0.0 intro doc with canonical base URL note.

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

Comment thread openAPI/search/v1.json
"info": {
"title": "Quran.Foundation Search API",
"description": "Quran.Foundation Search API provides programmatic access to search Quran content including verses, chapters, juz, pages, and translations. This is distinct from user-specific data like notes and bookmarks provided by [User-related APIs](/docs/category/user-related-apis).\n\n## How to get access\n\nWe are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). The required scope is [`search`](/docs/user_related_apis_versioned/scopes#search).",
"description": "Quran.Foundation Search API provides programmatic access to search Quran content including verses, chapters, juz, pages, and translations. This is distinct from user-specific data like notes and bookmarks provided by [User-related APIs](/docs/category/user-related-apis).\n\n## How to get access\n\nWe are using OAuth2 flows to authenticate and authorize requests. To get started, you need to [get an access token](/docs/tutorials/oidc/getting-started-with-oauth2#obtaining-oauth-20-client-credentials) to make requests to our APIs. Then follow the steps mentioned [here](/docs/tutorials/oidc/getting-started-with-oauth2). The required scope is [`search`](/docs/user_related_apis_versioned/scopes#search).\n\nUse the canonical base URL `https://apis.quran.foundation/search/api` (or `https://apis-prelive.quran.foundation/search/api` in pre-production). The legacy base URL without `/api` remains supported for backward compatibility.",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This PR once merged should push new search definition to the docs repo so we don't need to manually do this.

@basit3407 basit3407 closed this Apr 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants