1
votes

I am using servicestack as REST framework. The swagger UI plugin is very help full for manual testing and debugging.

Now I want to do more automatic testing, performance testing, with a tool like SoapUI.

My question is, is there a way to generate the swagger spec from within service stack? So i can import it into SoapUI.

I don't want to create all the requests in SoapUI manually.

Thank you!

1

1 Answers

3
votes

Open API v2.0 Specification

ServiceStack implements the OpenAPI v2.0 Specification in its Open API Feature which you can install from NuGet with:

PM> Install-Package ServiceStack.Api.OpenApi

Then register in your AppHost with:

Plugins.Add(new OpenApiFeature());

When enabled you can access the Open API spec for your services at the /openapi endpoint. This is what the /swagger-ui/ uses to generate its dynamic UI for your Services.

Generating REST Client using Open API Spec

Which you can also use with Azure's AutoRest client to generate an AutoRest client from the spec.

But I don't see what the Swagger/OpenAPI Spec has to do with SoapUI? Soap Web Services are described and can have their clients generated from a WSDL, not the Open API spec.

SOAP Support

ServiceStack's SOAP Support also generates the WSDL for your Services which you can find linked on your Metadata Page.

Older Swagger 1.2 Spec

Alternatively ServiceStack also supports the older Swagger 1.2 Spec with its Swagger Feature which you can install from NuGet with:

PM> Install-Package ServiceStack.Api.Swagger

Then register in your AppHost with:

Plugins.Add(new SwaggerFeature());