You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have created a custom controller Which inherits from BaseJsonApiController<> and i have overridden methods like GetAsync, GetById, PatchResource, PostResource. So while running the application getting error from swagger that says : An unhandled exception has occurred while executing the request. Swashbuckle.AspNetCore.SwaggerGen.SwaggerGeneratorException: Ambiguous HTTP method for action - Controllers.RaceController.GetSecondaryAsync. Actions require an explicit HttpMethod binding for Swagger/OpenAPI 3.0
Also, even if i use specific service then also it generates all the controller endpoints Example :
public class BaseController<TResource, TIdentifier> : BaseJsonApiController<TResource, TIdentifier> where TResource : class, IIdentifiable where TIdentifier : struct { public BaseController(IJsonApiOptions options, IResourceGraph resourceGraph, ILoggerFactory loggerFactory, IGetAllService<TResource, TIdentifier> getAllService) : base(options, resourceGraph, loggerFactory, getAllService) {
} }
Now in the above example it will create endpoints for PostAsync as well which it should not as per the documentation.
I wanted to get only the routes endpoint generated for those the methods has been overridden from the BaseJsonApiController but currently it is generating all the endpoints. I am using version 5.3.0 of JsonApiDotNetCore
The text was updated successfully, but these errors were encountered:
Currently as a workaround for the managing the request and response structure according to json:api I have used the Swashbuckle.AspNetCore.SwaggerGen.IOperationFilter and IDocumentFilter.
But If i have injected only IGetAllService<TResource, TIdentifier> in the BaseJsonApiController<TResource, TIdentifier> constructor then also i am able to hit the Post Url. Is there any way to restrict that?
So, Is there any way to only expose the partial resource endpoints using the BaseJsonApiController<TResource, TIdentifier> ?
Before starting to work on this PR, I wasn't able to give you a good answer because I didn't know how this was implemented. The original code was written by @maurei, who isn't active on the project anymore. I'm picking up from there, still learning. I think I understand your issue now. Can you let me know if the PR solves the problem?
I have created a custom controller Which inherits from BaseJsonApiController<> and i have overridden methods like GetAsync, GetById, PatchResource, PostResource. So while running the application getting error from swagger that says : An unhandled exception has occurred while executing the request. Swashbuckle.AspNetCore.SwaggerGen.SwaggerGeneratorException: Ambiguous HTTP method for action - Controllers.RaceController.GetSecondaryAsync. Actions require an explicit HttpMethod binding for Swagger/OpenAPI 3.0
Also, even if i use specific service then also it generates all the controller endpoints Example :
public class BaseController<TResource, TIdentifier> : BaseJsonApiController<TResource, TIdentifier> where TResource : class, IIdentifiable where TIdentifier : struct { public BaseController(IJsonApiOptions options, IResourceGraph resourceGraph, ILoggerFactory loggerFactory, IGetAllService<TResource, TIdentifier> getAllService) : base(options, resourceGraph, loggerFactory, getAllService) {
} }
Now in the above example it will create endpoints for PostAsync as well which it should not as per the documentation.
I wanted to get only the routes endpoint generated for those the methods has been overridden from the BaseJsonApiController but currently it is generating all the endpoints. I am using version 5.3.0 of JsonApiDotNetCore
The text was updated successfully, but these errors were encountered: