Advertisement
jambtc

swagger.json openapi json spec

Nov 30th, 2020
1,042
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JSON 34.14 KB | None | 0 0
  1. {
  2.   "definitions": {
  3.     "Event": {
  4.       "description": "A Merchant Event trigger",
  5.       "example": {
  6.         "cart_id": "9roj8f70TUEU",
  7.         "client_address": "0xab96032f5a7Efe3F95622c5B9D98D50F96a91756",
  8.         "items": [
  9.           {
  10.             "product_id": "1",
  11.             "product_name": "product_1",
  12.             "product_price": 5.0
  13.           }
  14.         ],
  15.         "merchant_id": "1234",
  16.         "total_items": 3,
  17.         "total_price": 15
  18.       },
  19.       "title": "Event",
  20.       "type": "object"
  21.     },
  22.     "EventRequest": {
  23.       "description": "POST body for trigger events",
  24.       "properties": {
  25.         "event": {
  26.           "$ref": "#/definitions/Event",
  27.           "description": "Event Trigger"
  28.         }
  29.       },
  30.       "title": "EventRequest",
  31.       "type": "object"
  32.     },
  33.     "EventResponse": {
  34.       "description": "Response for trigger event",
  35.       "properties": {
  36.         "data": {
  37.           "$ref": "#/definitions/Event",
  38.           "description": "The Trigger event"
  39.         }
  40.       },
  41.       "title": "EventResponse",
  42.       "type": "object"
  43.     },
  44.     "Group": {
  45.       "description": "A Merchant Rule Group",
  46.       "example": {
  47.         "description": "some description",
  48.         "merchant_id": "1234",
  49.         "name": "some name",
  50.         "priority": 10,
  51.         "rules": [
  52.           "test"
  53.         ],
  54.         "type": "unit_rule_group"
  55.       },
  56.       "properties": {
  57.         "description": {
  58.           "description": "Group description",
  59.           "type": "string"
  60.         },
  61.         "merchant_id": {
  62.           "description": "Merchant ID",
  63.           "type": "string"
  64.         },
  65.         "name": {
  66.           "description": "Group name",
  67.           "type": "string"
  68.         },
  69.         "priority": {
  70.           "description": "Group priority",
  71.           "type": "integer"
  72.         },
  73.         "rules": {
  74.           "description": "Rules list",
  75.           "type": "array"
  76.         },
  77.         "type": {
  78.           "description": "Group Rule Type",
  79.           "type": "string"
  80.         }
  81.       },
  82.       "required": [
  83.         "type",
  84.         "merchant_id",
  85.         "priority",
  86.         "rules",
  87.         "name"
  88.       ],
  89.       "title": "Groups",
  90.       "type": "object"
  91.     },
  92.     "GroupRequest": {
  93.       "description": "POST body for creating a group",
  94.       "properties": {
  95.         "group": {
  96.           "$ref": "#/definitions/Group",
  97.           "description": "The group rule details"
  98.         }
  99.       },
  100.       "title": "GroupRequest",
  101.       "type": "object"
  102.     },
  103.     "GroupResponse": {
  104.       "description": "Response schema for single group rule",
  105.       "properties": {
  106.         "group": {
  107.           "$ref": "#/definitions/Group",
  108.           "description": "The group rule details"
  109.         }
  110.       },
  111.       "title": "GroupResponse",
  112.       "type": "object"
  113.     },
  114.     "GroupsResponse": {
  115.       "description": "Response schema for multiple group rule",
  116.       "properties": {
  117.         "group": {
  118.           "description": "The group rule details",
  119.           "items": {
  120.             "$ref": "#/definitions/Group"
  121.           },
  122.           "type": "array"
  123.         }
  124.       },
  125.       "title": "GroupsReponse",
  126.       "type": "object"
  127.     },
  128.     "Rule": {
  129.       "description": "A Merchant Rule",
  130.       "example": {
  131.         "actions": [
  132.           "alarm"
  133.         ],
  134.         "condition": {
  135.           "Operation": "eq",
  136.           "key": "price",
  137.           "value": "1"
  138.         },
  139.         "description": "some updated description",
  140.         "merchant_id": "1234",
  141.         "name": "test",
  142.         "priority": 43
  143.       },
  144.       "properties": {
  145.         "actions": {
  146.           "description": "Rule Action",
  147.           "type": "array"
  148.         },
  149.         "condition": {
  150.           "description": "Rule trigger condition",
  151.           "type": "map"
  152.         },
  153.         "description": {
  154.           "description": "Rule description",
  155.           "type": "string"
  156.         },
  157.         "merchant_id": {
  158.           "description": "Merchant ID",
  159.           "type": "string"
  160.         },
  161.         "name": {
  162.           "description": "Rule name",
  163.           "type": "string"
  164.         },
  165.         "priority": {
  166.           "description": "Rule priority",
  167.           "type": "integer"
  168.         }
  169.       },
  170.       "required": [
  171.         "condition",
  172.         "merchant_id",
  173.         "priority",
  174.         "actions",
  175.         "name"
  176.       ],
  177.       "title": "Rules",
  178.       "type": "object"
  179.     },
  180.     "RuleRequest": {
  181.       "description": "POST body for creating a rule",
  182.       "properties": {
  183.         "rule": {
  184.           "$ref": "#/definitions/Rule",
  185.           "description": "The rule details"
  186.         }
  187.       },
  188.       "title": "RuleRequest",
  189.       "type": "object"
  190.     },
  191.     "RuleResponse": {
  192.       "description": "Response schema for single rule",
  193.       "properties": {
  194.         "rule": {
  195.           "$ref": "#/definitions/Rule",
  196.           "description": "The rule details"
  197.         }
  198.       },
  199.       "title": "RuleResponse",
  200.       "type": "object"
  201.     },
  202.     "RulesResponse": {
  203.       "description": "Response schema for multiple rules",
  204.       "properties": {
  205.         "rule": {
  206.           "description": "The rule details",
  207.           "items": {
  208.             "$ref": "#/definitions/Rule"
  209.           },
  210.           "type": "array"
  211.         }
  212.       },
  213.       "title": "RulesReponse",
  214.       "type": "object"
  215.     },
  216.     "Set": {
  217.       "description": "A Merchant Rule Set",
  218.       "example": {
  219.         "merchant_id": "1234",
  220.         "rules": [
  221.           "test"
  222.         ],
  223.         "type": "skip_on_first_applied_rule"
  224.       },
  225.       "properties": {
  226.         "merchant_id": {
  227.           "description": "Merchant ID",
  228.           "type": "string"
  229.         },
  230.         "rules": {
  231.           "description": "Rules and Groups",
  232.           "type": "array"
  233.         },
  234.         "type": {
  235.           "description": "Rule Set Type",
  236.           "type": "string"
  237.         }
  238.       },
  239.       "required": [
  240.         "rules",
  241.         "merchant_id"
  242.       ],
  243.       "title": "Sets",
  244.       "type": "object"
  245.     },
  246.     "SetRequest": {
  247.       "description": "POST body for creating a rule set",
  248.       "properties": {
  249.         "set": {
  250.           "$ref": "#/definitions/Set",
  251.           "description": "The rule set details"
  252.         }
  253.       },
  254.       "title": "SetRequest",
  255.       "type": "object"
  256.     },
  257.     "SetResponse": {
  258.       "description": "Response schema for single rule set",
  259.       "properties": {
  260.         "set": {
  261.           "$ref": "#/definitions/Set",
  262.           "description": "The rule set details"
  263.         }
  264.       },
  265.       "title": "SetResponse",
  266.       "type": "object"
  267.     },
  268.     "SetsResponse": {
  269.       "description": "Response schema for multiple rule set",
  270.       "properties": {
  271.         "set": {
  272.           "description": "The rule sets details",
  273.           "items": {
  274.             "$ref": "#/definitions/Set"
  275.           },
  276.           "type": "array"
  277.         }
  278.       },
  279.       "title": "SetsReponse",
  280.       "type": "object"
  281.     }
  282.   },
  283.   "host": "localhost:4000",
  284.   "info": {
  285.     "title": "Fidelity Rule Engine",
  286.     "version": "1.0"
  287.   },
  288.   "paths": {
  289.     "/api/v1/event": {
  290.       "post": {
  291.         "consumes": [
  292.           "application/json"
  293.         ],
  294.         "description": "Tiggers Rule engine with request payload",
  295.         "operationId": "FidelityRulexWeb.Api.V1.EventController.create",
  296.         "parameters": [
  297.           {
  298.             "description": "Fidelity Rule Engine Merchant ID",
  299.             "in": "header",
  300.             "name": "x-fre-origin",
  301.             "required": true,
  302.             "type": "string"
  303.           },
  304.           {
  305.             "description": "The Event body",
  306.             "in": "body",
  307.             "name": "event",
  308.             "required": false,
  309.             "schema": {
  310.               "$ref": "#/definitions/EventRequest"
  311.             },
  312.             "x-example": {
  313.               "cart_id": "9roj8f70TUEU",
  314.               "client_address": "0xab96032f5a7Efe3F95622c5B9D98D50F96a91756",
  315.               "items": [
  316.                 {
  317.                   "product_id": "1",
  318.                   "product_name": "product_1",
  319.                   "product_price": 5.0
  320.                 }
  321.               ],
  322.               "merchant_id": "1234",
  323.               "total_items": 3,
  324.               "total_price": 15
  325.             }
  326.           }
  327.         ],
  328.         "produces": [
  329.           "application/json"
  330.         ],
  331.         "responses": {
  332.           "201": {
  333.             "description": "Event POST OK",
  334.             "examples": {
  335.               "application/json": {
  336.                 "event": {
  337.                   "group": {
  338.                     "total_price_eq": [
  339.                       "ok"
  340.                     ]
  341.                   }
  342.                 }
  343.               }
  344.             },
  345.             "schema": {
  346.               "$ref": "#/definitions/EventResponse"
  347.             }
  348.           },
  349.           "422": {
  350.             "description": "Unprocessable Entity",
  351.             "examples": {
  352.               "application/json": {
  353.                 "errors": {
  354.                   "detail": "Event not valid, check header combination for merchant_id Parameter"
  355.                 }
  356.               }
  357.             },
  358.             "schema": {
  359.               "$ref": "#/definitions/EventResponse"
  360.             }
  361.           }
  362.         },
  363.         "summary": "POST Event Trigger",
  364.         "tags": [
  365.           "Event"
  366.         ]
  367.       }
  368.     },
  369.     "/api/v1/groups": {
  370.       "get": {
  371.         "deprecated": false,
  372.         "description": "List all group rules in the database",
  373.         "operationId": "FidelityRulexWeb.Api.V1.GroupController.index",
  374.         "parameters": [
  375.           {
  376.             "description": "Fidelity Rule Engine Merchant ID",
  377.             "in": "header",
  378.             "name": "x-fre-origin",
  379.             "required": true,
  380.             "type": "string"
  381.           }
  382.         ],
  383.         "produces": [
  384.           "application/json"
  385.         ],
  386.         "responses": {
  387.           "200": {
  388.             "description": "OK",
  389.             "examples": {
  390.               "application/json": {
  391.                 "group": [
  392.                   {
  393.                     "description": "some description",
  394.                     "id": 1,
  395.                     "merchant_id": "1234",
  396.                     "name": "some name",
  397.                     "priority": 10,
  398.                     "rules": [
  399.                       "test"
  400.                     ],
  401.                     "type": "unit_rule_group"
  402.                   },
  403.                   {
  404.                     "description": "some description",
  405.                     "id": 2,
  406.                     "merchant_id": "1234",
  407.                     "name": "some name",
  408.                     "priority": 10,
  409.                     "rules": [
  410.                       "test"
  411.                     ],
  412.                     "type": "unit_rule_group"
  413.                   }
  414.                 ]
  415.               }
  416.             },
  417.             "schema": {
  418.               "$ref": "#/definitions/GroupsResponse"
  419.             }
  420.           }
  421.         },
  422.         "summary": "List group rules",
  423.         "tags": [
  424.           "Group"
  425.         ]
  426.       },
  427.       "post": {
  428.         "consumes": [
  429.           "application/json"
  430.         ],
  431.         "description": "Creates a new Merchant group rule",
  432.         "operationId": "FidelityRulexWeb.Api.V1.GroupController.create",
  433.         "parameters": [
  434.           {
  435.             "description": "Fidelity Rule Engine Merchant ID",
  436.             "in": "header",
  437.             "name": "x-fre-origin",
  438.             "required": true,
  439.             "type": "string"
  440.           },
  441.           {
  442.             "description": "The group rule details",
  443.             "in": "body",
  444.             "name": "group",
  445.             "required": false,
  446.             "schema": {
  447.               "$ref": "#/definitions/GroupRequest"
  448.             },
  449.             "x-example": {
  450.               "group": {
  451.                 "description": "some description",
  452.                 "merchant_id": "1234",
  453.                 "name": "some name",
  454.                 "priority": 10,
  455.                 "rules": [
  456.                   "test"
  457.                 ],
  458.                 "type": "unit_rule_group"
  459.               }
  460.             }
  461.           }
  462.         ],
  463.         "produces": [
  464.           "application/json"
  465.         ],
  466.         "responses": {
  467.           "201": {
  468.             "description": "Group Rule created OK",
  469.             "examples": {
  470.               "application/json": {
  471.                 "group": {
  472.                   "description": "some description",
  473.                   "id": 1,
  474.                   "merchant_id": "1234",
  475.                   "name": "some name",
  476.                   "priority": 10,
  477.                   "rules": [
  478.                     "test"
  479.                   ],
  480.                   "type": "unit_rule_group"
  481.                 }
  482.               }
  483.             },
  484.             "schema": {
  485.               "$ref": "#/definitions/GroupResponse"
  486.             }
  487.           },
  488.           "422": {
  489.             "description": "Unprocessable Entity",
  490.             "examples": {
  491.               "application/json": {
  492.                 "errors": {
  493.                   "rules": [
  494.                     "One of the rule does not exist"
  495.                   ]
  496.                 }
  497.               }
  498.             },
  499.             "schema": {
  500.               "$ref": "#/definitions/GroupResponse"
  501.             }
  502.           }
  503.         },
  504.         "summary": "Create Merchant group rule",
  505.         "tags": [
  506.           "Group"
  507.         ]
  508.       }
  509.     },
  510.     "/api/v1/groups/{id}": {
  511.       "delete": {
  512.         "description": "Delete a Merchant_id group rule by ID",
  513.         "operationId": "FidelityRulexWeb.Api.V1.GroupController.delete",
  514.         "parameters": [
  515.           {
  516.             "description": "Fidelity Rule Engine Merchant ID",
  517.             "in": "header",
  518.             "name": "x-fre-origin",
  519.             "required": true,
  520.             "type": "string"
  521.           },
  522.           {
  523.             "description": "Group Rule ID",
  524.             "in": "path",
  525.             "name": "id",
  526.             "required": true,
  527.             "type": "integer",
  528.             "x-example": 3
  529.           }
  530.         ],
  531.         "responses": {
  532.           "204": {
  533.             "description": "No Content - Deleted Successfully"
  534.           }
  535.         },
  536.         "summary": "Delete Merchant_Id group rule",
  537.         "tags": [
  538.           "Group"
  539.         ]
  540.       },
  541.       "get": {
  542.         "description": "Show a group rule by ID",
  543.         "operationId": "FidelityRulexWeb.Api.V1.GroupController.show",
  544.         "parameters": [
  545.           {
  546.             "description": "Fidelity Rule Engine Merchant ID",
  547.             "in": "header",
  548.             "name": "x-fre-origin",
  549.             "required": true,
  550.             "type": "string"
  551.           },
  552.           {
  553.             "description": "Group Rule ID",
  554.             "in": "path",
  555.             "name": "id",
  556.             "required": true,
  557.             "type": "integer",
  558.             "x-example": 123
  559.           }
  560.         ],
  561.         "produces": [
  562.           "application/json"
  563.         ],
  564.         "responses": {
  565.           "200": {
  566.             "description": "OK",
  567.             "examples": {
  568.               "application/json": {
  569.                 "group": {
  570.                   "description": "some description",
  571.                   "id": 1,
  572.                   "merchant_id": "1234",
  573.                   "name": "some name",
  574.                   "priority": 10,
  575.                   "rules": [
  576.                     "test"
  577.                   ],
  578.                   "type": "unit_rule_group"
  579.                 }
  580.               }
  581.             },
  582.             "schema": {
  583.               "$ref": "#/definitions/GroupResponse"
  584.             }
  585.           }
  586.         },
  587.         "summary": "Show Group Rule",
  588.         "tags": [
  589.           "Group"
  590.         ]
  591.       },
  592.       "put": {
  593.         "consumes": [
  594.           "application/json"
  595.         ],
  596.         "description": "Update all attributes of a group rule",
  597.         "operationId": "FidelityRulexWeb.Api.V1.GroupController.update",
  598.         "parameters": [
  599.           {
  600.             "description": "Fidelity Rule Engine Merchant ID",
  601.             "in": "header",
  602.             "name": "x-fre-origin",
  603.             "required": true,
  604.             "type": "string"
  605.           },
  606.           {
  607.             "description": "Group Rule ID",
  608.             "in": "path",
  609.             "name": "id",
  610.             "required": true,
  611.             "type": "integer",
  612.             "x-example": 3
  613.           },
  614.           {
  615.             "description": "The group Rule details",
  616.             "in": "body",
  617.             "name": "group",
  618.             "required": false,
  619.             "schema": {
  620.               "$ref": "#/definitions/GroupRequest"
  621.             },
  622.             "x-example": {
  623.               "group": {
  624.                 "description": "some description",
  625.                 "merchant_id": "1234",
  626.                 "name": "some name",
  627.                 "priority": 10,
  628.                 "rules": [
  629.                   "test"
  630.                 ],
  631.                 "type": "unit_rule_group"
  632.               }
  633.             }
  634.           }
  635.         ],
  636.         "produces": [
  637.           "application/json"
  638.         ],
  639.         "responses": {
  640.           "200": {
  641.             "description": "Updated Successfully",
  642.             "examples": {
  643.               "application/json": {
  644.                 "group": {
  645.                   "description": "some description",
  646.                   "id": 1,
  647.                   "merchant_id": "1234",
  648.                   "name": "some name",
  649.                   "priority": 10,
  650.                   "rules": [
  651.                     "test"
  652.                   ],
  653.                   "type": "unit_rule_group"
  654.                 }
  655.               }
  656.             },
  657.             "schema": {
  658.               "$ref": "#/definitions/GroupResponse"
  659.             }
  660.           }
  661.         },
  662.         "summary": "Update group rule",
  663.         "tags": [
  664.           "Group"
  665.         ]
  666.       }
  667.     },
  668.     "/api/v1/rules": {
  669.       "get": {
  670.         "deprecated": false,
  671.         "description": "List all rules in the database",
  672.         "operationId": "FidelityRulexWeb.Api.V1.RuleController.index",
  673.         "parameters": [
  674.           {
  675.             "description": "Fidelity Rule Engine Merchant ID",
  676.             "in": "header",
  677.             "name": "x-fre-origin",
  678.             "required": true,
  679.             "type": "string"
  680.           }
  681.         ],
  682.         "produces": [
  683.           "application/json"
  684.         ],
  685.         "responses": {
  686.           "200": {
  687.             "description": "OK",
  688.             "examples": {
  689.               "application/json": {
  690.                 "rule": [
  691.                   {
  692.                     "actions": [
  693.                       "alarm"
  694.                     ],
  695.                     "condition": {
  696.                       "Operation": "eq",
  697.                       "key": "price",
  698.                       "value": "1"
  699.                     },
  700.                     "description": "some updated description",
  701.                     "merchant_id": "1234",
  702.                     "name": "test_1",
  703.                     "priority": 43
  704.                   },
  705.                   {
  706.                     "actions": [
  707.                       "alarm"
  708.                     ],
  709.                     "condition": {
  710.                       "Operation": "gt",
  711.                       "key": "price",
  712.                       "value": "12"
  713.                     },
  714.                     "description": "some updated description",
  715.                     "merchant_id": "1234",
  716.                     "name": "test_2",
  717.                     "priority": 43
  718.                   }
  719.                 ]
  720.               }
  721.             },
  722.             "schema": {
  723.               "$ref": "#/definitions/RulesResponse"
  724.             }
  725.           }
  726.         },
  727.         "summary": "List rule",
  728.         "tags": [
  729.           "Rule"
  730.         ]
  731.       },
  732.       "post": {
  733.         "consumes": [
  734.           "application/json"
  735.         ],
  736.         "description": "Creates a new Merchant rule",
  737.         "operationId": "FidelityRulexWeb.Api.V1.RuleController.create",
  738.         "parameters": [
  739.           {
  740.             "description": "Fidelity Rule Engine Merchant ID",
  741.             "in": "header",
  742.             "name": "x-fre-origin",
  743.             "required": true,
  744.             "type": "string"
  745.           },
  746.           {
  747.             "description": "The rule details",
  748.             "in": "body",
  749.             "name": "rule",
  750.             "required": false,
  751.             "schema": {
  752.               "$ref": "#/definitions/RuleRequest"
  753.             },
  754.             "x-example": {
  755.               "rule": {
  756.                 "actions": [
  757.                   "alarm"
  758.                 ],
  759.                 "condition": {
  760.                   "Operation": "gt",
  761.                   "key": "price",
  762.                   "value": "12"
  763.                 },
  764.                 "description": "some updated description",
  765.                 "merchant_id": "1234",
  766.                 "name": "test_2",
  767.                 "priority": 43
  768.               }
  769.             }
  770.           }
  771.         ],
  772.         "produces": [
  773.           "application/json"
  774.         ],
  775.         "responses": {
  776.           "201": {
  777.             "description": "Rule created OK",
  778.             "examples": {
  779.               "application/json": {
  780.                 "rule": {
  781.                   "actions": [
  782.                     "alarm"
  783.                   ],
  784.                   "condition": {
  785.                     "Operation": "gt",
  786.                     "key": "price",
  787.                     "value": "12"
  788.                   },
  789.                   "description": "some updated description",
  790.                   "merchant_id": "1234",
  791.                   "name": "test_2",
  792.                   "priority": 43
  793.                 }
  794.               }
  795.             },
  796.             "schema": {
  797.               "$ref": "#/definitions/RuleResponse"
  798.             }
  799.           },
  800.           "422": {
  801.             "description": "Unprocessable Entity",
  802.             "examples": {
  803.               "application/json": {
  804.                 "errors": {
  805.                   "name": [
  806.                     "has already been taken"
  807.                   ]
  808.                 }
  809.               }
  810.             },
  811.             "schema": {
  812.               "$ref": "#/definitions/RuleResponse"
  813.             }
  814.           }
  815.         },
  816.         "summary": "Create Merchant rule",
  817.         "tags": [
  818.           "Rule"
  819.         ]
  820.       }
  821.     },
  822.     "/api/v1/rules/{id}": {
  823.       "delete": {
  824.         "description": "Delete a Merchant_id rule by ID",
  825.         "operationId": "FidelityRulexWeb.Api.V1.RuleController.delete",
  826.         "parameters": [
  827.           {
  828.             "description": "Fidelity Rule Engine Merchant ID",
  829.             "in": "header",
  830.             "name": "x-fre-origin",
  831.             "required": true,
  832.             "type": "string"
  833.           },
  834.           {
  835.             "description": "Rule ID",
  836.             "in": "path",
  837.             "name": "id",
  838.             "required": true,
  839.             "type": "integer",
  840.             "x-example": 3
  841.           }
  842.         ],
  843.         "responses": {
  844.           "204": {
  845.             "description": "No Content - Deleted Successfully"
  846.           }
  847.         },
  848.         "summary": "Delete Merchant_Id rule",
  849.         "tags": [
  850.           "Rule"
  851.         ]
  852.       },
  853.       "get": {
  854.         "description": "Show a rule by ID",
  855.         "operationId": "FidelityRulexWeb.Api.V1.RuleController.show",
  856.         "parameters": [
  857.           {
  858.             "description": "Fidelity Rule Engine Merchant ID",
  859.             "in": "header",
  860.             "name": "x-fre-origin",
  861.             "required": true,
  862.             "type": "string"
  863.           },
  864.           {
  865.             "description": "Rule ID",
  866.             "in": "path",
  867.             "name": "id",
  868.             "required": true,
  869.             "type": "integer",
  870.             "x-example": 123
  871.           }
  872.         ],
  873.         "produces": [
  874.           "application/json"
  875.         ],
  876.         "responses": {
  877.           "200": {
  878.             "description": "OK",
  879.             "examples": {
  880.               "application/json": {
  881.                 "rule": {
  882.                   "actions": [
  883.                     "alarm"
  884.                   ],
  885.                   "condition": {
  886.                     "Operation": "gt",
  887.                     "key": "price",
  888.                     "value": "12"
  889.                   },
  890.                   "description": "some updated description",
  891.                   "merchant_id": "1234",
  892.                   "name": "test_2",
  893.                   "priority": 43
  894.                 }
  895.               }
  896.             },
  897.             "schema": {
  898.               "$ref": "#/definitions/RuleResponse"
  899.             }
  900.           }
  901.         },
  902.         "summary": "Show Rule",
  903.         "tags": [
  904.           "Rule"
  905.         ]
  906.       },
  907.       "put": {
  908.         "consumes": [
  909.           "application/json"
  910.         ],
  911.         "description": "Update all attributes of a rule",
  912.         "operationId": "FidelityRulexWeb.Api.V1.RuleController.update",
  913.         "parameters": [
  914.           {
  915.             "description": "Fidelity Rule Engine Merchant ID",
  916.             "in": "header",
  917.             "name": "x-fre-origin",
  918.             "required": true,
  919.             "type": "string"
  920.           },
  921.           {
  922.             "description": "Rule ID",
  923.             "in": "path",
  924.             "name": "id",
  925.             "required": true,
  926.             "type": "integer",
  927.             "x-example": 3
  928.           },
  929.           {
  930.             "description": "The Rule details",
  931.             "in": "body",
  932.             "name": "rule",
  933.             "required": false,
  934.             "schema": {
  935.               "$ref": "#/definitions/RuleRequest"
  936.             },
  937.             "x-example": {
  938.               "user": {
  939.                 "email": "joe4@mail.com",
  940.                 "name": "Joe"
  941.               }
  942.             }
  943.           }
  944.         ],
  945.         "produces": [
  946.           "application/json"
  947.         ],
  948.         "responses": {
  949.           "200": {
  950.             "description": "Updated Successfully",
  951.             "examples": {
  952.               "application/json": {
  953.                 "rule": {
  954.                   "id": 1,
  955.                   "inserted_at": "2017-02-08T12:34:55Z",
  956.                   "merchant_id": "1234",
  957.                   "rules": [
  958.                     "test"
  959.                   ],
  960.                   "type": "skip_on_first_applied_rule",
  961.                   "updated_at": "2017-02-12T13:45:23Z"
  962.                 }
  963.               }
  964.             },
  965.             "schema": {
  966.               "$ref": "#/definitions/SetResponse"
  967.             }
  968.           }
  969.         },
  970.         "summary": "Update rule",
  971.         "tags": [
  972.           "Rule"
  973.         ]
  974.       }
  975.     },
  976.     "/api/v1/sets": {
  977.       "get": {
  978.         "deprecated": false,
  979.         "description": "List all rule sets in the database",
  980.         "operationId": "FidelityRulexWeb.Api.V1.SetController.index",
  981.         "parameters": [
  982.           {
  983.             "description": "Fidelity Rule Engine Merchant ID",
  984.             "in": "header",
  985.             "name": "x-fre-origin",
  986.             "required": true,
  987.             "type": "string"
  988.           }
  989.         ],
  990.         "produces": [
  991.           "application/json"
  992.         ],
  993.         "responses": {
  994.           "200": {
  995.             "description": "OK",
  996.             "examples": {
  997.               "application/json": {
  998.                 "set": [
  999.                   {
  1000.                     "id": 1,
  1001.                     "merchant_id": "1234",
  1002.                     "rules": [
  1003.                       "test"
  1004.                     ],
  1005.                     "type": "skip_on_first_applied_rule"
  1006.                   },
  1007.                   {
  1008.                     "id": 2,
  1009.                     "merchant_id": "4321",
  1010.                     "rules": [
  1011.                       "test_1"
  1012.                     ],
  1013.                     "type": "skip_on_first_applied_rule"
  1014.                   }
  1015.                 ]
  1016.               }
  1017.             },
  1018.             "schema": {
  1019.               "$ref": "#/definitions/SetsResponse"
  1020.             }
  1021.           }
  1022.         },
  1023.         "summary": "List rule sets",
  1024.         "tags": [
  1025.           "Set"
  1026.         ]
  1027.       },
  1028.       "post": {
  1029.         "consumes": [
  1030.           "application/json"
  1031.         ],
  1032.         "description": "Creates a new Merchant rule set",
  1033.         "operationId": "FidelityRulexWeb.Api.V1.SetController.create",
  1034.         "parameters": [
  1035.           {
  1036.             "description": "Fidelity Rule Engine Merchant ID",
  1037.             "in": "header",
  1038.             "name": "x-fre-origin",
  1039.             "required": true,
  1040.             "type": "string"
  1041.           },
  1042.           {
  1043.             "description": "The rule set details",
  1044.             "in": "body",
  1045.             "name": "set",
  1046.             "required": false,
  1047.             "schema": {
  1048.               "$ref": "#/definitions/SetRequest"
  1049.             },
  1050.             "x-example": {
  1051.               "set": {
  1052.                 "merchant_id": "1234",
  1053.                 "rules": [
  1054.                   "test"
  1055.                 ],
  1056.                 "type": "skip_on_first_applied_rule"
  1057.               }
  1058.             }
  1059.           }
  1060.         ],
  1061.         "produces": [
  1062.           "application/json"
  1063.         ],
  1064.         "responses": {
  1065.           "201": {
  1066.             "description": "Rule Set created OK",
  1067.             "examples": {
  1068.               "application/json": {
  1069.                 "set": {
  1070.                   "id": 1,
  1071.                   "merchant_id": "1234",
  1072.                   "rules": [
  1073.                     "test"
  1074.                   ],
  1075.                   "type": "skip_on_first_applied_rule"
  1076.                 }
  1077.               }
  1078.             },
  1079.             "schema": {
  1080.               "$ref": "#/definitions/SetResponse"
  1081.             }
  1082.           },
  1083.           "422": {
  1084.             "description": "Unprocessable Entity",
  1085.             "examples": {
  1086.               "application/json": {
  1087.                 "errors": {
  1088.                   "rules": [
  1089.                     "One of the rule does not exist"
  1090.                   ]
  1091.                 }
  1092.               }
  1093.             },
  1094.             "schema": {
  1095.               "$ref": "#/definitions/SetResponse"
  1096.             }
  1097.           }
  1098.         },
  1099.         "summary": "Create Merchant rule set",
  1100.         "tags": [
  1101.           "Set"
  1102.         ]
  1103.       }
  1104.     },
  1105.     "/api/v1/sets/{id}": {
  1106.       "delete": {
  1107.         "description": "Delete a Merchant_id rule Set by ID",
  1108.         "operationId": "FidelityRulexWeb.Api.V1.SetController.delete",
  1109.         "parameters": [
  1110.           {
  1111.             "description": "Fidelity Rule Engine Merchant ID",
  1112.             "in": "header",
  1113.             "name": "x-fre-origin",
  1114.             "required": true,
  1115.             "type": "string"
  1116.           },
  1117.           {
  1118.             "description": "Rule Set ID",
  1119.             "in": "path",
  1120.             "name": "id",
  1121.             "required": true,
  1122.             "type": "integer",
  1123.             "x-example": 3
  1124.           }
  1125.         ],
  1126.         "responses": {
  1127.           "204": {
  1128.             "description": "No Content - Deleted Successfully"
  1129.           }
  1130.         },
  1131.         "summary": "Delete Merchant_Id rule Set",
  1132.         "tags": [
  1133.           "Set"
  1134.         ]
  1135.       },
  1136.       "get": {
  1137.         "description": "Show a rule set by ID",
  1138.         "operationId": "FidelityRulexWeb.Api.V1.SetController.show",
  1139.         "parameters": [
  1140.           {
  1141.             "description": "Fidelity Rule Engine Merchant ID",
  1142.             "in": "header",
  1143.             "name": "x-fre-origin",
  1144.             "required": true,
  1145.             "type": "string"
  1146.           },
  1147.           {
  1148.             "description": "Rule Set ID",
  1149.             "in": "path",
  1150.             "name": "id",
  1151.             "required": true,
  1152.             "type": "integer",
  1153.             "x-example": 123
  1154.           }
  1155.         ],
  1156.         "produces": [
  1157.           "application/json"
  1158.         ],
  1159.         "responses": {
  1160.           "200": {
  1161.             "description": "OK",
  1162.             "examples": {
  1163.               "application/json": {
  1164.                 "set": {
  1165.                   "id": 1,
  1166.                   "merchant_id": "1234",
  1167.                   "rules": [
  1168.                     "test"
  1169.                   ],
  1170.                   "type": "skip_on_first_applied_rule"
  1171.                 }
  1172.               }
  1173.             },
  1174.             "schema": {
  1175.               "$ref": "#/definitions/SetResponse"
  1176.             }
  1177.           }
  1178.         },
  1179.         "summary": "Show Rule Set",
  1180.         "tags": [
  1181.           "Set"
  1182.         ]
  1183.       },
  1184.       "put": {
  1185.         "consumes": [
  1186.           "application/json"
  1187.         ],
  1188.         "description": "Update all attributes of a rule set",
  1189.         "operationId": "FidelityRulexWeb.Api.V1.SetController.update",
  1190.         "parameters": [
  1191.           {
  1192.             "description": "Fidelity Rule Engine Merchant ID",
  1193.             "in": "header",
  1194.             "name": "x-fre-origin",
  1195.             "required": true,
  1196.             "type": "string"
  1197.           },
  1198.           {
  1199.             "description": "Rule Set ID",
  1200.             "in": "path",
  1201.             "name": "id",
  1202.             "required": true,
  1203.             "type": "integer",
  1204.             "x-example": 3
  1205.           },
  1206.           {
  1207.             "description": "The Rule Set details",
  1208.             "in": "body",
  1209.             "name": "set",
  1210.             "required": false,
  1211.             "schema": {
  1212.               "$ref": "#/definitions/SetRequest"
  1213.             },
  1214.             "x-example": {
  1215.               "user": {
  1216.                 "email": "joe4@mail.com",
  1217.                 "name": "Joe"
  1218.               }
  1219.             }
  1220.           }
  1221.         ],
  1222.         "produces": [
  1223.           "application/json"
  1224.         ],
  1225.         "responses": {
  1226.           "200": {
  1227.             "description": "Updated Successfully",
  1228.             "examples": {
  1229.               "application/json": {
  1230.                 "set": {
  1231.                   "id": 1,
  1232.                   "inserted_at": "2017-02-08T12:34:55Z",
  1233.                   "merchant_id": "1234",
  1234.                   "rules": [
  1235.                     "test"
  1236.                   ],
  1237.                   "type": "skip_on_first_applied_rule",
  1238.                   "updated_at": "2017-02-12T13:45:23Z"
  1239.                 }
  1240.               }
  1241.             },
  1242.             "schema": {
  1243.               "$ref": "#/definitions/SetResponse"
  1244.             }
  1245.           }
  1246.         },
  1247.         "summary": "Update rule set ",
  1248.         "tags": [
  1249.           "Set"
  1250.         ]
  1251.       }
  1252.     }
  1253.   },
  1254.   "security": [
  1255.     {
  1256.       "basic": []
  1257.     }
  1258.   ],
  1259.   "securityDefinitions": {
  1260.     "basic": {
  1261.       "type": "basic"
  1262.     }
  1263.   },
  1264.   "swagger": "2.0"
  1265. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement