Azure / autorest.java

Extension for AutoRest (https://github.com/Azure/autorest) that generates Java code
MIT License
32 stars 80 forks source link

[stream-style-serialization] multi-level-inheritance, when discriminator is enum, generated code is wrong #2798

Closed XiaofeiCao closed 2 weeks ago

XiaofeiCao commented 1 month ago

tsp file: https://github.com/XiaofeiCao/autorest.java/blob/multi_level_inheritance_test/typespec-tests/tsp/inheritance.tsp

generated code: https://github.com/XiaofeiCao/autorest.java/blob/multi_level_inheritance_test/typespec-tests/src/main/java/com/cadl/inheritance/models/GoblinShark.java#L18-L26

/*
 * The kind property.
 */
private FishKind kind = SharkType.fromString("shark");

Seems wrong.

XiaofeiCao commented 2 weeks ago

fixed by https://github.com/Azure/autorest.java/pull/2799