Class DefaultPathProvider

  • All Implemented Interfaces:
    PathProvider

    public class DefaultPathProvider
    extends java.lang.Object
    implements PathProvider
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected java.lang.String getDocumentationPath()
      The base path to the swagger api documentation.
      java.lang.String getOperationPath​(java.lang.String operationPath)
      The relative path to the operation, from the basePath, which this operation describes.
      java.lang.String getResourceListingPath​(java.lang.String groupName, java.lang.String apiDeclaration)
      Corresponds to the path attribute of a swagger Resource Object (within a Resource Listing).
      • Methods inherited from class java.lang.Object

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

      • DefaultPathProvider

        public DefaultPathProvider()
    • Method Detail

      • getDocumentationPath

        protected java.lang.String getDocumentationPath()
        The base path to the swagger api documentation.

        Typically docs are served from <yourApp>/api-docs so a relative resourceListing path will omit the api-docs segment. E.g. Relative: "path": "/" Absolute: "path": "http://localhost:8080/api-docs"

        Returns:
        the documentation base path
      • getOperationPath

        public java.lang.String getOperationPath​(java.lang.String operationPath)
        The relative path to the operation, from the basePath, which this operation describes. The value SHOULD be in a relative (URL) path format.

        Includes the apiResourcePrefix

        Specified by:
        getOperationPath in interface PathProvider
        Parameters:
        operationPath - operation path
        Returns:
        the relative path to the api operation
      • getResourceListingPath

        public java.lang.String getResourceListingPath​(java.lang.String groupName,
                                                       java.lang.String apiDeclaration)
        Corresponds to the path attribute of a swagger Resource Object (within a Resource Listing).

        This method builds a URL based off of

        Specified by:
        getResourceListingPath in interface PathProvider
        Parameters:
        groupName - the group name for this Resource Object e.g. 'default'
        apiDeclaration - the identifier for the api declaration e.g 'business-controller'
        Returns:
        the resource listing path
        See Also:
        by appending the swagger group and apiDeclaration