Skip to content

Commit 20b801f

Browse files
ci: update Julia sample workflow to use the exact OpenAPI release-0.2 checkout
1 parent 7d10a3c commit 20b801f

4 files changed

Lines changed: 20 additions & 5 deletions

File tree

‎.github/workflows/samples-julia.yaml‎

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,26 @@ jobs:
2424
shell: bash
2525
working-directory: 'samples'
2626
run: |
27-
currdir=`pwd`
27+
currdir=$(pwd)
2828
# The julia-client/julia-server generators target the OpenAPI.jl 0.2.x series,
2929
# maintained on the release-0.2 branch; OpenAPI.jl main hosts the 1.x rewrite
3030
# with a different API. Testing against release-0.2 covers the latest 0.2.x fixes.
31+
# Clone the exact branch we want instead of resolving from the registry, which can
32+
# pick up stale or mismatched package metadata.
33+
rm -rf ~/.julia/dev/OpenAPI
34+
git clone --branch release-0.2 --depth 1 https://github.com/JuliaComputing/OpenAPI.jl.git ~/.julia/dev/OpenAPI
35+
3136
# Using develop mode to install package so that it is easier to modify the package test files
32-
julia -e "using Pkg; Pkg.develop(\"OpenAPI\");"
37+
julia -e 'using Pkg; Pkg.develop(path=joinpath(homedir(), ".julia", "dev", "OpenAPI")); Pkg.instantiate()'
38+
3339
cd ~/.julia/dev/OpenAPI
34-
git checkout release-0.2
35-
cd $currdir
40+
cd "$currdir"
41+
3642
rm -rf ~/.julia/dev/OpenAPI/test/client/openapigenerator_petstore_v3/petstore
3743
rm -rf ~/.julia/dev/OpenAPI/test/server/openapigenerator_petstore_v3/petstore
3844
cp -r client/petstore/julia ~/.julia/dev/OpenAPI/test/client/openapigenerator_petstore_v3/petstore
3945
cp -r server/petstore/julia ~/.julia/dev/OpenAPI/test/server/openapigenerator_petstore_v3/petstore
46+
4047
# setting this env runs only the tests relevant to the openapi-generator repo
4148
export OPENAPI_GENERATOR=true
42-
julia -e "using Pkg; Pkg.test(\"OpenAPI\");"
49+
julia -e 'using Pkg; Pkg.test("OpenAPI")'

‎modules/openapi-generator/src/test/resources/3_0/julia/petstore.yaml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -452,6 +452,7 @@ paths:
452452
required: true
453453
schema:
454454
type: string
455+
format: password
455456
responses:
456457
'200':
457458
description: successful operation
@@ -687,6 +688,7 @@ components:
687688
type: string
688689
password:
689690
type: string
691+
format: password
690692
phone:
691693
type: string
692694
userStatus:

‎samples/client/petstore/julia/src/models/model_User.jl‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@ function OpenAPI.validate_property(::Type{ User }, name::Symbol, val)
7070

7171

7272

73+
if name === Symbol("password")
74+
OpenAPI.validate_param(name, "User", :format, val, "password")
75+
end
7376

7477

7578
if name === Symbol("userStatus")

‎samples/server/petstore/julia/src/models/model_User.jl‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@ function OpenAPI.validate_property(::Type{ User }, name::Symbol, val)
7070

7171

7272

73+
if name === Symbol("password")
74+
OpenAPI.validate_param(name, "User", :format, val, "password")
75+
end
7376

7477

7578
if name === Symbol("userStatus")

0 commit comments

Comments
 (0)