3939from ..dependencies .webserver_http import get_webserver_session
4040from ..dependencies .webserver_rpc import get_wb_api_rpc_client
4141from . import solvers_jobs , studies_jobs
42+ from ._constants import FMSG_CHANGELOG_NEW_IN_VERSION , create_route_description
4243from .function_jobs_routes import register_function_job
4344
4445# pylint: disable=too-many-arguments
5354 },
5455}
5556
57+ FIRST_RELEASE_VERSION = "0.8.0"
58+
5659
5760@function_router .post (
5861 "" ,
5962 response_model = RegisteredFunction ,
6063 responses = {** _COMMON_FUNCTION_ERROR_RESPONSES },
61- description = "Create function" ,
64+ description = create_route_description (
65+ base = "Create function" ,
66+ changelog = [
67+ FMSG_CHANGELOG_NEW_IN_VERSION .format (FIRST_RELEASE_VERSION ),
68+ ],
69+ ),
6270)
6371async def register_function (
6472 wb_api_rpc : Annotated [WbApiRpcClient , Depends (get_wb_api_rpc_client )],
@@ -71,7 +79,12 @@ async def register_function(
7179 "/{function_id:uuid}" ,
7280 response_model = RegisteredFunction ,
7381 responses = {** _COMMON_FUNCTION_ERROR_RESPONSES },
74- description = "Get function" ,
82+ description = create_route_description (
83+ base = "Get function" ,
84+ changelog = [
85+ FMSG_CHANGELOG_NEW_IN_VERSION .format (FIRST_RELEASE_VERSION ),
86+ ],
87+ ),
7588)
7689async def get_function (
7790 function_id : FunctionID ,
@@ -81,7 +94,14 @@ async def get_function(
8194
8295
8396@function_router .get (
84- "" , response_model = Page [RegisteredFunction ], description = "List functions"
97+ "" ,
98+ response_model = Page [RegisteredFunction ],
99+ description = create_route_description (
100+ base = "List functions" ,
101+ changelog = [
102+ FMSG_CHANGELOG_NEW_IN_VERSION .format ("0.8.0" ),
103+ ],
104+ ),
85105)
86106async def list_functions (
87107 wb_api_rpc : Annotated [WbApiRpcClient , Depends (get_wb_api_rpc_client )],
@@ -102,7 +122,12 @@ async def list_functions(
102122@function_router .get (
103123 "/{function_id:uuid}/jobs" ,
104124 response_model = Page [RegisteredFunctionJob ],
105- description = "List function jobs for a function" ,
125+ description = create_route_description (
126+ base = "List function jobs for a function" ,
127+ changelog = [
128+ FMSG_CHANGELOG_NEW_IN_VERSION .format (FIRST_RELEASE_VERSION ),
129+ ],
130+ ),
106131)
107132async def list_function_jobs_for_functionid (
108133 function_id : FunctionID ,
@@ -126,7 +151,12 @@ async def list_function_jobs_for_functionid(
126151 "/{function_id:uuid}/title" ,
127152 response_model = RegisteredFunction ,
128153 responses = {** _COMMON_FUNCTION_ERROR_RESPONSES },
129- description = "Update function" ,
154+ description = create_route_description (
155+ base = "Update function" ,
156+ changelog = [
157+ FMSG_CHANGELOG_NEW_IN_VERSION .format (FIRST_RELEASE_VERSION ),
158+ ],
159+ ),
130160)
131161async def update_function_title (
132162 function_id : FunctionID ,
@@ -146,7 +176,12 @@ async def update_function_title(
146176 "/{function_id:uuid}/description" ,
147177 response_model = RegisteredFunction ,
148178 responses = {** _COMMON_FUNCTION_ERROR_RESPONSES },
149- description = "Update function" ,
179+ description = create_route_description (
180+ base = "Update function" ,
181+ changelog = [
182+ FMSG_CHANGELOG_NEW_IN_VERSION .format (FIRST_RELEASE_VERSION ),
183+ ],
184+ ),
150185)
151186async def update_function_description (
152187 function_id : FunctionID ,
@@ -180,7 +215,12 @@ def _join_inputs(
180215 "/{function_id:uuid}/input_schema" ,
181216 response_model = FunctionInputSchema ,
182217 responses = {** _COMMON_FUNCTION_ERROR_RESPONSES },
183- description = "Get function input schema" ,
218+ description = create_route_description (
219+ base = "Get function input schema" ,
220+ changelog = [
221+ FMSG_CHANGELOG_NEW_IN_VERSION .format (FIRST_RELEASE_VERSION ),
222+ ],
223+ ),
184224)
185225async def get_function_inputschema (
186226 function_id : FunctionID ,
@@ -194,7 +234,12 @@ async def get_function_inputschema(
194234 "/{function_id:uuid}/output_schema" ,
195235 response_model = FunctionInputSchema ,
196236 responses = {** _COMMON_FUNCTION_ERROR_RESPONSES },
197- description = "Get function input schema" ,
237+ description = create_route_description (
238+ base = "Get function output schema" ,
239+ changelog = [
240+ FMSG_CHANGELOG_NEW_IN_VERSION .format (FIRST_RELEASE_VERSION ),
241+ ],
242+ ),
198243)
199244async def get_function_outputschema (
200245 function_id : FunctionID ,
@@ -211,7 +256,12 @@ async def get_function_outputschema(
211256 status .HTTP_400_BAD_REQUEST : {"description" : "Invalid inputs" },
212257 status .HTTP_404_NOT_FOUND : {"description" : "Function not found" },
213258 },
214- description = "Validate inputs against the function's input schema" ,
259+ description = create_route_description (
260+ base = "Validate inputs against the function's input schema" ,
261+ changelog = [
262+ FMSG_CHANGELOG_NEW_IN_VERSION .format (FIRST_RELEASE_VERSION ),
263+ ],
264+ ),
215265)
216266async def validate_function_inputs (
217267 function_id : FunctionID ,
@@ -242,7 +292,12 @@ async def validate_function_inputs(
242292 "/{function_id:uuid}:run" ,
243293 response_model = RegisteredFunctionJob ,
244294 responses = {** _COMMON_FUNCTION_ERROR_RESPONSES },
245- description = "Run function" ,
295+ description = create_route_description (
296+ base = "Run function" ,
297+ changelog = [
298+ FMSG_CHANGELOG_NEW_IN_VERSION .format (FIRST_RELEASE_VERSION ),
299+ ],
300+ ),
246301)
247302async def run_function ( # noqa: PLR0913
248303 request : Request ,
@@ -353,7 +408,12 @@ async def run_function( # noqa: PLR0913
353408 "/{function_id:uuid}" ,
354409 response_model = None ,
355410 responses = {** _COMMON_FUNCTION_ERROR_RESPONSES },
356- description = "Delete function" ,
411+ description = create_route_description (
412+ base = "Delete function" ,
413+ changelog = [
414+ FMSG_CHANGELOG_NEW_IN_VERSION .format (FIRST_RELEASE_VERSION ),
415+ ],
416+ ),
357417)
358418async def delete_function (
359419 wb_api_rpc : Annotated [WbApiRpcClient , Depends (get_wb_api_rpc_client )],
@@ -374,7 +434,12 @@ async def delete_function(
374434 "/{function_id:uuid}:map" ,
375435 response_model = RegisteredFunctionJobCollection ,
376436 responses = {** _COMMON_FUNCTION_ERROR_RESPONSES },
377- description = "Map function over input parameters" ,
437+ description = create_route_description (
438+ base = "Map function over input parameters" ,
439+ changelog = [
440+ FMSG_CHANGELOG_NEW_IN_VERSION .format (FIRST_RELEASE_VERSION ),
441+ ],
442+ ),
378443)
379444async def map_function ( # noqa: PLR0913
380445 function_id : FunctionID ,
0 commit comments