Open ArcturusZhang opened 1 week ago
@ArcturusZhang This is currently by design. Using an alias will prevent such a type from being emitted. Eventually, I think all emitters should have an equivalent of the omit-unreachable-types
setting that limits the generated types to those that are reachable from operations. But generating all user-supplied types should be the default.
Keeping this issue to track omit-unreachable-types as a setting
@ArcturusZhang This is currently by design. Using an alias will prevent such a type from being emitted. Eventually, I think all emitters should have an equivalent of the
omit-unreachable-types
setting that limits the generated types to those that are reachable from operations. But generating all user-supplied types should be the default.Keeping this issue to track omit-unreachable-types as a setting
make sense. C# generator has this setting, unreference-type-handling
.
I am generating the petstore spec, the model
PetId
is not really used, we use it to spread it as parameters:but this model is actually not used. The server gen still generates it, and it cannot compile because this model has a property with the same name as the model.
Either, the server gen should not generate the model that is not used, or we should do something on the generated model to ensure it never has a property with the same name as its enclosing type. Or I think we should do both.