Skip to content

[INFO] Error! Codegen Property not yet supported in getPydanticType #21084

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
timonrieger opened this issue Apr 13, 2025 · 0 comments
Open

Comments

@timonrieger
Copy link

In case someone is using FastaAPI as a backend generating a python client.
I literally spent hours to resolve this issue:

Exception in thread "main" java.lang.RuntimeException: Error! Codegen Property not yet supported in getPydanticType: CodegenProperty{openApiType='null', baseName='any_of_1', complexType='null', getter='getAnyOf1', setter='setAnyOf1', description='null', dataType='none_type', datatypeWithEnum='none_type', dataFormat='null', name='any_of_1', min='null', max='null', defaultValue='null', defaultValueWithParam=' = data.any_of_1;', baseType='none_type', containerType='null', containerTypeMapped='null', title='null', unescapedDescription='null', maxLength=null, minLength=null, pattern='null', example='null', jsonSchema='{ }', minimum='null', maximum='null', exclusiveMinimum=false, exclusiveMaximum=false, required=false, deprecated=false, hasMoreNonReadOnly=false, isPrimitiveType=true, isModel=false, isContainer=false, isString=false, isNumeric=false, isInteger=false, isShort=false, isLong=false, isUnboundedInteger=false, isNumber=false, isFloat=false, isDouble=false, isDecimal=false, isByteArray=false, isBinary=false, isFile=false, isBoolean=false, isDate=false, isDateTime=false, isUuid=false, isUri=false, isEmail=false, isPassword=false, isFreeFormObject=false, isArray=false, isMap=false, isOptional=false, isEnum=false, isInnerEnum=false, isEnumRef=false, isAnyType=false, isReadOnly=false, isWriteOnly=false, isNullable=false, isSelfReference=false, isCircularReference=false, isDiscriminator=false, isNew=false, isOverridden=null, _enum=null, allowableValues=null, items=null, additionalProperties=null, vars=[], requiredVars=[], mostInnerItems=null, vendorExtensions={}, hasValidation=false, isInherited=false, discriminatorValue='null', nameInCamelCase='anyOf1', nameInPascalCase='AnyOf1', nameInSnakeCase='ANY_OF1', enumName='null', maxItems=null, minItems=null, maxProperties=null, minProperties=null, uniqueItems=false, uniqueItemsBoolean=null, multipleOf=null, isXmlAttribute=false, xmlPrefix='null', xmlName='null', xmlNamespace='null', isXmlWrapped=false, isNull=true, isVoid=false, getAdditionalPropertiesIsAnyType=false, getHasVars=false, getHasRequired=false, getHasDiscriminatorWithNonEmptyMapping=false, composedSchemas=null, hasMultipleTypes=false, hasSanitizedName=false, requiredVarsMap=null, ref=null, schemaIsFromAdditionalProperties=false, isBooleanSchemaTrue=false, isBooleanSchemaFalse=false, format=null, dependentRequired=null, contains=null}
        at org.openapitools.codegen.languages.AbstractPythonCodegen$PydanticType.getType(AbstractPythonCodegen.java:2155)
        at org.openapitools.codegen.languages.AbstractPythonCodegen$PydanticType.generatePythonType(AbstractPythonCodegen.java:2104)
        at org.openapitools.codegen.languages.AbstractPythonCodegen.postProcessModelsMap(AbstractPythonCodegen.java:968)
        at org.openapitools.codegen.languages.AbstractPythonCodegen.postProcessAllModels(AbstractPythonCodegen.java:862)
        at org.openapitools.codegen.DefaultGenerator.generateModels(DefaultGenerator.java:536)
        at org.openapitools.codegen.DefaultGenerator.generateModels(DefaultGenerator.java:453)
        at org.openapitools.codegen.DefaultGenerator.generate(DefaultGenerator.java:1303)
        at org.openapitools.codegen.cmd.Generate.execute(Generate.java:535)
        at org.openapitools.codegen.cmd.OpenApiGeneratorCommand.run(OpenApiGeneratorCommand.java:32)
        at org.openapitools.codegen.OpenAPIGenerator.main(OpenAPIGenerator.java:66)

To resolve, i had to include the routers ABOVE!!! the first endpoint

# up here
app.include_router(now_router)
app.include_router(products_router)
app.include_router(payments_router)


@app.get("/", tags=["Status"], operation_id="ping")
async def ping():
    return HTTPException(status_code=status.HTTP_200_OK)

# not down here

This is very specific but maybe it helps someone out 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant