Skip to content

Home

Development

IDEs

API Explorer

Releases

Release notes

Martini Runtime

Martini Desktop

Martini Online

Feature requests

Bug reports

Validating Gloop REST APIs

The Gloop REST API editor also features linting; it analyzes code for potential errors. When a REST API is opened or modified, the IDE will validate the content and configuration of the REST API and warn the user about probable runtime errors.

Depending on the severity of the problem detected, Martini will either label it as a warning or an error. A warning label indicates that the property will not cause a runtime error but is implementing unsafe logic or bad practice. An error label, on the other hand, indicates that the problem will cause a runtime error when the REST API is published.

All problematic properties will be flagged via a warning or error icon at the first column. Hovering over an icon prompts a tooltip to pop-up, describing the issue(s) of the property.

Hovering over the warning or error icon shows the description of the problem

Hovering over the warning or error icon shows the description of the problem

Quickly navigate to REST API validation issues

Use the shortcuts and to navigate to the next or previous item with a validation issue.

Navigating to REST API nodes with issues

Quick fixes

Martini offers a quick fix for most problems. A quick fix is a short series of actions that can be executed in order to repair offending code. To apply a quick fix:

  1. Right click the offending line in the line ruler and then select Quick Fix from the context menu. Alternatively, you may press (Martini Desktop) or (Martini Online) instead. Either of these actions prompt the quick fix pop-up to appear.
  2. If the step has more than one problem, choose which problem to fix. You can use your arrow keys to shuffle through the choices and the key to finalize your selection.
  3. Choose which quick fix to apply; some problems have more than one solution or quick fix available.
  4. Enter required inputs, if any, as some quick fixes require certain inputs like entering a value or expression.

List of detectable problems and quick fix suggestions

  • Path is empty
    • Severity: Error
    • Available quick fixes:
      • Edit path
  • Response is empty
    • Severity: Error
    • Available quick fixes:
      • Add response
  • Service is empty
    • Severity: Error
    • Available quick fixes:
      • Edit service
  • Service not found from location
    • Severity: Error
    • Available quick fixes:
      • Edit service
      • Refresh service
      • Create Gloop service with namespace ‘{serviceName}’
  • Property object is missing
    • Description: The service configured doesn't provide the object properties required by the Gloop REST API. This problem typically occurs when the service and Gloop REST API are out of sync.
    • Severity: Error
    • Available quick fixes:
      • Add property
      • Edit property
      • Edit service
      • Refresh service
  • Parameter is empty
    • Severity: Error
    • Available quick fixes:
      • Edit parameter
  • Operation has no response; an operation requires at least one response
    • Severity: Error
    • Available quick fixes:
      • Add response
  • Path parameter is not found in list of parameters
    • Description: A path parameter is declared in the path but this path parameter is not declared in the list of parameters.
    • Severity: Error
    • Available quick fixes:
      • Edit parameter
      • Edit path
      • Edit parameter type
      • Delete parameter
  • Parameter '{name}' is not a path parameter
    • Description: A path parameter is declared in the path but this parameter is not type path.
    • Severity: Error
    • Available quick fixes:
      • Edit path
      • Edit parameter type to 'PATH'
  • Path has no operations; a path requires at least one operation
    • Severity: Warning
    • Available quick fixes:
      • Add operation
  • Description’s length is more than 1,024 characters
    • Description: This rule applies to all Description properties. Their length must be less than or equal to 1,024 characters.
    • Severity: Warning
    • Available quick fixes:
      • Edit description
      • Delete description
  • Summary’s length is more than 255 characters
    • Description: This rule applies to all Summary properties. Their length must be less than or equal to 1,024 characters.
    • Severity: Warning
    • Available quick fixes:
      • Edit summary
      • Delete summary
  • Response header model should be non-array model only
    • Severity: Warning
    • No Available quick fixes
  • Response header model should not have a model property.
    • Description: The model selected to contain response header details is not allowed to have Gloop model-type properties.
    • Severity: Warning
  • Parameter with type Path and Header cannot be model or bytes[]
    • Severity: Warning
    • Available quick fixes:
      • Edit parameter
      • Delete parameter
  • Parameter with type Form should be non-array property only
    • Severity: Warning
    • Available quick fixes:
      • Edit parameter
      • Delete parameter
  • Body Parameter should be non-array property only except model
    • Severity: Warning
    • Available quick fixes:
      • Edit parameter
      • Delete parameter
  • Parameter with type Path is unused
    • Description: The parameter with type Path is not being used in the path.
    • Severity: Warning
    • Available quick fixes:
      • Edit parameter
      • Edit path
      • Edit type
      • Delete parameter
  • Response code should be string and integer only
    • Severity: Warning
    • Available quick fixes:
      • Edit response code
      • Delete response code