Skip to content

Commit 4d1e5d9

Browse files
committed
Allow only exactly one schema to be valid at a certain point in time.
1 parent 9ef8625 commit 4d1e5d9

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

api/brokerserver/broker_handler_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1186,7 +1186,7 @@ var _ = Describe("BrokerHandler", func() {
11861186
It("fails with 400", func() {
11871187
Expect(resp.Code).To(Equal(http.StatusBadRequest))
11881188
Expect(resp.Body.String()).To(MatchJSON(
1189-
`{"error": "InvalidPolicy", "description": "invalid policy provided: [{\"context\":\"(root)\",\"description\":\"Must validate at least one schema (anyOf)\"},{\"context\":\"(root).credential-type\",\"description\":\"credential-type must be one of the following: \\\"x509\\\", \\\"binding-secret\\\"\"}]"}`,
1189+
`{"error": "InvalidPolicy", "description": "invalid policy provided: [{\"context\":\"(root)\",\"description\":\"Must validate one and only one schema (oneOf)\"},{\"context\":\"(root).credential-type\",\"description\":\"credential-type must be one of the following: \\\"x509\\\", \\\"binding-secret\\\"\"}]"}`,
11901190
))
11911191
})
11921192

api/policyvalidator/meta.schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"title": "Autoscaler Policy JSON Schema",
44
"description": "Unification of different schemas for scaling-policies for Autoscaler",
55

6-
"anyOf": [
6+
"oneOf": [
77
{"$ref": "./scaling-policy.v0_9.schema.json"},
88
{"$ref": "./legacy.schema.json"},
99
{"$ref": "./service-key_only.v0_9.schema.json"}

0 commit comments

Comments
 (0)