Skip to content

Commit

Permalink
make schema adhere to openapi 3.0
Browse files Browse the repository at this point in the history
(we were using 3.1 draft, or respectivly a more up to date json schema)
 see: OAI/OpenAPI-Specification#1977
  • Loading branch information
DanielHabenicht committed Apr 26, 2020
1 parent 3490261 commit 96ebea6
Show file tree
Hide file tree
Showing 2 changed files with 263 additions and 131 deletions.
170 changes: 135 additions & 35 deletions openapi/components/schemas/questionnaire.json
Expand Up @@ -26,6 +26,7 @@
},
"NumericQuestion": {
"additionalProperties": false,
"description": "Represents a question with numeric answer.",
"properties": {
"details": {
"description": "Optional human-readable details or clarifiation about this question.",
Expand Down Expand Up @@ -56,6 +57,7 @@
}
},
"required": ["id", "text", "type"],
"title": "Numeric question",
"type": "object"
},
"Option": {
Expand Down Expand Up @@ -89,10 +91,12 @@
{
"$ref": "#/definitions/NumericQuestion"
}
]
],
"description": "Represents a single question of the questionnaire."
},
"QuestionWithOptions": {
"additionalProperties": false,
"description": "Represents a question with predefined answers to select.",
"properties": {
"details": {
"description": "Optional human-readable details or clarifiation about this question.",
Expand Down Expand Up @@ -346,23 +350,40 @@
"type": "object"
},
"LogicConstant": {
"type": "string"
"anyOf": [
{
"type": "number"
},
{
"type": "string"
},
{
"type": "boolean"
}
]
},
"LogicEquals": {
"additionalProperties": false,
"type": "object",
"properties": {
"==": {
"items": {
"$ref": "#/definitions/LogicExpression"
"anyOf": [
{
"$ref": "#/definitions/LogicExpression"
},
{
"$ref": "#/definitions/LogicExpression"
}
]
},
"maxItems": 2,
"minItems": 2,
"type": "array"
}
},
"required": ["=="],
"title": "LogicEquals"
"title": "LogicEquals",
"type": "object"
},
"LogicExpression": {
"anyOf": [
Expand All @@ -380,115 +401,170 @@
},
"LogicGreater": {
"additionalProperties": false,
"type": "object",
"properties": {
">": {
"items": {
"$ref": "#/definitions/LogicExpression"
"anyOf": [
{
"$ref": "#/definitions/LogicExpression"
},
{
"$ref": "#/definitions/LogicExpression"
}
]
},
"maxItems": 2,
"minItems": 2,
"type": "array"
}
},
"required": [">"],
"title": "LogicGreater"
"title": "LogicGreater",
"type": "object"
},
"LogicGreaterEqual": {
"additionalProperties": false,
"type": "object",
"properties": {
">=": {
"items": {
"$ref": "#/definitions/LogicExpression"
"anyOf": [
{
"$ref": "#/definitions/LogicExpression"
},
{
"$ref": "#/definitions/LogicExpression"
}
]
},
"maxItems": 2,
"minItems": 2,
"type": "array"
}
},
"required": [">="],
"title": "LogicGreaterEqual"
"title": "LogicGreaterEqual",
"type": "object"
},
"LogicIf": {
"additionalProperties": false,
"type": "object",
"properties": {
"if": {
"items": {
"$ref": "#/definitions/LogicExpression"
"anyOf": [
{
"$ref": "#/definitions/LogicExpression"
},
{
"$ref": "#/definitions/LogicExpression"
},
{
"$ref": "#/definitions/LogicExpression"
}
]
},
"maxItems": 3,
"minItems": 3,
"type": "array"
}
},
"required": ["if"],
"title": "LogicIf"
"title": "LogicIf",
"type": "object"
},
"LogicIn": {
"additionalProperties": false,
"type": "object",
"properties": {
"in": {
"items": {
"$ref": "#/definitions/LogicExpression"
"anyOf": [
{
"$ref": "#/definitions/LogicExpression"
},
{
"items": {
"$ref": "#/definitions/LogicExpression"
},
"type": "array"
}
]
},
"maxItems": 2,
"minItems": 2,
"type": "array"
}
},
"required": ["in"],
"title": "LogicIn"
"title": "LogicIn",
"type": "object"
},
"LogicLess": {
"additionalProperties": false,
"type": "object",
"properties": {
"<": {
"items": {
"$ref": "#/definitions/LogicExpression"
"anyOf": [
{
"$ref": "#/definitions/LogicExpression"
},
{
"$ref": "#/definitions/LogicExpression"
}
]
},
"maxItems": 2,
"minItems": 2,
"type": "array"
}
},
"required": ["<"],
"title": "LogicLess"
"title": "LogicLess",
"type": "object"
},
"LogicLessEqual": {
"additionalProperties": false,
"type": "object",
"properties": {
"<=": {
"items": {
"$ref": "#/definitions/LogicExpression"
"anyOf": [
{
"$ref": "#/definitions/LogicExpression"
},
{
"$ref": "#/definitions/LogicExpression"
}
]
},
"maxItems": 2,
"minItems": 2,
"type": "array"
}
},
"required": ["<="],
"title": "LogicLessEqual"
"title": "LogicLessEqual",
"type": "object"
},
"LogicMinus": {
"additionalProperties": false,
"type": "object",
"properties": {
"-": {
"items": {
"$ref": "#/definitions/LogicExpression"
"anyOf": [
{
"$ref": "#/definitions/LogicExpression"
},
{
"$ref": "#/definitions/LogicExpression"
}
]
},
"maxItems": 2,
"minItems": 2,
"type": "array"
}
},
"required": ["-"],
"title": "LogicMinus"
"title": "LogicMinus",
"type": "object"
},
"LogicNot": {
"additionalProperties": false,
Expand Down Expand Up @@ -573,51 +649,75 @@
},
"LogicPlus": {
"additionalProperties": false,
"type": "object",
"properties": {
"+": {
"items": {
"$ref": "#/definitions/LogicExpression"
"anyOf": [
{
"$ref": "#/definitions/LogicExpression"
},
{
"$ref": "#/definitions/LogicExpression"
}
]
},
"maxItems": 2,
"minItems": 2,
"type": "array"
}
},
"required": ["+"],
"title": "LogicPlus"
"title": "LogicPlus",
"type": "object"
},
"LogicReduce": {
"additionalProperties": false,
"type": "object",
"properties": {
"reduce": {
"items": {
"$ref": "#/definitions/LogicExpression"
"anyOf": [
{
"$ref": "#/definitions/LogicExpression"
},
{
"$ref": "#/definitions/LogicExpression"
},
{
"$ref": "#/definitions/LogicExpression"
}
]
},
"maxItems": 3,
"minItems": 3,
"type": "array"
}
},
"required": ["reduce"],
"title": "LogicReduce"
"title": "LogicReduce",
"type": "object"
},
"LogicSome": {
"additionalProperties": false,
"type": "object",
"properties": {
"some": {
"items": {
"$ref": "#/definitions/LogicExpression"
"anyOf": [
{
"$ref": "#/definitions/LogicExpression"
},
{
"$ref": "#/definitions/LogicExpression"
}
]
},
"maxItems": 2,
"minItems": 2,
"type": "array"
}
},
"required": ["some"],
"title": "LogicSome"
"title": "LogicSome",
"type": "object"
},
"LogicVariable": {
"additionalProperties": false,
Expand Down

0 comments on commit 96ebea6

Please sign in to comment.