Skip to content

Commit c84d656

Browse files
committed
schema: allow the "type" property for composable images
1 parent 91d87ed commit c84d656

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

validator/schema/upsun.json

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@
4242
"firewall": {"$ref": "#/definitions/firewall"},
4343
"type": {
4444
"type": "string",
45-
"title": "The base runtime (language) and version to use for this application",
46-
"description": "The base image to use with a specific app language. \nFormat: runtime:version. \nMore information: \nhttps://docs.upsun.com/create-apps/app-reference/single-runtime-image.html#types"
45+
"title": "The base runtime and version to use for this application",
46+
"description": "The base image to use. \nFormat: runtime:version. \nMore information: \nhttps://docs.upsun.com/create-apps/app-reference/single-runtime-image.html#types"
4747
},
4848
"runtime": {
4949
"type": "object",
@@ -705,14 +705,14 @@
705705
"type": "object"
706706
}
707707
]
708-
}
708+
},
709+
"description": "A package definition, for example 'package@version' (for services) or just 'package' (for tools)."
709710
}
710711
],
711712
"title": "Composable Image definition",
712-
"description": "A list of packages from the Upsun collection of supported runtimes and/or from NixPkgs. \nMore information: \nhttps://docs.upsun.com/create-apps/app-reference/composable-image.html"
713-
}
713+
"description": "A list of Nix packages from NixPkgs. \nMore information: \nhttps://docs.upsun.com/create-apps/app-reference/composable-image.html" }
714714
},
715-
"oneOf": [
715+
"anyOf": [
716716
{
717717
"required": [
718718
"type"
@@ -722,6 +722,12 @@
722722
"required": [
723723
"stack"
724724
]
725+
},
726+
{
727+
"required": [
728+
"type",
729+
"stack"
730+
]
725731
}
726732
],
727733
"additionalProperties": false

validator/validator_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ services:
171171
Data: []byte(`
172172
applications:
173173
app1:
174-
type: "python:3.11"
174+
type: "composable:25.05"
175175
stack:
176176
177177
extensions:
@@ -195,7 +195,7 @@ services:
195195
},
196196
},
197197
},
198-
wantErr: true,
198+
wantErr: false,
199199
},
200200
{
201201
name: "true-boolean",

0 commit comments

Comments
 (0)