-
-
Notifications
You must be signed in to change notification settings - Fork 7.3k
Open
Description
Adding in a custom route breaks the behavior.
Custom route:
"/api/rule_templates/:name": "/ruleTemplates?name=:name&singular=1&noerror=1",
This uses the name as a lookup, returns a single object instead of an array of objects, and does not throw a 404, instead gives a 200 with an empty object if nothing is found.
Problem: This breaks PUT, POST, DELETE, and PATCH operations. They will never hit the route /ruleTemplates/:name, they will always hit /ruleTemplates?name.
Proposed solution: It would take some time to implement, but add a two level json structure:
{
"/api/rule_templates/:name": {
"GET": "/ruleTemplates?name=:name&singular=1&noerror=1",
"POST": "/ruleTemplates/:name",
"PUT": "/ruleTemplates/:name",
"PATCH": "/ruleTemplates/:name"
}
}This would close out several of the issues.
julaudo, cooperka, ToledoNicola and sharjeel-jan
Metadata
Metadata
Assignees
Labels
No labels