Commit e3f2ea8
fix: Refactor NettyServerConfig to use MessageCodecFactory directly (#4134)
## Summary
- Change `NettyServerConfig` to store `MessageCodecFactory` instead of
`PartialFunction`
- Add `codecFactory` getter that ensures `withMapOutput` is applied for
JSON serialization
- Update `NettyResponseHandler` to accept `MessageCodecFactory` directly
- Centralize codec factory creation to avoid duplication between
response handler and request dispatcher
This follows the suggestion from Gemini code review on #4132 to pass
`MessageCodecFactory` directly instead of `PartialFunction`, improving
maintainability by making the codec dependency more explicit.
## Test plan
- [x] Compile netty module
- [ ] CI tests pass
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>1 parent 58b28c9 commit e3f2ea8
File tree
2 files changed
+19
-15
lines changed- airframe-http-netty/src/main/scala/wvlet/airframe/http/netty
2 files changed
+19
-15
lines changedLines changed: 3 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
26 | | - | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
27 | 28 | | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | 29 | | |
33 | 30 | | |
34 | 31 | | |
| |||
Lines changed: 16 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
| 55 | + | |
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
67 | 72 | | |
68 | 73 | | |
69 | 74 | | |
| |||
92 | 97 | | |
93 | 98 | | |
94 | 99 | | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
95 | 104 | | |
96 | | - | |
| 105 | + | |
97 | 106 | | |
| 107 | + | |
98 | 108 | | |
99 | | - | |
100 | | - | |
101 | | - | |
| 109 | + | |
102 | 110 | | |
103 | 111 | | |
104 | 112 | | |
| |||
140 | 148 | | |
141 | 149 | | |
142 | 150 | | |
143 | | - | |
| 151 | + | |
144 | 152 | | |
145 | 153 | | |
146 | 154 | | |
| |||
235 | 243 | | |
236 | 244 | | |
237 | 245 | | |
238 | | - | |
239 | | - | |
240 | | - | |
| 246 | + | |
| 247 | + | |
241 | 248 | | |
242 | 249 | | |
243 | 250 | | |
| |||
0 commit comments