Skip to content

Commit 9ff52da

Browse files
authored
📚 Sync docs: Fix Tafsir endpoint schema & document random verse filters & other updates (#10)
* docs: document support for location-based filters 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. * fix: correct response schema for: /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. * fix(docs): correct response schema for 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. * fix: correct tafsir typos * Fix Mushaf typo in content API docs * regenerated api docs after fixing "Mushaf" typos * Replace unrendered model placeholders * Regenerated api docs after fixing model names * Replace placeholder endpoints in v4.json * regenerated api docs after replacing endpoint tokens with actual endpoints
1 parent a3f6897 commit 9ff52da

121 files changed

Lines changed: 508 additions & 403 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎docs/content_apis_versioned/4.0.0/chapter-info.api.mdx‎

Lines changed: 3 additions & 3 deletions
Large diffs are not rendered by default.

‎docs/content_apis_versioned/4.0.0/chapter-reciters.api.mdx‎

Lines changed: 3 additions & 3 deletions
Large diffs are not rendered by default.

‎docs/content_apis_versioned/4.0.0/get-chapter.api.mdx‎

Lines changed: 3 additions & 3 deletions
Large diffs are not rendered by default.

‎docs/content_apis_versioned/4.0.0/info.api.mdx‎

Lines changed: 3 additions & 3 deletions
Large diffs are not rendered by default.

‎docs/content_apis_versioned/4.0.0/juzs.api.mdx‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
---
22
id: juzs
33
title: "Get All Juzs"
4-
description: "Get list of all #model:XwogxNra8JdvchxBE"
4+
description: "Get list of all Juz"
55
sidebar_label: "Get All Juzs"
66
hide_title: true
77
hide_table_of_contents: true
8-
api: {"tags":["Juz"],"description":"Get list of all #model:XwogxNra8JdvchxBE","operationId":"juzs","responses":{"default":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"method":"get","path":"/juzs","servers":[{"url":"https://apis-prelive.quran.foundation/content/api/v4","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/content/api/v4","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","description":"The JWT access token required for accessing the endpoints.","name":"x-auth-token","in":"header"},"x-client-id":{"type":"apiKey","description":"Your client Id","name":"x-client-id","in":"header"}},"info":{"title":"Content APIs","description":"Quran.Foundation Content APIs offer programmatic access to the Quran's core content like chapters, verses, recitations, translations, and more, 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\n We 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. Since the APIs are not user-related, you will need to use the `client_credentials` grant type and [`content` scope](/docs/user_related_apis_versioned/scopes#content) when sending a request to [The OAuth 2.0 Token Endpoint](/docs/oauth2_apis_versioned/oauth-2-token-exchange) to get the access token. The below diagram shows the flow of getting an access token using the `client_credentials` grant type in a very simplified way.\n\n ![Client Credentials Flow](/img/client-credentials-flow.png) After getting a valid access token, each request to get resources will have to include 2 headers mentioned below: `x-auth-token` and `x-client-id`.","version":"v4"},"postman":{"name":"Get All Juzs","description":{"content":"Get list of all #model:XwogxNra8JdvchxBE","type":"text/plain"},"url":{"path":["juzs"],"host":["{{baseUrl}}"],"query":[],"variable":[]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}}
8+
api: {"tags":["Juz"],"description":"Get list of all Juz","operationId":"juzs","responses":{"default":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"method":"get","path":"/juzs","servers":[{"url":"https://apis-prelive.quran.foundation/content/api/v4","description":"Pre-production Server"},{"url":"https://apis.quran.foundation/content/api/v4","description":"Production Server"}],"security":[{"x-auth-token":[],"x-client-id":[]}],"securitySchemes":{"x-auth-token":{"type":"apiKey","description":"The JWT access token required for accessing the endpoints.","name":"x-auth-token","in":"header"},"x-client-id":{"type":"apiKey","description":"Your client Id","name":"x-client-id","in":"header"}},"info":{"title":"Content APIs","description":"Quran.Foundation Content APIs offer programmatic access to the Quran's core content like chapters, verses, recitations, translations, and more, 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\n We 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. Since the APIs are not user-related, you will need to use the `client_credentials` grant type and [`content` scope](/docs/user_related_apis_versioned/scopes#content) when sending a request to [The OAuth 2.0 Token Endpoint](/docs/oauth2_apis_versioned/oauth-2-token-exchange) to get the access token. The below diagram shows the flow of getting an access token using the `client_credentials` grant type in a very simplified way.\n\n ![Client Credentials Flow](/img/client-credentials-flow.png) After getting a valid access token, each request to get resources will have to include 2 headers mentioned below: `x-auth-token` and `x-client-id`.","version":"v4"},"postman":{"name":"Get All Juzs","description":{"content":"Get list of all Juz","type":"text/plain"},"url":{"path":["juzs"],"host":["{{baseUrl}}"],"query":[],"variable":[]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}}
99
sidebar_class_name: "get api-method"
1010
info_path: docs/content_apis_versioned/4.0.0/content-apis
1111
custom_edit_url: null
@@ -24,7 +24,7 @@ import TabItem from "@theme/TabItem";
2424

2525

2626

27-
Get list of all #model:XwogxNra8JdvchxBE
27+
Get list of all Juz
2828

2929
<div><ApiTabs><TabItem label={"default"} value={"default"}><div></div><div><MimeTabs schemaType={"response"}><TabItem label={"application/json"} value={"application/json"}><SchemaTabs><TabItem label={"Schema"} value={"Schema"}><details style={{}} data-collapsed={false} open={true}><summary style={{"textAlign":"left"}}><strong>Schema</strong></summary><div style={{"textAlign":"left","marginLeft":"1rem"}}></div><ul style={{"marginLeft":"1rem"}}><div style={{"marginTop":".5rem","marginBottom":".5rem","marginLeft":"1rem"}}>
3030

‎docs/content_apis_versioned/4.0.0/list-ayah-recitation.api.mdx‎

Lines changed: 4 additions & 4 deletions
Large diffs are not rendered by default.

‎docs/content_apis_versioned/4.0.0/list-ayah-tafsirs.api.mdx‎

Lines changed: 6 additions & 2 deletions
Large diffs are not rendered by default.

‎docs/content_apis_versioned/4.0.0/list-chapters.api.mdx‎

Lines changed: 3 additions & 3 deletions
Large diffs are not rendered by default.

‎docs/content_apis_versioned/4.0.0/list-hizb-recitation.api.mdx‎

Lines changed: 4 additions & 4 deletions
Large diffs are not rendered by default.

‎docs/content_apis_versioned/4.0.0/list-juz-recitation.api.mdx‎

Lines changed: 4 additions & 4 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)