docfx icon indicating copy to clipboard operation
docfx copied to clipboard

File UID question

Open vdecristofaro opened this issue 10 years ago • 2 comments

In the documentation available here I can read:

A single Swagger API file is considered as a unique REST File containing multiple APIs. The UID(Unique IDentifier) for the File is defined as the combination of host, basePath, info.title and info.version with / as separator.

What about the UID if the basePath is just /?

vdecristofaro avatar Oct 31 '16 14:10 vdecristofaro

If basePathis is /, it would be ignored in uid.

The sample below would generate uid as microsoft.com/Contacts/1.6

{
  "swagger": "2.0",
  "info": {
    "title": "Contacts",
    "version": "1.6"
  },
  "host": "microsoft.com",
  "basePath": "",
  "schemes": [
    "https"
  ]
}

Code logic is here GetUid.

hellosnow avatar Nov 01 '16 03:11 hellosnow

Actually I have a / in basePath like in the following sample:

{
  "swagger": "2.0",
  "info": {
    "title": "Contacts",
    "version": "1.6"
  },
  "host": "microsoft.com",
  "basePath": "/",
  "schemes": [
    "https"
  ]
}

and this would generate the following uid: microsoft.com//Contacts/1.6 (note the double forward slash). As long as this will work for Overwrite Files I can live with it.

vdecristofaro avatar Nov 01 '16 14:11 vdecristofaro