Bug Report Checklist
Description
When generating Protobuf schemas for composed schemas that contain nested structures with enum references, the codegen incorrectly treats enums in maps and arrays as primitive string types, resulting in StringMap and StringArray wrappers instead of the correct enum-typed wrappers.
spec:
components:
schemas:
Fruit:
type: string
enum:
- APPLE
- BANANA
- ORANGE
FruitByColor:
type: object
additionalProperties:
$ref: '#/components/schemas/Fruit'
FruitList:
type: array
items:
$ref: '#/components/schemas/Fruit'
FruitInventory:
oneOf:
- title: fruitList
$ref: '#/components/schemas/FruitList'
- title: fruitColor
$ref: '#/components/schemas/FruitByColor'
protobuf:
enum Fruit {
FRUIT_APPLE = 0;
FRUIT_BANANA = 1;
FRUIT_ORANGE = 2;
}
message FruitInventory {
oneof fruit_inventory {
StringArray fruit_list = 1;
StringMap fruit_color = 2;
}
}
- A map containing enum values → should generate named enum map type (e.g.,
FruitMap)
- An array containing enum items → should generate named enum array type (e.g.,
FruitArray)
openapi-generator version
OpenAPI declaration file content or url
Generation Details
Steps to reproduce
Related issues/PRs
Suggest a fix
Bug Report Checklist
Description
When generating Protobuf schemas for composed schemas that contain nested structures with enum references, the codegen incorrectly treats enums in maps and arrays as primitive string types, resulting in
StringMapandStringArraywrappers instead of the correct enum-typed wrappers.spec:
protobuf:
FruitMap)FruitArray)openapi-generator version
OpenAPI declaration file content or url
Generation Details
Steps to reproduce
Related issues/PRs
Suggest a fix