1

ServiceStack has support for OpenAPI and can generate an OpenAPI spec. However, for APIs/endpoints to be generated in the spec, it is not enough to specify the API details using the Route attributes as described here, you also need to create the Service classes that (eventually) implement the functionality.

Is there a way to make the OpenAPI specification include everything without having to create the Service classes that go with them?

The reason is that sometimes you just want to work on the specification, not implementation (even though you can just skip implementation details and throw a NotImplementedException), and creating those Service classes just to get the spec to show is annoying.

1 Answer 1

0

If it doesn't have an implementation it's not a Service and therefore wont have any of ServiceStack's metadata or features available for it.

If you want to skip their implementation you can just create stub implementations for them, e.g:

public class MyServices : Service
{
   public object Any(MyRequest1 request) => null;
   public object Any(MyRequest2 request) => null;
   public object Any(MyRequest3 request) => null;
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.