Class EndpointsHandler

java.lang.Object
v1.sulphurapi.handlers.endpoints.EndpointsHandler
All Implemented Interfaces:
GUIActionInterface

public class EndpointsHandler extends Object implements GUIActionInterface
  • Constructor Details

    • EndpointsHandler

      public EndpointsHandler(APILoader apiLoader)
  • Method Details

    • getSelectedEndpointURL

      public String getSelectedEndpointURL()
      Returns the URL of the selected endpoint by combining the server URL and the current loaded path.
      Returns:
      the full URL of the selected endpoint. TODO: Handle multiple servers.
    • createSubMenu

      public JMenu createSubMenu()
      Creates a submenu for the current loaded path with options for each HTTP method (GET, POST, PUT, DELETE, PATCH, OPTIONS).
      Returns:
      the created JMenu instance containing the options for the current loaded path.
    • fillPropertiesMapFromOperation

      public void fillPropertiesMapFromOperation(io.swagger.v3.oas.models.Operation item)
      fills propertyMap in the format : {"application/json" : {Schema object}, "application/x-www-form-urlencoded" : {Schema object}}
      Parameters:
      item - the Operation object that contains the request body content to be filled into the map.
    • getSelectedMediaType

      public String getSelectedMediaType()
      Returns the selected media type from the combo box in the grid. If no item is selected, it returns an empty string.
      Returns:
      the selected media type as a string.
    • getParametersMap

      public Map<String,io.swagger.v3.oas.models.parameters.Parameter> getParametersMap()
    • getPropertiesMap

      public Map<String,io.swagger.v3.oas.models.media.Schema<?>> getPropertiesMap()
    • getGrid

      public EndpointGrid getGrid()
    • getMenu

      public JPopupMenu getMenu()
    • getCurrentLoadedPath

      public String getCurrentLoadedPath()
    • setCurrentLoadedPath

      public void setCurrentLoadedPath(String currentLoadedPath)