Skip to content

Commit 7b37eeb

Browse files
author
Bart Koelman
authored
Naming consistency (#909)
* Naming consistency: our framework is called JsonApiDotNetCore and the spec it implements is called JSON:API (in this casing) * Fixed: invalid reference (was pointing to the member itself instead of the class)
1 parent 2b9f6ae commit 7b37eeb

File tree

58 files changed

+91
-90
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+91
-90
lines changed

README.md

+5-4
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,23 @@
22
<img src ="https://raw.githubusercontent.com/json-api-dotnet/JsonApiDotnetCore/master/logo.png" />
33
</p>
44

5-
# JSON:API Framework for ASP.NET Core
5+
# JsonApiDotNetCore
6+
A framework for building [JSON:API](http://jsonapi.org/) compliant REST APIs using .NET Core and Entity Framework Core.
67

78
[![Build status](https://ci.appveyor.com/api/projects/status/5go47hrm0iik0ls3/branch/master?svg=true)](https://ci.appveyor.com/project/jaredcnance/jsonapidotnetcore/branch/master)
89
[![Travis](https://travis-ci.org/json-api-dotnet/JsonApiDotNetCore.svg?branch=master)](https://travis-ci.org/json-api-dotnet/JsonApiDotNetCore)
910
[![NuGet](https://img.shields.io/nuget/v/JsonApiDotNetCore.svg)](https://www.nuget.org/packages/JsonApiDotNetCore/)
1011
[![Join the chat at https://gitter.im/json-api-dotnet-core/Lobby](https://badges.gitter.im/json-api-dotnet-core/Lobby.svg)](https://gitter.im/json-api-dotnet-core/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
1112
[![FIRST-TIMERS](https://img.shields.io/badge/first--timers--only-friendly-blue.svg)](http://www.firsttimersonly.com/)
1213

13-
A framework for building [json:api](http://jsonapi.org/) compliant web APIs. The ultimate goal of this library is to eliminate as much boilerplate as possible by offering out-of-the-box features such as sorting, filtering and pagination. You just need to focus on defining the resources and implementing your custom business logic. This library has been designed around dependency injection making extensibility incredibly easy.
14+
The ultimate goal of this library is to eliminate as much boilerplate as possible by offering out-of-the-box features such as sorting, filtering and pagination. You just need to focus on defining the resources and implementing your custom business logic. This library has been designed around dependency injection, making extensibility incredibly easy.
1415

1516
## Getting Started
1617

1718
These are some steps you can take to help you understand what this project is and how you can use it:
1819

19-
- [What is json:api and why should I use it?](https://nordicapis.com/the-benefits-of-using-json-api/)
20-
- [The json:api specification](http://jsonapi.org/format/)
20+
- [What is JSON:API and why should I use it?](https://nordicapis.com/the-benefits-of-using-json-api/)
21+
- [The JSON:API specification](http://jsonapi.org/format/)
2122
- [Demo [Video]](https://youtu.be/KAMuo6K7VcE)
2223
- [Our documentation](https://json-api-dotnet.github.io/JsonApiDotNetCore/)
2324
- [Check out the example projects](https://github.com/json-api-dotnet/JsonApiDotNetCore/tree/master/src/Examples)

docs/home/index.html

+6-6
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
<head>
44
<meta charset="utf-8">
55
<meta content="width=device-width, initial-scale=1.0" name="viewport">
6-
<title>JSON:API .NET Core</title>
7-
<meta content="A framework for building json:api compliant REST APIs using .NET Core and Entity Framework Core" name="description">
8-
<meta content="jsonapidotnetcore jsonapi json:api dotnetcore" name="keywords">
6+
<title>JsonApiDotNetCore documentation</title>
7+
<meta content="A framework for building JSON:API compliant REST APIs using .NET Core and Entity Framework Core" name="description">
8+
<meta content="jsonapidotnetcore jsonapi json:api dotnet asp.net" name="keywords">
99
<link href="favicon.ico" rel="icon">
1010
<link href="favicon.ico" rel="apple-touch-icon">
1111
<link href="https://fonts.googleapis.com/css?family=Open+Sans:300,300i,400,400i,600,600i,700,700i|Raleway:300,300i,400,400i,600,600i,700,700i" rel="stylesheet">
@@ -21,8 +21,8 @@
2121
<div class="container">
2222
<div class="row">
2323
<div class="col-lg-7 pt-5 pt-lg-0 order-2 order-lg-1">
24-
<h1>JSON:API .NET Core</h1>
25-
<h2>A framework for building <a href="https://jsonapi.org/" target="_blank">json:api</a> compliant REST APIs using .NET Core and Entity Framework Core</h2>
24+
<h1>JsonApiDotNetCore</h1>
25+
<h2>A framework for building <a href="https://jsonapi.org/" target="_blank">JSON:API</a> compliant REST APIs using .NET Core and Entity Framework Core</h2>
2626
<a href="#about" class="btn-get-started scrollto">Read more</a>
2727
<a href="../../getting-started/install.html" class="btn-get-started">Getting started</a>
2828
<a href="https://github.com/json-api-dotnet/JsonApiDotNetCore/" target="_blank" class="btn-get-started">Contribute on GitHub</a>
@@ -43,7 +43,7 @@ <h2>A framework for building <a href="https://jsonapi.org/" target="_blank">json
4343
<div class="col-lg-6 pt-5 pt-lg-0">
4444
<h3 data-aos="fade-up">Objectives</h3>
4545
<p data-aos="fade-up" data-aos-delay="100">
46-
The goal of this library is to simplify the development of APIs that leverage the full range of features provided by the <a href="https://jsonapi.org/" target="_blank">json:api</a> specification.
46+
The goal of this library is to simplify the development of APIs that leverage the full range of features provided by the <a href="https://jsonapi.org/" target="_blank">JSON:API</a> specification.
4747
You just need to focus on defining the resources and implementing your custom business logic.
4848
</p>
4949
<div class="row">

docs/usage/errors.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Errors returned will contain only the properties that are set on the `Error` class. Custom fields can be added through `Error.Meta`.
44
You can create a custom error by throwing a `JsonApiException` (which accepts an `Error` instance), or returning an `Error` instance from an `ActionResult` in a controller.
5-
Please keep in mind that json:api requires Title to be a generic message, while Detail should contain information about the specific problem occurence.
5+
Please keep in mind that JSON:API requires Title to be a generic message, while Detail should contain information about the specific problem occurence.
66

77
From a controller method:
88
```c#
@@ -22,7 +22,7 @@ throw new JsonApiException(new Error(HttpStatusCode.Conflict)
2222
});
2323
```
2424

25-
In both cases, the middleware will properly serialize it and return it as a json:api error.
25+
In both cases, the middleware will properly serialize it and return it as a JSON:API error.
2626

2727
# Exception handling
2828

docs/usage/meta.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Metadata
22

3-
We support two ways to add json:api meta to your responses: global and per resource.
3+
We support two ways to add JSON:API meta to your responses: global and per resource.
44

55
## Global Meta
66

docs/usage/options.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ options.UseRelativeLinks = true;
6464

6565
## Unknown Query String Parameters
6666

67-
If you would like to allow unknown query string parameters (parameters not reserved by the json:api specification or registered using resource definitions), you can set `AllowUnknownQueryStringParameters = true`. When set to `false` (the default), an HTTP 400 Bad Request is returned for unknown query string parameters.
67+
If you would like to allow unknown query string parameters (parameters not reserved by the JSON:API specification or registered using resource definitions), you can set `AllowUnknownQueryStringParameters = true`. When set to `false` (the default), an HTTP 400 Bad Request is returned for unknown query string parameters.
6868

6969
```c#
7070
options.AllowUnknownQueryStringParameters = true;

docs/usage/resource-graph.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
_NOTE: prior to v4 this was called the `ContextGraph`_
44

5-
The `ResourceGraph` is a map of all the json:api resources and their relationships that your API serves.
5+
The `ResourceGraph` is a map of all the JSON:API resources and their relationships that your API serves.
66

77
It is built at app startup and available as a singleton through Dependency Injection.
88

@@ -21,7 +21,7 @@ is prioritized by the list above in descending order.
2121
### Auto-discovery
2222

2323
Auto-discovery refers to the process of reflecting on an assembly and
24-
detecting all of the json:api resources, resource definitions, resource services and repositories.
24+
detecting all of the JSON:API resources, resource definitions, resource services and repositories.
2525

2626
The following command builds the resource graph using all `IIdentifiable` implementations and registers the services mentioned.
2727
You can enable auto-discovery for the current assembly by adding the following to your `Startup` class.
@@ -73,7 +73,7 @@ public void ConfigureServices(IServiceCollection services)
7373

7474
## Resource Name
7575

76-
The public resource name is exposed through the `type` member in the json:api payload. This can be configured by the following approaches (in order of priority):
76+
The public resource name is exposed through the `type` member in the JSON:API payload. This can be configured by the following approaches (in order of priority):
7777

7878
1. The `publicName` parameter when manually adding a resource to the graph
7979
```c#

docs/usage/resources/attributes.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public class Person : Identifiable
2929

3030
_since v4.0_
3131

32-
Default json:api attribute capabilities are specified in @JsonApiDotNetCore.Configuration.JsonApiOptions#JsonApiDotNetCore_Configuration_JsonApiOptions_DefaultAttrCapabilities:
32+
Default JSON:API attribute capabilities are specified in @JsonApiDotNetCore.Configuration.JsonApiOptions#JsonApiDotNetCore_Configuration_JsonApiOptions_DefaultAttrCapabilities:
3333

3434
```c#
3535
options.DefaultAttrCapabilities = AttrCapabilities.None; // default: All

docs/usage/resources/relationships.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public class TodoItem : Identifiable
7777

7878
_since v4.0_
7979

80-
Your resource may expose a calculated property, whose value depends on a related entity that is not exposed as a json:api resource.
80+
Your resource may expose a calculated property, whose value depends on a related entity that is not exposed as a JSON:API resource.
8181
So for the calculated property to be evaluated correctly, the related entity must always be retrieved. You can achieve that using `EagerLoad`, for example:
8282

8383
```c#

docs/usage/resources/resource-definitions.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ For various reasons (see examples below) you may need to change parts of the que
1313
`JsonApiResourceDefinition<TResource>` (which is an empty implementation of `IResourceDefinition<TResource>`) provides overridable methods that pass you the result of query string parameter parsing.
1414
The value returned by you determines what will be used to execute the query.
1515

16-
An intermediate format (`QueryExpression` and derived types) is used, which enables us to separate json:api implementation
16+
An intermediate format (`QueryExpression` and derived types) is used, which enables us to separate JSON:API implementation
1717
from Entity Framework Core `IQueryable` execution.
1818

1919
### Excluding fields

docs/usage/routing.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Which results in URLs like: https://yourdomain.com/api/v1/people
1414

1515
## Default Routing Convention
1616

17-
The library will configure routes for all controllers in your project. By default, routes are camel-cased. This is based on the [recommendations](https://jsonapi.org/recommendations/) outlined in the json:api spec.
17+
The library will configure routes for all controllers in your project. By default, routes are camel-cased. This is based on the [recommendations](https://jsonapi.org/recommendations/) outlined in the JSON:API spec.
1818

1919
```c#
2020
public class OrderLine : Identifiable { }
@@ -35,7 +35,7 @@ GET /orderLines HTTP/1.1
3535

3636
The exposed name of the resource ([which can be customized](~/usage/resource-graph.md#resource-name)) is used for the route, instead of the controller name.
3737

38-
### Non-json:api controllers
38+
### Non-JSON:API controllers
3939

4040
If a controller does not inherit from `JsonApiController<TResource>`, the [configured naming convention](~/usage/options.md#custom-serializer-settings) is applied to the name of the controller.
4141
```c#
@@ -69,4 +69,4 @@ public void ConfigureServices(IServiceCollection services)
6969
{
7070
services.AddSingleton<IJsonApiRoutingConvention, CustomRoutingConvention>();
7171
}
72-
```
72+
```

src/JsonApiDotNetCore/Configuration/IJsonApiOptions.cs

+5-5
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public interface IJsonApiOptions
2020
string Namespace { get; }
2121

2222
/// <summary>
23-
/// Specifies the default query string capabilities that can be used on exposed json:api attributes.
23+
/// Specifies the default query string capabilities that can be used on exposed JSON:API attributes.
2424
/// Defaults to <see cref="AttrCapabilities.All"/>.
2525
/// </summary>
2626
AttrCapabilities DefaultAttrCapabilities { get; }
@@ -56,21 +56,21 @@ public interface IJsonApiOptions
5656
bool UseRelativeLinks { get; }
5757

5858
/// <summary>
59-
/// Configures globally which links to show in the <see cref="TopLevelLinks"/>
59+
/// Configures globally which links to show in the <see cref="Serialization.Objects.TopLevelLinks"/>
6060
/// object for a requested resource. Setting can be overridden per resource by
6161
/// adding a <see cref="ResourceLinksAttribute"/> to the class definition of that resource.
6262
/// </summary>
6363
LinkTypes TopLevelLinks { get; }
6464

6565
/// <summary>
66-
/// Configures globally which links to show in the <see cref="ResourceLinks"/>
66+
/// Configures globally which links to show in the <see cref="Serialization.Objects.ResourceLinks"/>
6767
/// object for a requested resource. Setting can be overridden per resource by
6868
/// adding a <see cref="ResourceLinksAttribute"/> to the class definition of that resource.
6969
/// </summary>
7070
LinkTypes ResourceLinks { get; }
7171

7272
/// <summary>
73-
/// Configures globally which links to show in the <see cref="RelationshipLinks"/>
73+
/// Configures globally which links to show in the <see cref="Serialization.Objects.RelationshipLinks"/>
7474
/// object for a requested resource. Setting can be overridden per resource by
7575
/// adding a <see cref="ResourceLinksAttribute"/> to the class definition of that resource.
7676
/// This option can also be specified per relationship by using the associated links argument
@@ -174,7 +174,7 @@ public interface IJsonApiOptions
174174

175175
/// <summary>
176176
/// Specifies the settings that are used by the <see cref="JsonSerializer"/>.
177-
/// Note that at some places a few settings are ignored, to ensure json:api spec compliance.
177+
/// Note that at some places a few settings are ignored, to ensure JSON:API spec compliance.
178178
/// <example>
179179
/// The next example changes the naming convention to kebab casing.
180180
/// <code><![CDATA[

src/JsonApiDotNetCore/Configuration/JsonApiMetadataProvider.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
namespace JsonApiDotNetCore.Configuration
77
{
88
/// <summary>
9-
/// Custom implementation of <see cref="IModelMetadataProvider"/> to support json:api partial patching.
9+
/// Custom implementation of <see cref="IModelMetadataProvider"/> to support JSON:API partial patching.
1010
/// </summary>
1111
internal class JsonApiModelMetadataProvider : DefaultModelMetadataProvider
1212
{

src/JsonApiDotNetCore/Configuration/JsonApiValidationFilter.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
namespace JsonApiDotNetCore.Configuration
1010
{
1111
/// <summary>
12-
/// Validation filter that blocks ASP.NET Core ModelState validation on data according to the json:api spec.
12+
/// Validation filter that blocks ASP.NET Core ModelState validation on data according to the JSON:API spec.
1313
/// </summary>
1414
internal sealed class JsonApiValidationFilter : IPropertyValidationFilter
1515
{

src/JsonApiDotNetCore/Configuration/ResourceContext.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -51,23 +51,23 @@ public class ResourceContext
5151
public IReadOnlyCollection<ResourceFieldAttribute> Fields => _fields ??= Attributes.Cast<ResourceFieldAttribute>().Concat(Relationships).ToArray();
5252

5353
/// <summary>
54-
/// Configures which links to show in the <see cref="TopLevelLinks"/>
54+
/// Configures which links to show in the <see cref="Serialization.Objects.TopLevelLinks"/>
5555
/// object for this resource. If set to <see cref="LinkTypes.NotConfigured"/>,
5656
/// the configuration will be read from <see cref="IJsonApiOptions"/>.
5757
/// Defaults to <see cref="LinkTypes.NotConfigured"/>.
5858
/// </summary>
5959
public LinkTypes TopLevelLinks { get; internal set; } = LinkTypes.NotConfigured;
6060

6161
/// <summary>
62-
/// Configures which links to show in the <see cref="ResourceLinks"/>
62+
/// Configures which links to show in the <see cref="Serialization.Objects.ResourceLinks"/>
6363
/// object for this resource. If set to <see cref="LinkTypes.NotConfigured"/>,
6464
/// the configuration will be read from <see cref="IJsonApiOptions"/>.
6565
/// Defaults to <see cref="LinkTypes.NotConfigured"/>.
6666
/// </summary>
6767
public LinkTypes ResourceLinks { get; internal set; } = LinkTypes.NotConfigured;
6868

6969
/// <summary>
70-
/// Configures which links to show in the <see cref="RelationshipLinks"/>
70+
/// Configures which links to show in the <see cref="Serialization.Objects.RelationshipLinks"/>
7171
/// for all relationships of the resource for which this attribute was instantiated.
7272
/// If set to <see cref="LinkTypes.NotConfigured"/>, the configuration will
7373
/// be read from <see cref="RelationshipAttribute.Links"/> or

src/JsonApiDotNetCore/Configuration/ResourceGraph.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ private static Expression RemoveConvert(Expression expression)
169169

170170
private void ThrowNotExposedError(string memberName, FieldFilterType type)
171171
{
172-
throw new ArgumentException($"{memberName} is not an json:api exposed {type:g}.");
172+
throw new ArgumentException($"{memberName} is not a JSON:API exposed {type:g}.");
173173
}
174174

175175
private enum FieldFilterType

src/JsonApiDotNetCore/Configuration/ResourceGraphBuilder.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ private void SetResourceLinksOptions(ResourceContext resourceContext)
4747
}
4848

4949
/// <summary>
50-
/// Adds a json:api resource with <code>int</code> as the identifier type.
50+
/// Adds a JSON:API resource with <code>int</code> as the identifier type.
5151
/// </summary>
5252
/// <typeparam name="TResource">The resource model type.</typeparam>
5353
/// <param name="publicName">
@@ -58,7 +58,7 @@ public ResourceGraphBuilder Add<TResource>(string publicName = null) where TReso
5858
=> Add<TResource, int>(publicName);
5959

6060
/// <summary>
61-
/// Adds a json:api resource.
61+
/// Adds a JSON:API resource.
6262
/// </summary>
6363
/// <typeparam name="TResource">The resource model type.</typeparam>
6464
/// <typeparam name="TId">The resource model identifier type.</typeparam>
@@ -70,7 +70,7 @@ public ResourceGraphBuilder Add<TResource, TId>(string publicName = null) where
7070
=> Add(typeof(TResource), typeof(TId), publicName);
7171

7272
/// <summary>
73-
/// Adds a json:api resource.
73+
/// Adds a JSON:API resource.
7474
/// </summary>
7575
/// <param name="resourceType">The resource model type.</param>
7676
/// <param name="idType">The resource model identifier type.</param>

src/JsonApiDotNetCore/Configuration/ServiceCollectionExtensions.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ private static void SetupApplicationBuilder(IServiceCollection services, Action<
6161

6262
/// <summary>
6363
/// Enables client serializers for sending requests and receiving responses
64-
/// in json:api format. Internally only used for testing.
64+
/// in JSON:API format. Internally only used for testing.
6565
/// Will be extended in the future to be part of a JsonApiClientDotNetCore package.
6666
/// </summary>
6767
public static IServiceCollection AddClientSerialization(this IServiceCollection services)

src/JsonApiDotNetCore/Controllers/CoreJsonApiController.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
namespace JsonApiDotNetCore.Controllers
77
{
88
/// <summary>
9-
/// Provides helper methods to raise json:api compliant errors from controller actions.
9+
/// Provides helper methods to raise JSON:API compliant errors from controller actions.
1010
/// </summary>
1111
public abstract class CoreJsonApiController : ControllerBase
1212
{

src/JsonApiDotNetCore/Errors/JsonApiException.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
namespace JsonApiDotNetCore.Errors
88
{
99
/// <summary>
10-
/// The base class for an <see cref="Exception"/> that represents one or more json:api error objects in an unsuccessful response.
10+
/// The base class for an <see cref="Exception"/> that represents one or more JSON:API error objects in an unsuccessful response.
1111
/// </summary>
1212
public class JsonApiException : Exception
1313
{

0 commit comments

Comments
 (0)