1
0
mirror of synced 2025-12-20 10:28:40 -05:00

Fix server URL for repos/upload-release-asset (#23838)

* Fix server URL for repos/upload-release-asset

* Add updated decorated file
This commit is contained in:
Robert Sese
2022-01-05 14:58:00 -06:00
committed by GitHub
parent cfd40fb2ab
commit 9234921dca
2 changed files with 11 additions and 2 deletions

View File

@@ -20,6 +20,15 @@ function createCodeSamples(operation) {
const serverUrl = operation.serverUrl
const codeSampleParams = { route, serverUrl }
if (
operation.operationId === 'repos/upload-release-asset' &&
Object.prototype.hasOwnProperty.call(operation, 'servers') &&
serverUrl === 'https://api.github.com'
) {
codeSampleParams.serverUrl = operation.servers[0].variables.origin.default
}
return [
{ lang: 'Shell', source: toShellExample(codeSampleParams) },
{ lang: 'JavaScript', source: toJsExample(codeSampleParams) },