Conversation
Transitions Dart generation from sidekickconfig.Config to parser.ModelConfig. Replaces toSidekickConfig with toModelConfig and updates the generator signatures to accept the codec map directly.
There was a problem hiding this comment.
Code Review
This pull request refactors the Dart generation logic to use parser.ModelConfig instead of sidekickconfig.Config. The changes are clean, consistent, and improve decoupling by reducing dependencies on the larger configuration structure. I've suggested one minor improvement to respect the SpecificationFormat from the library configuration instead of hardcoding it.
| modelConfig := parser.ModelConfig{ | ||
| SpecificationFormat: "protobuf", | ||
| ServiceConfig: api.ServiceConfig, | ||
| SpecificationSource: ch.Path, | ||
| Source: src, | ||
| Codec: buildCodec(library), | ||
| } |
There was a problem hiding this comment.
The SpecificationFormat is currently hardcoded to "protobuf". It would be better to respect the SpecificationFormat field from the library config, which allows for other formats like "discovery". The default can remain "protobuf" if the field is not set.
| modelConfig := parser.ModelConfig{ | |
| SpecificationFormat: "protobuf", | |
| ServiceConfig: api.ServiceConfig, | |
| SpecificationSource: ch.Path, | |
| Source: src, | |
| Codec: buildCodec(library), | |
| } | |
| specFormat := library.SpecificationFormat | |
| if specFormat == "" { | |
| specFormat = "protobuf" | |
| } | |
| modelConfig := parser.ModelConfig{ | |
| SpecificationFormat: specFormat, | |
| ServiceConfig: api.ServiceConfig, | |
| SpecificationSource: ch.Path, | |
| Source: src, | |
| Codec: buildCodec(library), | |
| } |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3947 +/- ##
=======================================
Coverage 83.35% 83.35%
=======================================
Files 69 69
Lines 6188 6188
=======================================
Hits 5158 5158
Misses 671 671
Partials 359 359 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Transitions Dart generation from sidekickconfig.Config to parser.ModelConfig
Part of #3662