contributte / apitte

:wrench: An opinionated and enjoyable API framework based on Nette Framework. Supporting content negotiation, debugging, middlewares, attributes, annotations and loving openapi/swagger.
https://contributte.org/packages/contributte/apitte/
MIT License
61 stars 36 forks source link

Improve routing - regular expressions #70

Closed mabar closed 4 years ago

mabar commented 5 years ago

Question is how matching should exactly act. Route contains {id \d+}, so should string_id cause error like datatype is defined in @RequestParameter or should not match? (First variant is preferred by me)

mabar commented 5 years ago

Seems like slashes in identifiers could be huge problem. Also, we need to be compatible with openapi. See that discussion for more info, people noted there some important things.

Regex for parameters will be implemented as @RequestParameter(name="id", type="string", pattern="^\d{3}-\d{2}-\d{4}$"), to be compatible with openapi