Handle APIVersions requests #PV1: Some parsing improvements questions

I’m not necessarily stuck, actually passed the stage by some hard-coding
As of right now I’m doing some restructuring and refactoring regarding the project
As well as generalising request parsing and respond building

I have some questions left unanswered since we are using V4, which is documented very poorly and I passed the tests only be cause of reading a post on this forum regarding this stage

  1. So, there are basically Request Header V0 and Request Header V1+. According to reply of a staff member on this forum, ApiVersionsRequest always contains RequestHeaderV0, and every other request consists of V1+. Is there a convenient way to support v0 and v1 headers regardless ? As for me rn only seen solution are: check for api key, if it’s apiverreq, try to parse as v0 header, otherwise try to parse as v1+ header, otherwise error response. Don’t really want to consider “trying to parse as v0 header and if fails, try to parse as v1” as it’s inefficient.
  2. Is there any documentation on ApiVersionsRequest V4 fields ? As from parsing I completely ignored like 5-6 bytes (or even more) of contents for a test in #PV1, but after restructuring my project I would like to be able to parse it successfully

Hi @FRIZFOREVER, I’m not a staff member, but I think ApiVersionsRequest has request header v2. It’s ApiVersionsResponse that has response header v0 while every other response has response header v1, as stated in the instructions of #NV3.

3 Likes

Closing this thread due to inactivity. If you still need assistance, feel free to reopen or start a new discussion!

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.