mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-07-09 03:04:20 -04:00
Swagger: Adding every module, not just the core
This commit is contained in:
parent
ba37a7cb9b
commit
340950177e
@ -177,6 +177,7 @@ namespace Kyoo.Authentication.Views
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
[ApiExplorerSettings(IgnoreApi = true)]
|
||||
public async Task GetProfileDataAsync(ProfileDataRequestContext context)
|
||||
{
|
||||
User user = await _users.GetOrDefault(int.Parse(context.Subject.GetSubjectId()));
|
||||
@ -187,6 +188,7 @@ namespace Kyoo.Authentication.Views
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
[ApiExplorerSettings(IgnoreApi = true)]
|
||||
public async Task IsActiveAsync(IsActiveContext context)
|
||||
{
|
||||
User user = await _users.GetOrDefault(int.Parse(context.Subject.GetSubjectId()));
|
||||
|
@ -138,7 +138,9 @@ namespace Kyoo.Core
|
||||
{
|
||||
string publicUrl = _configuration.GetPublicUrl();
|
||||
|
||||
services.AddMvc().AddControllersAsServices();
|
||||
services.AddMvcCore()
|
||||
.AddControllersAsServices()
|
||||
.AddApiExplorer();
|
||||
services.AddControllers()
|
||||
.AddNewtonsoftJson(x =>
|
||||
{
|
||||
|
@ -19,6 +19,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using Autofac;
|
||||
using Kyoo.Abstractions;
|
||||
using Kyoo.Abstractions.Controllers;
|
||||
@ -108,6 +109,9 @@ namespace Kyoo.Core
|
||||
/// <param name="services">The service collection to fill.</param>
|
||||
public void ConfigureServices(IServiceCollection services)
|
||||
{
|
||||
foreach (Assembly assembly in _plugins.GetAllPlugins().Select(x => x.GetType().Assembly))
|
||||
services.AddMvcCore().AddApplicationPart(assembly);
|
||||
|
||||
foreach (IPlugin plugin in _plugins.GetAllPlugins())
|
||||
plugin.Configure(services);
|
||||
|
||||
|
@ -21,6 +21,7 @@ using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using Kyoo.Abstractions.Controllers;
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.AspNetCore.Mvc.ApiExplorer;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.OpenApi.Models;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user