-
Notifications
You must be signed in to change notification settings - Fork 315
Open
Labels
bugSomething isn't workingSomething isn't workingemitter:openapi3Issues for @typespec/openapi3 emitterIssues for @typespec/openapi3 emittertriaged:core
Milestone
Description
Describe the bug
@typespec/openapi3
crashed while compiling when nested object having field name set
.
Dependencies described in package.json
"dependencies": {
"@typespec/compiler": "1.4.0",
"@typespec/http": "1.4.0",
"@typespec/rest": "0.74.0",
"@typespec/openapi": "1.4.0",
"@typespec/openapi3": "1.4.0"
}
Example
@route("/example")
@tag("Example")
interface Example {
@get
example(
@body request: {
field: { set: true; value?: string }
}
): { message: string }
}
But when I change the field name set
to anything else like assign
then it compiles succesfully.
@route("/example")
@tag("Example")
interface Example {
@get
example(
@body request: {
field: { assign: true; value?: string }
}
): { message: string }
}
Stack Traces
> tsp compile .
TypeSpec compiler v1.4.0
⚠ Compiling
× Running @typespec/openapi3...
Emitter "@typespec/openapi3" crashed! This is a bug.
Please file an issue at https://github.com/microsoft/typespec/issues
TypeError: props.set is not a function
at OpenAPI31SchemaEmitter.modelProperties (file:///node_modules/@typespec/openapi3/dist/src/schema-emitter.js:238:19)
at file:///node_modules/@typespec/asset-emitter/dist/src/asset-emitter.js:376:55
at withTypeContext (file:///node_modules/@typespec/asset-emitter/dist/src/asset-emitter.js:519:9)
at invokeTypeEmitter (file:///node_modules/@typespec/asset-emitter/dist/src/asset-emitter.js:366:9)
at Object.emitModelProperties (file:///node_modules/@typespec/asset-emitter/dist/src/asset-emitter.js:309:25)
at OpenAPI31SchemaEmitter.modelLiteral (file:///node_modules/@typespec/openapi3/dist/src/schema-emitter.js:162:38)
at file:///node_modules/@typespec/asset-emitter/dist/src/asset-emitter.js:376:55
at withTypeContext (file:///node_modules/@typespec/asset-emitter/dist/src/asset-emitter.js:519:9)
at invokeTypeEmitter (file:///node_modules/@typespec/asset-emitter/dist/src/asset-emitter.js:366:9)
at Object.emitType (file:///node_modules/@typespec/asset-emitter/dist/src/asset-emitter.js:267:28)
Reproduction
Checklist
- Follow our Code of Conduct
- Check that there isn't already an issue that request the same bug to avoid creating a duplicate.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion.
- The provided reproduction is a minimal reproducible example of the bug.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingemitter:openapi3Issues for @typespec/openapi3 emitterIssues for @typespec/openapi3 emittertriaged:core