Visual Studio cannot add swagger metadata file to my api rest client

I am new to mobile development. Since I am familiar with C # .net, so I use the xamarin plugin for visual studio . I created an example application in which I used SQLite , created a database, and then performed CRUD operations. At the moment, everything is working well. But I already have a local DB , and I want to use it. To do this, I made offline Azure api using swagger , and on Release I saved the locally files using the File System in the release option in VS Now I want to add my application as rest api client and want to use my local DB. But when I try to add leisure api as a client, and then I select select an existing swagger file , so while browsing I can not find the file. See images below for reference.

enter image description here

So, when I click on browse and iterate over the place where I saved my files for swagger, I get nothing, as shown below.

enter image description here

It also finds a .json extension .json that is not in my api post.

I do not know why this is happening, just as I said above. I am new to mobile development. I'm not sure what to do. Please see below image of my swagger UI

enter image description here

Any help would be greatly appreciated

+5
source share
2 answers

Why are you using azure ? I think you work in a company, so they must have a server. Just publish your services on the server, and then synchronize them with the mobile application and the database. This is the easiest and most free way to do this. You can use Rest services for this.

+2
source

The URL you provide is for convenient reference documents for your API; There must be an appropriate JSON definition endpoint URL for your API. Use this instead in the Add Client Client Interface dialog box for Swagger URL.

Another option is to use this partner URL to load the JSON description of your REST API into the local .json file and indicate what you are creating client access classes to.

For an example of these two endpoints, see https://msdn.microsoft.com/en-us/library/mt788315.aspx#Anchor_1 .

+2
source

Source: https://habr.com/ru/post/1259707/


All Articles