{"record":{"id":"1672d05c1398c6cf","repo":"OpenAPITools/openapi-generator","slug":"error-codegen-parameter-not-yet-supported-in-getp-1672d0","errorCode":null,"errorMessage":"Error! Codegen Parameter not yet supported in getPydanticType: {cp}","messagePattern":"Error! Codegen Parameter 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":1301,"sourceCode":"            typingImports.add(\"Any\");\n            return \"Dict[str, Any]\";\n        } else if (!cp.isPrimitiveType) {\n            // add model prefix\n            hasModelsToImport = true;\n            modelImports.add(cp.dataType);\n            exampleImports.add(cp.dataType);\n            return cp.dataType;\n        } else if (cp.getContent() != null) {\n            LinkedHashMap<String, CodegenMediaType> contents = cp.getContent();\n            for (String key : contents.keySet()) {\n                CodegenMediaType cmt = contents.get(key);\n                // TODO process the first one only at the moment\n                if (cmt != null)\n                    return getPydanticType(cmt.getSchema(), typingImports, pydanticImports, datetimeImports, modelImports, exampleImports, postponedModelImports, postponedExampleImports, classname);\n            }\n            throw new RuntimeException(\"Error! Failed to process getPydanticType when getting the content: \" + cp);\n        } else {\n            throw new RuntimeException(\"Error! Codegen Parameter not yet supported in getPydanticType: \" + cp);\n        }\n    }\n\n\n    /*\n     * Gets the pydantic type given a Codegen Property\n     *\n     * @param cp codegen property\n     * @param typingImports typing imports\n     * @param pydantic pydantic imports\n     * @param datetimeImports datetime imports\n     * @param modelImports model imports\n     * @param exampleImports example imports\n     * @param postponedModelImports postponed model imports\n     * @param postponedExampleImports postponed example imports\n     * @param classname class name\n     * @return pydantic type\n     *","sourceCodeStart":1283,"sourceCodeEnd":1319,"githubUrl":"https://github.com/OpenAPITools/openapi-generator/blob/fcec517be3cf5b7964296bcba25fbc97541484e7/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPythonPydanticV1Codegen.java#L1283-L1319","documentation":"In AbstractPythonPydanticV1Codegen's getPydanticType for parameters, a parameter must end up with either a dataType (typed parameter) or content (request-body style). A parameter with neither falls through to this RuntimeException — the generator cannot map the parameter to any pydantic type.","triggerScenarios":"A query/header/path/collection-format parameter with no schema so dataType is unset, e.g. { name: q, in: query } without schema, when generating with -g python-pydantic-v1.","commonSituations":"Specs with missing schema blocks on parameters; $ref parameter components without schemas; converted specs from tools that omit schemas.","solutions":["Add an explicit schema to the parameter, e.g. schema: { type: string }","Inline or fix the parameter $ref so it resolves to a schema-bearing definition","Validate the spec with Spectral before generating to catch schema-less parameters early"],"exampleFix":"# before\nparameters:\n  - name: q\n    in: query\n\n# after\nparameters:\n  - name: q\n    in: query\n    schema:\n      type: string","handlingStrategy":"validation","validationCode":"// JS: every parameter needs a schema or $ref before python-pydantic-v1 generation\nfor (const item of Object.values(spec.paths || {})) {\n  for (const op of Object.values(item)) {\n    for (const p of (op && op.parameters) || []) {\n      if (!p.schema && !p.$ref) fail(`parameter '${p.name || '?'}' missing schema`);\n    }\n  }\n}","typeGuard":null,"tryCatchPattern":"try { generator.generate(); } catch (RuntimeException e) { if (String.valueOf(e.getMessage()).contains(\"Codegen Parameter not yet supported\")) { /* add schema to the parameter printed in the message */ } throw e; }","preventionTips":["Include a schema on every parameter when authoring specs","Run Spectral validation as a CI gate","Verify $ref parameter components still contain schemas after refactors"],"tags":["pydantic","python","parameters","openapi-spec"],"backgroundTag":"unsupported-schema-type","analyzedSha":"fcec517be3cf5b7964296bcba25fbc97541484e7","analyzedAt":"2026-08-22T11:13:11.613Z","schemaVersion":2},"datasetVersion":"2026-08-22T14:17:55.899Z"}