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

W-15555945 - Fix SYAML conversion using casting with handling #1980

Merged
merged 1 commit into from
Apr 24, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class Async22EndpointParser(
map.key(
"servers",
entry => {
val nodes = entry.value.value.asInstanceOf[YSequence].nodes
val nodes = entry.value.as[YSequence].nodes
val servers = nodes.map { n =>
val server = Server()
server.setWithoutId(
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
asyncapi: 2.6.0
info:
title: Async 2.2 new fields
version: 1.0.0
description: Async 2.2 new fields
servers:
myServer:
url: some.com
protocol: ibmmq
bindings:
ibmmq:
groupId: test
ccdtQueueManagerName: test
cipherSpec: test
multiEndpointServer: true
heartBeatInterval: 123
channels:
myChannel:
servers:
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
ModelId: file://amf-cli/shared/src/test/resources/validations/async20/validations/async-server-map.yaml
Profile:
Conforms: false
Number of results: 1

Level: Violation

- Constraint: http://a.ml/vocabularies/amf/core#syaml-error
Message: YAML sequence expected
Severity: Violation
Target:
Property:
Range: [(19,12)-(19,12)]
Location: file://amf-cli/shared/src/test/resources/validations/async20/validations/async-server-map.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -484,4 +484,8 @@ class Async20UniquePlatformUnitValidationsTest extends UniquePlatformReportGenTe
test("Async Kafka channel binding validations") {
validate("kafka-channel-binding-validations.yaml", Some("kafka-channel-binding-validations.report"))
}

test("Async server invalid map") {
validate("async-server-map.yaml", Some("async-server-map.report"))
}
}