Skip to content
Draft
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions documentation/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Infrastructure / Support

Bugfixes
-----------
* Allow flex-model and flex-context to be missing from scheduling requests, because by now the whole flex-config can be defined on assets (in the db) instead [see `PR #2237 <https://www.github.com/FlexMeasures/flexmeasures/pull/2237>`_]


v0.33.0 | June 1, 2026
Expand Down
12 changes: 6 additions & 6 deletions flexmeasures/api/v3_0/assets.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def __init__(self, *args, **kwargs):

flex_context = fields.Nested(
flex_context_schema_openAPI,
required=True,
load_default={},
data_key="flex-context",
metadata=dict(
description="The flex-context is validated according to the scheduler's `FlexContextSchema`.",
Expand All @@ -107,11 +107,11 @@ def __init__(self, *args, **kwargs):
flex_model = fields.List(
fields.Nested(
storage_flex_model_schema_openAPI(exclude=["asset"]),
required=True,
data_key="flex-model",
metadata=dict(
description="Flex-model per device (identified by `sensor`). The flex-model validation is handled by the scheduler. What follows is the schema used by the `StorageScheduler`.",
),
),
load_default=[],
data_key="flex-model",
metadata=dict(
description="Flex-model per device (identified by `sensor`). The flex-model validation is handled by the scheduler. What follows is the schema used by the `StorageScheduler`.",
),
)

Expand Down
7 changes: 4 additions & 3 deletions flexmeasures/ui/static/openapi-specs.json
Original file line number Diff line number Diff line change
Expand Up @@ -6254,14 +6254,16 @@
"example": "PT2H",
"format": "duration"
},
"flex_model": {
"flex-model": {
"type": "array",
"default": [],
"description": "Flex-model per device (identified by `sensor`). The flex-model validation is handled by the scheduler. What follows is the schema used by the `StorageScheduler`.",
"items": {
"description": "Flex-model per device (identified by `sensor`). The flex-model validation is handled by the scheduler. What follows is the schema used by the `StorageScheduler`.",
"$ref": "#/components/schemas/StorageFlexModelSchemaOpenAPI"
}
},
"flex-context": {
"default": {},
"description": "The flex-context is validated according to the scheduler's `FlexContextSchema`.",
"$ref": "#/components/schemas/FlexContextOpenAPISchema"
},
Expand All @@ -6276,7 +6278,6 @@
}
},
"required": [
"flex-context",
"start"
],
"additionalProperties": false
Expand Down
Loading