{"record":{"id":"7a1f3e6ccc915ec7","repo":"OpenAPITools/openapi-generator","slug":"error-codegen-property-not-yet-supported-in-getpy-7a1f3e","errorCode":null,"errorMessage":"Error! Codegen Property not yet supported in getPydanticType: {cp}","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/AbstractPythonPydanticV1Codegen.java","lineNumber":1596,"sourceCode":"                    if (circularImports.get(cp.dataType).contains(classname)) {\n                        hasModelsToImport = true;\n                        postponedModelImports.add(cp.dataType);\n                        postponedExampleImports.add(cp.dataType);\n                        // cp.dataType import map of set contains this model (classname), don't import\n                        LOGGER.debug(\"Skipped importing {} in {} due to circular import.\", cp.dataType, classname);\n                    } else {\n                        // not circular import, so ok to import it\n                        hasModelsToImport = true;\n                        modelImports.add(cp.dataType);\n                        exampleImports.add(cp.dataType);\n                    }\n                } else {\n                    LOGGER.error(\"Failed to look up {} from the imports (map of set) of models.\", cp.dataType);\n                }\n            }\n            return cp.dataType;\n        } else {\n            throw new RuntimeException(\"Error! Codegen Property not yet supported in getPydanticType: \" + cp);\n        }\n    }\n\n    public void setMapNumberTo(String mapNumberTo) {\n        if (\"Union[StrictFloat, StrictInt]\".equals(mapNumberTo)\n                || \"StrictFloat\".equals(mapNumberTo)\n                || \"float\".equals(mapNumberTo)) {\n            this.mapNumberTo = mapNumberTo;\n        } else {\n            throw new IllegalArgumentException(\"mapNumberTo value must be Union[StrictFloat, StrictInt], StrictStr or float\");\n        }\n    }\n\n    public String toEnumVariableName(String name, String datatype) {\n        name = name.replace(\".\", \"_DOT_\");\n\n        if (\"int\".equals(datatype)) {\n            return \"NUMBER_\" + name.replace(\"-\", \"MINUS_\");","sourceCodeStart":1578,"sourceCodeEnd":1614,"githubUrl":"https://github.com/OpenAPITools/openapi-generator/blob/fcec517be3cf5b7964296bcba25fbc97541484e7/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPythonPydanticV1Codegen.java#L1578-L1614","documentation":"In AbstractPythonPydanticV1Codegen's getPydanticType for properties, every CodegenProperty must reduce to a Python type through the handled branches (primitives, containers, enums, model refs). A property matching no branch falls through to this RuntimeException — the pydantic-v1 mapper has no type mapping for that property shape yet.","triggerScenarios":"Generating -g python-pydantic-v1 when a model property uses a combination the mapper does not cover — e.g. maps of composed schemas or other nested constructs, depending on release. The message dumps the full CodegenProperty, identifying the offender.","commonSituations":"Complex enterprise specs with unusual nesting; running a newer spec against an older pinned generator; migrating from -g python to -g python-pydantic-v1 and hitting v1-specific gaps.","solutions":["Find the failing property from the CodegenProperty dump and restructure it — hoist composed inner schemas into named components","Upgrade openapi-generator to the latest release with improved pydantic-v1 coverage","Still failing, open a GitHub issue with the model snippet — the exception says the case is not yet supported"],"exampleFix":"# before\nmetadata:\n  type: object\n  additionalProperties:\n    oneOf:\n      - type: string\n      - type: boolean\n\n# after\nmetadata:\n  type: object\n  additionalProperties:\n    $ref: '#/components/schemas/MetadataValue'","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        // CodegenProperty dump in the message names the failing property: hoist/simplify it\n        throw new BuildFailure(\"Unsupported pydantic-v1 property: \" + e.getMessage(), e);\n    }\n    throw e;\n}","preventionTips":["Pin and regularly bump the generator; coverage gaps close over time","Prefer named component schemas over inline nested compositions","Smoke-generate in CI with -g python-pydantic-v1 for every spec change"],"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"}