Openapi.json/openapi.yml from a canonical source

Heyo! I wanna grab an openapi.yml or json or whatever from cockpit, and I found… a way to do that, it’s generated to cockpit-url/system/api/openapi. But it’s not reeeaaally that complete. I’d love for it to generate in models and stuff. I suspect that doesn’t exist?

Also after pulling it I tried to use pagination. Aaaand turns out the API changes when using pagination. Example:

without pagination:

[
  {
    "images": {
      "_id": "f43eb247393239b9790000bb"
    },
    "_state": 1,
    "_modified": 1721832667,
    "_mby": "2c2be4a96430305ddf0002bb",
    "_created": 1721832667,
    "_cby": "2c2be4a96430305ddf0002bb",
    "_id": "f43eba386661642418000260"
  },
  {
    "images": {
      "_id": "f4590e3f35623538b8000362"
    },
    "_state": 1,
    "_modified": 1721832840,
    "_mby": "2c2be4a96430305ddf0002bb",
    "_created": 1721832840,
    "_cby": "2c2be4a96430305ddf0002bb",
    "_id": "f4591464663333cd71000046"
  },
  ...
]

And with pagination:

{
  "data": [
    {
      "images": {
        "_id": "f4590e3f35623538b8000362"
      },
      "_state": 1,
      "_modified": 1721832840,
      "_mby": "2c2be4a96430305ddf0002bb",
      "_created": 1721832840,
      "_cby": "2c2be4a96430305ddf0002bb",
      "_id": "f4591464663333cd71000046"
    },
    {
      "images": {
        "_id": "f45912903666636ee300011d"
      },
      "_state": 1,
      "_modified": 1721832840,
      "_mby": "2c2be4a96430305ddf0002bb",
      "_created": 1721832840,
      "_cby": "2c2be4a96430305ddf0002bb",
      "_id": "f4591ac86561662de1000055"
    },
    ...
  ],
  "meta": {
    "total": 42
  }
}

So that’s a thing, I suspect whatever generates the api yml really doesn’t understand that the edge case exists? I dislike that the api has two different behaviours depending on whether skip is set as well. That seems badly designed. Anyways, not here to rant, anyone encountered this before and has an overview of what could be done to mitigate the issue and whether there’s a better openapi.yml somewhere? Or does everyone just implement the api without code gen, which is fine but kinda boring xD