@@ -1304,5 +1304,89 @@ public void V2_SerializeV2_WithBindings_Serializes()
13041304
13051305 Assert . AreEqual ( "this mah binding" , httpBinding . Headers . Description ) ;
13061306 }
1307+
1308+ [ Test ]
1309+ public void V2_DocumentWithParameterReference_ResolvesToParameter ( )
1310+ {
1311+ var input = """
1312+ {
1313+ "asyncapi": "2.6.0",
1314+ "info": {
1315+ "title": "NikolajApi",
1316+ "description": "Trying to work with enum in parameter",
1317+ "contact": {
1318+ "url": "https://github.com/Nikolajls",
1319+ "name": "Nikolaj",
1320+ "email": "test@test.com"
1321+ },
1322+ "version": "0.0.1"
1323+ },
1324+ "servers": {
1325+ "integration-pulsar": {
1326+ "url": "pulsar+ssl://localhost:6651",
1327+ "protocol": "pulsar+ssl"
1328+ }
1329+ },
1330+ "channels": {
1331+ "v1.Room.{roomId}.Opened": {
1332+ "publish": {
1333+ "description": "Publish a message about a room being opened",
1334+ "operationId": "pub-room",
1335+ "message": {
1336+ "$ref": "#/components/messages/RoomOpened"
1337+ }
1338+ },
1339+ "parameters": {
1340+ "roomId": {
1341+ "schema": {
1342+ "$ref": "#/components/schemas/Rooms"
1343+ },
1344+ "description": "The ID of the room"
1345+ }
1346+ }
1347+ }
1348+ },
1349+ "components": {
1350+ "schemas": {
1351+ "RoomOpened": {
1352+ "type": "object",
1353+ "properties": {
1354+ "roomName": {
1355+ "type": "string",
1356+ "examples": [
1357+ "ABC"
1358+ ]
1359+ }
1360+ },
1361+ "additionalProperties": false
1362+ },
1363+ "Rooms": {
1364+ "enum": [
1365+ "123",
1366+ "245",
1367+ "678"
1368+ ],
1369+ "type": "string"
1370+ }
1371+ },
1372+ "messages": {
1373+ "RoomOpened": {
1374+ "name": "RoomOpened",
1375+ "summary": "Message indicating a room has been opened",
1376+ "contentType": "application/json",
1377+ "payload": {
1378+ "$ref": "#/components/schemas/RoomOpened"
1379+ }
1380+ }
1381+ }
1382+ }
1383+ }
1384+ """ ;
1385+
1386+ var document = new AsyncApiStringReader ( ) . Read ( input , out var diagnostic ) ;
1387+ diagnostic . Errors . Should ( ) . BeEmpty ( ) ;
1388+ diagnostic . Warnings . Should ( ) . BeEmpty ( ) ;
1389+ document . Channels . First ( ) . Value . Parameters . First ( ) . Value . Enum . Should ( ) . HaveCount ( 3 ) ;
1390+ }
13071391 }
13081392}
0 commit comments