mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Generate docs with rails rswag
This commit is contained in:
committed by
Maikel Linke
parent
cc4192047e
commit
39f4feed4a
@@ -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: "/"
|
||||
|
||||
Reference in New Issue
Block a user