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

[Bug]: processing in http-service-csharp affect other emitters #5424

Closed
4 tasks done
weidongxu-microsoft opened this issue Dec 20, 2024 · 1 comment · Fixed by #5417
Closed
4 tasks done

[Bug]: processing in http-service-csharp affect other emitters #5424

weidongxu-microsoft opened this issue Dec 20, 2024 · 1 comment · Fixed by #5417
Labels
bug Something isn't working emitter:service:csharp

Comments

@weidongxu-microsoft
Copy link
Contributor

weidongxu-microsoft commented Dec 20, 2024

Describe the bug

Enable http-service-csharp causes change of TCGC crossLanguageDefinitionId (which is generated from Namespace/Interface/Operation or Model) in http-client-java
allenjzhang/typespec-e2e-demo@d48c548

E.g. Todo.TodoItems.Attachments.createFileAttachment becomes Todo.TodoItems.Attachments.AttachmentsOperations.createFileAttachment, with http-service-csharp enabled.

Not sure if the cause is this code
https://github.com/microsoft/typespec/blob/main/packages/http-server-csharp/src/service.ts#L1344-L1354

        const iface: Interface = program.checker.createAndFinishType({
          node: undefined as any,
          sourceInterfaces: [],
          decorators: [],
          operations: createRekeyableMap(nsOps),
          kind: "Interface",
          name: `${target.name}Operations`,
          namespace: target,
          entityKind: "Type",
          isFinished: true,
        });

I kind of assume the processing of emitters should be independent from each other. I didn't expect processing in one emitter would affect other emitters.

Reproduction

Generate typespec-e2e-demo/todoApp with both "http-service-csharp" and "http-client-java". See the content of "todoApp/clients/java/src/main/resources/META-INF/todo_apiview_properties.json" file.

Checklist

@markcowl
Copy link
Contributor

This should be fixed in #5417

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working emitter:service:csharp
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants