Class ApiDocServiceImpl
- java.lang.Object
-
- org.opendaylight.netconf.sal.rest.doc.impl.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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classApiDocServiceImpl.OAversionstatic classApiDocServiceImpl.URIType
-
Field Summary
Fields Modifier and Type Field Description static intDEFAULT_PAGESIZE
-
Constructor Summary
Constructors Constructor Description ApiDocServiceImpl(MountPointSwaggerGeneratorDraft02 mountPointSwaggerGeneratorDraft02, MountPointSwaggerGeneratorRFC8040 mountPointSwaggerGeneratorRFC8040, ApiDocGeneratorDraftO2 apiDocGeneratorDraft02, ApiDocGeneratorRFC8040 apiDocGeneratorRFC8040, AllModulesDocGenerator allModulesDocGenerator)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description javax.ws.rs.core.ResponsegetAllModulesDoc(javax.ws.rs.core.UriInfo uriInfo)javax.ws.rs.core.ResponsegetApiExplorer(javax.ws.rs.core.UriInfo uriInfo)Redirects to embedded swagger ui.javax.ws.rs.core.ResponsegetDocByModule(String module, String revision, javax.ws.rs.core.UriInfo uriInfo)Generates Swagger compliant document listing APIs for module.javax.ws.rs.core.ResponsegetListOfMounts(javax.ws.rs.core.UriInfo uriInfo)Generates index document for Swagger UI.javax.ws.rs.core.ResponsegetMountDoc(String instanceNum, javax.ws.rs.core.UriInfo uriInfo)Generates Swagger compliant document listing APIs for all modules of mount point.javax.ws.rs.core.ResponsegetMountDocByModule(String instanceNum, String module, String revision, javax.ws.rs.core.UriInfo uriInfo)Generates Swagger compliant document listing APIs for module.
-
-
-
Field Detail
-
DEFAULT_PAGESIZE
public static final int DEFAULT_PAGESIZE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ApiDocServiceImpl
public ApiDocServiceImpl(MountPointSwaggerGeneratorDraft02 mountPointSwaggerGeneratorDraft02, MountPointSwaggerGeneratorRFC8040 mountPointSwaggerGeneratorRFC8040, ApiDocGeneratorDraftO2 apiDocGeneratorDraft02, ApiDocGeneratorRFC8040 apiDocGeneratorRFC8040, AllModulesDocGenerator allModulesDocGenerator)
-
-
Method Detail
-
getAllModulesDoc
public javax.ws.rs.core.Response getAllModulesDoc(javax.ws.rs.core.UriInfo uriInfo)
- Specified by:
getAllModulesDocin interfaceApiDocService
-
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:
getDocByModulein interfaceApiDocService
-
getApiExplorer
public javax.ws.rs.core.Response getApiExplorer(javax.ws.rs.core.UriInfo uriInfo)
Redirects to embedded swagger ui.- Specified by:
getApiExplorerin interfaceApiDocService
-
getListOfMounts
public javax.ws.rs.core.Response getListOfMounts(javax.ws.rs.core.UriInfo uriInfo)
Description copied from interface:ApiDocServiceGenerates 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 bygetDocByModule()method.- Specified by:
getListOfMountsin interfaceApiDocService
-
getMountDocByModule
public javax.ws.rs.core.Response getMountDocByModule(String instanceNum, String module, String revision, javax.ws.rs.core.UriInfo uriInfo)
Description copied from interface:ApiDocServiceGenerates Swagger compliant document listing APIs for module.- Specified by:
getMountDocByModulein interfaceApiDocService
-
getMountDoc
public javax.ws.rs.core.Response getMountDoc(String instanceNum, javax.ws.rs.core.UriInfo uriInfo)
Description copied from interface:ApiDocServiceGenerates Swagger compliant document listing APIs for all modules of mount point.- Specified by:
getMountDocin interfaceApiDocService
-
-