Conversation
✅ Deploy Preview for moodledevdocs ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The reference has an incorrect API server URL, incomplete fallback validation, and broken or unusable documentation links and instructions.
Review effort: Balanced
Findings: 1
Open (3)
What changed in this PR
Replaces the hand-written Marketplace API guide with a Redocusaurus-rendered OpenAPI reference and build-time refresh mechanism.
Changes:
- Adds Redocusaurus integration and dependencies.
- Fetches, rewrites, and caches the Marketplace OpenAPI specification.
- Converts the guide to MDX and adds link-rewriting tests.
| File | Description |
|---|---|
docusaurus.config.js |
Configures Redocusaurus and refreshes the specification. |
package.json |
Adds Redocusaurus dependencies. |
yarn.lock |
Locks new dependencies. |
src/utils/marketplaceApiSpec.js |
Implements fetching, rewriting, and fallback behavior. |
src/utils/marketplaceApiSpec.test.js |
Tests link rewriting. |
static/marketplace-api/openapi.json |
Provides the fallback OpenAPI specification. |
general/community/plugincontribution/moodlemarketplaceapi.md |
Removes the hand-written guide. |
general/community/plugincontribution/moodlemarketplaceapi.mdx |
Embeds the generated reference. |
general/community/plugincontribution/pluginsdirectory/api.md |
Updates the Marketplace API link. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
vmdef
marked this pull request as draft
October 1, 2026 12:20
Replace the hand-written Moodle Marketplace API guide with a reference generated from the Marketplace OpenAPI spec using Redocusaurus. The spec is fetched from the Marketplace on every start and build, so the reference stays up to date. A copy is committed in static/ and used if the Marketplace is unreachable. Site-relative links in the spec are rewritten to point to the Marketplace. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
vmdef
force-pushed
the
marketplace-api-reference
branch
from
October 1, 2026 13:57
2ef68da to
d2333c2
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Summary
Replaces the hand-written Moodle Marketplace API guide with a reference generated from the Marketplace OpenAPI spec (
https://marketplace.next.moodle.org/api/docs.jsonopenapi), rendered with Redocusaurus.general/community/plugincontribution/moodlemarketplaceapi.mdbecomes.mdxand embeds the reference with<ApiDocMdx id="marketplace-api" />. The URL, sidebar position and tags are unchanged. The link to it frompluginsdirectory/api.mdis now relative (../moodlemarketplaceapi.mdx).docusaurus.config.jsnow exports an async function that fetches the spec before everystart/build.static/marketplace-api/openapi.json. If the Marketplace is unreachable, times out (15 seconds) or returns something that isn't an OpenAPI spec, the build logs a warning and uses that copy. The build only fails if no copy exists. The file is only rewritten when the spec changes. It is also served at/marketplace-api/openapi.jsonfor Redoc's Download button./account/security) are rewritten to point to the Marketplace, since they can't be changed there.z-index: 2so Redoc's content (z-index: 1) no longer shows through it.redocusaurus, plus its peer dependencies@docusaurus/theme-commonand@docusaurus/utilsat our Docusaurus version.All page content now comes from the spec. Any wording changes should be made in the Marketplace.
Testing
yarn jest src/utils: 11 tests forupdateMarketplaceApiSpec, withfetchandfs/promisesmocked:pathseach fall back to the committed copy with a single warning.yarn start: the page renders in the docs layout with the Redoc menu on the right, the security settings link points to the Marketplace, the Download button serves the committed spec, and the sticky footer bar covers the content correctly.🤖 Generated with Claude Code