[cmd/mdatagen]Allow custom mapstructure tags for generated config struct fields#15157
[cmd/mdatagen]Allow custom mapstructure tags for generated config struct fields#15157jkoronaAtCisco wants to merge 1 commit intoopen-telemetry:mainfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #15157 +/- ##
==========================================
- Coverage 91.31% 91.31% -0.01%
==========================================
Files 699 699
Lines 44939 44942 +3
==========================================
+ Hits 41036 41037 +1
- Misses 2759 2760 +1
- Partials 1144 1145 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
This is not an intuitive user interface. We should not require any mapstructure tag customization for a simple grouping. I'd imagine this to be handled by something like this |
@dmitryax type Config struct {
Protocols Protocols `mapstructure:"protocols"`
}but what we need to achieve is: type Config struct {
Protocols `mapstructure:"protocols"`
}(This is real example from OTLP receiver component config) So it's kind of mix:
This is currently not possible with config schemas and mdatagen. |
this seems wrong to me. I've created #15178 to address that |
|
This issue will be solved in the other way, as described #15155 (comment) |
Description
mapstructure:",squash"and properties use the property name — no change to existing behavior.mapstructure:"protocols") rather than squashed.Example:
Link to tracking issue
Fixes #15155
Testing
Covered change with corresponding unit tests