Last post Sep 08, 2020 08:38 PM by bruce (sqlwork.com)
Sep 07, 2020 08:45 AM|manga75|LINK
I just got asked to prepare to get a API up that has a swagger file to connect to the company website to connect some new
functionality and I have never done it before and the guy that normally does stuff like that has quit and they want it up and running ASAP so I was hoping someone could point me in the right direction.
I have mapped up and utilized all kinds of webservices and things like that before and worked with integration of them but here I just dont know what to do.
Sep 07, 2020 10:52 AM|mgebhard|LINK
Are you asking for an utility that generates a C# client from a Swagger JSON file?
Sep 07, 2020 11:22 AM|cartersland|LINK
Sep 07, 2020 01:28 PM|manga75|LINK
Yes, and I looked at the swagger-codegen but couldn't make full sense out of it...don't really understand how to use it.
And the site is an old project that we dont work on anymore its a webforms project which will be replaced buy a
core website next year.
Do we need to make a web api application as a middleware or can we just integrate it directly into the webforms project?
Sep 08, 2020 08:38 PM|bruce (sqlwork.com)|LINK
its not clear if you want to call a webapi site that supports swagger or write a new webapi site that supports swagger UI.
if the first case, you download the swagger tools, and use the codegen to generate a client api for the swagger enabled website.
if the second case, create your web api project. pick a swagger toolkit (say nswag or swashbuckle). then install the nuget package for the webapi framework and toolkit you are using. then follow the documentation for the chosen nuget package to add swagger
support to your webapi project.
note: if you are not using asp.net core you may need to add owin support.