Skip to content

Commit ab3f852

Browse files
CLOUDP-313088: Doc feedback for preview API
1 parent 3b89bf5 commit ab3f852

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

tools/cli/internal/openapi/filter/bump.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ const (
3131
stateFieldValueUpcoming = "Upcoming"
3232
stateFieldValuePreview = "Preview"
3333
betaFieldName = "x-beta"
34+
description = "\nThis API is in preview. Breaking changes might be introduced before it is released. " +
35+
"Don't use preview APIs in production."
3436
)
3537

3638
func (f *BumpFilter) ValidateMetadata() error {
@@ -70,6 +72,7 @@ func (f *BumpFilter) includeBumpFieldForPreview() error {
7072
}
7173
op.Extensions[stateFieldName] = stateFieldValuePreview
7274
op.Extensions[betaFieldName] = true
75+
op.Description += description
7376
}
7477
}
7578
return nil

tools/cli/internal/openapi/filter/bump_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ func TestBumpFilter_Apply_Preview(t *testing.T) {
7070
assert.Equal(t, "Preview", op.Extensions["x-state"])
7171
assert.Contains(t, op.Extensions, "x-beta")
7272
assert.Equal(t, true, op.Extensions["x-beta"])
73+
assert.Contains(t, description, op.Description)
7374
}
7475

7576
func TestBumpFilter_Apply_Upcoming(t *testing.T) {
@@ -115,6 +116,7 @@ func TestBumpFilter_Apply_Upcoming(t *testing.T) {
115116
assert.Contains(t, op.Extensions, "x-state")
116117
assert.Equal(t, "Upcoming", op.Extensions["x-state"])
117118
assert.NotContains(t, op.Extensions, "x-beta")
119+
assert.NotContains(t, op.Description, description)
118120
}
119121

120122
func TestBumpFilter_Apply_Stable(t *testing.T) {

tools/cli/test/data/exemptions/exemptions.txt

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)