Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
a2c2675
feat: add respect to cli
DmitryAnansky Feb 17, 2025
4fda722
chore: prettier
DmitryAnansky Feb 17, 2025
a7e9701
chore: changes to e2e and rename to respect-core
DmitryAnansky Feb 18, 2025
a5aff49
feat: remove respect auth
DmitryAnansky Feb 18, 2025
e055d03
fix: add ignored module
DmitryAnansky Feb 18, 2025
a0a9f18
chore: add files
DmitryAnansky Feb 18, 2025
7e2890e
fix: type issue in utils
DmitryAnansky Feb 18, 2025
f7f892f
fix: update all e2e tests
DmitryAnansky Feb 18, 2025
b25b578
chore: renaming
DmitryAnansky Feb 18, 2025
2c246fc
chore: fix and simplify go-to logic
RomanHotsiy Feb 18, 2025
c5c28af
chore: fix lint and unit tests
RomanHotsiy Feb 18, 2025
4c3e706
chore: fix e2e for new goto
RomanHotsiy Feb 18, 2025
f83a71a
chore: fix scripts to support respect-core
tatomyr Feb 18, 2025
aff6682
fix parser:generate
tatomyr Feb 18, 2025
70f6ed3
chore: rename ResultObject type
RomanHotsiy Feb 18, 2025
d146a22
chore: remove todos
DmitryAnansky Feb 18, 2025
ee96261
chore: sync package-lock
RomanHotsiy Feb 18, 2025
fb6a001
chore: fix some lint errors
RomanHotsiy Feb 18, 2025
344de08
chore: add secret
RomanHotsiy Feb 18, 2025
d4cf1e2
chore: prettier fix
DmitryAnansky Feb 18, 2025
014a5f9
chore: add abnf-parser to prettierignore
RomanHotsiy Feb 18, 2025
7bc8fb7
chore: publish respect-core snaphot to npm
tatomyr Feb 18, 2025
d7eacd5
chore: comment ignored e2e snapshot and update regexp
DmitryAnansky Feb 18, 2025
e76493a
fix: update cert regexp
DmitryAnansky Feb 18, 2025
2da48ec
chore: try fixing publish and yarn smokes
tatomyr Feb 18, 2025
e0d0b20
chore: try fixing publish
tatomyr Feb 18, 2025
7e6ff71
chore: try fixing publish and remove smokes for node 14 and 16
tatomyr Feb 18, 2025
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
  •  
  •  
  •  
26 changes: 0 additions & 26 deletions .github/workflows/smoke-plugins.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,29 +64,3 @@ jobs:
with:
node-version: 18
- run: bash ./__tests__/smoke-plugins/run-smoke.sh

run-smoke-plugins--npm--node-16:
needs: prepare-smoke-plugins
runs-on: ubuntu-latest
steps:
- uses: actions/cache@v3
with:
path: __tests__/smoke-plugins/
key: cache-plugins-${{ github.run_id }}-${{ github.run_attempt }}
- uses: actions/setup-node@v3
with:
node-version: 16
- run: bash ./__tests__/smoke-plugins/run-smoke.sh

run-smoke-plugins--npm--node-14:
needs: prepare-smoke-plugins
runs-on: ubuntu-latest
steps:
- uses: actions/cache@v3
with:
path: __tests__/smoke-plugins/
key: cache-plugins-${{ github.run_id }}-${{ github.run_attempt }}
- uses: actions/setup-node@v3
with:
node-version: 14
- run: bash ./__tests__/smoke-plugins/run-smoke.sh
13 changes: 12 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 Expand Up @@ -66,5 +71,11 @@ jobs:

cd packages/core
npm publish --tag snapshot
sleep 10

cd ../respect-core
npm publish --tag snapshot
sleep 10

cd ../cli
npm publish --tag snapshot
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