Skip to content

Fix duration mockapi float comparisons to be numeric#9954

Open
SergioChan wants to merge 2 commits intomicrosoft:mainfrom
SergioChan:fix-duration-float-comparison-9944
Open

Fix duration mockapi float comparisons to be numeric#9954
SergioChan wants to merge 2 commits intomicrosoft:mainfrom
SergioChan:fix-duration-float-comparison-9944

Conversation

@SergioChan
Copy link

@SergioChan SergioChan commented Mar 6, 2026

Summary

  • switch duration query float scenarios to dedicated handlers that compare numeric values via Number(req.query?.input)
  • switch duration header float scenarios to dedicated handlers that compare numeric values via Number(req.headers?.duration)
  • keep integer/string scenarios unchanged so the diff stays scoped to the float comparison bug in the issue

Testing

  • pnpm prettier --check packages/http-specs/specs/encode/duration/mockapi.ts
  • attempted to run pnpm --filter @typespec/http-specs exec tsp-spector validate-mock-apis ./specs/encode/duration, but this isolated run is missing built @typespec/spec-api artifacts required by tsp-spector (ERR_MODULE_NOT_FOUND from packages/spector/dist/...)

Related

Fixes #9944

@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 Mar 6, 2026
@SergioChan
Copy link
Author

@microsoft-github-policy-service agree

@pkg-pr-new
Copy link

pkg-pr-new bot commented Mar 9, 2026

Open in StackBlitz

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

commit: 0447dbc

@github-actions
Copy link
Contributor

github-actions bot commented Mar 9, 2026

❌ There is undocummented changes. Run chronus add to add a changeset or click here.

The following packages have changes but are not documented.

  • @typespec/http-specs
Show changes

@SergioChan
Copy link
Author

Thanks for the heads-up. I pushed a follow-up commit adding the required Chronus changeset for @typespec/http-specs.

  • Added: .chronus/changes/fix-duration-float-comparison-9944-2026-3-9-15-40-00.md
  • Commit: 4efce4aef

This should satisfy the undocumented changes check.

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.

[Bug]: mockapi in e2e test, logic to compare float is not correct

2 participants