Skip to content

Commit 7fc0430

Browse files
authored
[#1768]: allow using env variable in schema properties
2 parents fce8455 + a694b83 commit 7fc0430

File tree

2 files changed

+16
-8
lines changed

2 files changed

+16
-8
lines changed

schemas/config/2.0.schema.json

+8-4
Original file line numberDiff line numberDiff line change
@@ -2244,18 +2244,22 @@
22442244
"HostAndPortWithTCP": {
22452245
"description": "Host and port with tcp:// prefix",
22462246
"type": "string",
2247-
"pattern": "^(tcp://[0-9a-zA-Z_.-]+|):[0-9]{1,5}$",
2247+
"pattern": "^(((tcp://[0-9a-zA-Z_.-]+|)|\\$\\{([^}]+)\\}):([0-9]{1,5}||\\$\\{([^}]+)\\}))|\\$\\{([^}]+)\\}$",
22482248
"examples": [
2249-
"tcp://127.0.0.1:443"
2249+
"tcp://127.0.0.1:443",
2250+
"${TCP:-tcp://127.0.0.1:443}",
2251+
"tcp://127.0.0.1:${TCP_PORT}"
22502252
]
22512253
},
22522254
"HostAndPort": {
22532255
"description": "Host and port",
22542256
"type": "string",
2255-
"pattern": "^([0-9a-zA-Z_.-]+|):[0-9]{1,5}$",
2257+
"pattern": "^((([0-9a-zA-Z_.-]+|)|\\$\\{([^}]+)\\}):([0-9]{1,5})|\\$\\{([^}]+)\\})|\\$\\{([^}]+)\\}$",
22562258
"examples": [
22572259
"127.0.0.1:443",
2258-
":8080"
2260+
":8080",
2261+
"0.0.0.0:${HTTP_PORT:-8080}",
2262+
"${HTTP_HOST:-127.0.0.1:8000}"
22592263
]
22602264
},
22612265
"LogMode": {

schemas/config/3.0.schema.json

+8-4
Original file line numberDiff line numberDiff line change
@@ -2362,18 +2362,22 @@
23622362
"HostAndPortWithTCP": {
23632363
"description": "Host and port with tcp:// prefix",
23642364
"type": "string",
2365-
"pattern": "^(tcp://[0-9a-zA-Z_.-]+|):[0-9]{1,5}$",
2365+
"pattern": "^(((tcp://[0-9a-zA-Z_.-]+|)|\\$\\{([^}]+)\\}):([0-9]{1,5}||\\$\\{([^}]+)\\}))|\\$\\{([^}]+)\\}$",
23662366
"examples": [
2367-
"tcp://127.0.0.1:443"
2367+
"tcp://127.0.0.1:443",
2368+
"${TCP:-tcp://127.0.0.1:443}",
2369+
"tcp://127.0.0.1:${TCP_PORT}"
23682370
]
23692371
},
23702372
"HostAndPort": {
23712373
"description": "Host and port",
23722374
"type": "string",
2373-
"pattern": "^([0-9a-zA-Z_.-]+|):[0-9]{1,5}$",
2375+
"pattern": "^((([0-9a-zA-Z_.-]+|)|\\$\\{([^}]+)\\}):([0-9]{1,5})|\\$\\{([^}]+)\\})|\\$\\{([^}]+)\\}$",
23742376
"examples": [
23752377
"127.0.0.1:443",
2376-
":8080"
2378+
":8080",
2379+
"0.0.0.0:${HTTP_PORT:-8080}",
2380+
"${HTTP_HOST:-127.0.0.1:8000}"
23772381
]
23782382
},
23792383
"LogMode": {

0 commit comments

Comments
 (0)