fix: make service config optional in API design#325
Conversation
Remove config from Required fields in the Goa DSL and add omitempty to the JSON tag. The custom validation layer already handles nil configs with sensible defaults, but the generated validation was rejecting requests before custom parsing could run. Normalize nil config to an empty map in the API conversion layer so downstream code never needs nil checks.
📝 WalkthroughWalkthroughMade the Changes
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 0 |
| Duplication | 0 |
TIP This summary will be updated as you push new changes. Give us feedback
Summary
configfrom required fields in the Goa service spec DSLomitemptyto the config JSON tag so responses omit empty configsmap[string]any{}in the API-to-domain conversion layerTest plan
make testpassesconfigfield — should use defaultsconfigfield — should use defaultsconfigfield — should return validation error (pipelines required)configstill work as beforePLAT-530