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

[http-server-csharp] Templated model reported error when generating #5124

Open
ArcturusZhang opened this issue Nov 15, 2024 · 0 comments · May be fixed by #5140
Open

[http-server-csharp] Templated model reported error when generating #5124

ArcturusZhang opened this issue Nov 15, 2024 · 0 comments · May be fixed by #5140
Assignees
Labels

Comments

@ArcturusZhang
Copy link
Member

I am using the petstore as spec to generate server code: https://github.com/microsoft/typespec/tree/main/packages/samples/specs/petstore
This is the stack trace of the issue:

Emitter "@typespec/http-server-csharp" crashed! This is a bug.
Please file an issue at https://github.com/microsoft/typespec/issues

Error: Encountered type TemplateParameter which we don't know how to emit.
    at compilerAssert (file:///C:/Users/dapzhang/Documents/workspace/playground/tsp-random-project/spec/node_modules/@typespec/compiler/dist/src/core/diagnostics.js:140:11)
    at typeEmitterKey (file:///C:/Users/dapzhang/Documents/workspace/playground/tsp-random-project/spec/node_modules/@typespec/compiler/dist/src/emitter-framework/asset-emitter.js:619:17)
    at Object.emitType (file:///C:/Users/dapzhang/Documents/workspace/playground/tsp-random-project/spec/node_modules/@typespec/compiler/dist/src/emitter-framework/asset-emitter.js:239:25)
    at file:///C:/Users/dapzhang/Documents/workspace/playground/tsp-random-project/spec/node_modules/@typespec/compiler/dist/src/emitter-framework/asset-emitter.js:161:37
    at withPatchedReferenceContext (file:///C:/Users/dapzhang/Documents/workspace/playground/tsp-random-project/spec/node_modules/@typespec/compiler/dist/src/emitter-framework/asset-emitter.js:540:20)
    at Object.emitTypeReference (file:///C:/Users/dapzhang/Documents/workspace/playground/tsp-random-project/spec/node_modules/@typespec/compiler/dist/src/emitter-framework/asset-emitter.js:144:20)
    at #findPropertyType (file:///C:/Users/dapzhang/Documents/workspace/playground/tsp-random-project/spec/node_modules/@typespec/http-server-csharp/dist/src/service.js:219:50)
    at CSharpCodeEmitter.modelPropertyLiteral (file:///C:/Users/dapzhang/Documents/workspace/playground/tsp-random-project/spec/node_modules/@typespec/http-server-csharp/dist/src/service.js:192:67)
    at file:///C:/Users/dapzhang/Documents/workspace/playground/tsp-random-project/spec/node_modules/@typespec/compiler/dist/src/emitter-framework/asset-emitter.js:377:55
    at withTypeContext (file:///C:/Users/dapzhang/Documents/workspace/playground/tsp-random-project/spec/node_modules/@typespec/compiler/dist/src/emitter-framework/asset-emitter.js:520:9)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants