Open
Description
Something that I have missed is the ability to combine models outside of spread operators. One example of a (unrelated) language is jsonnet's object combine operator (see inheritance and nested field inheritance the sections).
To illustrate a bit what I'm thinking:
model Base {
id: string;
etag?: string;
apiVersion: string;
}
model Overrides {
id: int32;
description?: string;
apiVersion: never;
}
model Combined is Base + Overrides;
/*
// Resulting model:
model Combined {
id: int32;
etag?: string;
apiVersion: never;
description?: string;
}
*/
As indicated, the resulting model is not a subtype of either operands, the order of attributes could be preserved (although there is an argument to be made that overriding attributes should move later), decorators (not shown) are not merged etc.
I can think of a couple of places in azure core where this would be useful and simplify our life.