Skip to content

Commit 8974d1b

Browse files
Ship JSON schemas
1 parent 883e117 commit 8974d1b

File tree

6 files changed

+177
-1
lines changed

6 files changed

+177
-1
lines changed

src/Umbraco.StorageProviders.AzureBlob/Umbraco.StorageProviders.AzureBlob.csproj

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,13 @@
44
<Description>Azure Blob Storage provider for Umbraco CMS.</Description>
55
<PackageTags>umbraco storage azure blob</PackageTags>
66
</PropertyGroup>
7-
<ItemGroup>
7+
<ItemGroup>
88
<PackageReference Include="Umbraco.Cms.Web.Common" />
99
<PackageReference Include="Azure.Storage.Blobs" />
1010
<ProjectReference Include="..\Umbraco.StorageProviders\Umbraco.StorageProviders.csproj" />
1111
</ItemGroup>
12+
<ItemGroup>
13+
<Content Include="buildTransitive\**" PackagePath="buildTransitive" />
14+
<Content Include="appsettings-schema.Umbraco.StorageProviders.AzureBlob.json" PackagePath="" />
15+
</ItemGroup>
1216
</Project>
Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-04/schema#",
3+
"title": "UmbracoStorageProvidersSchema",
4+
"type": "object",
5+
"properties": {
6+
"Umbraco": {
7+
"$ref": "#/definitions/UmbracoDefinition"
8+
}
9+
},
10+
"definitions": {
11+
"UmbracoDefinition": {
12+
"type": "object",
13+
"description": "Configuration container for all Umbraco products.",
14+
"properties": {
15+
"Storage": {
16+
"$ref": "#/definitions/UmbracoStorageProvidersDefinition"
17+
}
18+
}
19+
},
20+
"UmbracoStorageProvidersDefinition": {
21+
"type": "object",
22+
"description": "Configuration of Umbraco Storage Providers.",
23+
"properties": {
24+
"AzureBlob": {
25+
"$ref": "#/definitions/UmbracoStorageProvidersAzureBlobDefinition"
26+
}
27+
}
28+
},
29+
"UmbracoStorageProvidersAzureBlobDefinition": {
30+
"type": "object",
31+
"description": "Configuration of Umbraco Storage Providers - Azure Blob Storage.",
32+
"properties": {
33+
"Media": {
34+
"$ref": "#/definitions/AzureBlobMediaFileSystemOptions"
35+
}
36+
},
37+
"patternProperties": {
38+
"^(?!Media$).*": {
39+
"$ref": "#/definitions/AzureBlobFileSystemOptions"
40+
}
41+
}
42+
},
43+
"AzureBlobMediaFileSystemOptions": {
44+
"type": "object",
45+
"description": "The Azure Blob Media File System options.",
46+
"required": [
47+
"ConnectionString",
48+
"ContainerName"
49+
],
50+
"properties": {
51+
"ConnectionString": {
52+
"type": "string",
53+
"description": "Gets or sets the storage account connection string.",
54+
"minLength": 1
55+
},
56+
"ContainerName": {
57+
"type": "string",
58+
"description": "Gets or sets the container name.",
59+
"minLength": 1
60+
},
61+
"ContainerRootPath": {
62+
"type": [
63+
"null",
64+
"string"
65+
],
66+
"description": "Gets or sets the root path of the container."
67+
},
68+
"VirtualPath": {
69+
"type": "string",
70+
"description": "Gets or sets the virtual path."
71+
}
72+
}
73+
},
74+
"AzureBlobFileSystemOptions": {
75+
"type": "object",
76+
"description": "The Azure Blob File System options.",
77+
"required": [
78+
"ConnectionString",
79+
"ContainerName",
80+
"VirtualPath"
81+
],
82+
"properties": {
83+
"ConnectionString": {
84+
"type": "string",
85+
"description": "Gets or sets the storage account connection string.",
86+
"minLength": 1
87+
},
88+
"ContainerName": {
89+
"type": "string",
90+
"description": "Gets or sets the container name.",
91+
"minLength": 1
92+
},
93+
"ContainerRootPath": {
94+
"type": [
95+
"null",
96+
"string"
97+
],
98+
"description": "Gets or sets the root path of the container."
99+
},
100+
"VirtualPath": {
101+
"type": "string",
102+
"description": "Gets or sets the virtual path.",
103+
"minLength": 1
104+
}
105+
}
106+
}
107+
}
108+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2+
<ItemGroup>
3+
<UmbracoJsonSchemaFiles Include="$(MSBuildThisFileDirectory)..\appsettings-schema.Umbraco.StorageProviders.AzureBlob.json" Weight="-49" />
4+
</ItemGroup>
5+
</Project>

src/Umbraco.StorageProviders/Umbraco.StorageProviders.csproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,8 @@
66
<ItemGroup>
77
<PackageReference Include="Umbraco.Cms.Web.Common" />
88
</ItemGroup>
9+
<ItemGroup>
10+
<Content Include="buildTransitive\**" PackagePath="buildTransitive" />
11+
<Content Include="appsettings-schema.Umbraco.StorageProviders.json" PackagePath="" />
12+
</ItemGroup>
913
</Project>
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-04/schema#",
3+
"title": "UmbracoStorageProvidersSchema",
4+
"type": "object",
5+
"properties": {
6+
"Umbraco": {
7+
"$ref": "#/definitions/UmbracoDefinition"
8+
}
9+
},
10+
"definitions": {
11+
"UmbracoDefinition": {
12+
"type": "object",
13+
"description": "Configuration container for all Umbraco products.",
14+
"properties": {
15+
"Storage": {
16+
"$ref": "#/definitions/UmbracoStorageProvidersDefinition"
17+
}
18+
}
19+
},
20+
"UmbracoStorageProvidersDefinition": {
21+
"type": "object",
22+
"description": "Configuration of Umbraco Storage Providers.",
23+
"properties": {
24+
"Cdn": {
25+
"$ref": "#/definitions/CdnMediaUrlProviderOptions"
26+
}
27+
}
28+
},
29+
"CdnMediaUrlProviderOptions": {
30+
"type": "object",
31+
"description": "The CDN media URL provider options.",
32+
"required": [
33+
"Url"
34+
],
35+
"properties": {
36+
"Url": {
37+
"type": "string",
38+
"description": "Gets or sets the CDN media root URL.",
39+
"format": "uri",
40+
"minLength": 1
41+
},
42+
"RemoveMediaFromPath": {
43+
"type": "boolean",
44+
"description": "Gets or sets a value indicating whether to remove the UmbracoMediaPath from the path, defaults to true.",
45+
"default": true
46+
}
47+
}
48+
}
49+
}
50+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2+
<ItemGroup>
3+
<UmbracoJsonSchemaFiles Include="$(MSBuildThisFileDirectory)..\appsettings-schema.Umbraco.StorageProviders.json" Weight="-50" />
4+
</ItemGroup>
5+
</Project>

0 commit comments

Comments
 (0)