Skip to content

Commit 6b76e49

Browse files
feat: Support Apple App Site later versions (SchemaStore#4601)
* feat: Support Apple App Site later versions * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * doc: Spelling * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * feat: Support Webcredential and AppClip * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent e2fe98a commit 6b76e49

File tree

4 files changed

+169
-24
lines changed

4 files changed

+169
-24
lines changed

src/schema-validation.jsonc

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -530,9 +530,6 @@
530530
"app-config.json": {
531531
"externalSchema": ["base.json"]
532532
},
533-
"apple-app-site-association.json": {
534-
"externalSchema": ["base-04.json"]
535-
},
536533
"appsscript.json": {
537534
"externalSchema": ["base.json"]
538535
},
Lines changed: 116 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,143 @@
11
{
2-
"$schema": "http://json-schema.org/draft-04/schema#",
3-
"description": "An Apple Universal Link config schema",
4-
"id": "https://json.schemastore.org/apple-app-site-association.json",
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"$id": "https://json.schemastore.org/apple-app-site-association.json",
4+
"$defs": {
5+
"app_ids": {
6+
"type": "array",
7+
"title": "AppIDs",
8+
"description": "Array of multiple AppIDs",
9+
"items": {
10+
"$ref": "#/$defs/app_id"
11+
}
12+
},
13+
"app_id": {
14+
"type": "string",
15+
"pattern": "^[A-Z0-9]{10}\\.([A-Za-z]{1}[A-Za-z\\d_]*\\.)+[A-Za-z][A-Za-z\\d_]*$",
16+
"title": "TeamID And AppID",
17+
"description": "10 character TeamID followed by AppID"
18+
},
19+
"component": {
20+
"type": "object",
21+
"title": "AppID component",
22+
"description": "A component for uri matching",
23+
"additionalProperties": false,
24+
"properties": {
25+
"/": {
26+
"type": "string",
27+
"title": "Path component",
28+
"description": "Define path matching"
29+
},
30+
"#": {
31+
"type": "string",
32+
"title": "Fragment component",
33+
"description": "Define fragment matching"
34+
},
35+
"?": {
36+
"title": "Query component",
37+
"description": "Define Query matching",
38+
"anyOf": [
39+
{
40+
"type": "object"
41+
},
42+
{
43+
"type": "string"
44+
}
45+
]
46+
},
47+
"exclude": {
48+
"type": "boolean",
49+
"title": "Exclusion flag",
50+
"description": "Whether to exclude a specific match"
51+
}
52+
}
53+
}
54+
},
55+
"required": ["applinks"],
56+
"title": "Apple Universal Links Config",
57+
"description": "Apple Universal Links Config Schema",
58+
"type": "object",
59+
"additionalProperties": false,
560
"properties": {
61+
"webcredentials": {
62+
"type": "object",
63+
"title": "Webcredentials Config",
64+
"description": "Apple Webcredentials Config Schema",
65+
"properties": {
66+
"apps": {
67+
"$ref": "#/$defs/app_ids"
68+
}
69+
}
70+
},
71+
"appclips": {
72+
"type": "object",
73+
"title": "AppClip Config",
74+
"description": "Apple AppClip Config Schema",
75+
"properties": {
76+
"apps": {
77+
"$ref": "#/$defs/app_ids"
78+
}
79+
}
80+
},
681
"applinks": {
7-
"title": "application links",
8-
"description": "Application links",
982
"type": "object",
10-
"required": ["apps", "details"],
83+
"title": "Universalink Configurations",
84+
"description": "Universalink Configurations Schema",
85+
"additionalProperties": false,
86+
"required": ["details"],
1187
"properties": {
1288
"apps": {
13-
"description": "Applications",
89+
"description": "Always empty [] for UniversaLink, can be omitted in later versions",
1490
"type": "array",
15-
"enum": [[]]
91+
"const": []
1692
},
1793
"details": {
18-
"description": "Details",
1994
"type": "array",
95+
"description": "AppIDs's Universalink URI Matching Configuration",
96+
"minItems": 1,
2097
"items": {
21-
"title": "detail",
22-
"description": "A detail",
98+
"title": "AppID's matching details",
99+
"description": "Details of specific AppIDs uri matching configuration",
23100
"type": "object",
101+
"additionalProperties": false,
24102
"properties": {
103+
"appIDs": {
104+
"title": "AppIDs",
105+
"description": "Array of AppIDs",
106+
"type": "array",
107+
"uniqueItems": true,
108+
"minItems": 1,
109+
"items": {
110+
"$ref": "#/$defs/app_id"
111+
}
112+
},
25113
"appID": {
26-
"description": "An appID key or app ID prefix, followed by the bundle ID",
27-
"type": "string"
114+
"$ref": "#/$defs/app_id"
28115
},
29116
"paths": {
30-
"description": "Paths",
117+
"title": "Paths",
118+
"description": "Array of paths to be matched against",
31119
"type": "array",
32120
"uniqueItems": true,
121+
"minItems": 1,
122+
"items": {
123+
"type": "string",
124+
"title": "Path",
125+
"description": "Single unique path to be matched against"
126+
}
127+
},
128+
"components": {
129+
"type": "array",
130+
"title": "URI Components",
131+
"description": "Array of path components to be matched, available in later versions",
132+
"minItems": 1,
33133
"items": {
34-
"$ref": "https://json.schemastore.org/base-04.json#/definitions/path",
35-
"description": "Path to open in the mobile app"
134+
"$ref": "#/$defs/component"
36135
}
37136
}
38137
}
39138
}
40139
}
41140
}
42141
}
43-
},
44-
"required": ["applinks"],
45-
"title": "Apple Universal Link config",
46-
"type": "object"
142+
}
47143
}
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
{
2+
"appclips": {
3+
"apps": ["ABCDE12345.com.example.MyApp.Clip"]
4+
},
5+
"applinks": {
6+
"apps": [],
7+
"details": [
8+
{
9+
"appIDs": ["ABCDE12345.com.example.lunch"],
10+
"components": [
11+
{
12+
"/": "*/order/"
13+
},
14+
{
15+
"/": "/taco/*",
16+
"?": {
17+
"cheese": "?*",
18+
"taco": "???"
19+
}
20+
},
21+
{
22+
"#": "coupon-1???",
23+
"exclude": true
24+
},
25+
{
26+
"#": "coupon-????",
27+
"/": ""
28+
}
29+
]
30+
},
31+
{
32+
"appID": "ABCDE12345.com.example.app",
33+
"appIDs": ["ABCDE12345.com.example.app", "9JA89QQLNQ.com.example.app2"],
34+
"components": [
35+
{
36+
"/": "/path/*/filename"
37+
},
38+
{
39+
"#": "*fragment"
40+
},
41+
{
42+
"?": "widget=?*"
43+
}
44+
],
45+
"paths": ["/path/*/filename"]
46+
}
47+
]
48+
},
49+
"webcredentials": {
50+
"apps": ["ABCDE12345.com.example.app"]
51+
}
52+
}

src/test/apple-app-site-association/apple-app-site-association_getting-started.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"paths": ["/wwdc/news/", "/videos/wwdc/2015/*"]
88
},
99
{
10-
"appID": "ABCD1234.com.apple.wwdc",
10+
"appID": "ABCD123451.com.apple.wwdc",
1111
"paths": ["*"]
1212
}
1313
]

0 commit comments

Comments
 (0)