Skip to content

Conversation

@kosenko-dev
Copy link

…in case of they can not be distributed from the framework (like okhttp, etc.)

…n case of they can not be distributed from the framework (like okhttp, etc.)
Map<String, String> extractedPathParams = new AntPathMatcher()
.extractUriTemplateVariables(keyOptional.get().getPath(), key.getPath());
if (!extractedPathParams.isEmpty()) {
List<String> existedPathParametersNames = value.getParameters().stream()

Choose a reason for hiding this comment

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

I've tried your fix, and it works great! However, in my case, I encountered a NullPointerException on value.getParameters().stream().

Perhaps we could handle it like this:

List<Parameter> existedPathParameters = (value.getParameters() != null) 
    ? value.getParameters() 
    : new ArrayList<>();

List<String> existedPathParametersNames = existedPathParameters.stream()
    .filter(parameter -> parameter.getIn().equals("path"))
    .map(parameter -> parameter.getName())
    .collect(Collectors.toList());

Looking forward to seeing your PR accepted soon!

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.

2 participants