Skip to content

Commit e56015f

Browse files
authored
Merge pull request #39 from brainwipe/dev
Post release 1.0.7 merge down to master.
2 parents 7d3ea94 + 0a83dbb commit e56015f

File tree

9 files changed

+37
-25
lines changed

9 files changed

+37
-25
lines changed

Package.nuspec

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
<package>
33
<metadata>
44
<id>NJsonApiCore</id>
5-
<version>1.0.6</version>
5+
<version>1.0.7</version>
66
<authors>Rob Lang</authors>
77
<owners>Rob Lang</owners>
88
<projectUrl>http://brainwipe.github.io/NJsonApiCore</projectUrl>
99
<iconUrl>https://raw.githubusercontent.com/brainwipe/NJsonApiCore/gh-pages/images/njsonapi.png</iconUrl>
1010
<requireLicenseAcceptance>false</requireLicenseAcceptance>
1111
<description>NJsonApiCore extends a ASP.NET json web service so that it returns JSON in the {json:api} format. </description>
1212
<copyright>Copyright 2016</copyright>
13-
<releaseNotes>Fixes for model binding in POST/PATCH and model configuration warnings. https://github.com/brainwipe/NJsonApiCore/milestone/5?closed=1</releaseNotes>
13+
<releaseNotes>Added support for Array return types, allowed JsonApi services to run alongside non-JsonApi services. All issues here: https://github.com/brainwipe/NJsonApiCore/milestone/6?closed=1</releaseNotes>
1414
<tags>jsonapi njsonapi webapi core</tags>
1515
<dependencies>
1616
<group targetFramework="dotnet">
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Web;
5+
using System.Web.Http;
6+
using NJsonApi.Web.MVC5.HelloWorld.Models;
7+
8+
namespace NJsonApiCore.Web.MVC5.HelloWorld.Controllers
9+
{
10+
[RoutePrefix("notajsonapiperson")]
11+
public class NotAJsonApiPersonController : ApiController
12+
{
13+
[Route("")]
14+
[HttpGet]
15+
public IEnumerable<Person> Get()
16+
{
17+
return StaticPersistentStore.People;
18+
}
19+
}
20+
}

src/NJsonApiCore.Web.MVC5.HelloWorld/NJsonApiCore.Web.MVC5.HelloWorld.csproj

+1
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@
155155
<Compile Include="App_Start\WebApiConfig.cs" />
156156
<Compile Include="Controllers\ArticlesController.cs" />
157157
<Compile Include="Controllers\CommentsController.cs" />
158+
<Compile Include="Controllers\NotAJsonApiPersonController.cs" />
158159
<Compile Include="Controllers\PeopleController.cs" />
159160
<Compile Include="Controllers\SimplestPossibleController.cs" />
160161
<Compile Include="Controllers\TestExamplesController.cs" />

src/NJsonApiCore.Web.MVC5.HelloWorld/Properties/AssemblyInfo.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,5 @@
3030
//
3131
// You can specify all the values or you can default the Revision and Build Numbers
3232
// by using the '*' as shown below:
33-
[assembly: AssemblyVersion("1.0.6.0")]
34-
[assembly: AssemblyFileVersion("1.0.6.0")]
33+
[assembly: AssemblyVersion("1.0.7.0")]
34+
[assembly: AssemblyFileVersion("1.0.7.0")]

src/NJsonApiCore.Web.MVC5/JsonApiActionFilter.cs

+1-10
Original file line numberDiff line numberDiff line change
@@ -51,16 +51,7 @@ public async Task<HttpResponseMessage> ExecuteActionFilterAsync(HttpActionContex
5151

5252
InternalActionExecuting(context, cancellationToken);
5353
}
54-
else
55-
{
56-
if (isValidContentType)
57-
{
58-
var unsupported = new HttpResponseMessage(HttpStatusCode.UnsupportedMediaType);
59-
unsupported.Content = new StringContent($"The Content-Type provided was {contentType} but there was no NJsonApiCore configuration mapping for {controllerType.FullName}");
60-
return unsupported;
61-
}
62-
}
63-
54+
6455
if (context.Response != null)
6556
return context.Response;
6657

src/NJsonApiCore.Web.MVC5/Properties/AssemblyInfo.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,5 @@
2020

2121
// The following GUID is for the ID of the typelib if this project is exposed to COM
2222
[assembly: Guid("806263c3-7903-4f1f-80c7-28793b51181b")]
23-
[assembly: AssemblyVersion("1.0.6.0")]
24-
[assembly: AssemblyFileVersion("1.0.6.0")]
23+
[assembly: AssemblyVersion("1.0.7.0")]
24+
[assembly: AssemblyFileVersion("1.0.7.0")]

src/NJsonApiCore.Web.MVCCore/Properties/AssemblyInfo.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@
1616

1717
// The following GUID is for the ID of the typelib if this project is exposed to COM
1818
[assembly: Guid("ed4f18ff-7d61-4413-b2ea-96dda140a442")]
19-
[assembly: AssemblyVersion("1.0.6.0")]
19+
[assembly: AssemblyVersion("1.0.7.0")]

src/NJsonApiCore/Properties/AssemblyInfo.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
[assembly: AssemblyCopyright("Copyright © 2016")]
1414
[assembly: AssemblyTrademark("")]
1515
[assembly: AssemblyCulture("")]
16-
[assembly: AssemblyVersion("1.0.6.0")]
17-
[assembly: AssemblyFileVersion("1.0.6.0")]
16+
[assembly: AssemblyVersion("1.0.7.0")]
17+
[assembly: AssemblyFileVersion("1.0.7.0")]
1818

1919
// Setting ComVisible to false makes the types in this assembly not visible
2020
// to COM components. If you need to access a type in this assembly from

test/NJsonApiCore.Test/Utils/ReflectionUnitTests.cs

+6-6
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,10 @@ public void GIVEN_NullType_WHEN_FromWithinGeneric_THEN_Exception()
5050
public void Given_ArrayType_WHEN_GetObjectType_THEN_ArrayElementTypeReturned()
5151
{
5252
// Arrange
53-
var type = typeof(string[]);
53+
var myEmptyObject = new string[0];
5454

5555
// Act
56-
var result = Reflection.GetObjectType(type);
56+
var result = Reflection.GetObjectType(myEmptyObject);
5757

5858
// Assert
5959
Assert.Equal(typeof(string), result);
@@ -63,10 +63,10 @@ public void Given_ArrayType_WHEN_GetObjectType_THEN_ArrayElementTypeReturned()
6363
public void Given_GenericEnumerable_WHEN_GetObjectType_THEN_GenericTypeReturned()
6464
{
6565
// Arrange
66-
var type = typeof(List<string>);
66+
var myStringListObject = new List<string>();
6767

6868
// Act
69-
var result = Reflection.GetObjectType(type);
69+
var result = Reflection.GetObjectType(myStringListObject);
7070

7171
// Assert
7272
Assert.Equal(typeof(string), result);
@@ -77,10 +77,10 @@ public void Given_GenericEnumerable_WHEN_GetObjectType_THEN_GenericTypeReturned(
7777
public void Given_NonEnumerable_WHEN_GetObjectType_THEN_TypeReturned()
7878
{
7979
// Arrange
80-
var type = typeof(string);
80+
string myEmptyObject = string.Empty;
8181

8282
// Act
83-
var result = Reflection.GetObjectType(type);
83+
var result = Reflection.GetObjectType(myEmptyObject);
8484

8585
// Assert
8686
Assert.Equal(typeof(string), result);

0 commit comments

Comments
 (0)