Skip to content

Commit

Permalink
Merge branch 'v3' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
justinyoo committed Aug 3, 2020
2 parents a2345d3 + e2e3f3b commit 02499d8
Show file tree
Hide file tree
Showing 282 changed files with 7,740 additions and 4,642 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
branches:
- master
- dev
- v3
- feature/*

jobs:
Expand All @@ -13,7 +14,7 @@ jobs:
strategy:
matrix:
os: [ 'windows-latest' ]
dotnet: [ '3.1.301' ]
dotnet: [ '3.1.302' ]

runs-on: ${{ matrix.os }}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
strategy:
matrix:
os: [ 'windows-latest' ]
dotnet: [ '3.1.301' ]
dotnet: [ '3.1.302' ]

runs-on: ${{ matrix.os }}

Expand Down
34 changes: 31 additions & 3 deletions .github/workflows/release-all.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@ on:
- release/configjson-*
- release/di-*
- release/swagger-*
- release/swaggercore-*

jobs:
build_test_package_release:
name: Build, test, package and release
strategy:
matrix:
os: [ 'windows-latest' ]
dotnet: [ '3.1.301' ]
dotnet: [ '3.1.302' ]

runs-on: ${{ matrix.os }}

Expand Down Expand Up @@ -89,12 +90,21 @@ jobs:
dotnet build ./src/Aliencube.AzureFunctions.Extensions.DependencyInjection -c Release -p:Version=${{ steps.release.outputs.version }} -v minimal
dotnet build ./test/Aliencube.AzureFunctions.Extensions.DependencyInjection.Tests -c Release
- name: Build solution for OpenApi Core
if: steps.release.outputs.module == 'swaggercore'
shell: pwsh
run: |
dir
dotnet build ./src/Aliencube.AzureFunctions.Extensions.OpenApi.Core -c Release -p:Version=${{ steps.release.outputs.version }} -v minimal
dotnet build ./test/Aliencube.AzureFunctions.Extensions.OpenApi.Core.Tests -c Release
- name: Build solution for OpenApi
if: steps.release.outputs.module == 'swagger'
shell: pwsh
run: |
dir
dotnet build . -c Release -p:Version=${{ steps.release.outputs.version }} -v minimal
dotnet build ./src/Aliencube.AzureFunctions.Extensions.OpenApi -c Release -p:Version=${{ steps.release.outputs.version }} -v minimal
dotnet build ./test/Aliencube.AzureFunctions.Extensions.OpenApi.Tests -c Release
- name: Test solution for AppSettings
if: steps.release.outputs.module == 'appsettings'
Expand All @@ -117,12 +127,19 @@ jobs:
dir
dotnet test ./test/Aliencube.AzureFunctions.Extensions.DependencyInjection.Tests -c Release
- name: Test solution for OpenApi Core
if: steps.release.outputs.module == 'swaggercore'
shell: pwsh
run: |
dir
dotnet test ./test/Aliencube.AzureFunctions.Extensions.OpenApi.Core.Tests -c Release
- name: Test solution for OpenApi
if: steps.release.outputs.module == 'swagger'
shell: pwsh
run: |
dir
dotnet test . -c Release
dotnet test ./test/Aliencube.AzureFunctions.Extensions.OpenApi.Tests -c Release
- name: List Package for AppSettings
if: steps.release.outputs.module == 'appsettings'
Expand Down Expand Up @@ -157,6 +174,17 @@ jobs:
echo "::set-env name=PACKAGE_PATH::$path"
echo "::set-env name=PACKAGE_NAME::$name"
- name: List Package for OpenApi Core
if: steps.release.outputs.module == 'swaggercore'
shell: pwsh
run: |
$package = Get-ChildItem -Path ./src/*.OpenApi.Core -Include *.nupkg -Recurse | Where-Object { $_.FullName -like "*${{ steps.release.outputs.version }}*" }
$path = $package[0].FullName
$name = $package[0].Name
echo "::set-env name=PACKAGE_PATH::$path"
echo "::set-env name=PACKAGE_NAME::$name"
- name: List Package for OpenApi
if: steps.release.outputs.module == 'swagger'
shell: pwsh
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-cli.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
matrix:
os: [ 'windows-latest' ]
node: [ 10 ]
dotnet: [ '3.1.301' ]
dotnet: [ '3.1.302' ]
targetFramework: [ 'net461', 'netcoreapp3.1' ]
runtime: [ 'win-x64', 'linux-x64', 'osx-x64' ]

Expand Down
106 changes: 43 additions & 63 deletions Aliencube.AzureFunctions.Extensions.sln

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#if NET461
using System;
using System.Net;
using System.Net.Http;
#endif

using System.Threading.Tasks;

using Aliencube.AzureFunctions.Extensions.DependencyInjection.Abstractions;
using Aliencube.AzureFunctions.FunctionApp.Services;

#if !NET461
using Microsoft.AspNetCore.Mvc;
#endif

using Microsoft.Extensions.Logging;

namespace Aliencube.AzureFunctions.FunctionApp.Functions
{
/// <summary>
/// This represents the function entity for sample HTTP trigger.
/// </summary>
public class AddDummyFunction : FunctionBase<ILogger>, IAddDummyFunction
{
private readonly IDummyHttpService _service;

/// <summary>
/// Initializes a new instance of the <see cref="AddDummyFunction"/> class.
/// </summary>
/// <param name="dependency"><see cref="IDummyHttpService"/> instance.</param>
public AddDummyFunction(IDummyHttpService service)
{
this._service = service;
}

/// <inheritdoc />
public override async Task<TOutput> InvokeAsync<TInput, TOutput>(TInput input, FunctionOptionsBase options = null)
{
this.Log.LogInformation("C# HTTP trigger function processed a request.");

var content = await this._service.AddDummy().ConfigureAwait(false);
#if NET461
var req = input as HttpRequestMessage;
var result = req.CreateResponse(HttpStatusCode.OK, content);

return (TOutput)Convert.ChangeType(result, typeof(TOutput));
#elif NETSTANDARD2_0
var result = new OkObjectResult(content);

return (TOutput)(IActionResult)result;
#endif
}
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if NET461
#if NET461
using System;
using System.Net;
using System.Net.Http;
Expand All @@ -20,15 +20,15 @@ namespace Aliencube.AzureFunctions.FunctionApp.Functions
/// <summary>
/// This represents the function entity for sample HTTP trigger.
/// </summary>
public class GetSamplesFunction : FunctionBase<ILogger>, IGetSamplesFunction
public class GetDummiesFunction : FunctionBase<ILogger>, IGetDummiesFunction
{
private readonly ISampleHttpService _service;
private readonly IDummyHttpService _service;

/// <summary>
/// Initializes a new instance of the <see cref="GetSamplesFunction"/> class.
/// Initializes a new instance of the <see cref="GetDummiesFunction"/> class.
/// </summary>
/// <param name="dependency"><see cref="ISampleHttpService"/> instance.</param>
public GetSamplesFunction(ISampleHttpService service)
/// <param name="dependency"><see cref="IDummyHttpService"/> instance.</param>
public GetDummiesFunction(IDummyHttpService service)
{
this._service = service;
}
Expand All @@ -38,7 +38,7 @@ public override async Task<TOutput> InvokeAsync<TInput, TOutput>(TInput input, F
{
this.Log.LogInformation("C# HTTP trigger function processed a request.");

var content = await this._service.GetSamples().ConfigureAwait(false);
var content = await this._service.GetDummies().ConfigureAwait(false);
#if NET461
var req = input as HttpRequestMessage;
var result = req.CreateResponse(HttpStatusCode.OK, content);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
namespace Aliencube.AzureFunctions.FunctionApp.Functions
{
/// <summary>
/// This provides interfaces to <see cref="GetSamplesFunction"/>.
/// This provides interfaces to <see cref="AddDummyFunction"/>.
/// </summary>
public interface IGetSamplesFunction : IFunction<ILogger>
public interface IAddDummyFunction : IFunction<ILogger>
{
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
using Aliencube.AzureFunctions.Extensions.DependencyInjection.Abstractions;

using Microsoft.Extensions.Logging;

namespace Aliencube.AzureFunctions.FunctionApp.Functions
{
/// <summary>
/// This provides interfaces to <see cref="GetDummiesFunction"/>.
/// </summary>
public interface IGetDummiesFunction : IFunction<ILogger>
{
}
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net461;netstandard2.0</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\Aliencube.AzureFunctions.Extensions.OpenApi\Aliencube.AzureFunctions.Extensions.OpenApi.csproj" />
<ProjectReference Include="..\..\src\Aliencube.AzureFunctions.Extensions.OpenApi.Core\Aliencube.AzureFunctions.Extensions.OpenApi.Core.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using Newtonsoft.Json;

namespace Aliencube.AzureFunctions.FunctionApp.Models
{
public class DummyArrayResponseModel
{
public string Id { get; set; }

[JsonRequired]
public string JsonRequiredValue { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using System;

using Newtonsoft.Json;

namespace Aliencube.AzureFunctions.FunctionApp.Models
{
public class DummyDictionaryResponseModel
{
public Guid? Id { get; set; }

[JsonRequired]
public string JsonRequiredValue { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
namespace Aliencube.AzureFunctions.FunctionApp.Models
{
public class DummyRecursiveResponseModel
{
public string Id { get; set; }

public DummyRecursiveResponseModel RecursiveValue { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
using System;

namespace Aliencube.AzureFunctions.FunctionApp.Models
{
public class DummyRequestModel
{
public Guid Id { get; set; }

public short ShortValue { get; set; }

public int IntValue { get; set; }

public long LongValue { get; set; }

public float SingleValue { get; set; }

public double DoubleValue { get; set; }

public decimal DecimalValue { get; set; }

public int? NullableIntValue { get; set; }

public bool BoolValue { get; set; }

public ShortEnum ShortEnumValue { get; set; }

public IntEnum IntEnumValue { get; set; }

public LongEnum LongEnumValue { get; set; }

public StringEnum StringEnumValue { get; set; }

public DateTime DateTimeValue { get; set; }

public DateTimeOffset DateTimeOffsetValue { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
using System.Collections.Generic;

using Aliencube.AzureFunctions.Extensions.OpenApi.Core.Attributes;
using Aliencube.AzureFunctions.Extensions.OpenApi.Core.Enums;

using Newtonsoft.Json;
using Newtonsoft.Json.Linq;

namespace Aliencube.AzureFunctions.FunctionApp.Models
{
public class DummyResponseModel
{
public DummySubResponseModel SubObjectValue { get; set; }

public DummyRecursiveResponseModel RecursiveObjectValue { get; set; }

public IDictionary<string, string> DictionaryStringValue { get; set; }

public Dictionary<string, int> DictionaryIntValue { get; set; }

public Dictionary<string, DummyDictionaryResponseModel> DictionaryObjectValue { get; set; }

public IList<string> ListStringValue { get; set; }

public List<int> ListIntValue { get; set; }

public List<DummyArrayResponseModel> ListObjectValue { get; set; }

public DummyArrayResponseModel[] ArrayObjectValue { get; set; }

public JObject JObjectValue { get; set; }

public JToken JTokenValue { get; set; }

[JsonProperty("CapitalisedJsonPropertyValue")]
public string JsonPropertyValue { get; set; }

[JsonIgnore]
public string JsonIgnoreValue { get; set; }

[JsonProperty("CapitalisedJsonPropertyRequiredValue", Required = Required.DisallowNull)]
public string JsonPropertyRequiredValue { get; set; } = "hello world";

[JsonRequired]
public string JsonRequiredValue { get; set; } = "lorem ipsum";

[OpenApiSchemaVisibility(OpenApiVisibilityType.Advanced)]
public string OpenApiSchemaVisibilityValue { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using Newtonsoft.Json;

namespace Aliencube.AzureFunctions.FunctionApp.Models
{
public class DummySubResponseModel
{
public int Id { get; set; }

[JsonProperty("CapitalisedJsonRequiredValue", Required = Required.Always)]
public string JsonRequiredValue { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
namespace Aliencube.AzureFunctions.FunctionApp.Models
{
public enum IntEnum
{
Value1,
Value2
}
}
Loading

0 comments on commit 02499d8

Please sign in to comment.