Skip to content

Conversation

@letiescanciano
Copy link

Description

When plugins are defined as functions in Docusaurus config, getPluginConfig crashes trying to access data[1].id on non-array entries. By passing pluginInstances (pre-filtered for docusaurus-plugin-openapi-docs) instead of the raw plugins array, we ensure only valid array-formatted plugins are processed.

Motivation and Context

Fixes #1246

How Has This Been Tested?

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

Checklist

  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes if appropriate.
  • All new and existing tests passed.

…or when getting plugin config

 When plugins are defined as functions in Docusaurus config, getPluginConfig
  crashes trying to access data[1].id on non-array entries. By passing
  pluginInstances (pre-filtered for docusaurus-plugin-openapi-docs) instead
  of the raw plugins array, we ensure only valid array-formatted plugins
  are processed.

  Fixes PaloAltoNetworks#1246
Export getPluginConfig and getPluginInstances to enable unit testing.
Add comprehensive test coverage including edge cases and integration tests
to verify the bug fix where plugin instances must be filtered before
getting plugin config.
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.

gen-api-docs command doesn't support non-array plugins

1 participant