{"record":{"id":"3d5f67a18653b8a6","repo":"OpenAPITools/openapi-generator","slug":"error-codegen-property-not-yet-supported-in-getpy","errorCode":null,"errorMessage":"Error! Codegen Property not yet supported in getPydanticType: %s","messagePattern":"Error! Codegen Property not yet supported in getPydanticType: (.+?)","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPythonCodegen.java","lineNumber":2275,"sourceCode":"                            if (circularImports.get(cp.getDataType()).contains(classname)) {\n                                hasModelsToImport = true;\n                                postponedModelImports.add(cp.getDataType());\n                                postponedExampleImports.add(cp.getDataType());\n                                // cp.getDataType() import map of set contains this model (classname), don't import\n                                LOGGER.debug(\"Skipped importing {} in {} due to circular import.\", cp.getDataType(), classname);\n                            } else {\n                                // not circular import, so ok to import it\n                                hasModelsToImport = true;\n                                modelImports.add(cp.getDataType());\n                                exampleImports.add(cp.getDataType());\n                            }\n                        } else {\n                            LOGGER.error(\"Failed to look up {} from the imports (map of set) of models.\", cp.getDataType());\n                        }\n                    }\n                    result = new PythonType(cp.getDataType());\n                } else {\n                    throw new RuntimeException(\"Error! Codegen Property not yet supported in getPydanticType: \" + cp);\n                }\n            }\n\n            return result;\n        }\n\n        private String finalizeType(CodegenProperty cp, PythonType pt) {\n            if (!StringUtils.isEmpty(cp.description)) { // has description\n                pt.annotate(\"description\", cp.description);\n            }\n\n            // field\n            String publicName = (String) cp.vendorExtensions.get(X_PY_PUBLIC_NAME);\n            if (publicName != null) {\n                String aliasName = cp.vendorExtensions.containsKey(X_PY_EXPLICIT_PUBLIC_NAME)\n                        || cp.vendorExtensions.containsKey(X_PY_LEGACY_PUBLIC_NAME)\n                        ? publicName\n                        : cp.baseName;","sourceCodeStart":2257,"sourceCodeEnd":2293,"githubUrl":"https://github.com/OpenAPITools/openapi-generator/blob/fcec517be3cf5b7964296bcba25fbc97541484e7/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPythonCodegen.java#L2257-L2293","documentation":"In AbstractPythonCodegen's pydantic type-mapping pass, getPydanticType(CodegenProperty, ...) must reduce every property to a Python type through its handled branches (primitives, containers, enums, and model refs/imports). A property that matches no branch falls through to this RuntimeException, meaning the generator has no pydantic type mapping for that property shape — an implementation gap in the generator, not a configuration mistake.","triggerScenarios":"Generating Python (pydantic v2 output) when a model property has a shape the mapper does not cover — e.g. a map whose additionalProperties is a composed oneOf/anyOf, arrays of free-form objects, or other deeply nested compositions, depending on release. The message prints the full CodegenProperty toString, which identifies the offending property.","commonSituations":"Large real-world specs (payments/cloud APIs) with unusual property constructs; upgrading a spec to OpenAPI 3.1 composition styles while the generator is pinned to an older release.","solutions":["Read the CodegenProperty dump in the message to find the failing property, then simplify it — hoist nested oneOf/anyOf into named component schemas the mapper can import as models","Upgrade openapi-generator to the latest release; pydantic type coverage improves constantly","If it still fails on the current release, open a GitHub issue with the model snippet — the message itself says the case is not yet supported"],"exampleFix":"# before\nsettings:\n  type: object\n  additionalProperties:\n    oneOf:\n      - type: string\n      - type: number\n\n# after (hoisted into an importable schema)\nsettings:\n  type: object\n  additionalProperties:\n    $ref: '#/components/schemas/SettingValue'","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n    new DefaultGenerator().opts(clientOptInput).generate();\n} catch (RuntimeException e) {\n    if (e.getMessage() != null && e.getMessage().contains(\"not yet supported in getPydanticType\")) {\n        // message dumps the full CodegenProperty: use it to locate and simplify that model\n        throw new BuildFailure(\"Unsupported pydantic property shape: \" + e.getMessage(), e);\n    }\n    throw e;\n}","preventionTips":["Pin the generator version and smoke-generate every spec change in CI","Prefer flat named component schemas over deeply nested inline oneOf/anyOf","When upgrading openapi-generator, regenerate early to surface newly unsupported shapes before release"],"tags":["pydantic","python","schema","openapi-generator"],"backgroundTag":"unsupported-schema-type","analyzedSha":"fcec517be3cf5b7964296bcba25fbc97541484e7","analyzedAt":"2026-08-22T11:13:11.613Z","schemaVersion":2},"datasetVersion":"2026-08-22T14:17:55.899Z"}