Skip to content

Commit ce7a16d

Browse files
Places feed and Open Booking API support (#2)
1 parent 6b404da commit ce7a16d

8 files changed

Lines changed: 1173 additions & 823 deletions

File tree

OpenActive.DatasetSite.NET.Generator/package-lock.json

Lines changed: 11 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

OpenActive.DatasetSite.NET.Generator/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"author": "Nick Evans",
1212
"license": "MIT",
1313
"dependencies": {
14-
"@openactive/data-models": "^2.0.145",
14+
"@openactive/data-models": "^2.0.285",
1515
"@openactive/dataset-site-template": "^1.0.2",
1616
"fs-extra": "^7.0.1",
1717
"sync-request": "^6.0.0"

OpenActive.DatasetSite.NET/DatasetSiteGenerator.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,15 +130,16 @@ public static string RenderSimpleDatasetSiteFromDataDownloads(DatasetSiteGenerat
130130
{
131131
Name = settings.PlatformName,
132132
Url = settings.PlatformUrl,
133-
SoftwareVersion = settings.PlatformVersion
133+
SoftwareVersion = settings.PlatformVersion,
134+
HasCredential = settings.TestSuiteCertificateUrl
134135
},
135136
AccessService = settings.OpenBookingAPIBaseUrl == null ? null : new WebAPI
136137
{
137138
Name = "Open Booking API",
138139
Description = $"API that allows for seamless booking experiences to be created for {dataFeedHumanisedList.ToLowerInvariant()} available from {settings.OrganisationName}",
139140
Documentation = settings.OpenBookingAPIDocumentationUrl ?? new Uri("https://developer.openactive.io/go/open-booking-api"),
140141
TermsOfService = settings.OpenBookingAPITermsOfServiceUrl,
141-
EndpointURL = settings.OpenBookingAPIBaseUrl,
142+
EndpointUrl = settings.OpenBookingAPIBaseUrl,
142143
AuthenticationAuthority = settings.OpenBookingAPIAuthenticationAuthority,
143144
ConformsTo = new List<Uri> { new Uri("https://openactive.io/open-booking-api/EditorsDraft/") },
144145
EndpointDescription = new Uri("https://www.openactive.io/open-booking-api/EditorsDraft/swagger.json"),
@@ -176,8 +177,8 @@ public static string RenderDatasetSiteWithTemplate(Dataset dataset, string musta
176177
JObject jsonObj = JObject.Parse(jsonString);
177178

178179
// Stringify the input JSON using formatting, and place the contents of the string
179-
// within the "json" property at the root of the JSON itself.
180-
jsonObj.Add("json", jsonObj.ToString(Formatting.Indented));
180+
// within the "jsonld" property at the root of the JSON itself.
181+
jsonObj.Add("jsonld", jsonObj.ToString(Formatting.Indented));
181182

182183
//Use the resulting JSON with the mustache template to render the dataset site.
183184
var stubble = new StubbleBuilder().Configure(s => s.AddJsonNet()).Build();

OpenActive.DatasetSite.NET/OpenActive.DatasetSite.NET.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
<PrivateAssets>all</PrivateAssets>
3030
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
3131
</PackageReference>
32-
<PackageReference Include="OpenActive.NET" Version="15.2.2" />
32+
<PackageReference Include="OpenActive.NET" Version="15.2.17" />
3333
<PackageReference Include="Stubble.Core" Version="1.7.2" />
3434
<PackageReference Include="Stubble.Extensions.JsonNet.Net45" Version="1.3.3" />
3535
<PackageReference Include="Nerdbank.GitVersioning" Version="3.3.37">

OpenActive.DatasetSite.NET/metadata/DatasetSiteMustacheTemplate.cs

Lines changed: 1135 additions & 811 deletions
Large diffs are not rendered by default.

OpenActive.DatasetSite.NET/metadata/OpportunityTypes.cs

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ public enum OpportunityType
2020
HeadlineEventSubEvent,
2121
Event,
2222
EventSeries,
23-
OnDemandEvent
23+
OnDemandEvent,
24+
Place
2425
}
2526

2627
public static class OpportunityTypes
@@ -184,10 +185,21 @@ public static class OpportunityTypes
184185
Identifier = "OnDemandEvent",
185186
Name = "OnDemandEvent",
186187
SameAs = new Uri("https://schema.org/OnDemandEvent"),
187-
DefaultFeedPath = "/on-demand-event",
188+
DefaultFeedPath = "/on-demand-events",
188189
Bookable = true,
189190
ThemeDisplayName = "On Demand Events"
190191
}
192+
},
193+
{
194+
OpportunityType.Place,
195+
new OpportunityTypeConfiguration {
196+
Identifier = "Place",
197+
Name = "Place",
198+
SameAs = new Uri("https://schema.org/Place"),
199+
DefaultFeedPath = "/places",
200+
Bookable = false,
201+
ThemeDisplayName = "Places"
202+
}
191203
}
192204
};
193205
}

OpenActive.DatasetSite.NET/models/DatasetSiteGeneratorSettings.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,5 +113,10 @@ public class DatasetSiteGeneratorSettings
113113
/// The Issuer URL of the OpenID Provider used to access the Open Booking API
114114
/// </summary>
115115
public Uri OpenBookingAPIAuthenticationAuthority { get; set; }
116+
117+
/// <summary>
118+
/// The publicly accessible URL of an up-to-date OpenActive Test Suite Certificate for the implementation
119+
/// </summary>
120+
public Uri TestSuiteCertificateUrl { get; set; }
116121
}
117122
}

version.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json",
3-
"version": "4.2",
3+
"version": "5.0",
44
"publicReleaseRefSpec": [
55
"^refs/heads/master$"
66
],

0 commit comments

Comments
 (0)