express-openapi icon indicating copy to clipboard operation
express-openapi copied to clipboard

Using Express@5 causes error with fast_slash

Open JonathanVelkeneers opened this issue 10 months ago • 2 comments

Using this library in it's most basic form with express@5 causes the follwing error to be thrown:

TypeError: Cannot read properties of undefined (reading 'fast_slash')
at split (@wesleytodd/openapi/lib/generate-doc.js:127:20)

package version: 1.1.0 express version: 5.0.1

JonathanVelkeneers avatar Mar 14 '25 20:03 JonathanVelkeneers

Just saw it mentioned here as well:

https://github.com/wesleytodd/express-openapi/pull/64#issuecomment-2596813526

And @... unfortunately changes to path-to-regexp broke this lib in both express@>=4.20.0 and express@5. I am going to be working on fixes for that soon.

JonathanVelkeneers avatar Mar 14 '25 20:03 JonathanVelkeneers

There is some work happening to expose a new router.getRoutes() API in pillarjs/router It would simplify or allow us to get rid of iterateStack in generate-doc.js. That would be in addition to getting rid of the functions split and processComplexMatch as Express 5 does not support regex routes.

enov avatar Aug 27 '25 18:08 enov