Skip to content

Commit c02c91d

Browse files
authored
Merge pull request #246 from platformsh/fix-schema-expires-can-be-int
schema: allow integer in "expires" values
2 parents dd91a3b + 666a4bf commit c02c91d

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

validator/schema/platformsh.application.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,7 @@
458458
"default": null
459459
},
460460
"expires": {
461-
"type": "string",
461+
"type": ["integer", "string"],
462462
"title": "Amount of time to cache static assets.",
463463
"default": -1
464464
},
@@ -501,7 +501,7 @@
501501
"type": "object",
502502
"properties": {
503503
"expires": {
504-
"type": "string",
504+
"type": ["integer", "string"],
505505
"title": "Amount of time to cache static assets."
506506
},
507507
"passthru": {
@@ -621,7 +621,7 @@
621621
"title": "Blacklisted entries."
622622
},
623623
"expires": {
624-
"type": "string",
624+
"type": ["integer", "string"],
625625
"title": "Amount of time to cache static assets."
626626
},
627627
"move_to_root": {

validator/schema/platformsh.routes.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"type": "object",
3434
"properties": {
3535
"expires": {
36-
"type": "string",
36+
"type": ["integer", "string"],
3737
"title": "The amount of time, in seconds, to cache the redirects.",
3838
"default": -1
3939
},
@@ -67,7 +67,7 @@
6767
"default": 302
6868
},
6969
"expires": {
70-
"type": "string",
70+
"type": ["integer", "string"],
7171
"title": "The amount of time, in seconds, to cache the redirects.",
7272
"default": null
7373
}
@@ -195,7 +195,7 @@
195195
"type": "object",
196196
"properties": {
197197
"expires": {
198-
"type": "string",
198+
"type": ["integer", "string"],
199199
"title": "The amount of time, in seconds, to cache the redirects.",
200200
"default": -1
201201
},
@@ -229,7 +229,7 @@
229229
"default": 302
230230
},
231231
"expires": {
232-
"type": "string",
232+
"type": ["integer", "string"],
233233
"title": "The amount of time, in seconds, to cache the redirects.",
234234
"default": null
235235
}

validator/schema/upsun.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@
244244
"default": "public"
245245
},
246246
"expires": {
247-
"type": "string",
247+
"type": ["integer", "string"],
248248
"title": "Amount of time to cache static assets",
249249
"description": "How long static assets are cached. The default means no caching. Setting it to a value enables the `Cache-Control` and `Expires` headers. Times can be suffixed with `ms` = milliseconds, `s` = seconds, `m` = minutes, `h` = hours, `d` = days, `w` = weeks, `M` = months/30d, or `y` = years/365d. If a `Cache-Control` appears on the `headers` configuration, `expires`, if set, will be ignored. Thus, make sure to set the `Cache-Control`’s `max-age` value when specifying a the header.",
250250
"default": -1
@@ -296,7 +296,7 @@
296296
"type": "object",
297297
"properties": {
298298
"expires": {
299-
"type": "string",
299+
"type": ["integer", "string"],
300300
"title": "Amount of time to cache static assets",
301301
"description": "How long static assets are cached. The default means no caching. Setting it to a value enables the `Cache-Control` and `Expires` headers. Times can be suffixed with `ms` = milliseconds, `s` = seconds, `m` = minutes, `h` = hours, `d` = days, `w` = weeks, `M` = months/30d, or `y` = years/365d. If a `Cache-Control` appears on the `headers` configuration, `expires`, if set, will be ignored. Thus, make sure to set the `Cache-Control`’s `max-age` value when specifying a the header.",
302302
"default": -1
@@ -437,7 +437,7 @@
437437
"deprecationMessage": "Deprecated"
438438
},
439439
"expires": {
440-
"type": "string",
440+
"type": ["integer", "string"],
441441
"title": "Amount of time to cache static assets",
442442
"deprecationMessage": "Deprecated"
443443
},
@@ -896,7 +896,7 @@
896896
"description": "Defines redirects for partial routes. For definition and options, see the redirect rules: \nhttps://docs.upsun.com/define-routes/redirects.html",
897897
"properties": {
898898
"expires": {
899-
"type": "string",
899+
"type": ["integer", "string"],
900900
"title": "The duration the redirect is cached",
901901
"description": "Examples of valid values include 3600s, 1d, 2w, 3m. \nTo disable caching for all your redirects, set expires to 0. You can also disable caching on a specific redirect: \nhttps://docs.upsun.com/define-routes/redirects.html#disable-caching-on-your-redirects",
902902
"default": -1
@@ -938,7 +938,7 @@
938938
"default": 302
939939
},
940940
"expires": {
941-
"type": "string",
941+
"type": ["integer", "string"],
942942
"title": "The amount of time, in seconds, to cache the redirects",
943943
"description": "The duration the redirect is cached for. \nMore information: \nhttps://docs.upsun.com/define-routes/redirects.html#manage-caching",
944944
"default": null

0 commit comments

Comments
 (0)