typespec
typespec copied to clipboard
[Bug]: Emitter "@typespec/json-schema" Unknown built-in scalar type unixTimestamp32
Describe the bug
TypeSpec compiler v0.58.1
Emitter "@typespec/json-schema" crashed! This is a bug. Please file an issue at https://github.com/microsoft/typespec/issues
Error: Unknown built-in scalar type unixTimestamp32 at compilerAssert (file:///D:/go/src/go.ailinking.com/gopkg/s002/docs/node_modules/@typespec/compiler/dist/src/core/diagnostics.js:138:11) at #getSchemaForStdScalars (file:///D:/go/src/go.ailinking.com/gopkg/s002/docs/node_modules/@typespec/json-schema/dist/src/json-schema-emitter.js:381:17) at #getSchemaForScalar (file:///D:/go/src/go.ailinking.com/gopkg/s002/docs/node_modules/@typespec/json-schema/dist/src/json-schema-emitter.js:293:50) at JsonSchemaEmitter.scalarDeclaration (file:///D:/go/src/go.ailinking.com/gopkg/s002/docs/node_modules/@typespec/json-schema/dist/src/json-schema-emitter.js:281:48) at file:///D:/go/src/go.ailinking.com/gopkg/s002/docs/node_modules/@typespec/compiler/dist/src/emitter-framework/asset-emitter.js:377:55 at withTypeContext (file:///D:/go/src/go.ailinking.com/gopkg/s002/docs/node_modules/@typespec/compiler/dist/src/emitter-framework/asset-emitter.js:520:9) at invokeTypeEmitter (file:///D:/go/src/go.ailinking.com/gopkg/s002/docs/node_modules/@typespec/compiler/dist/src/emitter-framework/asset-emitter.js:367:9) at Object.emitType (file:///D:/go/src/go.ailinking.com/gopkg/s002/docs/node_modules/@typespec/compiler/dist/src/emitter-framework/asset-emitter.js:268:28) at file:///D:/go/src/go.ailinking.com/gopkg/s002/docs/node_modules/@typespec/compiler/dist/src/emitter-framework/asset-emitter.js:161:37 at withPatchedReferenceContext (file:///D:/go/src/go.ailinking.com/gopkg/s002/docs/node_modules/@typespec/compiler/dist/src/emitter-framework/asset-emitter.js:540:20)
Reproduction
a.tsp:
import "@typespec/json-schema";
using TypeSpec.JsonSchema;
@jsonSchema
model SomeModel {
time: unixTimestamp32;
}
npx tsp compile a.tsp --emit=@typespec/json-schema
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.