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

Generated Lumen code can contain dots in routes #6897

Closed
philip opened this issue Nov 7, 2017 · 7 comments
Closed

Generated Lumen code can contain dots in routes #6897

philip opened this issue Nov 7, 2017 · 7 comments

Comments

@philip
Copy link

philip commented Nov 7, 2017

Lumen does not allow . in routes. The generator allows them without warning. Dots in URLs are common though, for example /api/v1.1/, but Lumen insists on not allowing them.

Confirmation about dots being disallowed in routes: laravel/framework#6180

@wing328
Copy link
Contributor

wing328 commented Nov 8, 2017

@philip yes, we should be able to fix it easily in the postProcessOperations.

Is that something you can contribute? If yes, I can show you a good starting point.

@wing328 wing328 added this to the v2.3.0 milestone Nov 8, 2017
@philip
Copy link
Author

philip commented Nov 8, 2017

@wing328 I'm interested, all pointers are welcome. Also, thoughts on what to do here e.g., replace them with something, fail, or allow this to be configured somehow.

@wing328
Copy link
Contributor

wing328 commented Nov 13, 2017

My take is to throw an exception as it's something not supported by Lumen.

As you mentioned we can replace it with something else but still the clients (PHP, Python, etc) generated from the spec expect the . in the path.

Please refer to https://github.com/swagger-api/swagger-codegen/blob/master/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/FinchServerCodegen.java#L210 on how we loop through all the path in postProcessOperations

@philip
Copy link
Author

philip commented Nov 15, 2017

@win328 I remember testing paths with dots and they failed, and removing the dots caused it all to work. However now I can't replicate this so am baffled and confused. Tested Lumen 5.2, 5.4, and 5.5. I switched to codegen on docker but don't understand how that'd change things.

On the bright side the lumen generator is working for my use case so I hope to expand its general usage and functionality. Although I fear this bug will make a comeback but we'll see.

Related, using Lumen 5.5 required other code updates but considering 5.5 is LTS I think it might be worth it.

@wing328
Copy link
Contributor

wing328 commented Nov 15, 2017

@philip that's ok. We'll open this if any reports similar issue.

I've created #6963 to track the Lumen version upgrade.

@wing328
Copy link
Contributor

wing328 commented Nov 17, 2017

FYI. I've filed #6986 to throw an exception if dot is found in the path.

@chrillep
Copy link

chrillep commented Sep 23, 2021

same goes for laravel.
Caused by: java.lang.IllegalArgumentException: '.' (dot) is not supported by PHP laravel.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants