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
@msyyc msyyc added this pull request to the merge queue Jan 14, 2026
Merged via the queue into main with commit ab7e44a Jan 14, 2026
23 checks passed
@msyyc msyyc deleted the copilot/fix-api-runtime-behavior branch January 14, 2026 09:17
@msyyc msyyc mentioned this pull request Jan 15, 2026
github-merge-queue bot pushed a commit that referenced this pull request Jan 19, 2026
…ded (#9387)

Adds test coverage for the documentation namespace spec (bullet points,
numbered lists, text formatting) to azure and unbranded mock API test
suites, mirroring the existing generic_mock_api_tests.

## Changes

- **New test files**:
- `test_specs_documentation.py` in azure/mock_api_tests and
unbranded/mock_api_tests
- `test_specs_documentation_async.py` in azure/mock_api_tests/asynctests
and unbranded/mock_api_tests/asynctests

- **Test coverage**: All 6 scenarios from TypeSpec documentation spec:
- Lists: bulletPointsOp, bulletPointsModel (skipped per #9173), numbered
  - Text formatting: boldText, italicText, combinedFormatting

- **Changelog**: Added entry under version 0.24.2

Tests follow the same pattern as other azure/unbranded tests (e.g.,
encode_duration).

<!-- START COPILOT ORIGINAL PROMPT -->



<details>

<summary>Original prompt</summary>

> 
> ----
> 
> *This section details on the original issue you should resolve*
> 
> <issue_title>[python] add test case</issue_title>
> <issue_description>GOAL: 
> - add test case in
/workspaces/typespec/packages/http-client-python/generator/test/generic_mock_api_tests/test_specs_documentation.py
and
/workspaces/typespec/packages/http-client-python/generator/test/generic_mock_api_tests/asynctests/test_specs_documentation_async.py
for #9200 which fixed a case
then we could test it.
> - add test case in
/workspaces/typespec/packages/http-client-python/generator/test/azure/mock_api_tests
and
/workspaces/typespec/packages/http-client-python/generator/test/unbranded/mock_api_tests
for https://github.com/microsoft/typespec/pull/9259/files which added a
new case
> 
> NOTE:
> - DO add changelog
> - DO format your changed files before commit</issue_description>
> 
> ## Comments on the Issue (you are @copilot in this section)
> 
> <comments>
> </comments>
> 


</details>



<!-- START COPILOT CODING AGENT SUFFIX -->

- Fixes #9386

<!-- START COPILOT CODING AGENT TIPS -->
---

✨ Let Copilot coding agent [set things up for
you](https://github.com/microsoft/typespec/issues/new?title=✨+Set+up+Copilot+instructions&body=Configure%20instructions%20for%20this%20repository%20as%20documented%20in%20%5BBest%20practices%20for%20Copilot%20coding%20agent%20in%20your%20repository%5D%28https://gh.io/copilot-coding-agent-tips%29%2E%0A%0A%3COnboard%20this%20repo%3E&assignees=copilot)
— coding agent works faster and does higher quality work when set up for
your repo.

---------

Co-authored-by: Yuchao Yan <[email protected]>
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