Skip to content

Commit

Permalink
Merge pull request #2022 from aml-org/W-16246407-asyncjson
Browse files Browse the repository at this point in the history
W-16246407 - Fix handle of method string kind
  • Loading branch information
looseale committed Jul 18, 2024
2 parents fbc0c51 + 5fb9bf3 commit 3378c5a
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class Async20ConcreteOperationParser(entry: YMapEntry, adopt: Operation => Opera
override protected def parseMessages(map: YMap, operation: Operation): Unit = map.key(
"message",
messageEntry =>
AsyncHelper.messageType(entry.key.value.toString) foreach { msgType =>
AsyncHelper.messageType(entry.key.as[YScalar].text) foreach { msgType =>
val messages = AsyncMultipleMessageParser(messageEntry.value.as[YMap], operation.id, msgType).parse()
operation.fields
.setWithoutId(msgType.field, AmfArray(messages, Annotations(messageEntry.value)), Annotations(messageEntry))
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"asyncapi": "2.6.0",
"info": {
"title": "async-json",
"version": "1.0.0"
},
"channels": {
"CANCELLATIONS": {
"subscribe": {
"message": {
"payload": {
"type": "object",
"required": [
"orderid"
],
"properties": {
"orderid": {
"description": "id of the order that was cancelled",
"type": "string",
"format": "uuid"
}
}
},
"contentType": "application/json"
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
asyncapi: 2.6.0
info:
title: async-json
version: 1.0.0
channels:
CANCELLATIONS:
subscribe:
message:
payload:
type: object
required:
- orderid
properties:
orderid:
description: id of the order that was cancelled
type: string
format: uuid
contentType: application/json
Original file line number Diff line number Diff line change
Expand Up @@ -283,10 +283,15 @@ class Async20CycleTest extends FunSuiteCycleTests {
"bindings/solace-operation-queue-binding.yaml",
"bindings/solace-operation-queue-binding.yaml"
),
FixtureData(
FixtureData(
"solace binding 0.4.0 version",
"bindings/solace-0.4.0-version.yaml",
"bindings/solace-0.4.0-version.yaml"
),
FixtureData(
"JSON AsyncAPI",
"message-json.json",
"message-json.yaml"
)

// TODO: figure out why this test is commented out
Expand Down

0 comments on commit 3378c5a

Please sign in to comment.