Repository navigation
feat: allow configuring ReDoc HTML attributes - #388
Conversation
|
Implemented the ReDoc customization requested in #376. Both adapters now accept: redoc_options: {
"show-extensions": "x-filter-fields",
}The same options can be passed directly to Attribute values and the schema URL are HTML-escaped. Invalid names, event handlers such as Added public type checks, documentation, a minor changeset, and 23 integration scenarios covering serialization, validation, both adapters, custom paths/base paths, and disabled routes. Validation completed: all 458 tests passed, along with lint and the CJS/ESM build. |
commit: |
|
Thanks @rafamolina1 |
|
Cheers mate 🇧🇷 |
Summary
Allow configuring the ReDoc HTML element through
redoc_optionson Hono and itty-router adapters and an optional second argument togetReDocUI(). For example,{ "show-extensions": "x-filter-fields" }now renders the extension filter requested in the issue.Export
ReDocOptions, preserve the default configuration, escape attribute values and the schema URL, and reject invalid names, event handlers, and attempts to overridespec-url. Include documentation and a minor changeset.Closes #376
Type of change
How was this tested?
npm test: 458 tests passed, including 23 new ReDoc scenarios.npm test -- redoc-options.test.ts: all 23 tests passed.npm run lint: passed.npm run build: passed; verified the new API in both generated declaration formats.Checklist
npm testandnpm run lintpassnpx changeset, empty changeset for internal changes)