Skip to content

Commit

Permalink
Added actions property to denote addtional actions that can be taken …
Browse files Browse the repository at this point in the history
…on a resource
  • Loading branch information
Gary Woodfine committed Oct 25, 2023
1 parent e8bdc69 commit 1197b16
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ jobs:
dotnet new tool-manifest
dotnet tool install Cake.Tool
dotnet tool restore
dotnet cake
dotnet cake build.cake
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<PackageTags>api project, api endpoints, response</PackageTags>
<RepositoryUrl>https://github.com/threenine/apiResponse</RepositoryUrl>
<PackageProjectUrl>https://threenine.co.uk</PackageProjectUrl>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
<LangVersion>10</LangVersion>
<RootNamespace>Threenine</RootNamespace>
<PackageIcon>icon.png</PackageIcon>
Expand Down
1 change: 1 addition & 0 deletions build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ Task("Pack")
DotNetPack("./ApiResponse.sln", settings);
});

Task("PublishNuget")
.IsDependentOn("Pack")
.Does(context => {
Expand Down
15 changes: 15 additions & 0 deletions src/ApiResponse/Actions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
using System;

namespace Threenine.ApiResponse;

/// <summary>
/// Actions are used to describe the actions that can be performed on a resource.
///
/// </summary>
public class Actions
{
public string Name { get; set; }
public Uri Url { get; set; }
public string Method { get; set; }
public string Summary { get; set; }
}
1 change: 1 addition & 0 deletions src/ApiResponse/SingleResponse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@ public SingleResponse(TModel model, List<KeyValuePair<string, string[]>> valida
Item = model;
}
public TModel Item { get; }
public List<Actions> Actions { get; set; }
}
}
5 changes: 5 additions & 0 deletions tests/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
<Project>
<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.props', '$(MSBuildThisFileDirectory)../'))" />
<PropertyGroup>
<RootNamespace>Threenine.ApiResponse.Tests</RootNamespace>
<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.2.0"/>
<PackageReference Include="NBuilder" Version="6.1.0"/>
Expand Down
6 changes: 1 addition & 5 deletions tests/Unit/Unit.csproj
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<IsPackable>false</IsPackable>
<RootNamespace>Threenine.ApiResponse.Tests</RootNamespace>
</PropertyGroup>


<ItemGroup>
<ProjectReference Include="..\..\src\ApiResponse\ApiResponse.csproj" />
</ItemGroup>
Expand Down

0 comments on commit 1197b16

Please sign in to comment.