昂首阔步未检测到功能文件夹中的控制器

时间:2019-06-09 22:57:22

标签: c# asp.net-core swagger

我试图在我的项目中使用Swagger,但是它没有检测到我的控制器。

这是我Startup.cs中大摇大摆的配置

/****
*this is .h file
*****/
 #pragma once

 #include "CoreMinimal.h"

 #include "AIController.h"

 #include "Engine.h"

 #include "AI_Controller.generated.h"


UCLASS()

class TEST_API AAI_Controller : public AAIController
{

GENERATED_BODY()

public:

    AAI_Controller();

        virtual void BeginPlay() override;

        virtual void Possess(APawn* Pawn) override;

        virtual void Tick(float DeltaSeconds) override;

        virtual FRotator GetControlRotation() const override;

        UFUNCTION()
            void OnPawnDetected(const TArray<AActor*> &DetectedPawns);

        UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = AI)
            float AISightRadius = 500.0f;

        UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = AI)
            float AISightAge = 5.0f;

        UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = AI)
            float AILoseSightRadius = AISightRadius + 50.0f;

        UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = AI)
            float AIFieldOfView = 90.0f;

        UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = AI)
            class UAISenseConfig_Sight* SightConfig;

};

this is the structure of my code

如果我有一个名称为“ Controllers”的文件夹,并且我内部有一个控制器,则摇摇晃晃地找到该控制器并在摇摇晃晃的页面中将其打印出来,但是如果该控制器位于Feature文件夹中,则找不到它

here is the full code

1 个答案:

答案 0 :(得分:0)

Swashbuckle使用Microsoft.AspNetCore.Mvc.ApiExplorer,因此,如果asp网络核心找到您的控制器,Swashbuckle也将使用。不管您使用什么文件夹。 如果您的控制器位于启动项目中,则无需执行任何操作。只需遵循可用的教程即可。请参阅G et started with Swashbuckle and ASP.NET Core