[Interest] [QtOpenAPI] Unable to compile Jellyfin OpenAPI schema

Ivan Solovev ivan.solovev at qt.io
Mon Jul 27 09:39:04 CEST 2026


Hi Alex,

the generated code internally uses `QObject *context` as a hardcoded parameter name
of one of the helper functions. That means that at this point it cannot be used as a
variable name.
The most straightforward fix for you is to rename the parameter in
the OpenAPI schema, e.g.:

"parameters": [
{
    "name": "encodingContext", // <--- here
    "in": "query",
    "description": "Optional. The MediaBrowser.Model.Dlna.EncodingContext.",
    "schema": {
        "$ref": "#/components/schemas/EncodingContext"
    }
}

Hope this helps!

Best regards,
Ivan

________________________________________
From: Interest <interest-bounces at qt-project.org> on behalf of Alex Shaw <alex.shaw.as at gmail.com>
Sent: Saturday, July 25, 2026 9:12 PM
To: interest at qt-project.org
Subject: [Interest] [QtOpenAPI] Unable to compile Jellyfin OpenAPI schema

I'm not sure if this is a bug (or if it is, which software it's a bug in), but I've reached the end of my rope trying to fix this, and it's a hard blocker for me.

I'm attempting to use the new Qt OpenAPI module to generate the HTTP client code for Jellyfin using the official OpenAPI schema available here: https://api.jellyfin.org/openapi/jellyfin-openapi-stable.json<https://api.jellyfin.org/openapi/jellyfin-openapi-stable.json>
Although qt_add_openapi_client works correctly, the code generated results in multiple compile-time C++ errors. I narrowed down the problem to being an issue with circular "allOf" references (for example, the "AlbumArtist" property of the "RemoteSearchResult" component is an allOf ref to RemoteSearchResult). I was able to solve those problems with a script that removes any problematic members in the schema. The remaining errors have proven much more difficult to patch.

Here's a portion of the Jellyfin OpenAPI schema:
{
  "paths": {
    "/Audio/{itemId}": {
      "get": {
        "parameters": [
          {
            "name": "context",
            "in": "query",
            "description": "Optional. The MediaBrowser.Model.Dlna.EncodingContext.",
            "schema": {
              "$ref": "#/components/schemas/EncodingContext"
            }
          }
        ]
      }
    }
  }
}

Here's the resulting error:

build/QtOpenAPIClient_autogen/VU62IVP4U3/../../client/audioapi.h:46:5: error: conflicting declaration ‘const QObject* context’

build/QtOpenAPIClient_autogen/VU62IVP4U3/../../client/audioapi.h:46:5189: note: previous declaration as ‘const QtOpenApiCommon::OptionalParameter<QtOpenAPI::EncodingContext>& context’

There are about 10 more errors in the audio and video APIs. They all involve the same compiler error: a constructor parameter named "context"
I'm not sure if this is a bug with Qt, OpenAPI Generator, the Jellyfin schema, or something else, but I won't be able to just fix this with a preprocessor script since I need the audio and video endpoints.

For what it's worth, I tried running openapi-generator-cli directly, but that just resulted in even more errors.

Any suggestions?


More information about the Interest mailing list