Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions .github/workflows/samples-julia.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,26 @@ jobs:
shell: bash
working-directory: 'samples'
run: |
currdir=`pwd`
currdir=$(pwd)
# The julia-client/julia-server generators target the OpenAPI.jl 0.2.x series,
# maintained on the release-0.2 branch; OpenAPI.jl main hosts the 1.x rewrite
# with a different API. Testing against release-0.2 covers the latest 0.2.x fixes.
# Clone the exact branch we want instead of resolving from the registry, which can
# pick up stale or mismatched package metadata.
rm -rf ~/.julia/dev/OpenAPI
git clone --branch release-0.2 --depth 1 https://github.com/JuliaComputing/OpenAPI.jl.git ~/.julia/dev/OpenAPI

# Using develop mode to install package so that it is easier to modify the package test files
julia -e "using Pkg; Pkg.develop(\"OpenAPI\");"
julia -e 'using Pkg; Pkg.develop(path=joinpath(homedir(), ".julia", "dev", "OpenAPI")); Pkg.instantiate()'

cd ~/.julia/dev/OpenAPI
git checkout release-0.2
cd $currdir
cd "$currdir"

rm -rf ~/.julia/dev/OpenAPI/test/client/openapigenerator_petstore_v3/petstore
rm -rf ~/.julia/dev/OpenAPI/test/server/openapigenerator_petstore_v3/petstore
cp -r client/petstore/julia ~/.julia/dev/OpenAPI/test/client/openapigenerator_petstore_v3/petstore
cp -r server/petstore/julia ~/.julia/dev/OpenAPI/test/server/openapigenerator_petstore_v3/petstore

# setting this env runs only the tests relevant to the openapi-generator repo
export OPENAPI_GENERATOR=true
julia -e "using Pkg; Pkg.test(\"OpenAPI\");"
julia -e 'using Pkg; Pkg.test("OpenAPI")'
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,7 @@ paths:
required: true
schema:
type: string
format: password
responses:
'200':
description: successful operation
Expand Down Expand Up @@ -687,6 +688,7 @@ components:
type: string
password:
type: string
format: password
phone:
type: string
userStatus:
Expand Down
3 changes: 3 additions & 0 deletions samples/client/petstore/julia/src/models/model_User.jl
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ function OpenAPI.validate_property(::Type{ User }, name::Symbol, val)



if name === Symbol("password")
OpenAPI.validate_param(name, "User", :format, val, "password")
end


if name === Symbol("userStatus")
Expand Down
3 changes: 3 additions & 0 deletions samples/server/petstore/julia/src/models/model_User.jl
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ function OpenAPI.validate_property(::Type{ User }, name::Symbol, val)



if name === Symbol("password")
OpenAPI.validate_param(name, "User", :format, val, "password")
end


if name === Symbol("userStatus")
Expand Down
Loading