ServiceStack Swagger Interface URL and API Version Number

Anyway, to get the version number in the swagger user interface?

So, can we tell the developers what version each version is in?

+4
source share
2 answers

This is possible in the latest version of ServiceStack, you just install the version of the ServiceStack API in your AppHost, this way:

public override void Configure(Container container) { SetConfig(new HostConfig { ApiVersion = "1.1" }); { 

Then it will pick up Swagger-Ui

+3
source

If you want to display the version of the API as a whole, there is support for this in the Swagger user interface, as indicated here . In addition, this support has evolved into a ServiceStack and will display correctly at the bottom of the screen just like the Swagger Example .

Unfortunately, there is no support yet for accessing the ApiVersion property in your code, as shown here . This property does not appear in ServiceStack versions 3 or 4, or even in the new Model and Property filters in the Swagger function. To access this, a transfer request is required to expose it.

+3
source

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


All Articles