Skip to content

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

Open
@Ichmed

Description

@Ichmed

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions