Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Namespace refactoring Implementation #2968

Open
Tracked by #4537
lmazuel opened this issue Oct 23, 2024 · 3 comments
Open
Tracked by #4537

Namespace refactoring Implementation #2968

lmazuel opened this issue Oct 23, 2024 · 3 comments
Assignees
Labels

Comments

@lmazuel
Copy link
Member

lmazuel commented Oct 23, 2024

No description provided.

@weidongxu-microsoft
Copy link
Member

weidongxu-microsoft commented Oct 24, 2024

@weidongxu-microsoft weidongxu-microsoft self-assigned this Oct 25, 2024
@weidongxu-microsoft
Copy link
Member

weidongxu-microsoft commented Nov 4, 2024

Java design (base on TCGC .namespace)

Azure

  • Client classes would be under <tcgc_namespace>
  • Model/enum classes would be under <tcgc_namespace>.models
  • Internal model/enum classes would be under <tcgc_namespace>.implementation.models

This is following best practice on Azure Java Guideline e.g. model types, without service had to define a separate TypeSpec namespace for TypeSpec models.

Unbranded

  • Client/model/enum classes would be under <tcgc_namespace>
  • Internal model/enum classes would be under <tcgc_namespace>.implementation (?)

@weidongxu-microsoft
Copy link
Member

Migration plan for Azure

  • namespace option would override the client namespace from TCGC
  • new onboard should not have namespace option
  • migrate existing lib, update client.tsp to add @clientNamespace, and remove namespace option

github-merge-queue bot pushed a commit to microsoft/typespec that referenced this issue Nov 13, 2024
Also remove the `Cadl.` in local test. Replaced it with `TspTest` (we
don't want to call it `TypeSpec.` as it could conflict with TypeSpec
libs).

It would not affect Azure SDK which always has `namespace` in emitter
option.
It only affect SDK that does not have this option (basically, test case,
and unbranded).

It prepares for the Namespace refactor, as we should not modify the
TypeSpec Namespace. Azure/autorest.java#2968
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants