Conversation
It supports all v1 methods, options, fields. It works via layer over v2 API. But user can use only one API. http_server will throw an error if user tries to use methods from both APIs.
| elseif self.__api_version == API_VERSIONS.V2 then | ||
| error( | ||
| ('":%s" method does not supported. Use http-v2 api https://github.com/tarantool/http/tree/master.'): | ||
| format(method_name) | ||
| ) |
There was a problem hiding this comment.
Is the check http server instance wide? So, different http server instances may be used according to different API versions, right? Is it fit good to the case, when cartridge uses one API version, but a user's application uses another one?
What is the reason of blocking such usage? It would not work appropriately?
There was a problem hiding this comment.
It is a check only for one http_server instance, not for all.
Yes, different instances could be used according to different API versions.
Yes, I think it fits good to the case with user and cartridge application servers. We may ask @rosik about it.
Both APIs have documentation and covered by tests. But their simultaneous usage not documented and not tests. So I think there are cases when simultaneous usage can lead to bugs or strange not documented behaviour. Error on such cases prevents it. Also I don't think that simultaneous usage is a good practice. As for me it would not give any advantages and confuses a code with a lot of different method calls, which do the same thing.
There was a problem hiding this comment.
Thanks for the clarification! It seems meaningful.
There was a problem hiding this comment.
@rosik said that users usually add application specific routes into the cartridge's http server.
|
@Satbek should it be closed since http v2 is deprecated? |
|
no need on it after #134 |
It supports all v1 methods, options, fields. It works via layer over v2 API.
But user can use only one API. http_server will throw an error if user tries to use methods from both APIs.
closes #131