Skip to content

Commit ee8dffd

Browse files
author
Jens Kürten
committed
Merge branch 'main' of github.com:cslab/functions-sdk-python
2 parents 7c65033 + 20b514c commit ee8dffd

File tree

6 files changed

+140
-125
lines changed

6 files changed

+140
-125
lines changed

csfunctions/devserver.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
import os
3636
import time
3737
from collections.abc import Iterable
38-
from wsgiref.types import StartResponse, WSGIEnvironment
3938

4039
from werkzeug.serving import run_simple
4140
from werkzeug.wrappers import Request, Response
@@ -128,7 +127,7 @@ def handle_request(request: Request) -> Response:
128127
return Response(response, content_type="application/json")
129128

130129

131-
def application(environ: WSGIEnvironment, start_response: StartResponse) -> Iterable[bytes]:
130+
def application(environ, start_response) -> Iterable[bytes]:
132131
request = Request(environ)
133132
response = handle_request(request)
134133
return response(environ, start_response)

csfunctions/objects/document.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from contextlib import suppress
21
from datetime import date, datetime
32
from typing import TYPE_CHECKING, Literal, Optional
43

@@ -8,9 +7,7 @@
87

98
from .base import BaseObject, ObjectType
109
from .file import File
11-
12-
with suppress(ImportError):
13-
from .part import Part
10+
from .part import Part
1411

1512
if TYPE_CHECKING:
1613
from csfunctions.events import EventData
@@ -99,3 +96,6 @@ class CADDocument(Document):
9996
"""
10097

10198
object_type: Literal[ObjectType.CAD_DOCUMENT] = ObjectType.CAD_DOCUMENT # type: ignore[assignment]
99+
100+
101+
Part.model_rebuild()

csfunctions/objects/part.py

-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from contextlib import suppress
21
from datetime import date, datetime
32
from typing import TYPE_CHECKING, Literal, Optional
43

@@ -11,7 +10,6 @@
1110
if TYPE_CHECKING:
1211
from csfunctions.events import EventData
1312

14-
with suppress(ImportError):
1513
from .document import Document
1614

1715

json_schemas/data_response.json

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"type": "string"
1212
},
1313
"data": {
14+
"additionalProperties": true,
1415
"description": "Data that should be returned.",
1516
"title": "Data",
1617
"type": "object"

json_schemas/request.json

+3
Original file line numberDiff line numberDiff line change
@@ -1514,14 +1514,17 @@
15141514
"FieldValueCalculationData": {
15151515
"properties": {
15161516
"scheme_updates": {
1517+
"additionalProperties": true,
15171518
"title": "Scheme Updates",
15181519
"type": "object"
15191520
},
15201521
"ctx": {
1522+
"additionalProperties": true,
15211523
"title": "Ctx",
15221524
"type": "object"
15231525
},
15241526
"obj": {
1527+
"additionalProperties": true,
15251528
"title": "Obj",
15261529
"type": "object"
15271530
},

0 commit comments

Comments
 (0)