We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0c42f65 commit 2eb618aCopy full SHA for 2eb618a
1 file changed
src/rest/components/get-rest-code-samples.ts
@@ -39,6 +39,16 @@ export function getShellExample(
39
contentTypeHeader = '-H "Content-Type: multipart/form-data"'
40
}
41
42
+ // GHES Manage API requests differ from the dotcom API requests and make use of multipart/form-data and json content types
43
+ if (operation.subcategory === 'manage-ghes') {
44
+ // GET requests don't have a requestBody set, therefore let's default them to application/json
45
+ if (operation.verb === 'get') {
46
+ contentTypeHeader = '-H "Content-Type: application/json"'
47
+ } else {
48
+ contentTypeHeader = `-H "Content-Type: ${codeSample?.request?.contentType}"`
49
+ }
50
51
+
52
let requestPath = codeSample?.request?.parameters
53
? parseTemplate(operation.requestPath).expand(codeSample.request.parameters)
54
: operation.requestPath
0 commit comments