Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
7 changes: 6 additions & 1 deletion .github/workflows/snapshot-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,14 @@ jobs:
# Update Core package version
jq ".version = \"$VERSION\"" packages/core/package.json > tmp.json && mv tmp.json packages/core/package.json

# Update CLI package version and the Core dependency
# Update Respect Core package version and dependencies
jq ".version = \"$VERSION\"" packages/respect-core/package.json > tmp.json && mv tmp.json packages/respect-core/package.json
jq ".dependencies[\"@redocly/openapi-core\"] = \"$VERSION\"" packages/respect-core/package.json > tmp.json && mv tmp.json packages/respect-core/package.json

# Update CLI package version and dependencies
jq ".version = \"$VERSION\"" packages/cli/package.json > tmp.json && mv tmp.json packages/cli/package.json
jq ".dependencies[\"@redocly/openapi-core\"] = \"$VERSION\"" packages/cli/package.json > tmp.json && mv tmp.json packages/cli/package.json
jq ".dependencies[\"@redocly/respect-core\"] = \"$VERSION\"" packages/cli/package.json > tmp.json && mv tmp.json packages/cli/package.json

# Add comment with installation instructions
COMMENT="📦 A new experimental version **v$VERSION** of Redocly CLI has been published for testing.
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
run: npm run e2e
env:
CI: true

SANDBOX_REBILLY_TOKEN: ${{ secrets.SANDBOX_REBILLY_TOKEN }}
cli-package-test:
runs-on: ubuntu-latest
steps:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ output/
*.tgz
redoc-static.html
packages/cli/README.md
.env
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ lib/
output/
*snapshot.js
packages/core/src/rules/__tests__/fixtures/invalid-yaml.yaml
packages/respect-core/src/modules/runtime-expressions/abnf-parser.js
__tests__/webpack-bundle/bundle-workflows/metafile.json
benchmark/api-definitions/
LICENSE.md
6 changes: 2 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,9 @@ To test local changes as a package, you can use the following steps:

1. Optionally, bump the version of the packages ([see details](#version-updating)).

1. Run `npm run pack:prepare` in the repository's root. This generates **redocly-cli.tgz** and **openapi-core.tgz** files and makes some changes to **packages/cli/package.json** file.
1. Run `npm run pack:prepare` in the repository's root. This generates **redocly-cli.tgz**, **respect-core.tgz**, and **openapi-core.tgz** files.

1. Copy **redocly-cli.tgz** file to a destination folder and then run `npm install redocly-cli.tgz` there to install Redocly CLI. To install `openapi-core` do the same but with **openapi-core.tgz** file.

Don't forget to revert the changes to **package.json** files later.
1. Copy those **.tgz** files to a destination folder and then run `npm install redocly-cli.tgz` there to install Redocly CLI. To install `openapi-core` do the same but with **openapi-core.tgz** file.

## Contribute documentation

Expand Down
3 changes: 2 additions & 1 deletion __tests__/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ type CLICommands =
| 'push'
| 'split'
| 'stats'
| 'build-docs';
| 'build-docs'
| 'respect';

export function getParams(
indexEntryPoint: string,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`should send in request and proceed case-insensitive headers in runtime expressions 1`] = `
"────────────────────────────────────────────────────────────────────────────────

Running workflow case-insensitive-headers.yaml / get-museum-hours

✓ GET /museum-hours - step get-museum-hours
    ✓ success criteria check
    ✓ success criteria check
    ✓ success criteria check
    ✓ status code check (Response code 200 matches one of description codes: [200, 400, 404])
    ✓ content-type check
    ✓ schema check


  Summary for case-insensitive-headers.yaml

  Workflows: 1 passed, 1 total
  Steps: 1 passed, 1 total
  Checks: 6 passed, 6 total
  Time: <test>ms


┌───────────────────────────────────────────────────────────────────────┬────────────┬─────────┬─────────┬──────────┬─────────┐
│ Filename │ Workflows │ Passed │ Failed │ Warnings │ Skipped │
├───────────────────────────────────────────────────────────────────────┼────────────┼─────────┼─────────┼──────────┼─────────┤
│ ✓ case-insensitive-headers.yaml │ 1 │ 1 │ - │ - │ - │
└───────────────────────────────────────────────────────────────────────┴────────────┴─────────┴─────────┴──────────┴─────────┘


"
`;
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { join } from 'path';
import { getCommandOutput, getParams } from '../utils';

test('should send in request and proceed case-insensitive headers in runtime expressions', () => {
const indexEntryPoint = join(process.cwd(), 'packages/cli/lib/index.js');
const fixturesPath = join(__dirname, 'case-insensitive-headers.yaml');
const args = getParams(indexEntryPoint, ['respect', fixturesPath]);

const result = getCommandOutput(args);
expect(result).toMatchSnapshot();
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
arazzo: 1.0.1
info:
title: Redocly Museum API
description: >-
Testing case insensitive headers in workflows
version: 1.0.0

sourceDescriptions:
- name: museum-api
type: openapi
url: museum-api.yaml

workflows:
- workflowId: get-museum-hours
description: >-
This workflow demonstrates how to get the museum opening hours and buy tickets.
parameters:
- in: header
name: Authorization
value: Basic Og==
steps:
- stepId: get-museum-hours
description: >-
Get museum hours by resolving request details with getMuseumHours operationId from museum-api.yaml description.
parameters:
- in: header
name: CammelCasedHeader
value: custom-header
- in: header
name: CoNtenT-Type
value: first
- in: header
name: ContenT-Type
value: second
- in: header
name: ContenT-TypE
value: third
operationId: museum-api.getMuseumHours
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'
Loading
Loading