Skip to content

Commit

Permalink
revert the api version upgrade, it wasn't forward-compatible enough
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom Sydney Kerckhove committed Dec 8, 2021
1 parent 0d4e0b4 commit 489f5b5
Show file tree
Hide file tree
Showing 8 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion smos-api-gen/test_resources/api-version/output.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
"0.2.2"
"0.2.1"
10 changes: 5 additions & 5 deletions smos-api/src/Smos/API.hs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ import Smos.Report.Agenda
import Smos.Report.Next

apiVersion :: Version
apiVersion = version 0 2 2 [] []
apiVersion = version 0 2 1 [] []

smosAPI :: Proxy SmosAPI
smosAPI = Proxy
Expand Down Expand Up @@ -167,12 +167,12 @@ instance HasCodec Register where
object "Register" $
Register
<$> parseAlternative
(requiredField "username" "username")
(requiredField "registerUsername" "legacy key")
(requiredField "username" "username")
.= registerUsername
<*> parseAlternative
(requiredField "password" "password")
(requiredField "registerPassword" "legacy key")
(requiredField "password" "password")
.= registerPassword

type PostLogin =
Expand All @@ -195,8 +195,8 @@ instance HasCodec Login where
codec =
object "Login" $
Login
<$> parseAlternative (requiredField "username" "username") (requiredField "loginUsername" "legacy key") .= loginUsername
<*> parseAlternative (requiredField "password" "password") (requiredField "loginPassword" "legacy key") .= loginPassword
<$> parseAlternative (requiredField "loginUsername" "legacy key") (requiredField "username" "username") .= loginUsername
<*> parseAlternative (requiredField "loginPassword" "legacy key") (requiredField "password" "password") .= loginPassword

type PostStripeHook = "stripe" :> ReqBody '[JSON] JSON.Value :> PostNoContent '[JSON] NoContent

Expand Down
2 changes: 1 addition & 1 deletion smos-client/src/Smos/Client.hs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ oldestSupportedAPIVersion = version 0 0 0 [] []

-- | Update this to a newer version than the current to build in forward-compatibility
newestSupportedAPIVersion :: Version
newestSupportedAPIVersion = apiVersion
newestSupportedAPIVersion = version 0 3 0 [] []

clientVersionCheck :: ClientM (Version, VersionCheck)
clientVersionCheck = do
Expand Down

0 comments on commit 489f5b5

Please sign in to comment.