Skip to content

Commit 96ebea6

Browse files
make schema adhere to openapi 3.0
(we were using 3.1 draft, or respectivly a more up to date json schema) see: OAI/OpenAPI-Specification#1977
1 parent 3490261 commit 96ebea6

File tree

2 files changed

+263
-131
lines changed

2 files changed

+263
-131
lines changed

openapi/components/schemas/questionnaire.json

+135-35
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
},
2727
"NumericQuestion": {
2828
"additionalProperties": false,
29+
"description": "Represents a question with numeric answer.",
2930
"properties": {
3031
"details": {
3132
"description": "Optional human-readable details or clarifiation about this question.",
@@ -56,6 +57,7 @@
5657
}
5758
},
5859
"required": ["id", "text", "type"],
60+
"title": "Numeric question",
5961
"type": "object"
6062
},
6163
"Option": {
@@ -89,10 +91,12 @@
8991
{
9092
"$ref": "#/definitions/NumericQuestion"
9193
}
92-
]
94+
],
95+
"description": "Represents a single question of the questionnaire."
9396
},
9497
"QuestionWithOptions": {
9598
"additionalProperties": false,
99+
"description": "Represents a question with predefined answers to select.",
96100
"properties": {
97101
"details": {
98102
"description": "Optional human-readable details or clarifiation about this question.",
@@ -346,23 +350,40 @@
346350
"type": "object"
347351
},
348352
"LogicConstant": {
349-
"type": "string"
353+
"anyOf": [
354+
{
355+
"type": "number"
356+
},
357+
{
358+
"type": "string"
359+
},
360+
{
361+
"type": "boolean"
362+
}
363+
]
350364
},
351365
"LogicEquals": {
352366
"additionalProperties": false,
353-
"type": "object",
354367
"properties": {
355368
"==": {
356369
"items": {
357-
"$ref": "#/definitions/LogicExpression"
370+
"anyOf": [
371+
{
372+
"$ref": "#/definitions/LogicExpression"
373+
},
374+
{
375+
"$ref": "#/definitions/LogicExpression"
376+
}
377+
]
358378
},
359379
"maxItems": 2,
360380
"minItems": 2,
361381
"type": "array"
362382
}
363383
},
364384
"required": ["=="],
365-
"title": "LogicEquals"
385+
"title": "LogicEquals",
386+
"type": "object"
366387
},
367388
"LogicExpression": {
368389
"anyOf": [
@@ -380,115 +401,170 @@
380401
},
381402
"LogicGreater": {
382403
"additionalProperties": false,
383-
"type": "object",
384404
"properties": {
385405
">": {
386406
"items": {
387-
"$ref": "#/definitions/LogicExpression"
407+
"anyOf": [
408+
{
409+
"$ref": "#/definitions/LogicExpression"
410+
},
411+
{
412+
"$ref": "#/definitions/LogicExpression"
413+
}
414+
]
388415
},
389416
"maxItems": 2,
390417
"minItems": 2,
391418
"type": "array"
392419
}
393420
},
394421
"required": [">"],
395-
"title": "LogicGreater"
422+
"title": "LogicGreater",
423+
"type": "object"
396424
},
397425
"LogicGreaterEqual": {
398426
"additionalProperties": false,
399-
"type": "object",
400427
"properties": {
401428
">=": {
402429
"items": {
403-
"$ref": "#/definitions/LogicExpression"
430+
"anyOf": [
431+
{
432+
"$ref": "#/definitions/LogicExpression"
433+
},
434+
{
435+
"$ref": "#/definitions/LogicExpression"
436+
}
437+
]
404438
},
405439
"maxItems": 2,
406440
"minItems": 2,
407441
"type": "array"
408442
}
409443
},
410444
"required": [">="],
411-
"title": "LogicGreaterEqual"
445+
"title": "LogicGreaterEqual",
446+
"type": "object"
412447
},
413448
"LogicIf": {
414449
"additionalProperties": false,
415-
"type": "object",
416450
"properties": {
417451
"if": {
418452
"items": {
419-
"$ref": "#/definitions/LogicExpression"
453+
"anyOf": [
454+
{
455+
"$ref": "#/definitions/LogicExpression"
456+
},
457+
{
458+
"$ref": "#/definitions/LogicExpression"
459+
},
460+
{
461+
"$ref": "#/definitions/LogicExpression"
462+
}
463+
]
420464
},
421465
"maxItems": 3,
422466
"minItems": 3,
423467
"type": "array"
424468
}
425469
},
426470
"required": ["if"],
427-
"title": "LogicIf"
471+
"title": "LogicIf",
472+
"type": "object"
428473
},
429474
"LogicIn": {
430475
"additionalProperties": false,
431-
"type": "object",
432476
"properties": {
433477
"in": {
434478
"items": {
435-
"$ref": "#/definitions/LogicExpression"
479+
"anyOf": [
480+
{
481+
"$ref": "#/definitions/LogicExpression"
482+
},
483+
{
484+
"items": {
485+
"$ref": "#/definitions/LogicExpression"
486+
},
487+
"type": "array"
488+
}
489+
]
436490
},
437491
"maxItems": 2,
438492
"minItems": 2,
439493
"type": "array"
440494
}
441495
},
442496
"required": ["in"],
443-
"title": "LogicIn"
497+
"title": "LogicIn",
498+
"type": "object"
444499
},
445500
"LogicLess": {
446501
"additionalProperties": false,
447-
"type": "object",
448502
"properties": {
449503
"<": {
450504
"items": {
451-
"$ref": "#/definitions/LogicExpression"
505+
"anyOf": [
506+
{
507+
"$ref": "#/definitions/LogicExpression"
508+
},
509+
{
510+
"$ref": "#/definitions/LogicExpression"
511+
}
512+
]
452513
},
453514
"maxItems": 2,
454515
"minItems": 2,
455516
"type": "array"
456517
}
457518
},
458519
"required": ["<"],
459-
"title": "LogicLess"
520+
"title": "LogicLess",
521+
"type": "object"
460522
},
461523
"LogicLessEqual": {
462524
"additionalProperties": false,
463-
"type": "object",
464525
"properties": {
465526
"<=": {
466527
"items": {
467-
"$ref": "#/definitions/LogicExpression"
528+
"anyOf": [
529+
{
530+
"$ref": "#/definitions/LogicExpression"
531+
},
532+
{
533+
"$ref": "#/definitions/LogicExpression"
534+
}
535+
]
468536
},
469537
"maxItems": 2,
470538
"minItems": 2,
471539
"type": "array"
472540
}
473541
},
474542
"required": ["<="],
475-
"title": "LogicLessEqual"
543+
"title": "LogicLessEqual",
544+
"type": "object"
476545
},
477546
"LogicMinus": {
478547
"additionalProperties": false,
479-
"type": "object",
480548
"properties": {
481549
"-": {
482550
"items": {
483-
"$ref": "#/definitions/LogicExpression"
551+
"anyOf": [
552+
{
553+
"$ref": "#/definitions/LogicExpression"
554+
},
555+
{
556+
"$ref": "#/definitions/LogicExpression"
557+
}
558+
]
484559
},
485560
"maxItems": 2,
486561
"minItems": 2,
487562
"type": "array"
488563
}
489564
},
490565
"required": ["-"],
491-
"title": "LogicMinus"
566+
"title": "LogicMinus",
567+
"type": "object"
492568
},
493569
"LogicNot": {
494570
"additionalProperties": false,
@@ -573,51 +649,75 @@
573649
},
574650
"LogicPlus": {
575651
"additionalProperties": false,
576-
"type": "object",
577652
"properties": {
578653
"+": {
579654
"items": {
580-
"$ref": "#/definitions/LogicExpression"
655+
"anyOf": [
656+
{
657+
"$ref": "#/definitions/LogicExpression"
658+
},
659+
{
660+
"$ref": "#/definitions/LogicExpression"
661+
}
662+
]
581663
},
582664
"maxItems": 2,
583665
"minItems": 2,
584666
"type": "array"
585667
}
586668
},
587669
"required": ["+"],
588-
"title": "LogicPlus"
670+
"title": "LogicPlus",
671+
"type": "object"
589672
},
590673
"LogicReduce": {
591674
"additionalProperties": false,
592-
"type": "object",
593675
"properties": {
594676
"reduce": {
595677
"items": {
596-
"$ref": "#/definitions/LogicExpression"
678+
"anyOf": [
679+
{
680+
"$ref": "#/definitions/LogicExpression"
681+
},
682+
{
683+
"$ref": "#/definitions/LogicExpression"
684+
},
685+
{
686+
"$ref": "#/definitions/LogicExpression"
687+
}
688+
]
597689
},
598690
"maxItems": 3,
599691
"minItems": 3,
600692
"type": "array"
601693
}
602694
},
603695
"required": ["reduce"],
604-
"title": "LogicReduce"
696+
"title": "LogicReduce",
697+
"type": "object"
605698
},
606699
"LogicSome": {
607700
"additionalProperties": false,
608-
"type": "object",
609701
"properties": {
610702
"some": {
611703
"items": {
612-
"$ref": "#/definitions/LogicExpression"
704+
"anyOf": [
705+
{
706+
"$ref": "#/definitions/LogicExpression"
707+
},
708+
{
709+
"$ref": "#/definitions/LogicExpression"
710+
}
711+
]
613712
},
614713
"maxItems": 2,
615714
"minItems": 2,
616715
"type": "array"
617716
}
618717
},
619718
"required": ["some"],
620-
"title": "LogicSome"
719+
"title": "LogicSome",
720+
"type": "object"
621721
},
622722
"LogicVariable": {
623723
"additionalProperties": false,

0 commit comments

Comments
 (0)