diff --git a/modules/openapi-generator/src/main/resources/julia-server/api.mustache b/modules/openapi-generator/src/main/resources/julia-server/api.mustache index c255a5a080c18..4741c181ded77 100644 --- a/modules/openapi-generator/src/main/resources/julia-server/api.mustache +++ b/modules/openapi-generator/src/main/resources/julia-server/api.mustache @@ -8,7 +8,7 @@ function {{operationId}}_read(handler) path_params = HTTP.getparams(req){{#pathParams}} openapi_params["{{#lambda.escapeDollar}}{{baseName}}{{/lambda.escapeDollar}}"] = OpenAPI.Servers.to_param({{dataType}}, path_params, "{{#lambda.escapeDollar}}{{baseName}}{{/lambda.escapeDollar}}", {{#required}}required=true, {{/required}}{{#isListContainer}}collection_format="{{collectionFormat}}", {{/isListContainer}}){{/pathParams}}{{/hasPathParams}}{{#hasQueryParams}} query_params = HTTP.queryparams(URIs.URI(req.target)){{#queryParams}} - openapi_params["{{#lambda.escapeDollar}}{{baseName}}{{/lambda.escapeDollar}}"] = OpenAPI.Servers.to_param({{dataType}}, query_params, "{{#lambda.escapeDollar}}{{baseName}}{{/lambda.escapeDollar}}", {{#required}}required=true, {{/required}}style="{{style}}", is_explode={{isExplode}}){{/queryParams}}{{/hasQueryParams}}{{#hasHeaderParams}} + openapi_params["{{#lambda.escapeDollar}}{{baseName}}{{/lambda.escapeDollar}}"] = OpenAPI.Servers.to_param({{dataType}}, query_params, "{{#lambda.escapeDollar}}{{baseName}}{{/lambda.escapeDollar}}", {{#required}}required=true, {{/required}}style="{{style}}", is_explode={{isExplode}}{{#isListContainer}},collection_format="{{collectionFormat}}"{{/isListContainer}}){{/queryParams}}{{/hasQueryParams}}{{#hasHeaderParams}} headers = Dict{String,String}(HTTP.headers(req)){{#headerParams}} openapi_params["{{#lambda.escapeDollar}}{{baseName}}{{/lambda.escapeDollar}}"] = OpenAPI.Servers.to_param({{dataType}}, headers, "{{#lambda.escapeDollar}}{{baseName}}{{/lambda.escapeDollar}}", {{#required}}required=true, {{/required}}{{#isListContainer}}collection_format="{{collectionFormat}}", {{/isListContainer}}){{/headerParams}}{{/hasHeaderParams}}{{#hasBodyParam}}{{#bodyParams}} openapi_params["{{#lambda.escapeDollar}}{{baseName}}{{/lambda.escapeDollar}}"] = OpenAPI.Servers.to_param_type({{dataType}}, String(req.body)){{/bodyParams}}{{/hasBodyParam}}{{#hasFormParams}} diff --git a/samples/client/petstore/julia/src/apis/api_PetApi.jl b/samples/client/petstore/julia/src/apis/api_PetApi.jl index 49990a82e1de0..13126f05d1b46 100644 --- a/samples/client/petstore/julia/src/apis/api_PetApi.jl +++ b/samples/client/petstore/julia/src/apis/api_PetApi.jl @@ -82,7 +82,7 @@ const _returntypes_find_pets_by_status_PetApi = Dict{Regex,Type}( function _oacinternal_find_pets_by_status(_api::PetApi, status::Vector{String}; _mediaType=nothing) _ctx = OpenAPI.Clients.Ctx(_api.client, "GET", _returntypes_find_pets_by_status_PetApi, "/pet/findByStatus", ["petstore_auth", ]) - OpenAPI.Clients.set_param(_ctx.query, "status", status) # type Vector{String} + OpenAPI.Clients.set_param(_ctx.query, "status", status; style="form", is_explode=false) # type Vector{String} OpenAPI.Clients.set_header_accept(_ctx, ["application/xml", "application/json", ]) OpenAPI.Clients.set_header_content_type(_ctx, (_mediaType === nothing) ? [] : [_mediaType]) return _ctx @@ -114,7 +114,7 @@ const _returntypes_find_pets_by_tags_PetApi = Dict{Regex,Type}( function _oacinternal_find_pets_by_tags(_api::PetApi, tags::Vector{String}; _mediaType=nothing) _ctx = OpenAPI.Clients.Ctx(_api.client, "GET", _returntypes_find_pets_by_tags_PetApi, "/pet/findByTags", ["petstore_auth", ]) - OpenAPI.Clients.set_param(_ctx.query, "tags", tags) # type Vector{String} + OpenAPI.Clients.set_param(_ctx.query, "tags", tags; style="form", is_explode=false) # type Vector{String} OpenAPI.Clients.set_header_accept(_ctx, ["application/xml", "application/json", ]) OpenAPI.Clients.set_header_content_type(_ctx, (_mediaType === nothing) ? [] : [_mediaType]) return _ctx diff --git a/samples/client/petstore/julia/src/apis/api_UserApi.jl b/samples/client/petstore/julia/src/apis/api_UserApi.jl index 63e0df193aeab..89ed37ed772ad 100644 --- a/samples/client/petstore/julia/src/apis/api_UserApi.jl +++ b/samples/client/petstore/julia/src/apis/api_UserApi.jl @@ -174,8 +174,8 @@ const _returntypes_login_user_UserApi = Dict{Regex,Type}( function _oacinternal_login_user(_api::UserApi, username::String, password::String; _mediaType=nothing) _ctx = OpenAPI.Clients.Ctx(_api.client, "GET", _returntypes_login_user_UserApi, "/user/login", []) - OpenAPI.Clients.set_param(_ctx.query, "username", username) # type String - OpenAPI.Clients.set_param(_ctx.query, "password", password) # type String + OpenAPI.Clients.set_param(_ctx.query, "username", username; style="form", is_explode=true) # type String + OpenAPI.Clients.set_param(_ctx.query, "password", password; style="form", is_explode=true) # type String OpenAPI.Clients.set_header_accept(_ctx, ["application/xml", "application/json", ]) OpenAPI.Clients.set_header_content_type(_ctx, (_mediaType === nothing) ? [] : [_mediaType]) return _ctx diff --git a/samples/server/petstore/julia/src/apis/api_PetApi.jl b/samples/server/petstore/julia/src/apis/api_PetApi.jl index 95dae56e137e1..f3e5d9315dd20 100644 --- a/samples/server/petstore/julia/src/apis/api_PetApi.jl +++ b/samples/server/petstore/julia/src/apis/api_PetApi.jl @@ -63,7 +63,7 @@ function find_pets_by_status_read(handler) function find_pets_by_status_read_handler(req::HTTP.Request) openapi_params = Dict{String,Any}() query_params = HTTP.queryparams(URIs.URI(req.target)) - openapi_params["status"] = OpenAPI.Servers.to_param(Vector{String}, query_params, "status", required=true, ) + openapi_params["status"] = OpenAPI.Servers.to_param(Vector{String}, query_params, "status", required=true, style="form", is_explode=false) req.context[:openapi_params] = openapi_params return handler(req) @@ -91,7 +91,7 @@ function find_pets_by_tags_read(handler) function find_pets_by_tags_read_handler(req::HTTP.Request) openapi_params = Dict{String,Any}() query_params = HTTP.queryparams(URIs.URI(req.target)) - openapi_params["tags"] = OpenAPI.Servers.to_param(Vector{String}, query_params, "tags", required=true, ) + openapi_params["tags"] = OpenAPI.Servers.to_param(Vector{String}, query_params, "tags", required=true, style="form", is_explode=false) req.context[:openapi_params] = openapi_params return handler(req) diff --git a/samples/server/petstore/julia/src/apis/api_UserApi.jl b/samples/server/petstore/julia/src/apis/api_UserApi.jl index f8033b32330d6..5f2f35210ca0f 100644 --- a/samples/server/petstore/julia/src/apis/api_UserApi.jl +++ b/samples/server/petstore/julia/src/apis/api_UserApi.jl @@ -143,8 +143,8 @@ function login_user_read(handler) function login_user_read_handler(req::HTTP.Request) openapi_params = Dict{String,Any}() query_params = HTTP.queryparams(URIs.URI(req.target)) - openapi_params["username"] = OpenAPI.Servers.to_param(String, query_params, "username", required=true, ) - openapi_params["password"] = OpenAPI.Servers.to_param(String, query_params, "password", required=true, ) + openapi_params["username"] = OpenAPI.Servers.to_param(String, query_params, "username", required=true, style="form", is_explode=true) + openapi_params["password"] = OpenAPI.Servers.to_param(String, query_params, "password", required=true, style="form", is_explode=true) req.context[:openapi_params] = openapi_params return handler(req)