diff --git a/.github/workflows/if-nodejs-pr-testing.yml b/.github/workflows/if-nodejs-pr-testing.yml index 66ea65528..462e61316 100644 --- a/.github/workflows/if-nodejs-pr-testing.yml +++ b/.github/workflows/if-nodejs-pr-testing.yml @@ -14,7 +14,9 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-latest, macos-latest, windows-latest] + # Using macos-13 instead of latest (macos-14) due to an issue with Puppeteer and such runner. + # See: https://github.com/puppeteer/puppeteer/issues/12327 and https://github.com/asyncapi/parser-js/issues/1001 + os: [ubuntu-latest, macos-13, windows-latest] steps: - if: > !github.event.pull_request.draft && !( diff --git a/.github/workflows/if-nodejs-release.yml b/.github/workflows/if-nodejs-release.yml index e578d9002..72d01de47 100644 --- a/.github/workflows/if-nodejs-release.yml +++ b/.github/workflows/if-nodejs-release.yml @@ -33,7 +33,9 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-latest, macos-latest, windows-latest] + # Using macos-13 instead of latest (macos-14) due to an issue with Puppeteer and such runner. + # See: https://github.com/puppeteer/puppeteer/issues/12327 and https://github.com/asyncapi/parser-js/issues/1001 + os: [ubuntu-latest, macos-13, windows-latest] steps: - name: Set git to use LF #to once and for all finish neverending fight between Unix and Windows run: | diff --git a/apps/parser/src/custom-operations/apply-traits.ts b/apps/parser/src/custom-operations/apply-traits.ts index 6d99453ff..1c2ff7ef0 100644 --- a/apps/parser/src/custom-operations/apply-traits.ts +++ b/apps/parser/src/custom-operations/apply-traits.ts @@ -51,11 +51,9 @@ function applyTraitsToObjectV2(value: Record) { const v3TraitPaths = [ // operations '$.operations.*', - '$.operations.*.channel.*', '$.operations.*.channel.messages.*', '$.operations.*.messages.*', '$.components.operations.*', - '$.components.operations.*.channel.*', '$.components.operations.*.channel.messages.*', '$.components.operations.*.messages.*', // Channels diff --git a/apps/parser/test/validate.spec.ts b/apps/parser/test/validate.spec.ts index 6a3458518..60b85730a 100644 --- a/apps/parser/test/validate.spec.ts +++ b/apps/parser/test/validate.spec.ts @@ -51,4 +51,47 @@ describe('validate()', function() { expect(hasErrorDiagnostic(diagnostics)).toEqual(false); expect(hasWarningDiagnostic(diagnostics)).toEqual(true); }); + + // See https://github.com/asyncapi/parser-js/issues/996 + it('user case - null channel address should not make operation traits appliance fail', async function() { + const documentRaw = { + asyncapi: '3.0.0', + info: { + title: 'Nexus Server API', + version: '1.0.0' + }, + channels: { + Exchange: { + address: null, + messages: { + FooEvent: { + name: 'FooEvent', + title: 'Tenant Created', + contentType: 'application/json', + payload: { + type: 'string' + } + } + } + } + }, + operations: { + sendTenantCreated: { + title: 'Send tenant created event to client', + action: 'send', + channel: { + $ref: '#/channels/Exchange' + }, + messages: [ + { + $ref: '#/channels/Exchange/messages/FooEvent' + } + ] + } + } + }; + const { document, diagnostics } = await parser.parse(documentRaw, { validateOptions: { allowedSeverity: { warning: false } } }); + console.log(diagnostics); + expect(diagnostics).toHaveLength(0); + }); });