Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
fa26049
fix(Deserializer): remove dependency on GenericProcessorFactory
jaredcnance Apr 7, 2018
91b5d4b
fix(typeExtensions): cast to IEnumerable using covariance
jaredcnance Apr 8, 2018
7288de2
fix(Deserializer): properly convert collection type when setting it o…
jaredcnance Apr 8, 2018
1062ea9
set new HasManyRelationships with EntityState.Unchanged
jaredcnance Apr 8, 2018
ed223c1
ensure pointers are attached prior to adding the entity
jaredcnance Apr 8, 2018
5ea2252
fix tests
jaredcnance Apr 8, 2018
74d31e0
Merge branch 'fix/#237' into develop
jaredcnance Apr 28, 2018
fd1eaee
chore(csproj): bump package version
jaredcnance May 15, 2018
cb93418
fix(#218): include independent hasOne identifier
jaredcnance May 15, 2018
723614d
Merge pull request #287 from milosloub/master
jaredcnance May 28, 2018
34cc271
fix(HasOneAttribute): return null if property doesnt exist
jaredcnance Jun 5, 2018
1a8531f
fix(DocumentBuilder): handle case when hasOne relationship type is un…
jaredcnance Jun 5, 2018
e8cbc4b
Merge pull request #284 from json-api-dotnet/fix/#218
jaredcnance Jun 5, 2018
a1832f7
Merge pull request #288 from milosloub/master
jaredcnance Jun 6, 2018
acb7bc1
fix(Deserializer): remove dependency on GenericProcessorFactory
jaredcnance Apr 7, 2018
5f4640f
fix(typeExtensions): cast to IEnumerable using covariance
jaredcnance Apr 8, 2018
31a4b76
fix(Deserializer): properly convert collection type when setting it o…
jaredcnance Apr 8, 2018
341eb80
set new HasManyRelationships with EntityState.Unchanged
jaredcnance Apr 8, 2018
c453f31
ensure pointers are attached prior to adding the entity
jaredcnance Apr 8, 2018
67bb3d5
fix tests
jaredcnance Apr 8, 2018
ef60b90
add serialization tests
jaredcnance May 10, 2018
b94b252
refactor(JsonApiContext): begin interface separation
jaredcnance May 10, 2018
fa6ee6b
document(IUpdateRequest)
jaredcnance Jun 5, 2018
6741efd
fix(JsonApiDeserializer): if hasOne is nullable allow it to be set null
jaredcnance Jun 9, 2018
dae04a1
fix(JsonApiDeSerializer): null refs
jaredcnance Jun 9, 2018
903fb71
chore(csproj): bump package version
jaredcnance Jun 9, 2018
01181dd
fix(csproj): syntax error
jaredcnance Jun 9, 2018
21f4f46
Merge branch 'fix/#237' into develop
jaredcnance Jun 9, 2018
e7dc018
test(spec): can create hasOne relationship with resource
jaredcnance Jun 10, 2018
b6bbbdb
Merge pull request #296 from json-api-dotnet/test/creating-has-one
jaredcnance Jun 10, 2018
50cfa8d
Merge pull request #254 from json-api-dotnet/fix/#237
jaredcnance Jun 12, 2018
99ce78e
docs(*): add xml comments
jaredcnance Jun 12, 2018
ab15d70
Make `AddJsonApi` chainable
btecu Jun 12, 2018
4ac497c
Merge pull request #298 from json-api-dotnet/docs/xml-documentation
jaredcnance Jun 12, 2018
3fc1099
Merge pull request #299 from btecu/services
jaredcnance Jun 12, 2018
443e039
Use `MvcCore` instead of `Mvc`
btecu Jun 12, 2018
bbe0375
Update dependencies
btecu Jun 12, 2018
ad39fd7
Fix tests, cleanup warning (deprecations)
btecu Jun 12, 2018
3757b5c
Reduce verbosity
btecu Jun 13, 2018
1f474d2
Merge pull request #303 from btecu/verbosity
jaredcnance Jun 13, 2018
2103344
Further reduce tests verbosity
btecu Jun 13, 2018
12a385b
Make paths consistent
btecu Jun 13, 2018
43ac8b0
Remove already included packages
btecu Jun 13, 2018
e79b88e
Merge pull request #304 from btecu/verbosity
jaredcnance Jun 13, 2018
9c45cb5
fix test issue and bump package version to 2.3.0
jaredcnance Jun 14, 2018
2390669
Merge branch 'master' into updates
jaredcnance Jun 14, 2018
f68efb4
Merge pull request #300 from btecu/updates
jaredcnance Jun 14, 2018
27f890a
Link to performance reports and related projects
jaredcnance Jun 15, 2018
8b0c3fd
Merge pull request #306 from json-api-dotnet/jaredcnance-patch-1
jaredcnance Jun 15, 2018
5a07e55
Fixing issue where total-records was 0 on POST and PATCH calls.
nwise Jun 15, 2018
1f5608e
make attr constructor public
jaredcnance Jun 18, 2018
55407f2
update version 2.3.1
jaredcnance Jun 18, 2018
8f7f0f7
Merge pull request #309 from json-api-dotnet/jaredcnance-patch-1
jaredcnance Jun 18, 2018
1bd8d05
fix(IResourceService): should inherit from shorthand interfaces
jaredcnance Jun 18, 2018
ca33488
fix(IResourceCmdService): inherit shorthand interfaces
jaredcnance Jun 18, 2018
8f04c82
fix(IResourceQueryService): inherit shorthand interfaces
jaredcnance Jun 18, 2018
9472dd4
Merge pull request #311 from json-api-dotnet/master
jaredcnance Jun 18, 2018
48ecdc0
bump version to 2.3.2
jaredcnance Jun 18, 2018
02dbeab
Merge pull request #310 from json-api-dotnet/jaredcnance-patch-1
jaredcnance Jun 18, 2018
edead43
PR feedback
jaredcnance Jun 20, 2018
faa00b4
allow TotalRecords to be 0
jaredcnance Jun 20, 2018
46fbf74
allow meta to be included even if there is no returned resource
jaredcnance Jun 21, 2018
0a7faed
expect total-records to be included if configured
jaredcnance Jun 21, 2018
9013643
Merge pull request #308 from nwise/master
jaredcnance Jun 23, 2018
9dd7719
fix(#312): deserializer not handling included relationships
jaredcnance Jun 27, 2018
32522d0
handle attaching HasOne relationships
jaredcnance Jun 27, 2018
5791eb3
Merge pull request #314 from json-api-dotnet/fix/#312
jaredcnance Jun 27, 2018
4481147
Merge pull request #315 from json-api-dotnet/develop
jaredcnance Jun 27, 2018
f6c9fe0
Check if Model State is valid and throw a 400
sigent Jun 28, 2018
f3f7b44
Merge branch 'develop' of https://github.com/json-api-dotnet/JsonApiD…
sigent Jun 28, 2018
1cb1995
Merge branch 'master' of https://github.com/sigent/JsonApiDotNetCore …
sigent Jun 28, 2018
a9ca293
bumped version no
sigent Jun 28, 2018
9d16115
styling updates
sigent Jun 28, 2018
4d0d422
added ValidateModelState as feature flag in options
sigent Jun 28, 2018
390db09
Merge pull request #316 from sigent/feature/#252_valid_modelstate
jaredcnance Jun 28, 2018
912a284
propagate model state errors
jaredcnance Jun 29, 2018
f5900d4
chore(csproj): bump package version
jaredcnance Jun 29, 2018
1a14773
Merge pull request #320 from json-api-dotnet/feat/#319
jaredcnance Jun 29, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
language: csharp
dist: trusty
sudo: required
services:
services:
- postgresql
before_script:
- psql -c 'create database JsonApiDotNetCoreExample;' -U postgres
mono: none
dotnet: 2.1.105 # https://www.microsoft.com/net/download/linux
dotnet: 2.1.300 # https://www.microsoft.com/net/download/linux
branches:
only:
- master
Expand Down
27 changes: 13 additions & 14 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,27 @@
<NetCoreAppVersion>netcoreapp2.0</NetCoreAppVersion>
<NetStandardVersion>netstandard2.0</NetStandardVersion>

<AspNetCoreVersion>2.0.1</AspNetCoreVersion>
<AspNetCoreVersion>2.1.0</AspNetCoreVersion>

<MicrosoftLoggingVersion>2.0.0</MicrosoftLoggingVersion>
<MicrosoftConfigurationVersion>2.0.0</MicrosoftConfigurationVersion>
<MicrosoftOptionsVersion>2.0.0</MicrosoftOptionsVersion>
<MicrosoftLoggingVersion>2.1.0</MicrosoftLoggingVersion>
<MicrosoftConfigurationVersion>2.1.0</MicrosoftConfigurationVersion>
<MicrosoftOptionsVersion>2.1.0</MicrosoftOptionsVersion>

<EFCoreVersion>2.0.1</EFCoreVersion>
<EFCoreToolsVersion>2.0.1</EFCoreToolsVersion>
<EFCoreVersion>2.1.0</EFCoreVersion>
<EFCoreToolsVersion>2.1.0</EFCoreToolsVersion>

<NpgsqlVersion>3.2.6</NpgsqlVersion>
<NpgsqlPostgreSQLVersion>2.0.0</NpgsqlPostgreSQLVersion>
<NpgsqlVersion>4.0.0</NpgsqlVersion>
<NpgsqlPostgreSQLVersion>2.1.0</NpgsqlPostgreSQLVersion>

<TuplesVersion>4.4.0</TuplesVersion>
<TuplesVersion>4.5.0</TuplesVersion>
</PropertyGroup>

<!-- Test Project Dependencies -->
<PropertyGroup>
<TestSdkVersion>15.3.0-preview-20170427-09</TestSdkVersion>
<TestHostVersion>1.1.2</TestHostVersion>
<XUnitVersion>2.3.0-beta3-build3705</XUnitVersion>
<BogusVersion>15.0.3</BogusVersion>
<MoqVersion>4.7.99</MoqVersion>
<TestSdkVersion>15.7.2</TestSdkVersion>
<XUnitVersion>2.3.1</XUnitVersion>
<BogusVersion>22.1.2</BogusVersion>
<MoqVersion>4.8.3</MoqVersion>
</PropertyGroup>

</Project>
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,14 @@ These are some steps you can take to help you understand what this project is an
- [The json:api specification](http://jsonapi.org/format/)
- [Demo [Video]](https://youtu.be/KAMuo6K7VcE)
- [Our documentation](https://json-api-dotnet.github.io)
- Check out the examples in the next section
- [Check out the example projects](https://github.com/json-api-dotnet/JsonApiDotNetCore/tree/master/src/Examples)

## Related Projects

- [Performance Reports](https://github.com/json-api-dotnet/PerformanceReports)
- [JsonApiDotNetCore.MongoDb](https://github.com/json-api-dotnet/JsonApiDotNetCore.MongoDb)
- [JsonApiDotNetCore.Marten](https://github.com/wayne-o/JsonApiDotNetCore.Marten)
- [Todo List App](https://github.com/json-api-dotnet/TodoListExample)

## Examples

Expand Down
4 changes: 2 additions & 2 deletions benchmarks/Benchmarks.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
<AssemblyName>Benchmarks</AssemblyName>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.10.10" />
<PackageReference Include="BenchmarkDotNet" Version="0.10.14" />
<PackageReference Include="moq" Version="$(MoqVersion)" />
<PackageReference Include="xunit" Version="$(xUnitVersion)" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\src\JsonApiDotNetCore\JsonApiDotNetCore.csproj" />
<ProjectReference Include="../src/JsonApiDotNetCore/JsonApiDotNetCore.csproj" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace JsonApiDotNetCoreExample.Controllers.Restricted
{
[Route("[controller]")]
[HttpReadOnly]
public class ReadOnlyController : Controller
public class ReadOnlyController : ControllerBase
{
[HttpGet]
public IActionResult Get() => Ok();
Expand All @@ -22,7 +22,7 @@ public class ReadOnlyController : Controller

[Route("[controller]")]
[NoHttpPost]
public class NoHttpPostController : Controller
public class NoHttpPostController : ControllerBase
{
[HttpGet]
public IActionResult Get() => Ok();
Expand All @@ -39,7 +39,7 @@ public class NoHttpPostController : Controller

[Route("[controller]")]
[NoHttpPatch]
public class NoHttpPatchController : Controller
public class NoHttpPatchController : ControllerBase
{
[HttpGet]
public IActionResult Get() => Ok();
Expand All @@ -56,7 +56,7 @@ public class NoHttpPatchController : Controller

[Route("[controller]")]
[NoHttpDelete]
public class NoHttpDeleteController : Controller
public class NoHttpDeleteController : ControllerBase
{
[HttpGet]
public IActionResult Get() => Ok();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace JsonApiDotNetCoreExample.Controllers
{
[Route("[controller]")]
public class TestValuesController : Controller
public class TestValuesController : ControllerBase
{
[HttpGet]
public IActionResult Get()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,12 @@ public CustomJsonApiController(
}

public class CustomJsonApiController<T, TId>
: Controller where T : class, IIdentifiable<TId>
: ControllerBase where T : class, IIdentifiable<TId>
{
private readonly ILogger _logger;
private readonly IResourceService<T, TId> _resourceService;
private readonly IJsonApiContext _jsonApiContext;

protected IActionResult UnprocessableEntity()
{
return new StatusCodeResult(422);
}

protected IActionResult Forbidden()
{
return new StatusCodeResult(403);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,4 @@
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="$(NpgsqlPostgreSQLVersion)" />
</ItemGroup>

<ItemGroup>
<DotNetCliToolReference Include="Microsoft.EntityFrameworkCore.Tools.DotNet" Version="$(EFCoreToolsVersion)" />
</ItemGroup>

</Project>

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using System;
using System.Collections.Generic;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;

namespace JsonApiDotNetCoreExample.Migrations
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// <auto-generated />
// <auto-generated />
using JsonApiDotNetCoreExample.Data;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
Expand All @@ -7,6 +7,7 @@
using Microsoft.EntityFrameworkCore.Storage;
using Microsoft.EntityFrameworkCore.Storage.Internal;
using System;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;

namespace JsonApiDotNetCoreExample.Migrations
{
Expand Down
26 changes: 11 additions & 15 deletions src/Examples/JsonApiDotNetCoreExample/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,17 @@ public Startup(IHostingEnvironment env)
public virtual IServiceProvider ConfigureServices(IServiceCollection services)
{
var loggerFactory = new LoggerFactory();
loggerFactory.AddConsole(LogLevel.Trace);
services.AddSingleton<ILoggerFactory>(loggerFactory);
loggerFactory.AddConsole(LogLevel.Warning);

services.AddDbContext<AppDbContext>(options =>
{
options.UseNpgsql(GetDbConnectionString());
}, ServiceLifetime.Transient);

services.AddJsonApi<AppDbContext>(opt =>
{
opt.Namespace = "api/v1";
opt.DefaultPageSize = 5;
opt.IncludeTotalRecordCount = true;
});
services
.AddSingleton<ILoggerFactory>(loggerFactory)
.AddDbContext<AppDbContext>(options =>
options.UseNpgsql(GetDbConnectionString()), ServiceLifetime.Transient)
.AddJsonApi<AppDbContext>(options => {
options.Namespace = "api/v1";
options.DefaultPageSize = 5;
options.IncludeTotalRecordCount = true;
});

var provider = services.BuildServiceProvider();
var appContext = provider.GetRequiredService<AppDbContext>();
Expand All @@ -60,11 +57,10 @@ public virtual void Configure(
context.Database.EnsureCreated();

loggerFactory.AddConsole(Config.GetSection("Logging"));
loggerFactory.AddDebug();

app.UseJsonApi();
}

public string GetDbConnectionString() => Config["Data:DefaultConnection"];
}
}
}
6 changes: 3 additions & 3 deletions src/Examples/JsonApiDotNetCoreExample/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
"Logging": {
"IncludeScopes": false,
"LogLevel": {
"Default": "Trace",
"System": "Trace",
"Microsoft": "Trace"
"Default": "Warning",
"System": "Warning",
"Microsoft": "Warning"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="$(MicrosoftLoggingVersion)" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="$(NpgsqlPostgreSQLVersion)" />
<PackageReference Include="Npgsql" Version="$(NpgsqlVersion)" />
<PackageReference Include="Dapper" Version="1.50.2" />
<PackageReference Include="Dapper" Version="1.50.5" />
</ItemGroup>

</Project>
5 changes: 2 additions & 3 deletions src/Examples/NoEntityFrameworkExample/Startup.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using JsonApiDotNetCore.Extensions;
using JsonApiDotNetCore.Extensions;
using JsonApiDotNetCore.Services;
using JsonApiDotNetCoreExample.Data;
using JsonApiDotNetCoreExample.Models;
Expand Down Expand Up @@ -31,7 +31,7 @@ public Startup(IHostingEnvironment env)
public virtual IServiceProvider ConfigureServices(IServiceCollection services)
{
// Add framework services.
var mvcBuilder = services.AddMvc();
var mvcBuilder = services.AddMvcCore();

services.AddJsonApi(options => {
options.Namespace = "api/v1";
Expand All @@ -55,7 +55,6 @@ public virtual IServiceProvider ConfigureServices(IServiceCollection services)
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory, AppDbContext context)
{
loggerFactory.AddConsole(Configuration.GetSection("Logging"));
loggerFactory.AddDebug();

context.Database.EnsureCreated();

Expand Down
6 changes: 1 addition & 5 deletions src/Examples/OperationsExample/OperationsExample.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<ItemGroup>
<ProjectReference Include="../../JsonApiDotNetCore/JsonApiDotNetCore.csproj" />
<ProjectReference Include="..\JsonApiDotNetCoreExample\JsonApiDotNetCoreExample.csproj" />
<ProjectReference Include="../JsonApiDotNetCoreExample/JsonApiDotNetCoreExample.csproj" />
</ItemGroup>

<ItemGroup>
Expand All @@ -27,8 +27,4 @@
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="$(NpgsqlPostgreSQLVersion)" />
</ItemGroup>

<ItemGroup>
<DotNetCliToolReference Include="Microsoft.EntityFrameworkCore.Tools.DotNet" Version="$(EFCoreToolsVersion)" />
</ItemGroup>

</Project>
3 changes: 1 addition & 2 deletions src/Examples/OperationsExample/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public Startup(IHostingEnvironment env)
public virtual IServiceProvider ConfigureServices(IServiceCollection services)
{
var loggerFactory = new LoggerFactory();
loggerFactory.AddConsole(LogLevel.Trace);
loggerFactory.AddConsole(LogLevel.Warning);

services.AddSingleton<ILoggerFactory>(loggerFactory);

Expand All @@ -47,7 +47,6 @@ public virtual void Configure(
context.Database.EnsureCreated();

loggerFactory.AddConsole(Config.GetSection("Logging"));
loggerFactory.AddDebug();
app.UseJsonApi();
}

Expand Down
6 changes: 3 additions & 3 deletions src/Examples/OperationsExample/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
"Logging": {
"IncludeScopes": false,
"LogLevel": {
"Default": "Trace",
"System": "Trace",
"Microsoft": "Trace"
"Default": "Warning",
"System": "Warning",
"Microsoft": "Warning"
}
}
}
4 changes: 2 additions & 2 deletions src/Examples/ReportsExample/ReportsExample.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore" Version="$(AspNetCoreVersion)" />
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="$(AspNetCoreVersion)" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Core" Version="$(AspNetCoreVersion)" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="$(MicrosoftLoggingVersion)" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="$(NpgsqlPostgreSQLVersion)" />
<PackageReference Include="Npgsql" Version="$(NpgsqlVersion)" />
<PackageReference Include="Dapper" Version="1.50.2" />
<PackageReference Include="Dapper" Version="1.50.5" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion src/Examples/ReportsExample/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public Startup(IHostingEnvironment env)

public virtual void ConfigureServices(IServiceCollection services)
{
var mvcBuilder = services.AddMvc();
var mvcBuilder = services.AddMvcCore();
services.AddJsonApi(opt =>
{
opt.BuildContextGraph(builder =>
Expand Down
2 changes: 1 addition & 1 deletion src/Examples/ReportsExample/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"Logging": {
"IncludeScopes": false,
"LogLevel": {
"Default": "Information"
"Default": "Warning"
}
}
}
Loading