Skip to content

[http-server-js] handle Scalar and value literal return types in result processing#10058

Merged
witemple-msft merged 3 commits intomicrosoft:mainfrom
witemple-msft:wt/typespec/10005-bug-error-unimplemented-result-processing-for-ty
Mar 19, 2026
Merged

[http-server-js] handle Scalar and value literal return types in result processing#10058
witemple-msft merged 3 commits intomicrosoft:mainfrom
witemple-msft:wt/typespec/10005-bug-error-unimplemented-result-processing-for-ty

Conversation

@witemple-msft
Copy link
Member

Adds a branch in emitResultProcessingForType to handle top-level Scalar and value literal (String, Number, Boolean) return types, using the existing JSON serialization helpers. Previously, any operation returning a bare scalar (e.g. @get op read(): string;) would crash with:

Error: Unimplemented: result processing for type kind 'Scalar'

Fixes #10005

…result processing

Adds a branch in `emitResultProcessingForType` to handle top-level `Scalar`
and value literal (`String`, `Number`, `Boolean`) return types, using the
existing JSON serialization helpers. Previously, any operation returning a bare
scalar (e.g. `@get op read(): string;`) would crash with:

  Error: Unimplemented: result processing for type kind 'Scalar'

Fixes microsoft#10005

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@pkg-pr-new
Copy link

pkg-pr-new bot commented Mar 17, 2026

Open in StackBlitz

npm i https://pkg.pr.new/@typespec/http-server-js@10058

commit: e929d62

@github-actions
Copy link
Contributor

github-actions bot commented Mar 17, 2026

All changed packages have been documented.

  • @typespec/http-server-js
Show changes

@typespec/http-server-js - fix ✏️

handle immediate scalar-typed and value-literal typed responses in result processing layer to prevent crash when an operation returns a bare scalar or value literal

@azure-sdk
Copy link
Collaborator

azure-sdk commented Mar 17, 2026

You can try these changes here

🛝 Playground 🌐 Website 🛝 VSCode Extension

@witemple-msft witemple-msft added this pull request to the merge queue Mar 19, 2026
Merged via the queue into microsoft:main with commit 46eff52 Mar 19, 2026
30 checks passed
@witemple-msft witemple-msft deleted the wt/typespec/10005-bug-error-unimplemented-result-processing-for-ty branch March 19, 2026 21:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Error: Unimplemented: result processing for type kind 'Scalar'

4 participants