Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to correctly do versioning with express adapter? #2970

Open
1 of 5 tasks
soryy708 opened this issue Feb 12, 2024 · 2 comments
Open
1 of 5 tasks

how to correctly do versioning with express adapter? #2970

soryy708 opened this issue Feb 12, 2024 · 2 comments

Comments

@soryy708
Copy link
Contributor

I'm submitting a...

  • Regression
  • Bug report
  • Feature request
  • Documentation issue or request (new chapter/page)
  • Support request => Please do not submit support request here, instead post your question on Stack Overflow.

Current behavior

In the techniques - versioning documentation, there's a callout that says:

NOTICE
Selecting the highest matching version based on the array returned from extractor > does not reliably work with the Express adapter due to design limitations. A single version (either a string or array of 1 element) works just fine in Express. Fastify correctly supports both highest matching version selection and single version selection.

This is not actionable, so as a reader of the documentation I don't know what to do about it.

I have looked in the git-blame of the docs, and saw that it's connected to this issue:

Here there's more details, which aren't explained in the documentation:

Known bug here - if there are multiple versions supported across separate
handlers/controllers, we can’t select the highest matching handler.
Since this code is evaluated per-handler, then we can’t see if the highest
specified version exists in a different handler.
if a caller specified several different versions that it accepts, then the Express adapter cannot reliably select the highest matching version because it’s not properly aware all the supported versions at this point in the code.

Expected behavior

The documentation should provide a recommendation for how to work around the issue with versioning when combined with express adapter.

Minimal reproduction of the problem with instructions

What is the motivation / use case for changing the behavior?

Improving the documentation.

Environment

For Tooling issues:

  • Node version: whatever
  • Platform: docs website

Others:

@kamilmysliwiec
Copy link
Member

Would you like to create a PR for this issue?

@soryy708
Copy link
Contributor Author

@kamilmysliwiec: Would you like to create a PR for this issue?

I don't know how to correctly do versioning with express adapter?

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

No branches or pull requests

2 participants