5

I am new to mobile development. As i am familiar with c# .net so i am using xamarin plugin for visual studio. I have created a sample app in which i have used SQLite, created a DB and then performed CRUD operations. At this point all things are working good. But i already have a local DB and i want to use it. For this i have made an offline Azure api using swagger and on Release i have saved the files locally by using File System in release option in VS. Now i want to add my app as rest api client and want to use my local DB. But when i try to add as rest api client and then i select select an existing swagger file so while browsing i can't find any file. For reference please see the images bellow

enter image description here

So when i click browse and goto the location where i have saved my files for swagger i get nothing as shown in bellow image

enter image description here

Also it's finding the .json extension file which is not present in my publish api.

I don't know why it's happening, also as already told above i am new to mobile development i am not sure what to do. Kindly see the bellow image of my swagger UI

enter image description here

Any help would be highly appreciated

Moeez
  • 494
  • 9
  • 55
  • 147

2 Answers2

2

The URL you listed is for the user-friendly reference docs for your API; there should be a corresponding URL for the JSON definition endpoint for your API. Use this instead in the Add Rest API Client dialog in the "Swagger URL" option.

The other option is to use this peer URL to download the JSON description of your REST API into a local .json file and reference that when generating your client access classes.

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

Milar
  • 21
  • 1
1

Why you are using azure? I guess your are working in a company so they must have a server. Just publish your services on the server and then sync it with your mobile app and DB. This is the easiest and free way to do it. You can use Rest services for that