You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is an idea when we tried to solve the breaking issue during migrating swagger to typespec for anonymous model. The naming rule is different between them and one solution would be to location that model and use clientName decorator to rename it.
model Foo {
bar: {
baz: string;
}
}
Then in decorator we could have a way likeFoo.bar.Type to location that model then we could add decorator like other models.
// add doc into that model
@@doc(Foo.bar.Type, "This is demo for doc with anonymous model");
// give a name for that model
@@clientName(Foo.bar.Type, "NamedBarType");
Did talk with people about that recently, the main problem is that the anonymous model can have multiple parent when using alias. But maybe then its ok to try to resolve the alias name or it is an antipattern.
sorry misunderstood, we have that but its broken with Foo.bar::type.baz should be solved by the symbol refactor
timotheeguerin
changed the title
Can we allow to location anonymous model in decorator?
Cannot augment properties in nested anonymous model
Oct 22, 2024
Clear and concise description of the problem
This is an idea when we tried to solve the breaking issue during migrating swagger to typespec for anonymous model. The naming rule is different between them and one solution would be to location that model and use clientName decorator to rename it.
Then in decorator we could have a way like
Foo.bar.Type
to location that model then we could add decorator like other models.Checklist
The text was updated successfully, but these errors were encountered: