Skip to content

Improve types, doc, allow spec on ApiSchema + various changes#422

Closed
serut wants to merge 8 commits into
mainfrom
feature/few-changes
Closed

Improve types, doc, allow spec on ApiSchema + various changes#422
serut wants to merge 8 commits into
mainfrom
feature/few-changes

Conversation

@serut

@serut serut commented May 25, 2025

Copy link
Copy Markdown
Collaborator

@changeset-bot

changeset-bot Bot commented May 25, 2025

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: b12e0d6

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel

vercel Bot commented May 25, 2025

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
redocusaurus ❌ Failed (Inspect) May 29, 2025 9:57pm

Comment thread packages/docusaurus-theme-redoc/src/theme/ApiSchema/ApiSchema.tsx Outdated
const { options } = useSpecOptions(themeId, optionsOverrides);
const isDevMode = process.env.NODE_ENV === 'development';

if ((isDevMode && isSpecFile === false) || !spec) {

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

undo the change? dev mode should be client side

Comment thread website/docs/guides/schema-imports.mdx Outdated
Comment on lines +27 to +33
| Name | Type | Description |
| ------- | ------------ | ---------------------------------------------------------------------------------------------------- |
| pointer | String | the redoc reference to display in [Redoc](https://redoc.ly/docs/resources/ref-guide/#pointer) format |
| example | boolean | (default: false) allow to display example |
| id | String | When spec not provided, load the spec from docusaurus config. Use first spec if not defined |
| spec | OpenAPI spec | A JSON content spec to use |
| themeId | String | redocusaurus theme to use - default to `theme-redoc` |

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

removing this as it will go out of sync from code and no one will maintain this. types are enough to figure out props

`${options.id || 'api-spec'}.yaml`,
);
let filesToWatch: string[] = isSpecFile ? [path.resolve(spec)] : [];
let filesToWatch: string[] = !isExternalUrl ? [path.resolve(spec)] : [];

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

undoing the change in plugin, I think passing the spec directly can work without involving the plugin.

basically by passing no specs array to preset so only configure the theme and directly use it. no need to create plugin

rohit-gohri added a commit that referenced this pull request May 30, 2025
Version of #422 with bare minimum changes while still supporting the feature

feat: minimally add spec option to all components and update docs

---------

Co-authored-by: Léo MIEULET <leo.mieulet.pro@gmail.com>
@rohit-gohri

Copy link
Copy Markdown
Owner

Closed in favor of #424

@rohit-gohri

Copy link
Copy Markdown
Owner

@serut let me know if I missed anything in terms of supported features

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants