I have to implement a routine/library to discover an application’s APIs then list them in a database. I don’t know where to start and I can’t find anything really helpful in internet.
All I can do is display the API information via their URL but I can’t find them.
2
Answers
The URL with API information might be made from an XML or JSON documentation file, like Swagger does. c.f. : https://swagger.io/specification/
Hopefully, you can access this file directly (And not the generated HTML) and therefore extract the required info. Then store it in your DB. We might need more precise info to help further.
Assuming you’re using ASP.NET instead of Core, this is a code snippet I used to do similar things.
For some stupid reason our project couldn’t use swagger, so this is a dirty way we do when we need to check if a certain endpoint exists in the project.