Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 12, 2025

Plan to fix bulletPointsModel API and runtime behavior mismatch

  • Update main.tsp: Change op bulletPointsModel response type from NoContentResponse to OkResponse
  • Update mockapi.ts: Wrap the request body in an input property to match the expected format { "input": {"prop": "Simple"} }
  • Verify the changes build successfully - TypeSpec compiles without errors
  • Run any relevant tests to ensure no regressions - Compiled JavaScript output verified
  • Add changelog entry for the fix
  • Run pnpm ci in http-specs folder - formatting and validation passed

Changes Made:

main.tsp

  • Changed response type from NoContentResponse (status 204) to OkResponse (status 200)
  • Updated scenarioDoc to show correct input format: {"input": {"prop": "Simple"}}

mockapi.ts

  • Wrapped request body in input property to match the operation signature
  • Now sends {input: {prop: "Simple"}} instead of {prop: "Simple"}

Changelog

  • Added changelog entry in .chronus/changes/ documenting the fix

All changes compile successfully and validation passed (717 scenarios passed, 2 pre-existing failures unrelated to this change).

Original prompt

This section details on the original issue you should resolve

<issue_title>[http-specs][bug] API doesn't follow runtime behavior</issue_title>
<issue_description>

@scenarioDoc("""
Test bullet points in model and enum documentation.
Expected input:
```json
{
"prop": "Simple"
}
```
""")
@post
@route("/bullet-points/model")
op bulletPointsModel(input: BulletPointsModel): NoContentResponse;
doesn't follow runtime behavior of
Scenarios.Documentation_Lists_bulletPointsModel = createPostServerTests(
"/documentation/lists/bullet-points/model",
{
prop: "Simple",
},
);

The related file shall make the following 2 fixes

  1. change response type of op bulletPointsModel to OkResponse
  2. update expected request of op bulletPointsModel to
{
  "input": {"prop": "Simple"}
}

NOTE: please fix main.tsp and mockapi.ts at the same time.</issue_description>

Comments on the Issue (you are @copilot in this section)

@msyyc After this issue resolved, we could reopen test case for https://github.com//pull/8927/files#diff-8a1b7d09be7a2e3e5524ec956eac181cf0bade458ce3cac4f65d240fa5217e64

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

- Changed response type from NoContentResponse to OkResponse
- Updated request body to wrap model in 'input' property
- Updated scenarioDoc to reflect correct input format

Co-authored-by: msyyc <[email protected]>
Copilot AI changed the title [WIP] Fix API to follow expected runtime behavior Fix bulletPointsModel API signature to match runtime behavior Dec 12, 2025
Copilot AI requested a review from msyyc December 12, 2025 05:46
@msyyc msyyc marked this pull request as ready for review December 12, 2025 07:17
@msyyc msyyc changed the title Fix bulletPointsModel API signature to match runtime behavior [http-specs] Fix bulletPointsModel API signature to match runtime behavior Dec 12, 2025
@microsoft-github-policy-service microsoft-github-policy-service bot added the lib:http-specs For issues/prs related to the @typespec/http-specs package label Dec 12, 2025
Copilot AI requested a review from msyyc December 12, 2025 07:33
@pkg-pr-new
Copy link

pkg-pr-new bot commented Dec 15, 2025

Open in StackBlitz

npm i https://pkg.pr.new/microsoft/typespec/@typespec/http@9200
npm i https://pkg.pr.new/microsoft/typespec/@typespec/http-specs@9200

commit: 7a1f806

@github-actions
Copy link
Contributor

github-actions bot commented Dec 15, 2025

All changed packages have been documented.

  • @typespec/http-specs
Show changes

@typespec/http-specs - fix ✏️

Fix bulletPointsModel API signature to match runtime behavior - changed response type to OkResponse and updated request body structure

@msyyc msyyc enabled auto-merge December 15, 2025 03:50
@msyyc
Copy link
Contributor

msyyc commented Dec 15, 2025

@markcowl / @timotheeguerin Pls help review, thanks!

@msyyc msyyc disabled auto-merge December 18, 2025 09:28
@msyyc msyyc enabled auto-merge December 22, 2025 02:26
@msyyc msyyc added this pull request to the merge queue Jan 7, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jan 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lib:http-specs For issues/prs related to the @typespec/http-specs package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[http-specs][bug] API doesn't follow runtime behavior

4 participants