Open
Description
openedon Oct 28, 2024
Example:
model Bar {
name: utcDateTime;
}
@@Tcgc.alternateType(Bar.name, string, "python");
Rationale is to be able to express in TypeScript autorest Swagger directive rules like this one:
- from: swagger-document
where: $.definitions.AccessPolicy.properties
transform: >
$.Start.format = "str";
$.Expiry.format = "str";
Side note, if I understood @timotheeguerin correctly, we should be able to make this work as well:
scalar storageDateTime extends utcDataTime;
model Bar {
name: storageDateTime;
}
@@Tcgc.alternateType(storageDateTime, string, "python");
which would avoid to replace all one by one.
I would expect this is done in a way that emitter do not need to change anything, since they will receive models with the new type auto-magically.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment