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
[v0.10] wildcard route ':country_id' conflicts with existing edges in path '/country/:country_id/edit' #159
Comments
By the way, I did try to figured it how to be fixed and I found it in radix_tree.go and I commented lines from 245 to 248, after that the problem gone. But, there is a conflict between I think radix_tree.go can't distinguish between 2 level and 3 level urls seperation! Is this a bug? |
@vzool aah router tells you have problem in route definitions, those lines (245 to 248) are required not to be commented. I will try to explain, problem is these two route definition (happening at same level; not level 2 or level 3)
For example: Request 1: http://localhost:8080/country/create Where it would send it to??? This is the problem router tells you. You need to thing about route URLs. I hope it helps. BTW, remove this line |
@jeevatkm Aha, I see. Request 1: should send to page that Show Create Form Ok, I will looking for a different naming to But, when I remove In fact, I felt it's a little strange to me at first time! |
@vzool I thought to give you a suggestion. Typically if you design Web and REST API together in one application. Following design approach works well and makes sense. Web:
REST API (if API application itself separate project, then
Controllers package structure -
So routes definition would look like -
I hope this would give a very good start point. |
@jeevatkm Thanks for your suggestions, it's helpful. In fact, I'm trying to implement a "Pyramid Hierarchy URL" for a situation like this:
or simply
So, the routes would be something like this:
But, I don't know how can I do that with current routing system! I think we need new routing system as an option to cover this area. What do you think? |
@vzool As far as my understanding, not only
So, no issues with currently routing system (FYI, aah uses radix tree implementation from this library https://github.com/julienschmidt/httprouter). I'm always looking for a ways to improve aah to give best framework experience. If you come across any library which supports above routes structure, please let me know. Surely I will learn and adapt that feature into PS: You may have to rethink your URL structure, that's why I gave you optimal URL design approach. |
@jeevatkm I feel that "Pyramid Hierarchy URL" looks and behave just like "BTree", as I think But, why the BTY, I found an interesting library can implement this new way, it's called Bone, and I really did a testing for it here. Funny picture used for the library, ha ha ha |
@jeevatkm While I'm testing it, it looks and behave really fast with ton of features. |
@vzool Thank you for your finding, I have a look and get back to you 😄 |
@vzool Seems like, your input gonna make aah much more flexible on routing system with multiple routing algorithms. I have created this issue #160 to do overhaul on aah routing system. I have scheduled it for I hope this plan works for you 😄 |
@jeevatkm Of course, I'm totally fine with that plan. |
Hi,
I'm trying to make a "Restful Web" and I followed the documentation to do these End-Points:
But I can't make it right, here is my routes:
And here is my controller:
What I did wrong?
Thanks
The text was updated successfully, but these errors were encountered: