You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor: Drive OpenApiServer from a list of SpecBinding
The constructor now takes List<SpecBinding> instead of Spec; the Builder
synthesises a single-element list so the public API is unchanged.
HandlerConfig drops the handlers and securityValidators fields (moved to
SpecBinding). The not-found catch-all context is registered only when no
binding has a root base path.
Copy file name to clipboardExpand all lines: docs/superpowers/plans/2026-05-22-multiple-specs.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -111,7 +111,7 @@ git commit -m "refactor: Add SpecBinding record for per-spec server state"
111
111
112
112
The goal here is purely structural: the constructor stops taking a `Spec` and instead takes `List<SpecBinding>`. The Builder still produces a list of size 1. No public API change yet.
113
113
114
-
-[]**Step 1: Update `OpenApiServer` constructor signature and body**
114
+
-[x]**Step 1: Update `OpenApiServer` constructor signature and body**
115
115
116
116
Replace the constructor (currently lines 73–157) with a version that loops over bindings:
117
117
@@ -207,7 +207,7 @@ OpenApiServer(
207
207
}
208
208
```
209
209
210
-
-[]**Step 2: Drop the now-unused `handlers` field from `HandlerConfig`**
210
+
-[x]**Step 2: Drop the now-unused `handlers` field from `HandlerConfig`**
211
211
212
212
In `OpenApiServer.java`, change the `HandlerConfig` record to remove `handlers` (it's per-binding now):
213
213
@@ -223,7 +223,7 @@ record HandlerConfig(
223
223
224
224
Also drop the per-binding `securityValidators` from `HandlerConfig` (they live on each `SpecBinding` now). Update every callsite of `HandlerConfig` accordingly.
225
225
226
-
-[]**Step 3: Update `Builder.build()` to construct one binding and pass `List.of(binding)`**
226
+
-[x]**Step 3: Update `Builder.build()` to construct one binding and pass `List.of(binding)`**
227
227
228
228
In `Builder.build()` (currently lines 364–402), replace the construction of `HandlerConfig` and the call to `new OpenApiServer(...)` with:
229
229
@@ -268,17 +268,17 @@ public OpenApiServer build() throws IOException {
268
268
}
269
269
```
270
270
271
-
-[]**Step 4: Run the full unit test suite**
271
+
-[x]**Step 4: Run the full unit test suite**
272
272
273
273
Run: `mvn -q test`
274
274
Expected: BUILD SUCCESS. All 440 existing tests pass with no edits. (If anything fails, it's a refactoring mistake — fix before moving on.)
0 commit comments