fastify / fastify-swagger-ui

Serve Swagger-UI for Fastify
MIT License
137 stars 40 forks source link

This library should not depend DOM types #142

Open khokm opened 5 months ago

khokm commented 5 months ago

Prerequisites

Fastify version

4

Plugin version

No response

Node.js version

20

Operating system

Windows

Operating system version (i.e. 20.04, 11.3, 10)

10

Description

This library depends on DOM types, which was introduced by #59. The dom types was included to support this property: https://github.com/fastify/fastify-swagger-ui/blob/f9cb0a0f92f0bc85da50d3ea3fa6b4799d76685c/types/index.d.ts#L155

I don't see a reason why should domNode accept an HTMLElement interface in first place, because there there is nothing in Nodejs that implements this interface.

Can we remove domNode property, or replace it with unknown/any type at least? any type would be the best, because it makes it compatible with current code, so there is no need to bump major version.

Link to code that reproduces the bug

No response

Expected Behavior

No response

mcollina commented 5 months ago

Thanks for reporting! Would you like to send a Pull Request to address this issue? Remember to add unit tests.