-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mapper: Comments on fields of bean types #18
Comments
Yeah this should be supported |
If you have any good use cases, please post them. Definitely one of the bigger things missing, I'd just like to have some good examples to think about how this feature would look in detail |
I think @gamerover98 might have some specific examples |
Hello, this is a piece of my configuration where I've used the bean implementation: TeamProperty class:
BeanPropertyType implementation:
In addition, I've implemented it into a SettingsManager class with a property array:
This is the result:
I want to add comments like:
Thank you for asking |
Heard anything? 😌 |
This is really good input, thanks. The reason I tend to forget about this issue is that I'm still unclear on how we'd handle multiple entries in the array. |
I've been thinking about this a lot, and I think it would be interesting to be able to define comments based on the property values. This would be helpful for #132, but also here. Before exporting, some method could be called that collects |
- Missing new tests & adaptions of existing tests - Comments on map values currently breaks the export
- Draft version of exporting properties as SnakeYAML nodes (allows to specify comments) - Current state still has many open points
- Fix issues with new lines - Remove unused code
- Restructure logic, revise Javadoc - Still missing a lot of tests
- Introduce SnakeYamlNodeBuilder to create nodes for every export value - Properties can return ValueWithComments to specify comments on the fly - Missing tests and ability to not repeat a comment in a bean
Breaking changesYou should not be affected by any breaking changes if you are using ConfigMe "normally" and not overriding/implementing classes like YamlFileResource. Otherwise, please read on. Note that further breaking changes may be introduced with ConfigMe 2.0, so if you don't need any of the new features of ConfigMe 1.4, consider updating from 1.3 to 2.0 directly once it is out. Breaking changes:
If these changes cause issues for you (because you are overriding YamlFileResource or otherwise relying on these classes), please open a new issue to get assistance. |
Should we support
@Comment
on bean fields? This might be difficult since we don't always have a direct path (maps with unknown keys) and the comment would be present for each entry.The text was updated successfully, but these errors were encountered: