We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bce7a08 commit 8a4ac25Copy full SHA for 8a4ac25
tools/cli/internal/openapi/filter/bump.go
@@ -28,10 +28,10 @@ type BumpFilter struct {
28
29
const (
30
stateFieldName = "x-state"
31
- stateFieldValueUpcoming = "Upcoming"
32
- stateFieldValuePreview = "Preview"
+ stateFieldValueUpcoming = "UPCOMING"
+ stateFieldValuePreview = "PREVIEW"
33
betaFieldName = "x-beta"
34
- description = "\nThis API is in preview. Breaking changes might be introduced before it is released. " +
+ description = "This API is in preview. Breaking changes might be introduced before it is released. " +
35
"Don't use preview APIs in production."
36
)
37
@@ -72,7 +72,7 @@ func (f *BumpFilter) includeBumpFieldForPreview() error {
72
}
73
op.Extensions[stateFieldName] = stateFieldValuePreview
74
op.Extensions[betaFieldName] = true
75
- op.Description += description
+ op.Description = description + " " + op.Description
76
77
78
return nil
tools/cli/internal/openapi/filter/bump_test.go
@@ -67,10 +67,10 @@ func TestBumpFilter_Apply_Preview(t *testing.T) {
67
68
op := testPath.Get
69
assert.Contains(t, op.Extensions, "x-state")
70
- assert.Equal(t, "Preview", op.Extensions["x-state"])
+ assert.Equal(t, stateFieldValuePreview, op.Extensions["x-state"])
71
assert.Contains(t, op.Extensions, "x-beta")
assert.Equal(t, true, op.Extensions["x-beta"])
- assert.Contains(t, description, op.Description)
+ assert.Contains(t, op.Description, description)
func TestBumpFilter_Apply_Upcoming(t *testing.T) {
@@ -114,7 +114,7 @@ func TestBumpFilter_Apply_Upcoming(t *testing.T) {
114
115
116
117
- assert.Equal(t, "Upcoming", op.Extensions["x-state"])
+ assert.Equal(t, stateFieldValueUpcoming, op.Extensions["x-state"])
118
assert.NotContains(t, op.Extensions, "x-beta")
119
assert.NotContains(t, op.Description, description)
120
0 commit comments