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
Some change in 0.47.x causes usage flags to propagate from derived type to base type. This means that it's no longer possible to identify base types that aren't explicitly annotated.
For Go, which does not have inheritance, we omit base types by default unless they're explicitly referenced (directly or transitively) via an operation.
For model-only builds we can only rely on usage flags to control the output. Now that these flags are propagated, the usage on base model types is ambiguous.
Reproduction
For the following tsp, BaseClassThatsPruned has a usage of output even though it's not explicitly annotated as such.
import "@azure-tools/typespec-client-generator-core";
using Azure.ClientGenerator.Core;
@service({
title: "ModelsOnly",
})
namespace ModelsOnly;
model BaseClassThatsPruned {
id: int32;
}
model DerivedOne extends BaseClassThatsPruned {
name: string;
}
model PreservedBaseClass {
id: int32;
}
model DerivedTwo extends PreservedBaseClass {
name: string;
}
@@access(ModelsOnly.PreservedBaseClass, Access.public);
@@access(ModelsOnly.DerivedOne, Access.public);
@@access(ModelsOnly.DerivedTwo, Access.public);
@@usage(ModelsOnly.PreservedBaseClass, Usage.output);
@@usage(ModelsOnly.DerivedOne, Usage.output);
@@usage(ModelsOnly.DerivedTwo, Usage.output);
…ception usage from output usage (#1834)
resolve: #1827
add `disableUsageAccessPropagationToBase` flag: this flag aims to
support language that does not generate base model, it will skip the
base model's propagation but will not skip the property or subtype of
the base model.
Describe the bug
Some change in
0.47.x
causes usage flags to propagate from derived type to base type. This means that it's no longer possible to identify base types that aren't explicitly annotated.For Go, which does not have inheritance, we omit base types by default unless they're explicitly referenced (directly or transitively) via an operation.
For model-only builds we can only rely on usage flags to control the output. Now that these flags are propagated, the usage on base model types is ambiguous.
Reproduction
For the following tsp,
BaseClassThatsPruned
has a usage ofoutput
even though it's not explicitly annotated as such.Checklist
The text was updated successfully, but these errors were encountered: