@@ -257,6 +257,97 @@ func TestCodeSampleFilter(t *testing.T) {
257257 })),
258258 },
259259 },
260+ {
261+ name : "stable api gzip" ,
262+ version : "2025-01-01" ,
263+ oas : & openapi3.T {
264+ Paths : openapi3 .NewPaths (openapi3 .WithPath ("/test" , & openapi3.PathItem {
265+ Get : & openapi3.Operation {
266+ OperationID : "testOperationID" ,
267+ Summary : "testSummary" ,
268+ Responses : openapi3 .NewResponses (openapi3 .WithName ("200" , & openapi3.Response {
269+ Content : openapi3.Content {
270+ "application/vnd.atlas.2025-01-01+gzip" : {
271+ Schema : & openapi3.SchemaRef {
272+ Ref : "#/components/schemas/PaginatedAppUserView" ,
273+ },
274+ Extensions : map [string ]any {
275+ "x-gen-version" : "2025-01-01" ,
276+ },
277+ },
278+ },
279+ })),
280+ Tags : []string {"TestTag" },
281+ Extensions : map [string ]any {
282+ "x-sunset" : "9999-12-31" ,
283+ },
284+ },
285+ })),
286+ },
287+ expectedOas : & openapi3.T {
288+ Paths : openapi3 .NewPaths (openapi3 .WithPath ("/test" , & openapi3.PathItem {
289+ Get : & openapi3.Operation {
290+ OperationID : "testOperationID" ,
291+ Summary : "testSummary" ,
292+ Responses : openapi3 .NewResponses (openapi3 .WithName ("200" , & openapi3.Response {
293+ Content : openapi3.Content {
294+ "application/vnd.atlas.2025-01-01+gzip" : {
295+ Schema : & openapi3.SchemaRef {
296+ Ref : "#/components/schemas/PaginatedAppUserView" ,
297+ },
298+ Extensions : map [string ]any {
299+ "x-gen-version" : "2025-01-01" ,
300+ },
301+ },
302+ },
303+ })),
304+ Tags : []string {"TestTag" },
305+ Extensions : map [string ]any {
306+ "x-sunset" : "9999-12-31" ,
307+ "x-codeSamples" : []codeSample {
308+ {
309+ Lang : "cURL" ,
310+ Label : "Atlas CLI" ,
311+ Source : "atlas api testOperationID --help" ,
312+ },
313+ {
314+ Lang : "go" ,
315+ Label : "Go" ,
316+ Source : "import (\n " +
317+ "\t \" os\" \n \" context\" \n " + "\t \" log\" \n " +
318+ "\t sdk \" go.mongodb.org/atlas-sdk/v20250101001/admin\" \n )\n \n " +
319+ "func main() {\n " +
320+ "\t ctx := context.Background()\n " +
321+ "\t clientID := os.Getenv(\" MONGODB_ATLAS_CLIENT_ID\" )\n " +
322+ "\t clientSecret := os.Getenv(\" MONGODB_ATLAS_CLIENT_SECRET\" )\n \n " +
323+ "\t // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth\n " +
324+ "\t client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret))\n \n " +
325+ "\t if err != nil {\n " + "\t \t log.Fatalf(\" Error: %v\" , err)\n \t }\n \n " +
326+ "\t params = &sdk.TestOperationIDApiParams{}\n " +
327+ "\t sdkResp, httpResp, err := client.TestTagApi.\n " +
328+ "\t \t TestOperationIDWithParams(ctx, params).\n " +
329+ "\t \t Execute()" + "\n }\n " ,
330+ },
331+ {
332+ Lang : "cURL" ,
333+ Label : "curl (Service Accounts)" ,
334+ Source : "curl --header \" Authorization: Bearer ${ACCESS_TOKEN}\" \\ \n " +
335+ "--header \" Accept: application/vnd.atlas.2025-01-01+gzip\" \\ \n " +
336+ "-X GET \" https://cloud.mongodb.com/test\" \\ \n --output \" file_name.gz\" " ,
337+ },
338+ {
339+ Lang : "cURL" ,
340+ Label : "curl (Digest)" ,
341+ Source : "curl --user \" ${PUBLIC_KEY}:${PRIVATE_KEY}\" \\ \n --digest \\ \n " +
342+ "--header \" Accept: application/vnd.atlas.2025-01-01+gzip\" \\ \n " +
343+ "-X GET \" https://cloud.mongodb.com/test\" \\ \n --output \" file_name.gz\" " ,
344+ },
345+ },
346+ },
347+ },
348+ })),
349+ },
350+ },
260351 }
261352
262353 for _ , tt := range testCases {
0 commit comments