Closed weidongxu-microsoft closed 1 month ago
Resource
is input + output, why is DomainResource
output only?
// intput+output
model Resource {
name: string;
prop0?: string;
}
// output
@discriminator("kind")
model DomainResource extends Resource {
kind: string;
prop1?: string;
}
Resource
is not a discriminated model.
For response, service cannot send DomainResource
if op response body is Resource
. (no discriminator means SDK won't serialize to DomainResource
)
For request, service likely cannot receive DomainResource
if op request body is Resource
. (DomainResource
likely have more property than Resource
, which is expected to be rejected by service, if it expect body as Resource
)
So, basically, DomainResource
and Resource
is not related in REST API (even SDK model them as subclass -- it can choose not to model this way).
In case only Resource
is used in operation, DomainResource
could be not generated at all.
ok, I see.
Sync usage/access behavior to current TCGC -- sub type of normal "extends" won't get access/usage from its parent.
Reason is that healthinsights is to release GA. This change affect them. See https://github.com/Azure/azure-sdk-for-java/pull/40125/files
local test tsp, to be merged into internal.tsp in future PR
PS: It does not handle below case (nor does TCGC -- checked with Chenjie)