Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to remove routes from route chart #1042

Closed
llebc opened this issue Aug 20, 2021 · 5 comments
Closed

Unable to remove routes from route chart #1042

llebc opened this issue Aug 20, 2021 · 5 comments

Comments

@llebc
Copy link

llebc commented Aug 20, 2021

DESCRIPTION

Sometimes there's a scenerio where I don't want to enable certain routes. I.E having a read-only route which has just a GET for the list and a GET for the find.

/users
/users/1

STEPS TO REPRODUCE

Create a new project and add a model + controller. All routes will be generated with relationships etc.

EXPECTED BEHAVIOR

Having a option to specify the routes which are allowed. No specification should lead to all routes being active.

[AllowedRoutes('find', 'index')]

ACTUAL BEHAVIOR

All routes are generated no matter the controller.

VERSIONS USED

  • JsonApiDotNetCore version:
  • ASP.NET Core version: 5
  • Entity Framework Core version: 5.0.9
  • Database provider: SQL Server 4.2.0
@llebc
Copy link
Author

llebc commented Aug 20, 2021

OK so after reading further into the source code, I have extended the original class from the resource query service and managed to achieve this. However, when using Swagger it doesn't recognise the HttpGet attribute on the controllers method. I think this is the bug.

@maurei
Copy link
Member

maurei commented Aug 23, 2021

There is an example in our test codebase that demonstrates how to create a readonly controller.

Swagger not picking up on this is not a bug because swagger is not intended to work with the current version of JADNC. I am working on an OpenAPI integration and I am hoping to release a roadmap for this in the near future.

@llebc
Copy link
Author

llebc commented Aug 25, 2021

@maurei Thank you for confirming, going to go ahead and close the issue. Thank you very much.

@llebc llebc closed this as completed Aug 25, 2021
@maurei
Copy link
Member

maurei commented Sep 1, 2021

@llebc the update on our progress on a swagger integration can be found at #1046

@llebc
Copy link
Author

llebc commented Sep 13, 2021

@llebc the update on our progress on a swagger integration can be found at #1046

Thanks @maurei, much appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants