Skip to content

Commit 183650a

Browse files
committed
Merge remote-tracking branch 'jsonapi-net/master'
2 parents 933226a + aee11a7 commit 183650a

File tree

3 files changed

+20
-11
lines changed

3 files changed

+20
-11
lines changed

JSONAPI.Autofac/JsonApiAutofacModule.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public class JsonApiAutofacModule : Module
1818
{
1919
private readonly IJsonApiConfiguration _jsonApiConfiguration;
2020

21-
internal JsonApiAutofacModule(IJsonApiConfiguration jsonApiConfiguration)
21+
public JsonApiAutofacModule(IJsonApiConfiguration jsonApiConfiguration)
2222
{
2323
_jsonApiConfiguration = jsonApiConfiguration;
2424
}

JSONAPI/Documents/Builders/JsonApiException.cs

+16-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public class JsonApiException : Exception
1919
/// Creates a new JsonApiException
2020
/// </summary>
2121
/// <param name="error"></param>
22-
public JsonApiException(IError error)
22+
public JsonApiException(IError error) : base(error?.Detail ?? "An error occurred in JSONAPI")
2323
{
2424
Error = error;
2525
}
@@ -99,5 +99,20 @@ public static JsonApiException CreateForForbidden(string detail = null)
9999
};
100100
return new JsonApiException(error);
101101
}
102+
103+
/// <summary>
104+
/// Creates a JsonApiException to send a 405 Method Not Allowed error.
105+
/// </summary>
106+
public static JsonApiException CreateForMethodNotAllowed(string detail = null)
107+
{
108+
var error = new Error
109+
{
110+
Id = Guid.NewGuid().ToString(),
111+
Status = HttpStatusCode.MethodNotAllowed,
112+
Title = "Method not allowed",
113+
Detail = detail
114+
};
115+
return new JsonApiException(error);
116+
}
102117
}
103118
}

README.md

+3-9
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,11 @@ JSONAPI.NET
22
===========
33
[![jsonapi MyGet Build Status](https://www.myget.org/BuildSource/Badge/jsonapi?identifier=caf48269-c15b-4850-a29e-b41a23d9854d)](https://www.myget.org/)
44

5-
News
6-
----
5+
_Deprecation notice_
6+
------------------
77

8-
The NuGet packages are out!
9-
* [JSONAPI](https://www.nuget.org/packages/JSONAPI/)
10-
* [JSONAPI.EntityFramework](https://www.nuget.org/packages/JSONAPI.EntityFramework/)
8+
JSONAPI.NET is no longer actively maintained. It is not recommended for use in new projects. It does NOT work with .NET Core. Please consider [one of the other .NET server implementations](http://jsonapi.org/implementations/#server-libraries-net) instead.
119

12-
JSON API Compliance
13-
----------------------
14-
15-
The master branch is roughly compatible with the RC3 version of JSON API. The major missing feature is inclusion of related resources. Many changes made to the spec since RC3 are not yet available in this library. Full 1.0 compliance is planned, so stay tuned!
1610

1711
What is JSONAPI.NET?
1812
====================

0 commit comments

Comments
 (0)