{"record":{"id":"f254e0a5d4df64e0","repo":"OpenAPITools/openapi-generator","slug":"error-codegen-parameter-not-yet-supported-in-getp","errorCode":null,"errorMessage":"Error! Codegen Parameter not yet supported in getPydanticType: %s","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/AbstractPythonCodegen.java","lineNumber":2364,"sourceCode":"            if (result == null) {\n                if (!cp.isPrimitiveType) {\n                    // add model prefix\n                    hasModelsToImport = true;\n                    modelImports.add(cp.getDataType());\n                    exampleImports.add(cp.getDataType());\n                    result = new PythonType(cp.getDataType());\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                            // TODO: don't loop back to the deprecated getPydanticType method\n                            return getPydanticType(cmt.getSchema(), modelImports, exampleImports, postponedModelImports, postponedExampleImports, moduleImports, 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            return result;\n        }\n\n        private String finalizeType(CodegenParameter cp, PythonType pt) {\n            if (!cp.required || cp.isNullable) {\n                moduleImports.add(TYPING, \"Optional\");\n                PythonType opt = new PythonType(\"Optional\");\n                opt.addTypeParam(pt);\n                pt = opt;\n            }\n\n            if (!StringUtils.isEmpty(cp.description)) { // has description\n                pt.annotate(\"description\", cp.description);\n            }\n","sourceCodeStart":2346,"sourceCodeEnd":2382,"githubUrl":"https://github.com/OpenAPITools/openapi-generator/blob/fcec517be3cf5b7964296bcba25fbc97541484e7/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPythonCodegen.java#L2346-L2382","documentation":"In AbstractPythonCodegen's getPydanticType(CodegenParameter, ...), a parameter is expected to have either a resolved dataType (the normal path for typed parameters) or request-body style content. A parameter with neither falls through to this RuntimeException — the generator has no pydantic type mapping for that parameter at all.","triggerScenarios":"A query/header/path parameter with no usable schema so dataType stays unset, e.g. { name: q, in: query } with the schema block missing, or a schema whose type the mapper leaves unresolved, or a $ref that resolves to an object without a schema.","commonSituations":"Typos that drop the schema: block; spec converters/prototools emitting parameters without schemas; lenient OpenAPI 3.1 parsing letting incomplete parameters through to generation.","solutions":["Add an explicit schema to the failing parameter, e.g. schema: { type: string }","Resolve or inline the parameter's $ref so it carries a real schema","Run a Spectral/swagger-cli validation pass — parameters without schemas are flagged before generation ever runs"],"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 operation parameter must carry a schema (or valid $ref to one)\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}' has no schema`);\n    }\n  }\n}","typeGuard":null,"tryCatchPattern":"try { generator.generate(); } catch (RuntimeException e) { if (String.valueOf(e.getMessage()).contains(\"Codegen Parameter not yet supported\")) { /* message prints the parameter: add its missing schema */ } throw e; }","preventionTips":["Lint specs with Spectral's oas3 rules — schema-less parameters are caught pre-generation","Inline or resolve parameter $refs and re-validate after refactors","Prefer a single parameter component style across the whole spec"],"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"}