diff --git a/resources/cafe-split/components/parameters/Before.yaml b/resources/cafe-split/components/parameters/Before.yaml index ea713dbec5..a719dc664b 100644 --- a/resources/cafe-split/components/parameters/Before.yaml +++ b/resources/cafe-split/components/parameters/Before.yaml @@ -2,6 +2,6 @@ name: before in: query required: false description: | - Use the `startCursor` as a value for the `before` parameter to get the next page. + Use the `startCursor` as a value for the `before` parameter to get the previous page. schema: type: string diff --git a/resources/cafe-split/components/parameters/Filter.yaml b/resources/cafe-split/components/parameters/Filter.yaml index 401bc2e86f..9aa0e76197 100644 --- a/resources/cafe-split/components/parameters/Filter.yaml +++ b/resources/cafe-split/components/parameters/Filter.yaml @@ -1,20 +1,14 @@ name: filter description: |- Filters the collection items using space-separated `field:value` pairs. + See each list endpoint for the specific fields it supports. **Format:** `field1:value1 field2:value2` **Supported operators:** - - `field:value` - Exact match - - `field:value1,value2` - Match any of the comma-separated values (OR) - - Time ranges: Use `30d` (30 days), `7d` (7 days), `1h` (1 hour), etc. - - **Examples:** - - `status:placed` - Filter by single status. - - `status:placed,completed` - Filter by multiple statuses. - - `createdAt:30d` - Filter orders created in the last 30 days. - - `orderId:ord_01h1s5z6vf2mm1mz3hevnn9va7` - Filter by specific order ID. - - `status:placed createdAt:7d` - Combine multiple filters. + - `field:value` - exact match + - `field:value1,value2` - match any of the comma-separated values (OR) + - Time ranges (on date fields): use `30d` (30 days), `7d` (7 days), `1h` (1 hour), etc. in: query required: false schema: diff --git a/resources/cafe-split/components/parameters/Limit.yaml b/resources/cafe-split/components/parameters/Limit.yaml index 42050c4787..b960de05ae 100644 --- a/resources/cafe-split/components/parameters/Limit.yaml +++ b/resources/cafe-split/components/parameters/Limit.yaml @@ -1,7 +1,7 @@ name: limit description: | - Use to return a number of results per page. - If there is more data, use in combination with `after` to page through the data. + Specify the number of results per page. + If there is more data, use in combination with `after` to page through all results. in: query required: false schema: diff --git a/resources/cafe-split/components/parameters/Search.yaml b/resources/cafe-split/components/parameters/Search.yaml index 6601e9b153..71877812c1 100644 --- a/resources/cafe-split/components/parameters/Search.yaml +++ b/resources/cafe-split/components/parameters/Search.yaml @@ -1,13 +1,9 @@ name: search in: query description: |- - Performs a case-insensitive text search across relevant fields in the collection. - - **Fields searched depend on the endpoint:** - - **Menu items:** `name`, `photoTextDescription` - - **Orders:** `customerName`, `id` - - Returns items where any of the searchable fields contain the search term as a substring. + Performs a case-insensitive text search across the endpoint's searchable fields, + returning items where any of those fields contain the search term as a substring. + See each list endpoint for the specific fields it searches. required: false schema: type: string diff --git a/resources/cafe-split/components/schemas/Error.yaml b/resources/cafe-split/components/schemas/Error.yaml index ac9640eef9..9c8f3121c3 100644 --- a/resources/cafe-split/components/schemas/Error.yaml +++ b/resources/cafe-split/components/schemas/Error.yaml @@ -20,7 +20,7 @@ properties: format: uri-reference description: | URI reference that identifies the specific occurrence of the problem, e.g. by adding a fragment identifier or sub-path to the problem type. - May be used to locate the root of this problem in the source code. + Can be used to locate the root of this problem in the source code. example: '/some/uri-reference#specific-occurrence-context' details: description: Additional error details. diff --git a/resources/cafe-split/components/schemas/MenuBaseItem.yaml b/resources/cafe-split/components/schemas/MenuBaseItem.yaml index d96f3d3ea5..b683d8c63a 100644 --- a/resources/cafe-split/components/schemas/MenuBaseItem.yaml +++ b/resources/cafe-split/components/schemas/MenuBaseItem.yaml @@ -36,7 +36,7 @@ properties: - string - 'null' format: binary - description: Photo of the menu item. Must be a PNG image and less than 1MB. + description: Photo of the menu item. Must be a PNG image less than 1MB in size. photoUrl: readOnly: true type: string diff --git a/resources/cafe-split/components/schemas/RevenueStatistics.yaml b/resources/cafe-split/components/schemas/RevenueStatistics.yaml index 065f784ef3..4dd4792c68 100644 --- a/resources/cafe-split/components/schemas/RevenueStatistics.yaml +++ b/resources/cafe-split/components/schemas/RevenueStatistics.yaml @@ -33,11 +33,11 @@ properties: minimum: 0 startDate: type: string - format: date + format: date-time description: Start date of the revenue calculation period. endDate: type: string - format: date + format: date-time description: End date of the revenue calculation period. required: - revenue diff --git a/resources/cafe-split/paths/menu.yaml b/resources/cafe-split/paths/menu.yaml index 4f3f6edade..4c1946b519 100644 --- a/resources/cafe-split/paths/menu.yaml +++ b/resources/cafe-split/paths/menu.yaml @@ -9,8 +9,39 @@ get: - $ref: ../components/parameters/After.yaml - $ref: ../components/parameters/Before.yaml - $ref: ../components/parameters/Sort.yaml + description: |- + Sorts the collection by a single field. Prefix with `-` for descending order + (for example, `-price`); omit the prefix for ascending order (`price`). + + **Sortable fields:** `name`, `price`, `createdAt`, `updatedAt`, `id` + example: '-price' - $ref: ../components/parameters/Filter.yaml + description: |- + Filters the collection items using space-separated `field:value` pairs. + + **Filterable fields:** `name`, `category`, `price`, `createdAt`, `id` + + **Format:** `field1:value1 field2:value2` + + **Supported operators:** + - `field:value` - Exact match + - `field:value1,value2` - Match any of the comma-separated values (OR) + - Time ranges (on `createdAt`): Use `30d` (30 days), `7d` (7 days), `1h` (1 hour), etc. + + **Examples:** + - `category:beverage` - Filter by a single category. + - `category:beverage,dessert` - Filter by multiple categories. + - `createdAt:7d` - Menu items created in the last 7 days. + - `name:Latte` - Filter by name. + - `category:beverage price:400` - Combine multiple filters. + example: category:beverage - $ref: ../components/parameters/Search.yaml + description: |- + Performs a case-insensitive text search across the searchable fields, returning + items where any of them contain the search term as a substring. + + **Searchable fields:** `name`, `photoTextDescription` + example: Latte - $ref: ../components/parameters/Limit.yaml responses: '200': diff --git a/resources/cafe-split/paths/order-items.yaml b/resources/cafe-split/paths/order-items.yaml index bbdd9ce4ce..adeab36de0 100644 --- a/resources/cafe-split/paths/order-items.yaml +++ b/resources/cafe-split/paths/order-items.yaml @@ -12,6 +12,12 @@ get: parameters: - $ref: ../components/parameters/Filter.yaml required: true + description: |- + Selects the order whose items to return, using a single `orderId:` pair + (for example, `orderId:ord_01h1s5z6vf2mm1mz3hevnn9va7`). + + This filter is required and only the `orderId` field is supported. + example: orderId:ord_01h1s5z6vf2mm1mz3hevnn9va7 responses: '200': description: Successful operation. diff --git a/resources/cafe-split/paths/orders.yaml b/resources/cafe-split/paths/orders.yaml index b76b367245..f8c5e52b38 100644 --- a/resources/cafe-split/paths/orders.yaml +++ b/resources/cafe-split/paths/orders.yaml @@ -9,11 +9,42 @@ get: - orders:read parameters: - $ref: ../components/parameters/Filter.yaml + description: |- + Filters the collection items using space-separated `field:value` pairs. + + **Filterable fields:** `customerName`, `status`, `totalPrice`, `createdAt`, `id` + + **Format:** `field1:value1 field2:value2` + + **Supported operators:** + - `field:value` - Exact match + - `field:value1,value2` - Match any of the comma-separated values (OR) + - Time ranges (on `createdAt`): Use `30d` (30 days), `7d` (7 days), `1h` (1 hour), etc. + + **Examples:** + - `status:placed` - Filter by a single status. + - `status:placed,completed` - Filter by multiple statuses. + - `createdAt:30d` - Orders created in the last 30 days. + - `id:ord_01h1s5z6vf2mm1mz3hevnn9va7` - Filter by a specific order ID. + - `status:placed createdAt:7d` - Combine multiple filters. + example: status:placed - $ref: ../components/parameters/Sort.yaml + description: |- + Sorts the collection by a single field. Prefix with `-` for descending order + (for example, `-createdAt`); omit the prefix for ascending order (`createdAt`). + + **Sortable fields:** `customerName`, `status`, `totalPrice`, `createdAt`, `updatedAt`, `id` + example: '-createdAt' - $ref: ../components/parameters/Limit.yaml - $ref: ../components/parameters/After.yaml - $ref: ../components/parameters/Before.yaml - $ref: ../components/parameters/Search.yaml + description: |- + Performs a case-insensitive text search across the searchable fields, returning + items where any of them contain the search term as a substring. + + **Searchable fields:** `customerName`, `id` + example: John responses: '200': description: Successful operation. @@ -35,7 +66,7 @@ post: summary: Create order description: | Create a new order. - Order items cannot be changed - if they need to be updated, the order should be canceled and a new one placed. + Order items cannot be changed - if they need to be updated, cancel the order and place a new one. operationId: createOrder security: - OAuth2: diff --git a/resources/cafe-split/paths/orders_{orderId}.yaml b/resources/cafe-split/paths/orders_{orderId}.yaml index 05b0917d41..b6104fc59f 100644 --- a/resources/cafe-split/paths/orders_{orderId}.yaml +++ b/resources/cafe-split/paths/orders_{orderId}.yaml @@ -47,7 +47,7 @@ patch: summary: Partially update an order description: | Update an existing order status. - Order items cannot be changed - if they need to be updated, the order should be canceled and a new one placed. + Order items cannot be changed - if they need to be updated, cancel the order and place a new one. operationId: updateOrder security: - OAuth2: @@ -104,7 +104,7 @@ delete: summary: Delete an order description: | Delete the order. - To keep the order history, the order should be canceled instead of deleted. + To keep the order history, cancel the order instead of deleting it. operationId: deleteOrder security: - OAuth2: diff --git a/resources/cafe-split/paths/revenue.yaml b/resources/cafe-split/paths/revenue.yaml index 10c2555bfc..1c177e06d3 100644 --- a/resources/cafe-split/paths/revenue.yaml +++ b/resources/cafe-split/paths/revenue.yaml @@ -19,8 +19,8 @@ get: Defaults to 30 days ago if not provided. schema: type: string - format: date - example: '2026-01-01' + format: date-time + example: '2026-01-01T00:00:00Z' - name: endDate in: query required: false @@ -29,8 +29,8 @@ get: Defaults to current time if not provided. schema: type: string - format: date - example: '2026-01-31' + format: date-time + example: '2026-01-31T23:59:59Z' responses: '200': description: Revenue statistics retrieved successfully. diff --git a/resources/cafe.yaml b/resources/cafe.yaml index c7102cc8a2..3ea25da3aa 100644 --- a/resources/cafe.yaml +++ b/resources/cafe.yaml @@ -41,8 +41,62 @@ paths: - $ref: '#/components/parameters/After' - $ref: '#/components/parameters/Before' - $ref: '#/components/parameters/Sort' + description: >- + Sorts the collection by a single field. Prefix with `-` for + descending order + + (for example, `-price`); omit the prefix for ascending order + (`price`). + + + **Sortable fields:** `name`, `price`, `createdAt`, `updatedAt`, `id` + example: '-price' - $ref: '#/components/parameters/Filter' + description: >- + Filters the collection items using space-separated `field:value` + pairs. + + + **Filterable fields:** `name`, `category`, `price`, `createdAt`, + `id` + + + **Format:** `field1:value1 field2:value2` + + + **Supported operators:** + + - `field:value` - Exact match + + - `field:value1,value2` - Match any of the comma-separated values + (OR) + + - Time ranges (on `createdAt`): Use `30d` (30 days), `7d` (7 days), + `1h` (1 hour), etc. + + + **Examples:** + + - `category:beverage` - Filter by a single category. + + - `category:beverage,dessert` - Filter by multiple categories. + + - `createdAt:7d` - Menu items created in the last 7 days. + + - `name:Latte` - Filter by name. + + - `category:beverage price:400` - Combine multiple filters. + example: category:beverage - $ref: '#/components/parameters/Search' + description: >- + Performs a case-insensitive text search across the searchable + fields, returning + + items where any of them contain the search term as a substring. + + + **Searchable fields:** `name`, `photoTextDescription` + example: Latte - $ref: '#/components/parameters/Limit' responses: '200': @@ -182,11 +236,67 @@ paths: - orders:read parameters: - $ref: '#/components/parameters/Filter' + description: >- + Filters the collection items using space-separated `field:value` + pairs. + + + **Filterable fields:** `customerName`, `status`, `totalPrice`, + `createdAt`, `id` + + + **Format:** `field1:value1 field2:value2` + + + **Supported operators:** + + - `field:value` - Exact match + + - `field:value1,value2` - Match any of the comma-separated values + (OR) + + - Time ranges (on `createdAt`): Use `30d` (30 days), `7d` (7 days), + `1h` (1 hour), etc. + + + **Examples:** + + - `status:placed` - Filter by a single status. + + - `status:placed,completed` - Filter by multiple statuses. + + - `createdAt:30d` - Orders created in the last 30 days. + + - `id:ord_01h1s5z6vf2mm1mz3hevnn9va7` - Filter by a specific order + ID. + + - `status:placed createdAt:7d` - Combine multiple filters. + example: status:placed - $ref: '#/components/parameters/Sort' + description: >- + Sorts the collection by a single field. Prefix with `-` for + descending order + + (for example, `-createdAt`); omit the prefix for ascending order + (`createdAt`). + + + **Sortable fields:** `customerName`, `status`, `totalPrice`, + `createdAt`, `updatedAt`, `id` + example: '-createdAt' - $ref: '#/components/parameters/Limit' - $ref: '#/components/parameters/After' - $ref: '#/components/parameters/Before' - $ref: '#/components/parameters/Search' + description: >- + Performs a case-insensitive text search across the searchable + fields, returning + + items where any of them contain the search term as a substring. + + + **Searchable fields:** `customerName`, `id` + example: John responses: '200': description: Successful operation. @@ -209,8 +319,8 @@ paths: description: > Create a new order. - Order items cannot be changed - if they need to be updated, the order - should be canceled and a new one placed. + Order items cannot be changed - if they need to be updated, cancel the + order and place a new one. operationId: createOrder security: - OAuth2: @@ -311,8 +421,8 @@ paths: description: > Update an existing order status. - Order items cannot be changed - if they need to be updated, the order - should be canceled and a new one placed. + Order items cannot be changed - if they need to be updated, cancel the + order and place a new one. operationId: updateOrder security: - OAuth2: @@ -368,11 +478,9 @@ paths: tags: - Orders summary: Delete an order - description: > + description: | Delete the order. - - To keep the order history, the order should be canceled instead of - deleted. + To keep the order history, cancel the order instead of deleting it. operationId: deleteOrder security: - OAuth2: @@ -407,6 +515,15 @@ paths: parameters: - $ref: '#/components/parameters/Filter' required: true + description: >- + Selects the order whose items to return, using a single + `orderId:` pair + + (for example, `orderId:ord_01h1s5z6vf2mm1mz3hevnn9va7`). + + + This filter is required and only the `orderId` field is supported. + example: orderId:ord_01h1s5z6vf2mm1mz3hevnn9va7 responses: '200': description: Successful operation. @@ -453,8 +570,8 @@ paths: Defaults to 30 days ago if not provided. schema: type: string - format: date - example: '2026-01-01' + format: date-time + example: '2026-01-01T00:00:00Z' - name: endDate in: query required: false @@ -465,8 +582,8 @@ paths: Defaults to current time if not provided. schema: type: string - format: date - example: '2026-01-31' + format: date-time + example: '2026-01-31T23:59:59Z' responses: '200': description: Revenue statistics retrieved successfully. @@ -608,7 +725,7 @@ components: required: false description: > Use the `startCursor` as a value for the `before` parameter to get the - next page. + previous page. schema: type: string Sort: @@ -625,31 +742,20 @@ components: description: >- Filters the collection items using space-separated `field:value` pairs. + See each list endpoint for the specific fields it supports. + **Format:** `field1:value1 field2:value2` **Supported operators:** - - `field:value` - Exact match - - - `field:value1,value2` - Match any of the comma-separated values (OR) - - - Time ranges: Use `30d` (30 days), `7d` (7 days), `1h` (1 hour), etc. - - - **Examples:** - - - `status:placed` - Filter by single status. + - `field:value` - exact match - - `status:placed,completed` - Filter by multiple statuses. + - `field:value1,value2` - match any of the comma-separated values (OR) - - `createdAt:30d` - Filter orders created in the last 30 days. - - - `orderId:ord_01h1s5z6vf2mm1mz3hevnn9va7` - Filter by specific order - ID. - - - `status:placed createdAt:7d` - Combine multiple filters. + - Time ranges (on date fields): use `30d` (30 days), `7d` (7 days), `1h` + (1 hour), etc. in: query required: false schema: @@ -658,29 +764,23 @@ components: name: search in: query description: >- - Performs a case-insensitive text search across relevant fields in the - collection. - - - **Fields searched depend on the endpoint:** + Performs a case-insensitive text search across the endpoint's searchable + fields, - - **Menu items:** `name`, `photoTextDescription` + returning items where any of those fields contain the search term as a + substring. - - **Orders:** `customerName`, `id` - - - Returns items where any of the searchable fields contain the search term - as a substring. + See each list endpoint for the specific fields it searches. required: false schema: type: string Limit: name: limit description: > - Use to return a number of results per page. + Specify the number of results per page. If there is more data, use in combination with `after` to page through - the data. + all results. in: query required: false schema: @@ -803,7 +903,7 @@ components: - string - 'null' format: binary - description: Photo of the menu item. Must be a PNG image and less than 1MB. + description: Photo of the menu item. Must be a PNG image less than 1MB in size. photoUrl: readOnly: true type: string @@ -911,7 +1011,7 @@ components: problem, e.g. by adding a fragment identifier or sub-path to the problem type. - May be used to locate the root of this problem in the source code. + Can be used to locate the root of this problem in the source code. example: /some/uri-reference#specific-occurrence-context details: description: Additional error details. @@ -1087,11 +1187,11 @@ components: minimum: 0 startDate: type: string - format: date + format: date-time description: Start date of the revenue calculation period. endDate: type: string - format: date + format: date-time description: End date of the revenue calculation period. required: - revenue diff --git a/tests/e2e/respect/cafe-api-with-errors.yaml b/tests/e2e/respect/cafe-api-with-errors.yaml new file mode 100644 index 0000000000..60fe388689 --- /dev/null +++ b/tests/e2e/respect/cafe-api-with-errors.yaml @@ -0,0 +1,1364 @@ +openapi: 3.2.0 +info: + title: Redocly Cafe with errors + description: > + Copy of the Redocly Cafe API description with deliberately wrong response + definitions (status codes and content types) used to trigger failing checks + in severity-level tests. + version: 1.0.0 + contact: + email: team@redocly.com + url: https://redocly.com/contact-us/ + license: + name: MIT + url: https://opensource.org/licenses/MIT + termsOfService: https://redocly.com/subscription-agreement +servers: + - url: https://api.cafe.redocly.com + description: Live server. +tags: + - name: Authorization + description: Create a client to demo the API. + - name: Products + description: Operations related to products. + - name: Orders + description: Order management operations. + - name: Statistics + description: Statistics operations. +paths: + /menu: + get: + tags: + - Products + summary: List all menu items + description: >- + Retrieve a collection of menu items with optional filtering and + pagination. + operationId: listMenuItems + security: [] + parameters: + - $ref: '#/components/parameters/After' + - $ref: '#/components/parameters/Before' + - $ref: '#/components/parameters/Sort' + description: >- + Sorts the collection by a single field. Prefix with `-` for + descending order + + (for example, `-price`); omit the prefix for ascending order + (`price`). + + + **Sortable fields:** `name`, `price`, `createdAt`, `updatedAt`, `id` + example: '-price' + - $ref: '#/components/parameters/Filter' + description: >- + Filters the collection items using space-separated `field:value` + pairs. + + + **Filterable fields:** `name`, `category`, `price`, `createdAt`, + `id` + + + **Format:** `field1:value1 field2:value2` + + + **Supported operators:** + + - `field:value` - Exact match + + - `field:value1,value2` - Match any of the comma-separated values + (OR) + + - Time ranges (on `createdAt`): Use `30d` (30 days), `7d` (7 days), + `1h` (1 hour), etc. + + + **Examples:** + + - `category:beverage` - Filter by a single category. + + - `category:beverage,dessert` - Filter by multiple categories. + + - `createdAt:7d` - Menu items created in the last 7 days. + + - `name:Latte` - Filter by name. + + - `category:beverage price:400` - Combine multiple filters. + example: category:beverage + - $ref: '#/components/parameters/Search' + description: >- + Performs a case-insensitive text search across the searchable + fields, returning + + items where any of them contain the search term as a substring. + + + **Searchable fields:** `name`, `photoTextDescription` + example: Latte + - $ref: '#/components/parameters/Limit' + responses: + # Deliberate error: the live API returns 200 with application/json, + # but this file documents 201 with html/text, so the status code check fails. + '201': + description: Successful operation. + content: + html/text: + schema: + $ref: '#/components/schemas/MenuItemList' + '400': + $ref: '#/components/responses/BadRequest' + '500': + $ref: '#/components/responses/InternalServerError' + post: + tags: + - Products + summary: Create menu item + description: Create a new menu item. + operationId: createMenuItem + security: + - OAuth2: + - menu:write + requestBody: + required: true + content: + multipart/form-data: + schema: + $ref: '#/components/schemas/MenuItem' + examples: + Beverage: + summary: Create a beverage + value: + name: Cappuccino + price: 4500 + category: beverage + volume: 250 + containsCaffeine: true + photoTextDescription: A hot cappuccino in a white ceramic cup. + Dessert: + summary: Create a dessert + value: + name: Chocolate-Brownie + price: 3500 + category: dessert + calories: 420 + photoTextDescription: A rich chocolate brownie square dusted with cocoa. + responses: + '201': + description: Menu item created successfully. + content: + application/json: + schema: + $ref: '#/components/schemas/MenuItem' + examples: + MenuItemResponse: + value: + id: prd_01khr487f7qm7p44xn427m43vb + object: menuItem + name: coffee + price: 4000 + category: beverage + createdAt: '2026-02-18T10:20:38.228Z' + updatedAt: '2026-02-18T10:20:38.228Z' + volume: 600 + containsCaffeine: false + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '409': + $ref: '#/components/responses/Conflict' + '500': + $ref: '#/components/responses/InternalServerError' + /menu/{menuItemId}: + parameters: + - $ref: '#/components/parameters/MenuItemId' + delete: + tags: + - Products + summary: Delete a menu item + description: Delete an existing menu item. + operationId: deleteMenuItem + security: + - OAuth2: + - menu:write + responses: + '204': + description: Menu item deleted successfully. + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '404': + $ref: '#/components/responses/NotFound' + '500': + $ref: '#/components/responses/InternalServerError' + /menu-item-images/{menuItemId}: + parameters: + - $ref: '#/components/parameters/MenuItemId' + get: + operationId: getMenuItemPhoto + summary: Retrieve a menu item photo + description: Retrieve the product photo image for a specific menu item. + security: [] + tags: + - Products + parameters: + - $ref: '#/components/parameters/PhotoSize' + responses: + '200': + description: Menu item photo retrieved successfully. + content: + image/png: + schema: + type: string + format: binary + # Deliberate error: the live API returns text/plain, + # but this file documents text/csv, so the content-type check fails. + text/csv: + schema: + description: Alternative image text. + type: string + '404': + $ref: '#/components/responses/NotFound' + '500': + $ref: '#/components/responses/InternalServerError' + /orders: + get: + tags: + - Orders + summary: List all orders + description: Retrieve a collection of orders with optional filtering and pagination. + operationId: listOrders + security: + - OAuth2: + - orders:read + parameters: + - $ref: '#/components/parameters/Filter' + description: >- + Filters the collection items using space-separated `field:value` + pairs. + + + **Filterable fields:** `customerName`, `status`, `totalPrice`, + `createdAt`, `id` + + + **Format:** `field1:value1 field2:value2` + + + **Supported operators:** + + - `field:value` - Exact match + + - `field:value1,value2` - Match any of the comma-separated values + (OR) + + - Time ranges (on `createdAt`): Use `30d` (30 days), `7d` (7 days), + `1h` (1 hour), etc. + + + **Examples:** + + - `status:placed` - Filter by a single status. + + - `status:placed,completed` - Filter by multiple statuses. + + - `createdAt:30d` - Orders created in the last 30 days. + + - `id:ord_01h1s5z6vf2mm1mz3hevnn9va7` - Filter by a specific order + ID. + + - `status:placed createdAt:7d` - Combine multiple filters. + example: status:placed + - $ref: '#/components/parameters/Sort' + description: >- + Sorts the collection by a single field. Prefix with `-` for + descending order + + (for example, `-createdAt`); omit the prefix for ascending order + (`createdAt`). + + + **Sortable fields:** `customerName`, `status`, `totalPrice`, + `createdAt`, `updatedAt`, `id` + example: '-createdAt' + - $ref: '#/components/parameters/Limit' + - $ref: '#/components/parameters/After' + - $ref: '#/components/parameters/Before' + - $ref: '#/components/parameters/Search' + description: >- + Performs a case-insensitive text search across the searchable + fields, returning + + items where any of them contain the search term as a substring. + + + **Searchable fields:** `customerName`, `id` + example: John + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/OrderList' + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '500': + $ref: '#/components/responses/InternalServerError' + post: + tags: + - Orders + summary: Create order + description: > + Create a new order. + + Order items cannot be changed - if they need to be updated, cancel the + order and place a new one. + operationId: createOrder + security: + - OAuth2: + - orders:write + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Order' + examples: + OrderRequest: + dataValue: + customerName: Mary Ann + orderItems: + - menuItemId: prd_01h1s5z6vf2mm1mz3hevnn9va7 + quantity: 2 + comment: No sugar! + discount: 0 + responses: + '201': + description: Order placed successfully. + content: + application/json: + schema: + $ref: '#/components/schemas/Order' + examples: + OrderResponse: + dataValue: + id: ord_01h1s5z6vf2mm1mz3hevnn9va7 + customerName: Mary Ann + orderItems: + - menuItemId: prd_01h1s5z6vf2mm1mz3hevnn9va7 + quantity: 2 + comment: No sugar! + discount: 0 + object: order + status: placed + totalPrice: 200 + createdAt: '2026-08-24T14:15:22Z' + updatedAt: '2026-08-24T14:15:22Z' + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '500': + $ref: '#/components/responses/InternalServerError' + /orders/{orderId}: + get: + tags: + - Orders + summary: Retrieve an order + description: Retrieve a single order by its ID. + operationId: getOrderById + security: + - OAuth2: + - orders:read + parameters: + - $ref: '#/components/parameters/OrderId' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/Order' + examples: + OrderResponse: + dataValue: + id: ord_01h1s5z6vf2mm1mz3hevnn9va7 + customerName: Mary Ann + orderItems: + - menuItemId: prd_01h1s5z6vf2mm1mz3hevnn9va7 + quantity: 2 + comment: No sugar! + discount: 0 + object: order + status: placed + totalPrice: 200 + createdAt: '2026-08-24T14:15:22Z' + updatedAt: '2026-08-24T14:15:22Z' + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '404': + $ref: '#/components/responses/NotFound' + '500': + $ref: '#/components/responses/InternalServerError' + patch: + tags: + - Orders + summary: Partially update an order + description: > + Update an existing order status. + + Order items cannot be changed - if they need to be updated, cancel the + order and place a new one. + operationId: updateOrder + security: + - OAuth2: + - orders:write + parameters: + - $ref: '#/components/parameters/OrderId' + requestBody: + content: + application/json: + schema: + type: object + description: > + Partial order update using JSON Merge Patch - only include + fields to update. + properties: + status: + $ref: '#/components/schemas/OrderStatus' + required: + - status + responses: + '200': + description: Order updated successfully. + content: + application/json: + schema: + $ref: '#/components/schemas/Order' + examples: + OrderResponse: + dataValue: + id: ord_01h1s5z6vf2mm1mz3hevnn9va7 + customerName: Mary Ann + orderItems: + - menuItemId: prd_01h1s5z6vf2mm1mz3hevnn9va7 + quantity: 2 + comment: No sugar! + discount: 0 + object: order + status: completed + totalPrice: 200 + createdAt: '2026-08-24T14:15:22Z' + updatedAt: '2026-08-24T14:15:22Z' + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '404': + $ref: '#/components/responses/NotFound' + '500': + $ref: '#/components/responses/InternalServerError' + delete: + tags: + - Orders + summary: Delete an order + description: | + Delete the order. + To keep the order history, cancel the order instead of deleting it. + operationId: deleteOrder + security: + - OAuth2: + - orders:write + parameters: + - $ref: '#/components/parameters/OrderId' + responses: + '204': + description: Order deleted successfully. + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '404': + $ref: '#/components/responses/NotFound' + '500': + $ref: '#/components/responses/InternalServerError' + /order-items: + get: + tags: + - Orders + summary: List all order items with menu item details + description: | + Returns an array of order items for a specific order. + Use the `filter` parameter to filter by order ID. + operationId: listOrderItems + security: + - OAuth2: + - orders:read + parameters: + - $ref: '#/components/parameters/Filter' + required: true + description: >- + Selects the order whose items to return, using a single + `orderId:` pair + + (for example, `orderId:ord_01h1s5z6vf2mm1mz3hevnn9va7`). + + + This filter is required and only the `orderId` field is supported. + example: orderId:ord_01h1s5z6vf2mm1mz3hevnn9va7 + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + description: List of menu items that are part of the order. + items: + $ref: '#/components/schemas/OrderItem' + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '404': + $ref: '#/components/responses/NotFound' + '500': + $ref: '#/components/responses/InternalServerError' + /revenue: + get: + tags: + - Statistics + summary: Get revenue statistics + description: > + Retrieve revenue statistics for a configurable date range. + + Returns revenue, order counts, average order amount, and other useful + statistics. + operationId: getRevenue + security: + - ApiKey: [] + - OAuth2: + - revenue:read + parameters: + - name: startDate + in: query + required: false + description: > + Start date for the revenue calculation period (ISO 8601 datetime + format). + + Defaults to 30 days ago if not provided. + schema: + type: string + format: date-time + example: '2026-01-01T00:00:00Z' + - name: endDate + in: query + required: false + description: > + End date for the revenue calculation period (ISO 8601 datetime + format). + + Defaults to current time if not provided. + schema: + type: string + format: date-time + example: '2026-01-31T23:59:59Z' + responses: + '200': + description: Revenue statistics retrieved successfully. + content: + application/json: + schema: + $ref: '#/components/schemas/RevenueStatistics' + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '500': + $ref: '#/components/responses/InternalServerError' + /oauth2/register: + post: + tags: + - Authorization + summary: Create OAuth2 client + description: > + Register a new OAuth2 client for dynamic client registration. This + endpoint implements the Dynamic Client Registration Protocol (RFC 7591), + using camelCase field names instead of the RFC's snake_case convention + (e.g., `redirectUris` instead of `redirect_uris`, `grantTypes` instead + of `grant_types`). The `name` field is required. Other fields are + optional. If not provided: + + - `redirectUris` defaults to an empty array. Note: When using the + `authorization_code` grant type, + `redirectUris` must be provided (per RFC 7591 Section 2). + - `scopes` defaults to all available scopes (menu:read, menu:write, + orders:read, orders:write) - `grantTypes` defaults to both supported + grant types (authorization_code, client_credentials) + + Returns the registered client information per RFC 7591, including: + + - `clientId` and `clientSecret` (must be stored securely) - + `clientIdIssuedAt` and `clientSecretExpiresAt` timestamps - All + registered client metadata (name, redirectUris, scopes, grantTypes) + operationId: registerOAuth2Client + security: [] + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/RegisterClientObject' + examples: + RegisterClientObject: + dataValue: + name: auth + redirectUris: + - https://api.cafe.redocly.com/callback + scopes: + - menu:read + - menu:write + - orders:read + - orders:write + - revenue:read + grantTypes: + - client_credentials + responses: + '201': + description: OAuth2 client registered successfully. + content: + application/json: + schema: + $ref: '#/components/schemas/OAuth2Client' + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '500': + $ref: '#/components/responses/InternalServerError' +webhooks: + order-notification: + post: + tags: + - Orders + operationId: orderNotificationWebhook + security: [] + summary: Order notification webhook + description: Webhook triggered when a new order is placed. + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/OrderNotification' + responses: + '200': + description: Webhook received successfully. + '400': + $ref: '#/components/responses/BadRequest' + '500': + $ref: '#/components/responses/InternalServerError' +components: + securitySchemes: + OAuth2: + type: oauth2 + description: OAuth2 authorization for API access. + flows: + authorizationCode: + authorizationUrl: https://api.cafe.redocly.com/oauth2/authorize + tokenUrl: https://api.cafe.redocly.com/oauth2/token + scopes: + menu:read: Read access to menu items and images + menu:write: Write access to menu items (create, delete) + orders:read: Read access to orders + orders:write: Write access to orders (create, update, delete) + revenue:read: Read access to revenue statistics + clientCredentials: + tokenUrl: https://api.cafe.redocly.com/oauth2/token + scopes: + menu:read: Read access to menu items and images + menu:write: Write access to menu items (create, delete) + orders:read: Read access to orders + orders:write: Write access to orders (create, update, delete) + revenue:read: Read access to revenue statistics + ApiKey: + type: apiKey + name: X-API-Key + in: header + description: API key for internal operations. + parameters: + After: + name: after + in: query + required: false + description: >- + Use the `endCursor` as a value for the `after` parameter to get the next + page. + schema: + type: string + Before: + name: before + in: query + required: false + description: > + Use the `startCursor` as a value for the `before` parameter to get the + previous page. + schema: + type: string + Sort: + name: sort + description: |- + To sort by id in descending order use `-id`. + To sort by id in ascending order use `id`. + in: query + required: false + schema: + type: string + Filter: + name: filter + description: >- + Filters the collection items using space-separated `field:value` pairs. + + See each list endpoint for the specific fields it supports. + + + **Format:** `field1:value1 field2:value2` + + + **Supported operators:** + + - `field:value` - exact match + + - `field:value1,value2` - match any of the comma-separated values (OR) + + - Time ranges (on date fields): use `30d` (30 days), `7d` (7 days), `1h` + (1 hour), etc. + in: query + required: false + schema: + type: string + Search: + name: search + in: query + description: >- + Performs a case-insensitive text search across the endpoint's searchable + fields, + + returning items where any of those fields contain the search term as a + substring. + + See each list endpoint for the specific fields it searches. + required: false + schema: + type: string + Limit: + name: limit + description: > + Specify the number of results per page. + + If there is more data, use in combination with `after` to page through + all results. + in: query + required: false + schema: + type: integer + minimum: 1 + maximum: 100 + default: 10 + example: 10 + MenuItemId: + name: menuItemId + in: path + description: ID of the menu item to retrieve. + required: true + schema: + type: string + pattern: ^prd_[0-9abcdefghjkmnpqrstvwxyz]{26}$ + PhotoSize: + name: photoSize + in: query + description: Photo size to retrieve. + required: false + schema: + type: string + enum: + - thumbnail + - medium + - large + default: medium + OrderId: + name: orderId + in: path + description: ID of the order to retrieve. + required: true + schema: + type: string + pattern: ^ord_[0-9abcdefghjkmnpqrstvwxyz]{26}$ + example: ord_01h1s5z6vf2mm1mz3hevnn9va7 + schemas: + Page: + type: object + properties: + endCursor: + type: + - string + - 'null' + description: |- + Use with the `after` query parameter to load the next page of data. + When `null`, there is no data. + The cursor is opaque and internal structure is subject to change. + startCursor: + type: + - string + - 'null' + description: >- + Use with the `before` query parameter to load the previous page of + data. + + When `null`, there is no data. + + The cursor is opaque and internal structure is subject to change. + hasNextPage: + type: boolean + description: Indicates if there is a next page with items. + hasPrevPage: + type: boolean + description: Indicates if there is a previous page with items. + limit: + type: integer + minimum: 1 + maximum: 100 + default: 10 + description: Value showing how many items are in the page limit. + total: + type: integer + description: Count of items across all pages. + minimum: 0 + required: + - endCursor + - startCursor + - hasNextPage + - hasPrevPage + - limit + - total + MenuBaseItem: + type: object + properties: + createdAt: + description: Created date. + type: string + format: date-time + readOnly: true + updatedAt: + description: Updated date. + type: string + format: date-time + readOnly: true + id: + description: Menu item ID. Unique identifier prefixed with `prd_`. + type: string + readOnly: true + pattern: ^prd_[0-9abcdefghjkmnpqrstvwxyz]{26}$ + example: prd_01h1s5z6vf2mm1mz3hevnn9va7 + object: + description: Entity name. + type: string + const: menuItem + readOnly: true + name: + description: Menu item name. + type: string + minLength: 1 + maxLength: 50 + price: + description: Price in cents. + type: integer + minimum: 0 + photo: + writeOnly: true + type: + - string + - 'null' + format: binary + description: Photo of the menu item. Must be a PNG image less than 1MB in size. + photoUrl: + readOnly: true + type: string + format: uri + description: Photo URL of the menu item. + photoTextDescription: + type: + - string + - 'null' + required: + - id + - name + - price + - createdAt + - updatedAt + - object + Beverage: + allOf: + - type: object + properties: + category: + description: Menu item category. + type: string + const: beverage + volume: + type: number + description: Size of the beverage in milliliters. + exclusiveMinimum: 0 + containsCaffeine: + type: boolean + description: Indicates if the beverage contains caffeine. + required: + - category + - volume + - containsCaffeine + - $ref: '#/components/schemas/MenuBaseItem' + Dessert: + allOf: + - type: object + properties: + category: + description: Menu item category. + type: string + const: dessert + calories: + type: number + exclusiveMinimum: 0 + description: Amount of calories. + required: + - category + - calories + - $ref: '#/components/schemas/MenuBaseItem' + MenuItem: + discriminator: + propertyName: category + mapping: + beverage: '#/components/schemas/Beverage' + dessert: '#/components/schemas/Dessert' + oneOf: + - $ref: '#/components/schemas/Beverage' + - $ref: '#/components/schemas/Dessert' + required: + - category + MenuItemList: + type: object + properties: + object: + type: string + const: list + description: Entity name. + page: + $ref: '#/components/schemas/Page' + items: + type: array + items: + $ref: '#/components/schemas/MenuItem' + required: + - object + - page + - items + Error: + type: object + properties: + type: + type: string + format: uri-reference + description: URI reference that identifies the problem type. + default: about:blank + title: + type: string + description: Short summary of the problem type. + status: + type: integer + format: int32 + description: > + HTTP status code generated by the origin server for this occurrence + of the problem. + minimum: 100 + exclusiveMaximum: 600 + instance: + type: string + format: uri-reference + description: > + URI reference that identifies the specific occurrence of the + problem, e.g. by adding a fragment identifier or sub-path to the + problem type. + + Can be used to locate the root of this problem in the source code. + example: /some/uri-reference#specific-occurrence-context + details: + description: Additional error details. + type: object + additionalProperties: true + required: + - type + - title + - status + OrderStatus: + type: string + description: Order status. + enum: + - placed + - preparing + - completed + - canceled + Order: + type: object + title: Order + properties: + id: + description: Order ID. Unique identifier prefixed with `ord_`. + type: string + format: ulid + readOnly: true + pattern: ^ord_[0-9abcdefghjkmnpqrstvwxyz]{26}$ + example: ord_01h1s5z6vf2mm1mz3hevnn9va7 + object: + description: Entity name. + type: string + const: order + readOnly: true + customerName: + description: > + Name of the customer who placed the order. + + Must start and end with a letter, and can contain letters, spaces, + hyphens, and apostrophes (e.g., "John Doe", "Mary-Jane", "O'Brien"). + type: string + pattern: ^[A-Za-z]+(?:[\s'-][A-Za-z]+)*$ + minLength: 1 + maxLength: 100 + status: + allOf: + - $ref: '#/components/schemas/OrderStatus' + readOnly: true + totalPrice: + description: Total order price in cents. + type: integer + minimum: 0 + readOnly: true + createdAt: + description: Created date. + type: string + format: date-time + readOnly: true + updatedAt: + description: Updated date. + type: string + format: date-time + readOnly: true + orderItems: + type: array + description: List of items to include in the order. + minItems: 1 + items: + type: object + properties: + menuItemId: + type: string + format: ulid + description: ID of the menu item to add to the order. + quantity: + type: integer + minimum: 1 + description: Quantity of the menu item. + discount: + type: integer + minimum: 0 + description: Discount amount in cents (absolute value). + default: 0 + comment: + type: string + maxLength: 500 + description: Optional comment for the order item (e.g., "No sugar"). + required: + - menuItemId + - quantity + required: + - customerName + - orderItems + OrderList: + type: object + properties: + object: + type: string + const: list + description: Entity name. + page: + $ref: '#/components/schemas/Page' + items: + type: array + items: + $ref: '#/components/schemas/Order' + required: + - object + - page + - items + OrderItem: + type: object + properties: + menuItemId: + type: string + description: ID of the menu item to add to the order. + writeOnly: true + menuItem: + allOf: + - $ref: '#/components/schemas/MenuItem' + description: Menu item that is part of the order. + readOnly: true + quantity: + type: integer + minimum: 1 + description: Quantity of the menu item. + discount: + type: integer + minimum: 0 + description: Discount amount in cents (absolute value). + default: 0 + comment: + type: string + maxLength: 500 + description: Optional comment for the order item (e.g., "No sugar"). + required: + - menuItemId + - quantity + RevenueStatistics: + type: object + description: Revenue statistics for a given date range. + properties: + revenue: + type: number + format: float + description: Total revenue in cents from completed orders. + minimum: 0 + averageOrderAmount: + type: number + format: float + description: >- + Average order amount in cents (calculated from completed orders + only). + minimum: 0 + totalOrders: + type: integer + description: Total number of orders (all statuses) in the date range. + minimum: 0 + placedOrders: + type: integer + description: Number of placed orders. + minimum: 0 + preparingOrders: + type: integer + description: Number of preparing orders. + minimum: 0 + completedOrders: + type: integer + description: Number of completed orders. + minimum: 0 + canceledOrders: + type: integer + description: Number of canceled orders. + minimum: 0 + startDate: + type: string + format: date-time + description: Start date of the revenue calculation period. + endDate: + type: string + format: date-time + description: End date of the revenue calculation period. + required: + - revenue + - averageOrderAmount + - totalOrders + - placedOrders + - preparingOrders + - completedOrders + - canceledOrders + - startDate + - endDate + RegisterClientObject: + type: object + properties: + name: + type: string + description: Client name. + redirectUris: + type: array + items: + type: string + format: uri + description: List of redirect URIs (optional, defaults to empty array). + scopes: + type: array + items: + type: string + enum: + - menu:read + - menu:write + - orders:read + - orders:write + - revenue:read + description: List of scopes. + grantTypes: + type: array + items: + type: string + enum: + - authorization_code + - client_credentials + description: List of grant types. + required: + - name + OAuth2Client: + type: object + description: >- + OAuth2 client registration response. Per RFC 7591, includes the client + identifier, secret, timestamps, and all registered client metadata. + properties: + clientId: + type: string + description: Client identifier issued by the authorization server. + clientSecret: + type: string + description: Client secret issued by the authorization server. + clientIdIssuedAt: + type: integer + format: int64 + description: >- + Time when the client_id is issued, represented as seconds since + epoch (RFC7591). + clientSecretExpiresAt: + type: integer + format: int64 + description: >- + Time at which the client_secret expires, represented as seconds + since epoch. 0 indicates the secret does not expire (RFC 7591). + name: + type: string + description: Client name (registered metadata). + redirectUris: + type: array + items: + type: string + format: uri + description: List of redirect URIs (registered metadata). + registrationClientUri: + type: string + format: uri + description: >- + URL of the client configuration endpoint for managing this client + registration (RFC 7592). + registrationAccessToken: + type: string + description: >- + Access token to be used at the client configuration endpoint for + managing this client registration (RFC 7592). + scopes: + type: array + items: + type: string + enum: + - menu:read + - menu:write + - orders:read + - orders:write + - revenue:read + description: List of scopes (registered metadata). + grantTypes: + type: array + items: + type: string + enum: + - authorization_code + - client_credentials + description: List of grant types (registered metadata). + required: + - clientId + - clientSecret + - clientIdIssuedAt + - clientSecretExpiresAt + - registrationClientUri + - registrationAccessToken + OrderNotification: + type: object + required: + - orderId + - orderStatus + - timestamp + properties: + orderId: + type: string + description: Unique order identifier. + orderStatus: + $ref: '#/components/schemas/OrderStatus' + timestamp: + type: string + format: date-time + description: When the event occurred. + responses: + BadRequest: + description: Bad request - invalid input parameters. + content: + application/problem+json: + schema: + $ref: '#/components/schemas/Error' + InternalServerError: + description: Internal server error. + content: + application/problem+json: + schema: + $ref: '#/components/schemas/Error' + Unauthorized: + description: Unauthorized - authorization required. + content: + application/problem+json: + schema: + $ref: '#/components/schemas/Error' + Forbidden: + description: Forbidden - insufficient permissions. + content: + application/problem+json: + schema: + $ref: '#/components/schemas/Error' + Conflict: + description: Conflict - entity already exists. + content: + application/problem+json: + schema: + $ref: '#/components/schemas/Error' + NotFound: + description: Resource not found. + content: + application/problem+json: + schema: + $ref: '#/components/schemas/Error' diff --git a/tests/e2e/respect/cafe-api.yaml b/tests/e2e/respect/cafe-api.yaml new file mode 100644 index 0000000000..3ea25da3aa --- /dev/null +++ b/tests/e2e/respect/cafe-api.yaml @@ -0,0 +1,1361 @@ +openapi: 3.2.0 +info: + title: Redocly Cafe + description: > + Demo API for cafe operators (not customers) to manage menus, orders, and + revenue. + + Create API credentials and try it yourself in a realistic OpenAPI workflow. + version: 1.0.0 + contact: + email: team@redocly.com + url: https://redocly.com/contact-us/ + license: + name: MIT + url: https://opensource.org/licenses/MIT + termsOfService: https://redocly.com/subscription-agreement +servers: + - url: https://api.cafe.redocly.com + description: Live server. +tags: + - name: Authorization + description: Create a client to demo the API. + - name: Products + description: Operations related to products. + - name: Orders + description: Order management operations. + - name: Statistics + description: Statistics operations. +paths: + /menu: + get: + tags: + - Products + summary: List all menu items + description: >- + Retrieve a collection of menu items with optional filtering and + pagination. + operationId: listMenuItems + security: [] + parameters: + - $ref: '#/components/parameters/After' + - $ref: '#/components/parameters/Before' + - $ref: '#/components/parameters/Sort' + description: >- + Sorts the collection by a single field. Prefix with `-` for + descending order + + (for example, `-price`); omit the prefix for ascending order + (`price`). + + + **Sortable fields:** `name`, `price`, `createdAt`, `updatedAt`, `id` + example: '-price' + - $ref: '#/components/parameters/Filter' + description: >- + Filters the collection items using space-separated `field:value` + pairs. + + + **Filterable fields:** `name`, `category`, `price`, `createdAt`, + `id` + + + **Format:** `field1:value1 field2:value2` + + + **Supported operators:** + + - `field:value` - Exact match + + - `field:value1,value2` - Match any of the comma-separated values + (OR) + + - Time ranges (on `createdAt`): Use `30d` (30 days), `7d` (7 days), + `1h` (1 hour), etc. + + + **Examples:** + + - `category:beverage` - Filter by a single category. + + - `category:beverage,dessert` - Filter by multiple categories. + + - `createdAt:7d` - Menu items created in the last 7 days. + + - `name:Latte` - Filter by name. + + - `category:beverage price:400` - Combine multiple filters. + example: category:beverage + - $ref: '#/components/parameters/Search' + description: >- + Performs a case-insensitive text search across the searchable + fields, returning + + items where any of them contain the search term as a substring. + + + **Searchable fields:** `name`, `photoTextDescription` + example: Latte + - $ref: '#/components/parameters/Limit' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/MenuItemList' + '400': + $ref: '#/components/responses/BadRequest' + '500': + $ref: '#/components/responses/InternalServerError' + post: + tags: + - Products + summary: Create menu item + description: Create a new menu item. + operationId: createMenuItem + security: + - OAuth2: + - menu:write + requestBody: + required: true + content: + multipart/form-data: + schema: + $ref: '#/components/schemas/MenuItem' + examples: + Beverage: + summary: Create a beverage + value: + name: Cappuccino + price: 4500 + category: beverage + volume: 250 + containsCaffeine: true + photoTextDescription: A hot cappuccino in a white ceramic cup. + Dessert: + summary: Create a dessert + value: + name: Chocolate-Brownie + price: 3500 + category: dessert + calories: 420 + photoTextDescription: A rich chocolate brownie square dusted with cocoa. + responses: + '201': + description: Menu item created successfully. + content: + application/json: + schema: + $ref: '#/components/schemas/MenuItem' + examples: + MenuItemResponse: + value: + id: prd_01khr487f7qm7p44xn427m43vb + object: menuItem + name: coffee + price: 4000 + category: beverage + createdAt: '2026-02-18T10:20:38.228Z' + updatedAt: '2026-02-18T10:20:38.228Z' + volume: 600 + containsCaffeine: false + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '409': + $ref: '#/components/responses/Conflict' + '500': + $ref: '#/components/responses/InternalServerError' + /menu/{menuItemId}: + parameters: + - $ref: '#/components/parameters/MenuItemId' + delete: + tags: + - Products + summary: Delete a menu item + description: Delete an existing menu item. + operationId: deleteMenuItem + security: + - OAuth2: + - menu:write + responses: + '204': + description: Menu item deleted successfully. + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '404': + $ref: '#/components/responses/NotFound' + '500': + $ref: '#/components/responses/InternalServerError' + /menu-item-images/{menuItemId}: + parameters: + - $ref: '#/components/parameters/MenuItemId' + get: + operationId: getMenuItemPhoto + summary: Retrieve a menu item photo + description: Retrieve the product photo image for a specific menu item. + security: [] + tags: + - Products + parameters: + - $ref: '#/components/parameters/PhotoSize' + responses: + '200': + description: Menu item photo retrieved successfully. + content: + image/png: + schema: + type: string + format: binary + text/plain: + schema: + description: Alternative image text. + type: string + '404': + $ref: '#/components/responses/NotFound' + '500': + $ref: '#/components/responses/InternalServerError' + /orders: + get: + tags: + - Orders + summary: List all orders + description: Retrieve a collection of orders with optional filtering and pagination. + operationId: listOrders + security: + - OAuth2: + - orders:read + parameters: + - $ref: '#/components/parameters/Filter' + description: >- + Filters the collection items using space-separated `field:value` + pairs. + + + **Filterable fields:** `customerName`, `status`, `totalPrice`, + `createdAt`, `id` + + + **Format:** `field1:value1 field2:value2` + + + **Supported operators:** + + - `field:value` - Exact match + + - `field:value1,value2` - Match any of the comma-separated values + (OR) + + - Time ranges (on `createdAt`): Use `30d` (30 days), `7d` (7 days), + `1h` (1 hour), etc. + + + **Examples:** + + - `status:placed` - Filter by a single status. + + - `status:placed,completed` - Filter by multiple statuses. + + - `createdAt:30d` - Orders created in the last 30 days. + + - `id:ord_01h1s5z6vf2mm1mz3hevnn9va7` - Filter by a specific order + ID. + + - `status:placed createdAt:7d` - Combine multiple filters. + example: status:placed + - $ref: '#/components/parameters/Sort' + description: >- + Sorts the collection by a single field. Prefix with `-` for + descending order + + (for example, `-createdAt`); omit the prefix for ascending order + (`createdAt`). + + + **Sortable fields:** `customerName`, `status`, `totalPrice`, + `createdAt`, `updatedAt`, `id` + example: '-createdAt' + - $ref: '#/components/parameters/Limit' + - $ref: '#/components/parameters/After' + - $ref: '#/components/parameters/Before' + - $ref: '#/components/parameters/Search' + description: >- + Performs a case-insensitive text search across the searchable + fields, returning + + items where any of them contain the search term as a substring. + + + **Searchable fields:** `customerName`, `id` + example: John + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/OrderList' + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '500': + $ref: '#/components/responses/InternalServerError' + post: + tags: + - Orders + summary: Create order + description: > + Create a new order. + + Order items cannot be changed - if they need to be updated, cancel the + order and place a new one. + operationId: createOrder + security: + - OAuth2: + - orders:write + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Order' + examples: + OrderRequest: + dataValue: + customerName: Mary Ann + orderItems: + - menuItemId: prd_01h1s5z6vf2mm1mz3hevnn9va7 + quantity: 2 + comment: No sugar! + discount: 0 + responses: + '201': + description: Order placed successfully. + content: + application/json: + schema: + $ref: '#/components/schemas/Order' + examples: + OrderResponse: + dataValue: + id: ord_01h1s5z6vf2mm1mz3hevnn9va7 + customerName: Mary Ann + orderItems: + - menuItemId: prd_01h1s5z6vf2mm1mz3hevnn9va7 + quantity: 2 + comment: No sugar! + discount: 0 + object: order + status: placed + totalPrice: 200 + createdAt: '2026-08-24T14:15:22Z' + updatedAt: '2026-08-24T14:15:22Z' + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '500': + $ref: '#/components/responses/InternalServerError' + /orders/{orderId}: + get: + tags: + - Orders + summary: Retrieve an order + description: Retrieve a single order by its ID. + operationId: getOrderById + security: + - OAuth2: + - orders:read + parameters: + - $ref: '#/components/parameters/OrderId' + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + $ref: '#/components/schemas/Order' + examples: + OrderResponse: + dataValue: + id: ord_01h1s5z6vf2mm1mz3hevnn9va7 + customerName: Mary Ann + orderItems: + - menuItemId: prd_01h1s5z6vf2mm1mz3hevnn9va7 + quantity: 2 + comment: No sugar! + discount: 0 + object: order + status: placed + totalPrice: 200 + createdAt: '2026-08-24T14:15:22Z' + updatedAt: '2026-08-24T14:15:22Z' + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '404': + $ref: '#/components/responses/NotFound' + '500': + $ref: '#/components/responses/InternalServerError' + patch: + tags: + - Orders + summary: Partially update an order + description: > + Update an existing order status. + + Order items cannot be changed - if they need to be updated, cancel the + order and place a new one. + operationId: updateOrder + security: + - OAuth2: + - orders:write + parameters: + - $ref: '#/components/parameters/OrderId' + requestBody: + content: + application/json: + schema: + type: object + description: > + Partial order update using JSON Merge Patch - only include + fields to update. + properties: + status: + $ref: '#/components/schemas/OrderStatus' + required: + - status + responses: + '200': + description: Order updated successfully. + content: + application/json: + schema: + $ref: '#/components/schemas/Order' + examples: + OrderResponse: + dataValue: + id: ord_01h1s5z6vf2mm1mz3hevnn9va7 + customerName: Mary Ann + orderItems: + - menuItemId: prd_01h1s5z6vf2mm1mz3hevnn9va7 + quantity: 2 + comment: No sugar! + discount: 0 + object: order + status: completed + totalPrice: 200 + createdAt: '2026-08-24T14:15:22Z' + updatedAt: '2026-08-24T14:15:22Z' + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '404': + $ref: '#/components/responses/NotFound' + '500': + $ref: '#/components/responses/InternalServerError' + delete: + tags: + - Orders + summary: Delete an order + description: | + Delete the order. + To keep the order history, cancel the order instead of deleting it. + operationId: deleteOrder + security: + - OAuth2: + - orders:write + parameters: + - $ref: '#/components/parameters/OrderId' + responses: + '204': + description: Order deleted successfully. + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '404': + $ref: '#/components/responses/NotFound' + '500': + $ref: '#/components/responses/InternalServerError' + /order-items: + get: + tags: + - Orders + summary: List all order items with menu item details + description: | + Returns an array of order items for a specific order. + Use the `filter` parameter to filter by order ID. + operationId: listOrderItems + security: + - OAuth2: + - orders:read + parameters: + - $ref: '#/components/parameters/Filter' + required: true + description: >- + Selects the order whose items to return, using a single + `orderId:` pair + + (for example, `orderId:ord_01h1s5z6vf2mm1mz3hevnn9va7`). + + + This filter is required and only the `orderId` field is supported. + example: orderId:ord_01h1s5z6vf2mm1mz3hevnn9va7 + responses: + '200': + description: Successful operation. + content: + application/json: + schema: + type: array + description: List of menu items that are part of the order. + items: + $ref: '#/components/schemas/OrderItem' + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '404': + $ref: '#/components/responses/NotFound' + '500': + $ref: '#/components/responses/InternalServerError' + /revenue: + get: + tags: + - Statistics + summary: Get revenue statistics + description: > + Retrieve revenue statistics for a configurable date range. + + Returns revenue, order counts, average order amount, and other useful + statistics. + operationId: getRevenue + security: + - ApiKey: [] + - OAuth2: + - revenue:read + parameters: + - name: startDate + in: query + required: false + description: > + Start date for the revenue calculation period (ISO 8601 datetime + format). + + Defaults to 30 days ago if not provided. + schema: + type: string + format: date-time + example: '2026-01-01T00:00:00Z' + - name: endDate + in: query + required: false + description: > + End date for the revenue calculation period (ISO 8601 datetime + format). + + Defaults to current time if not provided. + schema: + type: string + format: date-time + example: '2026-01-31T23:59:59Z' + responses: + '200': + description: Revenue statistics retrieved successfully. + content: + application/json: + schema: + $ref: '#/components/schemas/RevenueStatistics' + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '500': + $ref: '#/components/responses/InternalServerError' + /oauth2/register: + post: + tags: + - Authorization + summary: Create OAuth2 client + description: > + Register a new OAuth2 client for dynamic client registration. This + endpoint implements the Dynamic Client Registration Protocol (RFC 7591), + using camelCase field names instead of the RFC's snake_case convention + (e.g., `redirectUris` instead of `redirect_uris`, `grantTypes` instead + of `grant_types`). The `name` field is required. Other fields are + optional. If not provided: + + - `redirectUris` defaults to an empty array. Note: When using the + `authorization_code` grant type, + `redirectUris` must be provided (per RFC 7591 Section 2). + - `scopes` defaults to all available scopes (menu:read, menu:write, + orders:read, orders:write) - `grantTypes` defaults to both supported + grant types (authorization_code, client_credentials) + + Returns the registered client information per RFC 7591, including: + + - `clientId` and `clientSecret` (must be stored securely) - + `clientIdIssuedAt` and `clientSecretExpiresAt` timestamps - All + registered client metadata (name, redirectUris, scopes, grantTypes) + operationId: registerOAuth2Client + security: [] + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/RegisterClientObject' + examples: + RegisterClientObject: + dataValue: + name: auth + redirectUris: + - https://api.cafe.redocly.com/callback + scopes: + - menu:read + - menu:write + - orders:read + - orders:write + - revenue:read + grantTypes: + - client_credentials + responses: + '201': + description: OAuth2 client registered successfully. + content: + application/json: + schema: + $ref: '#/components/schemas/OAuth2Client' + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '500': + $ref: '#/components/responses/InternalServerError' +webhooks: + order-notification: + post: + tags: + - Orders + operationId: orderNotificationWebhook + security: [] + summary: Order notification webhook + description: Webhook triggered when a new order is placed. + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/OrderNotification' + responses: + '200': + description: Webhook received successfully. + '400': + $ref: '#/components/responses/BadRequest' + '500': + $ref: '#/components/responses/InternalServerError' +components: + securitySchemes: + OAuth2: + type: oauth2 + description: OAuth2 authorization for API access. + flows: + authorizationCode: + authorizationUrl: https://api.cafe.redocly.com/oauth2/authorize + tokenUrl: https://api.cafe.redocly.com/oauth2/token + scopes: + menu:read: Read access to menu items and images + menu:write: Write access to menu items (create, delete) + orders:read: Read access to orders + orders:write: Write access to orders (create, update, delete) + revenue:read: Read access to revenue statistics + clientCredentials: + tokenUrl: https://api.cafe.redocly.com/oauth2/token + scopes: + menu:read: Read access to menu items and images + menu:write: Write access to menu items (create, delete) + orders:read: Read access to orders + orders:write: Write access to orders (create, update, delete) + revenue:read: Read access to revenue statistics + ApiKey: + type: apiKey + name: X-API-Key + in: header + description: API key for internal operations. + parameters: + After: + name: after + in: query + required: false + description: >- + Use the `endCursor` as a value for the `after` parameter to get the next + page. + schema: + type: string + Before: + name: before + in: query + required: false + description: > + Use the `startCursor` as a value for the `before` parameter to get the + previous page. + schema: + type: string + Sort: + name: sort + description: |- + To sort by id in descending order use `-id`. + To sort by id in ascending order use `id`. + in: query + required: false + schema: + type: string + Filter: + name: filter + description: >- + Filters the collection items using space-separated `field:value` pairs. + + See each list endpoint for the specific fields it supports. + + + **Format:** `field1:value1 field2:value2` + + + **Supported operators:** + + - `field:value` - exact match + + - `field:value1,value2` - match any of the comma-separated values (OR) + + - Time ranges (on date fields): use `30d` (30 days), `7d` (7 days), `1h` + (1 hour), etc. + in: query + required: false + schema: + type: string + Search: + name: search + in: query + description: >- + Performs a case-insensitive text search across the endpoint's searchable + fields, + + returning items where any of those fields contain the search term as a + substring. + + See each list endpoint for the specific fields it searches. + required: false + schema: + type: string + Limit: + name: limit + description: > + Specify the number of results per page. + + If there is more data, use in combination with `after` to page through + all results. + in: query + required: false + schema: + type: integer + minimum: 1 + maximum: 100 + default: 10 + example: 10 + MenuItemId: + name: menuItemId + in: path + description: ID of the menu item to retrieve. + required: true + schema: + type: string + pattern: ^prd_[0-9abcdefghjkmnpqrstvwxyz]{26}$ + PhotoSize: + name: photoSize + in: query + description: Photo size to retrieve. + required: false + schema: + type: string + enum: + - thumbnail + - medium + - large + default: medium + OrderId: + name: orderId + in: path + description: ID of the order to retrieve. + required: true + schema: + type: string + pattern: ^ord_[0-9abcdefghjkmnpqrstvwxyz]{26}$ + example: ord_01h1s5z6vf2mm1mz3hevnn9va7 + schemas: + Page: + type: object + properties: + endCursor: + type: + - string + - 'null' + description: |- + Use with the `after` query parameter to load the next page of data. + When `null`, there is no data. + The cursor is opaque and internal structure is subject to change. + startCursor: + type: + - string + - 'null' + description: >- + Use with the `before` query parameter to load the previous page of + data. + + When `null`, there is no data. + + The cursor is opaque and internal structure is subject to change. + hasNextPage: + type: boolean + description: Indicates if there is a next page with items. + hasPrevPage: + type: boolean + description: Indicates if there is a previous page with items. + limit: + type: integer + minimum: 1 + maximum: 100 + default: 10 + description: Value showing how many items are in the page limit. + total: + type: integer + description: Count of items across all pages. + minimum: 0 + required: + - endCursor + - startCursor + - hasNextPage + - hasPrevPage + - limit + - total + MenuBaseItem: + type: object + properties: + createdAt: + description: Created date. + type: string + format: date-time + readOnly: true + updatedAt: + description: Updated date. + type: string + format: date-time + readOnly: true + id: + description: Menu item ID. Unique identifier prefixed with `prd_`. + type: string + readOnly: true + pattern: ^prd_[0-9abcdefghjkmnpqrstvwxyz]{26}$ + example: prd_01h1s5z6vf2mm1mz3hevnn9va7 + object: + description: Entity name. + type: string + const: menuItem + readOnly: true + name: + description: Menu item name. + type: string + minLength: 1 + maxLength: 50 + price: + description: Price in cents. + type: integer + minimum: 0 + photo: + writeOnly: true + type: + - string + - 'null' + format: binary + description: Photo of the menu item. Must be a PNG image less than 1MB in size. + photoUrl: + readOnly: true + type: string + format: uri + description: Photo URL of the menu item. + photoTextDescription: + type: + - string + - 'null' + required: + - id + - name + - price + - createdAt + - updatedAt + - object + Beverage: + allOf: + - type: object + properties: + category: + description: Menu item category. + type: string + const: beverage + volume: + type: number + description: Size of the beverage in milliliters. + exclusiveMinimum: 0 + containsCaffeine: + type: boolean + description: Indicates if the beverage contains caffeine. + required: + - category + - volume + - containsCaffeine + - $ref: '#/components/schemas/MenuBaseItem' + Dessert: + allOf: + - type: object + properties: + category: + description: Menu item category. + type: string + const: dessert + calories: + type: number + exclusiveMinimum: 0 + description: Amount of calories. + required: + - category + - calories + - $ref: '#/components/schemas/MenuBaseItem' + MenuItem: + discriminator: + propertyName: category + mapping: + beverage: '#/components/schemas/Beverage' + dessert: '#/components/schemas/Dessert' + oneOf: + - $ref: '#/components/schemas/Beverage' + - $ref: '#/components/schemas/Dessert' + required: + - category + MenuItemList: + type: object + properties: + object: + type: string + const: list + description: Entity name. + page: + $ref: '#/components/schemas/Page' + items: + type: array + items: + $ref: '#/components/schemas/MenuItem' + required: + - object + - page + - items + Error: + type: object + properties: + type: + type: string + format: uri-reference + description: URI reference that identifies the problem type. + default: about:blank + title: + type: string + description: Short summary of the problem type. + status: + type: integer + format: int32 + description: > + HTTP status code generated by the origin server for this occurrence + of the problem. + minimum: 100 + exclusiveMaximum: 600 + instance: + type: string + format: uri-reference + description: > + URI reference that identifies the specific occurrence of the + problem, e.g. by adding a fragment identifier or sub-path to the + problem type. + + Can be used to locate the root of this problem in the source code. + example: /some/uri-reference#specific-occurrence-context + details: + description: Additional error details. + type: object + additionalProperties: true + required: + - type + - title + - status + OrderStatus: + type: string + description: Order status. + enum: + - placed + - preparing + - completed + - canceled + Order: + type: object + title: Order + properties: + id: + description: Order ID. Unique identifier prefixed with `ord_`. + type: string + format: ulid + readOnly: true + pattern: ^ord_[0-9abcdefghjkmnpqrstvwxyz]{26}$ + example: ord_01h1s5z6vf2mm1mz3hevnn9va7 + object: + description: Entity name. + type: string + const: order + readOnly: true + customerName: + description: > + Name of the customer who placed the order. + + Must start and end with a letter, and can contain letters, spaces, + hyphens, and apostrophes (e.g., "John Doe", "Mary-Jane", "O'Brien"). + type: string + pattern: ^[A-Za-z]+(?:[\s'-][A-Za-z]+)*$ + minLength: 1 + maxLength: 100 + status: + allOf: + - $ref: '#/components/schemas/OrderStatus' + readOnly: true + totalPrice: + description: Total order price in cents. + type: integer + minimum: 0 + readOnly: true + createdAt: + description: Created date. + type: string + format: date-time + readOnly: true + updatedAt: + description: Updated date. + type: string + format: date-time + readOnly: true + orderItems: + type: array + description: List of items to include in the order. + minItems: 1 + items: + type: object + properties: + menuItemId: + type: string + format: ulid + description: ID of the menu item to add to the order. + quantity: + type: integer + minimum: 1 + description: Quantity of the menu item. + discount: + type: integer + minimum: 0 + description: Discount amount in cents (absolute value). + default: 0 + comment: + type: string + maxLength: 500 + description: Optional comment for the order item (e.g., "No sugar"). + required: + - menuItemId + - quantity + required: + - customerName + - orderItems + OrderList: + type: object + properties: + object: + type: string + const: list + description: Entity name. + page: + $ref: '#/components/schemas/Page' + items: + type: array + items: + $ref: '#/components/schemas/Order' + required: + - object + - page + - items + OrderItem: + type: object + properties: + menuItemId: + type: string + description: ID of the menu item to add to the order. + writeOnly: true + menuItem: + allOf: + - $ref: '#/components/schemas/MenuItem' + description: Menu item that is part of the order. + readOnly: true + quantity: + type: integer + minimum: 1 + description: Quantity of the menu item. + discount: + type: integer + minimum: 0 + description: Discount amount in cents (absolute value). + default: 0 + comment: + type: string + maxLength: 500 + description: Optional comment for the order item (e.g., "No sugar"). + required: + - menuItemId + - quantity + RevenueStatistics: + type: object + description: Revenue statistics for a given date range. + properties: + revenue: + type: number + format: float + description: Total revenue in cents from completed orders. + minimum: 0 + averageOrderAmount: + type: number + format: float + description: >- + Average order amount in cents (calculated from completed orders + only). + minimum: 0 + totalOrders: + type: integer + description: Total number of orders (all statuses) in the date range. + minimum: 0 + placedOrders: + type: integer + description: Number of placed orders. + minimum: 0 + preparingOrders: + type: integer + description: Number of preparing orders. + minimum: 0 + completedOrders: + type: integer + description: Number of completed orders. + minimum: 0 + canceledOrders: + type: integer + description: Number of canceled orders. + minimum: 0 + startDate: + type: string + format: date-time + description: Start date of the revenue calculation period. + endDate: + type: string + format: date-time + description: End date of the revenue calculation period. + required: + - revenue + - averageOrderAmount + - totalOrders + - placedOrders + - preparingOrders + - completedOrders + - canceledOrders + - startDate + - endDate + RegisterClientObject: + type: object + properties: + name: + type: string + description: Client name. + redirectUris: + type: array + items: + type: string + format: uri + description: List of redirect URIs (optional, defaults to empty array). + scopes: + type: array + items: + type: string + enum: + - menu:read + - menu:write + - orders:read + - orders:write + - revenue:read + description: List of scopes. + grantTypes: + type: array + items: + type: string + enum: + - authorization_code + - client_credentials + description: List of grant types. + required: + - name + OAuth2Client: + type: object + description: >- + OAuth2 client registration response. Per RFC 7591, includes the client + identifier, secret, timestamps, and all registered client metadata. + properties: + clientId: + type: string + description: Client identifier issued by the authorization server. + clientSecret: + type: string + description: Client secret issued by the authorization server. + clientIdIssuedAt: + type: integer + format: int64 + description: >- + Time when the client_id is issued, represented as seconds since + epoch (RFC7591). + clientSecretExpiresAt: + type: integer + format: int64 + description: >- + Time at which the client_secret expires, represented as seconds + since epoch. 0 indicates the secret does not expire (RFC 7591). + name: + type: string + description: Client name (registered metadata). + redirectUris: + type: array + items: + type: string + format: uri + description: List of redirect URIs (registered metadata). + registrationClientUri: + type: string + format: uri + description: >- + URL of the client configuration endpoint for managing this client + registration (RFC 7592). + registrationAccessToken: + type: string + description: >- + Access token to be used at the client configuration endpoint for + managing this client registration (RFC 7592). + scopes: + type: array + items: + type: string + enum: + - menu:read + - menu:write + - orders:read + - orders:write + - revenue:read + description: List of scopes (registered metadata). + grantTypes: + type: array + items: + type: string + enum: + - authorization_code + - client_credentials + description: List of grant types (registered metadata). + required: + - clientId + - clientSecret + - clientIdIssuedAt + - clientSecretExpiresAt + - registrationClientUri + - registrationAccessToken + OrderNotification: + type: object + required: + - orderId + - orderStatus + - timestamp + properties: + orderId: + type: string + description: Unique order identifier. + orderStatus: + $ref: '#/components/schemas/OrderStatus' + timestamp: + type: string + format: date-time + description: When the event occurred. + responses: + BadRequest: + description: Bad request - invalid input parameters. + content: + application/problem+json: + schema: + $ref: '#/components/schemas/Error' + InternalServerError: + description: Internal server error. + content: + application/problem+json: + schema: + $ref: '#/components/schemas/Error' + Unauthorized: + description: Unauthorized - authorization required. + content: + application/problem+json: + schema: + $ref: '#/components/schemas/Error' + Forbidden: + description: Forbidden - insufficient permissions. + content: + application/problem+json: + schema: + $ref: '#/components/schemas/Error' + Conflict: + description: Conflict - entity already exists. + content: + application/problem+json: + schema: + $ref: '#/components/schemas/Error' + NotFound: + description: Resource not found. + content: + application/problem+json: + schema: + $ref: '#/components/schemas/Error' diff --git a/tests/e2e/respect/cafe-menu.arazzo.yaml b/tests/e2e/respect/cafe-menu.arazzo.yaml new file mode 100644 index 0000000000..78a5df20c9 --- /dev/null +++ b/tests/e2e/respect/cafe-menu.arazzo.yaml @@ -0,0 +1,34 @@ +arazzo: 1.0.1 +info: + title: Redocly Cafe API Menu Search + description: >- + A part of the Redocly Cafe API test fixtures. + Searches the cafe menu and exposes the search result as workflow outputs. + version: 1.0.0 + +sourceDescriptions: + - name: cafe-api + type: openapi + url: cafe-api.yaml + +workflows: + - workflowId: search-menu-items + description: >- + This workflow demonstrates how to search menu items in the cafe menu. + steps: + - stepId: search-menu + description: >- + Search menu items resolving request details with listMenuItems operationId from cafe-api.yaml description. + operationId: listMenuItems + parameters: + - in: query + name: search + value: mermaid-treasure-latte + successCriteria: + - condition: $statusCode == 200 + outputs: + total: $response.body#/page/total + fullBody: $response.body + outputs: + total: $steps.search-menu.outputs.total + stepFullBody: $steps.search-menu.outputs.fullBody diff --git a/tests/e2e/respect/case-insensitive-headers/__snapshots__/case-insensitive-headers.test.ts.snap b/tests/e2e/respect/case-insensitive-headers/__snapshots__/case-insensitive-headers.test.ts.snap index 772e940a4f..a305bec23b 100644 --- a/tests/e2e/respect/case-insensitive-headers/__snapshots__/case-insensitive-headers.test.ts.snap +++ b/tests/e2e/respect/case-insensitive-headers/__snapshots__/case-insensitive-headers.test.ts.snap @@ -3,13 +3,13 @@ exports[`should send in request and proceed case-insensitive headers in runtime expressions 1`] = ` "──────────────────────────────────────────────────────────────────────────────── - Running workflow case-insensitive-headers.arazzo.yaml / get-museum-hours + Running workflow case-insensitive-headers.arazzo.yaml / get-menu-items - ✓ GET /museum-hours - step get-museum-hours + ✓ GET /menu - step get-menu-items     ✓ success criteria check - $request.header.content-type == 'third'     ✓ success criteria check - $request.header.CammelCasedHeader == 'custom-heade... -    ✓ success criteria check - $response.header.X-Content-Type-Options == 'nosnif... -    ✓ status code check - $statusCode in [200, 400, 404] +    ✓ success criteria check - $response.header.Content-TYPE == 'application/json... +    ✓ status code check - $statusCode in [200, 400, 500]     ✓ content-type check     ✓ schema check diff --git a/tests/e2e/respect/case-insensitive-headers/case-insensitive-headers.arazzo.yaml b/tests/e2e/respect/case-insensitive-headers/case-insensitive-headers.arazzo.yaml index 54a87f13f5..ea3c3db7d5 100644 --- a/tests/e2e/respect/case-insensitive-headers/case-insensitive-headers.arazzo.yaml +++ b/tests/e2e/respect/case-insensitive-headers/case-insensitive-headers.arazzo.yaml @@ -1,27 +1,23 @@ arazzo: 1.0.1 info: - title: Redocly Museum API + title: Case insensitive headers description: >- Testing case insensitive headers in workflows version: 1.0.0 sourceDescriptions: - - name: museum-api + - name: cafe-api type: openapi - url: ../museum-api.yaml + url: ../cafe-api.yaml workflows: - - workflowId: get-museum-hours + - workflowId: get-menu-items description: >- - This workflow demonstrates how to get the museum opening hours and buy tickets. - parameters: - - in: header - name: Authorization - value: Basic Og== + This workflow demonstrates how to list the cafe menu items. steps: - - stepId: get-museum-hours + - stepId: get-menu-items description: >- - Get museum hours by resolving request details with getMuseumHours operationId from museum-api.yaml description. + List menu items by resolving request details with listMenuItems operationId from cafe-api.yaml description. parameters: - in: header name: CammelCasedHeader @@ -35,8 +31,8 @@ workflows: - in: header name: ContenT-TypE value: third - operationId: museum-api.getMuseumHours + operationId: cafe-api.listMenuItems successCriteria: - condition: $request.header.content-type == 'third' - - condition: $request.header.CammelCasedHeader == 'custom-header' && $response.header.X-Frame-Options == 'deny' - - condition: $response.header.X-Content-Type-Options == 'nosniff' + - condition: $request.header.CammelCasedHeader == 'custom-header' && $response.header.X-Powered-By == 'Express' + - condition: $response.header.Content-TYPE == 'application/json; charset=utf-8' diff --git a/tests/e2e/respect/consider-severity-in-next-step-execution/__snapshots__/consider-severity-in-next-step-execution.test.ts.snap b/tests/e2e/respect/consider-severity-in-next-step-execution/__snapshots__/consider-severity-in-next-step-execution.test.ts.snap index 559196de02..7240113f7f 100644 --- a/tests/e2e/respect/consider-severity-in-next-step-execution/__snapshots__/consider-severity-in-next-step-execution.test.ts.snap +++ b/tests/e2e/respect/consider-severity-in-next-step-execution/__snapshots__/consider-severity-in-next-step-execution.test.ts.snap @@ -5,12 +5,11 @@ exports[`should not follow the default behavior to break and return if onFailure Running workflow consider-severity-in-next-step-execution.arazzo.yaml / first-workflow - ✓ GET /museum-hours - step first-step + ✓ GET /menu - step first-step -    Request URL: https://redocly.com/_mock/demo/openapi/museum-api/museum-hours +    Request URL: https://api.cafe.redocly.com/menu?search=mermaid-treasure-latte     Request Headers: -      accept: application/json, application/problem+json -      authorization: Basic Og== +      accept: application/json, application/problem+json     Response status code: 200 @@ -18,61 +17,21 @@ exports[`should not follow the default behavior to break and return if onFailure     Response Headers:     Response Size: bytes     Response Body: -      [ -       { -       "date": "2023-09-11", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-12", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-13", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-14", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-15", -       "timeOpen": "10:00", -       "timeClose": "16:00" -       }, -       { -       "date": "2023-09-18", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-19", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-20", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-21", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-22", -       "timeOpen": "10:00", -       "timeClose": "16:00" -       } -      ] +      { +       "object": "list", +       "page": { +       "startCursor": null, +       "endCursor": null, +       "hasNextPage": false, +       "hasPrevPage": false, +       "limit": 10, +       "total": 0 +       }, +       "items": [] +      }     ✓ success criteria check - $statusCode == 200 -    ✓ status code check - $statusCode in [200, 400, 404] +    ✓ status code check - $statusCode in [200, 400, 500]     ✓ content-type check     ✓ schema check @@ -80,12 +39,11 @@ exports[`should not follow the default behavior to break and return if onFailure Running workflow consider-severity-in-next-step-execution.arazzo.yaml / second-workflow - ✗ GET /special-events - step list-events + ✗ GET /menu - step list-menu-items -    Request URL: https://redocly.com/_mock/demo/openapi/museum-api/special-events +    Request URL: https://api.cafe.redocly.com/menu?search=mermaid-treasure-latte     Request Headers: -      accept: application/json, application/problem+json -      authorization: Basic Og== +      accept: application/json, application/problem+json     Response status code: 200 @@ -93,138 +51,32 @@ exports[`should not follow the default behavior to break and return if onFailure     Response Headers:     Response Size: bytes     Response Body: -      [ -       { -       "eventId": "f3e0e76e-e4a8-466e-ab9c-ae36c15b8e97", -       "name": "Sasquatch Ballet", -       "location": "Seattle... probably", -       "eventDescription": "They're big, they're hairy, but they're also graceful. Come learn how the biggest feet can have the lightest touch.", -       "dates": [ -       "2023-12-15", -       "2023-12-22" -       ], -       "price": 40 -       }, -       { -       "eventId": "2f14374a-9c65-4ee5-94b7-fba66d893483", -       "name": "Solar Telescope Demonstration", -       "location": "Far from the sun.", -       "eventDescription": "Look at the sun without going blind!", -       "dates": [ -       "2023-09-07", -       "2023-09-14" -       ], -       "price": 50 -       }, -       { -       "eventId": "6aaa61ba-b2aa-4868-b803-603dbbf7bfdb", -       "name": "Cook like a Caveman", -       "location": "Fire Pit on East side", -       "eventDescription": "Learn to cook on an open flame.", -       "dates": [ -       "2023-11-10", -       "2023-11-17", -       "2023-11-24" -       ], -       "price": 5 -       }, -       { -       "eventId": "602b75e1-5696-4ab8-8c7a-f9e13580f910", -       "name": "Underwater Basket Weaving", -       "location": "Rec Center Pool next door.", -       "eventDescription": "Learn to weave baskets underwater.", -       "dates": [ -       "2023-09-12", -       "2023-09-15" -       ], -       "price": 15 -       }, -       { -       "eventId": "dad4bce8-f5cb-4078-a211-995864315e39", -       "name": "Mermaid Treasure Identification and Analysis", -       "location": "Room Sea-12", -       "eventDescription": "Join us as we review and classify a rare collection of 20 thingamabobs, gadgets, gizmos, whoosits, and whatsits — kindly donated by Ariel.", -       "dates": [ -       "2023-09-05", -       "2023-09-08" -       ], -       "price": 30 -       }, -       { -       "eventId": "6744a0da-4121-49cd-8479-f8cc20526495", -       "name": "Time Traveler Tea Party", -       "location": "Temporal Tearoom", -       "eventDescription": "Sip tea with important historical figures.", -       "dates": [ -       "2023-11-18", -       "2023-11-25", -       "2023-12-02" -       ], -       "price": 60 -       }, -       { -       "eventId": "3be6453c-03eb-4357-ae5a-984a0e574a54", -       "name": "Pirate Coding Workshop", -       "location": "Computer Room", -       "eventDescription": "Captain Blackbeard shares his love of the C...language. And possibly Arrrrr (R lang).", -       "dates": [ -       "2023-10-29", -       "2023-10-30", -       "2023-10-31" -       ], -       "price": 45 -       }, -       { -       "eventId": "9d90d29a-2af5-4206-97d9-9ea9ceadcb78", -       "name": "Llama Street Art Through the Ages", -       "location": "Auditorium", -       "eventDescription": "Llama street art?! Alpaca my bags -- let's go!", -       "dates": [ -       "2023-10-29", -       "2023-10-30", -       "2023-10-31" -       ], -       "price": 45 -       }, -       { -       "eventId": "a3c7b2c4-b5fb-4ef7-9322-00a919864957", -       "name": "The Great Parrot Debate", -       "location": "Outdoor Amphitheatre", -       "eventDescription": "See leading parrot minds discuss important geopolitical issues.", -       "dates": [ -       "2023-11-03", -       "2023-11-10" -       ], -       "price": 35 -       }, -       { -       "eventId": "b92d46b7-4c5d-422b-87a5-287767e26f29", -       "name": "Eat a Bunch of Corn", -       "location": "Cafeteria", -       "eventDescription": "We accidentally bought too much corn. Please come eat it.", -       "dates": [ -       "2023-11-10", -       "2023-11-17", -       "2023-11-24" -       ], -       "price": 5 -       } -      ] +      { +       "object": "list", +       "page": { +       "startCursor": null, +       "endCursor": null, +       "hasNextPage": false, +       "hasPrevPage": false, +       "limit": 10, +       "total": 0 +       }, +       "items": [] +      }     ⚠ success criteria check - $statusCode == 201 -    ✓ status code check - $statusCode in [200, 400, 404] +    ✓ status code check - $statusCode in [200, 400, 500]     ✓ content-type check     ✓ schema check Running child workflow for the step call-first-workflow Running workflow consider-severity-in-next-step-execution.arazzo.yaml / first-workflow - ✓ GET /museum-hours - step first-step + ✓ GET /menu - step first-step -    Request URL: https://redocly.com/_mock/demo/openapi/museum-api/museum-hours +    Request URL: https://api.cafe.redocly.com/menu?search=mermaid-treasure-latte     Request Headers: -      accept: application/json, application/problem+json -      authorization: Basic Og== +      accept: application/json, application/problem+json     Response status code: 200 @@ -232,61 +84,21 @@ exports[`should not follow the default behavior to break and return if onFailure     Response Headers:     Response Size: bytes     Response Body: -      [ -       { -       "date": "2023-09-11", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-12", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-13", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-14", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-15", -       "timeOpen": "10:00", -       "timeClose": "16:00" -       }, -       { -       "date": "2023-09-18", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-19", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-20", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-21", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-22", -       "timeOpen": "10:00", -       "timeClose": "16:00" -       } -      ] +      { +       "object": "list", +       "page": { +       "startCursor": null, +       "endCursor": null, +       "hasNextPage": false, +       "hasPrevPage": false, +       "limit": 10, +       "total": 0 +       }, +       "items": [] +      }     ✓ success criteria check - $statusCode == 200 -    ✓ status code check - $statusCode in [200, 400, 404] +    ✓ status code check - $statusCode in [200, 400, 500]     ✓ content-type check     ✓ schema check @@ -296,7 +108,7 @@ exports[`should not follow the default behavior to break and return if onFailure   Workflow name: second-workflow -    stepId - list-events +    stepId - list-menu-items     ⚠ success criteria check       Checking simple criteria: {"condition":"$statusCode == 201"}        diff --git a/tests/e2e/respect/consider-severity-in-next-step-execution/consider-severity-in-next-step-execution.arazzo.yaml b/tests/e2e/respect/consider-severity-in-next-step-execution/consider-severity-in-next-step-execution.arazzo.yaml index 78ed32d023..59356c17e6 100644 --- a/tests/e2e/respect/consider-severity-in-next-step-execution/consider-severity-in-next-step-execution.arazzo.yaml +++ b/tests/e2e/respect/consider-severity-in-next-step-execution/consider-severity-in-next-step-execution.arazzo.yaml @@ -1,34 +1,34 @@ arazzo: 1.0.1 info: - title: Redocly Museum API + title: Consider severity in next step execution version: 1.0.0 sourceDescriptions: - - name: museum-api + - name: cafe-api type: openapi - url: ../museum-api.yaml + url: ../cafe-api.yaml workflows: - workflowId: first-workflow - parameters: - - in: header - name: Authorization - value: Basic Og== steps: - stepId: first-step - operationId: museum-api.getMuseumHours + operationId: cafe-api.listMenuItems + parameters: + - in: query + name: search + value: mermaid-treasure-latte successCriteria: - condition: $statusCode == 200 - workflowId: second-workflow description: >- - This workflow demonstrates how to list, create, update, and delete special events at the museum. - parameters: - - in: header - name: Authorization - value: Basic Og== + This workflow demonstrates how to list the cafe menu items. steps: - - stepId: list-events - operationPath: '{$sourceDescriptions.museum-api.url}#/paths/~1special-events/get' + - stepId: list-menu-items + operationPath: '{$sourceDescriptions.cafe-api.url}#/paths/~1menu/get' + parameters: + - in: query + name: search + value: mermaid-treasure-latte successCriteria: # Make this check fail - condition: $statusCode == 201 diff --git a/tests/e2e/respect/inputs-passed-to-step-target-workflow-and-remapped/__snapshots__/inputs-passed-to-step-target-workflow-and-remapped.test.ts.snap b/tests/e2e/respect/inputs-passed-to-step-target-workflow-and-remapped/__snapshots__/inputs-passed-to-step-target-workflow-and-remapped.test.ts.snap index a240c735cf..7557180771 100644 --- a/tests/e2e/respect/inputs-passed-to-step-target-workflow-and-remapped/__snapshots__/inputs-passed-to-step-target-workflow-and-remapped.test.ts.snap +++ b/tests/e2e/respect/inputs-passed-to-step-target-workflow-and-remapped/__snapshots__/inputs-passed-to-step-target-workflow-and-remapped.test.ts.snap @@ -6,11 +6,11 @@ exports[`should pass inputs to step target workflow with additional input parame Running workflow inputs-passed-to-step-target-workflow-and-remapped.arazzo.yaml / inputs-passed-to-step-target-workflow Running child workflow for the step health-workflow - Running workflow events.arazzo.yaml / events-crud + Running workflow events.arazzo.yaml / client-registration - ✗ POST /special-events - step create-event + ✓ POST /oauth2/register - step create-client -    Request URL: https://redocly.com/_mock/demo/openapi/museum-api/special-events +    Request URL: https://api.cafe.redocly.com/oauth2/register     Request Headers:       content-type: application/json       accept: application/json, application/problem+json @@ -21,14 +21,7 @@ exports[`should pass inputs to step target workflow with additional input parame       {        "PROJECT_CLIENT_ID": "0000001",        "PROJECT_CLIENT_SECRET": "PROJECT_CLIENT_SECRET", -       "PROJECT_SUBSCRIPTION_KEY": "PROJECT_SUBSCRIPTION_KEY", -       "name": "Mermaid Treasure Identification and Analysis", -       "location": "Under the seaaa 🦀 🎶 🌊.", -       "eventDescription": "Join us as we review and classify a rare collection of 20 thingamabobs, gadgets, gizmos, whoosits, and whatsits, kindly donated by Ariel.", -       "dates": [ -       "2023-09-05", -       "2023-09-08" -       ] +       "PROJECT_SUBSCRIPTION_KEY": "PROJECT_SUBSCRIPTION_KEY"       } @@ -38,45 +31,47 @@ exports[`should pass inputs to step target workflow with additional input parame     Response Size: bytes     Response Body:       { -       "type": "object", -       "title": "Error validating body. data must have required property 'price'" +       "type": "about:blank", +       "title": "Validation failed", +       "status": 400, +       "instance": "/oauth2/register", +       "details": { +       "errors": [ +       { +       "code": "invalid_type", +       "expected": "string", +       "received": "undefined", +       "path": [ +       "name" +       ], +       "message": "Required" +       } +       ] +       }       } -    ✗ success criteria check - $statusCode == 201 -    ✗ success criteria check - $[?@.name == 'Mermaid Treasure Identification and ... -    ✓ status code check - $statusCode in [201, 400, 404] +    ✓ success criteria check - $statusCode == 400 +    ✓ success criteria check - $[?@.title == 'Validation failed'] +    ✓ status code check - $statusCode in [201, 400, 401, 500]     ✓ content-type check     ✓ schema check - -  Failed tests info: - -  Workflow name: inputs-passed-to-step-target-workflow -    stepId - create-event -    ✗ success criteria check -      Checking simple criteria: {"condition":"$statusCode == 201"} -       -    ✗ success criteria check -      Checking jsonpath criteria: $[?@.name == 'Mermaid Treasure Identification and Analysis'] -         Summary for inputs-passed-to-step-target-workflow-and-remapped.arazzo.yaml    -  Workflows: 1 failed, 1 total -  Steps: 1 failed, 1 total -  Checks: 3 passed, 2 failed, 5 total +  Workflows: 1 passed, 1 total +  Steps: 1 passed, 1 total +  Checks: 5 passed, 5 total   Time: ms ┌────────────────────────────────────────────────────────────────────────────────────────────────────────┬────────────┬─────────┬─────────┬──────────┐ │ Filename │ Workflows │ Passed │ Failed │ Warnings │ ├────────────────────────────────────────────────────────────────────────────────────────────────────────┼────────────┼─────────┼─────────┼──────────┤ -│ x inputs-passed-to-step-target-workflow-and-remapped.arazzo.yaml │ 1 │ 0 │ 1 │ - │ +│ ✓ inputs-passed-to-step-target-workflow-and-remapped.arazzo.yaml │ 1 │ 1 │ - │ - │ └────────────────────────────────────────────────────────────────────────────────────────────────────────┴────────────┴─────────┴─────────┴──────────┘ - Tests exited with error - " `; diff --git a/tests/e2e/respect/inputs-passed-to-step-target-workflow-and-remapped/events.arazzo.yaml b/tests/e2e/respect/inputs-passed-to-step-target-workflow-and-remapped/events.arazzo.yaml index dba82cd487..22af87d279 100644 --- a/tests/e2e/respect/inputs-passed-to-step-target-workflow-and-remapped/events.arazzo.yaml +++ b/tests/e2e/respect/inputs-passed-to-step-target-workflow-and-remapped/events.arazzo.yaml @@ -6,14 +6,14 @@ info: version: 1.0.0 sourceDescriptions: - - name: museum-api + - name: cafe-api type: openapi - url: ../museum-api.yaml + url: ../cafe-api.yaml workflows: - - workflowId: events-crud + - workflowId: client-registration description: >- - This workflow demonstrates how to list, create, update, and delete special events at the museum. + This workflow demonstrates how to pass inputs into an OAuth2 client registration request. parameters: - in: header name: Authorization @@ -40,24 +40,18 @@ workflows: type: string format: password steps: - - stepId: create-event + - stepId: create-client description: >- - Create a new special event. - operationPath: '{$sourceDescriptions.museum-api.url}#/paths/~1special-events/post' + Try to register a new OAuth2 client without the required `name` field. + operationPath: '{$sourceDescriptions.cafe-api.url}#/paths/~1oauth2~1register/post' requestBody: payload: PROJECT_CLIENT_ID: $inputs.PROJECT_CLIENT_ID PROJECT_CLIENT_SECRET: $inputs.PROJECT_CLIENT_SECRET PROJECT_SUBSCRIPTION_KEY: $inputs.PROJECT_SUBSCRIPTION_KEY - name: 'Mermaid Treasure Identification and Analysis' - location: 'Under the seaaa 🦀 🎶 🌊.' - eventDescription: 'Join us as we review and classify a rare collection of 20 thingamabobs, gadgets, gizmos, whoosits, and whatsits, kindly donated by Ariel.' - dates: - - '2023-09-05' - - '2023-09-08' price: $inputs.custom_price successCriteria: - - condition: $statusCode == 201 + - condition: $statusCode == 400 - context: $response.body - condition: "$[?@.name == 'Mermaid Treasure Identification and Analysis']" + condition: "$[?@.title == 'Validation failed']" type: jsonpath diff --git a/tests/e2e/respect/inputs-passed-to-step-target-workflow-and-remapped/inputs-passed-to-step-target-workflow-and-remapped.arazzo.yaml b/tests/e2e/respect/inputs-passed-to-step-target-workflow-and-remapped/inputs-passed-to-step-target-workflow-and-remapped.arazzo.yaml index 85dd469320..0057a433ae 100644 --- a/tests/e2e/respect/inputs-passed-to-step-target-workflow-and-remapped/inputs-passed-to-step-target-workflow-and-remapped.arazzo.yaml +++ b/tests/e2e/respect/inputs-passed-to-step-target-workflow-and-remapped/inputs-passed-to-step-target-workflow-and-remapped.arazzo.yaml @@ -1,14 +1,14 @@ arazzo: 1.0.1 info: - title: Test inputs passed to step target workflow + title: Test inputs passed to step target workflow and remapped version: 1.0.0 sourceDescriptions: - - name: events + - name: clients url: ./events.arazzo.yaml type: arazzo workflows: - workflowId: inputs-passed-to-step-target-workflow - summary: PEARL Merchandising API - Health Check for PRD + summary: Redocly Cafe API - Health Check for PRD inputs: type: object properties: @@ -20,7 +20,7 @@ workflows: type: string steps: - stepId: health-workflow - workflowId: $sourceDescriptions.events.events-crud + workflowId: $sourceDescriptions.clients.client-registration parameters: - name: custom_price value: 800 diff --git a/tests/e2e/respect/inputs-passed-to-step-target-workflow/__snapshots__/inputs-passed-to-step-target-workflow.test.ts.snap b/tests/e2e/respect/inputs-passed-to-step-target-workflow/__snapshots__/inputs-passed-to-step-target-workflow.test.ts.snap index f52cb65e64..2d4e1c58a3 100644 --- a/tests/e2e/respect/inputs-passed-to-step-target-workflow/__snapshots__/inputs-passed-to-step-target-workflow.test.ts.snap +++ b/tests/e2e/respect/inputs-passed-to-step-target-workflow/__snapshots__/inputs-passed-to-step-target-workflow.test.ts.snap @@ -6,11 +6,11 @@ exports[`should pass inputs to step target workflow with additional input parame Running workflow inputs-passed-to-step-target-workflow.arazzo.yaml / inputs-passed-to-step-target-workflow Running child workflow for the step health-workflow - Running workflow events.arazzo.yaml / events-crud + Running workflow events.arazzo.yaml / client-registration - ✓ POST /special-events - step create-event + ✓ POST /oauth2/register - step create-client -    Request URL: https://redocly.com/_mock/demo/openapi/museum-api/special-events +    Request URL: https://api.cafe.redocly.com/oauth2/register     Request Headers:       content-type: application/json       accept: application/json, application/problem+json @@ -21,37 +21,38 @@ exports[`should pass inputs to step target workflow with additional input parame        "PROJECT_CLIENT_ID": "0000001",        "PROJECT_CLIENT_SECRET": "PROJECT_CLIENT_SECRET",        "PROJECT_SUBSCRIPTION_KEY": "PROJECT_SUBSCRIPTION_KEY", -       "name": "Mermaid Treasure Identification and Analysis", -       "location": "Under the seaaa 🦀 🎶 🌊.", -       "eventDescription": "Join us as we review and classify a rare collection of 20 thingamabobs, gadgets, gizmos, whoosits, and whatsits, kindly donated by Ariel.", -       "dates": [ -       "2023-09-05", -       "2023-09-08" -       ],        "price": 800       } -    Response status code: 201 +    Response status code: 400     Response time: ms     Response Headers:     Response Size: bytes     Response Body:       { -       "eventId": "dad4bce8-f5cb-4078-a211-995864315e39", -       "name": "Mermaid Treasure Identification and Analysis", -       "location": "Under the seaaa 🦀 🎶 🌊.", -       "eventDescription": "Join us as we review and classify a rare collection of 20 thingamabobs, gadgets, gizmos, whoosits, and whatsits, kindly donated by Ariel.", -       "dates": [ -       "2023-09-05", -       "2023-09-08" -       ], -       "price": 800 +       "type": "about:blank", +       "title": "Validation failed", +       "status": 400, +       "instance": "/oauth2/register", +       "details": { +       "errors": [ +       { +       "code": "invalid_type", +       "expected": "string", +       "received": "undefined", +       "path": [ +       "name" +       ], +       "message": "Required" +       } +       ] +       }       } -    ✓ success criteria check - $statusCode == 201 -    ✓ success criteria check - $[?@.name == 'Mermaid Treasure Identification and ... -    ✓ status code check - $statusCode in [201, 400, 404] +    ✓ success criteria check - $statusCode == 400 +    ✓ success criteria check - $[?@.title == 'Validation failed'] +    ✓ status code check - $statusCode in [201, 400, 401, 500]     ✓ content-type check     ✓ schema check diff --git a/tests/e2e/respect/inputs-passed-to-step-target-workflow/events.arazzo.yaml b/tests/e2e/respect/inputs-passed-to-step-target-workflow/events.arazzo.yaml index 439a9a057d..b5ebcfcb26 100644 --- a/tests/e2e/respect/inputs-passed-to-step-target-workflow/events.arazzo.yaml +++ b/tests/e2e/respect/inputs-passed-to-step-target-workflow/events.arazzo.yaml @@ -6,14 +6,14 @@ info: version: 1.0.0 sourceDescriptions: - - name: museum-api + - name: cafe-api type: openapi - url: ../museum-api.yaml + url: ../cafe-api.yaml workflows: - - workflowId: events-crud + - workflowId: client-registration description: >- - This workflow demonstrates how to list, create, update, and delete special events at the museum. + This workflow demonstrates how to pass inputs into an OAuth2 client registration request. parameters: - in: header name: Authorization @@ -39,24 +39,18 @@ workflows: type: string format: password steps: - - stepId: create-event + - stepId: create-client description: >- - Create a new special event. - operationPath: '{$sourceDescriptions.museum-api.url}#/paths/~1special-events/post' + Try to register a new OAuth2 client without the required `name` field. + operationPath: '{$sourceDescriptions.cafe-api.url}#/paths/~1oauth2~1register/post' requestBody: payload: PROJECT_CLIENT_ID: $inputs.PROJECT_CLIENT_ID PROJECT_CLIENT_SECRET: $inputs.PROJECT_CLIENT_SECRET PROJECT_SUBSCRIPTION_KEY: $inputs.PROJECT_SUBSCRIPTION_KEY - name: 'Mermaid Treasure Identification and Analysis' - location: 'Under the seaaa 🦀 🎶 🌊.' - eventDescription: 'Join us as we review and classify a rare collection of 20 thingamabobs, gadgets, gizmos, whoosits, and whatsits, kindly donated by Ariel.' - dates: - - '2023-09-05' - - '2023-09-08' price: $inputs.custom_price successCriteria: - - condition: $statusCode == 201 + - condition: $statusCode == 400 - context: $response.body - condition: "$[?@.name == 'Mermaid Treasure Identification and Analysis']" + condition: "$[?@.title == 'Validation failed']" type: jsonpath diff --git a/tests/e2e/respect/inputs-passed-to-step-target-workflow/inputs-passed-to-step-target-workflow.arazzo.yaml b/tests/e2e/respect/inputs-passed-to-step-target-workflow/inputs-passed-to-step-target-workflow.arazzo.yaml index 85dd469320..8e5dc6c0c1 100644 --- a/tests/e2e/respect/inputs-passed-to-step-target-workflow/inputs-passed-to-step-target-workflow.arazzo.yaml +++ b/tests/e2e/respect/inputs-passed-to-step-target-workflow/inputs-passed-to-step-target-workflow.arazzo.yaml @@ -3,12 +3,12 @@ info: title: Test inputs passed to step target workflow version: 1.0.0 sourceDescriptions: - - name: events + - name: clients url: ./events.arazzo.yaml type: arazzo workflows: - workflowId: inputs-passed-to-step-target-workflow - summary: PEARL Merchandising API - Health Check for PRD + summary: Redocly Cafe API - Health Check for PRD inputs: type: object properties: @@ -20,7 +20,7 @@ workflows: type: string steps: - stepId: health-workflow - workflowId: $sourceDescriptions.events.events-crud + workflowId: $sourceDescriptions.clients.client-registration parameters: - name: custom_price value: 800 diff --git a/tests/e2e/respect/inputs-with-cli-and-env/__snapshots__/inputs-with-cli-and-env.test.ts.snap b/tests/e2e/respect/inputs-with-cli-and-env/__snapshots__/inputs-with-cli-and-env.test.ts.snap index 83a688889a..942fee0559 100644 --- a/tests/e2e/respect/inputs-with-cli-and-env/__snapshots__/inputs-with-cli-and-env.test.ts.snap +++ b/tests/e2e/respect/inputs-with-cli-and-env/__snapshots__/inputs-with-cli-and-env.test.ts.snap @@ -3,11 +3,11 @@ exports[`should use inputs from CLI and env 1`] = ` "──────────────────────────────────────────────────────────────────────────────── - Running workflow inputs-with-cli-and-env.arazzo.yaml / get-museum-hours + Running workflow inputs-with-cli-and-env.arazzo.yaml / get-menu-items - ✓ GET /museum-hours - step get-museum-hours + ✓ GET /menu - step get-menu-items -    Request URL: https://redocly.com/_mock/demo/openapi/museum-api/museum-hours +    Request URL: https://api.cafe.redocly.com/menu?search=mermaid-treasure-latte     Request Headers:       accept: application/json, application/problem+json       authorization: Basic Og== @@ -18,104 +18,61 @@ exports[`should use inputs from CLI and env 1`] = `     Response Headers:     Response Size: bytes     Response Body: -      [ -       { -       "date": "2023-09-11", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-12", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-13", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-14", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-15", -       "timeOpen": "10:00", -       "timeClose": "16:00" -       }, -       { -       "date": "2023-09-18", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-19", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-20", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-21", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-22", -       "timeOpen": "10:00", -       "timeClose": "16:00" -       } -      ] +      { +       "object": "list", +       "page": { +       "startCursor": null, +       "endCursor": null, +       "hasNextPage": false, +       "hasPrevPage": false, +       "limit": 10, +       "total": 0 +       }, +       "items": [] +      }     ✓ success criteria check - $statusCode == 200 -    ✓ status code check - $statusCode in [200, 400, 404] +    ✓ status code check - $statusCode in [200, 400, 500]     ✓ content-type check     ✓ schema check - Running child workflow for the step buy-ticket - Running workflow museum-tickets.yaml / get-museum-tickets + Running child workflow for the step search-menu + Running workflow cafe-menu.arazzo.yaml / search-menu-items - ✓ POST /tickets - step buy-tickets + ✓ GET /menu - step search-menu -    Request URL: https://redocly.com/_mock/demo/openapi/museum-api/tickets +    Request URL: https://api.cafe.redocly.com/menu?search=mermaid-treasure-latte     Request Headers: -      content-type: application/json -      accept: application/json, application/problem+json -      authorization: Basic Og== -    Request Body: -      { -       "ticketType": "general", -       "ticketDate": "2023-09-07", -       "email": "todd@example.com" -      } +      accept: application/json, application/problem+json -    Response status code: 201 +    Response status code: 200     Response time: ms     Response Headers:     Response Size: bytes     Response Body:       { -       "message": "Museum general entry ticket purchased", -       "ticketId": "382c0820-0530-4f4b-99af-13811ad0f17a", -       "ticketType": "general", -       "ticketDate": "2023-09-07", -       "confirmationCode": "ticket-general-e5e5c6-dce78" +       "object": "list", +       "page": { +       "startCursor": null, +       "endCursor": null, +       "hasNextPage": false, +       "hasPrevPage": false, +       "limit": 10, +       "total": 0 +       }, +       "items": []       } -    ✓ success criteria check - $statusCode == 201 -    ✓ status code check - $statusCode in [201, 400, 404] +    ✓ success criteria check - $statusCode == 200 +    ✓ status code check - $statusCode in [200, 400, 500]     ✓ content-type check     ✓ schema check - ✓ GET /museum-hours - step test-default-input + ✓ GET /menu - step test-default-input -    Request URL: https://redocly.com/_mock/demo/openapi/museum-api/museum-hours?organizationId=acme-inc +    Request URL: https://api.cafe.redocly.com/menu?search=mermaid-treasure-latte&organizationId=acme-inc     Request Headers:       accept: application/json, application/problem+json       authorization: Basic Og== @@ -126,70 +83,30 @@ exports[`should use inputs from CLI and env 1`] = `     Response Headers:     Response Size: bytes     Response Body: -      [ -       { -       "date": "2023-09-11", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-12", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-13", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-14", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-15", -       "timeOpen": "10:00", -       "timeClose": "16:00" -       }, -       { -       "date": "2023-09-18", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-19", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-20", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-21", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-22", -       "timeOpen": "10:00", -       "timeClose": "16:00" -       } -      ] +      { +       "object": "list", +       "page": { +       "startCursor": null, +       "endCursor": null, +       "hasNextPage": false, +       "hasPrevPage": false, +       "limit": 10, +       "total": 0 +       }, +       "items": [] +      } -    ✓ status code check - $statusCode in [200, 400, 404] +    ✓ status code check - $statusCode in [200, 400, 500]     ✓ content-type check     ✓ schema check ──────────────────────────────────────────────────────────────────────────────── - Running workflow inputs-with-cli-and-env.arazzo.yaml / events-crud + Running workflow inputs-with-cli-and-env.arazzo.yaml / client-registration - ✓ POST /special-events - step create-event + ✓ POST /oauth2/register - step create-client -    Request URL: https://redocly.com/_mock/demo/openapi/museum-api/special-events +    Request URL: https://api.cafe.redocly.com/oauth2/register     Request Headers:       content-type: application/json       accept: application/json, application/problem+json @@ -199,38 +116,38 @@ exports[`should use inputs from CLI and env 1`] = `       {        "additionalName": "John",        "additionalPassword": "password", -       "additionalEnv": "Basic Og==", -       "name": "Mermaid Treasure Identification and Analysis", -       "location": "Under the seaaa 🦀 🎶 🌊.", -       "eventDescription": "Join us as we review and classify a rare collection of 20 thingamabobs, gadgets, gizmos, whoosits, and whatsits, kindly donated by Ariel.", -       "dates": [ -       "2023-09-05", -       "2023-09-08" -       ], -       "price": 0 +       "additionalEnv": "Basic Og=="       } -    Response status code: 201 +    Response status code: 400     Response time: ms     Response Headers:     Response Size: bytes     Response Body:       { -       "eventId": "dad4bce8-f5cb-4078-a211-995864315e39", -       "name": "Mermaid Treasure Identification and Analysis", -       "location": "Under the seaaa 🦀 🎶 🌊.", -       "eventDescription": "Join us as we review and classify a rare collection of 20 thingamabobs, gadgets, gizmos, whoosits, and whatsits, kindly donated by Ariel.", -       "dates": [ -       "2023-09-05", -       "2023-09-08" -       ], -       "price": 0 +       "type": "about:blank", +       "title": "Validation failed", +       "status": 400, +       "instance": "/oauth2/register", +       "details": { +       "errors": [ +       { +       "code": "invalid_type", +       "expected": "string", +       "received": "undefined", +       "path": [ +       "name" +       ], +       "message": "Required" +       } +       ] +       }       } -    ✓ success criteria check - $statusCode == 201 -    ✓ success criteria check - $[?@.name == 'Mermaid Treasure Identification and ... -    ✓ status code check - $statusCode in [201, 400, 404] +    ✓ success criteria check - $statusCode == 400 +    ✓ success criteria check - $[?@.title == 'Validation failed'] +    ✓ status code check - $statusCode in [201, 400, 401, 500]     ✓ content-type check     ✓ schema check diff --git a/tests/e2e/respect/inputs-with-cli-and-env/inputs-with-cli-and-env.arazzo.yaml b/tests/e2e/respect/inputs-with-cli-and-env/inputs-with-cli-and-env.arazzo.yaml index 550877bc79..846bf987bd 100644 --- a/tests/e2e/respect/inputs-with-cli-and-env/inputs-with-cli-and-env.arazzo.yaml +++ b/tests/e2e/respect/inputs-with-cli-and-env/inputs-with-cli-and-env.arazzo.yaml @@ -6,15 +6,15 @@ info: version: 1.0.0 sourceDescriptions: - - name: museum-api + - name: cafe-api type: openapi - url: ../museum-api.yaml - - name: tickets-from-museum-api + url: ../cafe-api.yaml + - name: menu-from-cafe-api type: arazzo - url: ../museum-tickets.yaml + url: ../cafe-menu.arazzo.yaml workflows: - - workflowId: get-museum-hours + - workflowId: get-menu-items inputs: type: object properties: @@ -27,33 +27,40 @@ workflows: type: string default: acme-inc description: >- - This workflow demonstrates how to get the museum opening hours and buy tickets. + This workflow demonstrates how to list the cafe menu items and search the menu. parameters: - in: header name: Authorization value: $inputs.env.AUTH_TOKEN steps: - - stepId: get-museum-hours + - stepId: get-menu-items description: >- - Get museum hours by resolving request details with getMuseumHours operationId from museum-api.yaml description. - operationId: museum-api.getMuseumHours + List menu items by resolving request details with listMenuItems operationId from cafe-api.yaml description. + operationId: cafe-api.listMenuItems + parameters: + - in: query + name: search + value: mermaid-treasure-latte successCriteria: - condition: $statusCode == 200 outputs: - schedule: $response.body - - stepId: buy-ticket + menu: $response.body + - stepId: search-menu description: >- - Buy a ticket for the museum by calling an external workflow from another Arazzo file. - workflowId: $sourceDescriptions.tickets-from-museum-api.get-museum-tickets + Search the cafe menu by calling an external workflow from another Arazzo file. + workflowId: $sourceDescriptions.menu-from-cafe-api.search-menu-items outputs: - ticketId: $outputs.ticketId + total: $outputs.total - stepId: test-default-input - operationId: museum-api.getMuseumHours + operationId: cafe-api.listMenuItems parameters: + - in: query + name: search + value: mermaid-treasure-latte - in: query name: organizationId value: $inputs.env.organizationId - - workflowId: events-crud + - workflowId: client-registration inputs: type: object properties: @@ -67,34 +74,27 @@ workflows: password: type: string description: >- - This workflow demonstrates how to list, create, update, and delete special events at the museum. + This workflow demonstrates how to pass inputs into an OAuth2 client registration request. parameters: - in: header name: Authorization value: Basic Og== steps: - - stepId: create-event + - stepId: create-client parameters: - in: header name: username-token value: $inputs.env.AUTH_TOKEN description: >- - Create a new special event. - operationPath: '{$sourceDescriptions.museum-api.url}#/paths/~1special-events/post' + Try to register a new OAuth2 client without the required `name` field. + operationPath: '{$sourceDescriptions.cafe-api.url}#/paths/~1oauth2~1register/post' requestBody: payload: additionalName: $inputs.username additionalPassword: $inputs.password additionalEnv: $inputs.env.AUTH_TOKEN - name: 'Mermaid Treasure Identification and Analysis' - location: 'Under the seaaa 🦀 🎶 🌊.' - eventDescription: 'Join us as we review and classify a rare collection of 20 thingamabobs, gadgets, gizmos, whoosits, and whatsits, kindly donated by Ariel.' - dates: - - '2023-09-05' - - '2023-09-08' - price: 0 successCriteria: - - condition: $statusCode == 201 + - condition: $statusCode == 400 - context: $response.body - condition: "$[?@.name == 'Mermaid Treasure Identification and Analysis']" + condition: "$[?@.title == 'Validation failed']" type: jsonpath diff --git a/tests/e2e/respect/mask-input-secrets/__snapshots__/mask-input-secrets.test.ts.snap b/tests/e2e/respect/mask-input-secrets/__snapshots__/mask-input-secrets.test.ts.snap index 5bc7d46403..c68a98e75b 100644 --- a/tests/e2e/respect/mask-input-secrets/__snapshots__/mask-input-secrets.test.ts.snap +++ b/tests/e2e/respect/mask-input-secrets/__snapshots__/mask-input-secrets.test.ts.snap @@ -3,11 +3,11 @@ exports[`should hide sensitive input values 1`] = ` "──────────────────────────────────────────────────────────────────────────────── - Running workflow mask-input-secrets.arazzo.yaml / get-museum-hours + Running workflow mask-input-secrets.arazzo.yaml / get-menu-items - ✓ GET /museum-hours - step get-museum-hours + ✓ GET /menu - step get-menu-items -    Request URL: https://redocly.com/_mock/demo/openapi/museum-api/museum-hours +    Request URL: https://api.cafe.redocly.com/menu?search=mermaid-treasure-latte     Request Headers:       accept: application/json, application/problem+json       authorization: ******** @@ -22,71 +22,31 @@ exports[`should hide sensitive input values 1`] = `     Response Headers:     Response Size: bytes     Response Body: -      [ -       { -       "date": "2023-09-11", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-12", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-13", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-14", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-15", -       "timeOpen": "10:00", -       "timeClose": "16:00" -       }, -       { -       "date": "2023-09-18", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-19", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-20", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-21", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-22", -       "timeOpen": "10:00", -       "timeClose": "16:00" -       } -      ] +      { +       "object": "list", +       "page": { +       "startCursor": null, +       "endCursor": null, +       "hasNextPage": false, +       "hasPrevPage": false, +       "limit": 10, +       "total": 0 +       }, +       "items": [] +      }     ✓ success criteria check - $statusCode == 200 -    ✓ status code check - $statusCode in [200, 400, 404] +    ✓ status code check - $statusCode in [200, 400, 500]     ✓ content-type check     ✓ schema check ──────────────────────────────────────────────────────────────────────────────── - Running workflow mask-input-secrets.arazzo.yaml / events-crud + Running workflow mask-input-secrets.arazzo.yaml / client-registration - ✓ GET /special-events - step list-events + ✓ GET /menu - step list-menu-items -    Request URL: https://redocly.com/_mock/demo/openapi/museum-api/special-events +    Request URL: https://api.cafe.redocly.com/menu?search=mermaid-treasure-latte     Request Headers:       accept: application/json, application/problem+json       authorization: ******** @@ -98,131 +58,26 @@ exports[`should hide sensitive input values 1`] = `     Response Headers:     Response Size: bytes     Response Body: -      [ -       { -       "eventId": "f3e0e76e-e4a8-466e-ab9c-ae36c15b8e97", -       "name": "Sasquatch Ballet", -       "location": "Seattle... probably", -       "eventDescription": "They're big, they're hairy, but they're also graceful. Come learn how the biggest feet can have the lightest touch.", -       "dates": [ -       "2023-12-15", -       "2023-12-22" -       ], -       "price": 40 -       }, -       { -       "eventId": "2f14374a-9c65-4ee5-94b7-fba66d893483", -       "name": "Solar Telescope Demonstration", -       "location": "Far from the sun.", -       "eventDescription": "Look at the sun without going blind!", -       "dates": [ -       "2023-09-07", -       "2023-09-14" -       ], -       "price": 50 -       }, -       { -       "eventId": "6aaa61ba-b2aa-4868-b803-603dbbf7bfdb", -       "name": "Cook like a Caveman", -       "location": "Fire Pit on East side", -       "eventDescription": "Learn to cook on an open flame.", -       "dates": [ -       "2023-11-10", -       "2023-11-17", -       "2023-11-24" -       ], -       "price": 5 -       }, -       { -       "eventId": "602b75e1-5696-4ab8-8c7a-f9e13580f910", -       "name": "Underwater Basket Weaving", -       "location": "Rec Center Pool next door.", -       "eventDescription": "Learn to weave baskets underwater.", -       "dates": [ -       "2023-09-12", -       "2023-09-15" -       ], -       "price": 15 -       }, -       { -       "eventId": "dad4bce8-f5cb-4078-a211-995864315e39", -       "name": "Mermaid Treasure Identification and Analysis", -       "location": "Room Sea-12", -       "eventDescription": "Join us as we review and classify a rare collection of 20 thingamabobs, gadgets, gizmos, whoosits, and whatsits — kindly donated by Ariel.", -       "dates": [ -       "2023-09-05", -       "2023-09-08" -       ], -       "price": 30 -       }, -       { -       "eventId": "6744a0da-4121-49cd-8479-f8cc20526495", -       "name": "Time Traveler Tea Party", -       "location": "Temporal Tearoom", -       "eventDescription": "Sip tea with important historical figures.", -       "dates": [ -       "2023-11-18", -       "2023-11-25", -       "2023-12-02" -       ], -       "price": 60 -       }, -       { -       "eventId": "3be6453c-03eb-4357-ae5a-984a0e574a54", -       "name": "Pirate Coding Workshop", -       "location": "Computer Room", -       "eventDescription": "Captain Blackbeard shares his love of the C...language. And possibly Arrrrr (R lang).", -       "dates": [ -       "2023-10-29", -       "2023-10-30", -       "2023-10-31" -       ], -       "price": 45 -       }, -       { -       "eventId": "9d90d29a-2af5-4206-97d9-9ea9ceadcb78", -       "name": "Llama Street Art Through the Ages", -       "location": "Auditorium", -       "eventDescription": "Llama street art?! Alpaca my bags -- let's go!", -       "dates": [ -       "2023-10-29", -       "2023-10-30", -       "2023-10-31" -       ], -       "price": 45 -       }, -       { -       "eventId": "a3c7b2c4-b5fb-4ef7-9322-00a919864957", -       "name": "The Great Parrot Debate", -       "location": "Outdoor Amphitheatre", -       "eventDescription": "See leading parrot minds discuss important geopolitical issues.", -       "dates": [ -       "2023-11-03", -       "2023-11-10" -       ], -       "price": 35 -       }, -       { -       "eventId": "b92d46b7-4c5d-422b-87a5-287767e26f29", -       "name": "Eat a Bunch of Corn", -       "location": "Cafeteria", -       "eventDescription": "We accidentally bought too much corn. Please come eat it.", -       "dates": [ -       "2023-11-10", -       "2023-11-17", -       "2023-11-24" -       ], -       "price": 5 -       } -      ] +      { +       "object": "list", +       "page": { +       "startCursor": null, +       "endCursor": null, +       "hasNextPage": false, +       "hasPrevPage": false, +       "limit": 10, +       "total": 0 +       }, +       "items": [] +      } -    ✓ status code check - $statusCode in [200, 400, 404] +    ✓ status code check - $statusCode in [200, 400, 500]     ✓ content-type check     ✓ schema check - ✓ POST /special-events - step create-event + ✓ POST /oauth2/register - step create-client -    Request URL: https://redocly.com/_mock/demo/openapi/museum-api/special-events +    Request URL: https://api.cafe.redocly.com/oauth2/register     Request Headers:       content-type: application/json       accept: application/json, application/problem+json @@ -232,38 +87,38 @@ exports[`should hide sensitive input values 1`] = `       {        "username": "John",        "secret": "********", -       "multiwordSecret": "Bearer ********", -       "name": "Mermaid Treasure Identification and Analysis", -       "location": "Under the seaaa 🦀 🎶 🌊.", -       "eventDescription": "Join us as we review and classify a rare collection of 20 thingamabobs, gadgets, gizmos, whoosits, and whatsits, kindly donated by Ariel.", -       "dates": [ -       "2023-09-05", -       "2023-09-08" -       ], -       "price": 0 +       "multiwordSecret": "Bearer ********"       } -    Response status code: 201 +    Response status code: 400     Response time: ms     Response Headers:     Response Size: bytes     Response Body:       { -       "eventId": "dad4bce8-f5cb-4078-a211-995864315e39", -       "name": "Mermaid Treasure Identification and Analysis", -       "location": "Under the seaaa 🦀 🎶 🌊.", -       "eventDescription": "Join us as we review and classify a rare collection of 20 thingamabobs, gadgets, gizmos, whoosits, and whatsits, kindly donated by Ariel.", -       "dates": [ -       "2023-09-05", -       "2023-09-08" -       ], -       "price": 0 +       "type": "about:blank", +       "title": "Validation failed", +       "status": 400, +       "instance": "/oauth2/register", +       "details": { +       "errors": [ +       { +       "code": "invalid_type", +       "expected": "string", +       "received": "undefined", +       "path": [ +       "name" +       ], +       "message": "Required" +       } +       ] +       }       } -    ✓ success criteria check - $statusCode == 201 -    ✓ success criteria check - $[?@.name == 'Mermaid Treasure Identification and ... -    ✓ status code check - $statusCode in [201, 400, 404] +    ✓ success criteria check - $statusCode == 400 +    ✓ success criteria check - $[?@.title == 'Validation failed'] +    ✓ status code check - $statusCode in [201, 400, 401, 500]     ✓ content-type check     ✓ schema check diff --git a/tests/e2e/respect/mask-input-secrets/mask-input-secrets.arazzo.yaml b/tests/e2e/respect/mask-input-secrets/mask-input-secrets.arazzo.yaml index e203f2d4c9..b9ada2b216 100644 --- a/tests/e2e/respect/mask-input-secrets/mask-input-secrets.arazzo.yaml +++ b/tests/e2e/respect/mask-input-secrets/mask-input-secrets.arazzo.yaml @@ -6,15 +6,15 @@ info: version: 1.0.0 sourceDescriptions: - - name: museum-api + - name: cafe-api type: openapi - url: ../museum-api.yaml - - name: tickets-from-museum-api + url: ../cafe-api.yaml + - name: menu-from-cafe-api type: arazzo - url: ../museum-tickets.yaml + url: ../cafe-menu.arazzo.yaml workflows: - - workflowId: get-museum-hours + - workflowId: get-menu-items inputs: type: object properties: @@ -44,23 +44,26 @@ workflows: name: masked-combined-value value: '{$inputs.username} and {$inputs.password} and maybe {$inputs.env.AUTH_TOKEN}' description: >- - This workflow demonstrates how to get the museum opening hours and buy tickets. + This workflow demonstrates how to list the cafe menu items. steps: - - stepId: get-museum-hours + - stepId: get-menu-items parameters: - in: header name: multi-word-secret value: Bearer {$inputs.password} + - in: query + name: search + value: mermaid-treasure-latte description: >- - Get museum hours by resolving request details with getMuseumHours operationId from museum-api.yaml description. - operationId: $sourceDescriptions.museum-api.getMuseumHours + List menu items by resolving request details with listMenuItems operationId from cafe-api.yaml description. + operationId: $sourceDescriptions.cafe-api.listMenuItems successCriteria: - condition: $statusCode == 200 outputs: - schedule: $response.body - - workflowId: events-crud + menu: $response.body + - workflowId: client-registration description: >- - This workflow demonstrates how to list, create, update, and delete special events at the museum. + This workflow demonstrates how sensitive inputs are masked in an OAuth2 client registration request. parameters: - in: header name: Authorization @@ -89,30 +92,27 @@ workflows: type: string format: password steps: - - stepId: list-events + - stepId: list-menu-items description: >- - Request the list of events. - operationPath: '{$sourceDescriptions.museum-api.url}#/paths/~1special-events/get' + Request the list of menu items. + operationPath: '{$sourceDescriptions.cafe-api.url}#/paths/~1menu/get' + parameters: + - in: query + name: search + value: mermaid-treasure-latte outputs: - events: $response.body - - stepId: create-event + menuItems: $response.body + - stepId: create-client description: >- - Create a new special event. - operationPath: '{$sourceDescriptions.museum-api.url}#/paths/~1special-events/post' + Try to register a new OAuth2 client without the required `name` field. + operationPath: '{$sourceDescriptions.cafe-api.url}#/paths/~1oauth2~1register/post' requestBody: payload: username: $inputs.username secret: $inputs.password multiwordSecret: Bearer {$inputs.secret.secretValue} - name: 'Mermaid Treasure Identification and Analysis' - location: 'Under the seaaa 🦀 🎶 🌊.' - eventDescription: 'Join us as we review and classify a rare collection of 20 thingamabobs, gadgets, gizmos, whoosits, and whatsits, kindly donated by Ariel.' - dates: - - '2023-09-05' - - '2023-09-08' - price: 0 successCriteria: - - condition: $statusCode == 201 + - condition: $statusCode == 400 - context: $response.body - condition: "$[?@.name == 'Mermaid Treasure Identification and Analysis']" + condition: "$[?@.title == 'Validation failed']" type: jsonpath diff --git a/tests/e2e/respect/museum-api-with-errors.yaml b/tests/e2e/respect/museum-api-with-errors.yaml deleted file mode 100644 index 98fcaf666a..0000000000 --- a/tests/e2e/respect/museum-api-with-errors.yaml +++ /dev/null @@ -1,755 +0,0 @@ -openapi: 3.1.0 -info: - title: Redocly Museum API - description: >- - Imaginary, but delightful Museum API for interacting with museum services - and information. Built with love by Redocly. - version: 1.1.1 - termsOfService: https://redocly.com/subscription-agreement/ - contact: - email: team@redocly.com - url: https://redocly.com/docs/cli/ - license: - name: MIT - url: https://opensource.org/license/mit/ -servers: - - url: https://redocly.com/_mock/demo/openapi/museum-api/ -paths: - /museum-hours: - get: - summary: Get museum hours - description: Get upcoming museum operating hours. - operationId: getMuseumHours - tags: - - Operations - parameters: - - $ref: '#/components/parameters/StartDate' - - $ref: '#/components/parameters/PaginationPage' - - $ref: '#/components/parameters/PaginationLimit' - responses: - '201': - description: Success. - content: - html/text: - schema: - $ref: '#/components/schemas/GetMuseumHoursResponse' - examples: - default_example: - $ref: '#/components/examples/GetMuseumHoursResponseExample' - '400': - $ref: '#/components/responses/BadRequest' - '404': - $ref: '#/components/responses/NotFound' - /special-events: - post: - summary: Create special events - description: Creates a new special event for the museum. - operationId: createSpecialEvent - tags: - - Events - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/CreateSpecialEventRequest' - examples: - default_example: - $ref: '#/components/examples/CreateSpecialEventRequestExample' - responses: - '201': - description: Created. - content: - application/json: - schema: - $ref: '#/components/schemas/SpecialEventResponse' - examples: - default_example: - $ref: '#/components/examples/CreateSpecialEventResponseExample' - '400': - $ref: '#/components/responses/BadRequest' - '404': - $ref: '#/components/responses/NotFound' - get: - summary: List special events - description: Return a list of upcoming special events at the museum. - operationId: listSpecialEvents - tags: - - Events - parameters: - - $ref: '#/components/parameters/StartDate' - - $ref: '#/components/parameters/EndDate' - - $ref: '#/components/parameters/PaginationPage' - - $ref: '#/components/parameters/PaginationLimit' - responses: - '200': - description: Success. - content: - application/json: - schema: - $ref: '#/components/schemas/ListSpecialEventsResponse' - examples: - default_example: - $ref: '#/components/examples/ListSpecialEventsResponseExample' - '400': - $ref: '#/components/responses/BadRequest' - '404': - $ref: '#/components/responses/NotFound' - /special-events/{eventId}: - get: - summary: Get special event - description: Get details about a special event. - operationId: getSpecialEvent - tags: - - Events - parameters: - - $ref: '#/components/parameters/EventId' - responses: - '200': - description: Success. - content: - application/json: - schema: - $ref: '#/components/schemas/SpecialEventResponse' - examples: - default_example: - $ref: '#/components/examples/GetSpecialEventResponseExample' - '400': - $ref: '#/components/responses/BadRequest' - '404': - $ref: '#/components/responses/NotFound' - patch: - summary: Update special event - description: Update the details of a special event. - operationId: updateSpecialEvent - tags: - - Events - parameters: - - $ref: '#/components/parameters/EventId' - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateSpecialEventRequest' - examples: - default_example: - $ref: '#/components/examples/UpdateSpecialEventRequestExample' - responses: - '200': - description: Success. - content: - json: - schema: - $ref: '#/components/schemas/SpecialEventResponse' - examples: - default_example: - $ref: '#/components/examples/UpdateSpecialEventResponseExample' - '400': - $ref: '#/components/responses/BadRequest' - '404': - $ref: '#/components/responses/NotFound' - delete: - summary: Delete special event - description: >- - Delete a special event from the collection. Allows museum to cancel - planned events. - operationId: deleteSpecialEvent - tags: - - Events - parameters: - - $ref: '#/components/parameters/EventId' - responses: - '205': - description: Success - no content. - '400': - $ref: '#/components/responses/BadRequest' - '401': - $ref: '#/components/responses/Unauthorized' - '404': - $ref: '#/components/responses/NotFound' - /tickets: - post: - summary: Buy museum tickets - description: Purchase museum tickets for general entry or special events. - operationId: buyMuseumTickets - tags: - - Tickets - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/BuyMuseumTicketsRequest' - examples: - general_entry: - $ref: '#/components/examples/BuyGeneralTicketsRequestExample' - event_entry: - $ref: '#/components/examples/BuyEventTicketsRequestExample' - responses: - '201': - description: Created. - content: - application/json: - schema: - $ref: '#/components/schemas/BuyMuseumTicketsResponse' - examples: - general_entry: - $ref: '#/components/examples/BuyGeneralTicketsResponseExample' - event_entry: - $ref: '#/components/examples/BuyEventTicketsResponseExample' - '400': - $ref: '#/components/responses/BadRequest' - '404': - $ref: '#/components/responses/NotFound' - /tickets/{ticketId}/qr: - get: - summary: Get ticket QR code - description: >- - Return an image of your ticket with scannable QR code. Used for event - entry. - operationId: getTicketCode - tags: - - Tickets - parameters: - - $ref: '#/components/parameters/TicketId' - responses: - '200': - description: Scannable event ticket in image format. - content: - image/png: - schema: - $ref: '#/components/schemas/GetTicketCodeResponse' - '400': - $ref: '#/components/responses/BadRequest' - '404': - $ref: '#/components/responses/NotFound' -components: - schemas: - TicketType: - description: >- - Type of ticket being purchased. Use `general` for regular museum entry - and `event` for tickets to special events. - type: string - enum: - - event - - general - example: event - Date: - type: string - format: date - example: '2023-10-29' - Email: - description: Email address for ticket purchaser. - type: string - format: email - example: museum-lover@example.com - Phone: - description: Phone number for the ticket purchaser (optional). - type: string - example: +1(234)-567-8910 - BuyMuseumTicketsRequest: - description: Request payload used for purchasing museum tickets. - type: object - properties: - ticketType: - $ref: '#/components/schemas/TicketType' - eventId: - description: >- - Unique identifier for a special event. Required if purchasing - tickets for the museum's special events. - $ref: '#/components/schemas/EventId' - ticketDate: - description: Date that the ticket is valid for. - $ref: '#/components/schemas/Date' - email: - $ref: '#/components/schemas/Email' - phone: - $ref: '#/components/schemas/Phone' - required: - - ticketType - - ticketDate - - email - TicketMessage: - description: Confirmation message after a ticket purchase. - type: string - example: Museum general entry ticket purchased - TicketId: - description: Unique identifier for museum ticket. Generated when purchased. - type: string - format: uuid - example: a54a57ca-36f8-421b-a6b4-2e8f26858a4c - TicketConfirmation: - description: Unique confirmation code used to verify ticket purchase. - type: string - example: ticket-event-a98c8f-7eb12 - BuyMuseumTicketsResponse: - description: Details for a museum ticket after a successful purchase. - type: object - properties: - message: - $ref: '#/components/schemas/TicketMessage' - eventName: - $ref: '#/components/schemas/EventName' - ticketId: - $ref: '#/components/schemas/TicketId' - ticketType: - $ref: '#/components/schemas/TicketType' - ticketDate: - description: Date the ticket is valid for. - $ref: '#/components/schemas/Date' - confirmationCode: - $ref: '#/components/schemas/TicketConfirmation' - required: - - message - - ticketId - - ticketType - - ticketDate - - confirmationCode - GetTicketCodeResponse: - description: Image of a ticket with a QR code used for museum or event entry. - type: string - format: binary - GetMuseumHoursResponse: - description: List of museum operating hours for consecutive days. - type: array - items: - $ref: '#/components/schemas/MuseumDailyHours' - MuseumDailyHours: - description: Daily operating hours for the museum. - type: object - properties: - sample: - type: string - example: 'sample' - date: - description: Date the operating hours apply to. - $ref: '#/components/schemas/Date' - example: '2024-12-31' - timeOpen: - type: string - pattern: ^([01]\d|2[0-3]):?([0-5]\d)$ - description: >- - Time the museum opens on a specific date. Uses 24 hour time format - (`HH:mm`). - example: '09:00' - timeClose: - description: >- - Time the museum closes on a specific date. Uses 24 hour time format - (`HH:mm`). - type: string - pattern: ^([01]\d|2[0-3]):?([0-5]\d)$ - example: '18:00' - required: - - date - - timeOpen - - timeClose - EventId: - description: Identifier for a special event. - type: string - format: uuid - example: 3be6453c-03eb-4357-ae5a-984a0e574a54 - EventName: - type: string - description: Name of the special event. - example: Pirate Coding Workshop - EventLocation: - type: string - description: Location where the special event is held. - example: Computer Room - EventDescription: - type: string - description: Description of the special event. - example: >- - Captain Blackbeard shares his love of the C...language. And possibly - Arrrrr (R lang). - EventDates: - type: array - items: - $ref: '#/components/schemas/Date' - description: List of planned dates for the special event. - EventPrice: - description: Price of a ticket for the special event. - type: number - format: float - example: 25 - CreateSpecialEventRequest: - description: Request payload for creating new special events at the museum. - type: object - properties: - name: - $ref: '#/components/schemas/EventName' - location: - $ref: '#/components/schemas/EventLocation' - eventDescription: - $ref: '#/components/schemas/EventDescription' - dates: - $ref: '#/components/schemas/EventDates' - price: - $ref: '#/components/schemas/EventPrice' - required: - - name - - location - - eventDescription - - dates - - price - UpdateSpecialEventRequest: - description: >- - Request payload for updating an existing special event. Only included - fields are updated in the event. - type: object - properties: - name: - $ref: '#/components/schemas/EventName' - location: - $ref: '#/components/schemas/EventLocation' - eventDescription: - $ref: '#/components/schemas/EventDescription' - dates: - $ref: '#/components/schemas/EventDates' - price: - $ref: '#/components/schemas/EventPrice' - ListSpecialEventsResponse: - description: List of upcoming special events. - type: array - items: - $ref: '#/components/schemas/SpecialEventResponse' - SpecialEventResponse: - description: Information about a special event. - type: object - properties: - eventId: - $ref: '#/components/schemas/EventId' - name: - $ref: '#/components/schemas/EventName' - location: - $ref: '#/components/schemas/EventLocation' - eventDescription: - $ref: '#/components/schemas/EventDescription' - dates: - $ref: '#/components/schemas/EventDates' - price: - $ref: '#/components/schemas/EventPrice' - required: - - eventId - - name - - location - - eventDescription - - dates - - price - Error: - type: object - properties: - type: - type: string - example: object - title: - type: string - example: Validation failed - securitySchemes: - MuseumPlaceholderAuth: - type: http - scheme: basic - examples: - BuyGeneralTicketsRequestExample: - summary: General entry ticket - value: - ticketType: general - ticketDate: '2023-09-07' - email: todd@example.com - BuyEventTicketsRequestExample: - summary: Special event ticket - value: - ticketType: general - eventId: dad4bce8-f5cb-4078-a211-995864315e39 - ticketDate: '2023-09-05' - email: todd@example.com - BuyGeneralTicketsResponseExample: - summary: General entry ticket - value: - message: Museum general entry ticket purchased - ticketId: 382c0820-0530-4f4b-99af-13811ad0f17a - ticketType: general - ticketDate: '2023-09-07' - confirmationCode: ticket-general-e5e5c6-dce78 - BuyEventTicketsResponseExample: - summary: Special event ticket - value: - message: Museum special event ticket purchased - ticketId: b811f723-17b2-44f7-8952-24b03e43d8a9 - eventName: Mermaid Treasure Identification and Analysis - ticketType: event - ticketDate: '2023-09-05' - confirmationCode: ticket-event-9c55eg-8v82a - CreateSpecialEventRequestExample: - summary: Create special event - value: - name: Mermaid Treasure Identification and Analysis - location: Under the seaaa 🦀 🎶 🌊. - eventDescription: >- - Join us as we review and classify a rare collection of 20 - thingamabobs, gadgets, gizmos, whoosits, and whatsits, kindly donated - by Ariel. - dates: - - '2023-09-05' - - '2023-09-08' - price: 0 - CreateSpecialEventResponseExample: - summary: Special event created - value: - eventId: dad4bce8-f5cb-4078-a211-995864315e39 - name: Mermaid Treasure Identification and Analysis - location: Under the seaaa 🦀 🎶 🌊. - eventDescription: >- - Join us as we review and classify a rare collection of 20 - thingamabobs, gadgets, gizmos, whoosits, and whatsits, kindly donated - by Ariel. - dates: - - '2023-09-05' - - '2023-09-08' - price: 30 - GetSpecialEventResponseExample: - summary: Get special event - value: - eventId: 6744a0da-4121-49cd-8479-f8cc20526495 - name: Time Traveler Tea Party - location: Temporal Tearoom - eventDescription: Sip tea with important historical figures. - dates: - - '2023-11-18' - - '2023-11-25' - - '2023-12-02' - price: 60 - ListSpecialEventsResponseExample: - summary: List of special events - value: - - eventId: f3e0e76e-e4a8-466e-ab9c-ae36c15b8e97 - name: Sasquatch Ballet - location: Seattle... probably - eventDescription: >- - They're big, they're hairy, but they're also graceful. Come learn - how the biggest feet can have the lightest touch. - dates: - - '2023-12-15' - - '2023-12-22' - price: 40 - - eventId: 2f14374a-9c65-4ee5-94b7-fba66d893483 - name: Solar Telescope Demonstration - location: Far from the sun. - eventDescription: Look at the sun without going blind! - dates: - - '2023-09-07' - - '2023-09-14' - price: 50 - - eventId: 6aaa61ba-b2aa-4868-b803-603dbbf7bfdb - name: Cook like a Caveman - location: Fire Pit on East side - eventDescription: Learn to cook on an open flame. - dates: - - '2023-11-10' - - '2023-11-17' - - '2023-11-24' - price: 5 - - eventId: 602b75e1-5696-4ab8-8c7a-f9e13580f910 - name: Underwater Basket Weaving - location: Rec Center Pool next door. - eventDescription: Learn to weave baskets underwater. - dates: - - '2023-09-12' - - '2023-09-15' - price: 15 - - eventId: dad4bce8-f5cb-4078-a211-995864315e39 - name: Mermaid Treasure Identification and Analysis - location: Room Sea-12 - eventDescription: >- - Join us as we review and classify a rare collection of 20 - thingamabobs, gadgets, gizmos, whoosits, and whatsits — kindly - donated by Ariel. - dates: - - '2023-09-05' - - '2023-09-08' - price: 30 - - eventId: 6744a0da-4121-49cd-8479-f8cc20526495 - name: Time Traveler Tea Party - location: Temporal Tearoom - eventDescription: Sip tea with important historical figures. - dates: - - '2023-11-18' - - '2023-11-25' - - '2023-12-02' - price: 60 - - eventId: 3be6453c-03eb-4357-ae5a-984a0e574a54 - name: Pirate Coding Workshop - location: Computer Room - eventDescription: >- - Captain Blackbeard shares his love of the C...language. And possibly - Arrrrr (R lang). - dates: - - '2023-10-29' - - '2023-10-30' - - '2023-10-31' - price: 45 - - eventId: 9d90d29a-2af5-4206-97d9-9ea9ceadcb78 - name: Llama Street Art Through the Ages - location: Auditorium - eventDescription: Llama street art?! Alpaca my bags -- let's go! - dates: - - '2023-10-29' - - '2023-10-30' - - '2023-10-31' - price: 45 - - eventId: a3c7b2c4-b5fb-4ef7-9322-00a919864957 - name: The Great Parrot Debate - location: Outdoor Amphitheatre - eventDescription: See leading parrot minds discuss important geopolitical issues. - dates: - - '2023-11-03' - - '2023-11-10' - price: 35 - - eventId: b92d46b7-4c5d-422b-87a5-287767e26f29 - name: Eat a Bunch of Corn - location: Cafeteria - eventDescription: We accidentally bought too much corn. Please come eat it. - dates: - - '2023-11-10' - - '2023-11-17' - - '2023-11-24' - price: 5 - UpdateSpecialEventRequestExample: - summary: Update special event request - value: - location: On the beach. - price: 15 - UpdateSpecialEventResponseExample: - summary: Update special event - value: - eventId: dad4bce8-f5cb-4078-a211-995864315e39 - name: Mermaid Treasure Identification and Analysis - location: On the beach. - eventDescription: >- - Join us as we review and classify a rare collection of 20 - thingamabobs, gadgets, gizmos, whoosits, and whatsits, kindly donated - by Ariel. - dates: - - '2023-09-05' - - '2023-09-08' - price: 15 - GetMuseumHoursResponseExample: - summary: Get hours response - value: - - date: '2023-09-11' - timeOpen: '09:00' - timeClose: '18:00' - - date: '2023-09-12' - timeOpen: '09:00' - timeClose: '18:00' - - date: '2023-09-13' - timeOpen: '09:00' - timeClose: '18:00' - - date: '2023-09-14' - timeOpen: '09:00' - timeClose: '18:00' - - date: '2023-09-15' - timeOpen: '10:00' - timeClose: '16:00' - - date: '2023-09-18' - timeOpen: '09:00' - timeClose: '18:00' - - date: '2023-09-19' - timeOpen: '09:00' - timeClose: '18:00' - - date: '2023-09-20' - timeOpen: '09:00' - timeClose: '18:00' - - date: '2023-09-21' - timeOpen: '09:00' - timeClose: '18:00' - - date: '2023-09-22' - timeOpen: '10:00' - timeClose: '16:00' - parameters: - PaginationPage: - name: page - in: query - description: Page number to retrieve. - schema: - type: integer - default: 1 - example: 2 - PaginationLimit: - name: limit - in: query - description: Number of days per page. - schema: - type: integer - default: 10 - maximum: 30 - example: 15 - EventId: - name: eventId - in: path - description: Identifier for a special event. - required: true - schema: - type: string - format: uuid - example: dad4bce8-f5cb-4078-a211-995864315e39 - StartDate: - name: startDate - in: query - description: >- - Starting date to retrieve future operating hours from. Defaults to - today's date. - schema: - type: string - format: date - example: '2023-02-23' - EndDate: - name: endDate - in: query - description: >- - End of a date range to retrieve special events for. Defaults to 7 days - after `startDate`. - schema: - type: string - format: date - example: '2023-04-18' - TicketId: - name: ticketId - in: path - description: >- - Identifier for a ticket to a museum event. Used to generate ticket - image. - required: true - schema: - type: string - format: uuid - example: a54a57ca-36f8-421b-a6b4-2e8f26858a4c - responses: - BadRequest: - description: Bad request. - content: - application/problem+json: - schema: - $ref: '#/components/schemas/Error' - NotFound: - description: Not found. - content: - application/problem+json: - schema: - $ref: '#/components/schemas/Error' - Unauthorized: - description: Unauthorized. - content: - application/problem+json: - schema: - $ref: '#/components/schemas/Error' -tags: - - name: Operations - description: Operational information about the museum. - - name: Events - description: Special events hosted by the museum. - - name: Tickets - description: Museum tickets for general entrance or special events. -security: - - MuseumPlaceholderAuth: [] diff --git a/tests/e2e/respect/museum-api.yaml b/tests/e2e/respect/museum-api.yaml deleted file mode 100644 index f19af26a56..0000000000 --- a/tests/e2e/respect/museum-api.yaml +++ /dev/null @@ -1,855 +0,0 @@ -openapi: 3.1.0 -info: - title: Redocly Museum API - description: >- - Imaginary, but delightful Museum API for interacting with museum services - and information. Built with love by Redocly. - version: 1.1.1 - termsOfService: https://redocly.com/subscription-agreement/ - contact: - email: team@redocly.com - url: https://redocly.com/docs/cli/ - license: - name: MIT - url: https://opensource.org/license/mit/ -servers: - - url: https://redocly.com/_mock/demo/openapi/museum-api/ -paths: - /museum-hours: - get: - summary: Get museum hours - description: Get upcoming museum operating hours. - operationId: getMuseumHours - tags: - - Operations - parameters: - - $ref: '#/components/parameters/StartDate' - - $ref: '#/components/parameters/PaginationPage' - - $ref: '#/components/parameters/PaginationLimit' - responses: - '200': - description: Success. - content: - application/json: - schema: - $ref: '#/components/schemas/GetMuseumHoursResponse' - examples: - default_example: - $ref: '#/components/examples/GetMuseumHoursResponseExample' - '400': - $ref: '#/components/responses/BadRequest' - '404': - $ref: '#/components/responses/NotFound' - /special-events: - post: - summary: Create special events - description: Creates a new special event for the museum. - operationId: createSpecialEvent - tags: - - Events - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/CreateSpecialEventRequest' - examples: - default_example: - $ref: '#/components/examples/CreateSpecialEventRequestExample' - responses: - '201': - description: Created. - content: - application/json: - schema: - $ref: '#/components/schemas/SpecialEventResponse' - examples: - default_example: - $ref: '#/components/examples/CreateSpecialEventResponseExample' - '400': - $ref: '#/components/responses/BadRequest' - '404': - $ref: '#/components/responses/NotFound' - get: - summary: List special events - description: Return a list of upcoming special events at the museum. - operationId: listSpecialEvents - tags: - - Events - parameters: - - $ref: '#/components/parameters/StartDate' - - $ref: '#/components/parameters/EndDate' - - $ref: '#/components/parameters/PaginationPage' - - $ref: '#/components/parameters/PaginationLimit' - responses: - '200': - description: Success. - content: - application/json: - schema: - $ref: '#/components/schemas/ListSpecialEventsResponse' - examples: - default_example: - $ref: '#/components/examples/ListSpecialEventsResponseExample' - '400': - $ref: '#/components/responses/BadRequest' - '404': - $ref: '#/components/responses/NotFound' - /special-events/{eventId}: - get: - summary: Get special event - description: Get details about a special event. - operationId: getSpecialEvent - tags: - - Events - parameters: - - $ref: '#/components/parameters/EventId' - responses: - '200': - description: Success. - content: - application/json: - schema: - $ref: '#/components/schemas/SpecialEventResponse' - examples: - default_example: - $ref: '#/components/examples/GetSpecialEventResponseExample' - '400': - $ref: '#/components/responses/BadRequest' - '404': - $ref: '#/components/responses/NotFound' - patch: - summary: Update special event - description: Update the details of a special event. - operationId: updateSpecialEvent - tags: - - Events - parameters: - - $ref: '#/components/parameters/EventId' - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateSpecialEventRequest' - examples: - default_example: - $ref: '#/components/examples/UpdateSpecialEventRequestExample' - responses: - '200': - description: Success. - content: - application/json: - schema: - $ref: '#/components/schemas/SpecialEventResponse' - examples: - default_example: - $ref: '#/components/examples/UpdateSpecialEventResponseExample' - '400': - $ref: '#/components/responses/BadRequest' - '404': - $ref: '#/components/responses/NotFound' - delete: - summary: Delete special event - description: >- - Delete a special event from the collection. Allows museum to cancel - planned events. - operationId: deleteSpecialEvent - tags: - - Events - parameters: - - $ref: '#/components/parameters/EventId' - responses: - '204': - description: Success - no content. - '400': - $ref: '#/components/responses/BadRequest' - '401': - $ref: '#/components/responses/Unauthorized' - '404': - $ref: '#/components/responses/NotFound' - /tickets: - post: - summary: Buy museum tickets - description: Purchase museum tickets for general entry or special events. - operationId: buyMuseumTickets - tags: - - Tickets - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/BuyMuseumTicketsRequest' - examples: - general_entry: - $ref: '#/components/examples/BuyGeneralTicketsRequestExample' - event_entry: - $ref: '#/components/examples/BuyEventTicketsRequestExample' - responses: - '201': - description: Created. - content: - application/json: - schema: - $ref: '#/components/schemas/BuyMuseumTicketsResponse' - examples: - general_entry: - $ref: '#/components/examples/BuyGeneralTicketsResponseExample' - event_entry: - $ref: '#/components/examples/BuyEventTicketsResponseExample' - '400': - $ref: '#/components/responses/BadRequest' - '404': - $ref: '#/components/responses/NotFound' - /tickets/{ticketId}/qr: - get: - summary: Get ticket QR code - description: >- - Return an image of your ticket with scannable QR code. Used for event - entry. - operationId: getTicketCode - tags: - - Tickets - parameters: - - $ref: '#/components/parameters/TicketId' - responses: - '200': - description: Scannable event ticket in image format. - content: - image/png: - schema: - $ref: '#/components/schemas/GetTicketCodeResponse' - '400': - $ref: '#/components/responses/BadRequest' - '404': - $ref: '#/components/responses/NotFound' - /query: - query: - summary: Query museum data - description: Execute a custom query against museum data - operationId: queryMuseum - parameters: - - in: header - name: Content-Type - required: true - schema: - type: string - enum: ['application/sql'] - description: Content type must be application/sql - - in: header - name: Accept - required: true - schema: - type: string - enum: ['text/csv'] - description: Accept header must be text/csv - tags: - - Operations - requestBody: - required: true - content: - application/sql: - schema: - type: string - description: SQL query to execute - example: 'select event_name, location, price from events where price < 50' - responses: - '200': - description: Query results - content: - text/csv: - schema: - type: string - format: binary - example: | - event_name,location,price - "Underwater Basket Weaving","Rec Center Pool",15 - "Cook like a Caveman","Fire Pit",5 - application/json: - schema: - type: array - items: - type: object - additionalProperties: true - '400': - $ref: '#/components/responses/BadRequest' - '404': - $ref: '#/components/responses/NotFound' - x-query: - summary: Query museum data - description: Execute a custom query against museum data - operationId: queryMuseumEx - parameters: - - in: header - name: Content-Type - required: true - schema: - type: string - enum: ['application/sql'] - description: Content type must be application/sql - - in: header - name: Accept - required: true - schema: - type: string - enum: ['text/csv'] - description: Accept header must be text/csv - tags: - - Operations - requestBody: - required: true - content: - application/sql: - schema: - type: string - description: SQL query to execute - example: 'select event_name, location, price from events where price < 50' - responses: - '200': - description: Query results - content: - text/csv: - schema: - type: string - format: binary - example: | - event_name,location,price - "Underwater Basket Weaving","Rec Center Pool",15 - "Cook like a Caveman","Fire Pit",5 - application/json: - schema: - type: array - items: - type: object - additionalProperties: true - '400': - $ref: '#/components/responses/BadRequest' - '404': - $ref: '#/components/responses/NotFound' -components: - schemas: - TicketType: - description: >- - Type of ticket being purchased. Use `general` for regular museum entry - and `event` for tickets to special events. - type: string - enum: - - event - - general - example: event - Date: - type: string - format: date - example: '2023-10-29' - Email: - description: Email address for ticket purchaser. - type: string - format: email - example: museum-lover@example.com - Phone: - description: Phone number for the ticket purchaser (optional). - type: string - example: +1(234)-567-8910 - BuyMuseumTicketsRequest: - description: Request payload used for purchasing museum tickets. - type: object - properties: - ticketType: - $ref: '#/components/schemas/TicketType' - eventId: - description: >- - Unique identifier for a special event. Required if purchasing - tickets for the museum's special events. - $ref: '#/components/schemas/EventId' - ticketDate: - description: Date that the ticket is valid for. - $ref: '#/components/schemas/Date' - email: - $ref: '#/components/schemas/Email' - phone: - $ref: '#/components/schemas/Phone' - required: - - ticketType - - ticketDate - - email - TicketMessage: - description: Confirmation message after a ticket purchase. - type: string - example: Museum general entry ticket purchased - TicketId: - description: Unique identifier for museum ticket. Generated when purchased. - type: string - format: uuid - example: a54a57ca-36f8-421b-a6b4-2e8f26858a4c - TicketConfirmation: - description: Unique confirmation code used to verify ticket purchase. - type: string - example: ticket-event-a98c8f-7eb12 - BuyMuseumTicketsResponse: - description: Details for a museum ticket after a successful purchase. - type: object - properties: - message: - $ref: '#/components/schemas/TicketMessage' - eventName: - $ref: '#/components/schemas/EventName' - ticketId: - $ref: '#/components/schemas/TicketId' - ticketType: - $ref: '#/components/schemas/TicketType' - ticketDate: - description: Date the ticket is valid for. - $ref: '#/components/schemas/Date' - confirmationCode: - $ref: '#/components/schemas/TicketConfirmation' - required: - - message - - ticketId - - ticketType - - ticketDate - - confirmationCode - GetTicketCodeResponse: - description: Image of a ticket with a QR code used for museum or event entry. - type: string - format: binary - GetMuseumHoursResponse: - description: List of museum operating hours for consecutive days. - type: array - items: - $ref: '#/components/schemas/MuseumDailyHours' - MuseumDailyHours: - description: Daily operating hours for the museum. - type: object - properties: - date: - description: Date the operating hours apply to. - $ref: '#/components/schemas/Date' - example: '2024-12-31' - timeOpen: - type: string - pattern: ^([01]\d|2[0-3]):?([0-5]\d)$ - description: >- - Time the museum opens on a specific date. Uses 24 hour time format - (`HH:mm`). - example: '09:00' - timeClose: - description: >- - Time the museum closes on a specific date. Uses 24 hour time format - (`HH:mm`). - type: string - pattern: ^([01]\d|2[0-3]):?([0-5]\d)$ - example: '18:00' - required: - - date - - timeOpen - - timeClose - EventId: - description: Identifier for a special event. - type: string - format: uuid - example: 3be6453c-03eb-4357-ae5a-984a0e574a54 - EventName: - type: string - description: Name of the special event. - example: Pirate Coding Workshop - EventLocation: - type: string - description: Location where the special event is held. - example: Computer Room - EventDescription: - type: string - description: Description of the special event. - example: >- - Captain Blackbeard shares his love of the C...language. And possibly - Arrrrr (R lang). - EventDates: - type: array - items: - $ref: '#/components/schemas/Date' - description: List of planned dates for the special event. - EventPrice: - description: Price of a ticket for the special event. - type: number - format: float - example: 25 - CreateSpecialEventRequest: - description: Request payload for creating new special events at the museum. - type: object - properties: - name: - $ref: '#/components/schemas/EventName' - location: - $ref: '#/components/schemas/EventLocation' - eventDescription: - $ref: '#/components/schemas/EventDescription' - dates: - $ref: '#/components/schemas/EventDates' - price: - $ref: '#/components/schemas/EventPrice' - required: - - name - - location - - eventDescription - - dates - - price - UpdateSpecialEventRequest: - description: >- - Request payload for updating an existing special event. Only included - fields are updated in the event. - type: object - properties: - name: - $ref: '#/components/schemas/EventName' - location: - $ref: '#/components/schemas/EventLocation' - eventDescription: - $ref: '#/components/schemas/EventDescription' - dates: - $ref: '#/components/schemas/EventDates' - price: - $ref: '#/components/schemas/EventPrice' - ListSpecialEventsResponse: - description: List of upcoming special events. - type: array - items: - $ref: '#/components/schemas/SpecialEventResponse' - SpecialEventResponse: - description: Information about a special event. - type: object - properties: - eventId: - $ref: '#/components/schemas/EventId' - name: - $ref: '#/components/schemas/EventName' - location: - $ref: '#/components/schemas/EventLocation' - eventDescription: - $ref: '#/components/schemas/EventDescription' - dates: - $ref: '#/components/schemas/EventDates' - price: - $ref: '#/components/schemas/EventPrice' - required: - - eventId - - name - - location - - eventDescription - - dates - - price - Error: - type: object - properties: - type: - type: string - example: object - title: - type: string - example: Validation failed - securitySchemes: - MuseumPlaceholderAuth: - type: http - scheme: basic - examples: - BuyGeneralTicketsRequestExample: - summary: General entry ticket - value: - ticketType: general - ticketDate: '2023-09-07' - email: todd@example.com - BuyEventTicketsRequestExample: - summary: Special event ticket - value: - ticketType: general - eventId: dad4bce8-f5cb-4078-a211-995864315e39 - ticketDate: '2023-09-05' - email: todd@example.com - BuyGeneralTicketsResponseExample: - summary: General entry ticket - value: - message: Museum general entry ticket purchased - ticketId: 382c0820-0530-4f4b-99af-13811ad0f17a - ticketType: general - ticketDate: '2023-09-07' - confirmationCode: ticket-general-e5e5c6-dce78 - BuyEventTicketsResponseExample: - summary: Special event ticket - value: - message: Museum special event ticket purchased - ticketId: b811f723-17b2-44f7-8952-24b03e43d8a9 - eventName: Mermaid Treasure Identification and Analysis - ticketType: event - ticketDate: '2023-09-05' - confirmationCode: ticket-event-9c55eg-8v82a - CreateSpecialEventRequestExample: - summary: Create special event - value: - name: Mermaid Treasure Identification and Analysis - location: Under the seaaa 🦀 🎶 🌊. - eventDescription: >- - Join us as we review and classify a rare collection of 20 - thingamabobs, gadgets, gizmos, whoosits, and whatsits, kindly donated - by Ariel. - dates: - - '2023-09-05' - - '2023-09-08' - price: 0 - CreateSpecialEventResponseExample: - summary: Special event created - value: - eventId: dad4bce8-f5cb-4078-a211-995864315e39 - name: Mermaid Treasure Identification and Analysis - location: Under the seaaa 🦀 🎶 🌊. - eventDescription: >- - Join us as we review and classify a rare collection of 20 - thingamabobs, gadgets, gizmos, whoosits, and whatsits, kindly donated - by Ariel. - dates: - - '2023-09-05' - - '2023-09-08' - price: 30 - GetSpecialEventResponseExample: - summary: Get special event - value: - eventId: 6744a0da-4121-49cd-8479-f8cc20526495 - name: Time Traveler Tea Party - location: Temporal Tearoom - eventDescription: Sip tea with important historical figures. - dates: - - '2023-11-18' - - '2023-11-25' - - '2023-12-02' - price: 60 - ListSpecialEventsResponseExample: - summary: List of special events - value: - - eventId: f3e0e76e-e4a8-466e-ab9c-ae36c15b8e97 - name: Sasquatch Ballet - location: Seattle... probably - eventDescription: >- - They're big, they're hairy, but they're also graceful. Come learn - how the biggest feet can have the lightest touch. - dates: - - '2023-12-15' - - '2023-12-22' - price: 40 - - eventId: 2f14374a-9c65-4ee5-94b7-fba66d893483 - name: Solar Telescope Demonstration - location: Far from the sun. - eventDescription: Look at the sun without going blind! - dates: - - '2023-09-07' - - '2023-09-14' - price: 50 - - eventId: 6aaa61ba-b2aa-4868-b803-603dbbf7bfdb - name: Cook like a Caveman - location: Fire Pit on East side - eventDescription: Learn to cook on an open flame. - dates: - - '2023-11-10' - - '2023-11-17' - - '2023-11-24' - price: 5 - - eventId: 602b75e1-5696-4ab8-8c7a-f9e13580f910 - name: Underwater Basket Weaving - location: Rec Center Pool next door. - eventDescription: Learn to weave baskets underwater. - dates: - - '2023-09-12' - - '2023-09-15' - price: 15 - - eventId: dad4bce8-f5cb-4078-a211-995864315e39 - name: Mermaid Treasure Identification and Analysis - location: Room Sea-12 - eventDescription: >- - Join us as we review and classify a rare collection of 20 - thingamabobs, gadgets, gizmos, whoosits, and whatsits — kindly - donated by Ariel. - dates: - - '2023-09-05' - - '2023-09-08' - price: 30 - - eventId: 6744a0da-4121-49cd-8479-f8cc20526495 - name: Time Traveler Tea Party - location: Temporal Tearoom - eventDescription: Sip tea with important historical figures. - dates: - - '2023-11-18' - - '2023-11-25' - - '2023-12-02' - price: 60 - - eventId: 3be6453c-03eb-4357-ae5a-984a0e574a54 - name: Pirate Coding Workshop - location: Computer Room - eventDescription: >- - Captain Blackbeard shares his love of the C...language. And possibly - Arrrrr (R lang). - dates: - - '2023-10-29' - - '2023-10-30' - - '2023-10-31' - price: 45 - - eventId: 9d90d29a-2af5-4206-97d9-9ea9ceadcb78 - name: Llama Street Art Through the Ages - location: Auditorium - eventDescription: Llama street art?! Alpaca my bags -- let's go! - dates: - - '2023-10-29' - - '2023-10-30' - - '2023-10-31' - price: 45 - - eventId: a3c7b2c4-b5fb-4ef7-9322-00a919864957 - name: The Great Parrot Debate - location: Outdoor Amphitheatre - eventDescription: See leading parrot minds discuss important geopolitical issues. - dates: - - '2023-11-03' - - '2023-11-10' - price: 35 - - eventId: b92d46b7-4c5d-422b-87a5-287767e26f29 - name: Eat a Bunch of Corn - location: Cafeteria - eventDescription: We accidentally bought too much corn. Please come eat it. - dates: - - '2023-11-10' - - '2023-11-17' - - '2023-11-24' - price: 5 - UpdateSpecialEventRequestExample: - summary: Update special event request - value: - location: On the beach. - price: 15 - UpdateSpecialEventResponseExample: - summary: Update special event - value: - eventId: dad4bce8-f5cb-4078-a211-995864315e39 - name: Mermaid Treasure Identification and Analysis - location: On the beach. - eventDescription: >- - Join us as we review and classify a rare collection of 20 - thingamabobs, gadgets, gizmos, whoosits, and whatsits, kindly donated - by Ariel. - dates: - - '2023-09-05' - - '2023-09-08' - price: 15 - GetMuseumHoursResponseExample: - summary: Get hours response - value: - - date: '2023-09-11' - timeOpen: '09:00' - timeClose: '18:00' - - date: '2023-09-12' - timeOpen: '09:00' - timeClose: '18:00' - - date: '2023-09-13' - timeOpen: '09:00' - timeClose: '18:00' - - date: '2023-09-14' - timeOpen: '09:00' - timeClose: '18:00' - - date: '2023-09-15' - timeOpen: '10:00' - timeClose: '16:00' - - date: '2023-09-18' - timeOpen: '09:00' - timeClose: '18:00' - - date: '2023-09-19' - timeOpen: '09:00' - timeClose: '18:00' - - date: '2023-09-20' - timeOpen: '09:00' - timeClose: '18:00' - - date: '2023-09-21' - timeOpen: '09:00' - timeClose: '18:00' - - date: '2023-09-22' - timeOpen: '10:00' - timeClose: '16:00' - parameters: - PaginationPage: - name: page - in: query - description: Page number to retrieve. - schema: - type: integer - default: 1 - example: 2 - PaginationLimit: - name: limit - in: query - description: Number of days per page. - schema: - type: integer - default: 10 - maximum: 30 - example: 15 - EventId: - name: eventId - in: path - description: Identifier for a special event. - required: true - schema: - type: string - format: uuid - example: dad4bce8-f5cb-4078-a211-995864315e39 - StartDate: - name: startDate - in: query - description: >- - Starting date to retrieve future operating hours from. Defaults to - today's date. - schema: - type: string - format: date - example: '2023-02-23' - EndDate: - name: endDate - in: query - description: >- - End of a date range to retrieve special events for. Defaults to 7 days - after `startDate`. - schema: - type: string - format: date - example: '2023-04-18' - TicketId: - name: ticketId - in: path - description: >- - Identifier for a ticket to a museum event. Used to generate ticket - image. - required: true - schema: - type: string - format: uuid - example: a54a57ca-36f8-421b-a6b4-2e8f26858a4c - responses: - BadRequest: - description: Bad request. - content: - application/problem+json: - schema: - $ref: '#/components/schemas/Error' - NotFound: - description: Not found. - content: - application/problem+json: - schema: - $ref: '#/components/schemas/Error' - Unauthorized: - description: Unauthorized. - content: - application/problem+json: - schema: - $ref: '#/components/schemas/Error' -tags: - - name: Operations - description: Operational information about the museum. - - name: Events - description: Special events hosted by the museum. - - name: Tickets - description: Museum tickets for general entrance or special events. -security: - - MuseumPlaceholderAuth: [] diff --git a/tests/e2e/respect/museum-tickets.yaml b/tests/e2e/respect/museum-tickets.yaml deleted file mode 100644 index c0dd01ecf2..0000000000 --- a/tests/e2e/respect/museum-tickets.yaml +++ /dev/null @@ -1,39 +0,0 @@ -arazzo: 1.0.1 -info: - title: Redocly Museum API Tickets - description: >- - A part of imaginary, but delightful Museum API for interacting with museum services - and information. Built with love by Redocly. - version: 1.0.0 - -sourceDescriptions: - - name: museum-api - type: openapi - url: museum-api.yaml - -workflows: - - workflowId: get-museum-tickets - description: >- - This workflow demonstrates how to buy tickets for the museum. - parameters: - - in: header - name: Authorization - value: Basic Og== - steps: - - stepId: buy-tickets - description: >- - Buy museum tickets resolving request details with buyMuseumTickets operationId from museum-api.yaml description. - operationId: buyMuseumTickets - requestBody: - payload: - ticketType: general - ticketDate: 2023-09-07 - email: todd@example.com - successCriteria: - - condition: $statusCode == 201 - outputs: - ticketId: $response.body#/ticketId - fullBody: $response.body - outputs: - ticketId: $steps.buy-tickets.outputs.ticketId - stepFullBody: $steps.buy-tickets.outputs.fullBody diff --git a/tests/e2e/respect/outputs-access-syntax-variations/__snapshots__/outputs-access-syntax-variations.test.ts.snap b/tests/e2e/respect/outputs-access-syntax-variations/__snapshots__/outputs-access-syntax-variations.test.ts.snap index 674dba57c1..962f2a27c1 100644 --- a/tests/e2e/respect/outputs-access-syntax-variations/__snapshots__/outputs-access-syntax-variations.test.ts.snap +++ b/tests/e2e/respect/outputs-access-syntax-variations/__snapshots__/outputs-access-syntax-variations.test.ts.snap @@ -3,14 +3,13 @@ exports[`should resolve outputs access syntax variations 1`] = ` "──────────────────────────────────────────────────────────────────────────────── - Running workflow outputs-access-syntax-variations.arazzo.yaml / get-museum-hours + Running workflow outputs-access-syntax-variations.arazzo.yaml / get-menu-items - ✓ GET /museum-hours - step get-museum-hours + ✓ GET /menu - step get-menu-items -    Request URL: https://redocly.com/_mock/demo/openapi/museum-api/museum-hours +    Request URL: https://api.cafe.redocly.com/menu?search=mermaid-treasure-latte     Request Headers: -      accept: application/json, application/problem+json -      authorization: Basic Og== +      accept: application/json, application/problem+json     Response status code: 200 @@ -18,111 +17,67 @@ exports[`should resolve outputs access syntax variations 1`] = `     Response Headers:     Response Size: bytes     Response Body: -      [ -       { -       "date": "2023-09-11", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-12", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-13", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-14", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-15", -       "timeOpen": "10:00", -       "timeClose": "16:00" -       }, -       { -       "date": "2023-09-18", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-19", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-20", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-21", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-22", -       "timeOpen": "10:00", -       "timeClose": "16:00" -       } -      ] +      { +       "object": "list", +       "page": { +       "startCursor": null, +       "endCursor": null, +       "hasNextPage": false, +       "hasPrevPage": false, +       "limit": 10, +       "total": 0 +       }, +       "items": [] +      }     ✓ success criteria check - $statusCode == 200 -    ✓ status code check - $statusCode in [200, 400, 404] +    ✓ status code check - $statusCode in [200, 400, 500]     ✓ content-type check     ✓ schema check - Running child workflow for the step buy-ticket - Running workflow museum-tickets.yaml / get-museum-tickets + Running child workflow for the step search-menu + Running workflow cafe-menu.arazzo.yaml / search-menu-items - ✓ POST /tickets - step buy-tickets + ✓ GET /menu - step search-menu -    Request URL: https://redocly.com/_mock/demo/openapi/museum-api/tickets +    Request URL: https://api.cafe.redocly.com/menu?search=mermaid-treasure-latte     Request Headers: -      content-type: application/json -      accept: application/json, application/problem+json -      authorization: Basic Og== -    Request Body: -      { -       "ticketType": "general", -       "ticketDate": "2023-09-07", -       "email": "todd@example.com" -      } +      accept: application/json, application/problem+json -    Response status code: 201 +    Response status code: 200     Response time: ms     Response Headers:     Response Size: bytes     Response Body:       { -       "message": "Museum general entry ticket purchased", -       "ticketId": "382c0820-0530-4f4b-99af-13811ad0f17a", -       "ticketType": "general", -       "ticketDate": "2023-09-07", -       "confirmationCode": "ticket-general-e5e5c6-dce78" +       "object": "list", +       "page": { +       "startCursor": null, +       "endCursor": null, +       "hasNextPage": false, +       "hasPrevPage": false, +       "limit": 10, +       "total": 0 +       }, +       "items": []       } -    ✓ success criteria check - $statusCode == 201 -    ✓ status code check - $statusCode in [201, 400, 404] +    ✓ success criteria check - $statusCode == 200 +    ✓ status code check - $statusCode in [200, 400, 500]     ✓ content-type check     ✓ schema check ──────────────────────────────────────────────────────────────────────────────── - Running workflow outputs-access-syntax-variations.arazzo.yaml / events-crud + Running workflow outputs-access-syntax-variations.arazzo.yaml / client-registration - ✓ GET /special-events - step list-events + ✓ GET /menu - step list-menu-items -    Request URL: https://redocly.com/_mock/demo/openapi/museum-api/special-events +    Request URL: https://api.cafe.redocly.com/menu?search=mermaid-treasure-latte     Request Headers: -      accept: application/json, application/problem+json -      authorization: Basic Og== +      accept: application/json, application/problem+json     Response status code: 200 @@ -130,181 +85,77 @@ exports[`should resolve outputs access syntax variations 1`] = `     Response Headers:     Response Size: bytes     Response Body: -      [ -       { -       "eventId": "f3e0e76e-e4a8-466e-ab9c-ae36c15b8e97", -       "name": "Sasquatch Ballet", -       "location": "Seattle... probably", -       "eventDescription": "They're big, they're hairy, but they're also graceful. Come learn how the biggest feet can have the lightest touch.", -       "dates": [ -       "2023-12-15", -       "2023-12-22" -       ], -       "price": 40 -       }, -       { -       "eventId": "2f14374a-9c65-4ee5-94b7-fba66d893483", -       "name": "Solar Telescope Demonstration", -       "location": "Far from the sun.", -       "eventDescription": "Look at the sun without going blind!", -       "dates": [ -       "2023-09-07", -       "2023-09-14" -       ], -       "price": 50 -       }, -       { -       "eventId": "6aaa61ba-b2aa-4868-b803-603dbbf7bfdb", -       "name": "Cook like a Caveman", -       "location": "Fire Pit on East side", -       "eventDescription": "Learn to cook on an open flame.", -       "dates": [ -       "2023-11-10", -       "2023-11-17", -       "2023-11-24" -       ], -       "price": 5 -       }, -       { -       "eventId": "602b75e1-5696-4ab8-8c7a-f9e13580f910", -       "name": "Underwater Basket Weaving", -       "location": "Rec Center Pool next door.", -       "eventDescription": "Learn to weave baskets underwater.", -       "dates": [ -       "2023-09-12", -       "2023-09-15" -       ], -       "price": 15 -       }, -       { -       "eventId": "dad4bce8-f5cb-4078-a211-995864315e39", -       "name": "Mermaid Treasure Identification and Analysis", -       "location": "Room Sea-12", -       "eventDescription": "Join us as we review and classify a rare collection of 20 thingamabobs, gadgets, gizmos, whoosits, and whatsits — kindly donated by Ariel.", -       "dates": [ -       "2023-09-05", -       "2023-09-08" -       ], -       "price": 30 -       }, -       { -       "eventId": "6744a0da-4121-49cd-8479-f8cc20526495", -       "name": "Time Traveler Tea Party", -       "location": "Temporal Tearoom", -       "eventDescription": "Sip tea with important historical figures.", -       "dates": [ -       "2023-11-18", -       "2023-11-25", -       "2023-12-02" -       ], -       "price": 60 -       }, -       { -       "eventId": "3be6453c-03eb-4357-ae5a-984a0e574a54", -       "name": "Pirate Coding Workshop", -       "location": "Computer Room", -       "eventDescription": "Captain Blackbeard shares his love of the C...language. And possibly Arrrrr (R lang).", -       "dates": [ -       "2023-10-29", -       "2023-10-30", -       "2023-10-31" -       ], -       "price": 45 -       }, -       { -       "eventId": "9d90d29a-2af5-4206-97d9-9ea9ceadcb78", -       "name": "Llama Street Art Through the Ages", -       "location": "Auditorium", -       "eventDescription": "Llama street art?! Alpaca my bags -- let's go!", -       "dates": [ -       "2023-10-29", -       "2023-10-30", -       "2023-10-31" -       ], -       "price": 45 -       }, -       { -       "eventId": "a3c7b2c4-b5fb-4ef7-9322-00a919864957", -       "name": "The Great Parrot Debate", -       "location": "Outdoor Amphitheatre", -       "eventDescription": "See leading parrot minds discuss important geopolitical issues.", -       "dates": [ -       "2023-11-03", -       "2023-11-10" -       ], -       "price": 35 -       }, -       { -       "eventId": "b92d46b7-4c5d-422b-87a5-287767e26f29", -       "name": "Eat a Bunch of Corn", -       "location": "Cafeteria", -       "eventDescription": "We accidentally bought too much corn. Please come eat it.", -       "dates": [ -       "2023-11-10", -       "2023-11-17", -       "2023-11-24" -       ], -       "price": 5 -       } -      ] +      { +       "object": "list", +       "page": { +       "startCursor": null, +       "endCursor": null, +       "hasNextPage": false, +       "hasPrevPage": false, +       "limit": 10, +       "total": 0 +       }, +       "items": [] +      } -    ✓ status code check - $statusCode in [200, 400, 404] +    ✓ status code check - $statusCode in [200, 400, 500]     ✓ content-type check     ✓ schema check - ✓ POST /special-events - step create-event + ✓ POST /oauth2/register - step create-client -    Request URL: https://redocly.com/_mock/demo/openapi/museum-api/special-events +    Request URL: https://api.cafe.redocly.com/oauth2/register     Request Headers:       content-type: application/json       accept: application/json, application/problem+json -      authorization: Basic Og==     Request Body:       { -       "name": "Mermaid Treasure Identification and Analysis", -       "location": "Under the seaaa 🦀 🎶 🌊.", -       "eventDescription": "Join us as we review and classify a rare collection of 20 thingamabobs, gadgets, gizmos, whoosits, and whatsits, kindly donated by Ariel.", -       "dates": [ -       "2023-12-15", -       "2023-12-22" -       ], -       "price": 0 +       "listObject": 10, +       "listTotal": 0       } -    Response status code: 201 +    Response status code: 400     Response time: ms     Response Headers:     Response Size: bytes     Response Body:       { -       "eventId": "dad4bce8-f5cb-4078-a211-995864315e39", -       "name": "Mermaid Treasure Identification and Analysis", -       "location": "Under the seaaa 🦀 🎶 🌊.", -       "eventDescription": "Join us as we review and classify a rare collection of 20 thingamabobs, gadgets, gizmos, whoosits, and whatsits, kindly donated by Ariel.", -       "dates": [ -       "2023-12-15", -       "2023-12-22" -       ], -       "price": 0 +       "type": "about:blank", +       "title": "Validation failed", +       "status": 400, +       "instance": "/oauth2/register", +       "details": { +       "errors": [ +       { +       "code": "invalid_type", +       "expected": "string", +       "received": "undefined", +       "path": [ +       "name" +       ], +       "message": "Required" +       } +       ] +       }       } -    ✓ success criteria check - $statusCode == 201 -    ✓ success criteria check - $workflows.get-museum-hours.outputs.message == 'Mu... -    ✓ status code check - $statusCode in [201, 400, 404] +    ✓ success criteria check - $statusCode == 400 +    ✓ success criteria check - $workflows.get-menu-items.outputs.itemsCount == 0 +    ✓ status code check - $statusCode in [201, 400, 401, 500]     ✓ content-type check     ✓ schema check ──────────────────────────────────────────────────────────────────────────────── - Running workflow outputs-access-syntax-variations.arazzo.yaml / get-event-by-id + Running workflow outputs-access-syntax-variations.arazzo.yaml / get-menu-items-by-error-field - ✓ GET /special-events/{eventId} - step get-event-by-id + ✓ GET /menu - step get-menu-items-by-error-field -    Request URL: https://redocly.com/_mock/demo/openapi/museum-api/special-events/dad4bce8-f5cb-4078-a211-995864315e39 +    Request URL: https://api.cafe.redocly.com/menu?search=name     Request Headers:       accept: application/json, application/problem+json -      authorization: Basic Og== +      x-original-message: Required     Response status code: 200 @@ -313,20 +164,20 @@ exports[`should resolve outputs access syntax variations 1`] = `     Response Size: bytes     Response Body:       { -       "eventId": "6744a0da-4121-49cd-8479-f8cc20526495", -       "name": "Time Traveler Tea Party", -       "location": "Temporal Tearoom", -       "eventDescription": "Sip tea with important historical figures.", -       "dates": [ -       "2023-11-18", -       "2023-11-25", -       "2023-12-02" -       ], -       "price": 60 +       "object": "list", +       "page": { +       "startCursor": null, +       "endCursor": null, +       "hasNextPage": false, +       "hasPrevPage": false, +       "limit": 10, +       "total": 0 +       }, +       "items": []       } -    ✓ success criteria check - $workflows.events-crud.outputs.createdEventData#/p... -    ✓ status code check - $statusCode in [200, 400, 404] +    ✓ success criteria check - $workflows.client-registration.outputs.createdClie... +    ✓ status code check - $statusCode in [200, 400, 500]     ✓ content-type check     ✓ schema check diff --git a/tests/e2e/respect/outputs-access-syntax-variations/outputs-access-syntax-variations.arazzo.yaml b/tests/e2e/respect/outputs-access-syntax-variations/outputs-access-syntax-variations.arazzo.yaml index 20efa47411..86ee5b4a79 100644 --- a/tests/e2e/respect/outputs-access-syntax-variations/outputs-access-syntax-variations.arazzo.yaml +++ b/tests/e2e/respect/outputs-access-syntax-variations/outputs-access-syntax-variations.arazzo.yaml @@ -1,81 +1,74 @@ arazzo: 1.0.1 info: - title: Redocly Museum API + title: Outputs access syntax variations description: >- - An imaginary, but delightful Museum API for interacting with museum services - and information. Built with love by Redocly. + Testing outputs access syntax variations against the Redocly Cafe API. version: 1.0.0 sourceDescriptions: - - name: museum-api + - name: cafe-api type: openapi - url: ../museum-api.yaml - - name: tickets-from-museum-api + url: ../cafe-api.yaml + - name: menu-from-cafe-api type: arazzo - url: ../museum-tickets.yaml + url: ../cafe-menu.arazzo.yaml workflows: - - workflowId: get-museum-hours - parameters: - - in: header - name: Authorization - value: Basic Og== + - workflowId: get-menu-items steps: - - stepId: get-museum-hours - operationId: museum-api.getMuseumHours + - stepId: get-menu-items + operationId: cafe-api.listMenuItems + parameters: + - in: query + name: search + value: mermaid-treasure-latte successCriteria: - condition: $statusCode == 200 outputs: - schedule: $response.body - firstEventData: $response.body#/0/date - - stepId: buy-ticket + menu: $response.body + pageLimit: $response.body#/page/limit + - stepId: search-menu # the legacy `$sourceDescriptions..workflows.` form is kept here for backward compatibility coverage - workflowId: $sourceDescriptions.tickets-from-museum-api.workflows.get-museum-tickets + workflowId: $sourceDescriptions.menu-from-cafe-api.workflows.search-menu-items outputs: - ticketId: $outputs.ticketId - message: $outputs.stepFullBody#/message + total: $outputs.total + itemsCount: $outputs.stepFullBody#/page/total outputs: - message: $steps.buy-ticket.outputs.message - - workflowId: events-crud - parameters: - - in: header - name: Authorization - value: Basic Og== + itemsCount: $steps.search-menu.outputs.itemsCount + - workflowId: client-registration steps: - - stepId: list-events - operationPath: '{$sourceDescriptions.museum-api.url}#/paths/~1special-events/get' + - stepId: list-menu-items + operationPath: '{$sourceDescriptions.cafe-api.url}#/paths/~1menu/get' + parameters: + - in: query + name: search + value: mermaid-treasure-latte outputs: - events: $response.body - - stepId: create-event - operationPath: '{$sourceDescriptions.museum-api.url}#/paths/~1special-events/post' + menuItems: $response.body + - stepId: create-client + operationPath: '{$sourceDescriptions.cafe-api.url}#/paths/~1oauth2~1register/post' requestBody: payload: - name: 'Mermaid Treasure Identification and Analysis' - location: 'Under the seaaa 🦀 🎶 🌊.' - eventDescription: 'Join us as we review and classify a rare collection of 20 thingamabobs, gadgets, gizmos, whoosits, and whatsits, kindly donated by Ariel.' - dates: - - $steps.list-events.outputs.events.0.dates.0 - - $steps.list-events.outputs.events#/0/dates/1 - price: 0 + listObject: $steps.list-menu-items.outputs.menuItems.page.limit + listTotal: $steps.list-menu-items.outputs.menuItems#/page/total successCriteria: - - condition: $statusCode == 201 - - condition: $workflows.get-museum-hours.outputs.message == 'Museum general entry ticket purchased' + - condition: $statusCode == 400 + - condition: $workflows.get-menu-items.outputs.itemsCount == 0 outputs: - createdEventId: $response.body#/eventId - crearedEventData: $response.body + errorStatus: $response.body#/status + createdClientError: $response.body outputs: - createdEventData: $steps.create-event.outputs.crearedEventData - - workflowId: get-event-by-id - parameters: - - in: header - name: Authorization - value: Basic Og== + createdClientError: $steps.create-client.outputs.createdClientError + - workflowId: get-menu-items-by-error-field steps: - - stepId: get-event-by-id - operationPath: '{$sourceDescriptions.museum-api.url}#/paths/~1special-events~1{eventId}/get' + - stepId: get-menu-items-by-error-field + operationPath: '{$sourceDescriptions.cafe-api.url}#/paths/~1menu/get' parameters: - - name: eventId - in: path - value: $workflows.events-crud.outputs.createdEventData#/eventId + - name: search + in: query + value: $workflows.client-registration.outputs.createdClientError#/details/errors/0/path/0 + - name: x-original-message + in: header + value: $workflows.client-registration.outputs.createdClientError.details.errors.0.message successCriteria: - - condition: $workflows.events-crud.outputs.createdEventData#/price == 0 + - condition: $workflows.client-registration.outputs.createdClientError#/status == 400 diff --git a/tests/e2e/respect/outputs-in-path-parameters/__snapshots__/outputs-in-path-parameters.test.ts.snap b/tests/e2e/respect/outputs-in-path-parameters/__snapshots__/outputs-in-path-parameters.test.ts.snap new file mode 100644 index 0000000000..293eb05abf --- /dev/null +++ b/tests/e2e/respect/outputs-in-path-parameters/__snapshots__/outputs-in-path-parameters.test.ts.snap @@ -0,0 +1,75 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`should resolve step outputs in path parameters 1`] = ` +"──────────────────────────────────────────────────────────────────────────────── + + Running workflow outputs-in-path-parameters.arazzo.yaml / photo-by-menu-item-id + + ✓ GET /menu - step search-menu-by-id + +    Request URL: https://api.cafe.redocly.com/menu?search=prd_0000000000seedtrams0000000 +    Request Headers: +      accept: application/json, application/problem+json + + +    Response status code: 200 +    Response time: ms +    Response Headers: +    Response Size: bytes +    Response Body: +      { +       "object": "list", +       "page": { +       "startCursor": null, +       "endCursor": null, +       "hasNextPage": false, +       "hasPrevPage": false, +       "limit": 10, +       "total": 0 +       }, +       "items": [] +      } + +    ✓ success criteria check - $statusCode == 200 +    ✓ status code check - $statusCode in [200, 400, 500] +    ✓ content-type check +    ✓ schema check + + ✓ GET /menu-item-images/{menuItemId} - step get-menu-item-photo + +    Request URL: https://api.cafe.redocly.com/menu-item-images/prd_0000000000seedtrams0000000 +    Request Headers: +      accept: text/plain + + +    Response status code: 200 +    Response time: ms +    Response Headers: +    Response Size: bytes +    Response Body: +      A classic Italian tiramisu layered with mascarpone and espresso + +    ✓ success criteria check - $statusCode == 200 +    ✓ success criteria check - $response.body == 'A classic Italian tiramisu laye... +    ✓ status code check - $statusCode in [200, 404, 500] +    ✓ content-type check +    ✓ schema check + + +  Summary for outputs-in-path-parameters.arazzo.yaml +   +  Workflows: 1 passed, 1 total +  Steps: 2 passed, 2 total +  Checks: 9 passed, 9 total +  Time: ms + + +┌────────────────────────────────────────────────────────────────────────────────┬────────────┬─────────┬─────────┬──────────┐ +│ Filename │ Workflows │ Passed │ Failed │ Warnings │ +├────────────────────────────────────────────────────────────────────────────────┼────────────┼─────────┼─────────┼──────────┤ +│ ✓ outputs-in-path-parameters.arazzo.yaml │ 1 │ 1 │ - │ - │ +└────────────────────────────────────────────────────────────────────────────────┴────────────┴─────────┴─────────┴──────────┘ + + +" +`; diff --git a/tests/e2e/respect/outputs-in-path-parameters/outputs-in-path-parameters.arazzo.yaml b/tests/e2e/respect/outputs-in-path-parameters/outputs-in-path-parameters.arazzo.yaml new file mode 100644 index 0000000000..c42a751c68 --- /dev/null +++ b/tests/e2e/respect/outputs-in-path-parameters/outputs-in-path-parameters.arazzo.yaml @@ -0,0 +1,45 @@ +arazzo: 1.0.1 +info: + title: Outputs in path parameters + description: >- + Chains a step output into a path parameter and renders the resolved request URL + in verbose output. + The id is taken from the request query so every printed response body stays deterministic. + version: 1.0.0 + +sourceDescriptions: + - name: cafe-api + type: openapi + url: ../cafe-api.yaml + +workflows: + - workflowId: photo-by-menu-item-id + description: >- + This workflow demonstrates how a step output resolves inside a path parameter. + steps: + - stepId: search-menu-by-id + description: >- + Search the menu by a menu item id and capture the id from the request query. + operationId: cafe-api.listMenuItems + parameters: + - in: query + name: search + value: prd_0000000000seedtrams0000000 + successCriteria: + - condition: $statusCode == 200 + outputs: + menuItemId: $request.query.search + - stepId: get-menu-item-photo + description: >- + Retrieve the photo text description using the menu item id from the previous step. + operationId: cafe-api.getMenuItemPhoto + parameters: + - in: path + name: menuItemId + value: $steps.search-menu-by-id.outputs.menuItemId + - in: header + name: Accept + value: text/plain + successCriteria: + - condition: $statusCode == 200 + - condition: $response.body == 'A classic Italian tiramisu layered with mascarpone and espresso' diff --git a/tests/e2e/respect/outputs-in-path-parameters/outputs-in-path-parameters.test.ts b/tests/e2e/respect/outputs-in-path-parameters/outputs-in-path-parameters.test.ts new file mode 100644 index 0000000000..d7af3065b6 --- /dev/null +++ b/tests/e2e/respect/outputs-in-path-parameters/outputs-in-path-parameters.test.ts @@ -0,0 +1,15 @@ +import { dirname, join } from 'node:path'; +import { fileURLToPath } from 'node:url'; + +import { getCommandOutput, getParams } from '../../helpers.js'; + +const __dirname = dirname(fileURLToPath(import.meta.url)); + +test('should resolve step outputs in path parameters', () => { + const indexEntryPoint = join(process.cwd(), 'packages/cli/lib/index.js'); + const fixturesPath = join(__dirname, 'outputs-in-path-parameters.arazzo.yaml'); + const args = getParams(indexEntryPoint, ['respect', fixturesPath, '--verbose']); + + const result = getCommandOutput(args); + expect(result).toMatchSnapshot(); +}, 60_000); diff --git a/tests/e2e/respect/replacements/__snapshots__/replacements.test.ts.snap b/tests/e2e/respect/replacements/__snapshots__/replacements.test.ts.snap index db8547fce5..ccfd98774a 100644 --- a/tests/e2e/respect/replacements/__snapshots__/replacements.test.ts.snap +++ b/tests/e2e/respect/replacements/__snapshots__/replacements.test.ts.snap @@ -5,12 +5,11 @@ exports[`should replace values in the request body 1`] = ` Running workflow replacements.arazzo.yaml / replacements - ✓ GET /special-events/{eventId} - step first-step + ✓ GET /menu - step first-step -    Request URL: https://redocly.com/_mock/demo/openapi/museum-api/special-events/dad4bce8-f5cb-4078-a211-995864315e39 +    Request URL: https://api.cafe.redocly.com/menu?search=mermaid-treasure-latte     Request Headers: -      accept: application/json, application/problem+json -      authorization: Basic Og== +      accept: application/json, application/problem+json     Response status code: 200 @@ -19,39 +18,35 @@ exports[`should replace values in the request body 1`] = `     Response Size: bytes     Response Body:       { -       "eventId": "6744a0da-4121-49cd-8479-f8cc20526495", -       "name": "Time Traveler Tea Party", -       "location": "Temporal Tearoom", -       "eventDescription": "Sip tea with important historical figures.", -       "dates": [ -       "2023-11-18", -       "2023-11-25", -       "2023-12-02" -       ], -       "price": 60 +       "object": "list", +       "page": { +       "startCursor": null, +       "endCursor": null, +       "hasNextPage": false, +       "hasPrevPage": false, +       "limit": 10, +       "total": 0 +       }, +       "items": []       } -    ✓ status code check - $statusCode in [200, 400, 404] +    ✓ status code check - $statusCode in [200, 400, 500]     ✓ content-type check     ✓ schema check - ✓ POST /tickets - step step-with-json-replacements + ✓ POST /oauth2/register - step step-with-json-replacements -    Request URL: https://redocly.com/_mock/demo/openapi/museum-api/tickets +    Request URL: https://api.cafe.redocly.com/oauth2/register     Request Headers:       content-type: application/json       accept: application/json, application/problem+json -      authorization: Basic Og==     Request Body:       { -       "eventId": "my-custom-event-id", -       "name": "Time Traveler Tea Party", -       "location": "Time Traveler Tea Party", -       "eventDescription": "Sip tea with important historical figures.", -       "dates": [ +       "object": "my-custom-object", +       "page": [        "2025-01-01"        ], -       "price": 60 +       "items": "list"       } @@ -61,61 +56,81 @@ exports[`should replace values in the request body 1`] = `     Response Size: bytes     Response Body:       { -       "type": "object", -       "title": "Error validating body. data must have required property 'ticketType', data must have required property 'ticketDate', data must have required property 'email', data/eventId must match format \\"uuid\\"" +       "type": "about:blank", +       "title": "Validation failed", +       "status": 400, +       "instance": "/oauth2/register", +       "details": { +       "errors": [ +       { +       "code": "invalid_type", +       "expected": "string", +       "received": "undefined", +       "path": [ +       "name" +       ], +       "message": "Required" +       } +       ] +       }       } -    ✓ status code check - $statusCode in [201, 400, 404] +    ✓ success criteria check - $statusCode == 400 +    ✓ status code check - $statusCode in [201, 400, 401, 500]     ✓ content-type check     ✓ schema check - ✓ PATCH /special-events/{eventId} - step step-with-form-urlencoded-replacements + ✓ POST /orders - step step-with-form-urlencoded-replacements -    Request URL: https://redocly.com/_mock/demo/openapi/museum-api/special-events/dad4bce8-f5cb-4078-a211-995864315e39 +    Request URL: https://api.cafe.redocly.com/orders     Request Headers:       content-type: application/x-www-form-urlencoded       accept: application/json, application/problem+json -      authorization: Basic Og==     Request Body: -      "name=Time+Traveler+Tea+Party&location=New+York" +      "customerName=list&location=New+York" -    Response status code: 400 +    Response status code: 401     Response time: ms     Response Headers:     Response Size: bytes     Response Body:       { -       "type": "object", -       "title": "Media type \\"application/x-www-form-urlencoded\\" is not supported" +       "type": "about:blank", +       "title": "Unauthorized", +       "status": 401, +       "instance": "/orders"       } -    ✓ status code check - $statusCode in [200, 400, 404] +    ✓ success criteria check - $statusCode == 401 +    ✓ status code check - $statusCode in [201, 400, 401, 403, 500]     ✓ content-type check     ✓ schema check - ✓ PATCH /special-events/{eventId} - step step-with-form-urlencoded-replacements-2 + ✓ POST /orders - step step-with-form-urlencoded-replacements-2 -    Request URL: https://redocly.com/_mock/demo/openapi/museum-api/special-events/dad4bce8-f5cb-4078-a211-995864315e39 +    Request URL: https://api.cafe.redocly.com/orders     Request Headers:       content-type: application/x-www-form-urlencoded       accept: application/json, application/problem+json -      authorization: Basic Og==     Request Body: -      "name=Time+Traveler+Tea+Party&location=Jakarta" +      "customerName=list&location=Jakarta" -    Response status code: 400 +    Response status code: 401     Response time: ms     Response Headers:     Response Size: bytes     Response Body:       { -       "type": "object", -       "title": "Media type \\"application/x-www-form-urlencoded\\" is not supported" +       "type": "about:blank", +       "title": "Unauthorized", +       "status": 401, +       "instance": "/orders"       } -    ✓ status code check - $statusCode in [200, 400, 404] +    ✓ success criteria check - $statusCode == 401 +    ✓ status code check - $statusCode in [201, 400, 401, 403, 500]     ✓ content-type check     ✓ schema check @@ -124,7 +139,7 @@ exports[`should replace values in the request body 1`] = `      Workflows: 1 passed, 1 total   Steps: 4 passed, 4 total -  Checks: 12 passed, 12 total +  Checks: 15 passed, 15 total   Time: ms diff --git a/tests/e2e/respect/replacements/replacements.arazzo.yaml b/tests/e2e/respect/replacements/replacements.arazzo.yaml index 98e7b463b1..4d3d940606 100644 --- a/tests/e2e/respect/replacements/replacements.arazzo.yaml +++ b/tests/e2e/respect/replacements/replacements.arazzo.yaml @@ -1,56 +1,62 @@ arazzo: 1.0.1 info: - title: Test `successActions` in workflows - description: Testing functionality of `end` action in `onFailure` action. + title: Test requestBody `replacements` in steps + description: Testing functionality of requestBody `replacements`. version: 1.0.0 sourceDescriptions: - - name: museum-api + - name: cafe-api type: openapi - url: ../museum-api.yaml + url: ../cafe-api.yaml workflows: - workflowId: replacements - parameters: - - in: header - name: Authorization - value: Basic Og== description: >- This workflow demonstrates how to replace values in the request body. steps: - stepId: first-step - operationId: getSpecialEvent + operationId: listMenuItems + parameters: + - in: query + name: search + value: mermaid-treasure-latte outputs: - event: $response.body + menu: $response.body - stepId: step-with-json-replacements - operationId: buyMuseumTickets + operationId: registerOAuth2Client requestBody: contentType: application/json - payload: $steps.first-step.outputs.event + payload: $steps.first-step.outputs.menu replacements: - - target: /eventId - value: 'my-custom-event-id' - - target: /location - value: $steps.first-step.outputs.event#/name - - target: /dates + - target: /object + value: 'my-custom-object' + - target: /items + value: $steps.first-step.outputs.menu#/object + - target: /page value: - '2025-01-01' + successCriteria: + - condition: $statusCode == 400 - stepId: step-with-form-urlencoded-replacements - operationId: updateSpecialEvent + operationId: createOrder requestBody: contentType: application/x-www-form-urlencoded - payload: name={$steps.first-step.outputs.event#/name}&location=Lviv" + payload: customerName={$steps.first-step.outputs.menu#/object}&location=Lviv replacements: - target: /location value: 'New York' + successCriteria: + - condition: $statusCode == 401 - stepId: step-with-form-urlencoded-replacements-2 - operationId: updateSpecialEvent + operationId: createOrder requestBody: contentType: application/x-www-form-urlencoded payload: - name: $steps.first-step.outputs.event#/name + customerName: $steps.first-step.outputs.menu#/object location: Lviv replacements: - target: /location value: 'Jakarta' + successCriteria: + - condition: $statusCode == 401 diff --git a/tests/e2e/respect/reusable-components/__snapshots__/reusable-components.test.ts.snap b/tests/e2e/respect/reusable-components/__snapshots__/reusable-components.test.ts.snap index e502794f2e..0be0334633 100644 --- a/tests/e2e/respect/reusable-components/__snapshots__/reusable-components.test.ts.snap +++ b/tests/e2e/respect/reusable-components/__snapshots__/reusable-components.test.ts.snap @@ -3,11 +3,11 @@ exports[`should use inputs from CLI and env to map with resolved refs 1`] = ` "──────────────────────────────────────────────────────────────────────────────── - Running workflow reusable-components.arazzo.yaml / get-museum-hours + Running workflow reusable-components.arazzo.yaml / get-menu-items - ✓ GET /museum-hours - step get-museum-hours-step-success-action + ✓ GET /menu - step get-menu-items-step-success-action -    Request URL: https://redocly.com/_mock/demo/openapi/museum-api/museum-hours +    Request URL: https://api.cafe.redocly.com/menu?search=mermaid-treasure-latte     Request Headers:       accept: application/json, application/problem+json       pagesize: 256 @@ -19,67 +19,27 @@ exports[`should use inputs from CLI and env to map with resolved refs 1`] = `     Response Headers:     Response Size: bytes     Response Body: -      [ -       { -       "date": "2023-09-11", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-12", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-13", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-14", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-15", -       "timeOpen": "10:00", -       "timeClose": "16:00" -       }, -       { -       "date": "2023-09-18", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-19", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-20", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-21", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-22", -       "timeOpen": "10:00", -       "timeClose": "16:00" -       } -      ] +      { +       "object": "list", +       "page": { +       "startCursor": null, +       "endCursor": null, +       "hasNextPage": false, +       "hasPrevPage": false, +       "limit": 10, +       "total": 0 +       }, +       "items": [] +      }     ✓ success criteria check - $statusCode == 200 -    ✓ status code check - $statusCode in [200, 400, 404] +    ✓ status code check - $statusCode in [200, 400, 500]     ✓ content-type check     ✓ schema check - ✗ GET /museum-hours - step get-museum-hours-step-failure-action-goto + ✗ GET /menu - step get-menu-items-step-failure-action-goto -    Request URL: https://redocly.com/_mock/demo/openapi/museum-api/museum-hours +    Request URL: https://api.cafe.redocly.com/menu?search=mermaid-treasure-latte     Request Headers:       accept: application/json, application/problem+json       pagesize: 256 @@ -91,70 +51,30 @@ exports[`should use inputs from CLI and env to map with resolved refs 1`] = `     Response Headers:     Response Size: bytes     Response Body: -      [ -       { -       "date": "2023-09-11", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-12", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-13", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-14", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-15", -       "timeOpen": "10:00", -       "timeClose": "16:00" -       }, -       { -       "date": "2023-09-18", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-19", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-20", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-21", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-22", -       "timeOpen": "10:00", -       "timeClose": "16:00" -       } -      ] +      { +       "object": "list", +       "page": { +       "startCursor": null, +       "endCursor": null, +       "hasNextPage": false, +       "hasPrevPage": false, +       "limit": 10, +       "total": 0 +       }, +       "items": [] +      }     ✗ success criteria check - $statusCode == 201 -    ✓ status code check - $statusCode in [200, 400, 404] +    ✓ status code check - $statusCode in [200, 400, 500]     ✓ content-type check     ✓ schema check - Running failure action get-museum-hours-failure-action for the step get-museum-hours-step-failure-action-goto + Running failure action get-menu-items-failure-action for the step get-menu-items-step-failure-action-goto Running workflow reusable-components.arazzo.yaml / final-workflow - ✓ GET /museum-hours - step final-workflow-step + ✓ GET /menu - step final-workflow-step -    Request URL: https://redocly.com/_mock/demo/openapi/museum-api/museum-hours +    Request URL: https://api.cafe.redocly.com/menu?search=mermaid-treasure-latte     Request Headers:       accept: application/json, application/problem+json       pagesize: 256 @@ -166,72 +86,32 @@ exports[`should use inputs from CLI and env to map with resolved refs 1`] = `     Response Headers:     Response Size: bytes     Response Body: -      [ -       { -       "date": "2023-09-11", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-12", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-13", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-14", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-15", -       "timeOpen": "10:00", -       "timeClose": "16:00" -       }, -       { -       "date": "2023-09-18", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-19", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-20", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-21", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-22", -       "timeOpen": "10:00", -       "timeClose": "16:00" -       } -      ] +      { +       "object": "list", +       "page": { +       "startCursor": null, +       "endCursor": null, +       "hasNextPage": false, +       "hasPrevPage": false, +       "limit": 10, +       "total": 0 +       }, +       "items": [] +      }     ✓ success criteria check - $statusCode == 200 -    ✓ status code check - $statusCode in [200, 400, 404] +    ✓ status code check - $statusCode in [200, 400, 500]     ✓ content-type check     ✓ schema check ──────────────────────────────────────────────────────────────────────────────── - Running workflow reusable-components.arazzo.yaml / events-crud + Running workflow reusable-components.arazzo.yaml / client-registration - ✓ GET /special-events - step list-events + ✓ GET /menu - step list-menu-items -    Request URL: https://redocly.com/_mock/demo/openapi/museum-api/special-events +    Request URL: https://api.cafe.redocly.com/menu?search=mermaid-treasure-latte     Request Headers:       accept: application/json, application/problem+json       pagesize: 256 @@ -244,131 +124,26 @@ exports[`should use inputs from CLI and env to map with resolved refs 1`] = `     Response Headers:     Response Size: bytes     Response Body: -      [ -       { -       "eventId": "f3e0e76e-e4a8-466e-ab9c-ae36c15b8e97", -       "name": "Sasquatch Ballet", -       "location": "Seattle... probably", -       "eventDescription": "They're big, they're hairy, but they're also graceful. Come learn how the biggest feet can have the lightest touch.", -       "dates": [ -       "2023-12-15", -       "2023-12-22" -       ], -       "price": 40 -       }, -       { -       "eventId": "2f14374a-9c65-4ee5-94b7-fba66d893483", -       "name": "Solar Telescope Demonstration", -       "location": "Far from the sun.", -       "eventDescription": "Look at the sun without going blind!", -       "dates": [ -       "2023-09-07", -       "2023-09-14" -       ], -       "price": 50 -       }, -       { -       "eventId": "6aaa61ba-b2aa-4868-b803-603dbbf7bfdb", -       "name": "Cook like a Caveman", -       "location": "Fire Pit on East side", -       "eventDescription": "Learn to cook on an open flame.", -       "dates": [ -       "2023-11-10", -       "2023-11-17", -       "2023-11-24" -       ], -       "price": 5 -       }, -       { -       "eventId": "602b75e1-5696-4ab8-8c7a-f9e13580f910", -       "name": "Underwater Basket Weaving", -       "location": "Rec Center Pool next door.", -       "eventDescription": "Learn to weave baskets underwater.", -       "dates": [ -       "2023-09-12", -       "2023-09-15" -       ], -       "price": 15 -       }, -       { -       "eventId": "dad4bce8-f5cb-4078-a211-995864315e39", -       "name": "Mermaid Treasure Identification and Analysis", -       "location": "Room Sea-12", -       "eventDescription": "Join us as we review and classify a rare collection of 20 thingamabobs, gadgets, gizmos, whoosits, and whatsits — kindly donated by Ariel.", -       "dates": [ -       "2023-09-05", -       "2023-09-08" -       ], -       "price": 30 -       }, -       { -       "eventId": "6744a0da-4121-49cd-8479-f8cc20526495", -       "name": "Time Traveler Tea Party", -       "location": "Temporal Tearoom", -       "eventDescription": "Sip tea with important historical figures.", -       "dates": [ -       "2023-11-18", -       "2023-11-25", -       "2023-12-02" -       ], -       "price": 60 -       }, -       { -       "eventId": "3be6453c-03eb-4357-ae5a-984a0e574a54", -       "name": "Pirate Coding Workshop", -       "location": "Computer Room", -       "eventDescription": "Captain Blackbeard shares his love of the C...language. And possibly Arrrrr (R lang).", -       "dates": [ -       "2023-10-29", -       "2023-10-30", -       "2023-10-31" -       ], -       "price": 45 -       }, -       { -       "eventId": "9d90d29a-2af5-4206-97d9-9ea9ceadcb78", -       "name": "Llama Street Art Through the Ages", -       "location": "Auditorium", -       "eventDescription": "Llama street art?! Alpaca my bags -- let's go!", -       "dates": [ -       "2023-10-29", -       "2023-10-30", -       "2023-10-31" -       ], -       "price": 45 -       }, -       { -       "eventId": "a3c7b2c4-b5fb-4ef7-9322-00a919864957", -       "name": "The Great Parrot Debate", -       "location": "Outdoor Amphitheatre", -       "eventDescription": "See leading parrot minds discuss important geopolitical issues.", -       "dates": [ -       "2023-11-03", -       "2023-11-10" -       ], -       "price": 35 -       }, -       { -       "eventId": "b92d46b7-4c5d-422b-87a5-287767e26f29", -       "name": "Eat a Bunch of Corn", -       "location": "Cafeteria", -       "eventDescription": "We accidentally bought too much corn. Please come eat it.", -       "dates": [ -       "2023-11-10", -       "2023-11-17", -       "2023-11-24" -       ], -       "price": 5 -       } -      ] +      { +       "object": "list", +       "page": { +       "startCursor": null, +       "endCursor": null, +       "hasNextPage": false, +       "hasPrevPage": false, +       "limit": 10, +       "total": 0 +       }, +       "items": [] +      } -    ✓ status code check - $statusCode in [200, 400, 404] +    ✓ status code check - $statusCode in [200, 400, 500]     ✓ content-type check     ✓ schema check - ✓ POST /special-events - step create-event + ✓ POST /oauth2/register - step create-client -    Request URL: https://redocly.com/_mock/demo/openapi/museum-api/special-events +    Request URL: https://api.cafe.redocly.com/oauth2/register     Request Headers:       content-type: application/json       accept: application/json, application/problem+json @@ -382,37 +157,37 @@ exports[`should use inputs from CLI and env to map with resolved refs 1`] = `        "my_pet_tags": [        "one",        "two" -       ], -       "name": "Mermaid Treasure Identification and Analysis", -       "location": "Under the seaaa 🦀 🎶 🌊.", -       "eventDescription": "Join us as we review and classify a rare collection of 20 thingamabobs, gadgets, gizmos, whoosits, and whatsits, kindly donated by Ariel.", -       "dates": [ -       "2023-09-05", -       "2023-09-08" -       ], -       "price": 0 +       ]       } -    Response status code: 201 +    Response status code: 400     Response time: ms     Response Headers:     Response Size: bytes     Response Body:       { -       "eventId": "dad4bce8-f5cb-4078-a211-995864315e39", -       "name": "Mermaid Treasure Identification and Analysis", -       "location": "Under the seaaa 🦀 🎶 🌊.", -       "eventDescription": "Join us as we review and classify a rare collection of 20 thingamabobs, gadgets, gizmos, whoosits, and whatsits, kindly donated by Ariel.", -       "dates": [ -       "2023-09-05", -       "2023-09-08" -       ], -       "price": 0 +       "type": "about:blank", +       "title": "Validation failed", +       "status": 400, +       "instance": "/oauth2/register", +       "details": { +       "errors": [ +       { +       "code": "invalid_type", +       "expected": "string", +       "received": "undefined", +       "path": [ +       "name" +       ], +       "message": "Required" +       } +       ] +       }       } -    ✓ success criteria check - $statusCode == 201 -    ✓ status code check - $statusCode in [201, 400, 404] +    ✓ success criteria check - $statusCode == 400 +    ✓ status code check - $statusCode in [201, 400, 401, 500]     ✓ content-type check     ✓ schema check @@ -420,9 +195,9 @@ exports[`should use inputs from CLI and env to map with resolved refs 1`] = ` Running workflow reusable-components.arazzo.yaml / final-workflow - ✓ GET /museum-hours - step final-workflow-step + ✓ GET /menu - step final-workflow-step -    Request URL: https://redocly.com/_mock/demo/openapi/museum-api/museum-hours +    Request URL: https://api.cafe.redocly.com/menu?search=mermaid-treasure-latte     Request Headers:       accept: application/json, application/problem+json       pagesize: 256 @@ -434,70 +209,30 @@ exports[`should use inputs from CLI and env to map with resolved refs 1`] = `     Response Headers:     Response Size: bytes     Response Body: -      [ -       { -       "date": "2023-09-11", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-12", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-13", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-14", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-15", -       "timeOpen": "10:00", -       "timeClose": "16:00" -       }, -       { -       "date": "2023-09-18", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-19", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-20", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-21", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-22", -       "timeOpen": "10:00", -       "timeClose": "16:00" -       } -      ] +      { +       "object": "list", +       "page": { +       "startCursor": null, +       "endCursor": null, +       "hasNextPage": false, +       "hasPrevPage": false, +       "limit": 10, +       "total": 0 +       }, +       "items": [] +      }     ✓ success criteria check - $statusCode == 200 -    ✓ status code check - $statusCode in [200, 400, 404] +    ✓ status code check - $statusCode in [200, 400, 500]     ✓ content-type check     ✓ schema check   Failed tests info: -  Workflow name: get-museum-hours +  Workflow name: get-menu-items -    stepId - get-museum-hours-step-failure-action-goto +    stepId - get-menu-items-step-failure-action-goto     ✗ success criteria check       Checking simple criteria: {"condition":"$statusCode == 201"}        diff --git a/tests/e2e/respect/reusable-components/reusable-components.arazzo.yaml b/tests/e2e/respect/reusable-components/reusable-components.arazzo.yaml index b4afd56d81..7462c2df21 100644 --- a/tests/e2e/respect/reusable-components/reusable-components.arazzo.yaml +++ b/tests/e2e/respect/reusable-components/reusable-components.arazzo.yaml @@ -5,19 +5,19 @@ info: version: 1.0.0 sourceDescriptions: - - name: museum-api + - name: cafe-api type: openapi - url: ../museum-api.yaml - - name: tickets-from-museum-api + url: ../cafe-api.yaml + - name: menu-from-cafe-api type: arazzo - url: ../museum-tickets.yaml + url: ../cafe-menu.arazzo.yaml workflows: - - workflowId: get-museum-hours + - workflowId: get-menu-items inputs: $ref: '#/components/inputs/reusable-test' description: >- - This workflow demonstrates how to get the museum opening hours and buy tickets. + This workflow demonstrates how to list the cafe menu items. parameters: - reference: $components.parameters.pageSize value: 256 @@ -27,31 +27,43 @@ workflows: outputs: reusable-test: $inputs.reusable-test steps: - - stepId: get-museum-hours-step-success-action - operationId: $sourceDescriptions.museum-api.getMuseumHours + - stepId: get-menu-items-step-success-action + operationId: $sourceDescriptions.cafe-api.listMenuItems + parameters: + - in: query + name: search + value: mermaid-treasure-latte successCriteria: - condition: $statusCode == 200 outputs: - schedule: $response.body - - stepId: get-museum-hours-step-failure-action-goto + menu: $response.body + - stepId: get-menu-items-step-failure-action-goto description: >- - Get museum hours by resolving request details with getMuseumHours operationId from museum-api.yaml description. - operationId: $sourceDescriptions.museum-api.getMuseumHours + List menu items by resolving request details with listMenuItems operationId from cafe-api.yaml description. + operationId: $sourceDescriptions.cafe-api.listMenuItems + parameters: + - in: query + name: search + value: mermaid-treasure-latte successCriteria: - condition: $statusCode == 201 outputs: - schedule: $response.body + menu: $response.body onFailure: - reference: $components.failureActions.gotoFailureAction - - stepId: get-museum-hours-step-failure-action-retry - operationId: $sourceDescriptions.museum-api.getMuseumHours + - stepId: get-menu-items-step-failure-action-retry + operationId: $sourceDescriptions.cafe-api.listMenuItems + parameters: + - in: query + name: search + value: mermaid-treasure-latte successCriteria: - condition: $statusCode == 201 outputs: - schedule: $response.body + menu: $response.body onFailure: - reference: $components.failureActions.retryFailureAction - - workflowId: events-crud + - workflowId: client-registration inputs: $ref: '#/components/inputs/buy_available_pet_input' parameters: @@ -63,28 +75,24 @@ workflows: - reference: $components.parameters.page value: 42 steps: - - stepId: list-events + - stepId: list-menu-items parameters: - reference: $components.parameters.page - operationPath: '{$sourceDescriptions.museum-api.url}#/paths/~1special-events/get' + - in: query + name: search + value: mermaid-treasure-latte + operationPath: '{$sourceDescriptions.cafe-api.url}#/paths/~1menu/get' outputs: - events: $response.body - - stepId: create-event - operationPath: '{$sourceDescriptions.museum-api.url}#/paths/~1special-events/post' + menuItems: $response.body + - stepId: create-client + operationPath: '{$sourceDescriptions.cafe-api.url}#/paths/~1oauth2~1register/post' requestBody: payload: - reusable: $workflows.get-museum-hours.outputs.reusable-test + reusable: $workflows.get-menu-items.outputs.reusable-test store_id: $inputs.store_id my_pet_tags: $inputs.my_pet_tags - name: 'Mermaid Treasure Identification and Analysis' - location: 'Under the seaaa 🦀 🎶 🌊.' - eventDescription: 'Join us as we review and classify a rare collection of 20 thingamabobs, gadgets, gizmos, whoosits, and whatsits, kindly donated by Ariel.' - dates: - - '2023-09-05' - - '2023-09-08' - price: 0 successCriteria: - - condition: $statusCode == 201 + - condition: $statusCode == 400 - workflowId: final-workflow inputs: $ref: '#/components/inputs/reusable-test' @@ -96,7 +104,11 @@ workflows: value: Basic Og== steps: - stepId: final-workflow-step - operationId: $sourceDescriptions.museum-api.getMuseumHours + operationId: $sourceDescriptions.cafe-api.listMenuItems + parameters: + - in: query + name: search + value: mermaid-treasure-latte successCriteria: - condition: $statusCode == 200 @@ -129,13 +141,13 @@ components: value: 100 failureActions: gotoFailureAction: - name: get-museum-hours-failure-action + name: get-menu-items-failure-action type: goto workflowId: final-workflow criteria: - condition: $statusCode == 200 retryFailureAction: - name: get-museum-hours-failure-action + name: get-menu-items-failure-action type: retry retryAfter: 3 retryLimit: 1 @@ -144,7 +156,7 @@ components: - condition: $statusCode == 200 successActions: gotoSuccessAction: - name: get-museum-hours-success-action + name: get-menu-items-success-action type: goto workflowId: final-workflow criteria: diff --git a/tests/e2e/respect/reveal-masked-input-secrets/__snapshots__/reveal-masked-input-secrets.test.ts.snap b/tests/e2e/respect/reveal-masked-input-secrets/__snapshots__/reveal-masked-input-secrets.test.ts.snap index e22cdcc174..47f55e94a6 100644 --- a/tests/e2e/respect/reveal-masked-input-secrets/__snapshots__/reveal-masked-input-secrets.test.ts.snap +++ b/tests/e2e/respect/reveal-masked-input-secrets/__snapshots__/reveal-masked-input-secrets.test.ts.snap @@ -3,11 +3,11 @@ exports[`should reveal masked input values 1`] = ` "──────────────────────────────────────────────────────────────────────────────── - Running workflow reveal-masked-input-secrets.arazzo.yaml / get-museum-hours + Running workflow reveal-masked-input-secrets.arazzo.yaml / get-menu-items - ✓ GET /museum-hours - step get-museum-hours + ✓ GET /menu - step get-menu-items -    Request URL: https://redocly.com/_mock/demo/openapi/museum-api/museum-hours +    Request URL: https://api.cafe.redocly.com/menu?search=mermaid-treasure-latte     Request Headers:       accept: application/json, application/problem+json       authorization: Basic Og== @@ -22,71 +22,31 @@ exports[`should reveal masked input values 1`] = `     Response Headers:     Response Size: bytes     Response Body: -      [ -       { -       "date": "2023-09-11", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-12", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-13", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-14", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-15", -       "timeOpen": "10:00", -       "timeClose": "16:00" -       }, -       { -       "date": "2023-09-18", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-19", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-20", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-21", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-22", -       "timeOpen": "10:00", -       "timeClose": "16:00" -       } -      ] +      { +       "object": "list", +       "page": { +       "startCursor": null, +       "endCursor": null, +       "hasNextPage": false, +       "hasPrevPage": false, +       "limit": 10, +       "total": 0 +       }, +       "items": [] +      }     ✓ success criteria check - $statusCode == 200 -    ✓ status code check - $statusCode in [200, 400, 404] +    ✓ status code check - $statusCode in [200, 400, 500]     ✓ content-type check     ✓ schema check ──────────────────────────────────────────────────────────────────────────────── - Running workflow reveal-masked-input-secrets.arazzo.yaml / events-crud + Running workflow reveal-masked-input-secrets.arazzo.yaml / client-registration - ✓ GET /special-events - step list-events + ✓ GET /menu - step list-menu-items -    Request URL: https://redocly.com/_mock/demo/openapi/museum-api/special-events +    Request URL: https://api.cafe.redocly.com/menu?search=mermaid-treasure-latte     Request Headers:       accept: application/json, application/problem+json       authorization: Basic Og== @@ -98,131 +58,26 @@ exports[`should reveal masked input values 1`] = `     Response Headers:     Response Size: bytes     Response Body: -      [ -       { -       "eventId": "f3e0e76e-e4a8-466e-ab9c-ae36c15b8e97", -       "name": "Sasquatch Ballet", -       "location": "Seattle... probably", -       "eventDescription": "They're big, they're hairy, but they're also graceful. Come learn how the biggest feet can have the lightest touch.", -       "dates": [ -       "2023-12-15", -       "2023-12-22" -       ], -       "price": 40 -       }, -       { -       "eventId": "2f14374a-9c65-4ee5-94b7-fba66d893483", -       "name": "Solar Telescope Demonstration", -       "location": "Far from the sun.", -       "eventDescription": "Look at the sun without going blind!", -       "dates": [ -       "2023-09-07", -       "2023-09-14" -       ], -       "price": 50 -       }, -       { -       "eventId": "6aaa61ba-b2aa-4868-b803-603dbbf7bfdb", -       "name": "Cook like a Caveman", -       "location": "Fire Pit on East side", -       "eventDescription": "Learn to cook on an open flame.", -       "dates": [ -       "2023-11-10", -       "2023-11-17", -       "2023-11-24" -       ], -       "price": 5 -       }, -       { -       "eventId": "602b75e1-5696-4ab8-8c7a-f9e13580f910", -       "name": "Underwater Basket Weaving", -       "location": "Rec Center Pool next door.", -       "eventDescription": "Learn to weave baskets underwater.", -       "dates": [ -       "2023-09-12", -       "2023-09-15" -       ], -       "price": 15 -       }, -       { -       "eventId": "dad4bce8-f5cb-4078-a211-995864315e39", -       "name": "Mermaid Treasure Identification and Analysis", -       "location": "Room Sea-12", -       "eventDescription": "Join us as we review and classify a rare collection of 20 thingamabobs, gadgets, gizmos, whoosits, and whatsits — kindly donated by Ariel.", -       "dates": [ -       "2023-09-05", -       "2023-09-08" -       ], -       "price": 30 -       }, -       { -       "eventId": "6744a0da-4121-49cd-8479-f8cc20526495", -       "name": "Time Traveler Tea Party", -       "location": "Temporal Tearoom", -       "eventDescription": "Sip tea with important historical figures.", -       "dates": [ -       "2023-11-18", -       "2023-11-25", -       "2023-12-02" -       ], -       "price": 60 -       }, -       { -       "eventId": "3be6453c-03eb-4357-ae5a-984a0e574a54", -       "name": "Pirate Coding Workshop", -       "location": "Computer Room", -       "eventDescription": "Captain Blackbeard shares his love of the C...language. And possibly Arrrrr (R lang).", -       "dates": [ -       "2023-10-29", -       "2023-10-30", -       "2023-10-31" -       ], -       "price": 45 -       }, -       { -       "eventId": "9d90d29a-2af5-4206-97d9-9ea9ceadcb78", -       "name": "Llama Street Art Through the Ages", -       "location": "Auditorium", -       "eventDescription": "Llama street art?! Alpaca my bags -- let's go!", -       "dates": [ -       "2023-10-29", -       "2023-10-30", -       "2023-10-31" -       ], -       "price": 45 -       }, -       { -       "eventId": "a3c7b2c4-b5fb-4ef7-9322-00a919864957", -       "name": "The Great Parrot Debate", -       "location": "Outdoor Amphitheatre", -       "eventDescription": "See leading parrot minds discuss important geopolitical issues.", -       "dates": [ -       "2023-11-03", -       "2023-11-10" -       ], -       "price": 35 -       }, -       { -       "eventId": "b92d46b7-4c5d-422b-87a5-287767e26f29", -       "name": "Eat a Bunch of Corn", -       "location": "Cafeteria", -       "eventDescription": "We accidentally bought too much corn. Please come eat it.", -       "dates": [ -       "2023-11-10", -       "2023-11-17", -       "2023-11-24" -       ], -       "price": 5 -       } -      ] +      { +       "object": "list", +       "page": { +       "startCursor": null, +       "endCursor": null, +       "hasNextPage": false, +       "hasPrevPage": false, +       "limit": 10, +       "total": 0 +       }, +       "items": [] +      } -    ✓ status code check - $statusCode in [200, 400, 404] +    ✓ status code check - $statusCode in [200, 400, 500]     ✓ content-type check     ✓ schema check - ✓ POST /special-events - step create-event + ✓ POST /oauth2/register - step create-client -    Request URL: https://redocly.com/_mock/demo/openapi/museum-api/special-events +    Request URL: https://api.cafe.redocly.com/oauth2/register     Request Headers:       content-type: application/json       accept: application/json, application/problem+json @@ -232,38 +87,38 @@ exports[`should reveal masked input values 1`] = `       {        "username": "John",        "secret": "password", -       "multiwordSecret": "Bearer secretToken", -       "name": "Mermaid Treasure Identification and Analysis", -       "location": "Under the seaaa 🦀 🎶 🌊.", -       "eventDescription": "Join us as we review and classify a rare collection of 20 thingamabobs, gadgets, gizmos, whoosits, and whatsits, kindly donated by Ariel.", -       "dates": [ -       "2023-09-05", -       "2023-09-08" -       ], -       "price": 0 +       "multiwordSecret": "Bearer secretToken"       } -    Response status code: 201 +    Response status code: 400     Response time: ms     Response Headers:     Response Size: bytes     Response Body:       { -       "eventId": "dad4bce8-f5cb-4078-a211-995864315e39", -       "name": "Mermaid Treasure Identification and Analysis", -       "location": "Under the seaaa 🦀 🎶 🌊.", -       "eventDescription": "Join us as we review and classify a rare collection of 20 thingamabobs, gadgets, gizmos, whoosits, and whatsits, kindly donated by Ariel.", -       "dates": [ -       "2023-09-05", -       "2023-09-08" -       ], -       "price": 0 +       "type": "about:blank", +       "title": "Validation failed", +       "status": 400, +       "instance": "/oauth2/register", +       "details": { +       "errors": [ +       { +       "code": "invalid_type", +       "expected": "string", +       "received": "undefined", +       "path": [ +       "name" +       ], +       "message": "Required" +       } +       ] +       }       } -    ✓ success criteria check - $statusCode == 201 -    ✓ success criteria check - $[?@.name == 'Mermaid Treasure Identification and ... -    ✓ status code check - $statusCode in [201, 400, 404] +    ✓ success criteria check - $statusCode == 400 +    ✓ success criteria check - $[?@.title == 'Validation failed'] +    ✓ status code check - $statusCode in [201, 400, 401, 500]     ✓ content-type check     ✓ schema check diff --git a/tests/e2e/respect/reveal-masked-input-secrets/reveal-masked-input-secrets.arazzo.yaml b/tests/e2e/respect/reveal-masked-input-secrets/reveal-masked-input-secrets.arazzo.yaml index 4155966a7c..a84efc6101 100644 --- a/tests/e2e/respect/reveal-masked-input-secrets/reveal-masked-input-secrets.arazzo.yaml +++ b/tests/e2e/respect/reveal-masked-input-secrets/reveal-masked-input-secrets.arazzo.yaml @@ -6,15 +6,15 @@ info: version: 1.0.0 sourceDescriptions: - - name: museum-api + - name: cafe-api type: openapi - url: ../museum-api.yaml - - name: tickets-from-museum-api + url: ../cafe-api.yaml + - name: menu-from-cafe-api type: arazzo - url: ../museum-tickets.yaml + url: ../cafe-menu.arazzo.yaml workflows: - - workflowId: get-museum-hours + - workflowId: get-menu-items inputs: type: object properties: @@ -44,23 +44,26 @@ workflows: name: masked-combined-value value: '{$inputs.username} and {$inputs.password} and maybe {$inputs.env.AUTH_TOKEN}' description: >- - This workflow demonstrates how to get the museum opening hours and buy tickets. + This workflow demonstrates how to list the cafe menu items. steps: - - stepId: get-museum-hours + - stepId: get-menu-items parameters: - in: header name: multi-word-secret value: Bearer {$inputs.password} + - in: query + name: search + value: mermaid-treasure-latte description: >- - Get museum hours by resolving request details with getMuseumHours operationId from museum-api.yaml description. - operationId: $sourceDescriptions.museum-api.getMuseumHours + List menu items by resolving request details with listMenuItems operationId from cafe-api.yaml description. + operationId: $sourceDescriptions.cafe-api.listMenuItems successCriteria: - condition: $statusCode == 200 outputs: - schedule: $response.body - - workflowId: events-crud + menu: $response.body + - workflowId: client-registration description: >- - This workflow demonstrates how to list, create, update, and delete special events at the museum. + This workflow demonstrates how masked inputs are revealed in an OAuth2 client registration request. parameters: - in: header name: Authorization @@ -89,30 +92,27 @@ workflows: type: string format: password steps: - - stepId: list-events + - stepId: list-menu-items description: >- - Request the list of events. - operationPath: '{$sourceDescriptions.museum-api.url}#/paths/~1special-events/get' + Request the list of menu items. + operationPath: '{$sourceDescriptions.cafe-api.url}#/paths/~1menu/get' + parameters: + - in: query + name: search + value: mermaid-treasure-latte outputs: - events: $response.body - - stepId: create-event + menuItems: $response.body + - stepId: create-client description: >- - Create a new special event. - operationPath: '{$sourceDescriptions.museum-api.url}#/paths/~1special-events/post' + Try to register a new OAuth2 client without the required `name` field. + operationPath: '{$sourceDescriptions.cafe-api.url}#/paths/~1oauth2~1register/post' requestBody: payload: username: $inputs.username secret: $inputs.password multiwordSecret: Bearer {$inputs.secret.secretValue} - name: 'Mermaid Treasure Identification and Analysis' - location: 'Under the seaaa 🦀 🎶 🌊.' - eventDescription: 'Join us as we review and classify a rare collection of 20 thingamabobs, gadgets, gizmos, whoosits, and whatsits, kindly donated by Ariel.' - dates: - - '2023-09-05' - - '2023-09-08' - price: 0 successCriteria: - - condition: $statusCode == 201 + - condition: $statusCode == 400 - context: $response.body - condition: "$[?@.name == 'Mermaid Treasure Identification and Analysis']" + condition: "$[?@.title == 'Validation failed']" type: jsonpath diff --git a/tests/e2e/respect/server-override-with-console-parameters/__snapshots__/server-override-with-console-parameters.test.ts.snap b/tests/e2e/respect/server-override-with-console-parameters/__snapshots__/server-override-with-console-parameters.test.ts.snap index 064d6486d8..19a8d332b3 100644 --- a/tests/e2e/respect/server-override-with-console-parameters/__snapshots__/server-override-with-console-parameters.test.ts.snap +++ b/tests/e2e/respect/server-override-with-console-parameters/__snapshots__/server-override-with-console-parameters.test.ts.snap @@ -3,52 +3,43 @@ exports[`should use server override from CLI and env 1`] = ` "──────────────────────────────────────────────────────────────────────────────── - Running workflow server-override-with-console-parameters.arazzo.yaml / get-museum-hours + Running workflow server-override-with-console-parameters.arazzo.yaml / get-menu-items - Running child workflow for the step buy-ticket - Running workflow museum-tickets.yaml / get-museum-tickets + Running child workflow for the step search-menu + Running workflow cafe-menu.arazzo.yaml / search-menu-items - ✗ POST /tickets - step buy-tickets + ✗ GET /menu - step search-menu -    Request URL: https://museum-api-bad-endpoint.com/museum-api-bad-endpoint/tickets +    Request URL: https://cafe-api-bad-endpoint.com/cafe-api-bad-endpoint/menu?search=mermaid-treasure-latte     Request Headers: -      content-type: application/json -      accept: application/json, application/problem+json -      authorization: Basic Og== -    Request Body: -      { -       "ticketType": "general", -       "ticketDate": "2023-09-07", -       "email": "todd@example.com" -      } +      accept: application/json, application/problem+json     ✗ failed network request ──────────────────────────────────────────────────────────────────────────────── - Running workflow server-override-with-console-parameters.arazzo.yaml / events-crud + Running workflow server-override-with-console-parameters.arazzo.yaml / client-registration - ✗ GET /special-events - step list-events + ✗ GET /menu - step list-menu-items -    Request URL: https://museum-api-bad-endpoint.com/museum-api-bad-endpoint/special-events +    Request URL: https://cafe-api-bad-endpoint.com/cafe-api-bad-endpoint/menu     Request Headers: -      accept: application/json, application/problem+json -      authorization: Basic Og== +      accept: application/json, application/problem+json     ✗ failed network request   Failed tests info: -  Workflow name: get-museum-hours +  Workflow name: get-menu-items -    stepId - buy-ticket +    stepId - search-menu     ✗ unexpected error -    Reason: Failed to resolve output "ticketId" in workflow "get-museum-tickets": Error in resolving runtime expression '$steps.buy-tickets.outputs.ticketId'. +    Reason: Failed to resolve output "total" in workflow "search-menu-items": Error in resolving runtime expression '$steps.search-menu.outputs.total'.     This could be because the expression references a value from a previous failed step, or is trying to reference a variable that hasn't been set. -  Workflow name: events-crud +  Workflow name: client-registration -    stepId - list-events +    stepId - list-menu-items     ✗ failed network request       fetch failed (cause: ENOTFOUND)        diff --git a/tests/e2e/respect/server-override-with-console-parameters/server-override-with-console-parameters.arazzo.yaml b/tests/e2e/respect/server-override-with-console-parameters/server-override-with-console-parameters.arazzo.yaml index 6b4f512079..51b5ec3855 100644 --- a/tests/e2e/respect/server-override-with-console-parameters/server-override-with-console-parameters.arazzo.yaml +++ b/tests/e2e/respect/server-override-with-console-parameters/server-override-with-console-parameters.arazzo.yaml @@ -1,43 +1,34 @@ arazzo: 1.0.1 info: - title: Redocly Museum API + title: Server override with console parameters description: >- - An imaginary, but delightful Museum API for interacting with museum services - and information. Built with love by Redocly. + Testing server override with console parameters against the Redocly Cafe API. version: 1.0.0 sourceDescriptions: - - name: museum-api + - name: cafe-api type: openapi - url: ../museum-api.yaml - - name: tickets-from-museum-api + url: ../cafe-api.yaml + - name: menu-from-cafe-api type: arazzo - url: ../museum-tickets.yaml + url: ../cafe-menu.arazzo.yaml workflows: - - workflowId: get-museum-hours + - workflowId: get-menu-items description: >- - This workflow demonstrates how to get the museum opening hours and buy tickets. - parameters: - - in: header - name: Authorization - value: Basic Og== + This workflow demonstrates how to search the cafe menu using an external workflow. steps: - - stepId: buy-ticket + - stepId: search-menu description: >- - Buy a ticket for the museum by calling an external workflow from another Arazzo file. - workflowId: $sourceDescriptions.tickets-from-museum-api.get-museum-tickets + Search the cafe menu by calling an external workflow from another Arazzo file. + workflowId: $sourceDescriptions.menu-from-cafe-api.search-menu-items outputs: - ticketId: $outputs.ticketId - - workflowId: events-crud + total: $outputs.total + - workflowId: client-registration description: >- - This workflow demonstrates how to list, create, update, and delete special events at the museum. - parameters: - - in: header - name: Authorization - value: Basic Og== + This workflow demonstrates how to list the cafe menu items. steps: - - stepId: list-events + - stepId: list-menu-items description: >- - Request the list of events. - operationPath: '{$sourceDescriptions.museum-api.url}#/paths/~1special-events/get' + Request the list of menu items. + operationPath: '{$sourceDescriptions.cafe-api.url}#/paths/~1menu/get' diff --git a/tests/e2e/respect/server-override-with-console-parameters/server-override-with-console-parameters.test.ts b/tests/e2e/respect/server-override-with-console-parameters/server-override-with-console-parameters.test.ts index ea7de5ef81..8274eeb847 100644 --- a/tests/e2e/respect/server-override-with-console-parameters/server-override-with-console-parameters.test.ts +++ b/tests/e2e/respect/server-override-with-console-parameters/server-override-with-console-parameters.test.ts @@ -5,10 +5,10 @@ import { getCommandOutput, getParams } from '../../helpers.js'; const __dirname = dirname(fileURLToPath(import.meta.url)); -// Snapshot is intentionally should show failed request to museum-api-bad-endpoint +// Snapshot intentionally shows a failed request to cafe-api-bad-endpoint test('should use server override from CLI and env', () => { process.env.REDOCLY_CLI_RESPECT_SERVER = - 'museum-api=https://museum-api-bad-endpoint.com/museum-api-bad-endpoint,tickets-from-museum-api=https://redocly.com/_mock/docs/openapi/museum-api'; + 'cafe-api=https://cafe-api-bad-endpoint.com/cafe-api-bad-endpoint,menu-from-cafe-api=https://api.cafe.redocly.com'; const indexEntryPoint = join(process.cwd(), 'packages/cli/lib/index.js'); const fixturesPath = join(__dirname, 'server-override-with-console-parameters.arazzo.yaml'); diff --git a/tests/e2e/respect/severity-error-level/__snapshots__/severity-error-level.test.ts.snap b/tests/e2e/respect/severity-error-level/__snapshots__/severity-error-level.test.ts.snap index 819fc8b7a2..da3798dfe7 100644 --- a/tests/e2e/respect/severity-error-level/__snapshots__/severity-error-level.test.ts.snap +++ b/tests/e2e/respect/severity-error-level/__snapshots__/severity-error-level.test.ts.snap @@ -3,14 +3,13 @@ exports[`should use error severity level 1`] = ` "──────────────────────────────────────────────────────────────────────────────── - Running workflow severity-level.arazzo.yaml / get-museum-hours + Running workflow severity-level.arazzo.yaml / get-menu-items - ✗ GET /museum-hours - step get-museum-hours + ✗ GET /menu - step get-menu-items -    Request URL: https://redocly.com/_mock/demo/openapi/museum-api/museum-hours +    Request URL: https://api.cafe.redocly.com/menu?search=mermaid-treasure-latte     Request Headers:       accept: html/text, application/problem+json -      authorization: Basic Og==       content-type: application/json @@ -19,126 +18,76 @@ exports[`should use error severity level 1`] = `     Response Headers:     Response Size: bytes     Response Body: -      [ -       { -       "date": "2023-09-11", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-12", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-13", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-14", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-15", -       "timeOpen": "10:00", -       "timeClose": "16:00" -       }, -       { -       "date": "2023-09-18", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-19", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-20", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-21", -       "timeOpen": "09:00", -       "timeClose": "18:00" +      { +       "object": "list", +       "page": { +       "startCursor": null, +       "endCursor": null, +       "hasNextPage": false, +       "hasPrevPage": false, +       "limit": 10, +       "total": 0        }, -       { -       "date": "2023-09-22", -       "timeOpen": "10:00", -       "timeClose": "16:00" -       } -      ] +       "items": [] +      }     ✓ success criteria check - $statusCode == 200     ✗ status code check ──────────────────────────────────────────────────────────────────────────────── - Running workflow severity-level.arazzo.yaml / events-crud + Running workflow severity-level.arazzo.yaml / client-registration - ✓ POST /special-events - step create-event + ✓ POST /oauth2/register - step create-client -    Request URL: https://redocly.com/_mock/demo/openapi/museum-api/special-events +    Request URL: https://api.cafe.redocly.com/oauth2/register     Request Headers:       content-type: application/json       accept: application/json, application/problem+json -      authorization: Basic Og==     Request Body:       { -       "name": "Mermaid Treasure Identification and Analysis", -       "location": "Under the seaaa 🦀 🎶 🌊.", -       "eventDescription": "Join us as we review and classify a rare collection of 20 thingamabobs, gadgets, gizmos, whoosits, and whatsits, kindly donated by Ariel.", -       "dates": [ -       "2023-09-05", -       "2023-09-08" -       ], -       "price": 0 +       "clientName": "respect-e2e-client"       } -    Response status code: 201 +    Response status code: 400     Response time: ms     Response Headers:     Response Size: bytes     Response Body:       { -       "eventId": "dad4bce8-f5cb-4078-a211-995864315e39", -       "name": "Mermaid Treasure Identification and Analysis", -       "location": "Under the seaaa 🦀 🎶 🌊.", -       "eventDescription": "Join us as we review and classify a rare collection of 20 thingamabobs, gadgets, gizmos, whoosits, and whatsits, kindly donated by Ariel.", -       "dates": [ -       "2023-09-05", -       "2023-09-08" -       ], -       "price": 0 +       "type": "about:blank", +       "title": "Validation failed", +       "status": 400, +       "instance": "/oauth2/register", +       "details": { +       "errors": [ +       { +       "code": "invalid_type", +       "expected": "string", +       "received": "undefined", +       "path": [ +       "name" +       ], +       "message": "Required" +       } +       ] +       }       } -    ✓ success criteria check - $statusCode == 201 -    ✓ success criteria check - $[?@.name == 'Mermaid Treasure Identification and ... -    ✓ status code check - $statusCode in [201, 400, 404] +    ✓ success criteria check - $statusCode == 400 +    ✓ success criteria check - $[?@.title == 'Validation failed'] +    ✓ success criteria check - $[?@.status == 400] +    ✓ status code check - $statusCode in [201, 400, 401, 500]     ✓ content-type check     ✓ schema check - ✗ PATCH /special-events/{eventId} - step update-event + ✗ GET /menu-item-images/{menuItemId} - step get-menu-item-photo -    Request URL: https://redocly.com/_mock/demo/openapi/museum-api/special-events/dad4bce8-f5cb-4078-a211-995864315e39 +    Request URL: https://api.cafe.redocly.com/menu-item-images/prd_0000000000seedtrams0000000     Request Headers: -      content-type: application/json -      accept: json, application/problem+json -      authorization: Basic Og== -    Request Body: -      { -       "name": "Orca Identification and Analysis", -       "location": "Under the seaaa 🦀 🎶 🌊.", -       "dates": [ -       "2023-09-05", -       "2023-09-08" -       ], -       "price": 0 -      } +      accept: text/plain +      x-error-field: name     Response status code: 200 @@ -146,44 +95,34 @@ exports[`should use error severity level 1`] = `     Response Headers:     Response Size: bytes     Response Body: -      { -       "eventId": "dad4bce8-f5cb-4078-a211-995864315e39", -       "name": "Orca Identification and Analysis", -       "location": "Under the seaaa 🦀 🎶 🌊.", -       "eventDescription": "Join us as we review and classify a rare collection of 20 thingamabobs, gadgets, gizmos, whoosits, and whatsits, kindly donated by Ariel.", -       "dates": [ -       "2023-09-05", -       "2023-09-08" -       ], -       "price": 0 -      } +      A classic Italian tiramisu layered with mascarpone and espresso     ✓ success criteria check - $statusCode == 200 -    ✓ success criteria check - $[?@.name == 'Orca Identification and Analysis'] -    ✓ status code check - $statusCode in [200, 400, 404] +    ✓ success criteria check - $response.body == 'A classic Italian tiramisu laye... +    ✓ status code check - $statusCode in [200, 404, 500]     ✗ content-type check   Failed tests info: -  Workflow name: get-museum-hours +  Workflow name: get-menu-items -    stepId - get-museum-hours +    stepId - get-menu-items     ✗ status code check               -  Workflow name: events-crud +  Workflow name: client-registration -    stepId - update-event +    stepId - get-menu-item-photo     ✗ content-type check -      Content type application/json for 200 response is not described in the schema. -      Expected content types: json. +      Content type text/plain for 200 response is not described in the schema. +      Expected content types: image/png, text/csv.          Summary for severity-level.arazzo.yaml      Workflows: 2 failed, 2 total   Steps: 1 passed, 2 failed, 3 total -  Checks: 9 passed, 2 failed, 11 total +  Checks: 10 passed, 2 failed, 12 total   Time: ms diff --git a/tests/e2e/respect/severity-error-level/severity-level.arazzo.yaml b/tests/e2e/respect/severity-error-level/severity-level.arazzo.yaml index c481f92613..883fd84006 100644 --- a/tests/e2e/respect/severity-error-level/severity-level.arazzo.yaml +++ b/tests/e2e/respect/severity-error-level/severity-level.arazzo.yaml @@ -1,87 +1,75 @@ arazzo: 1.0.1 info: - title: Redocly Museum API + title: Severity error level description: >- - An imaginary, but delightful Museum API for interacting with museum services - and information. Built with love by Redocly. + Testing severity levels for failing checks against the Redocly Cafe API + described with deliberately wrong response definitions. version: 1.0.0 sourceDescriptions: - - name: museum-api + - name: cafe-api type: openapi - url: ../museum-api-with-errors.yaml + url: ../cafe-api-with-errors.yaml workflows: - - workflowId: get-museum-hours + - workflowId: get-menu-items description: >- - This workflow demonstrates how to get the museum opening hours and buy tickets. - parameters: - - in: header - name: Authorization - value: Basic Og== + This workflow demonstrates how to list the cafe menu items. steps: - - stepId: get-museum-hours + - stepId: get-menu-items parameters: - in: header name: Content-Type value: application/json + - in: query + name: search + value: mermaid-treasure-latte description: >- - Get museum hours by resolving request details with getMuseumHours operationId from museum-api.yaml description. - operationId: museum-api.getMuseumHours + List menu items by resolving request details with listMenuItems operationId from cafe-api.yaml description. + operationId: cafe-api.listMenuItems successCriteria: - condition: $statusCode == 200 outputs: - schedule: $response.body - - workflowId: events-crud + menu: $response.body + - workflowId: client-registration description: >- - This workflow demonstrates how to list, create, update, and delete special events at the museum. - parameters: - - in: header - name: Authorization - value: Basic Og== + This workflow demonstrates how to register an OAuth2 client and retrieve a menu item photo description. steps: - - stepId: create-event + - stepId: create-client description: >- - Create a new special event. - operationPath: '{$sourceDescriptions.museum-api.url}#/paths/~1special-events/post' + Try to register a new OAuth2 client without the required `name` field. + operationPath: '{$sourceDescriptions.cafe-api.url}#/paths/~1oauth2~1register/post' requestBody: payload: - name: 'Mermaid Treasure Identification and Analysis' - location: 'Under the seaaa 🦀 🎶 🌊.' - eventDescription: 'Join us as we review and classify a rare collection of 20 thingamabobs, gadgets, gizmos, whoosits, and whatsits, kindly donated by Ariel.' - dates: - - '2023-09-05' - - '2023-09-08' - price: 0 + clientName: respect-e2e-client successCriteria: - - condition: $statusCode == 201 + - condition: $statusCode == 400 - context: $response.body - condition: "$[?@.name == 'Mermaid Treasure Identification and Analysis']" + condition: "$[?@.title == 'Validation failed']" type: jsonpath + - context: $response.body + condition: '$[?@.status == 400]' + type: + type: jsonpath + version: draft-goessner-dispatch-jsonpath-00 outputs: - createdEventId: $response.body#/eventId - name: $response.body#/name + errorField: $response.body#/details/errors/0/path/0 + errorTitle: $response.body#/title - - stepId: update-event + - stepId: get-menu-item-photo description: >- - Update the created event with new details. - operationPath: '{$sourceDescriptions.museum-api.url}#/paths/~1special-events~1{eventId}/patch' + Retrieve the photo text description of a seeded menu item. + operationPath: '{$sourceDescriptions.cafe-api.url}#/paths/~1menu-item-images~1{menuItemId}/get' parameters: - - name: eventId + - name: menuItemId in: path - value: $steps.create-event.outputs.createdEventId - requestBody: - payload: - name: 'Orca Identification and Analysis' - location: 'Under the seaaa 🦀 🎶 🌊.' - dates: - - '2023-09-05' - - '2023-09-08' - price: 0 + value: prd_0000000000seedtrams0000000 + - in: header + name: Accept + value: text/plain + - in: header + name: x-error-field + value: $steps.create-client.outputs.errorField successCriteria: - condition: $statusCode == 200 - - context: $response.body - condition: "$[?@.name == 'Orca Identification and Analysis']" - type: - type: jsonpath - version: draft-goessner-dispatch-jsonpath-00 + - condition: $response.body == 'A classic Italian tiramisu layered with mascarpone and espresso' diff --git a/tests/e2e/respect/severity-off-level/__snapshots__/severity-off-level.test.ts.snap b/tests/e2e/respect/severity-off-level/__snapshots__/severity-off-level.test.ts.snap index 19dad04520..0660c16d24 100644 --- a/tests/e2e/respect/severity-off-level/__snapshots__/severity-off-level.test.ts.snap +++ b/tests/e2e/respect/severity-off-level/__snapshots__/severity-off-level.test.ts.snap @@ -3,14 +3,13 @@ exports[`should use off severity level 1`] = ` "──────────────────────────────────────────────────────────────────────────────── - Running workflow severity-level.arazzo.yaml / get-museum-hours + Running workflow severity-level.arazzo.yaml / get-menu-items - ✗ GET /museum-hours - step get-museum-hours + ✗ GET /menu - step get-menu-items -    Request URL: https://redocly.com/_mock/demo/openapi/museum-api/museum-hours +    Request URL: https://api.cafe.redocly.com/menu?search=mermaid-treasure-latte     Request Headers:       accept: html/text, application/problem+json -      authorization: Basic Og==       content-type: application/json @@ -19,126 +18,76 @@ exports[`should use off severity level 1`] = `     Response Headers:     Response Size: bytes     Response Body: -      [ -       { -       "date": "2023-09-11", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-12", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-13", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-14", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-15", -       "timeOpen": "10:00", -       "timeClose": "16:00" -       }, -       { -       "date": "2023-09-18", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-19", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-20", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-21", -       "timeOpen": "09:00", -       "timeClose": "18:00" +      { +       "object": "list", +       "page": { +       "startCursor": null, +       "endCursor": null, +       "hasNextPage": false, +       "hasPrevPage": false, +       "limit": 10, +       "total": 0        }, -       { -       "date": "2023-09-22", -       "timeOpen": "10:00", -       "timeClose": "16:00" -       } -      ] +       "items": [] +      }     ✓ success criteria check - $statusCode == 200     ✗ status code check ──────────────────────────────────────────────────────────────────────────────── - Running workflow severity-level.arazzo.yaml / events-crud + Running workflow severity-level.arazzo.yaml / client-registration - ✓ POST /special-events - step create-event + ✓ POST /oauth2/register - step create-client -    Request URL: https://redocly.com/_mock/demo/openapi/museum-api/special-events +    Request URL: https://api.cafe.redocly.com/oauth2/register     Request Headers:       content-type: application/json       accept: application/json, application/problem+json -      authorization: Basic Og==     Request Body:       { -       "name": "Mermaid Treasure Identification and Analysis", -       "location": "Under the seaaa 🦀 🎶 🌊.", -       "eventDescription": "Join us as we review and classify a rare collection of 20 thingamabobs, gadgets, gizmos, whoosits, and whatsits, kindly donated by Ariel.", -       "dates": [ -       "2023-09-05", -       "2023-09-08" -       ], -       "price": 0 +       "clientName": "respect-e2e-client"       } -    Response status code: 201 +    Response status code: 400     Response time: ms     Response Headers:     Response Size: bytes     Response Body:       { -       "eventId": "dad4bce8-f5cb-4078-a211-995864315e39", -       "name": "Mermaid Treasure Identification and Analysis", -       "location": "Under the seaaa 🦀 🎶 🌊.", -       "eventDescription": "Join us as we review and classify a rare collection of 20 thingamabobs, gadgets, gizmos, whoosits, and whatsits, kindly donated by Ariel.", -       "dates": [ -       "2023-09-05", -       "2023-09-08" -       ], -       "price": 0 +       "type": "about:blank", +       "title": "Validation failed", +       "status": 400, +       "instance": "/oauth2/register", +       "details": { +       "errors": [ +       { +       "code": "invalid_type", +       "expected": "string", +       "received": "undefined", +       "path": [ +       "name" +       ], +       "message": "Required" +       } +       ] +       }       } -    ✓ success criteria check - $statusCode == 201 -    ✓ success criteria check - $[?@.name == 'Mermaid Treasure Identification and ... -    ✓ status code check - $statusCode in [201, 400, 404] +    ✓ success criteria check - $statusCode == 400 +    ✓ success criteria check - $[?@.title == 'Validation failed'] +    ✓ success criteria check - $[?@.status == 400] +    ✓ status code check - $statusCode in [201, 400, 401, 500]     ✓ content-type check     ✓ schema check - ✗ PATCH /special-events/{eventId} - step update-event + ✗ GET /menu-item-images/{menuItemId} - step get-menu-item-photo -    Request URL: https://redocly.com/_mock/demo/openapi/museum-api/special-events/dad4bce8-f5cb-4078-a211-995864315e39 +    Request URL: https://api.cafe.redocly.com/menu-item-images/prd_0000000000seedtrams0000000     Request Headers: -      content-type: application/json -      accept: json, application/problem+json -      authorization: Basic Og== -    Request Body: -      { -       "name": "Orca Identification and Analysis", -       "location": "Under the seaaa 🦀 🎶 🌊.", -       "dates": [ -       "2023-09-05", -       "2023-09-08" -       ], -       "price": 0 -      } +      accept: text/plain +      x-error-field: name     Response status code: 200 @@ -146,44 +95,34 @@ exports[`should use off severity level 1`] = `     Response Headers:     Response Size: bytes     Response Body: -      { -       "eventId": "dad4bce8-f5cb-4078-a211-995864315e39", -       "name": "Orca Identification and Analysis", -       "location": "Under the seaaa 🦀 🎶 🌊.", -       "eventDescription": "Join us as we review and classify a rare collection of 20 thingamabobs, gadgets, gizmos, whoosits, and whatsits, kindly donated by Ariel.", -       "dates": [ -       "2023-09-05", -       "2023-09-08" -       ], -       "price": 0 -      } +      A classic Italian tiramisu layered with mascarpone and espresso     ✓ success criteria check - $statusCode == 200 -    ✓ success criteria check - $[?@.name == 'Orca Identification and Analysis'] -    ✓ status code check - $statusCode in [200, 400, 404] +    ✓ success criteria check - $response.body == 'A classic Italian tiramisu laye... +    ✓ status code check - $statusCode in [200, 404, 500]     ✗ content-type check   Failed tests info: -  Workflow name: get-museum-hours +  Workflow name: get-menu-items -    stepId - get-museum-hours +    stepId - get-menu-items     ○ status code check (skipped)               -  Workflow name: events-crud +  Workflow name: client-registration -    stepId - update-event +    stepId - get-menu-item-photo     ○ content-type check (skipped) -      Content type application/json for 200 response is not described in the schema. -      Expected content types: json. +      Content type text/plain for 200 response is not described in the schema. +      Expected content types: image/png, text/csv.          Summary for severity-level.arazzo.yaml      Workflows: 2 passed, 2 total   Steps: 3 passed, 2 ignored, 3 total -  Checks: 11 passed, 2 ignored, 11 total +  Checks: 12 passed, 2 ignored, 12 total   Time: ms diff --git a/tests/e2e/respect/severity-off-level/severity-level.arazzo.yaml b/tests/e2e/respect/severity-off-level/severity-level.arazzo.yaml index c481f92613..7458c98878 100644 --- a/tests/e2e/respect/severity-off-level/severity-level.arazzo.yaml +++ b/tests/e2e/respect/severity-off-level/severity-level.arazzo.yaml @@ -1,87 +1,75 @@ arazzo: 1.0.1 info: - title: Redocly Museum API + title: Severity off level description: >- - An imaginary, but delightful Museum API for interacting with museum services - and information. Built with love by Redocly. + Testing severity levels for failing checks against the Redocly Cafe API + described with deliberately wrong response definitions. version: 1.0.0 sourceDescriptions: - - name: museum-api + - name: cafe-api type: openapi - url: ../museum-api-with-errors.yaml + url: ../cafe-api-with-errors.yaml workflows: - - workflowId: get-museum-hours + - workflowId: get-menu-items description: >- - This workflow demonstrates how to get the museum opening hours and buy tickets. - parameters: - - in: header - name: Authorization - value: Basic Og== + This workflow demonstrates how to list the cafe menu items. steps: - - stepId: get-museum-hours + - stepId: get-menu-items parameters: - in: header name: Content-Type value: application/json + - in: query + name: search + value: mermaid-treasure-latte description: >- - Get museum hours by resolving request details with getMuseumHours operationId from museum-api.yaml description. - operationId: museum-api.getMuseumHours + List menu items by resolving request details with listMenuItems operationId from cafe-api.yaml description. + operationId: cafe-api.listMenuItems successCriteria: - condition: $statusCode == 200 outputs: - schedule: $response.body - - workflowId: events-crud + menu: $response.body + - workflowId: client-registration description: >- - This workflow demonstrates how to list, create, update, and delete special events at the museum. - parameters: - - in: header - name: Authorization - value: Basic Og== + This workflow demonstrates how to register an OAuth2 client and retrieve a menu item photo description. steps: - - stepId: create-event + - stepId: create-client description: >- - Create a new special event. - operationPath: '{$sourceDescriptions.museum-api.url}#/paths/~1special-events/post' + Try to register a new OAuth2 client without the required `name` field. + operationPath: '{$sourceDescriptions.cafe-api.url}#/paths/~1oauth2~1register/post' requestBody: payload: - name: 'Mermaid Treasure Identification and Analysis' - location: 'Under the seaaa 🦀 🎶 🌊.' - eventDescription: 'Join us as we review and classify a rare collection of 20 thingamabobs, gadgets, gizmos, whoosits, and whatsits, kindly donated by Ariel.' - dates: - - '2023-09-05' - - '2023-09-08' - price: 0 + clientName: respect-e2e-client successCriteria: - - condition: $statusCode == 201 + - condition: $statusCode == 400 - context: $response.body - condition: "$[?@.name == 'Mermaid Treasure Identification and Analysis']" + condition: "$[?@.title == 'Validation failed']" type: jsonpath + - context: $response.body + condition: '$[?@.status == 400]' + type: + type: jsonpath + version: draft-goessner-dispatch-jsonpath-00 outputs: - createdEventId: $response.body#/eventId - name: $response.body#/name + errorField: $response.body#/details/errors/0/path/0 + errorTitle: $response.body#/title - - stepId: update-event + - stepId: get-menu-item-photo description: >- - Update the created event with new details. - operationPath: '{$sourceDescriptions.museum-api.url}#/paths/~1special-events~1{eventId}/patch' + Retrieve the photo text description of a seeded menu item. + operationPath: '{$sourceDescriptions.cafe-api.url}#/paths/~1menu-item-images~1{menuItemId}/get' parameters: - - name: eventId + - name: menuItemId in: path - value: $steps.create-event.outputs.createdEventId - requestBody: - payload: - name: 'Orca Identification and Analysis' - location: 'Under the seaaa 🦀 🎶 🌊.' - dates: - - '2023-09-05' - - '2023-09-08' - price: 0 + value: prd_0000000000seedtrams0000000 + - in: header + name: Accept + value: text/plain + - in: header + name: x-error-field + value: $steps.create-client.outputs.errorField successCriteria: - condition: $statusCode == 200 - - context: $response.body - condition: "$[?@.name == 'Orca Identification and Analysis']" - type: - type: jsonpath - version: draft-goessner-dispatch-jsonpath-00 + - condition: $response.body == 'A classic Italian tiramisu layered with mascarpone and espresso' diff --git a/tests/e2e/respect/severity-warn-level/__snapshots__/severity-warn-level.test.ts.snap b/tests/e2e/respect/severity-warn-level/__snapshots__/severity-warn-level.test.ts.snap index b31f65301a..7e7e43491f 100644 --- a/tests/e2e/respect/severity-warn-level/__snapshots__/severity-warn-level.test.ts.snap +++ b/tests/e2e/respect/severity-warn-level/__snapshots__/severity-warn-level.test.ts.snap @@ -3,14 +3,13 @@ exports[`should use warn severity level 1`] = ` "──────────────────────────────────────────────────────────────────────────────── - Running workflow severity-level.arazzo.yaml / get-museum-hours + Running workflow severity-level.arazzo.yaml / get-menu-items - ✗ GET /museum-hours - step get-museum-hours + ✗ GET /menu - step get-menu-items -    Request URL: https://redocly.com/_mock/demo/openapi/museum-api/museum-hours +    Request URL: https://api.cafe.redocly.com/menu?search=mermaid-treasure-latte     Request Headers:       accept: html/text, application/problem+json -      authorization: Basic Og==       content-type: application/json @@ -19,126 +18,76 @@ exports[`should use warn severity level 1`] = `     Response Headers:     Response Size: bytes     Response Body: -      [ -       { -       "date": "2023-09-11", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-12", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-13", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-14", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-15", -       "timeOpen": "10:00", -       "timeClose": "16:00" -       }, -       { -       "date": "2023-09-18", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-19", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-20", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-21", -       "timeOpen": "09:00", -       "timeClose": "18:00" +      { +       "object": "list", +       "page": { +       "startCursor": null, +       "endCursor": null, +       "hasNextPage": false, +       "hasPrevPage": false, +       "limit": 10, +       "total": 0        }, -       { -       "date": "2023-09-22", -       "timeOpen": "10:00", -       "timeClose": "16:00" -       } -      ] +       "items": [] +      }     ✓ success criteria check - $statusCode == 200     ⚠ status code check ──────────────────────────────────────────────────────────────────────────────── - Running workflow severity-level.arazzo.yaml / events-crud + Running workflow severity-level.arazzo.yaml / client-registration - ✓ POST /special-events - step create-event + ✓ POST /oauth2/register - step create-client -    Request URL: https://redocly.com/_mock/demo/openapi/museum-api/special-events +    Request URL: https://api.cafe.redocly.com/oauth2/register     Request Headers:       content-type: application/json       accept: application/json, application/problem+json -      authorization: Basic Og==     Request Body:       { -       "name": "Mermaid Treasure Identification and Analysis", -       "location": "Under the seaaa 🦀 🎶 🌊.", -       "eventDescription": "Join us as we review and classify a rare collection of 20 thingamabobs, gadgets, gizmos, whoosits, and whatsits, kindly donated by Ariel.", -       "dates": [ -       "2023-09-05", -       "2023-09-08" -       ], -       "price": 0 +       "clientName": "respect-e2e-client"       } -    Response status code: 201 +    Response status code: 400     Response time: ms     Response Headers:     Response Size: bytes     Response Body:       { -       "eventId": "dad4bce8-f5cb-4078-a211-995864315e39", -       "name": "Mermaid Treasure Identification and Analysis", -       "location": "Under the seaaa 🦀 🎶 🌊.", -       "eventDescription": "Join us as we review and classify a rare collection of 20 thingamabobs, gadgets, gizmos, whoosits, and whatsits, kindly donated by Ariel.", -       "dates": [ -       "2023-09-05", -       "2023-09-08" -       ], -       "price": 0 +       "type": "about:blank", +       "title": "Validation failed", +       "status": 400, +       "instance": "/oauth2/register", +       "details": { +       "errors": [ +       { +       "code": "invalid_type", +       "expected": "string", +       "received": "undefined", +       "path": [ +       "name" +       ], +       "message": "Required" +       } +       ] +       }       } -    ✓ success criteria check - $statusCode == 201 -    ✓ success criteria check - $[?@.name == 'Mermaid Treasure Identification and ... -    ✓ status code check - $statusCode in [201, 400, 404] +    ✓ success criteria check - $statusCode == 400 +    ✓ success criteria check - $[?@.title == 'Validation failed'] +    ✓ success criteria check - $[?@.status == 400] +    ✓ status code check - $statusCode in [201, 400, 401, 500]     ✓ content-type check     ✓ schema check - ✗ PATCH /special-events/{eventId} - step update-event + ✗ GET /menu-item-images/{menuItemId} - step get-menu-item-photo -    Request URL: https://redocly.com/_mock/demo/openapi/museum-api/special-events/dad4bce8-f5cb-4078-a211-995864315e39 +    Request URL: https://api.cafe.redocly.com/menu-item-images/prd_0000000000seedtrams0000000     Request Headers: -      content-type: application/json -      accept: json, application/problem+json -      authorization: Basic Og== -    Request Body: -      { -       "name": "Orca Identification and Analysis", -       "location": "Under the seaaa 🦀 🎶 🌊.", -       "dates": [ -       "2023-09-05", -       "2023-09-08" -       ], -       "price": 0 -      } +      accept: text/plain +      x-error-field: name     Response status code: 200 @@ -146,44 +95,34 @@ exports[`should use warn severity level 1`] = `     Response Headers:     Response Size: bytes     Response Body: -      { -       "eventId": "dad4bce8-f5cb-4078-a211-995864315e39", -       "name": "Orca Identification and Analysis", -       "location": "Under the seaaa 🦀 🎶 🌊.", -       "eventDescription": "Join us as we review and classify a rare collection of 20 thingamabobs, gadgets, gizmos, whoosits, and whatsits, kindly donated by Ariel.", -       "dates": [ -       "2023-09-05", -       "2023-09-08" -       ], -       "price": 0 -      } +      A classic Italian tiramisu layered with mascarpone and espresso     ✓ success criteria check - $statusCode == 200 -    ✓ success criteria check - $[?@.name == 'Orca Identification and Analysis'] -    ✓ status code check - $statusCode in [200, 400, 404] +    ✓ success criteria check - $response.body == 'A classic Italian tiramisu laye... +    ✓ status code check - $statusCode in [200, 404, 500]     ⚠ content-type check   Failed tests info: -  Workflow name: get-museum-hours +  Workflow name: get-menu-items -    stepId - get-museum-hours +    stepId - get-menu-items     ⚠ status code check               -  Workflow name: events-crud +  Workflow name: client-registration -    stepId - update-event +    stepId - get-menu-item-photo     ⚠ content-type check -      Content type application/json for 200 response is not described in the schema. -      Expected content types: json. +      Content type text/plain for 200 response is not described in the schema. +      Expected content types: image/png, text/csv.          Summary for severity-level.arazzo.yaml      Workflows: 2 passed, 2 total   Steps: 3 passed, 2 warnings, 3 total -  Checks: 11 passed, 2 warnings, 11 total +  Checks: 12 passed, 2 warnings, 12 total   Time: ms diff --git a/tests/e2e/respect/severity-warn-level/severity-level.arazzo.yaml b/tests/e2e/respect/severity-warn-level/severity-level.arazzo.yaml index c481f92613..289bd6f220 100644 --- a/tests/e2e/respect/severity-warn-level/severity-level.arazzo.yaml +++ b/tests/e2e/respect/severity-warn-level/severity-level.arazzo.yaml @@ -1,87 +1,75 @@ arazzo: 1.0.1 info: - title: Redocly Museum API + title: Severity warn level description: >- - An imaginary, but delightful Museum API for interacting with museum services - and information. Built with love by Redocly. + Testing severity levels for failing checks against the Redocly Cafe API + described with deliberately wrong response definitions. version: 1.0.0 sourceDescriptions: - - name: museum-api + - name: cafe-api type: openapi - url: ../museum-api-with-errors.yaml + url: ../cafe-api-with-errors.yaml workflows: - - workflowId: get-museum-hours + - workflowId: get-menu-items description: >- - This workflow demonstrates how to get the museum opening hours and buy tickets. - parameters: - - in: header - name: Authorization - value: Basic Og== + This workflow demonstrates how to list the cafe menu items. steps: - - stepId: get-museum-hours + - stepId: get-menu-items parameters: - in: header name: Content-Type value: application/json + - in: query + name: search + value: mermaid-treasure-latte description: >- - Get museum hours by resolving request details with getMuseumHours operationId from museum-api.yaml description. - operationId: museum-api.getMuseumHours + List menu items by resolving request details with listMenuItems operationId from cafe-api.yaml description. + operationId: cafe-api.listMenuItems successCriteria: - condition: $statusCode == 200 outputs: - schedule: $response.body - - workflowId: events-crud + menu: $response.body + - workflowId: client-registration description: >- - This workflow demonstrates how to list, create, update, and delete special events at the museum. - parameters: - - in: header - name: Authorization - value: Basic Og== + This workflow demonstrates how to register an OAuth2 client and retrieve a menu item photo description. steps: - - stepId: create-event + - stepId: create-client description: >- - Create a new special event. - operationPath: '{$sourceDescriptions.museum-api.url}#/paths/~1special-events/post' + Try to register a new OAuth2 client without the required `name` field. + operationPath: '{$sourceDescriptions.cafe-api.url}#/paths/~1oauth2~1register/post' requestBody: payload: - name: 'Mermaid Treasure Identification and Analysis' - location: 'Under the seaaa 🦀 🎶 🌊.' - eventDescription: 'Join us as we review and classify a rare collection of 20 thingamabobs, gadgets, gizmos, whoosits, and whatsits, kindly donated by Ariel.' - dates: - - '2023-09-05' - - '2023-09-08' - price: 0 + clientName: respect-e2e-client successCriteria: - - condition: $statusCode == 201 + - condition: $statusCode == 400 - context: $response.body - condition: "$[?@.name == 'Mermaid Treasure Identification and Analysis']" + condition: "$[?@.title == 'Validation failed']" type: jsonpath + - context: $response.body + condition: '$[?@.status == 400]' + type: + type: jsonpath + version: draft-goessner-dispatch-jsonpath-00 outputs: - createdEventId: $response.body#/eventId - name: $response.body#/name + errorField: $response.body#/details/errors/0/path/0 + errorTitle: $response.body#/title - - stepId: update-event + - stepId: get-menu-item-photo description: >- - Update the created event with new details. - operationPath: '{$sourceDescriptions.museum-api.url}#/paths/~1special-events~1{eventId}/patch' + Retrieve the photo text description of a seeded menu item. + operationPath: '{$sourceDescriptions.cafe-api.url}#/paths/~1menu-item-images~1{menuItemId}/get' parameters: - - name: eventId + - name: menuItemId in: path - value: $steps.create-event.outputs.createdEventId - requestBody: - payload: - name: 'Orca Identification and Analysis' - location: 'Under the seaaa 🦀 🎶 🌊.' - dates: - - '2023-09-05' - - '2023-09-08' - price: 0 + value: prd_0000000000seedtrams0000000 + - in: header + name: Accept + value: text/plain + - in: header + name: x-error-field + value: $steps.create-client.outputs.errorField successCriteria: - condition: $statusCode == 200 - - context: $response.body - condition: "$[?@.name == 'Orca Identification and Analysis']" - type: - type: jsonpath - version: draft-goessner-dispatch-jsonpath-00 + - condition: $response.body == 'A classic Italian tiramisu layered with mascarpone and espresso' diff --git a/tests/e2e/respect/step-on-failure-type-end-action/__snapshots__/step-on-failure-type-end-action.test.ts.snap b/tests/e2e/respect/step-on-failure-type-end-action/__snapshots__/step-on-failure-type-end-action.test.ts.snap index 13aa1a1e6a..abc9d75287 100644 --- a/tests/e2e/respect/step-on-failure-type-end-action/__snapshots__/step-on-failure-type-end-action.test.ts.snap +++ b/tests/e2e/respect/step-on-failure-type-end-action/__snapshots__/step-on-failure-type-end-action.test.ts.snap @@ -3,30 +3,30 @@ exports[`should end workflow execution, context returns to the caller with applicable outputs, when step fails and onFailure action is of type \`end\` 1`] = ` "──────────────────────────────────────────────────────────────────────────────── - Running workflow step-on-failure-type-end-action.arazzo.yaml / events-crud + Running workflow step-on-failure-type-end-action.arazzo.yaml / client-registration - ✗ GET /special-events - step list-events + ✗ GET /menu - step list-menu-items     ✗ success criteria check - $statusCode == 201 -    ✓ status code check - $statusCode in [200, 400, 404] +    ✓ status code check - $statusCode in [200, 400, 500]     ✓ content-type check     ✓ schema check ──────────────────────────────────────────────────────────────────────────────── - Running workflow step-on-failure-type-end-action.arazzo.yaml / get-museum-hours + Running workflow step-on-failure-type-end-action.arazzo.yaml / get-menu-items - ✓ GET /museum-hours - step get-museum-hours + ✓ GET /menu - step get-menu-items     ✓ success criteria check - $statusCode == 200 -    ✓ status code check - $statusCode in [200, 400, 404] +    ✓ status code check - $statusCode in [200, 400, 500]     ✓ content-type check     ✓ schema check   Failed tests info: -  Workflow name: events-crud +  Workflow name: client-registration -    stepId - list-events +    stepId - list-menu-items     ✗ success criteria check       Checking simple criteria: {"condition":"$statusCode == 201"}        diff --git a/tests/e2e/respect/step-on-failure-type-end-action/step-on-failure-type-end-action.arazzo.yaml b/tests/e2e/respect/step-on-failure-type-end-action/step-on-failure-type-end-action.arazzo.yaml index 7a2710e23c..99d8c86d1d 100644 --- a/tests/e2e/respect/step-on-failure-type-end-action/step-on-failure-type-end-action.arazzo.yaml +++ b/tests/e2e/respect/step-on-failure-type-end-action/step-on-failure-type-end-action.arazzo.yaml @@ -1,27 +1,23 @@ arazzo: 1.0.1 info: - title: Test `successActions` in workflows + title: Step onFailure type end action description: Testing functionality of `end` action in `onFailure` action. version: 1.0.0 sourceDescriptions: - - name: museum-api + - name: cafe-api type: openapi - url: ../museum-api.yaml + url: ../cafe-api.yaml workflows: - - workflowId: events-crud + - workflowId: client-registration description: >- - This workflow demonstrates how to list, create, update, and delete special events at the museum. - parameters: - - in: header - name: Authorization - value: Basic Og== + This workflow demonstrates how to list menu items and register an OAuth2 client in the cafe API. steps: - - stepId: list-events - operationPath: '{$sourceDescriptions.museum-api.url}#/paths/~1special-events/get' + - stepId: list-menu-items + operationPath: '{$sourceDescriptions.cafe-api.url}#/paths/~1menu/get' outputs: - events: $response.body + menuItems: $response.body successCriteria: - condition: $statusCode == 201 onFailure: @@ -32,31 +28,23 @@ workflows: # This goto action should not be called because previous action is an end action. - type: goto name: step-onFailure-action-goto - stepId: create-event + stepId: create-client - type: retry name: step-onFailure-action-retry retryLimit: 1 retryAfter: 3 - - stepId: create-event - operationPath: '{$sourceDescriptions.museum-api.url}#/paths/~1special-events/post' + - stepId: create-client + operationPath: '{$sourceDescriptions.cafe-api.url}#/paths/~1oauth2~1register/post' requestBody: payload: - name: 'Mermaid Treasure Identification and Analysis' - location: 'Under the seaaa 🦀 🎶 🌊.' - eventDescription: 'Join us as we review and classify a rare collection of 20 thingamabobs, gadgets, gizmos, whoosits, and whatsits, kindly donated by Ariel.' - dates: - - '2023-09-05' - - '2023-09-08' - price: 0 + name: respect-e2e-client + grantTypes: + - client_credentials successCriteria: - condition: $statusCode == 201 - - workflowId: get-museum-hours - parameters: - - in: header - name: Authorization - value: Basic Og== + - workflowId: get-menu-items steps: - - stepId: get-museum-hours - operationId: $sourceDescriptions.museum-api.getMuseumHours + - stepId: get-menu-items + operationId: $sourceDescriptions.cafe-api.listMenuItems successCriteria: - condition: $statusCode == 200 diff --git a/tests/e2e/respect/step-on-success-type-end-action/__snapshots__/step-on-success-type-end-action.test.ts.snap b/tests/e2e/respect/step-on-success-type-end-action/__snapshots__/step-on-success-type-end-action.test.ts.snap index 91c700464d..9733b6dd2b 100644 --- a/tests/e2e/respect/step-on-success-type-end-action/__snapshots__/step-on-success-type-end-action.test.ts.snap +++ b/tests/e2e/respect/step-on-success-type-end-action/__snapshots__/step-on-success-type-end-action.test.ts.snap @@ -3,21 +3,21 @@ exports[`should end workflow execution, context returns to the caller with applicable outputs, when step passes and onSuccess action is of type \`end\` 1`] = ` "──────────────────────────────────────────────────────────────────────────────── - Running workflow step-on-success-type-end-action.arazzo.yaml / events-crud + Running workflow step-on-success-type-end-action.arazzo.yaml / client-registration - ✓ GET /special-events - step list-events + ✓ GET /menu - step list-menu-items     ✓ success criteria check - $statusCode == 200 -    ✓ status code check - $statusCode in [200, 400, 404] +    ✓ status code check - $statusCode in [200, 400, 500]     ✓ content-type check     ✓ schema check ──────────────────────────────────────────────────────────────────────────────── - Running workflow step-on-success-type-end-action.arazzo.yaml / get-museum-hours + Running workflow step-on-success-type-end-action.arazzo.yaml / get-menu-items - ✓ GET /museum-hours - step get-museum-hours + ✓ GET /menu - step get-menu-items     ✓ success criteria check - $statusCode == 200 -    ✓ status code check - $statusCode in [200, 400, 404] +    ✓ status code check - $statusCode in [200, 400, 500]     ✓ content-type check     ✓ schema check diff --git a/tests/e2e/respect/step-on-success-type-end-action/step-on-success-type-end-action.arazzo.yaml b/tests/e2e/respect/step-on-success-type-end-action/step-on-success-type-end-action.arazzo.yaml index 1b8dda365b..692731a466 100644 --- a/tests/e2e/respect/step-on-success-type-end-action/step-on-success-type-end-action.arazzo.yaml +++ b/tests/e2e/respect/step-on-success-type-end-action/step-on-success-type-end-action.arazzo.yaml @@ -1,44 +1,36 @@ arazzo: 1.0.1 info: - title: Test `successActions` in workflows + title: Step onSuccess type end action description: Testing functionality of `end` action in `onSuccess` action. version: 1.0.0 sourceDescriptions: - - name: museum-api + - name: cafe-api type: openapi - url: ../museum-api.yaml + url: ../cafe-api.yaml workflows: - - workflowId: events-crud - parameters: - - in: header - name: Authorization - value: Basic Og== + - workflowId: client-registration steps: - - stepId: list-events - operationPath: '{$sourceDescriptions.museum-api.url}#/paths/~1special-events/get' + - stepId: list-menu-items + operationPath: '{$sourceDescriptions.cafe-api.url}#/paths/~1menu/get' outputs: - events: $response.body + menuItems: $response.body successCriteria: - condition: $statusCode == 200 onSuccess: - type: end name: step-onSuccess-action-end - - stepId: create-event - operationPath: '{$sourceDescriptions.museum-api.url}#/paths/~1special-events/post' + - stepId: create-client + operationPath: '{$sourceDescriptions.cafe-api.url}#/paths/~1oauth2~1register/post' requestBody: payload: - name: 'Mermaid Treasure Identification and Analysis' + name: respect-e2e-client successCriteria: - condition: $statusCode == 201 - - workflowId: get-museum-hours - parameters: - - in: header - name: Authorization - value: Basic Og== + - workflowId: get-menu-items steps: - - stepId: get-museum-hours - operationId: $sourceDescriptions.museum-api.getMuseumHours + - stepId: get-menu-items + operationId: $sourceDescriptions.cafe-api.listMenuItems successCriteria: - condition: $statusCode == 200 diff --git a/tests/e2e/respect/workflow-depends-on-failed/workflow-depends-on-failed.arazzo.yaml b/tests/e2e/respect/workflow-depends-on-failed/workflow-depends-on-failed.arazzo.yaml index 26efdfb1d4..921ce3ff4a 100644 --- a/tests/e2e/respect/workflow-depends-on-failed/workflow-depends-on-failed.arazzo.yaml +++ b/tests/e2e/respect/workflow-depends-on-failed/workflow-depends-on-failed.arazzo.yaml @@ -7,7 +7,7 @@ info: sourceDescriptions: - name: cafe-api type: openapi - url: ../../../../resources/cafe.yaml + url: ../cafe-api.yaml workflows: - workflowId: failing-dependency diff --git a/tests/e2e/respect/workflow-depends-on-not-found/workflow-depends-on-not-found.arazzo.yaml b/tests/e2e/respect/workflow-depends-on-not-found/workflow-depends-on-not-found.arazzo.yaml index 124e94dc40..3b0559ecfb 100644 --- a/tests/e2e/respect/workflow-depends-on-not-found/workflow-depends-on-not-found.arazzo.yaml +++ b/tests/e2e/respect/workflow-depends-on-not-found/workflow-depends-on-not-found.arazzo.yaml @@ -7,7 +7,7 @@ info: sourceDescriptions: - name: cafe-api type: openapi - url: ../../../../resources/cafe.yaml + url: ../cafe-api.yaml workflows: - workflowId: workflow-with-broken-depends-on diff --git a/tests/e2e/respect/workflow-failure-actions/__snapshots__/workflow-failure-actions.test.ts.snap b/tests/e2e/respect/workflow-failure-actions/__snapshots__/workflow-failure-actions.test.ts.snap index 647c30901c..a8e56067f8 100644 --- a/tests/e2e/respect/workflow-failure-actions/__snapshots__/workflow-failure-actions.test.ts.snap +++ b/tests/e2e/respect/workflow-failure-actions/__snapshots__/workflow-failure-actions.test.ts.snap @@ -3,56 +3,56 @@ exports[`should execute successActions for each workflow step if it does not have onSuccess action itself 1`] = ` "──────────────────────────────────────────────────────────────────────────────── - Running workflow workflow-failure-actions.arazzo.yaml / get-museum-hours + Running workflow workflow-failure-actions.arazzo.yaml / get-menu-items - ✗ GET /museum-hours - step get-museum-hours + ✗ GET /menu - step get-menu-items     ✗ success criteria check - $statusCode == 201 -    ✓ status code check - $statusCode in [200, 400, 404] +    ✓ status code check - $statusCode in [200, 400, 500]     ✓ content-type check     ✓ schema check - Running failure action repeated-failure-action-1 for the step get-museum-hours - Running workflow museum-tickets.yaml / get-museum-tickets + Running failure action repeated-failure-action-1 for the step get-menu-items + Running workflow cafe-menu.arazzo.yaml / search-menu-items - ✓ POST /tickets - step buy-tickets -    ✓ success criteria check - $statusCode == 201 -    ✓ status code check - $statusCode in [201, 400, 404] + ✓ GET /menu - step search-menu +    ✓ success criteria check - $statusCode == 200 +    ✓ status code check - $statusCode in [200, 400, 500]     ✓ content-type check     ✓ schema check - Retrying step get-museum-hours (1/1) + Retrying step get-menu-items (1/1) - ✗ GET /museum-hours - step get-museum-hours + ✗ GET /menu - step get-menu-items     ✗ success criteria check - $statusCode == 201 -    ✓ status code check - $statusCode in [200, 400, 404] +    ✓ status code check - $statusCode in [200, 400, 500]     ✓ content-type check     ✓ schema check - ✗ GET /museum-hours - step get-museum-hours-2 + ✗ GET /menu - step get-menu-items-2     ✗ success criteria check - $statusCode == 201 -    ✓ status code check - $statusCode in [200, 400, 404] +    ✓ status code check - $statusCode in [200, 400, 500]     ✓ content-type check     ✓ schema check - Retrying step get-museum-hours-2 (1/1) + Retrying step get-menu-items-2 (1/1) - ✗ GET /museum-hours - step get-museum-hours-2 + ✗ GET /menu - step get-menu-items-2     ✗ success criteria check - $statusCode == 201 -    ✓ status code check - $statusCode in [200, 400, 404] +    ✓ status code check - $statusCode in [200, 400, 500]     ✓ content-type check     ✓ schema check   Failed tests info: -  Workflow name: get-museum-hours +  Workflow name: get-menu-items -    stepId - get-museum-hours +    stepId - get-menu-items     ✗ success criteria check       Checking simple criteria: {"condition":"$statusCode == 201"}        -    stepId - get-museum-hours-2 +    stepId - get-menu-items-2     ✗ success criteria check       Checking simple criteria: {"condition":"$statusCode == 201"}        diff --git a/tests/e2e/respect/workflow-failure-actions/workflow-failure-actions.arazzo.yaml b/tests/e2e/respect/workflow-failure-actions/workflow-failure-actions.arazzo.yaml index 86b9cedabe..efccbb80b7 100644 --- a/tests/e2e/respect/workflow-failure-actions/workflow-failure-actions.arazzo.yaml +++ b/tests/e2e/respect/workflow-failure-actions/workflow-failure-actions.arazzo.yaml @@ -1,54 +1,50 @@ arazzo: 1.0.1 info: title: Test `failureActions` in workflows - description: Testing functionality based on MuseumAPI example using mockserver + description: Testing functionality based on the Redocly Cafe API example version: 1.0.0 sourceDescriptions: - - name: museum-api + - name: cafe-api type: openapi - url: ../museum-api.yaml - - name: tickets-from-museum-api + url: ../cafe-api.yaml + - name: menu-from-cafe-api type: arazzo - url: ../museum-tickets.yaml + url: ../cafe-menu.arazzo.yaml workflows: - - workflowId: get-museum-hours + - workflowId: get-menu-items failureActions: - name: repeated-failure-action-1 type: retry retryLimit: 1 - workflowId: $sourceDescriptions.tickets-from-museum-api.get-museum-tickets + workflowId: $sourceDescriptions.menu-from-cafe-api.search-menu-items criteria: - condition: $statusCode == 200 - name: repeated-failure-action-2 # this should not be executed as there is another action with the s type: goto - workflowId: $sourceDescriptions.tickets-from-museum-api.get-museum-tickets + workflowId: $sourceDescriptions.menu-from-cafe-api.search-menu-items criteria: - condition: $statusCode == 200 description: >- - This workflow demonstrates how to get the museum opening hours and buy tickets. - parameters: - - in: header - name: Authorization - value: Basic Og== + This workflow demonstrates how to list the cafe menu items. steps: - - stepId: get-museum-hours + - stepId: get-menu-items description: >- - Get museum hours by resolving request details with getMuseumHours operationId from museum-api.yaml description. - operationId: $sourceDescriptions.museum-api.getMuseumHours + List menu items by resolving request details with listMenuItems operationId from cafe-api.yaml description. + operationId: $sourceDescriptions.cafe-api.listMenuItems successCriteria: - condition: $statusCode == 201 outputs: - schedule: $response.body - - stepId: get-museum-hours-2 + menuItems: $response.body + - stepId: get-menu-items-2 description: >- - Get museum hours by resolving request details with getMuseumHours operationId from museum-api.yaml description. - operationId: $sourceDescriptions.museum-api.getMuseumHours + List menu items by resolving request details with listMenuItems operationId from cafe-api.yaml description. + operationId: $sourceDescriptions.cafe-api.listMenuItems successCriteria: - condition: $statusCode == 201 outputs: - schedule: $response.body + menuItems: $response.body onFailure: - type: retry name: not-executed-retry diff --git a/tests/e2e/respect/workflow-success-actions/__snapshots__/workflow-success-actions.test.ts.snap b/tests/e2e/respect/workflow-success-actions/__snapshots__/workflow-success-actions.test.ts.snap index 7170b1c5aa..5b6c431b52 100644 --- a/tests/e2e/respect/workflow-success-actions/__snapshots__/workflow-success-actions.test.ts.snap +++ b/tests/e2e/respect/workflow-success-actions/__snapshots__/workflow-success-actions.test.ts.snap @@ -3,39 +3,39 @@ exports[`should execute successActions for each workflow step if it does not have onSuccess action itself 1`] = ` "──────────────────────────────────────────────────────────────────────────────── - Running workflow workflow-success-actions.arazzo.yaml / get-museum-hours + Running workflow workflow-success-actions.arazzo.yaml / get-menu-items - ✓ GET /museum-hours - step get-museum-hours + ✓ GET /menu - step get-menu-items     ✓ success criteria check - $statusCode == 200 -    ✓ status code check - $statusCode in [200, 400, 404] +    ✓ status code check - $statusCode in [200, 400, 500]     ✓ content-type check     ✓ schema check - Running success action repeated-success-action-1 for the step get-museum-hours - Running workflow museum-tickets.yaml / get-museum-tickets + Running success action repeated-success-action-1 for the step get-menu-items + Running workflow cafe-menu.arazzo.yaml / search-menu-items - ✓ POST /tickets - step buy-tickets -    ✓ success criteria check - $statusCode == 201 -    ✓ status code check - $statusCode in [201, 400, 404] + ✓ GET /menu - step search-menu +    ✓ success criteria check - $statusCode == 200 +    ✓ status code check - $statusCode in [200, 400, 500]     ✓ content-type check     ✓ schema check ──────────────────────────────────────────────────────────────────────────────── - Running workflow workflow-success-actions.arazzo.yaml / events-crud + Running workflow workflow-success-actions.arazzo.yaml / client-registration - ✓ GET /special-events - step list-events -    ✓ status code check - $statusCode in [200, 400, 404] + ✓ GET /menu - step list-menu-items +    ✓ status code check - $statusCode in [200, 400, 500]     ✓ content-type check     ✓ schema check - Running success action step-onSuccess-action for the step list-events - Running workflow museum-tickets.yaml / get-museum-tickets + Running success action step-onSuccess-action for the step list-menu-items + Running workflow cafe-menu.arazzo.yaml / search-menu-items - ✓ POST /tickets - step buy-tickets -    ✓ success criteria check - $statusCode == 201 -    ✓ status code check - $statusCode in [201, 400, 404] + ✓ GET /menu - step search-menu +    ✓ success criteria check - $statusCode == 200 +    ✓ status code check - $statusCode in [200, 400, 500]     ✓ content-type check     ✓ schema check diff --git a/tests/e2e/respect/workflow-success-actions/workflow-success-actions.arazzo.yaml b/tests/e2e/respect/workflow-success-actions/workflow-success-actions.arazzo.yaml index c3e3ff9060..b7eab6503b 100644 --- a/tests/e2e/respect/workflow-success-actions/workflow-success-actions.arazzo.yaml +++ b/tests/e2e/respect/workflow-success-actions/workflow-success-actions.arazzo.yaml @@ -1,88 +1,76 @@ arazzo: 1.0.1 info: title: Test `successActions` in workflows - description: Testing functionality based on MuseumAPI example using mockserver + description: Testing functionality based on the Redocly Cafe API example version: 1.0.0 sourceDescriptions: - - name: museum-api + - name: cafe-api type: openapi - url: ../museum-api.yaml - - name: tickets-from-museum-api + url: ../cafe-api.yaml + - name: menu-from-cafe-api type: arazzo - url: ../museum-tickets.yaml + url: ../cafe-menu.arazzo.yaml workflows: - - workflowId: get-museum-hours + - workflowId: get-menu-items successActions: - name: repeated-success-action-1 type: goto - workflowId: $sourceDescriptions.tickets-from-museum-api.get-museum-tickets + workflowId: $sourceDescriptions.menu-from-cafe-api.search-menu-items criteria: - condition: $statusCode == 200 - name: repeated-success-action-2 # this should not be executed as there is another action with the same criteria type: goto - workflowId: events-crud + workflowId: client-registration criteria: - condition: $statusCode == 200 description: >- - This workflow demonstrates how to get the museum opening hours and buy tickets. - parameters: - - in: header - name: Authorization - value: Basic Og== + This workflow demonstrates how to list the cafe menu items. steps: - - stepId: get-museum-hours + - stepId: get-menu-items description: >- - Get museum hours by resolving request details with getMuseumHours operationId from museum-api.yaml description. - operationId: $sourceDescriptions.museum-api.getMuseumHours + List menu items by resolving request details with listMenuItems operationId from cafe-api.yaml description. + operationId: $sourceDescriptions.cafe-api.listMenuItems successCriteria: - condition: $statusCode == 200 outputs: - schedule: $response.body - - workflowId: events-crud + menuItems: $response.body + - workflowId: client-registration description: >- - This workflow demonstrates how to list, create, update, and delete special events at the museum. - parameters: - - in: header - name: Authorization - value: Basic Og== + This workflow demonstrates how to list menu items and register an OAuth2 client in the cafe API. steps: - - stepId: list-events + - stepId: list-menu-items description: >- - Request the list of events. - operationPath: '{$sourceDescriptions.museum-api.url}#/paths/~1special-events/get' + Request the list of menu items. + operationPath: '{$sourceDescriptions.cafe-api.url}#/paths/~1menu/get' outputs: - events: $response.body + menuItems: $response.body onSuccess: - type: goto name: step-onSuccess-action - workflowId: $sourceDescriptions.tickets-from-museum-api.get-museum-tickets + workflowId: $sourceDescriptions.menu-from-cafe-api.search-menu-items criteria: - condition: $statusCode == 200 - - stepId: create-event + - stepId: create-client description: >- - Create a new special event. - operationPath: '{$sourceDescriptions.museum-api.url}#/paths/~1special-events/post' + Register a new OAuth2 client. + operationPath: '{$sourceDescriptions.cafe-api.url}#/paths/~1oauth2~1register/post' onSuccess: - type: goto name: step-onSuccess-action-2 - stepId: list-events + stepId: list-menu-items criteria: - condition: $statusCode == 201 requestBody: payload: - name: 'Mermaid Treasure Identification and Analysis' - location: 'Under the seaaa 🦀 🎶 🌊.' - eventDescription: 'Join us as we review and classify a rare collection of 20 thingamabobs, gadgets, gizmos, whoosits, and whatsits, kindly donated by Ariel.' - dates: - - '2023-09-05' - - '2023-09-08' - price: 0 + name: respect-e2e-client + grantTypes: + - client_credentials successCriteria: - condition: $statusCode == 201 - context: $response.body - condition: "$[?@.name == 'Mermaid Treasure Identification and Analysis']" + condition: "$[?@.name == 'respect-e2e-client']" type: type: jsonpath version: draft-goessner-dispatch-jsonpath-00 diff --git a/tests/e2e/respect/x-allow-reserved-query-param/__snapshots__/x-allow-reserved-query-param.test.ts.snap b/tests/e2e/respect/x-allow-reserved-query-param/__snapshots__/x-allow-reserved-query-param.test.ts.snap index 3359e58422..f22beebff8 100644 --- a/tests/e2e/respect/x-allow-reserved-query-param/__snapshots__/x-allow-reserved-query-param.test.ts.snap +++ b/tests/e2e/respect/x-allow-reserved-query-param/__snapshots__/x-allow-reserved-query-param.test.ts.snap @@ -5,9 +5,9 @@ exports[`should leave reserved chars unencoded in query when x-allowReserved is Running workflow x-allow-reserved-query-param.arazzo.yaml / allow-reserved - ✓ GET /museum-hours - step get-with-allow-reserved + ✓ GET /menu - step get-with-allow-reserved -    Request URL: https://redocly.com/_mock/demo/openapi/museum-api/museum-hours?startDate=2023-02-23&filter=https://example.com/path/to;x,y(z)a*b.c[1]@v +    Request URL: https://api.cafe.redocly.com/menu?search=2023-02-23&filter=https://example.com/path/to;x,y(z)a*b.c[1]@v     Request Headers:       accept: application/json, application/problem+json @@ -18,11 +18,14 @@ exports[`should leave reserved chars unencoded in query when x-allowReserved is     Response Size: bytes     Response Body:       { -       "type": "object", -       "title": "Not authenticated. Supported authentication types: MuseumPlaceholderAuth." +       "type": "about:blank", +       "title": "Invalid filter field", +       "status": 400, +       "instance": "/menu?search=2023-02-23&filter=https://example.com/path/to;x,y(z)a*b.c[1]@v"       } -    ✓ status code check - $statusCode in [200, 400, 404] +    ✓ success criteria check - $statusCode == 400 +    ✓ status code check - $statusCode in [200, 400, 500]     ✓ content-type check     ✓ schema check @@ -31,7 +34,7 @@ exports[`should leave reserved chars unencoded in query when x-allowReserved is      Workflows: 1 passed, 1 total   Steps: 1 passed, 1 total -  Checks: 3 passed, 3 total +  Checks: 4 passed, 4 total   Time: ms diff --git a/tests/e2e/respect/x-allow-reserved-query-param/x-allow-reserved-query-param.arazzo.yaml b/tests/e2e/respect/x-allow-reserved-query-param/x-allow-reserved-query-param.arazzo.yaml index 9f878312bd..eabb3d537c 100644 --- a/tests/e2e/respect/x-allow-reserved-query-param/x-allow-reserved-query-param.arazzo.yaml +++ b/tests/e2e/respect/x-allow-reserved-query-param/x-allow-reserved-query-param.arazzo.yaml @@ -3,19 +3,21 @@ info: title: Allow reserved query params version: 1.0.0 sourceDescriptions: - - name: museum-api + - name: cafe-api type: openapi - url: ../museum-api.yaml + url: ../cafe-api.yaml workflows: - workflowId: allow-reserved steps: - stepId: get-with-allow-reserved - operationId: museum-api.getMuseumHours + operationId: cafe-api.listMenuItems parameters: - in: query - name: startDate + name: search value: 2023-02-23 - in: query name: filter value: 'https://example.com/path/to;x,y(z)a*b.c[1]@v' x-allowReserved: true + successCriteria: + - condition: $statusCode == 400 diff --git a/tests/e2e/respect/x-security-api-key-auth/__snapshots__/x-security-api-key-auth.test.ts.snap b/tests/e2e/respect/x-security-api-key-auth/__snapshots__/x-security-api-key-auth.test.ts.snap index 7181740405..9150d6c2fa 100644 --- a/tests/e2e/respect/x-security-api-key-auth/__snapshots__/x-security-api-key-auth.test.ts.snap +++ b/tests/e2e/respect/x-security-api-key-auth/__snapshots__/x-security-api-key-auth.test.ts.snap @@ -5,9 +5,9 @@ exports[`should make request with X-API-KEY in header 1`] = ` Running workflow x-security-api-key-auth.arazzo.yaml / api-key-auth-workflow - ✓ GET /museum-hours - step step-with-api-key-auth-scheme + ✓ GET /menu - step step-with-api-key-auth-scheme -    Request URL: https://redocly.com/_mock/demo/openapi/museum-api/museum-hours +    Request URL: https://api.cafe.redocly.com/menu?search=mermaid-treasure-latte     Request Headers:       accept: application/json, application/problem+json       authorization: Basic Og== @@ -19,60 +19,20 @@ exports[`should make request with X-API-KEY in header 1`] = `     Response Headers:     Response Size: bytes     Response Body: -      [ -       { -       "date": "2023-09-11", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-12", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-13", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-14", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-15", -       "timeOpen": "10:00", -       "timeClose": "16:00" -       }, -       { -       "date": "2023-09-18", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-19", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-20", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-21", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-22", -       "timeOpen": "10:00", -       "timeClose": "16:00" -       } -      ] - -    ✓ status code check - $statusCode in [200, 400, 404] +      { +       "object": "list", +       "page": { +       "startCursor": null, +       "endCursor": null, +       "hasNextPage": false, +       "hasPrevPage": false, +       "limit": 10, +       "total": 0 +       }, +       "items": [] +      } + +    ✓ status code check - $statusCode in [200, 400, 500]     ✓ content-type check     ✓ schema check diff --git a/tests/e2e/respect/x-security-api-key-auth/x-security-api-key-auth.arazzo.yaml b/tests/e2e/respect/x-security-api-key-auth/x-security-api-key-auth.arazzo.yaml index 6f4c44df47..354ead6426 100644 --- a/tests/e2e/respect/x-security-api-key-auth/x-security-api-key-auth.arazzo.yaml +++ b/tests/e2e/respect/x-security-api-key-auth/x-security-api-key-auth.arazzo.yaml @@ -1,12 +1,12 @@ arazzo: 1.0.1 info: - title: Redocly Museum API + title: X-Security API key auth version: 1.0.0 sourceDescriptions: - - name: museum-api + - name: cafe-api type: openapi - url: ../museum-api.yaml + url: ../cafe-api.yaml workflows: - workflowId: api-key-auth-workflow @@ -17,11 +17,14 @@ workflows: type: string steps: - stepId: step-with-api-key-auth-scheme - operationId: getMuseumHours + operationId: listMenuItems parameters: - in: header name: Authorization value: Basic Og== + - in: query + name: search + value: mermaid-treasure-latte x-security: - scheme: type: apiKey diff --git a/tests/e2e/respect/x-security-basic-auth/__snapshots__/x-security-basic-auth.test.ts.snap b/tests/e2e/respect/x-security-basic-auth/__snapshots__/x-security-basic-auth.test.ts.snap index 17c86c16aa..57556b76bf 100644 --- a/tests/e2e/respect/x-security-basic-auth/__snapshots__/x-security-basic-auth.test.ts.snap +++ b/tests/e2e/respect/x-security-basic-auth/__snapshots__/x-security-basic-auth.test.ts.snap @@ -5,9 +5,9 @@ exports[`should make request with Authorization header \`Basic ...\` 1`] = ` Running workflow x-security-basic-auth.arazzo.yaml / basic-auth-workflow - ✓ GET /museum-hours - step step-with-basic-auth-scheme + ✓ GET /menu - step step-with-basic-auth-scheme -    Request URL: https://redocly.com/_mock/demo/openapi/museum-api/museum-hours +    Request URL: https://api.cafe.redocly.com/menu?search=mermaid-treasure-latte     Request Headers:       accept: application/json, application/problem+json       authorization: Basic ******** @@ -18,60 +18,20 @@ exports[`should make request with Authorization header \`Basic ...\` 1`] = `     Response Headers:     Response Size: bytes     Response Body: -      [ -       { -       "date": "2023-09-11", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-12", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-13", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-14", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-15", -       "timeOpen": "10:00", -       "timeClose": "16:00" -       }, -       { -       "date": "2023-09-18", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-19", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-20", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-21", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-22", -       "timeOpen": "10:00", -       "timeClose": "16:00" -       } -      ] - -    ✓ status code check - $statusCode in [200, 400, 404] +      { +       "object": "list", +       "page": { +       "startCursor": null, +       "endCursor": null, +       "hasNextPage": false, +       "hasPrevPage": false, +       "limit": 10, +       "total": 0 +       }, +       "items": [] +      } + +    ✓ status code check - $statusCode in [200, 400, 500]     ✓ content-type check     ✓ schema check diff --git a/tests/e2e/respect/x-security-basic-auth/x-security-basic-auth.arazzo.yaml b/tests/e2e/respect/x-security-basic-auth/x-security-basic-auth.arazzo.yaml index e6aff3319c..d6d1a5499f 100644 --- a/tests/e2e/respect/x-security-basic-auth/x-security-basic-auth.arazzo.yaml +++ b/tests/e2e/respect/x-security-basic-auth/x-security-basic-auth.arazzo.yaml @@ -1,12 +1,12 @@ arazzo: 1.0.1 info: - title: Redocly Museum API + title: X-Security basic auth version: 1.0.0 sourceDescriptions: - - name: museum-api + - name: cafe-api type: openapi - url: ../museum-api.yaml + url: ../cafe-api.yaml workflows: - workflowId: basic-auth-workflow @@ -17,7 +17,11 @@ workflows: type: string steps: - stepId: step-with-basic-auth-scheme - operationId: getMuseumHours + operationId: listMenuItems + parameters: + - in: query + name: search + value: mermaid-treasure-latte x-security: - scheme: type: http diff --git a/tests/e2e/respect/x-security-bearer-auth/__snapshots__/x-security-bearer-auth.test.ts.snap b/tests/e2e/respect/x-security-bearer-auth/__snapshots__/x-security-bearer-auth.test.ts.snap index a72fcb7c95..5026e08368 100644 --- a/tests/e2e/respect/x-security-bearer-auth/__snapshots__/x-security-bearer-auth.test.ts.snap +++ b/tests/e2e/respect/x-security-bearer-auth/__snapshots__/x-security-bearer-auth.test.ts.snap @@ -5,25 +5,33 @@ exports[`should make request with Authorization header \`Bearer ...\`, actual re Running workflow x-security-bearer-auth.arazzo.yaml / bearer-auth-workflow - ✓ GET /museum-hours - step step-with-bearer-auth-scheme + ✓ GET /menu - step step-with-bearer-auth-scheme -    Request URL: https://redocly.com/_mock/demo/openapi/museum-api/museum-hours +    Request URL: https://api.cafe.redocly.com/menu?search=mermaid-treasure-latte     Request Headers:       accept: application/json, application/problem+json       authorization: Bearer ******** -    Response status code: 400 +    Response status code: 200     Response time: ms     Response Headers:     Response Size: bytes     Response Body:       { -       "type": "object", -       "title": "Not authenticated. Supported authentication types: MuseumPlaceholderAuth." +       "object": "list", +       "page": { +       "startCursor": null, +       "endCursor": null, +       "hasNextPage": false, +       "hasPrevPage": false, +       "limit": 10, +       "total": 0 +       }, +       "items": []       } -    ✓ status code check - $statusCode in [200, 400, 404] +    ✓ status code check - $statusCode in [200, 400, 500]     ✓ content-type check     ✓ schema check diff --git a/tests/e2e/respect/x-security-bearer-auth/x-security-bearer-auth.arazzo.yaml b/tests/e2e/respect/x-security-bearer-auth/x-security-bearer-auth.arazzo.yaml index 2504ccb0ad..bbbe2de56c 100644 --- a/tests/e2e/respect/x-security-bearer-auth/x-security-bearer-auth.arazzo.yaml +++ b/tests/e2e/respect/x-security-bearer-auth/x-security-bearer-auth.arazzo.yaml @@ -1,12 +1,12 @@ arazzo: 1.0.1 info: - title: Redocly Museum API + title: X-Security bearer auth version: 1.0.0 sourceDescriptions: - - name: museum-api + - name: cafe-api type: openapi - url: ../museum-api.yaml + url: ../cafe-api.yaml workflows: - workflowId: bearer-auth-workflow @@ -17,7 +17,11 @@ workflows: type: string steps: - stepId: step-with-bearer-auth-scheme - operationId: getMuseumHours + operationId: listMenuItems + parameters: + - in: query + name: search + value: mermaid-treasure-latte x-security: - scheme: type: http diff --git a/tests/e2e/respect/x-security-oauth2-auth/__snapshots__/x-security-oauth2-auth.test.ts.snap b/tests/e2e/respect/x-security-oauth2-auth/__snapshots__/x-security-oauth2-auth.test.ts.snap index 3bf0e5ff75..69cc501081 100644 --- a/tests/e2e/respect/x-security-oauth2-auth/__snapshots__/x-security-oauth2-auth.test.ts.snap +++ b/tests/e2e/respect/x-security-oauth2-auth/__snapshots__/x-security-oauth2-auth.test.ts.snap @@ -5,25 +5,33 @@ exports[`should make request with Authorization header \`Bearer ...\` using OAut Running workflow x-security-oauth2-auth.arazzo.yaml / oauth2-auth-workflow - ✓ GET /museum-hours - step step-with-oauth2-auth-scheme + ✓ GET /menu - step step-with-oauth2-auth-scheme -    Request URL: https://redocly.com/_mock/demo/openapi/museum-api/museum-hours +    Request URL: https://api.cafe.redocly.com/menu?search=mermaid-treasure-latte     Request Headers:       accept: application/json, application/problem+json       authorization: Bearer ******** -    Response status code: 400 +    Response status code: 200     Response time: ms     Response Headers:     Response Size: bytes     Response Body:       { -       "type": "object", -       "title": "Not authenticated. Supported authentication types: MuseumPlaceholderAuth." +       "object": "list", +       "page": { +       "startCursor": null, +       "endCursor": null, +       "hasNextPage": false, +       "hasPrevPage": false, +       "limit": 10, +       "total": 0 +       }, +       "items": []       } -    ✓ status code check - $statusCode in [200, 400, 404] +    ✓ status code check - $statusCode in [200, 400, 500]     ✓ content-type check     ✓ schema check diff --git a/tests/e2e/respect/x-security-oauth2-auth/x-security-oauth2-auth.arazzo.yaml b/tests/e2e/respect/x-security-oauth2-auth/x-security-oauth2-auth.arazzo.yaml index e9ca4786f4..0e517801d3 100644 --- a/tests/e2e/respect/x-security-oauth2-auth/x-security-oauth2-auth.arazzo.yaml +++ b/tests/e2e/respect/x-security-oauth2-auth/x-security-oauth2-auth.arazzo.yaml @@ -1,12 +1,12 @@ arazzo: 1.0.1 info: - title: Redocly Museum API + title: X-Security OAuth2 auth version: 1.0.0 sourceDescriptions: - - name: museum-api + - name: cafe-api type: openapi - url: ../museum-api.yaml + url: ../cafe-api.yaml workflows: - workflowId: oauth2-auth-workflow @@ -17,7 +17,11 @@ workflows: type: string steps: - stepId: step-with-oauth2-auth-scheme - operationId: getMuseumHours + operationId: listMenuItems + parameters: + - in: query + name: search + value: mermaid-treasure-latte x-security: - scheme: type: oauth2 diff --git a/tests/e2e/respect/x-security-on-workflow-level-merged-to-steps/__snapshots__/x-security-on-workflow-level-merged-to-steps.test.ts.snap b/tests/e2e/respect/x-security-on-workflow-level-merged-to-steps/__snapshots__/x-security-on-workflow-level-merged-to-steps.test.ts.snap index 27953b05fe..96265ae508 100644 --- a/tests/e2e/respect/x-security-on-workflow-level-merged-to-steps/__snapshots__/x-security-on-workflow-level-merged-to-steps.test.ts.snap +++ b/tests/e2e/respect/x-security-on-workflow-level-merged-to-steps/__snapshots__/x-security-on-workflow-level-merged-to-steps.test.ts.snap @@ -5,9 +5,9 @@ exports[`should merge x-security schemes on workflow level to steps 1`] = ` Running workflow x-security-on-workflow-level-merged-to-steps.arazzo.yaml / basic-auth-workflow - ✓ GET /museum-hours - step step-with-basic-auth-scheme + ✓ GET /menu - step step-with-basic-auth-scheme -    Request URL: https://redocly.com/_mock/demo/openapi/museum-api/museum-hours +    Request URL: https://api.cafe.redocly.com/menu?search=mermaid-treasure-latte     Request Headers:       accept: application/json, application/problem+json       authorization: Basic ******** @@ -18,102 +18,57 @@ exports[`should merge x-security schemes on workflow level to steps 1`] = `     Response Headers:     Response Size: bytes     Response Body: -      [ -       { -       "date": "2023-09-11", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-12", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-13", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-14", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-15", -       "timeOpen": "10:00", -       "timeClose": "16:00" -       }, -       { -       "date": "2023-09-18", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-19", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-20", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-21", -       "timeOpen": "09:00", -       "timeClose": "18:00" +      { +       "object": "list", +       "page": { +       "startCursor": null, +       "endCursor": null, +       "hasNextPage": false, +       "hasPrevPage": false, +       "limit": 10, +       "total": 0        }, -       { -       "date": "2023-09-22", -       "timeOpen": "10:00", -       "timeClose": "16:00" -       } -      ] +       "items": [] +      } -    ✓ status code check - $statusCode in [200, 400, 404] +    ✓ status code check - $statusCode in [200, 400, 500]     ✓ content-type check     ✓ schema check - ✓ POST /special-events - step step-with-basic-auth-scheme-2 + ✓ POST /orders - step step-with-basic-auth-scheme-2 -    Request URL: https://redocly.com/_mock/demo/openapi/museum-api/special-events +    Request URL: https://api.cafe.redocly.com/orders     Request Headers:       content-type: application/json       accept: application/json, application/problem+json       authorization: Basic ********     Request Body:       { -       "name": "Mermaid Treasure Identification and Analysis", -       "location": "Under the seaaa 🦀 🎶 🌊.", -       "eventDescription": "Join us as we review and classify a rare collection of 20 thingamabobs, gadgets, gizmos, whoosits, and whatsits, kindly donated by Ariel.", -       "dates": [ -       "2025-01-01", -       "2025-01-02" -       ], -       "price": 0 +       "customerName": "Mary Ann", +       "orderItems": [ +       { +       "menuItemId": "prd_0000000000seedtrams0000000", +       "quantity": 2, +       "comment": "No sugar!" +       } +       ]       } -    Response status code: 201 +    Response status code: 401     Response time: ms     Response Headers:     Response Size: bytes     Response Body:       { -       "eventId": "dad4bce8-f5cb-4078-a211-995864315e39", -       "name": "Mermaid Treasure Identification and Analysis", -       "location": "Under the seaaa 🦀 🎶 🌊.", -       "eventDescription": "Join us as we review and classify a rare collection of 20 thingamabobs, gadgets, gizmos, whoosits, and whatsits, kindly donated by Ariel.", -       "dates": [ -       "2025-01-01", -       "2025-01-02" -       ], -       "price": 0 +       "type": "about:blank", +       "title": "Unauthorized", +       "status": 401, +       "instance": "/orders"       } -    ✓ success criteria check - $statusCode == 201 -    ✓ status code check - $statusCode in [201, 400, 404] +    ✓ success criteria check - $statusCode == 401 +    ✓ status code check - $statusCode in [201, 400, 401, 403, 500]     ✓ content-type check     ✓ schema check diff --git a/tests/e2e/respect/x-security-on-workflow-level-merged-to-steps/x-security-on-workflow-level-merged-to-steps.arazzo.yaml b/tests/e2e/respect/x-security-on-workflow-level-merged-to-steps/x-security-on-workflow-level-merged-to-steps.arazzo.yaml index 3bc7e6fa21..9fb6fd6fe1 100644 --- a/tests/e2e/respect/x-security-on-workflow-level-merged-to-steps/x-security-on-workflow-level-merged-to-steps.arazzo.yaml +++ b/tests/e2e/respect/x-security-on-workflow-level-merged-to-steps/x-security-on-workflow-level-merged-to-steps.arazzo.yaml @@ -1,12 +1,12 @@ arazzo: 1.0.1 info: - title: Redocly Museum API + title: X-Security on workflow level merged to steps version: 1.0.0 sourceDescriptions: - - name: museum-api + - name: cafe-api type: openapi - url: ../museum-api.yaml + url: ../cafe-api.yaml workflows: - workflowId: basic-auth-workflow @@ -25,17 +25,19 @@ workflows: default: some-password steps: - stepId: step-with-basic-auth-scheme - operationId: getMuseumHours + operationId: listMenuItems + parameters: + - in: query + name: search + value: mermaid-treasure-latte - stepId: step-with-basic-auth-scheme-2 - operationId: createSpecialEvent + operationId: createOrder requestBody: payload: - name: 'Mermaid Treasure Identification and Analysis' - location: 'Under the seaaa 🦀 🎶 🌊.' - eventDescription: 'Join us as we review and classify a rare collection of 20 thingamabobs, gadgets, gizmos, whoosits, and whatsits, kindly donated by Ariel.' - dates: - - 2025-01-01 - - 2025-01-02 - price: 0 + customerName: Mary Ann + orderItems: + - menuItemId: prd_0000000000seedtrams0000000 + quantity: 2 + comment: No sugar! successCriteria: - - condition: $statusCode == 201 + - condition: $statusCode == 401 diff --git a/tests/e2e/respect/x-security-open-id-connect-auth/__snapshots__/x-security-open-id-connect-auth.test.ts.snap b/tests/e2e/respect/x-security-open-id-connect-auth/__snapshots__/x-security-open-id-connect-auth.test.ts.snap index 788eea139c..476eb4d762 100644 --- a/tests/e2e/respect/x-security-open-id-connect-auth/__snapshots__/x-security-open-id-connect-auth.test.ts.snap +++ b/tests/e2e/respect/x-security-open-id-connect-auth/__snapshots__/x-security-open-id-connect-auth.test.ts.snap @@ -5,25 +5,33 @@ exports[`should make request with Authorization header \`Bearer ...\` using Open Running workflow x-security-open-id-connect-auth.arazzo.yaml / open-id-connect-auth-workflow - ✓ GET /museum-hours - step step-with-open-id-connect-auth-scheme + ✓ GET /menu - step step-with-open-id-connect-auth-scheme -    Request URL: https://redocly.com/_mock/demo/openapi/museum-api/museum-hours +    Request URL: https://api.cafe.redocly.com/menu?search=mermaid-treasure-latte     Request Headers:       accept: application/json, application/problem+json       authorization: Bearer ******** -    Response status code: 400 +    Response status code: 200     Response time: ms     Response Headers:     Response Size: bytes     Response Body:       { -       "type": "object", -       "title": "Not authenticated. Supported authentication types: MuseumPlaceholderAuth." +       "object": "list", +       "page": { +       "startCursor": null, +       "endCursor": null, +       "hasNextPage": false, +       "hasPrevPage": false, +       "limit": 10, +       "total": 0 +       }, +       "items": []       } -    ✓ status code check - $statusCode in [200, 400, 404] +    ✓ status code check - $statusCode in [200, 400, 500]     ✓ content-type check     ✓ schema check diff --git a/tests/e2e/respect/x-security-open-id-connect-auth/x-security-open-id-connect-auth.arazzo.yaml b/tests/e2e/respect/x-security-open-id-connect-auth/x-security-open-id-connect-auth.arazzo.yaml index 34f06c0015..e27f2b0720 100644 --- a/tests/e2e/respect/x-security-open-id-connect-auth/x-security-open-id-connect-auth.arazzo.yaml +++ b/tests/e2e/respect/x-security-open-id-connect-auth/x-security-open-id-connect-auth.arazzo.yaml @@ -1,12 +1,12 @@ arazzo: 1.0.1 info: - title: Redocly Museum API + title: X-Security OpenID Connect auth version: 1.0.0 sourceDescriptions: - - name: museum-api + - name: cafe-api type: openapi - url: ../museum-api.yaml + url: ../cafe-api.yaml workflows: - workflowId: open-id-connect-auth-workflow @@ -17,7 +17,11 @@ workflows: type: string steps: - stepId: step-with-open-id-connect-auth-scheme - operationId: getMuseumHours + operationId: listMenuItems + parameters: + - in: query + name: search + value: mermaid-treasure-latte x-security: - scheme: type: openIdConnect diff --git a/tests/e2e/respect/x-security-resolve-scheme-name/__snapshots__/x-security-resolve-scheme-name.test.ts.snap b/tests/e2e/respect/x-security-resolve-scheme-name/__snapshots__/x-security-resolve-scheme-name.test.ts.snap index 876be8063d..3e2c78ba3b 100644 --- a/tests/e2e/respect/x-security-resolve-scheme-name/__snapshots__/x-security-resolve-scheme-name.test.ts.snap +++ b/tests/e2e/respect/x-security-resolve-scheme-name/__snapshots__/x-security-resolve-scheme-name.test.ts.snap @@ -3,14 +3,14 @@ exports[`should resolve securitySchemes described in x-security by schemeName 1`] = ` "──────────────────────────────────────────────────────────────────────────────── - Running workflow x-security-resolve-scheme-name.arazzo.yaml / events-crud + Running workflow x-security-resolve-scheme-name.arazzo.yaml / menu-items - ✓ GET /museum-hours - step apply-basic-auth-scheme-when-step-has-operationId + ✓ GET /menu - step apply-oauth2-scheme-when-step-has-operationId -    Request URL: https://redocly.com/_mock/demo/openapi/museum-api/museum-hours +    Request URL: https://api.cafe.redocly.com/menu?search=mermaid-treasure-latte     Request Headers:       accept: application/json, application/problem+json -      authorization: Basic ******** +      authorization: Bearer ********     Response status code: 200 @@ -18,69 +18,29 @@ exports[`should resolve securitySchemes described in x-security by schemeName 1`     Response Headers:     Response Size: bytes     Response Body: -      [ -       { -       "date": "2023-09-11", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-12", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-13", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-14", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-15", -       "timeOpen": "10:00", -       "timeClose": "16:00" -       }, -       { -       "date": "2023-09-18", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-19", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-20", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-21", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-22", -       "timeOpen": "10:00", -       "timeClose": "16:00" -       } -      ] +      { +       "object": "list", +       "page": { +       "startCursor": null, +       "endCursor": null, +       "hasNextPage": false, +       "hasPrevPage": false, +       "limit": 10, +       "total": 0 +       }, +       "items": [] +      } -    ✓ status code check - $statusCode in [200, 400, 404] +    ✓ status code check - $statusCode in [200, 400, 500]     ✓ content-type check     ✓ schema check - ✓ GET /museum-hours - step apply-basic-auth-scheme-when-step-has-operationPath + ✓ GET /menu - step apply-api-key-scheme-when-step-has-operationPath -    Request URL: https://redocly.com/_mock/demo/openapi/museum-api/museum-hours +    Request URL: https://api.cafe.redocly.com/menu?search=mermaid-treasure-latte     Request Headers:       accept: application/json, application/problem+json -      authorization: Basic ******** +      x-api-key: ********     Response status code: 200 @@ -88,60 +48,20 @@ exports[`should resolve securitySchemes described in x-security by schemeName 1`     Response Headers:     Response Size: bytes     Response Body: -      [ -       { -       "date": "2023-09-11", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-12", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-13", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-14", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-15", -       "timeOpen": "10:00", -       "timeClose": "16:00" -       }, -       { -       "date": "2023-09-18", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-19", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-20", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-21", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-22", -       "timeOpen": "10:00", -       "timeClose": "16:00" -       } -      ] +      { +       "object": "list", +       "page": { +       "startCursor": null, +       "endCursor": null, +       "hasNextPage": false, +       "hasPrevPage": false, +       "limit": 10, +       "total": 0 +       }, +       "items": [] +      } -    ✓ status code check - $statusCode in [200, 400, 404] +    ✓ status code check - $statusCode in [200, 400, 500]     ✓ content-type check     ✓ schema check diff --git a/tests/e2e/respect/x-security-resolve-scheme-name/x-security-resolve-scheme-name.arazzo.yaml b/tests/e2e/respect/x-security-resolve-scheme-name/x-security-resolve-scheme-name.arazzo.yaml index d68182b8e6..d87077aa9b 100644 --- a/tests/e2e/respect/x-security-resolve-scheme-name/x-security-resolve-scheme-name.arazzo.yaml +++ b/tests/e2e/respect/x-security-resolve-scheme-name/x-security-resolve-scheme-name.arazzo.yaml @@ -1,32 +1,38 @@ arazzo: 1.0.1 info: - title: Redocly Museum API + title: X-Security resolve scheme name version: 1.0.0 sourceDescriptions: - - name: museum-api + - name: cafe-api type: openapi - url: ../museum-api.yaml + url: ../cafe-api.yaml workflows: - - workflowId: events-crud + - workflowId: menu-items inputs: type: object properties: secret: type: string steps: - - stepId: apply-basic-auth-scheme-when-step-has-operationId - operationId: getMuseumHours + - stepId: apply-oauth2-scheme-when-step-has-operationId + operationId: listMenuItems + parameters: + - in: query + name: search + value: mermaid-treasure-latte x-security: - - schemeName: MuseumPlaceholderAuth + - schemeName: OAuth2 values: - username: John - password: $inputs.secret - - stepId: apply-basic-auth-scheme-when-step-has-operationPath - operationPath: '{$sourceDescriptions.museum-api.url}#/paths/~1museum-hours/get' + accessToken: $inputs.secret + - stepId: apply-api-key-scheme-when-step-has-operationPath + operationPath: '{$sourceDescriptions.cafe-api.url}#/paths/~1menu/get' + parameters: + - in: query + name: search + value: mermaid-treasure-latte x-security: - - schemeName: MuseumPlaceholderAuth + - schemeName: ApiKey values: - username: John - password: $inputs.secret + apiKey: $inputs.secret diff --git a/tests/e2e/respect/x-security-scheme-apply-order/__snapshots__/x-security-scheme-apply-order.test.ts.snap b/tests/e2e/respect/x-security-scheme-apply-order/__snapshots__/x-security-scheme-apply-order.test.ts.snap index d284bb05a5..04d5a01648 100644 --- a/tests/e2e/respect/x-security-scheme-apply-order/__snapshots__/x-security-scheme-apply-order.test.ts.snap +++ b/tests/e2e/respect/x-security-scheme-apply-order/__snapshots__/x-security-scheme-apply-order.test.ts.snap @@ -3,11 +3,11 @@ exports[`should apply x-security schemes in Top-Down order, the Last one have bigger priority 1`] = ` "──────────────────────────────────────────────────────────────────────────────── - Running workflow x-security-scheme-apply-order.arazzo.yaml / events-crud + Running workflow x-security-scheme-apply-order.arazzo.yaml / menu-items - ✓ GET /museum-hours - step get-museum-hours + ✓ GET /menu - step get-menu-items -    Request URL: https://redocly.com/_mock/demo/openapi/museum-api/museum-hours +    Request URL: https://api.cafe.redocly.com/menu?search=mermaid-treasure-latte     Request Headers:       accept: application/json, application/problem+json       authorization: Basic ******** @@ -20,61 +20,21 @@ exports[`should apply x-security schemes in Top-Down order, the Last one have bi     Response Headers:     Response Size: bytes     Response Body: -      [ -       { -       "date": "2023-09-11", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-12", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-13", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-14", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-15", -       "timeOpen": "10:00", -       "timeClose": "16:00" -       }, -       { -       "date": "2023-09-18", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-19", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-20", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-21", -       "timeOpen": "09:00", -       "timeClose": "18:00" -       }, -       { -       "date": "2023-09-22", -       "timeOpen": "10:00", -       "timeClose": "16:00" -       } -      ] +      { +       "object": "list", +       "page": { +       "startCursor": null, +       "endCursor": null, +       "hasNextPage": false, +       "hasPrevPage": false, +       "limit": 10, +       "total": 0 +       }, +       "items": [] +      }     ✓ success criteria check - $statusCode == 200 -    ✓ status code check - $statusCode in [200, 400, 404] +    ✓ status code check - $statusCode in [200, 400, 500]     ✓ content-type check     ✓ schema check diff --git a/tests/e2e/respect/x-security-scheme-apply-order/x-security-scheme-apply-order.arazzo.yaml b/tests/e2e/respect/x-security-scheme-apply-order/x-security-scheme-apply-order.arazzo.yaml index 155fbd6fa7..2475b0e9fb 100644 --- a/tests/e2e/respect/x-security-scheme-apply-order/x-security-scheme-apply-order.arazzo.yaml +++ b/tests/e2e/respect/x-security-scheme-apply-order/x-security-scheme-apply-order.arazzo.yaml @@ -1,15 +1,15 @@ arazzo: 1.0.1 info: - title: Redocly Museum API + title: X-Security scheme apply order version: 1.0.0 sourceDescriptions: - - name: museum-api + - name: cafe-api type: openapi - url: ../museum-api.yaml + url: ../cafe-api.yaml workflows: - - workflowId: events-crud + - workflowId: menu-items x-security: - scheme: type: http @@ -39,17 +39,19 @@ workflows: name: Authorization value: workflow-authorization-header steps: - - stepId: get-museum-hours - operationId: museum-api.getMuseumHours + - stepId: get-menu-items + operationId: cafe-api.listMenuItems parameters: - in: header name: Authorization value: step-authorization-header + - in: query + name: search + value: mermaid-treasure-latte x-security: - - schemeName: MuseumPlaceholderAuth + - schemeName: OAuth2 values: - username: will-be-overridden-by-the-next-scheme - password: $inputs.secret + accessToken: will-be-overridden-by-the-next-scheme - scheme: type: oauth2 flows: