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
For below case, RepeatabilityResult is as response header model, and should not be generated. But TCGC returns access for the model as public and usage = 4, thus after adopting TCGC access and usage, it gets generated.
aliasRepeatableOperationsWithTraits=global.Azure.Core.ResourceOperations<SupportsRepeatableRequests&NoConditionalRequests&NoClientRequestId>;oprepeatableAction is RepeatableOperationsWithTraits.ResourceAction<User,BodyParameter<UserActionParam>,UserActionResponse>;/** * Provides repeatable request headers for requests and responses. * @template VersionAdded The version when the trait was added to the specification. * Leave this empty if the trait is always supported. */
@trait("RepeatableRequests")
@traitAdded(VersionAdded)modelSupportsRepeatableRequests<VersionAddedextendsEnumMember|null=null>{
#suppress "@azure-tools/typespec-providerhub/no-inline-model""This inline model is never used directly in operations."
@traitContext(TraitContext.Create|TraitContext.Update|TraitContext.Delete|TraitContext.Action)repeatableRequests: {
@traitLocation(TraitLocation.Parameters)parameters: RepeatabilityRequestHeaders;
@traitLocation(TraitLocation.Response)response: RepeatabilityResponseHeaders;};}
@doc("Provides the 'Repeatability-*' headers to enable repeatable requests.")modelRepeatabilityResponseHeaders{
@visibility("read")
@header("Repeatability-Result")
@doc("Indicates whether the repeatable request was accepted or rejected.")repeatabilityResult?: RepeatabilityResult;}
Issue
For below case,
RepeatabilityResult
is as response header model, and should not be generated. But TCGC returns access for the model aspublic
andusage = 4
, thus after adopting TCGC access and usage, it gets generated.detailed test case
Solution
TCGC return usage as
0
to indicate the model should not be generated.The text was updated successfully, but these errors were encountered: