You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
chalk.green(`Successfully created "${outputDir}/sidebar.ts"`)
);
}catch(err){
console.error(
chalk.red(`Failed to write "${outputDir}/sidebar.ts"`),
chalk.yellow(err)
);
}
}
}
I think it would be nice to add an --overwrite arg in CLI that would allow you to overwrite this!
Describe the solution you'd like
Something similar to docusaurus gen-api-docs <plugin_id> --overwrite
Describe alternatives you've considered
Not blocked, able to just clean/delete the repo but it would be a nice step to include. It wasn't super obvious to me when I first did this and spend some time trying to debug why my updates weren't appearing in my docs.
Perhaps also maybe in output text say "warning: OpenAPI spec differs from data currently saved in <destination_path>.sidebar.ts file. If you would like to update this file, please re-run with the --overwrite flag: docusaurus gen-api-docs <plugin_id> --overwrite"
Additional context
The text was updated successfully, but these errors were encountered:
Hi @rossdanlm, I think this is something we can implement/support. Any chance you'd be willing/interested in working on it?
Also, FWIW, we chose not to check-in our generated MDX/sidebar files for our project, i.e. we use .gitignore to exclude them. This helps ensure we always generated the latest OpenAPI docs, accounting for added/removed/changed operations. Although overwriting seems like a good approach, it probably won't handle cases where operations are removed, since those would require manual cleanup.
Is your feature request related to a problem?
Similar to #615 (comment), I noticed that changes to the OpenAPI specs aren't reflected in sidebar.ts file:
docusaurus-openapi-docs/packages/docusaurus-plugin-openapi-docs/src/index.ts
Lines 181 to 194 in 0063174
I think it would be nice to add an
--overwrite
arg in CLI that would allow you to overwrite this!Describe the solution you'd like
Something similar to
docusaurus gen-api-docs <plugin_id> --overwrite
Describe alternatives you've considered
Not blocked, able to just clean/delete the repo but it would be a nice step to include. It wasn't super obvious to me when I first did this and spend some time trying to debug why my updates weren't appearing in my docs.
Perhaps also maybe in output text say "warning: OpenAPI spec differs from data currently saved in
<destination_path>.sidebar.ts
file. If you would like to update this file, please re-run with the--overwrite
flag:docusaurus gen-api-docs <plugin_id> --overwrite
"Additional context
The text was updated successfully, but these errors were encountered: