Skip to content

Custom routes, not able to PUT data, requires using the original routes #802

@NoMan2000

Description

@NoMan2000

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.

See #801, #793, , #791, #755, etc., etc., etc.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions