Class ApiDocServiceImpl

  • All Implemented Interfaces:
    ApiDocService

    public class ApiDocServiceImpl
    extends Object
    implements ApiDocService
    This service generates swagger (See https://helloreverb.com/developers/swagger) compliant documentation for RESTCONF APIs. The output of this is used by embedded Swagger UI.

    NOTE: These API's need to be synchronized due to bug 1198. Thread access to the SchemaContext is not synchronized properly and thus you can end up with missing definitions without this synchronization. There are likely otherways to work around this limitation, but given that this API is a dev only tool and not dependent UI, this was the fastest work around.

    • Method Detail

      • getAllModulesDoc

        public javax.ws.rs.core.Response getAllModulesDoc​(javax.ws.rs.core.UriInfo uriInfo)
        Specified by:
        getAllModulesDoc in interface ApiDocService
      • getDocByModule

        public javax.ws.rs.core.Response getDocByModule​(String module,
                                                        String revision,
                                                        javax.ws.rs.core.UriInfo uriInfo)
        Generates Swagger compliant document listing APIs for module.
        Specified by:
        getDocByModule in interface ApiDocService
      • getApiExplorer

        public javax.ws.rs.core.Response getApiExplorer​(javax.ws.rs.core.UriInfo uriInfo)
        Redirects to embedded swagger ui.
        Specified by:
        getApiExplorer in interface ApiDocService
      • getListOfMounts

        public javax.ws.rs.core.Response getListOfMounts​(javax.ws.rs.core.UriInfo uriInfo)
        Description copied from interface: ApiDocService
        Generates index document for Swagger UI. This document lists out all modules with link to get APIs for each module. The API for each module is served by getDocByModule() method.
        Specified by:
        getListOfMounts in interface ApiDocService
      • getMountDocByModule

        public javax.ws.rs.core.Response getMountDocByModule​(String instanceNum,
                                                             String module,
                                                             String revision,
                                                             javax.ws.rs.core.UriInfo uriInfo)
        Description copied from interface: ApiDocService
        Generates Swagger compliant document listing APIs for module.
        Specified by:
        getMountDocByModule in interface ApiDocService
      • getMountDoc

        public javax.ws.rs.core.Response getMountDoc​(String instanceNum,
                                                     javax.ws.rs.core.UriInfo uriInfo)
        Description copied from interface: ApiDocService
        Generates Swagger compliant document listing APIs for all modules of mount point.
        Specified by:
        getMountDoc in interface ApiDocService