Class SwaggerController


  • @Controller
    @RequestMapping("/plugin/swagger")
    public class SwaggerController
    extends org.molgenis.web.PluginController
    Serves Swagger documentation of the REST API.
    See Also:
    http://swagger.io/
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static String URI  
      • Fields inherited from class org.molgenis.web.PluginController

        PLUGIN_URI_PREFIX
    • Constructor Summary

      Constructors 
      Constructor Description
      SwaggerController​(org.molgenis.data.meta.MetaDataService metaDataService, org.molgenis.security.core.token.TokenService tokenService)  
    • Constructor Detail

      • SwaggerController

        public SwaggerController​(org.molgenis.data.meta.MetaDataService metaDataService,
                                 org.molgenis.security.core.token.TokenService tokenService)
    • Method Detail

      • init

        @GetMapping
        public String init​(org.springframework.ui.Model model)
        Serves the Swagger UI which allows you to try out the documented endpoints. Sets the url parameter to the swagger yaml that describes the REST API. Creates an apiKey token for the current user.
      • swagger

        @GetMapping(value="/swagger.yml",
                    produces="text/yaml")
        public String swagger​(org.springframework.ui.Model model,
                              javax.servlet.http.HttpServletResponse response)
        Serves the Swagger description of the REST API. As host, fills in the host where the controller lives. As options for the entity names, contains only those entity names that the user can actually see.