Skip to content
4 changes: 3 additions & 1 deletion tools/cli/internal/openapi/filter/code_sample.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,17 @@ func (f *CodeSampleFilter) Apply() error {
}

func (f *CodeSampleFilter) newCurlCodeSamplesForOperation(pathName, opMethod string) codeSample {
version := apiVersion(f.metadata.targetVersion)
source := "curl --user \"{PUBLIC-KEY}:{PRIVATE-KEY}\" \\\n --digest \\\n " +
"--header \"Accept: application/vnd.atlas." + apiVersion(f.metadata.targetVersion) + "+json\" \\\n "
"--header \"Accept: application/vnd.atlas." + version + "+json\" \\\n "

switch opMethod {
case "GET":
source += "-X " + opMethod + " \"" + pathName + "?pretty=true\""
case "DELETE":
source += "-X " + opMethod + " \"" + pathName + "\""
case "POST", "PATCH", "PUT":
source += "--header \"Content-Type: application/vnd.atlas." + version + "+json\" \\\n "
source += "-X " + opMethod + " \"" + pathName + "\"\n "
source += "-d " + "{ <Payload> }"
}
Expand Down
228 changes: 114 additions & 114 deletions tools/cli/test/data/split/dev/openapi-v2-2023-01-01.json

Large diffs are not rendered by default.

114 changes: 114 additions & 0 deletions tools/cli/test/data/split/dev/openapi-v2-2023-01-01.yaml

Large diffs are not rendered by default.

238 changes: 119 additions & 119 deletions tools/cli/test/data/split/dev/openapi-v2-2023-02-01.json

Large diffs are not rendered by default.

119 changes: 119 additions & 0 deletions tools/cli/test/data/split/dev/openapi-v2-2023-02-01.yaml

Large diffs are not rendered by default.

250 changes: 125 additions & 125 deletions tools/cli/test/data/split/dev/openapi-v2-2023-10-01.json

Large diffs are not rendered by default.

125 changes: 125 additions & 0 deletions tools/cli/test/data/split/dev/openapi-v2-2023-10-01.yaml

Large diffs are not rendered by default.

258 changes: 129 additions & 129 deletions tools/cli/test/data/split/dev/openapi-v2-2023-11-15.json

Large diffs are not rendered by default.

129 changes: 129 additions & 0 deletions tools/cli/test/data/split/dev/openapi-v2-2023-11-15.yaml

Large diffs are not rendered by default.

276 changes: 138 additions & 138 deletions tools/cli/test/data/split/dev/openapi-v2-2024-05-30.json

Large diffs are not rendered by default.

138 changes: 138 additions & 0 deletions tools/cli/test/data/split/dev/openapi-v2-2024-05-30.yaml

Large diffs are not rendered by default.

276 changes: 138 additions & 138 deletions tools/cli/test/data/split/dev/openapi-v2-2024-08-05.json

Large diffs are not rendered by default.

138 changes: 138 additions & 0 deletions tools/cli/test/data/split/dev/openapi-v2-2024-08-05.yaml

Large diffs are not rendered by default.

280 changes: 140 additions & 140 deletions tools/cli/test/data/split/dev/openapi-v2-2025-01-01.json

Large diffs are not rendered by default.

140 changes: 140 additions & 0 deletions tools/cli/test/data/split/dev/openapi-v2-2025-01-01.yaml

Large diffs are not rendered by default.

Loading