Skip to content

Commit

Permalink
Introduce client API versions V8 and V9
Browse files Browse the repository at this point in the history
  • Loading branch information
mdimjasevic committed Dec 5, 2024
1 parent 7917bc6 commit c0b978f
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 1 deletion.
5 changes: 4 additions & 1 deletion libs/wire-api/src/Wire/API/Routes/Version.hs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ import Wire.Arbitrary (Arbitrary, GenericUniform (GenericUniform))
-- and 'developmentVersions' stay in sync; everything else here should keep working without
-- change. See also documentation in the *docs* directory.
-- https://docs.wire.com/developer/developer/api-versioning.html#version-bump-checklist
data Version = V0 | V1 | V2 | V3 | V4 | V5 | V6 | V7
data Version = V0 | V1 | V2 | V3 | V4 | V5 | V6 | V7 | V8 | V9
deriving stock (Eq, Ord, Bounded, Enum, Show, Generic)
deriving (FromJSON, ToJSON) via (Schema Version)
deriving (Arbitrary) via (GenericUniform Version)
Expand All @@ -100,6 +100,8 @@ versionInt V4 = 4
versionInt V5 = 5
versionInt V6 = 6
versionInt V7 = 7
versionInt V8 = 8
versionInt V9 = 9

supportedVersions :: [Version]
supportedVersions = [minBound .. maxBound]
Expand Down Expand Up @@ -210,6 +212,7 @@ isDevelopmentVersion V3 = False
isDevelopmentVersion V4 = False
isDevelopmentVersion V5 = False
isDevelopmentVersion V6 = False
isDevelopmentVersion V7 = True
isDevelopmentVersion _ = True

developmentVersions :: [Version]
Expand Down
32 changes: 32 additions & 0 deletions services/brig/src/Brig/API/Public.hs
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,38 @@ internalEndpointsSwaggerDocsAPIs =
--
-- Dual to `internalEndpointsSwaggerDocsAPI`.
versionedSwaggerDocsAPI :: Servant.Server VersionedSwaggerDocsAPI
versionedSwaggerDocsAPI (Just (VersionNumber V9)) =
swaggerSchemaUIServer $
( serviceSwagger @VersionAPITag @'V9
<> serviceSwagger @BrigAPITag @'V9
<> serviceSwagger @GalleyAPITag @'V9
<> serviceSwagger @SparAPITag @'V9
<> serviceSwagger @CargoholdAPITag @'V9
<> serviceSwagger @CannonAPITag @'V9
<> serviceSwagger @GundeckAPITag @'V9
<> serviceSwagger @ProxyAPITag @'V9
<> serviceSwagger @OAuthAPITag @'V9
)
& S.info . S.title .~ "Wire-Server API"
& S.info . S.description ?~ $(embedText =<< makeRelativeToProject "docs/swagger.md")
& S.servers .~ [S.Server ("/" <> toUrlPiece V9) Nothing mempty]
& cleanupSwagger
versionedSwaggerDocsAPI (Just (VersionNumber V8)) =
swaggerSchemaUIServer $
( serviceSwagger @VersionAPITag @'V8
<> serviceSwagger @BrigAPITag @'V8
<> serviceSwagger @GalleyAPITag @'V8
<> serviceSwagger @SparAPITag @'V8
<> serviceSwagger @CargoholdAPITag @'V8
<> serviceSwagger @CannonAPITag @'V8
<> serviceSwagger @GundeckAPITag @'V8
<> serviceSwagger @ProxyAPITag @'V8
<> serviceSwagger @OAuthAPITag @'V8
)
& S.info . S.title .~ "Wire-Server API"
& S.info . S.description ?~ $(embedText =<< makeRelativeToProject "docs/swagger.md")
& S.servers .~ [S.Server ("/" <> toUrlPiece V8) Nothing mempty]
& cleanupSwagger
versionedSwaggerDocsAPI (Just (VersionNumber V7)) =
swaggerSchemaUIServer $
( serviceSwagger @VersionAPITag @'V7
Expand Down

0 comments on commit c0b978f

Please sign in to comment.