@@ -31,7 +31,6 @@ import Data.Aeson hiding (Array, Bool, Object, String)
3131import qualified Data.Aeson as A
3232import Data.Aeson.TH
3333import Data.Aeson.Types (Parser)
34−import Data.Foldable (foldMap)
3534import Data.Function (on)
3635import qualified Data.HashMap.Strict as Map
3736import Data.Maybe
@@ -439,12 +438,10 @@ serviceName = Text.unpack . (<> "Service") . toCamel . _sCanonicalName
439438
440439scopeName :: Service a -> Text -> String
441440scopeName s k = Text.unpack . toCamel $
442− case parts of
441+ case filter (not . url) (Text.split (== '/') k) of
443442 [] -> _sCanonicalName s <> "AllScope"
444443 xs -> foldMap upperHead xs <> "Scope"
445444 where
446− parts = filter (not . url) (Text.split (== '/') k)
447−
448445 url x = Text.null x
449446 || Text.isPrefixOf "http" x
450447 || Text.isPrefixOf "www" x