From 19161684c6fa210a6b4bb0bdfc2f0157adaf9247 Mon Sep 17 00:00:00 2001 From: Tanmay Mohapatra Date: Fri, 8 Dec 2023 11:08:51 +0530 Subject: [PATCH 1/4] update github workflow (#66) modernize github workflow --- .github/workflows/ci.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a2db97e..f3d651f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,7 +19,7 @@ jobs: arch: - x64 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: julia-actions/setup-julia@v1 with: version: ${{ matrix.version }} @@ -45,10 +45,11 @@ jobs: runs-on: ubuntu-latest permissions: contents: write + statuses: write steps: - - uses: actions/checkout@v2 - - uses: julia-actions/julia-buildpkg@v1 - - uses: julia-actions/julia-docdeploy@v1 + - uses: actions/checkout@v4 + - uses: julia-actions/julia-buildpkg@latest + - uses: julia-actions/julia-docdeploy@latest env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} From 48a9fff45d666e9e35fa28fd27c421918268007b Mon Sep 17 00:00:00 2001 From: Tanmay Mohapatra Date: Fri, 15 Mar 2024 08:04:17 +0530 Subject: [PATCH 2/4] fix(ci): fix test code that caused ci freeze (#69) Fixes an issue in the test code that used a closed channel unintentionally. --- .../openapigenerator_petstore_v3/petstore_test_storeapi.jl | 3 +++ test/client/petstore_v2/petstore_test_storeapi.jl | 3 +++ test/client/petstore_v3/petstore_test_storeapi.jl | 3 +++ test/client/runtests.jl | 4 ++-- 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/test/client/openapigenerator_petstore_v3/petstore_test_storeapi.jl b/test/client/openapigenerator_petstore_v3/petstore_test_storeapi.jl index d3f2e1e..15991b6 100644 --- a/test/client/openapigenerator_petstore_v3/petstore_test_storeapi.jl +++ b/test/client/openapigenerator_petstore_v3/petstore_test_storeapi.jl @@ -53,6 +53,9 @@ function test(uri) # a closed channel is equivalent of cancellation of the call, # no error should be thrown, but response can be nothing if call was interrupted immediately @test !isopen(response_channel) + + # open a new channel to use + response_channel = Channel{Order}(1) try resp, http_resp = get_order_by_id(api, response_channel, Int64(5)) @test (200 <= http_resp.status <= 206) diff --git a/test/client/petstore_v2/petstore_test_storeapi.jl b/test/client/petstore_v2/petstore_test_storeapi.jl index 5df5edf..fc07ef5 100644 --- a/test/client/petstore_v2/petstore_test_storeapi.jl +++ b/test/client/petstore_v2/petstore_test_storeapi.jl @@ -53,6 +53,9 @@ function test(uri) # a closed channel is equivalent of cancellation of the call, # no error should be thrown, but response can be nothing if call was interrupted immediately @test !isopen(response_channel) + + # open a new channel to use + response_channel = Channel{Order}(1) try resp, http_resp = get_order_by_id(api, response_channel, Int64(5)) @test (200 <= http_resp.status <= 206) diff --git a/test/client/petstore_v3/petstore_test_storeapi.jl b/test/client/petstore_v3/petstore_test_storeapi.jl index 715b465..1aa7beb 100644 --- a/test/client/petstore_v3/petstore_test_storeapi.jl +++ b/test/client/petstore_v3/petstore_test_storeapi.jl @@ -53,6 +53,9 @@ function test(uri) # a closed channel is equivalent of cancellation of the call, # no error should be thrown, but response can be nothing if call was interrupted immediately @test !isopen(response_channel) + + # open a new channel to use + response_channel = Channel{Order}(1) try resp, http_resp = get_order_by_id(api, response_channel, Int64(5)) @test (200 <= http_resp.status <= 206) diff --git a/test/client/runtests.jl b/test/client/runtests.jl index 82c2959..af4a380 100644 --- a/test/client/runtests.jl +++ b/test/client/runtests.jl @@ -30,8 +30,8 @@ function runtests(; skip_petstore=false, test_file_upload=false) PetStoreV3Tests.runtests(; test_file_upload=test_file_upload) end @testset "V2" begin - @info("Running petstore v2 tests") - PetStoreV2Tests.runtests() + @info("Running petstore v2 tests") + PetStoreV2Tests.runtests() end else @info("Skipping petstore tests in non Linux environment (can not run petstore docker on OSX or Windows)") From 6cdeb1919e98db3dd472ec60d9c6712574545296 Mon Sep 17 00:00:00 2001 From: Jon Alm Eriksen Date: Fri, 15 Mar 2024 03:49:01 +0100 Subject: [PATCH 3/4] fix set_param (#68) * fix set_param * remove prefix * add comments into code Co-authored-by: Tanmay Mohapatra --------- Co-authored-by: Tanmay Mohapatra --- src/client.jl | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/client.jl b/src/client.jl index 578779c..0e5afaa 100644 --- a/src/client.jl +++ b/src/client.jl @@ -293,7 +293,13 @@ end set_param(params::Dict{String,String}, name::String, value::Nothing; collection_format=",") = nothing function set_param(params::Dict{String,String}, name::String, value; collection_format=",") - if !isa(value, Vector) || isempty(collection_format) + if isa(value, Dict) + # implements the default serialization (style=form, explode=true, location=queryparams) + # as mentioned in https://swagger.io/docs/specification/serialization/ + for (k, v) in value + params[k] = string(v) + end + elseif !isa(value, Vector) || isempty(collection_format) params[name] = string(value) else dlm = get(COLL_DLM, collection_format, ",") From 6c820c5b0c5e235a6a1468ee0ab6bf237aa16d6c Mon Sep 17 00:00:00 2001 From: Tanmay Mohapatra Date: Fri, 15 Mar 2024 08:32:41 +0530 Subject: [PATCH 4/4] chore: update patch version for tagging (#70) update version to 0.1.22 --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index 54da3f0..4b16882 100644 --- a/Project.toml +++ b/Project.toml @@ -4,7 +4,7 @@ keywords = ["Swagger", "OpenAPI", "REST"] license = "MIT" desc = "OpenAPI server and client helper for Julia" authors = ["JuliaHub Inc."] -version = "0.1.21" +version = "0.1.22" [deps] Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"