Skip to content

Remove duplicate elements from final OpenApi object. #1212

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

Merged
merged 1 commit into from
Sep 20, 2023

Conversation

altro3
Copy link
Collaborator

@altro3 altro3 commented Sep 17, 2023

Fixed #1204

@altro3 altro3 requested a review from graemerocher September 17, 2023 10:20

openApi = resolvePropertyPlaceHolders(openApi, context);

return openApi;
}

private <T> List<T> findAndRemoveDuplicates(List<T> elements, BiPredicate<T, T> predicate) {
Copy link
Contributor

Choose a reason for hiding this comment

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

would this not be better written with elements.stream().distinct() or elements.stream().filter(..)?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@graemerocher Not for everyone... Personally, I try not to use streams because of their slowness and the creation of a bunch of additional objects. Yes, it is more convenient in terms of syntax, but always worse in performance

@sdelamo sdelamo merged commit 79b0dc2 into micronaut-projects:master Sep 20, 2023
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.

Duplicated server when generating the openapi file in a custom folder
3 participants