Skip to content

Commit

Permalink
feat(rulesets): revert operationId changes
Browse files Browse the repository at this point in the history
  • Loading branch information
magicmatatjahu committed Sep 27, 2022
1 parent 633fbfa commit d4990cb
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
4 changes: 2 additions & 2 deletions docs/reference/asyncapi-rules.md
Expand Up @@ -261,7 +261,7 @@ channels:

### asyncapi-message-messageId

Each Message should have a "messageId" field defined. It is recommended, but still optional. Tools can use it to define function names, class method names and even URL passwords in documentation systems.
Each Message should have a "messageId" field defined. It is recommended, but still optional. Tools can use it to define function names, class method names and even URL hashes in documentation systems.

**Recommended:** Yes

Expand Down Expand Up @@ -303,7 +303,7 @@ channels:

### asyncapi-operation-operationId

Each Operation should have a "operationId" field defined. It is recommended, but still optional. Tools can use it to define function names, class method names and even URL passwords in documentation systems.
Each Operation must have an "operationId" field defined. Tools can use it to define function names, class method names and even URL hashes in documentation systems.

**Recommended:** Yes

Expand Down
Expand Up @@ -56,14 +56,14 @@ testRule('asyncapi-operation-operationId', [
},
errors: [
{
message: 'Operation should have a "operationId" field defined.',
message: 'Operation must have an "operationId" field defined.',
path: ['channels', 'one', 'publish'],
severity: DiagnosticSeverity.Warning,
severity: DiagnosticSeverity.Error,
},
{
message: 'Operation should have a "operationId" field defined.',
message: 'Operation must have an "operationId" field defined.',
path: ['channels', 'one', 'subscribe'],
severity: DiagnosticSeverity.Warning,
severity: DiagnosticSeverity.Error,
},
],
},
Expand All @@ -85,9 +85,9 @@ testRule('asyncapi-operation-operationId', [
},
errors: [
{
message: 'Operation should have a "operationId" field defined.',
message: 'Operation must have an "operationId" field defined.',
path: ['channels', 'one', 'publish'],
severity: DiagnosticSeverity.Warning,
severity: DiagnosticSeverity.Error,
},
],
},
Expand Down
5 changes: 3 additions & 2 deletions packages/rulesets/src/asyncapi/index.ts
Expand Up @@ -269,9 +269,10 @@ export default {
},
},
'asyncapi-operation-operationId': {
description: 'Operation should have a "operationId" field defined.',
description: 'Operation must have an "operationId" field defined.',
severity: 'error',
recommended: true,
type: 'style',
type: 'validation',
given: ['$.channels[*][publish,subscribe]', '$.components.channels[*][publish,subscribe]'],
then: {
function: asyncApi2CheckId,
Expand Down

0 comments on commit d4990cb

Please sign in to comment.