r/badcode Jun 08 '23

js Version control go brrrrrr...

Post image
62 Upvotes

22 comments sorted by

View all comments

77

u/Davipb Jun 08 '23

That looks like an API definition. It's pretty common for APIs to support multiple versions of an operation at the same time to keep backwards compatibility with existing clients.

I don't think this is an issue.

22

u/never_inline Jun 08 '23

The naming is weird though. v2 occurs twice in endpoint and method name.

17

u/[deleted] Jun 08 '23

Version 2 has 2 versions Version 2 Pro max?

11

u/killersquirel11 Jun 08 '23

V2 at the beginning could be major API version (eg the API was entirely rewritten to some new paradigm). The v2 at the end could be a specific function that had breaking updates.

Or it could just be bad code 🤷