Skip to content

Fixed urls with complex URI Path Variables#728

Merged
graemerocher merged 1 commit intomicronaut-projects:masterfrom
altro3:fix_path_param_regex
May 24, 2022
Merged

Fixed urls with complex URI Path Variables#728
graemerocher merged 1 commit intomicronaut-projects:masterfrom
altro3:fix_path_param_regex

Conversation

@altro3
Copy link
Collaborator

@altro3 altro3 commented May 24, 2022

Fixed #601

@graemerocher
Copy link
Contributor

it feels like a bit of a slippery slope as you have written a mini regex parser in this commit 🤔

@altro3
Copy link
Collaborator Author

altro3 commented May 24, 2022

@graemerocher The problem is that micronaut does not allow access with parsed URL segments, so there are no other options. Now I can get the entire URL and a list of variable names, so I had to replace all expressions and special characters with the classic definition of variables like these:

{tagId: \\\\d+}  ---> {tagId}
{path:.*}{.ext}  ---> {path}
update{/id:[a-zA-Z]+} ---> update/{id}
{+path} ---> {path}

@altro3
Copy link
Collaborator Author

altro3 commented May 24, 2022

@graemerocher I don't even know how to do it more correctly, in the current conditions.

@graemerocher graemerocher added the type: improvement A minor improvement to an existing feature label May 24, 2022
@graemerocher graemerocher merged commit 35094bc into micronaut-projects:master May 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: improvement A minor improvement to an existing feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Path param with regex result in invalid openapi spec

2 participants