Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .chronus/changes/HEAD-2025-9-23-17-13-14.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
changeKind: feature
packages:
- "@typespec/http-specs"
---

Add case for constant query
6 changes: 6 additions & 0 deletions packages/http-specs/spec-summary.md
Original file line number Diff line number Diff line change
Expand Up @@ -7545,6 +7545,12 @@ Expect to handle a boolean value. Mock api will return true

Expect to send a boolean value. Mock api expect to receive 'true'

### Type_Scalar_ConstantQuery_post

- Endpoint: `post /type/scalar/constant-query`

Expect to handle a constant value for query and mock api returns nothing

### Type_Scalar_Decimal128Type_requestBody

- Endpoint: `put /type/scalar/decimal128/resquest_body`
Expand Down
14 changes: 14 additions & 0 deletions packages/http-specs/specs/type/scalar/main.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -183,3 +183,17 @@ interface DecimalVerify extends NumberTypesVerifyOperations<decimal, "[0.1, 0.1,
@doc("Decimal128 type verification")
@route("/decimal128")
interface Decimal128Verify extends NumberTypesVerifyOperations<decimal, "[0.1, 0.1, 0.1]", "0.3"> {}

@doc("Constant query parameter verification")
@route("/constant-query")
interface ConstantQuery {
#suppress "@azure-tools/typespec-azure-core/use-standard-operations" "For testing"
@scenario
@scenarioDoc("Expect to handle a constant value for query and mock api returns nothing")
@post
@doc("post constant query value")
post(
@query
queryParam: "constantValue",
): void;
}
12 changes: 12 additions & 0 deletions packages/http-specs/specs/type/scalar/mockapi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,3 +197,15 @@ Scenarios.Type_Scalar_Decimal128Verify_verify = passOnSuccess({
},
kind: "MockApiDefinition",
});

Scenarios.Type_Scalar_ConstantQuery_post = passOnSuccess({
uri: "/type/scalar/constant-query",
method: `post`,
request: {
query: { queryParam: "constantValue" },
},
response: {
status: 204,
},
kind: "MockApiDefinition",
});
Loading