typespec
typespec copied to clipboard
[Bug]: Unimplemented: transformJsonExprForType: Enum
Describe the bug
TypeSpec compiler v1.0.0-rc.0
✔ Compiling
✔ @typespec/openapi3 tsp-output/schema/
✔ @typespec/http-client-js tsp-output/clients/js/
× Running @typespec/http-server-js...
Emitter "@typespec/http-server-js" crashed! This is a bug.
Please file an issue at https://github.com/microsoft/typespec/issues
Error: Unimplemented: transformJsonExprForType: Enum
at transposeExpressionToJson (.../node_modules/@typespec/http-server-js/dist/src/common/serialization/json.js:231:19)
at emitToJson (.../node_modules/@typespec/http-server-js/dist/src/common/serialization/json.js:116:28)
at emitToJson.next (<anonymous>)
at indent (.../node_modules/@typespec/http-server-js/dist/src/util/iter.js:68:16)
at indent.next (<anonymous>)
at emitJsonSerialization (.../node_modules/@typespec/http-server-js/dist/src/common/serialization/json.js:79:12)
at emitJsonSerialization.next (<anonymous>)
at emitSerializationForType (.../node_modules/@typespec/http-server-js/dist/src/common/serialization/index.js:76:20)
at emitSerializationForType.next (<anonymous>)
at indent (.../node_modules/@typespec/http-server-js/dist/src/util/iter.js:68:16)
--------------------------------------------------
Library Version 0.58.0-alpha.12
TypeSpec Compiler Version 1.0.0-rc.0
--------------------------------------------------
Reproduction
import "@typespec/http";
using Http;
@service(#{ title: "Service" })
namespace Service;
enum Status {
open: "open",
closed: "closed",
}
model Data {
status: Status;
at: utcDateTime;
}
op list(): Data;
Checklist
- [x] Follow our Code of Conduct
- [x] Check that there isn't already an issue that request the same bug to avoid creating a duplicate.
- [x] Check that this is a concrete bug. For Q&A open a GitHub Discussion.
- [x] The provided reproduction is a minimal reproducible example of the bug.
somehow it does not crash when
model Data {
status: Status;
at: utcDateTime;
}
is changed to
model Data {
status: Status;
at: string;
}
@witemple-msft verify if this was fixed in recent check-ins
somehow it does not crash when
model Data { status: Status; at: utcDateTime; }is changed to
model Data { status: Status; at: string; }
This didn't work for me unfortunately. Hopefully this gets fixed soon.