Bug Report Checklist
Description
The issue occurs when the enum converter functions are generated for enum names that starts with digits. Identifiers cannot start with digits in Kotlin so the generator attempts to escape the name but this creates invalid syntax in the function declaration.
openapi-generator version
Introduced in 7.15.0
bfb6938
OpenAPI declaration file content or url
openapi: 3.1.0
info:
version: 1.0.0
title: Test api
components:
schemas:
123Example:
type: string
enum:
- TESTING
- TESTING_2
- TESTING_3
Generates:
class EnumConverterConfiguration {
@Bean(name=["org.openapitools.configuration.EnumConverterConfiguration`123Example`Converter"])
fun `123Example`Converter(): Converter<Kotlin.String, Model123ExampleDto> {
return object: Converter<kotlin.String, Model123ExampleDto> {
override fun convert(source: kotling.String): Model123ExampleDto = Model123ExampleDto.forValue(source)
}
}
}
Suggest a fix
Prefix function name with Model if enum name starts with a number, similar to how the model classes are named