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 java.lang.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)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String init​(org.springframework.ui.Model model)
      Serves the Swagger UI which allows you to try out the documented endpoints.
      java.lang.String swagger​(org.springframework.ui.Model model, javax.servlet.http.HttpServletResponse response)
      Serves the Swagger description of the REST API.
      • Methods inherited from class org.molgenis.web.PluginController

        getId, getPluginSettings, getUri
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SwaggerController

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

      • init

        @GetMapping
        public java.lang.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 java.lang.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.