Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
battermann committed Nov 2, 2022
1 parent 48bf0bd commit d49f964
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 22 deletions.
18 changes: 9 additions & 9 deletions libs/types-common/src/Data/Misc.hs
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,9 @@ instance ToSchema Location where
object "Location" $
Location
<$> _latitude
.= field "lat" genericToSchema
.= field "lat" genericToSchema
<*> _longitude
.= field "lon" genericToSchema
.= field "lon" genericToSchema

instance Show Location where
show p =
Expand Down Expand Up @@ -276,9 +276,9 @@ instance ToSchema HttpsUrl where
(decodeUtf8 . toByteString')
.= parsedText "HttpsUrl" (runParser parser . encodeUtf8)
& doc'
. S.schema
. S.example
?~ toJSON ("https://example.com" :: Text)
. S.schema
. S.example
?~ toJSON ("https://example.com" :: Text)

instance Cql HttpsUrl where
ctype = Tagged BlobColumn
Expand Down Expand Up @@ -325,9 +325,9 @@ instance ToSchema (Fingerprint Rsa) where
(decodeUtf8 . B64.encode . fingerprintBytes)
.= parsedText "Fingerprint" (runParser p . encodeUtf8)
& doc'
. S.schema
. S.example
?~ toJSON ("ioy3GeIjgQRsobf2EKGO3O8mq/FofFxHRqy0T4ERIZ8=" :: Text)
. S.schema
. S.example
?~ toJSON ("ioy3GeIjgQRsobf2EKGO3O8mq/FofFxHRqy0T4ERIZ8=" :: Text)
where
p :: Chars.Parser (Fingerprint Rsa)
p = do
Expand Down Expand Up @@ -362,7 +362,7 @@ instance ToSchema PlainTextPassword where
schema =
PlainTextPassword
<$> fromPlainTextPassword
.= untypedRangedSchema 6 1024 schema
.= untypedRangedSchema 6 1024 schema

instance Arbitrary PlainTextPassword where
-- TODO: why 6..1024? For tests we might want invalid passwords as well, e.g. 3 chars
Expand Down
22 changes: 11 additions & 11 deletions libs/wire-api/src/Wire/API/Call/Config.hs
Original file line number Diff line number Diff line change
Expand Up @@ -126,13 +126,13 @@ instance ToSchema RTCConfiguration where
objectWithDocModifier "RTCConfiguration" (description ?~ "A subset of the WebRTC 'RTCConfiguration' dictionary") $
RTCConfiguration
<$> _rtcConfIceServers
.= fieldWithDocModifier "ice_servers" (description ?~ "Array of 'RTCIceServer' objects") (nonEmptyArray schema)
.= fieldWithDocModifier "ice_servers" (description ?~ "Array of 'RTCIceServer' objects") (nonEmptyArray schema)
<*> _rtcConfSftServers
.= maybe_ (optFieldWithDocModifier "sft_servers" (description ?~ "Array of 'SFTServer' objects (optional)") (nonEmptyArray schema))
.= maybe_ (optFieldWithDocModifier "sft_servers" (description ?~ "Array of 'SFTServer' objects (optional)") (nonEmptyArray schema))
<*> _rtcConfTTL
.= fieldWithDocModifier "ttl" (description ?~ "Number of seconds after which the configuration should be refreshed (advisory)") schema
.= fieldWithDocModifier "ttl" (description ?~ "Number of seconds after which the configuration should be refreshed (advisory)") schema
<*> _rtcConfSftServersAll
.= maybe_ (optFieldWithDocModifier "sft_servers_all" (description ?~ "Array of all SFT servers") (array schema))
.= maybe_ (optFieldWithDocModifier "sft_servers_all" (description ?~ "Array of all SFT servers") (array schema))

--------------------------------------------------------------------------------
-- SFTServer
Expand All @@ -149,7 +149,7 @@ instance ToSchema SFTServer where
objectWithDocModifier "SftServer" (description ?~ "Inspired by WebRTC 'RTCIceServer' object, contains details of SFT servers") $
SFTServer
<$> (pure . _sftURL)
.= fieldWithDocModifier "urls" (description ?~ "Array containing exactly one SFT server address of the form 'https://<addr>:<port>'") (withParser (array schema) p)
.= fieldWithDocModifier "urls" (description ?~ "Array containing exactly one SFT server address of the form 'https://<addr>:<port>'") (withParser (array schema) p)
where
p :: [HttpsUrl] -> A.Parser HttpsUrl
p [url] = pure url
Expand Down Expand Up @@ -181,11 +181,11 @@ instance ToSchema RTCIceServer where
objectWithDocModifier "RTCIceServer" (description ?~ "A subset of the WebRTC 'RTCIceServer' object") $
RTCIceServer
<$> _iceURLs
.= fieldWithDocModifier "urls" (description ?~ "Array of TURN server addresses of the form 'turn:<addr>:<port>'") (nonEmptyArray schema)
.= fieldWithDocModifier "urls" (description ?~ "Array of TURN server addresses of the form 'turn:<addr>:<port>'") (nonEmptyArray schema)
<*> _iceUsername
.= fieldWithDocModifier "username" (description ?~ "Username to use for authenticating against the given TURN servers") schema
.= fieldWithDocModifier "username" (description ?~ "Username to use for authenticating against the given TURN servers") schema
<*> _iceCredential
.= fieldWithDocModifier "credential" (description ?~ "Password to use for authenticating against the given TURN servers") schema
.= fieldWithDocModifier "credential" (description ?~ "Password to use for authenticating against the given TURN servers") schema

--------------------------------------------------------------------------------
-- TurnURI
Expand Down Expand Up @@ -302,9 +302,9 @@ turnHostSchema =
object "TurnHost" $
fromTagged
<$> toTagged
.= bind
(fst .= field "tag" tagSchema)
(snd .= fieldOver _1 "contents" untaggedSchema)
.= bind
(fst .= field "tag" tagSchema)
(snd .= fieldOver _1 "contents" untaggedSchema)
where
toTagged :: TurnHost -> (TurnHostTag, TurnHost)
toTagged d@(TurnHostIp _) = (TurnHostIpTag, d)
Expand Down
4 changes: 2 additions & 2 deletions libs/wire-api/src/Wire/API/Routes/Public/Brig.hs
Original file line number Diff line number Diff line change
Expand Up @@ -547,9 +547,9 @@ instance ToSchema DeprecatedMatchingResult where
"DeprecatedMatchingResult"
$ DeprecatedMatchingResult
<$ const []
.= field "results" (array (null_ @SwaggerDoc))
.= field "results" (array (null_ @SwaggerDoc))
<* const []
.= field "auto-connects" (array (null_ @SwaggerDoc))
.= field "auto-connects" (array (null_ @SwaggerDoc))

data ActivationRespWithStatus
= ActivationResp ActivationResponse
Expand Down

0 comments on commit d49f964

Please sign in to comment.