-
Notifications
You must be signed in to change notification settings - Fork 1
[DEV-2699] Add rapidoc as api viewer #1668
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: 121af18 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
apps/nextjs-website/src/components/atoms/ApiViewer/ApiViewer.tsx
Outdated
Show resolved
Hide resolved
apps/nextjs-website/src/components/atoms/ApiViewer/ApiViewer.tsx
Outdated
Show resolved
Hide resolved
apps/nextjs-website/src/components/atoms/ApiViewer/ApiViewer.tsx
Outdated
Show resolved
Hide resolved
apps/nextjs-website/src/components/atoms/ApiViewer/ApiViewer.tsx
Outdated
Show resolved
Hide resolved
apps/nextjs-website/src/components/atoms/ApiViewer/ApiViewer.tsx
Outdated
Show resolved
Hide resolved
overflow: 'hidden', | ||
}} | ||
> | ||
<rapi-doc |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i tried to add custom css like here: https://rapidocweb.com/api.html but it doesn't seem to work. The border is an inline style option, so there is some part in the rapidoc parser that sets it.
apps/nextjs-website/src/components/atoms/ApiViewer/ApiViewer.tsx
Outdated
Show resolved
Hide resolved
apps/nextjs-website/src/components/atoms/ApiViewer/ApiViewer.tsx
Outdated
Show resolved
Hide resolved
Co-authored-by: marcobottaro <[email protected]>
Branch is not up to date with base branch@MarBert it seems this Pull Request is not updated with base branch. |
There was a problem hiding this 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 replaces the Stoplight Elements API viewer with RapiDoc for displaying API documentation. The change updates the API viewer component to use RapiDoc's custom web component instead of the previous Stoplight implementation.
- Replace Stoplight Elements with RapiDoc library
- Update component props by removing product dependency
- Configure RapiDoc with theme-aware styling
Reviewed Changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 3 comments.
File | Description |
---|---|
package.json | Adds RapiDoc dependency |
ApiRestSection.tsx | Removes product prop from ApiViewer component |
ApiViewer.tsx | Complete rewrite to use RapiDoc instead of Stoplight Elements |
thick-spoons-double.md | Changeset documenting the API viewer replacement |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
type ApiViewerProps = { | ||
specURL: string; | ||
product: Product; | ||
hideTryIt?: boolean; |
Copilot
AI
Sep 23, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The hideTryIt prop is still defined in ApiViewerProps but is no longer used in the component. This creates an inconsistent API where the prop is accepted but ignored.
hideTryIt?: boolean; |
Copilot uses AI. Check for mistakes.
const ApiViewer: FC<ApiViewerProps> = ({ specURL }) => { | ||
const { palette } = useTheme(); | ||
|
||
// function that return current API component type |
Copilot
AI
Sep 23, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment is unclear and doesn't accurately describe what the function does. It should be updated to describe that the function renders a RapiDoc API viewer component.
// function that return current API component type | |
// Renders a RapiDoc API viewer component for the provided OpenAPI spec URL |
Copilot uses AI. Check for mistakes.
show-method-in-nav-bar='as-plain-text' | ||
spec-url={specURL} | ||
text-color={palette.text.primary} | ||
theme='light' |
Copilot
AI
Sep 23, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The theme is hardcoded to 'light' but the component uses theme-aware colors from Material-UI. Consider making this dynamic based on the current theme mode (light/dark).
theme='light' | |
theme={palette.mode} |
Copilot uses AI. Check for mistakes.
apps/nextjs-website/src/components/atoms/ApiViewer/ApiViewer.tsx
Outdated
Show resolved
Hide resolved
This pull request is stale because it has been open for 14 days with no activity. If the pull request is still valid, please update it within 21 days to keep it open or merge it, otherwise it will be closed automatically. |
# Conflicts: # apps/nextjs-website/src/components/molecules/ApiRestSection/ApiRestSection.tsx
Jira Pull Request LinkThis Pull Request refers to the following Jira issue DEV-2699 |
List of Changes
Add rapidoc as the api viewer
Motivation and Context
How Has This Been Tested?
on localhost
Screenshots (if appropriate):
Types of changes
Checklist: