Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
vdayanand committed Jul 24, 2024
1 parent 6f94738 commit 4021c34
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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}}
Expand Down
4 changes: 2 additions & 2 deletions samples/client/petstore/julia/src/apis/api_PetApi.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions samples/client/petstore/julia/src/apis/api_UserApi.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions samples/server/petstore/julia/src/apis/api_PetApi.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions samples/server/petstore/julia/src/apis/api_UserApi.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 4021c34

Please sign in to comment.