You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If we have an API with these two paths, /avis/by_id_utilisateur-{id_utilisateur} and /avis/by_id_utilisateur-{id_utilisateur}_code_support-{code_support}
thus de verification will fail with an error Two path items have the same signature: /avis/by_id_utilisateur-{}.
This is because of wrong templates computed during the control process.
Analysis / Solution
After, an analysis of code, this template URL computation was made by a method that does a replace from a regex pattern.
...
public class PathsDiff {
private static final String REGEX_PATH = "\\{([^/]+)}";
...
private static String normalizePath(String path) {
return path.replaceAll(REGEX_PATH, "{}");
}
...
}
This pattern is wrong, we should have "\{([^/{}]+)}" to exclude "{" and "}" from detection.
I tested this pattern locally and it's ok for me with this last regex pattern.
If you want I can correct it. I will create a PR if nobody does it before me :p
Activity
[-]Path with several "{}" incorrectly parsed[/-][+]Path with several "{...}" incorrectly parsed[/+]fix OpenAPITools#358 - formatting code with fmt-maven-plugin
fix OpenAPITools#358 - correction of regex problem + tests
dedece35 commentedon Mar 29, 2022
you can see the PR : #359
Support multiple placeholders in resource path (#359)
dedece35 commentedon Jun 8, 2022
hello @joschi
thank you for your review and merge.
when do you think that there will be a new release ?
thank you.
best regards,
David