Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add another specialized exception to noun #35

Merged
merged 4 commits into from
Jun 27, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,24 @@ It's also possible to set it to `warn` or `info`.

The `extends` field is automatically added (or appended to) by the linter script to inject the iSP ruleset into your config.

### Local Development

1. Install `node 13.14.0` locally.
2. Run `npm run build` to compile the `isp-functions`.
3. Run `node ./entrypoint.js <PATH_TO_OPENAPI_SPEC>` to run the linter.

The `build` command may need to be re-run to pick up changes made to some of the `isp-functions`.

#### Tests

```sh
# Compile the isp-functions
npm run build

# Run test
npm run test
```

## License

Copyright © 2020 iStreamPlanet Co., LLC
Expand Down
26 changes: 26 additions & 0 deletions fixtures/lint/noun-pass.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,29 @@ paths:
responses:
'204':
description: Response description
/foos/{fooId}/bars/{barId}/preview/watch:
get:
summary: Test operation
description: Test operation description
operationId: test-preview
tags:
- Test
parameters:
- name: fooId
in: path
required: true
description: some parameter
schema:
type: string
pattern: /[a-z]+/
- name: barId
in: path
required: true
description: some parameter
schema:
type: string
pattern: /[a-z]+/
responses:
'204':
description: Response description

2 changes: 1 addition & 1 deletion isp-functions/noun-deps.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ module.exports = targetValue => {
// Split into path pieces ignoring blank/empty ones and params.
let pieces = targetValue.split('/').filter(i => !!i);

if ((pieces.length === 1 && pieces[0] === 'search') || pieces[0] === 'me' || pieces[0] === 'cust') {
if ((pieces.length === 1 && pieces[0] === 'search') || pieces[0] === 'me' || pieces[0] === 'cust' || pieces.length === 6 && pieces[4] === 'preview') {
iwong-isp marked this conversation as resolved.
Show resolved Hide resolved
// Top-level exceptions. Skip.
return;
}
Expand Down