-
Notifications
You must be signed in to change notification settings - Fork 230
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[http-server-javascript] Two small correctness fixes (#5253)
This fixes two issues that showed up in the widget and petstore REST examples. - Required query parameters were being detected as missing if their value was not exactly `null`. This PR changes this to a falsiness test. - Checking literal range-constrained properties in type differentiation could try to use a property without proving its presence. This PR adds an `in` check to that logic so that range-constrained properties have the same guard that literal-valued properties do. --------- Co-authored-by: Will Temple <[email protected]>
- Loading branch information
1 parent
dddf9c7
commit fc51b1f
Showing
4 changed files
with
28 additions
and
4 deletions.
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
.chronus/changes/witemple-msft-hsj-additional-guard-in-2024-11-3-13-53-46.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
changeKind: fix | ||
packages: | ||
- "@typespec/http-server-javascript" | ||
--- | ||
|
||
Added an additional check for the presence of a property before performing a bounds check on integer properties constrained to a range. |
7 changes: 7 additions & 0 deletions
7
.chronus/changes/witemple-msft-hsj-additional-guard-in-2024-11-3-14-29-16.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
changeKind: fix | ||
packages: | ||
- "@typespec/http-server-javascript" | ||
--- | ||
|
||
Fixed a null check in query parameter requiredness check by replacing it with a falseness check. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters