File tree Expand file tree Collapse file tree
lib/rest/static/decorated Expand file tree Collapse file tree Original file line number Diff line number Diff line change 7801678016 "x-codeSamples": [
7801778017 {
7801878018 "lang": "Shell",
78019- "source": "curl \\\n -X POST \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n https://api .github.com/repos/octocat/hello-world/releases/42/assets",
78020- "html": "<pre><code class=\"hljs language-shell\">curl \\\n -X POST \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n https://api .github.com/repos/octocat/hello-world/releases/42/assets</code></pre>"
78019+ "source": "curl \\\n -X POST \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n https://uploads .github.com/repos/octocat/hello-world/releases/42/assets",
78020+ "html": "<pre><code class=\"hljs language-shell\">curl \\\n -X POST \\\n -H \"Accept: application/vnd.github.v3+json\" \\\n https://uploads .github.com/repos/octocat/hello-world/releases/42/assets</code></pre>"
7802178021 },
7802278022 {
7802378023 "lang": "JavaScript",
Original file line number Diff line number Diff line change @@ -20,6 +20,15 @@ function createCodeSamples(operation) {
2020 const serverUrl = operation . serverUrl
2121
2222 const codeSampleParams = { route, serverUrl }
23+
24+ if (
25+ operation . operationId === 'repos/upload-release-asset' &&
26+ Object . prototype . hasOwnProperty . call ( operation , 'servers' ) &&
27+ serverUrl === 'https://api.github.com'
28+ ) {
29+ codeSampleParams . serverUrl = operation . servers [ 0 ] . variables . origin . default
30+ }
31+
2332 return [
2433 { lang : 'Shell' , source : toShellExample ( codeSampleParams ) } ,
2534 { lang : 'JavaScript' , source : toJsExample ( codeSampleParams ) } ,
You can’t perform that action at this time.
0 commit comments