Skip to content

Commit

Permalink
Fix make clean; allow new data constructors in ToSchema Version. (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
fisx authored Jan 10, 2023
1 parent 43a6a3d commit 6f91151
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 6 deletions.
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ endif
.PHONY: clean
clean:
cabal clean
$(MAKE) -C services/nginz clean
-rm -rf dist

.PHONY: clean-hint
Expand Down
1 change: 1 addition & 0 deletions changelog.d/5-internal/pr-2965
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix `make clean`; allow new data constructors in `ToSchema Version` instance
6 changes: 1 addition & 5 deletions libs/wire-api/src/Wire/API/Routes/Version.hs
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,7 @@ data Version = V0 | V1 | V2 | V3
instance ToSchema Version where
schema =
enum @Integer "Version" . mconcat $
[ element 0 V0,
element 1 V1,
element 2 V2,
element 3 V3
]
(\v -> element (fromIntegral $ fromEnum v) v) <$> [minBound @Version ..]

mkVersion :: Integer -> Maybe Version
mkVersion n = case Aeson.fromJSON (Aeson.Number (fromIntegral n)) of
Expand Down

0 comments on commit 6f91151

Please sign in to comment.