Azure / cadl-ranch

Cadl Scenarios for client generations
https://azure.github.io/cadl-ranch/
MIT License
8 stars 31 forks source link

cadl-ranch-specs, case for access/usage on namespace #726

Open weidongxu-microsoft opened 2 weeks ago

weidongxu-microsoft commented 2 weeks ago

Cadl Ranch Contribution Checklist:

changeset-bot[bot] commented 2 weeks ago

🦋 Changeset detected

Latest commit: 83b72b3fa84d722b5f58f92b74a2908577ad0d99

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package | Name | Type | | ----------------------------- | ----- | | @azure-tools/cadl-ranch-specs | Patch |

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

weidongxu-microsoft commented 2 weeks ago

Is there some problem within TCGC?

I cannot get Model3 even this this.

import "@typespec/http";
import "@azure-tools/cadl-ranch-expect";
import "@azure-tools/typespec-client-generator-core";

using TypeSpec.Http;
using global.Azure.ClientGenerator.Core;

@doc("Test for access/usage decorator.")
@supportedBy("dpg")
@scenarioService("/azure/client-generator-core/access-namespace")
namespace _Specs_.Azure.ClientGenerator.Core.AccessNamespace;

// this model should be access=internal and usage=output
model OutputModel {
  name: string;
}

// all the oprations and models within this interface should be access=internal
namespace InternalOperations {
  @get
  op output(): OutputModel;

  @access(Access.public)
  @usage(Usage.output)
  model Model3 {
    ref: string;
  }
}
weidongxu-microsoft commented 2 days ago

Current main.tsp has a client that only have internal API. I am not sure if all language can call it in test. Let me know if better idea.