Skip to content
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

fix(core): Replace special characters with a post processing step (#78) #84

Merged

Conversation

nandorholozsnyak
Copy link
Member

@nandorholozsnyak nandorholozsnyak commented Jul 13, 2023

  • Markup language related special characters are being replaced
  • Domain specific classes got some rework

Closes #78

- Markup language related special characters are being replaced
- Domain specific classes got some rework
@nandorholozsnyak nandorholozsnyak self-assigned this Jul 13, 2023
@nandorholozsnyak nandorholozsnyak force-pushed the bugfix/spring-configuration-property-documenter-78 branch from bfae39c to ee4b43c Compare July 13, 2023 18:21
Copy link

@Lindenson Lindenson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add this PostProcessor to the list:

    public PropertyGroupFilterService() {
        this(List.of(
            new UnknownGroupRemovalPostProcessor(),
            new IncludeExcludeGroupPostProcessor(),
            new IncludeExcludePropertyPostProcessor(),
            new EmptyGroupRemovalPostProcessor(),
            new UnknownGroupRenamePostProcessor(),
            new SpecialCharacterPostProcessor()
        ));
    }

Also this is not null safe (please change the code by adding if (Objects.nonNull...):

    private void replaceSpecialCharacters(Property property, Map<String, String> specialCharacterMap) {
        specialCharacterMap.forEach((character, replacement) -> {
            if (Objects.nonNull(property.getDescription()))
                property.setDescription(property.getDescription().replace(character, replacement));
            if (Objects.nonNull(property.getDefaultValue())) 
                property.setDefaultValue(property.getDefaultValue().replace(character, replacement));
        });
    }

@nandorholozsnyak
Copy link
Member Author

Thank you @Lindenson for the comment. I'll be finishing this PR soon.

- toString changes
- Now some classes are havin NonNull and Nullable annotations
- Tests passes again.
@nandorholozsnyak nandorholozsnyak merged commit 02c0d0f into master Sep 9, 2023
2 checks passed
@nandorholozsnyak nandorholozsnyak deleted the bugfix/spring-configuration-property-documenter-78 branch September 10, 2023 20:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Replace special characters with a post processing step
2 participants