Skip to content

Commit

Permalink
Merge pull request #39 from brainwipe/dev
Browse files Browse the repository at this point in the history
Post release 1.0.7 merge down to master.
  • Loading branch information
brainwipe authored Feb 16, 2017
2 parents 7d3ea94 + 0a83dbb commit e56015f
Show file tree
Hide file tree
Showing 9 changed files with 37 additions and 25 deletions.
4 changes: 2 additions & 2 deletions Package.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
<package>
<metadata>
<id>NJsonApiCore</id>
<version>1.0.6</version>
<version>1.0.7</version>
<authors>Rob Lang</authors>
<owners>Rob Lang</owners>
<projectUrl>http://brainwipe.github.io/NJsonApiCore</projectUrl>
<iconUrl>https://raw.githubusercontent.com/brainwipe/NJsonApiCore/gh-pages/images/njsonapi.png</iconUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>NJsonApiCore extends a ASP.NET json web service so that it returns JSON in the {json:api} format. </description>
<copyright>Copyright 2016</copyright>
<releaseNotes>Fixes for model binding in POST/PATCH and model configuration warnings. https://github.com/brainwipe/NJsonApiCore/milestone/5?closed=1</releaseNotes>
<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>
<tags>jsonapi njsonapi webapi core</tags>
<dependencies>
<group targetFramework="dotnet">
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Http;
using NJsonApi.Web.MVC5.HelloWorld.Models;

namespace NJsonApiCore.Web.MVC5.HelloWorld.Controllers
{
[RoutePrefix("notajsonapiperson")]
public class NotAJsonApiPersonController : ApiController
{
[Route("")]
[HttpGet]
public IEnumerable<Person> Get()
{
return StaticPersistentStore.People;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@
<Compile Include="App_Start\WebApiConfig.cs" />
<Compile Include="Controllers\ArticlesController.cs" />
<Compile Include="Controllers\CommentsController.cs" />
<Compile Include="Controllers\NotAJsonApiPersonController.cs" />
<Compile Include="Controllers\PeopleController.cs" />
<Compile Include="Controllers\SimplestPossibleController.cs" />
<Compile Include="Controllers\TestExamplesController.cs" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.0.6.0")]
[assembly: AssemblyFileVersion("1.0.6.0")]
[assembly: AssemblyVersion("1.0.7.0")]
[assembly: AssemblyFileVersion("1.0.7.0")]
11 changes: 1 addition & 10 deletions src/NJsonApiCore.Web.MVC5/JsonApiActionFilter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,7 @@ public async Task<HttpResponseMessage> ExecuteActionFilterAsync(HttpActionContex

InternalActionExecuting(context, cancellationToken);
}
else
{
if (isValidContentType)
{
var unsupported = new HttpResponseMessage(HttpStatusCode.UnsupportedMediaType);
unsupported.Content = new StringContent($"The Content-Type provided was {contentType} but there was no NJsonApiCore configuration mapping for {controllerType.FullName}");
return unsupported;
}
}


if (context.Response != null)
return context.Response;

Expand Down
4 changes: 2 additions & 2 deletions src/NJsonApiCore.Web.MVC5/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("806263c3-7903-4f1f-80c7-28793b51181b")]
[assembly: AssemblyVersion("1.0.6.0")]
[assembly: AssemblyFileVersion("1.0.6.0")]
[assembly: AssemblyVersion("1.0.7.0")]
[assembly: AssemblyFileVersion("1.0.7.0")]
2 changes: 1 addition & 1 deletion src/NJsonApiCore.Web.MVCCore/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("ed4f18ff-7d61-4413-b2ea-96dda140a442")]
[assembly: AssemblyVersion("1.0.6.0")]
[assembly: AssemblyVersion("1.0.7.0")]
4 changes: 2 additions & 2 deletions src/NJsonApiCore/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
[assembly: AssemblyCopyright("Copyright © 2016")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: AssemblyVersion("1.0.6.0")]
[assembly: AssemblyFileVersion("1.0.6.0")]
[assembly: AssemblyVersion("1.0.7.0")]
[assembly: AssemblyFileVersion("1.0.7.0")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
Expand Down
12 changes: 6 additions & 6 deletions test/NJsonApiCore.Test/Utils/ReflectionUnitTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ public void GIVEN_NullType_WHEN_FromWithinGeneric_THEN_Exception()
public void Given_ArrayType_WHEN_GetObjectType_THEN_ArrayElementTypeReturned()
{
// Arrange
var type = typeof(string[]);
var myEmptyObject = new string[0];

// Act
var result = Reflection.GetObjectType(type);
var result = Reflection.GetObjectType(myEmptyObject);

// Assert
Assert.Equal(typeof(string), result);
Expand All @@ -63,10 +63,10 @@ public void Given_ArrayType_WHEN_GetObjectType_THEN_ArrayElementTypeReturned()
public void Given_GenericEnumerable_WHEN_GetObjectType_THEN_GenericTypeReturned()
{
// Arrange
var type = typeof(List<string>);
var myStringListObject = new List<string>();

// Act
var result = Reflection.GetObjectType(type);
var result = Reflection.GetObjectType(myStringListObject);

// Assert
Assert.Equal(typeof(string), result);
Expand All @@ -77,10 +77,10 @@ public void Given_GenericEnumerable_WHEN_GetObjectType_THEN_GenericTypeReturned(
public void Given_NonEnumerable_WHEN_GetObjectType_THEN_TypeReturned()
{
// Arrange
var type = typeof(string);
string myEmptyObject = string.Empty;

// Act
var result = Reflection.GetObjectType(type);
var result = Reflection.GetObjectType(myEmptyObject);

// Assert
Assert.Equal(typeof(string), result);
Expand Down

0 comments on commit e56015f

Please sign in to comment.