@stdy/cli 0.4.2 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +53 -9
  2. package/package.json +9 -9
package/README.md CHANGED
@@ -6,11 +6,17 @@ and generates responses from schemas or examples.
6
6
  ## Installation
7
7
 
8
8
  ```bash
9
- # npm (recommended)
9
+ # npm
10
10
  npm install -g @stdy/cli
11
11
 
12
- # Or with Deno
12
+ # npx (no install)
13
+ npx @stdy/cli api.yaml
14
+
15
+ # Deno
13
16
  deno install -gAn steady jsr:@steady/cli
17
+
18
+ # deno run (no install)
19
+ deno run -A jsr:@steady/cli api.yaml
14
20
  ```
15
21
 
16
22
  ## Usage
@@ -49,6 +55,11 @@ Options:
49
55
  --relaxed Log warnings but return responses anyway
50
56
  -h, --help Show help
51
57
 
58
+ Validator Options:
59
+ --validator-strict-oneof Require exactly one oneOf variant to match
60
+ --validator-query-array-format=<fmt> Array query param serialization (see below)
61
+ --validator-query-object-format=<fmt> Object query param serialization (see below)
62
+
52
63
  Generator Options:
53
64
  --generator-array-size=<n> Exact size for all generated arrays
54
65
  --generator-array-min=<n> Minimum array size (default: 1)
@@ -56,6 +67,34 @@ Generator Options:
56
67
  --generator-seed=<n> Seed for deterministic generation (-1 for random)
57
68
  ```
58
69
 
70
+ ### Query Parameter Serialization
71
+
72
+ Steady supports the full OpenAPI 3.x parameter serialization matrix. By default
73
+ (`auto`), Steady reads the `style` and `explode` properties from your OpenAPI
74
+ spec for each parameter. You can override this globally via CLI flags or
75
+ per-request via headers.
76
+
77
+ **Array formats** (`--validator-query-array-format`):
78
+
79
+ | Format | Example | OpenAPI Equivalent |
80
+ | ---------- | ----------------------------- | ------------------------------ |
81
+ | `auto` | Read from spec (default) | - |
82
+ | `repeat` | `colors=red&colors=green` | `style=form, explode=true` |
83
+ | `comma` | `colors=red,green,blue` | `style=form, explode=false` |
84
+ | `space` | `colors=red%20green%20blue` | `style=spaceDelimited` |
85
+ | `pipe` | `colors=red\|green\|blue` | `style=pipeDelimited` |
86
+ | `brackets` | `colors[]=red&colors[]=green` | PHP/Rails style (non-standard) |
87
+
88
+ **Object formats** (`--validator-query-object-format`):
89
+
90
+ | Format | Example | OpenAPI Equivalent |
91
+ | ------------ | ----------------------------------- | --------------------------- |
92
+ | `auto` | Read from spec (default) | - |
93
+ | `flat` | `role=admin&firstName=Alex` | `style=form, explode=true` |
94
+ | `flat-comma` | `id=role,admin,firstName,Alex` | `style=form, explode=false` |
95
+ | `brackets` | `id[role]=admin&id[firstName]=Alex` | `style=deepObject` |
96
+ | `dots` | `id.role=admin&id.firstName=Alex` | Non-standard (SDK compat) |
97
+
59
98
  ### Port Configuration
60
99
 
61
100
  The server port is determined in this order:
@@ -118,13 +157,15 @@ validation errors are logged but responses are still returned.
118
157
 
119
158
  Override server behavior for individual requests:
120
159
 
121
- | Header | Description |
122
- | --------------------- | ------------------------------------------------- |
123
- | `X-Steady-Mode` | Override validation mode: `strict` or `relaxed` |
124
- | `X-Steady-Array-Size` | Override array size (sets both min and max) |
125
- | `X-Steady-Array-Min` | Override minimum array size |
126
- | `X-Steady-Array-Max` | Override maximum array size |
127
- | `X-Steady-Seed` | Override random seed (`-1` for non-deterministic) |
160
+ | Header | Description |
161
+ | ------------------------------ | ------------------------------------------------- |
162
+ | `X-Steady-Mode` | Override validation mode: `strict` or `relaxed` |
163
+ | `X-Steady-Query-Array-Format` | Override array query param serialization format |
164
+ | `X-Steady-Query-Object-Format` | Override object query param serialization format |
165
+ | `X-Steady-Array-Size` | Override array size (sets both min and max) |
166
+ | `X-Steady-Array-Min` | Override minimum array size |
167
+ | `X-Steady-Array-Max` | Override maximum array size |
168
+ | `X-Steady-Seed` | Override random seed (`-1` for non-deterministic) |
128
169
 
129
170
  ```bash
130
171
  # Force strict validation
@@ -135,6 +176,9 @@ curl -H "X-Steady-Array-Size: 50" http://localhost:3000/users
135
176
 
136
177
  # Get random (non-deterministic) responses
137
178
  curl -H "X-Steady-Seed: -1" http://localhost:3000/users
179
+
180
+ # Override query format for SDK testing
181
+ curl -H "X-Steady-Query-Object-Format: dots" "http://localhost:3000/search?filter.level=high"
138
182
  ```
139
183
 
140
184
  ### Response Headers
package/package.json CHANGED
@@ -1,16 +1,16 @@
1
1
  {
2
2
  "name": "@stdy/cli",
3
- "version": "0.4.2",
3
+ "version": "0.5.0",
4
4
  "description": "OpenAPI 3 mock server. Validates SDKs against OpenAPI specs with clear error attribution.",
5
5
  "license": "Elastic-2.0",
6
6
  "repository": {
7
7
  "type": "git",
8
- "url": "git+https://github.com/stainless-api/steady.git"
8
+ "url": "git+https://github.com/dgellow/steady.git"
9
9
  },
10
10
  "bugs": {
11
- "url": "https://github.com/stainless-api/steady/issues"
11
+ "url": "https://github.com/dgellow/steady/issues"
12
12
  },
13
- "homepage": "https://github.com/stainless-api/steady#readme",
13
+ "homepage": "https://github.com/dgellow/steady#readme",
14
14
  "keywords": [
15
15
  "openapi",
16
16
  "mock-server",
@@ -29,10 +29,10 @@
29
29
  "node": ">=14.0.0"
30
30
  },
31
31
  "optionalDependencies": {
32
- "@stdy/cli-linux-x64": "0.4.2",
33
- "@stdy/cli-linux-arm64": "0.4.2",
34
- "@stdy/cli-darwin-x64": "0.4.2",
35
- "@stdy/cli-darwin-arm64": "0.4.2",
36
- "@stdy/cli-win32-x64": "0.4.2"
32
+ "@stdy/cli-linux-x64": "0.5.0",
33
+ "@stdy/cli-linux-arm64": "0.5.0",
34
+ "@stdy/cli-darwin-x64": "0.5.0",
35
+ "@stdy/cli-darwin-arm64": "0.5.0",
36
+ "@stdy/cli-win32-x64": "0.5.0"
37
37
  }
38
38
  }