Skip to content

Commit f97c937

Browse files
committed
Schema validation: samples - drop grpc/check nil
1 parent d0eccac commit f97c937

File tree

1 file changed

+4
-4
lines changed
  • doc/code_snippets/snippets/config/instances.enabled/application_validate_cfg_record_computed_annotations

1 file changed

+4
-4
lines changed

doc/code_snippets/snippets/config/instances.enabled/application_validate_cfg_record_computed_annotations/api.lua

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ local listen_address = schema.record({
99
}, {
1010
validate = function(data, w)
1111
local protocol = w.schema.computed.annotations.protocol
12-
if protocol == 'grpc' and data.scheme then
13-
w.error("grpc doesn't support 'scheme'")
12+
if protocol == 'iproto' and data.scheme ~= nil then
13+
w.error("iproto doesn't support 'scheme'")
1414
end
1515
end,
1616
})
@@ -22,11 +22,11 @@ local http_listen_address_schema = schema.new('http_listen_address', schema.reco
2222
protocol = 'http',
2323
}))
2424

25-
local grpc_listen_address_schema = schema.new('grpc_listen_address', schema.record({
25+
local iproto_listen_address_schema = schema.new('iproto_listen_address', schema.record({
2626
name = schema.scalar({ type = 'string' }),
2727
listen_address = listen_address,
2828
}, {
29-
protocol = 'grpc',
29+
protocol = 'iproto',
3030
}))
3131

3232
local function validate(cfg)

0 commit comments

Comments
 (0)