git.iko.soy/typeable/openapi3
on 93d7dff help sign in
6 files changed+40−118
since splitsnapshots
unifiedsplit
.github/workflows/haskell-ci.yml+29−82 CHANGELOG.md−14 cabal.haskell-ci−4 openapi3.cabal+8−9 src/Data/OpenApi/Internal/Schema.hs+3−6 test/Data/OpenApi/Schema/ValidationSpec.hs−3
.github/workflows/haskell-ci.yml+29−82
@@ -8,9 +8,9 @@
88#
99# For more information, see https://github.com/haskell-CI/haskell-ci
1010#
11−# version: 0.14.3
11+# version: 0.12.1
1212#
13−# REGENDATA ("0.14.3",["github","cabal.project"])
13+# REGENDATA ("0.12.1",["github","cabal.project"])
1414#
1515name: Haskell-CI
1616on:
@@ -24,101 +24,55 @@ jobs:
2424 linux:
2525 name: Haskell-CI - Linux - ${{ matrix.compiler }}
2626 runs-on: ubuntu-18.04
27− timeout-minutes:
28− 60
2927 container:
30− image: buildpack-deps:focal
28+ image: buildpack-deps:bionic
3129 continue-on-error: ${{ matrix.allow-failure }}
3230 strategy:
3331 matrix:
3432 include:
35− - compiler: ghc-9.2.2
36− compilerKind: ghc
37− compilerVersion: 9.2.2
38− setup-method: ghcup
33+ - compiler: ghc-9.0.1
3934 allow-failure: true
40− - compiler: ghc-9.0.2
41− compilerKind: ghc
42− compilerVersion: 9.0.2
43− setup-method: ghcup
44− allow-failure: false
45− - compiler: ghc-8.10.7
46− compilerKind: ghc
47− compilerVersion: 8.10.7
48− setup-method: ghcup
35+ - compiler: ghc-8.10.4
4936 allow-failure: false
5037 - compiler: ghc-8.8.4
51− compilerKind: ghc
52− compilerVersion: 8.8.4
53− setup-method: hvr-ppa
5438 allow-failure: false
5539 - compiler: ghc-8.6.5
56− compilerKind: ghc
57− compilerVersion: 8.6.5
58− setup-method: hvr-ppa
5940 allow-failure: false
6041 - compiler: ghc-8.4.4
61− compilerKind: ghc
62− compilerVersion: 8.4.4
63− setup-method: hvr-ppa
6442 allow-failure: false
6543 fail-fast: false
6644 steps:
6745 - name: apt
6846 run: |
6947 apt-get update
70− apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5
71− if [ "${{ matrix.setup-method }}" = ghcup ]; then
72− mkdir -p "$HOME/.ghcup/bin"
73− curl -sL https://downloads.haskell.org/ghcup/0.1.17.5/x86_64-linux-ghcup-0.1.17.5 > "$HOME/.ghcup/bin/ghcup"
74− chmod a+x "$HOME/.ghcup/bin/ghcup"
75− "$HOME/.ghcup/bin/ghcup" install ghc "$HCVER"
76− "$HOME/.ghcup/bin/ghcup" install cabal 3.6.2.0
77− else
78− apt-add-repository -y 'ppa:hvr/ghc'
79− apt-get update
80− apt-get install -y "$HCNAME"
81− mkdir -p "$HOME/.ghcup/bin"
82− curl -sL https://downloads.haskell.org/ghcup/0.1.17.5/x86_64-linux-ghcup-0.1.17.5 > "$HOME/.ghcup/bin/ghcup"
83− chmod a+x "$HOME/.ghcup/bin/ghcup"
84− "$HOME/.ghcup/bin/ghcup" install cabal 3.6.2.0
85− fi
48+ apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common
49+ apt-add-repository -y 'ppa:hvr/ghc'
50+ apt-get update
51+ apt-get install -y $CC cabal-install-3.4
8652 env:
87− HCKIND: ${{ matrix.compilerKind }}
88− HCNAME: ${{ matrix.compiler }}
89− HCVER: ${{ matrix.compilerVersion }}
53+ CC: ${{ matrix.compiler }}
9054 - name: Set PATH and environment variables
9155 run: |
9256 echo "$HOME/.cabal/bin" >> $GITHUB_PATH
93− echo "LANG=C.UTF-8" >> "$GITHUB_ENV"
94− echo "CABAL_DIR=$HOME/.cabal" >> "$GITHUB_ENV"
95− echo "CABAL_CONFIG=$HOME/.cabal/config" >> "$GITHUB_ENV"
96− HCDIR=/opt/$HCKIND/$HCVER
97− if [ "${{ matrix.setup-method }}" = ghcup ]; then
98− HC=$HOME/.ghcup/bin/$HCKIND-$HCVER
99− echo "HC=$HC" >> "$GITHUB_ENV"
100− echo "HCPKG=$HOME/.ghcup/bin/$HCKIND-pkg-$HCVER" >> "$GITHUB_ENV"
101− echo "HADDOCK=$HOME/.ghcup/bin/haddock-$HCVER" >> "$GITHUB_ENV"
102− echo "CABAL=$HOME/.ghcup/bin/cabal-3.6.2.0 -vnormal+nowrap" >> "$GITHUB_ENV"
103− else
104− HC=$HCDIR/bin/$HCKIND
105− echo "HC=$HC" >> "$GITHUB_ENV"
106− echo "HCPKG=$HCDIR/bin/$HCKIND-pkg" >> "$GITHUB_ENV"
107− echo "HADDOCK=$HCDIR/bin/haddock" >> "$GITHUB_ENV"
108− echo "CABAL=$HOME/.ghcup/bin/cabal-3.6.2.0 -vnormal+nowrap" >> "$GITHUB_ENV"
109− fi
110−
57+ echo "LANG=C.UTF-8" >> $GITHUB_ENV
58+ echo "CABAL_DIR=$HOME/.cabal" >> $GITHUB_ENV
59+ echo "CABAL_CONFIG=$HOME/.cabal/config" >> $GITHUB_ENV
60+ HCDIR=$(echo "/opt/$CC" | sed 's/-/\//')
61+ HCNAME=ghc
62+ HC=$HCDIR/bin/$HCNAME
63+ echo "HC=$HC" >> $GITHUB_ENV
64+ echo "HCPKG=$HCDIR/bin/$HCNAME-pkg" >> $GITHUB_ENV
65+ echo "HADDOCK=$HCDIR/bin/haddock" >> $GITHUB_ENV
66+ echo "CABAL=/opt/cabal/3.4/bin/cabal -vnormal+nowrap" >> $GITHUB_ENV
11167 HCNUMVER=$(${HC} --numeric-version|perl -ne '/^(\d+)\.(\d+)\.(\d+)(\.(\d+))?$/; print(10000 * $1 + 100 * $2 + ($3 == 0 ? $5 != 1 : $3))')
112− echo "HCNUMVER=$HCNUMVER" >> "$GITHUB_ENV"
113− echo "ARG_TESTS=--enable-tests" >> "$GITHUB_ENV"
114− echo "ARG_BENCH=--enable-benchmarks" >> "$GITHUB_ENV"
115− echo "HEADHACKAGE=false" >> "$GITHUB_ENV"
116− echo "ARG_COMPILER=--$HCKIND --with-compiler=$HC" >> "$GITHUB_ENV"
117− echo "GHCJSARITH=0" >> "$GITHUB_ENV"
68+ echo "HCNUMVER=$HCNUMVER" >> $GITHUB_ENV
69+ echo "ARG_TESTS=--enable-tests" >> $GITHUB_ENV
70+ echo "ARG_BENCH=--enable-benchmarks" >> $GITHUB_ENV
71+ echo "HEADHACKAGE=false" >> $GITHUB_ENV
72+ echo "ARG_COMPILER=--$HCNAME --with-compiler=$HC" >> $GITHUB_ENV
73+ echo "GHCJSARITH=0" >> $GITHUB_ENV
11874 env:
119− HCKIND: ${{ matrix.compilerKind }}
120− HCNAME: ${{ matrix.compiler }}
121− HCVER: ${{ matrix.compilerVersion }}
75+ CC: ${{ matrix.compiler }}
12276 - name: env
12377 run: |
12478 env
@@ -141,10 +95,6 @@ jobs:
14195 repository hackage.haskell.org
14296 url: http://hackage.haskell.org/
14397 EOF
144− cat >> $CABAL_CONFIG <<EOF
145− program-default-options
146− ghc-options: $GHCJOBS +RTS -M3G -RTS
147− EOF
14898 cat $CABAL_CONFIG
14999 - name: versions
150100 run: |
@@ -183,8 +133,7 @@ jobs:
183133 - name: generate cabal.project
184134 run: |
185135 PKGDIR_openapi3="$(find "$GITHUB_WORKSPACE/unpacked" -maxdepth 1 -type d -regex '.*/openapi3-[0-9.]*')"
186− echo "PKGDIR_openapi3=${PKGDIR_openapi3}" >> "$GITHUB_ENV"
187− rm -f cabal.project cabal.project.local
136+ echo "PKGDIR_openapi3=${PKGDIR_openapi3}" >> $GITHUB_ENV
188137 touch cabal.project
189138 touch cabal.project.local
190139 echo "packages: ${PKGDIR_openapi3}" >> cabal.project
@@ -235,9 +184,7 @@ jobs:
235184 rm -f cabal.project.local
236185 - name: constraint set aeson-2
237186 run: |
238− $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --constraint='aeson >=2.0' --dependencies-only -j2 all
239187 $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --constraint='aeson >=2.0' all
240188 - name: constraint set aeson-1
241189 run: |
242− if [ $((HCNUMVER < 90200)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --constraint='aeson <2.0' --dependencies-only -j2 all ; fi
243− if [ $((HCNUMVER < 90200)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --constraint='aeson <2.0' all ; fi
190+ $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --constraint='aeson <2.0' all
CHANGELOG.md−14
@@ -1,20 +1,6 @@
11Unreleased
22----------
33
4−3.2.2
5−-----
6−
7−- Fix bug with infinite recursion in GToSchema [#37](https://github.com/biocad/openapi3/pull/37).
8−
9−3.2.1
10−-----
11−
12−- Support aeson-2.0.3.
13−- Support GHC-9.2 (doctests still fail).
14−
15−3.2.0
16−-----
17−
184- Support aeson-2 [#34](https://github.com/biocad/openapi3/pull/34).
195- Use `SecurityDefinitions` type for `_componentsSecuritySchemes`
206 [#32](https://github.com/biocad/openapi3/pull/32).
cabal.haskell-ci−4
@@ -1,11 +1,7 @@
11branches: master
22
3−distribution: focal
4−allow-failures: >=9.2
5−
63constraint-set aeson-1
74 constraints: aeson <2.0
8− ghc: <9.2
95
106constraint-set aeson-2
117 constraints: aeson >=2.0
openapi3.cabal+8−9
@@ -1,6 +1,6 @@
11cabal-version: >=1.10
22name: openapi3
3−version: 3.2.2
3+version: 3.2.0
44
55synopsis: OpenAPI 3.0 data model
66category: Web, Swagger, OpenApi
@@ -26,9 +26,8 @@ tested-with:
2626 GHC ==8.4.4
2727 || ==8.6.5
2828 || ==8.8.4
29− || ==8.10.7
30− || ==9.0.2
31− || ==9.2.2
29+ || ==8.10.4
30+ || ==9.0.1
3231
3332custom-setup
3433 setup-depends:
@@ -61,16 +60,16 @@ library
6160
6261 -- GHC boot libraries
6362 build-depends:
64− base >=4.11.1.0 && <4.17
65− , bytestring >=0.10.8.2 && <0.12
63+ base >=4.11.1.0 && <4.16
64+ , bytestring >=0.10.8.2 && <0.11
6665 , containers >=0.5.11.0 && <0.7
67− , template-haskell >=2.13.0.0 && <2.19
68− , time >=1.8.0.2 && <1.14
66+ , template-haskell >=2.13.0.0 && <2.18
67+ , time >=1.8.0.2 && <1.10
6968 , transformers >=0.5.5.0 && <0.6
7069
7170 build-depends:
7271 mtl >=2.2.2 && <2.3
73− , text >=1.2.3.1 && <2.1
72+ , text >=1.2.3.1 && <1.3
7473
7574 -- other dependencies
7675 build-depends:
src/Data/OpenApi/Internal/Schema.hs+3−6
@@ -945,13 +945,10 @@ instance (Selector s, GToSchema f, GToSchema (S1 s f)) => GToSchema (C1 c (S1 s
945945 case schema ^. items of
946946 Just (OpenApiItemsArray [_]) -> fieldSchema
947947 _ -> do
948− -- We have to run recordSchema instead of just using its defs,
949− -- since those can be recursive and will lead to infinite loop,
950− -- see https://github.com/biocad/openapi3/pull/37
951− NamedSchema _ schema' <- recordSchema
952− return (unnamed schema')
948+ NamedSchema _ schema <- recordSchema
949+ return (unnamed schema)
953950 where
954− (_, NamedSchema _ schema) = runDeclare recordSchema mempty
951+ (defs, NamedSchema _ schema) = runDeclare recordSchema mempty
955952 recordSchema = gdeclareNamedSchema opts (Proxy :: Proxy (S1 s f)) s
956953 fieldSchema = gdeclareNamedSchema opts (Proxy :: Proxy f) s
957954
test/Data/OpenApi/Schema/ValidationSpec.hs−3
@@ -301,8 +301,6 @@ instance Eq ZonedTime where
301301-- Arbitrary instance for Data.Aeson.Value
302302-- ========================================================================
303303
304−-- These instances were introduces in aeson upstream in 2.0.3
305−#if !MIN_VERSION_aeson(2,0,3)
306304instance Arbitrary Value where
307305 -- Weights are almost random
308306 -- Uniform oneof tends not to build complex objects cause of recursive call.
@@ -321,4 +319,3 @@ instance Arbitrary v => Arbitrary (KeyMap.KeyMap v) where
321319instance Arbitrary Key.Key where
322320 arbitrary = Key.fromText <$> arbitrary
323321#endif
324−#endif