C
C#3d ago
SWEETPONY

✅ How to convert controller route name to camel case automatically?

I have this:
[Authorize]
[Route("[controller]")]
public class StreamController
[Authorize]
[Route("[controller]")]
public class StreamController
and controller name in swagger is Stream but should be stream
4 Replies
Anton
Anton3d ago
it's not possible like that not within that attribute you have to type it like that manually for each class or extend the framework, probably with a controller filter to be able to configure controller metadata if you just want it for swagger, you need to dynamically parse routes, it's going to be a total mess, I don't recommend
Unknown User
Unknown User3d ago
Message Not Public
Sign In & Join Server To View
SWEETPONY
SWEETPONYOP3d ago
idk why asp doesn’t have this behavior by default.. but ok Thanks
Unknown User
Unknown User3d ago
Message Not Public
Sign In & Join Server To View

Did you find this page helpful?