juice-shop

Форк
0
/
swagger.yml 
52 строки · 2.2 Кб
1
openapi: 3.0.0
2
servers:
3
  -
4
    url: /b2b/v2
5
info:
6
  version: 2.0.0
7
  title: 'NextGen B2B API'
8
  description: 'New & secure JSON-based API for our enterprise customers. (Deprecates previously offered XML-based endpoints)'
9
  license:
10
    name: MIT
11
    url: 'https://opensource.org/licenses/MIT'
12
  contact:
13
    name: B2B API Support
14
tags:
15
  -
16
    name: Order
17
    description: 'API for customer orders'
18
paths:
19
  /orders:
20
    post:
21
      operationId: createCustomerOrder
22
      tags: [Order]
23
      description: 'Create new customer order'
24
      responses: { '200': { description: 'New customer order is created', content: { application/json: { schema: { $ref: '#/components/schemas/OrderConfirmation' } } } } }
25
      requestBody: { content: { application/json: { schema: { $ref: '#/components/schemas/Order' } } }, description: 'Customer order to be placed' }
26
components:
27
  securitySchemes:
28
    bearerAuth:
29
      type: http
30
      scheme: bearer
31
      bearerFormat: JWT
32
  schemas:
33
    Order:
34
      required: [cid]
35
      properties: { cid: { type: string, uniqueItems: true, example: JS0815DE }, orderLines: { $ref: '#/components/schemas/OrderLines' }, orderLinesData: { $ref: '#/components/schemas/OrderLinesData' } }
36
    OrderConfirmation:
37
      required: [cid, orderNo, paymentDue]
38
      properties: { cid: { type: string, uniqueItems: true, example: JS0815DE }, orderNo: { type: string, uniqueItems: true, example: 3d06ac5e1bdf39d26392f8100f124742 }, paymentDue: { description: 'All payments are due 14 days after order placement', type: string, format: date, example: '2018-01-19' } }
39
    OrderLine:
40
      description: 'Order line in default JSON format'
41
      required: [productId, quantity]
42
      properties: { productId: { type: integer, example: 8 }, quantity: { type: integer, minimum: 1, example: 500 }, customerReference: { type: string, example: PO0000001 } }
43
    OrderLines:
44
      type: array
45
      items: { $ref: '#/components/schemas/OrderLine' }
46
    OrderLinesData:
47
      description: 'Order line(s) in customer specific JSON format'
48
      type: string
49
      example: '[{"productId": 12,"quantity": 10000,"customerReference": ["PO0000001.2", "SM20180105|042"],"couponCode": "pes[Bh.u*t"},{"productId": 13,"quantity": 2000,"customerReference": "PO0000003.4"}]'
50
security:
51
  -
52
    bearerAuth: []
53

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.