Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gogol-pubsub: PubSub projects.topics.publish method generates incorrect URL #49

Closed
iand675 opened this issue Nov 28, 2016 · 1 comment
Closed
Assignees
Labels

Comments

@iand675
Copy link

iand675 commented Nov 28, 2016

According to the official docs from Google, the URL format should be:

POST https://pubsub.googleapis.com/v1/{topic=projects/*/topics/*}:publish

However, the publish URL being generated is missing the colon between the topic and "publish": /v1/projects/my-project-here/topics/topic-testerpublish

It works fine though if I add a colon myself, but I doubt that's the intended way to use the library:

{-# LANGUAGE OverloadedStrings #-}
import Control.Lens           ((&), (.~), (<&>), (?~))
import Data.Text              (Text)
import Network.Google
import Network.Google.PubSub
import System.IO              (stdout)

import qualified Data.Text as Text

example :: IO PublishResponse
example = do
    lgr  <- newLogger Debug stdout
    env  <- newEnv <&> (envLogger .~ lgr) . (envScopes .~ pubSubScope)

    runResourceT . runGoogle env $ do
      send $ projectsTopicsPublish 
        (publishRequest & prMessages .~ [pubsubMessage & pmData ?~ "Hi!"])
        "projects/my-project-here/topics/topic-tester:"
@brendanhay brendanhay added the bug label Dec 1, 2016
@brendanhay brendanhay self-assigned this Dec 1, 2016
@brendanhay
Copy link
Owner

Looks like this is correctly fixed in develop via #34

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants