From 83bfd34c218f8414e928ccf011d0a8be5a1a71f9 Mon Sep 17 00:00:00 2001 From: sverhoeven Date: Tue, 24 Sep 2024 14:04:35 +0200 Subject: [PATCH] Regen Julia server stubs --- .gitignore | 4 ++- RemoteBMI.jl/README.md | 3 +- RemoteBMI.jl/src/BmiServer.jl | 24 +++++++------ RemoteBMI.jl/src/apis/api_GettersApi.jl | 4 +++ RemoteBMI.jl/src/apis/api_IRFApi.jl | 4 +-- RemoteBMI.jl/src/apis/api_SettersApi.jl | 8 +++-- .../src/apis/api_VariableInformationApi.jl | 12 +++++++ RemoteBMI.jl/src/modelincludes.jl | 10 ++++-- .../models/model_GetComponentNameResponse.jl | 34 ++++++++++++++++++ .../src/models/model_GetGridTypeResponse.jl | 34 ++++++++++++++++++ .../src/models/model_GetTimeUnitsResponse.jl | 34 ++++++++++++++++++ .../model_GetVarLocationResponseLocation.jl | 33 ++++++++++++++--- .../src/models/model_GetVarTypeResponse.jl | 34 ++++++++++++++++++ .../src/models/model_GetVarUnitsResponse.jl | 34 ++++++++++++++++++ .../src/models/model_InitializeRequest.jl | 34 ++++++++++++++++++ .../src/models/model_ProblemDetails.jl | 21 ++++++++--- .../models/model_SetValueAtIndicesRequest.jl | 36 +++++++++++++++++++ 17 files changed, 335 insertions(+), 28 deletions(-) create mode 100644 RemoteBMI.jl/src/models/model_GetComponentNameResponse.jl create mode 100644 RemoteBMI.jl/src/models/model_GetGridTypeResponse.jl create mode 100644 RemoteBMI.jl/src/models/model_GetTimeUnitsResponse.jl create mode 100644 RemoteBMI.jl/src/models/model_GetVarTypeResponse.jl create mode 100644 RemoteBMI.jl/src/models/model_GetVarUnitsResponse.jl create mode 100644 RemoteBMI.jl/src/models/model_InitializeRequest.jl create mode 100644 RemoteBMI.jl/src/models/model_SetValueAtIndicesRequest.jl diff --git a/.gitignore b/.gitignore index 73cf7b8..3e9bd6e 100644 --- a/.gitignore +++ b/.gitignore @@ -27,4 +27,6 @@ __pycache__ /venv python/.venv/ python/heat.toml -RemoteBMI.jl/example/Project.toml \ No newline at end of file +RemoteBMI.jl/example/Project.toml +openapi-generator-cli.jar +openapitools.json \ No newline at end of file diff --git a/RemoteBMI.jl/README.md b/RemoteBMI.jl/README.md index f3c26db..760c39e 100644 --- a/RemoteBMI.jl/README.md +++ b/RemoteBMI.jl/README.md @@ -35,6 +35,7 @@ BestieTemplate.generate("RemoteBMI.jl") The openapi server stubs where generated using the following command: ```shell -npx @openapitools/openapi-generator-cli generate -i ./openapi.yaml -g julia-server -o julia-server --additional-properties=packageName=BmiServer --additional-properties=exportModels=true +wget https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.8.0/openapi-generator-cli-7.8.0.jar -O openapi-generator-cli.jar +java -jar ./openapi-generator-cli.jar generate -i ./openapi.yaml -g julia-server -o julia-server --additional-properties=packageName=BmiServer --additional-properties=exportModels=true # Copy the generated files to RemoteBMI.jl/src/ ``` \ No newline at end of file diff --git a/RemoteBMI.jl/src/BmiServer.jl b/RemoteBMI.jl/src/BmiServer.jl index cdd310e..323d02d 100644 --- a/RemoteBMI.jl/src/BmiServer.jl +++ b/RemoteBMI.jl/src/BmiServer.jl @@ -9,7 +9,7 @@ The following server methods must be implemented: - **get_component_name** - *invocation:* GET /get_component_name - - *signature:* get_component_name(req::HTTP.Request;) -> String + - *signature:* get_component_name(req::HTTP.Request;) -> GetComponentNameResponse - **get_input_item_count** - *invocation:* GET /get_input_item_count - *signature:* get_input_item_count(req::HTTP.Request;) -> Int64 @@ -36,13 +36,13 @@ The following server methods must be implemented: - *signature:* get_grid_size(req::HTTP.Request, grid::Int64;) -> Int64 - **get_grid_type** - *invocation:* GET /get_grid_type/{grid} - - *signature:* get_grid_type(req::HTTP.Request, grid::Int64;) -> BmiGetGridTypeResponse + - *signature:* get_grid_type(req::HTTP.Request, grid::Int64;) -> GetGridTypeResponse - **finalize** - *invocation:* DELETE /finalize - *signature:* finalize(req::HTTP.Request;) -> Nothing - **initialize** - *invocation:* POST /initialize - - *signature:* initialize(req::HTTP.Request, bmi_initialize_request::BmiInitializeRequest;) -> Nothing + - *signature:* initialize(req::HTTP.Request, initialize_request::InitializeRequest;) -> Nothing - **update** - *invocation:* POST /update - *signature:* update(req::HTTP.Request;) -> Nothing @@ -63,7 +63,7 @@ The following server methods must be implemented: - *signature:* set_value(req::HTTP.Request, name::String, request_body::Vector{Float64};) -> Nothing - **set_value_at_indices** - *invocation:* POST /set_value_at_indices/{name} - - *signature:* set_value_at_indices(req::HTTP.Request, name::String, bmi_set_value_at_indices_request::BmiSetValueAtIndicesRequest;) -> Nothing + - *signature:* set_value_at_indices(req::HTTP.Request, name::String, set_value_at_indices_request::SetValueAtIndicesRequest;) -> Nothing - **get_current_time** - *invocation:* GET /get_current_time - *signature:* get_current_time(req::HTTP.Request;) -> Float64 @@ -78,7 +78,7 @@ The following server methods must be implemented: - *signature:* get_time_step(req::HTTP.Request;) -> Float64 - **get_time_units** - *invocation:* GET /get_time_units - - *signature:* get_time_units(req::HTTP.Request;) -> String + - *signature:* get_time_units(req::HTTP.Request;) -> GetTimeUnitsResponse - **get_grid_origin** - *invocation:* GET /get_grid_origin/{grid} - *signature:* get_grid_origin(req::HTTP.Request, grid::Int64;) -> Vector{Float64} @@ -123,10 +123,10 @@ The following server methods must be implemented: - *signature:* get_var_nbytes(req::HTTP.Request, name::String;) -> Int64 - **get_var_type** - *invocation:* GET /get_var_type/{name} - - *signature:* get_var_type(req::HTTP.Request, name::String;) -> String + - *signature:* get_var_type(req::HTTP.Request, name::String;) -> GetVarTypeResponse - **get_var_units** - *invocation:* GET /get_var_units/{name} - - *signature:* get_var_units(req::HTTP.Request, name::String;) -> String + - *signature:* get_var_units(req::HTTP.Request, name::String;) -> GetVarUnitsResponse """ module BmiServer @@ -187,10 +187,14 @@ function register(router::HTTP.Router, impl; path_prefix::String="", optional_mi end # export models -export BmiGetGridTypeResponse -export BmiInitializeRequest -export BmiSetValueAtIndicesRequest +export GetComponentNameResponse +export GetGridTypeResponse +export GetTimeUnitsResponse export GetVarLocationResponseLocation +export GetVarTypeResponse +export GetVarUnitsResponse +export InitializeRequest export ProblemDetails +export SetValueAtIndicesRequest end # module BmiServer diff --git a/RemoteBMI.jl/src/apis/api_GettersApi.jl b/RemoteBMI.jl/src/apis/api_GettersApi.jl index dc407a6..d6ba826 100644 --- a/RemoteBMI.jl/src/apis/api_GettersApi.jl +++ b/RemoteBMI.jl/src/apis/api_GettersApi.jl @@ -17,6 +17,8 @@ function get_value_validate(handler) function get_value_validate_handler(req::HTTP.Request) openapi_params = req.context[:openapi_params] + OpenAPI.validate_param("name", "get_value", :minLength, openapi_params["name"], 1) + return handler(req) end end @@ -46,6 +48,8 @@ function get_value_at_indices_validate(handler) function get_value_at_indices_validate_handler(req::HTTP.Request) openapi_params = req.context[:openapi_params] + OpenAPI.validate_param("name", "get_value_at_indices", :minLength, openapi_params["name"], 1) + return handler(req) end end diff --git a/RemoteBMI.jl/src/apis/api_IRFApi.jl b/RemoteBMI.jl/src/apis/api_IRFApi.jl index a8b73a5..b2ad21e 100644 --- a/RemoteBMI.jl/src/apis/api_IRFApi.jl +++ b/RemoteBMI.jl/src/apis/api_IRFApi.jl @@ -31,7 +31,7 @@ end function initialize_read(handler) function initialize_read_handler(req::HTTP.Request) openapi_params = Dict{String,Any}() - openapi_params["BmiInitializeRequest"] = OpenAPI.Servers.to_param_type(BmiInitializeRequest, String(req.body)) + openapi_params["InitializeRequest"] = OpenAPI.Servers.to_param_type(InitializeRequest, String(req.body)) req.context[:openapi_params] = openapi_params return handler(req) @@ -49,7 +49,7 @@ end function initialize_invoke(impl; post_invoke=nothing) function initialize_invoke_handler(req::HTTP.Request) openapi_params = req.context[:openapi_params] - ret = impl.initialize(req::HTTP.Request, openapi_params["BmiInitializeRequest"];) + ret = impl.initialize(req::HTTP.Request, openapi_params["InitializeRequest"];) resp = OpenAPI.Servers.server_response(ret) return (post_invoke === nothing) ? resp : post_invoke(req, resp) end diff --git a/RemoteBMI.jl/src/apis/api_SettersApi.jl b/RemoteBMI.jl/src/apis/api_SettersApi.jl index 8931308..33de8ac 100644 --- a/RemoteBMI.jl/src/apis/api_SettersApi.jl +++ b/RemoteBMI.jl/src/apis/api_SettersApi.jl @@ -18,6 +18,8 @@ function set_value_validate(handler) function set_value_validate_handler(req::HTTP.Request) openapi_params = req.context[:openapi_params] + OpenAPI.validate_param("name", "set_value", :minLength, openapi_params["name"], 1) + return handler(req) end end @@ -36,7 +38,7 @@ function set_value_at_indices_read(handler) openapi_params = Dict{String,Any}() path_params = HTTP.getparams(req) openapi_params["name"] = OpenAPI.Servers.to_param(String, path_params, "name", required=true, ) - openapi_params["BmiSetValueAtIndicesRequest"] = OpenAPI.Servers.to_param_type(BmiSetValueAtIndicesRequest, String(req.body)) + openapi_params["SetValueAtIndicesRequest"] = OpenAPI.Servers.to_param_type(SetValueAtIndicesRequest, String(req.body)) req.context[:openapi_params] = openapi_params return handler(req) @@ -47,6 +49,8 @@ function set_value_at_indices_validate(handler) function set_value_at_indices_validate_handler(req::HTTP.Request) openapi_params = req.context[:openapi_params] + OpenAPI.validate_param("name", "set_value_at_indices", :minLength, openapi_params["name"], 1) + return handler(req) end end @@ -54,7 +58,7 @@ end function set_value_at_indices_invoke(impl; post_invoke=nothing) function set_value_at_indices_invoke_handler(req::HTTP.Request) openapi_params = req.context[:openapi_params] - ret = impl.set_value_at_indices(req::HTTP.Request, openapi_params["name"], openapi_params["BmiSetValueAtIndicesRequest"];) + ret = impl.set_value_at_indices(req::HTTP.Request, openapi_params["name"], openapi_params["SetValueAtIndicesRequest"];) resp = OpenAPI.Servers.server_response(ret) return (post_invoke === nothing) ? resp : post_invoke(req, resp) end diff --git a/RemoteBMI.jl/src/apis/api_VariableInformationApi.jl b/RemoteBMI.jl/src/apis/api_VariableInformationApi.jl index c1f6856..9ac76f8 100644 --- a/RemoteBMI.jl/src/apis/api_VariableInformationApi.jl +++ b/RemoteBMI.jl/src/apis/api_VariableInformationApi.jl @@ -17,6 +17,8 @@ function get_var_grid_validate(handler) function get_var_grid_validate_handler(req::HTTP.Request) openapi_params = req.context[:openapi_params] + OpenAPI.validate_param("name", "get_var_grid", :minLength, openapi_params["name"], 1) + return handler(req) end end @@ -45,6 +47,8 @@ function get_var_itemsize_validate(handler) function get_var_itemsize_validate_handler(req::HTTP.Request) openapi_params = req.context[:openapi_params] + OpenAPI.validate_param("name", "get_var_itemsize", :minLength, openapi_params["name"], 1) + return handler(req) end end @@ -73,6 +77,8 @@ function get_var_location_validate(handler) function get_var_location_validate_handler(req::HTTP.Request) openapi_params = req.context[:openapi_params] + OpenAPI.validate_param("name", "get_var_location", :minLength, openapi_params["name"], 1) + return handler(req) end end @@ -101,6 +107,8 @@ function get_var_nbytes_validate(handler) function get_var_nbytes_validate_handler(req::HTTP.Request) openapi_params = req.context[:openapi_params] + OpenAPI.validate_param("name", "get_var_nbytes", :minLength, openapi_params["name"], 1) + return handler(req) end end @@ -129,6 +137,8 @@ function get_var_type_validate(handler) function get_var_type_validate_handler(req::HTTP.Request) openapi_params = req.context[:openapi_params] + OpenAPI.validate_param("name", "get_var_type", :minLength, openapi_params["name"], 1) + return handler(req) end end @@ -157,6 +167,8 @@ function get_var_units_validate(handler) function get_var_units_validate_handler(req::HTTP.Request) openapi_params = req.context[:openapi_params] + OpenAPI.validate_param("name", "get_var_units", :minLength, openapi_params["name"], 1) + return handler(req) end end diff --git a/RemoteBMI.jl/src/modelincludes.jl b/RemoteBMI.jl/src/modelincludes.jl index a5ceaec..8afe3c1 100644 --- a/RemoteBMI.jl/src/modelincludes.jl +++ b/RemoteBMI.jl/src/modelincludes.jl @@ -1,8 +1,12 @@ # This file was generated by the Julia OpenAPI Code Generator # Do not modify this file directly. Modify the OpenAPI specification instead. -include("models/model_BmiGetGridTypeResponse.jl") -include("models/model_BmiInitializeRequest.jl") -include("models/model_BmiSetValueAtIndicesRequest.jl") +include("models/model_GetComponentNameResponse.jl") +include("models/model_GetGridTypeResponse.jl") +include("models/model_GetTimeUnitsResponse.jl") include("models/model_GetVarLocationResponseLocation.jl") +include("models/model_GetVarTypeResponse.jl") +include("models/model_GetVarUnitsResponse.jl") +include("models/model_InitializeRequest.jl") include("models/model_ProblemDetails.jl") +include("models/model_SetValueAtIndicesRequest.jl") diff --git a/RemoteBMI.jl/src/models/model_GetComponentNameResponse.jl b/RemoteBMI.jl/src/models/model_GetComponentNameResponse.jl new file mode 100644 index 0000000..c0e860e --- /dev/null +++ b/RemoteBMI.jl/src/models/model_GetComponentNameResponse.jl @@ -0,0 +1,34 @@ +# This file was generated by the Julia OpenAPI Code Generator +# Do not modify this file directly. Modify the OpenAPI specification instead. + + +@doc raw"""GetComponentNameResponse + + GetComponentNameResponse(; + name=nothing, + ) + + - name::String +""" +Base.@kwdef mutable struct GetComponentNameResponse <: OpenAPI.APIModel + name::Union{Nothing, String} = nothing + + function GetComponentNameResponse(name, ) + OpenAPI.validate_property(GetComponentNameResponse, Symbol("name"), name) + return new(name, ) + end +end # type GetComponentNameResponse + +const _property_types_GetComponentNameResponse = Dict{Symbol,String}(Symbol("name")=>"String", ) +OpenAPI.property_type(::Type{ GetComponentNameResponse }, name::Symbol) = Union{Nothing,eval(Base.Meta.parse(_property_types_GetComponentNameResponse[name]))} + +function check_required(o::GetComponentNameResponse) + o.name === nothing && (return false) + true +end + +function OpenAPI.validate_property(::Type{ GetComponentNameResponse }, name::Symbol, val) + if name === Symbol("name") + OpenAPI.validate_param(name, "GetComponentNameResponse", :minLength, val, 1) + end +end diff --git a/RemoteBMI.jl/src/models/model_GetGridTypeResponse.jl b/RemoteBMI.jl/src/models/model_GetGridTypeResponse.jl new file mode 100644 index 0000000..5492e22 --- /dev/null +++ b/RemoteBMI.jl/src/models/model_GetGridTypeResponse.jl @@ -0,0 +1,34 @@ +# This file was generated by the Julia OpenAPI Code Generator +# Do not modify this file directly. Modify the OpenAPI specification instead. + + +@doc raw"""GetGridTypeResponse + + GetGridTypeResponse(; + type=nothing, + ) + + - type::String +""" +Base.@kwdef mutable struct GetGridTypeResponse <: OpenAPI.APIModel + type::Union{Nothing, String} = nothing + + function GetGridTypeResponse(type, ) + OpenAPI.validate_property(GetGridTypeResponse, Symbol("type"), type) + return new(type, ) + end +end # type GetGridTypeResponse + +const _property_types_GetGridTypeResponse = Dict{Symbol,String}(Symbol("type")=>"String", ) +OpenAPI.property_type(::Type{ GetGridTypeResponse }, name::Symbol) = Union{Nothing,eval(Base.Meta.parse(_property_types_GetGridTypeResponse[name]))} + +function check_required(o::GetGridTypeResponse) + o.type === nothing && (return false) + true +end + +function OpenAPI.validate_property(::Type{ GetGridTypeResponse }, name::Symbol, val) + if name === Symbol("type") + OpenAPI.validate_param(name, "GetGridTypeResponse", :enum, val, ["scalar", "points", "vector", "unstructured", "structured_quadrilateral", "rectilinear", "uniform_rectilinear"]) + end +end diff --git a/RemoteBMI.jl/src/models/model_GetTimeUnitsResponse.jl b/RemoteBMI.jl/src/models/model_GetTimeUnitsResponse.jl new file mode 100644 index 0000000..5ba33a8 --- /dev/null +++ b/RemoteBMI.jl/src/models/model_GetTimeUnitsResponse.jl @@ -0,0 +1,34 @@ +# This file was generated by the Julia OpenAPI Code Generator +# Do not modify this file directly. Modify the OpenAPI specification instead. + + +@doc raw"""GetTimeUnitsResponse + + GetTimeUnitsResponse(; + units=nothing, + ) + + - units::String +""" +Base.@kwdef mutable struct GetTimeUnitsResponse <: OpenAPI.APIModel + units::Union{Nothing, String} = nothing + + function GetTimeUnitsResponse(units, ) + OpenAPI.validate_property(GetTimeUnitsResponse, Symbol("units"), units) + return new(units, ) + end +end # type GetTimeUnitsResponse + +const _property_types_GetTimeUnitsResponse = Dict{Symbol,String}(Symbol("units")=>"String", ) +OpenAPI.property_type(::Type{ GetTimeUnitsResponse }, name::Symbol) = Union{Nothing,eval(Base.Meta.parse(_property_types_GetTimeUnitsResponse[name]))} + +function check_required(o::GetTimeUnitsResponse) + o.units === nothing && (return false) + true +end + +function OpenAPI.validate_property(::Type{ GetTimeUnitsResponse }, name::Symbol, val) + if name === Symbol("units") + OpenAPI.validate_param(name, "GetTimeUnitsResponse", :minLength, val, 1) + end +end diff --git a/RemoteBMI.jl/src/models/model_GetVarLocationResponseLocation.jl b/RemoteBMI.jl/src/models/model_GetVarLocationResponseLocation.jl index 4aec63b..afe49be 100644 --- a/RemoteBMI.jl/src/models/model_GetVarLocationResponseLocation.jl +++ b/RemoteBMI.jl/src/models/model_GetVarLocationResponseLocation.jl @@ -2,8 +2,33 @@ # Do not modify this file directly. Modify the OpenAPI specification instead. -if !isdefined(@__MODULE__, :GetVarLocationResponseLocation) - const GetVarLocationResponseLocation = String -else - @warn("Skipping redefinition of GetVarLocationResponseLocation to String") +@doc raw"""GetVarLocationResponseLocation + + GetVarLocationResponseLocation(; + location="node", + ) + + - location::String +""" +Base.@kwdef mutable struct GetVarLocationResponseLocation <: OpenAPI.APIModel + location::Union{Nothing, String} = "node" + + function GetVarLocationResponseLocation(location, ) + OpenAPI.validate_property(GetVarLocationResponseLocation, Symbol("location"), location) + return new(location, ) + end +end # type GetVarLocationResponseLocation + +const _property_types_GetVarLocationResponseLocation = Dict{Symbol,String}(Symbol("location")=>"String", ) +OpenAPI.property_type(::Type{ GetVarLocationResponseLocation }, name::Symbol) = Union{Nothing,eval(Base.Meta.parse(_property_types_GetVarLocationResponseLocation[name]))} + +function check_required(o::GetVarLocationResponseLocation) + o.location === nothing && (return false) + true +end + +function OpenAPI.validate_property(::Type{ GetVarLocationResponseLocation }, name::Symbol, val) + if name === Symbol("location") + OpenAPI.validate_param(name, "GetVarLocationResponseLocation", :enum, val, ["node", "edge", "face"]) + end end diff --git a/RemoteBMI.jl/src/models/model_GetVarTypeResponse.jl b/RemoteBMI.jl/src/models/model_GetVarTypeResponse.jl new file mode 100644 index 0000000..dedee32 --- /dev/null +++ b/RemoteBMI.jl/src/models/model_GetVarTypeResponse.jl @@ -0,0 +1,34 @@ +# This file was generated by the Julia OpenAPI Code Generator +# Do not modify this file directly. Modify the OpenAPI specification instead. + + +@doc raw"""GetVarTypeResponse + + GetVarTypeResponse(; + type=nothing, + ) + + - type::String +""" +Base.@kwdef mutable struct GetVarTypeResponse <: OpenAPI.APIModel + type::Union{Nothing, String} = nothing + + function GetVarTypeResponse(type, ) + OpenAPI.validate_property(GetVarTypeResponse, Symbol("type"), type) + return new(type, ) + end +end # type GetVarTypeResponse + +const _property_types_GetVarTypeResponse = Dict{Symbol,String}(Symbol("type")=>"String", ) +OpenAPI.property_type(::Type{ GetVarTypeResponse }, name::Symbol) = Union{Nothing,eval(Base.Meta.parse(_property_types_GetVarTypeResponse[name]))} + +function check_required(o::GetVarTypeResponse) + o.type === nothing && (return false) + true +end + +function OpenAPI.validate_property(::Type{ GetVarTypeResponse }, name::Symbol, val) + if name === Symbol("type") + OpenAPI.validate_param(name, "GetVarTypeResponse", :enum, val, ["float", "double", "int32", "int64"]) + end +end diff --git a/RemoteBMI.jl/src/models/model_GetVarUnitsResponse.jl b/RemoteBMI.jl/src/models/model_GetVarUnitsResponse.jl new file mode 100644 index 0000000..5bc0637 --- /dev/null +++ b/RemoteBMI.jl/src/models/model_GetVarUnitsResponse.jl @@ -0,0 +1,34 @@ +# This file was generated by the Julia OpenAPI Code Generator +# Do not modify this file directly. Modify the OpenAPI specification instead. + + +@doc raw"""GetVarUnitsResponse + + GetVarUnitsResponse(; + units=nothing, + ) + + - units::String +""" +Base.@kwdef mutable struct GetVarUnitsResponse <: OpenAPI.APIModel + units::Union{Nothing, String} = nothing + + function GetVarUnitsResponse(units, ) + OpenAPI.validate_property(GetVarUnitsResponse, Symbol("units"), units) + return new(units, ) + end +end # type GetVarUnitsResponse + +const _property_types_GetVarUnitsResponse = Dict{Symbol,String}(Symbol("units")=>"String", ) +OpenAPI.property_type(::Type{ GetVarUnitsResponse }, name::Symbol) = Union{Nothing,eval(Base.Meta.parse(_property_types_GetVarUnitsResponse[name]))} + +function check_required(o::GetVarUnitsResponse) + o.units === nothing && (return false) + true +end + +function OpenAPI.validate_property(::Type{ GetVarUnitsResponse }, name::Symbol, val) + if name === Symbol("units") + OpenAPI.validate_param(name, "GetVarUnitsResponse", :minLength, val, 1) + end +end diff --git a/RemoteBMI.jl/src/models/model_InitializeRequest.jl b/RemoteBMI.jl/src/models/model_InitializeRequest.jl new file mode 100644 index 0000000..47f1246 --- /dev/null +++ b/RemoteBMI.jl/src/models/model_InitializeRequest.jl @@ -0,0 +1,34 @@ +# This file was generated by the Julia OpenAPI Code Generator +# Do not modify this file directly. Modify the OpenAPI specification instead. + + +@doc raw"""InitializeRequest + + InitializeRequest(; + config_file=nothing, + ) + + - config_file::String : Path to the configuration file. Should resolvable by web service. +""" +Base.@kwdef mutable struct InitializeRequest <: OpenAPI.APIModel + config_file::Union{Nothing, String} = nothing + + function InitializeRequest(config_file, ) + OpenAPI.validate_property(InitializeRequest, Symbol("config_file"), config_file) + return new(config_file, ) + end +end # type InitializeRequest + +const _property_types_InitializeRequest = Dict{Symbol,String}(Symbol("config_file")=>"String", ) +OpenAPI.property_type(::Type{ InitializeRequest }, name::Symbol) = Union{Nothing,eval(Base.Meta.parse(_property_types_InitializeRequest[name]))} + +function check_required(o::InitializeRequest) + o.config_file === nothing && (return false) + true +end + +function OpenAPI.validate_property(::Type{ InitializeRequest }, name::Symbol, val) + if name === Symbol("config_file") + OpenAPI.validate_param(name, "InitializeRequest", :minLength, val, 0) + end +end diff --git a/RemoteBMI.jl/src/models/model_ProblemDetails.jl b/RemoteBMI.jl/src/models/model_ProblemDetails.jl index 42c2d28..3aa9de7 100644 --- a/RemoteBMI.jl/src/models/model_ProblemDetails.jl +++ b/RemoteBMI.jl/src/models/model_ProblemDetails.jl @@ -3,6 +3,7 @@ @doc raw"""ProblemDetails +Definition from https://datatracker.ietf.org/doc/html/rfc9457#name-json-schema-for-http-proble ProblemDetails(; type=nothing, @@ -12,11 +13,11 @@ instance=nothing, ) - - type::String - - title::String - - status::Int64 - - detail::String - - instance::String + - type::String : A URI reference that identifies the problem type. + - title::String : A short, human-readable summary of the problem type. + - status::Int64 : The HTTP status code generated by the origin server for this occurrence of the problem. + - detail::String : A human-readable explanation specific to this occurrence of the problem. + - instance::String : A URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced. """ Base.@kwdef mutable struct ProblemDetails <: OpenAPI.APIModel type::Union{Nothing, String} = nothing @@ -43,4 +44,14 @@ function check_required(o::ProblemDetails) end function OpenAPI.validate_property(::Type{ ProblemDetails }, name::Symbol, val) + if name === Symbol("type") + OpenAPI.validate_param(name, "ProblemDetails", :format, val, "uri-reference") + end + if name === Symbol("status") + OpenAPI.validate_param(name, "ProblemDetails", :maximum, val, 599, false) + OpenAPI.validate_param(name, "ProblemDetails", :minimum, val, 100, false) + end + if name === Symbol("instance") + OpenAPI.validate_param(name, "ProblemDetails", :format, val, "uri-reference") + end end diff --git a/RemoteBMI.jl/src/models/model_SetValueAtIndicesRequest.jl b/RemoteBMI.jl/src/models/model_SetValueAtIndicesRequest.jl new file mode 100644 index 0000000..5ec5ffe --- /dev/null +++ b/RemoteBMI.jl/src/models/model_SetValueAtIndicesRequest.jl @@ -0,0 +1,36 @@ +# This file was generated by the Julia OpenAPI Code Generator +# Do not modify this file directly. Modify the OpenAPI specification instead. + + +@doc raw"""SetValueAtIndicesRequest + + SetValueAtIndicesRequest(; + indices=nothing, + values=nothing, + ) + + - indices::Vector{Int64} + - values::Vector{Float64} +""" +Base.@kwdef mutable struct SetValueAtIndicesRequest <: OpenAPI.APIModel + indices::Union{Nothing, Vector{Int64}} = nothing + values::Union{Nothing, Vector{Float64}} = nothing + + function SetValueAtIndicesRequest(indices, values, ) + OpenAPI.validate_property(SetValueAtIndicesRequest, Symbol("indices"), indices) + OpenAPI.validate_property(SetValueAtIndicesRequest, Symbol("values"), values) + return new(indices, values, ) + end +end # type SetValueAtIndicesRequest + +const _property_types_SetValueAtIndicesRequest = Dict{Symbol,String}(Symbol("indices")=>"Vector{Int64}", Symbol("values")=>"Vector{Float64}", ) +OpenAPI.property_type(::Type{ SetValueAtIndicesRequest }, name::Symbol) = Union{Nothing,eval(Base.Meta.parse(_property_types_SetValueAtIndicesRequest[name]))} + +function check_required(o::SetValueAtIndicesRequest) + o.indices === nothing && (return false) + o.values === nothing && (return false) + true +end + +function OpenAPI.validate_property(::Type{ SetValueAtIndicesRequest }, name::Symbol, val) +end