From 39f4feed4a128bd2d1ff7c4a5319af7e2d2d4bc8 Mon Sep 17 00:00:00 2001 From: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com> Date: Sat, 9 Oct 2021 20:14:56 +0100 Subject: [PATCH] Generate docs with `rails rswag` --- swagger/v1/swagger.yaml | 121 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 120 insertions(+), 1 deletion(-) diff --git a/swagger/v1/swagger.yaml b/swagger/v1/swagger.yaml index d387a8fd33..d341f1807d 100644 --- a/swagger/v1/swagger.yaml +++ b/swagger/v1/swagger.yaml @@ -3,6 +3,125 @@ openapi: 3.0.1 info: title: API V1 version: v1 -paths: {} +paths: + "/api/v0/orders": + get: + summary: list orders + tags: + - Orders + parameters: + - name: X-Spree-Token + in: header + schema: + type: string + - name: q[distributor_id_eq] + in: query + required: false + description: Query orders for a specific distributor id. + schema: + type: string + - name: q[completed_at_gt] + in: query + required: false + description: Query orders completed after a date. + schema: + type: string + - name: q[completed_at_lt] + in: query + required: false + description: Query orders completed before a date. + schema: + type: string + - name: q[state_eq] + in: query + required: false + description: Query orders by order state, eg 'cart', 'complete'. + schema: + type: string + - name: q[payment_state_eq] + in: query + required: false + description: Query orders by order payment_state, eg 'balance_due', 'paid', + 'failed'. + schema: + type: string + - name: q[email_cont] + in: query + required: false + description: Query orders where the order email contains a string. + schema: + type: string + - name: q[order_cycle_id_eq] + in: query + required: false + description: Query orders for a specific order_cycle id. + schema: + type: string + responses: + '200': + description: get orders + content: + application/json: + schema: + "$ref": "#/components/schemas/Order_Concise" + "/api/v1/customers/{id}": + get: + summary: Show customer + parameters: + - name: id + in: path + required: true + schema: + type: string + responses: + '200': + description: customer found + content: + application/json: + schema: + type: object + properties: + data: + type: object + properties: + id: + type: string + type: + type: string + attributes: + type: object + properties: + id: + type: integer + name: + type: string + nullable: true + code: + type: string + email: + type: string + required: + - id + - name + - code + - email + required: + - id + - type + - attributes + - relationships + relationships: + - enterprise + required: + - data + '404': + description: not found + content: + application/json: + schema: + type: object + properties: + error: + type: string servers: - url: "/"