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
Hi @nfroidure . Typically even though require allows you do do that, the danger of reaching into a module if it's not documented you can do so is that an internal file rearrangement can break you without warning (if you don't pin to a specific version).
The API of this module was created before I took over it and it does have a lot wanting in it. I think we could change the API if someone wanted to put together a proposal of what exactly they wanted the API to look like and the use-cases this would enable over the existing API 👍
In this router, I choose to not use the built in req/res objects unlike in every major frameworks for several reasons (snapshot testing, functional programming, function composition over middlewares...). For that matter, the requests and responses are raw JSON serializable objects so I cannot use APIs that expect a regular NodeJS response object (here is a more complete explanation of the why https://github.com/nfroidure/swagger-http-router#goal ).
I guess that the extractResponseSpec could be used with little changes to provide a functional API in this module.
I'd really like to be able to use this module by just using its pure functions.
It is feasible by requiring those functions directly:
Do you think it is safe or should we add a standard way to use those functions?
The text was updated successfully, but these errors were encountered: