phrase/phrase-go

Teams methods doesn't work

johanblondeau opened this issue · 8 comments

In api_teams.go, there are wrong replacement (in localVarPath) for {team_id} parameter :

localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", _neturl.QueryEscape(parameterToString(id, "")), -1)

Need to be replaced by :

localVarPath = strings.Replace(localVarPath, "{"+"team_id"+"}", _neturl.QueryEscape(parameterToString(id, "")), -1)

Error are in TeamDelete, TeamShow and TeamUpdate methods.

I try to push a pull request, but i have no access.

Thanks for your feedback, we currently need to use this Phrase Go Client in my company.

Hi Johan,

Thanks for reaching out to us.

I will close this thread and get back to you personally on the support ticket you submitted. Thank you for the provided information.

Best,
Domenica from the Phrase Technical Support Team

Comment by Domenica

Hi @johanblondeau ,

thanks for reporting this.
The library is generated by the openapi specification: https://github.com/phrase/openapi
You should be able to contribute to this repository.

We have logged this bug internally and will handle it in the upcoming weeks.

@johanblondeau in order to open a PR, you can fork the repo, git remote add... locally, push your branch there, and then open a PR from there.

Thanks for your feedback. Unfortunatly, i cannot push on repo :

➜ phrase-go git:(fix/id-replacement-api-call) ✗ git push origin fix/id-replacement-api-call
remote: Permission to phrase/phrase-go.git denied to johanblondeau.
fatal: unable to access 'https://github.com/phrase/phrase-go/': The requested URL returned error: 403

@johanblondeau yes, because you are trying to push to the original repo, which you don't have the access to. You need to fork first. Read this: https://docs.github.com/en/get-started/quickstart/fork-a-repo

But please don't try to fix the problem. As @forelabs already mentioned, this whole library is automatically generated from https://github.com/phrase/openapi. The problem needs to get fixed there.

OK, i let you fix the problem. Thanks a lot

Hi @johanblondeau, I've just published a new release https://github.com/phrase/phrase-cli/releases/tag/2.5.2. Now you can call those three teams endpoints by passing the param --id <id>. Thanks again for reporting this!

It's OK now.
Just for information : you have published a new release 2.5.2 but when we perform a "go get", it seams that it appear with one more minor version :
github.com/phrase/phrase-go/v2 v2.6.1

I'm not sure it's important, but just to inform you