Skip to content
Open
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
41 changes: 41 additions & 0 deletions schemas/json/calculation/calculation.schema.v1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"$id": "https://altinncdn.no/schemas/json/calculation/calculation.schema.v1.json",
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Altinn 3 Calculation",
"description": "Schema that describes the custom calculation configuration for Altinn applications.",
"type": "object",
"additionalProperties": false,
"properties": {
"$schema": {
"type": "string",
"title": "Schema",
"description": "The schema that this file adheres to"
},
"calculations": {
"type": "object",
"patternProperties": {
"^.+$": {
"type": "object",
"additionalProperties": false,
"properties": {
"expression": {
"title": "Expression returning any value",
"description": "The expression can return any value. The expression can contain references to other fields in the form.",
"anyOf": [
{ "$ref": "../layout/expression.schema.v1.json#/definitions/string" },
{ "$ref": "../layout/expression.schema.v1.json#/definitions/number" },
{ "$ref": "../layout/expression.schema.v1.json#/definitions/boolean" }
]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When synced into the monorepo, lists and objects should be added as well, I would think

}
},
"required": [
"expression"
]
}
}
}
},
"required": [
"calculations"
]
}