'what does Swagger server stub mean?

I am new to Swagger, and I ran into the term Server Stub, I do not understand what does that mean so I appreciate if anyone can explain it to me.



Solution 1:[1]

Stub the API means : create à mock to serve examples described in swagger file. This mock can be formatted in specific languages/ framework

Solution 2:[2]

Server stubbing can be quite powerful depending on the backend platform and framework you plan to use for your API.

For example, you may choose Apache (common in Linux environments) or ASP.NET (common for IIS). The server "stubs" being generated will typically be a deployable library to that specific platform. What you typically get is:

  • Routing to your business logic. The framework will handle the HTTP specification, but actually mapping from a "controller" to your service layer is being handled by the code generator, based on your API specification.
  • Serialization and Deserialization of your models (applies to strongly-typed languages like Java/C#).
  • AuthN/AuthZ may be handled, to some degree, based on the framework's support for your API's chosen auth scheme.

tl;dr: A server stub is intended to be a ready-to-deploy application that routes HTTP requests to your actual business logic on the backend.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Nomnom
Solution 2 Jmoney38