Skip to content

Commit 5fc0afa

Browse files
committed
review feedback
1 parent a46fc4d commit 5fc0afa

File tree

6 files changed

+17
-17
lines changed

6 files changed

+17
-17
lines changed

docs/getting-started/install.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@ Install-Package JsonApiDotnetCore
1919
```xml
2020
<ItemGroup>
2121
<!-- Be sure to check NuGet for the latest version # -->
22-
<PackageReference Include="JsonApiDotnetCore" Version="4.0.0" />
22+
<PackageReference Include="JsonApiDotNetCore" Version="4.0.0" />
2323
</ItemGroup>
2424
```

docs/usage/extensibility/middleware.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public class Startup
2727
{
2828
services.AddSingleton<CustomAsyncQueryStringActionFilter>();
2929

30-
IMvcCoreBuilder builder = services.AddMvcCore();
30+
IMvcCoreBuilder mvcBuilder = services.AddMvcCore();
3131
services.AddJsonApi<AppDbContext>(mvcBuilder: builder);
3232

3333
// Ensure this call is placed after the AddJsonApi call.

docs/usage/openapi.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,26 @@ You can describe your API with an OpenAPI specification using the [Swashbuckle](
44

55
## Installation
66

7-
Install the `JsonApiDotnetCore.OpenApi` NuGet package.
7+
Install the `JsonApiDotNetCore.OpenApi` NuGet package.
88

99
### CLI
1010

1111
```
12-
dotnet add package JsonApiDotnetCore.OpenApi
12+
dotnet add package JsonApiDotNetCore.OpenApi
1313
```
1414

1515
### Visual Studio
1616

1717
```powershell
18-
Install-Package JsonApiDotnetCore.OpenApi
18+
Install-Package JsonApiDotNetCore.OpenApi
1919
```
2020

2121
### *.csproj
2222

2323
```xml
2424
<ItemGroup>
2525
<!-- Be sure to check NuGet for the latest version # -->
26-
<PackageReference Include="JsonApiDotnetCore.OpenApi" Version="4.0.0" />
26+
<PackageReference Include="JsonApiDotNetCore.OpenApi" Version="4.0.0" />
2727
</ItemGroup>
2828
```
2929

@@ -58,7 +58,7 @@ public class Startup
5858

5959
By default, the OpenAPI specification will be available at `http://localhost:<port>/swagger/v1/swagger.json`.
6060

61-
Swashbuckle also ships with [SwaggerUI](https://swagger.io/tools/swagger-ui/), tooling for a generated documentation page. This can be enabled by adding the following to your `Startup` class.
61+
Swashbuckle also ships with [SwaggerUI](https://swagger.io/tools/swagger-ui/), tooling for a generated documentation page. This can be enabled by installing the `Swashbuckle.AspNetCore.SwaggerUI` NuGet package and adding the following to your `Startup` class.
6262

6363
```c#
6464
// Startup.cs

docs/usage/toc.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
# [Errors](errors.md)
2222
# [Metadata](meta.md)
2323
# [Caching](caching.md)
24+
# [OpenAPI](openapi.md)
2425

2526
# Extensibility
2627
## [Layer Overview](extensibility/layer-overview.md)
@@ -31,4 +32,3 @@
3132
## [Middleware](extensibility/middleware.md)
3233
## [Query Strings](extensibility/query-strings.md)
3334

34-
# [OpenAPI](openapi.md)

src/Examples/JsonApiDotNetCoreExample/Startup.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,6 @@ public void ConfigureServices(IServiceCollection services)
4747

4848
IMvcCoreBuilder mvcBuilder = services.AddMvcCore();
4949

50-
services.AddOpenApi(mvcBuilder);
51-
5250
using (CodeTimingSessionManager.Current.Measure("Configure JSON:API (startup)"))
5351
{
5452
services.AddJsonApi<AppDbContext>(options =>
@@ -64,6 +62,8 @@ public void ConfigureServices(IServiceCollection services)
6462
#endif
6563
}, discovery => discovery.AddCurrentAssembly(), mvcBuilder: mvcBuilder);
6664
}
65+
66+
services.AddOpenApi(mvcBuilder);
6767
}
6868
}
6969

@@ -82,14 +82,14 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment environment,
8282

8383
app.UseRouting();
8484

85-
app.UseSwagger();
86-
app.UseSwaggerUI();
87-
8885
using (CodeTimingSessionManager.Current.Measure("Initialize JSON:API (startup)"))
8986
{
9087
app.UseJsonApi();
9188
}
9289

90+
app.UseSwagger();
91+
app.UseSwaggerUI();
92+
9393
app.UseEndpoints(endpoints => endpoints.MapControllers());
9494
}
9595

src/JsonApiDotNetCore.OpenApi/ServiceCollectionExtensions.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ namespace JsonApiDotNetCore.OpenApi
66
{
77
public static class ServiceCollectionExtensions
88
{
9-
public static void AddOpenApi(this IServiceCollection services, IMvcCoreBuilder builder, Action<SwaggerGenOptions> setupSwaggerGenAction = null)
9+
public static void AddOpenApi(this IServiceCollection services, IMvcCoreBuilder mvcBuilder, Action<SwaggerGenOptions> setupSwaggerGenAction = null)
1010
{
1111
ArgumentGuard.NotNull(services, nameof(services));
12-
ArgumentGuard.NotNull(builder, nameof(builder));
12+
ArgumentGuard.NotNull(mvcBuilder, nameof(mvcBuilder));
1313

14-
builder.AddApiExplorer();
14+
mvcBuilder.AddApiExplorer();
1515

16-
builder.AddMvcOptions(options => options.Conventions.Add(new OpenApiEndpointConvention()));
16+
mvcBuilder.AddMvcOptions(options => options.Conventions.Add(new OpenApiEndpointConvention()));
1717

1818
services.AddSwaggerGen(setupSwaggerGenAction);
1919
}

0 commit comments

Comments
 (0)