microsoft / microsoft/typespec

[http-spector] Question on `withServiceKeys` usage

Open
#8,460 2 comments 0 reactions 0 assignees View on GitHub
feature spector triaged:core
Dominant language
Java
Stars
5.9k
Forks
394
Avg merge
1d 23h
Merged PRs (30d)
104

Description

Our use case is such:
We have a scenario, which contains multiple endpoints:
- endpoint1
- endpoint2
- endpoint3
- endpoint4

We want a certain set of endpoints to be called in order to consider this scenario pass, e.g. endpoint1 & endpoint3, or endpoint2 & endpoint 4.

How do we express this in Spector?

I tried `withServiceKeys`, e.g.
```typescript
Scenarios.MyScenario = withServiceKeys([
"keyA",
"keyB"
]).pass([
{
uri: endpoint1,
pass: keyA
},
{
uri: endpoint2,
pass: keyA
},
{
uri: endpoint3,
pass: keyB
},
{
uri: endpoint4,
pass: keyB
},
])
```
Though it seems `withServiceKeys` require all endpoints to return both keyA and keyB..

I also tried to set the endpoint as a regex, though it seems we only support string for endpoint uri.

How do we express this?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.