-
-
Notifications
You must be signed in to change notification settings - Fork 101
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
fix: apply traits to standalone messages from components section #214
Merged
derberg
merged 21 commits into
asyncapi:master
from
c-pius:fix/apply-traits-to-standalone-messages
Jan 7, 2021
Merged
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
df0c326
fix: NOT YET WORKING apply traits to standalone messages
c-pius f4a59f5
applied linting rules
c-pius 7769b6e
updated output json 1
c-pius 7ebd02d
updated output json 2
c-pius c5e5ede
guard on components and components.messages
c-pius f190db1
test for asyncapi without components object
c-pius 148a2a4
Merge remote-tracking branch 'upstream/master' into fix/apply-traits-…
c-pius 7cb782e
fixed test to include anonymous schema ids in schema objects
c-pius fe01eb7
adding check for not validating messages twice
c-pius 88011c2
convert to string instead of disabling eslint
c-pius 069a0bf
Merge remote-tracking branch 'upstream/master' into fix/apply-traits-…
c-pius 9c71814
applying x-parser-original-schema-format in default parser
c-pius 207c80a
added comment on x-parser-original-schema-format
c-pius 6b4d8b8
default parser adding x-parser-original-payload
c-pius 341aa20
Revert "default parser adding x-parser-original-payload"
c-pius 5d191b0
Revert "added comment on x-parser-original-schema-format"
c-pius 159e574
Revert "applying x-parser-original-schema-format in default parser"
c-pius 8bb2263
added x-parser-message-parsed flag
c-pius ec9710c
Update lib/parser.js
c-pius e6acb00
Update lib/parser.js
c-pius 7b8db16
Update lib/parser.js
c-pius File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
asyncapi: 2.0.0 | ||
info: | ||
title: My API | ||
version: '1.0.0' | ||
|
||
channels: | ||
mychannel: | ||
publish: | ||
message: | ||
$ref: '#/components/messages/channelMessage' | ||
|
||
components: | ||
messages: | ||
channelMessage: | ||
traits: | ||
- $ref: '#/components/messageTraits/extension' | ||
testMessage: | ||
traits: | ||
- $ref: '#/components/messageTraits/extension' | ||
payload: | ||
$ref: '#/components/schemas/testSchema' | ||
schemas: | ||
testSchema: | ||
type: object | ||
properties: | ||
name: | ||
type: string | ||
messageTraits: | ||
extension: | ||
x-some-extension: 'some extension' | ||
headers: | ||
type: object | ||
properties: | ||
some-common-header: | ||
type: string |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
asyncapi: 2.0.0 | ||
info: | ||
title: My API | ||
version: '1.0.0' | ||
channels: {} | ||
|
||
components: | ||
messages: | ||
testMessage: | ||
traits: | ||
- $ref: '#/components/messageTraits/extension' | ||
payload: | ||
$ref: '#/components/schemas/testSchema' | ||
schemas: | ||
testSchema: | ||
type: object | ||
properties: | ||
name: | ||
type: string | ||
messageTraits: | ||
extension: | ||
x-some-extension: 'some extension' | ||
headers: | ||
type: object | ||
properties: | ||
some-common-header: | ||
type: string |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
asyncapi: 2.0.0 | ||
info: | ||
title: My API | ||
version: 1.0.0 | ||
channels: | ||
"/test/tester": | ||
subscribe: | ||
message: | ||
payload: | ||
type: object | ||
properties: | ||
name: | ||
type: string |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's only a question.
(xParserMessageParsed in msg) === true
will work?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in general yes,
if (xParserMessageParsed in msg)
would work as well as of now. the second check is to check whether the value ofx-parser-message-parsed
is also set to boolean value of true. if we omit this we would check the sheer presence of the flag and skip validation. would be okay for me as well. just thought the check for a boolean true value would make it more resilient