1269
1269
"type" : " string"
1270
1270
}
1271
1271
},
1272
+ "io.github.springwolf.examples.kafka.dtos.discriminator.EnginePower" : {
1273
+ "title" : " EnginePower" ,
1274
+ "type" : " object" ,
1275
+ "properties" : {
1276
+ "hp" : {
1277
+ "type" : " integer" ,
1278
+ "format" : " int32"
1279
+ },
1280
+ "torque" : {
1281
+ "type" : " integer" ,
1282
+ "format" : " int32"
1283
+ }
1284
+ },
1285
+ "examples" : [
1286
+ {
1287
+ "hp" : 0 ,
1288
+ "torque" : 0
1289
+ }
1290
+ ],
1291
+ "x-json-schema" : {
1292
+ "$schema" : " https://json-schema.org/draft-04/schema#" ,
1293
+ "properties" : {
1294
+ "hp" : {
1295
+ "format" : " int32" ,
1296
+ "type" : " integer"
1297
+ },
1298
+ "torque" : { }
1299
+ },
1300
+ "title" : " EnginePower" ,
1301
+ "type" : " object"
1302
+ }
1303
+ },
1272
1304
"io.github.springwolf.examples.kafka.dtos.discriminator.VehicleBase" : {
1273
1305
"discriminator" : " vehicleType" ,
1274
1306
"title" : " VehicleBase" ,
1275
1307
"type" : " object" ,
1276
1308
"properties" : {
1309
+ "enginePower" : {
1310
+ "$ref" : " #/components/schemas/io.github.springwolf.examples.kafka.dtos.discriminator.EnginePower"
1311
+ },
1277
1312
"powerSource" : {
1278
1313
"type" : " string"
1279
1314
},
1288
1323
"description" : " Demonstrates the use of discriminator for polymorphic deserialization (not publishable)" ,
1289
1324
"examples" : [
1290
1325
{
1326
+ "batteryCapacity" : 0 ,
1327
+ "chargeTime" : 0 ,
1328
+ "enginePower" : {
1329
+ "hp" : 0 ,
1330
+ "torque" : 0
1331
+ },
1291
1332
"powerSource" : " string" ,
1292
1333
"topSpeed" : 0 ,
1293
1334
"vehicleType" : " string"
1294
1335
}
1295
1336
],
1337
+ "oneOf" : [
1338
+ {
1339
+ "$ref" : " #/components/schemas/io.github.springwolf.examples.kafka.dtos.discriminator.VehicleElectricPayloadDto"
1340
+ },
1341
+ {
1342
+ "$ref" : " #/components/schemas/io.github.springwolf.examples.kafka.dtos.discriminator.VehicleGasolinePayloadDto"
1343
+ }
1344
+ ],
1296
1345
"x-json-schema" : {
1297
1346
"$schema" : " https://json-schema.org/draft-04/schema#" ,
1298
1347
"description" : " Demonstrates the use of discriminator for polymorphic deserialization (not publishable)" ,
1348
+ "oneOf" : [
1349
+ {
1350
+ "allOf" : [
1351
+ { },
1352
+ {
1353
+ "properties" : {
1354
+ "batteryCapacity" : { },
1355
+ "chargeTime" : {
1356
+ "format" : " int32" ,
1357
+ "type" : " integer"
1358
+ }
1359
+ },
1360
+ "type" : " object"
1361
+ }
1362
+ ],
1363
+ "description" : " Electric vehicle implementation of VehicleBase" ,
1364
+ "type" : " object"
1365
+ },
1366
+ {
1367
+ "allOf" : [
1368
+ { },
1369
+ {
1370
+ "properties" : {
1371
+ "fuelCapacity" : { }
1372
+ },
1373
+ "type" : " object"
1374
+ }
1375
+ ],
1376
+ "description" : " Gasoline vehicle implementation of VehicleBase" ,
1377
+ "type" : " object"
1378
+ }
1379
+ ],
1299
1380
"properties" : {
1381
+ "enginePower" : {
1382
+ "properties" : {
1383
+ "hp" : { },
1384
+ "torque" : { }
1385
+ },
1386
+ "title" : " EnginePower" ,
1387
+ "type" : " object"
1388
+ },
1300
1389
"powerSource" : {
1301
1390
"type" : " string"
1302
1391
},
1303
- "topSpeed" : {
1304
- "format" : " int32" ,
1305
- "type" : " integer"
1306
- },
1392
+ "topSpeed" : { },
1307
1393
"vehicleType" : { }
1308
1394
},
1309
1395
"title" : " VehicleBase" ,
1317
1403
{
1318
1404
"batteryCapacity" : 0 ,
1319
1405
"chargeTime" : 0 ,
1406
+ "enginePower" : {
1407
+ "hp" : 0 ,
1408
+ "torque" : 0
1409
+ },
1320
1410
"powerSource" : " string" ,
1321
1411
"topSpeed" : 0 ,
1322
1412
"vehicleType" : " string"
1345
1435
"allOf" : [
1346
1436
{
1347
1437
"description" : " Demonstrates the use of discriminator for polymorphic deserialization (not publishable)" ,
1438
+ "oneOf" : [
1439
+ { },
1440
+ {
1441
+ "allOf" : [
1442
+ { },
1443
+ {
1444
+ "properties" : {
1445
+ "fuelCapacity" : {
1446
+ "format" : " int32" ,
1447
+ "type" : " integer"
1448
+ }
1449
+ },
1450
+ "type" : " object"
1451
+ }
1452
+ ],
1453
+ "description" : " Gasoline vehicle implementation of VehicleBase" ,
1454
+ "type" : " object"
1455
+ }
1456
+ ],
1348
1457
"properties" : {
1458
+ "enginePower" : {
1459
+ "properties" : {
1460
+ "hp" : { },
1461
+ "torque" : { }
1462
+ },
1463
+ "title" : " EnginePower" ,
1464
+ "type" : " object"
1465
+ },
1349
1466
"powerSource" : {
1350
1467
"type" : " string"
1351
1468
},
1352
- "topSpeed" : {
1353
- "format" : " int32" ,
1354
- "type" : " integer"
1355
- },
1469
+ "topSpeed" : { },
1356
1470
"vehicleType" : { }
1357
1471
},
1358
1472
"title" : " VehicleBase" ,
1375
1489
"description" : " Gasoline vehicle implementation of VehicleBase" ,
1376
1490
"examples" : [
1377
1491
{
1492
+ "enginePower" : {
1493
+ "hp" : 0 ,
1494
+ "torque" : 0
1495
+ },
1378
1496
"fuelCapacity" : 0 ,
1379
1497
"powerSource" : " string" ,
1380
1498
"topSpeed" : 0 ,
1400
1518
"allOf" : [
1401
1519
{
1402
1520
"description" : " Demonstrates the use of discriminator for polymorphic deserialization (not publishable)" ,
1521
+ "oneOf" : [
1522
+ {
1523
+ "allOf" : [
1524
+ { },
1525
+ {
1526
+ "properties" : {
1527
+ "batteryCapacity" : { },
1528
+ "chargeTime" : {
1529
+ "format" : " int32" ,
1530
+ "type" : " integer"
1531
+ }
1532
+ },
1533
+ "type" : " object"
1534
+ }
1535
+ ],
1536
+ "description" : " Electric vehicle implementation of VehicleBase" ,
1537
+ "type" : " object"
1538
+ },
1539
+ { }
1540
+ ],
1403
1541
"properties" : {
1542
+ "enginePower" : {
1543
+ "properties" : {
1544
+ "hp" : { },
1545
+ "torque" : { }
1546
+ },
1547
+ "title" : " EnginePower" ,
1548
+ "type" : " object"
1549
+ },
1404
1550
"powerSource" : {
1405
1551
"type" : " string"
1406
1552
},
1407
- "topSpeed" : {
1408
- "format" : " int32" ,
1409
- "type" : " integer"
1410
- },
1553
+ "topSpeed" : { },
1411
1554
"vehicleType" : { }
1412
1555
},
1413
1556
"title" : " VehicleBase" ,
2004
2147
]
2005
2148
}
2006
2149
}
2007
- }
2150
+ }
0 commit comments