diff --git a/.github/workflows/samples-julia.yaml b/.github/workflows/samples-julia.yaml index 2cb5ed8de05..c9c62f77210 100644 --- a/.github/workflows/samples-julia.yaml +++ b/.github/workflows/samples-julia.yaml @@ -30,7 +30,7 @@ jobs: # Using develop mode to install package so that it is easier to modify the package test files julia -e "using Pkg; Pkg.develop(\"OpenAPI\");" cd ~/.julia/dev/OpenAPI - git checkout v0.1.14 + git checkout v0.1.25 cd $currdir rm -rf ~/.julia/dev/OpenAPI/test/client/openapigenerator_petstore_v3/petstore rm -rf ~/.julia/dev/OpenAPI/test/server/openapigenerator_petstore_v3/petstore diff --git a/modules/openapi-generator/src/main/resources/julia-client/api.mustache b/modules/openapi-generator/src/main/resources/julia-client/api.mustache index c56a5cc8620..3881e7b5d59 100644 --- a/modules/openapi-generator/src/main/resources/julia-client/api.mustache +++ b/modules/openapi-generator/src/main/resources/julia-client/api.mustache @@ -51,7 +51,7 @@ function _oacinternal_{{operationId}}(_api::{{classname}}{{#allParams}}{{#requir OpenAPI.Clients.set_param(_ctx.path, "{{#lambda.escapeDollar}}{{baseName}}{{/lambda.escapeDollar}}", {{paramName}}{{#isListContainer}}; collection_format="{{collectionFormat}}"{{/isListContainer}}) # type {{dataType}} {{/pathParams}} {{#queryParams}} - OpenAPI.Clients.set_param(_ctx.query, "{{#lambda.escapeDollar}}{{baseName}}{{/lambda.escapeDollar}}", {{paramName}}{{#isListContainer}}; collection_format="{{collectionFormat}}"{{/isListContainer}}) # type {{dataType}} + OpenAPI.Clients.set_param(_ctx.query, "{{#lambda.escapeDollar}}{{baseName}}{{/lambda.escapeDollar}}", {{paramName}}; style="{{style}}", is_explode={{isExplode}}{{#isListContainer}},collection_format="{{collectionFormat}}"{{/isListContainer}}) # type {{dataType}} {{/queryParams}} {{#headerParams}} OpenAPI.Clients.set_param(_ctx.header, "{{#lambda.escapeDollar}}{{baseName}}{{/lambda.escapeDollar}}", {{paramName}}{{#isListContainer}}; collection_format="{{collectionFormat}}"{{/isListContainer}}) # type {{dataType}} 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 8d98de8e7f2..e65bb670f8e 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}}{{#isListContainer}}collection_format="{{collectionFormat}}", {{/isListContainer}}){{/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 2b45fa87e6f..55d2658b4e4 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 63e0df193ae..89ed37ed772 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 5d05aa84fe2..074ddfdb084 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 f8033b32330..5f2f35210ca 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)