docs icon indicating copy to clipboard operation
docs copied to clipboard

Fix curl request in rest code samples

Open pietervdheijden opened this issue 2 years ago • 2 comments
trafficstars

Code of Conduct

What article on docs.github.com is affected?

All rest articles containing code samples with header X-GitHub-Api-Version. For example:

  • https://docs.github.com/en/rest/releases/releases?apiVersion=2022-11-28
  • https://docs.github.com/en/rest/repos/autolinks?apiVersion=2022-11-28
  • https://docs.github.com/en/rest/repos/contents?apiVersion=2022-11-28

What part(s) of the article would you like to see updated?

Line:

-H "Authorization: Bearer <YOUR-TOKEN>"\

Doesn't have a space between " and \. As a result, the cURL request does not work correctly.

To fix this, the line should be replaced by:

-H "Authorization: Bearer <YOUR-TOKEN>" \

Additional information

image

pietervdheijden avatar Jun 30 '23 20:06 pietervdheijden

PLEASE FIX IT

NTA-MAX avatar Jul 01 '23 11:07 NTA-MAX

PLEASE FIX IT

GitHub CLI api

https://cli.github.com/manual/gh_api

gh api
--method PATCH
-H "Accept: application/vnd.github+json"
-H "X-GitHub-Api-Version: 2022-11-28"
/repos/OWNER/REPO/import
-f vcs='tfvc'
-f tfvc_project='project1'
-f human_name='project1 (tfs)'

jessjump143 avatar Jul 01 '23 12:07 jessjump143

@pietervdheijden Thanks for opening an issue! Looks like one of our bots closed your first one, so thanks for adjusting it and trying again!

I'll get this triaged for review! :zap:

cmwilson21 avatar Jul 03 '23 14:07 cmwilson21

Thank you for opening this issue! Changes to the REST API schema can be requested in github/rest-api-description. I will transfer your issue over to that open source repo.

docs-bot avatar Jul 03 '23 14:07 docs-bot

@pietervdheijden Per the bot above, these kind of changes will need to be made in /rest-api-description. I just saw your PR, so will close it in favor of this transfer 💛

cmwilson21 avatar Jul 03 '23 14:07 cmwilson21

Thank you for opening this issue! Changes to the REST API schema can be requested in github/rest-api-description. I will transfer your issue over to that open source repo.

docs-bot avatar Jul 03 '23 14:07 docs-bot

@cmwilson21 Are you sure this change has to be done in /rest-api-description? It seems that repository contains the OpenAPI reference, whereas the bug I reported is in the code sample block. Also, I can't find <YOUR-TOKEN> in repository /rest-api-description...

pietervdheijden avatar Jul 03 '23 14:07 pietervdheijden

Ok so where do I fix th

On Mon, Jul 3, 2023, 9:49 AM Pieter van der Heijden < @.***> wrote:

@cmwilson21 https://github.com/cmwilson21 Are you sure this change has to be done in /rest-api-description? It seems that repository contains the OpenAPI reference, whereas the bug I reported is in the code sample block. Also, I can't find <YOUR-TOKEN> in repository /rest-api-description...

— Reply to this email directly, view it on GitHub https://github.com/github/docs/issues/26396#issuecomment-1618513706, or unsubscribe https://github.com/notifications/unsubscribe-auth/A5HOKZ634KPW67WPSWGQH63XOLLXTANCNFSM6AAAAAAZ2ISGXU . You are receiving this because you commented.Message ID: @.***>

NTA-MAX avatar Jul 05 '23 17:07 NTA-MAX

@cmwilson21 can you still reply to my comment?

pietervdheijden avatar Jul 12 '23 18:07 pietervdheijden

@pietervdheijden Sorry for the delay, we had several out and I missed your comment. Code samples and example responses are updated internally and I believe this example fits that.

On a different note, it doesn't look like the automation to transfer this to the right repo pushed through, so I've manually opened it here. I'm going to go ahead and close this out but will happily reopen if it I am mistaken 💛

cmwilson21 avatar Jul 13 '23 15:07 cmwilson21

how and thank u

NTA-MAX avatar Jul 14 '23 03:07 NTA-MAX