Skip to content

Commit 791eafa

Browse files
committed
add tests
1 parent 80d85fe commit 791eafa

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

tools/cli/internal/apiversion/version.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ func (v *APIVersion) IsPreview() bool {
150150
}
151151

152152
func IsPreviewSabilityLevel(value string) bool {
153-
return strings.Contains(value, PreviewStabilityLevel)
153+
return strings.EqualFold(value, PreviewStabilityLevel) || strings.Contains(value, PreviewStabilityLevel) // we also need string match given private preview versions like "private-preview-<name>"
154154
}
155155

156156
func IsStableSabilityLevel(value string) bool {

tools/cli/test/data/base_spec_with_preview.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4038,7 +4038,10 @@
40384038
"$ref": "#/components/schemas/PaginatedAtlasGroupView"
40394039
},
40404040
"x-xgen-version": "preview",
4041-
"x-sunset": "2025-06-30"
4041+
"x-sunset": "2025-06-30",
4042+
"x-xgen-preview": {
4043+
"name": "new-feature"
4044+
}
40424045
}
40434046
}
40444047
},

0 commit comments

Comments
 (0)