Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"model_type" error when encountering "items": false #1229

Open
Ichmed opened this issue Mar 19, 2025 · 0 comments
Open

"model_type" error when encountering "items": false #1229

Ichmed opened this issue Mar 19, 2025 · 0 comments

Comments

@Ichmed
Copy link

Ichmed commented Mar 19, 2025

Describe the bug
According to the openapi 3.1 specification, tuples should be modeled using the "prefixItems" field with the "items" field being set to false (spec).

However this causes a "model_type" error as the generator expects the "items" field to be a dictionary.

OpenAPI Spec File

{
    "openapi": "3.1.0",
    "info": {
        "title": "foobar",
        "description": "",
        "license": {
            "name": ""
        },
        "version": "0.1.0"
    },
    "paths": {
        "/my/path": {
            "get": {
                "description": "foo",
                "operationId": "bar",
                "parameters": [],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "type": "array",
                                        "items": false,
                                        "prefixItems": [
                                            {
                                                "type": "string",
                                                "format": "date-time"
                                            },
                                            {}
                                        ]
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}

Removing the "items": false causes the file to parse successfully.

Desktop (please complete the following information):

  • OS: Ubuntu 22.04.5 LTS
  • Python Version: 3.10.12
  • openapi-python-client version 0.24.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant