{
  "swagger": "2.0",
  "info": {
    "description": "Navigation helper",
    "title": "Electrode Native generic navigation api (V2.0)"
  },
  "produces": [
    "application/json"
  ],
  "paths": {
    "/navigate": {
      "post": {
        "tags": [
          "EnNavigation"
        ],
        "operationId": "navigate",
        "parameters": [
          {
            "name": "route",
            "in": "body",
            "description": "Route object that details where to navigate next",
            "required": true,
            "schema": {
              "$ref": "#/definitions/ErnNavRoute"
            }
          }
        ]
      }
    },
    "/update": {
      "post": {
        "tags": [
          "EnNavigation"
        ],
        "operationId": "update",
        "parameters": [
          {
            "name": "updatedRoute",
            "in": "body",
            "description": "Updated route object. This API expects that the path of the update call is unchanged from the last navigate call. It is likely that the native implementation will reject your update call if the path is different from the last navigate call.",
            "required": true,
            "schema": {
              "$ref": "#/definitions/ErnNavRoute"
            }
          }
        ]
      }
    },
    "/finish": {
      "post": {
        "tags": [
          "EnNavigation"
        ],
        "operationId": "finish",
        "parameters": [
          {
            "name": "finalPayload",
            "in": "body",
            "description": "Optional json string payload to pass when a flow is completed. Use this to pass in any info needed by the RN view host on the native side",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/back": {
      "post": {
        "tags": [
          "EnNavigation"
        ],
        "operationId": "back",
        "parameters": [
          {
            "name": "route",
            "in": "body",
            "description": "Route object that details where to navigate next. Use this when you want to go back to a previous screen, it could be any previous screen in a given flow. If the given route is not found on the stack, native layer may push a new screen on top.",
            "required": true,
            "schema": {
              "$ref": "#/definitions/ErnNavRoute"
            }
          }
        ]
      }
    },
    "/events": {
      "event": {
        "tags": [
          "EnNavigation"
        ],
        "description": "Fire this event when a navigation bar button is clicked",
        "operationId": "OnNavButtonClick",
        "parameters": [
          {
            "name": "buttonId",
            "in": "path",
            "description": "Id of the button that is being clicked",
            "required": true,
            "type": "string"
          }
        ]
      }
    },
    "/events-navigation": {
      "event": {
        "tags": [
          "EnNavigation"
        ],
        "description": "Generic navigation related events",
        "operationId": "NavEvent",
        "parameters": [
          {
            "name": "eventData",
            "in": "body",
            "description": "navigation event data",
            "required": true,
            "schema": {
              "$ref": "#/definitions/NavEventData"
            }
          }
        ]
      }
    }
  },
  "definitions": {
    "ErnNavRoute": {
      "properties": {
        "path": {
          "type": "string",
          "description": "Path of the Route. Mostly the name of the container (defined by the native app) or the MiniApp name. The content of the path is mainly determined by the native implementation of the API"
        },
        "jsonPayload": {
          "type": "string",
          "description": "Optional Payload (represented as JSON String) needed by the screen you are trying to navigate to."
        },
        "navigationBar": {
          "$ref": "#/definitions/NavigationBar"
        },
        "overlay": {
          "type": "boolean",
          "description": "If set to true, the view component would be displayed over a transparent theme. Default value is false."
        },
        "refresh": {
          "type": "boolean",
          "description": "Set to true if you would like to re-render a component while navigating back to it."
        },
        "replace": {
          "type": "boolean",
          "description": "Set to true if you would like to replace the last page with the new one."
        }
      },
      "required": [
        "path"
      ]
    },
    "NavigationBarButton": {
      "properties": {
        "title": {
          "type": "string",
          "description": "Button title if any."
        },
        "icon": {
          "type": "string",
          "description": "Icon resource identifier that can be used find the icon"
        },
        "tint": {
          "type": "string",
          "description": "Specifies a tint for the icon. Supported formats: #RRGGBB, #AARRGGBB. Supported values: red, blue, green, black, white, gray, cyan, magenta, yellow, lightgray, darkgray, grey, lightgrey, darkgrey, aqua, fuchsia, lime, maroon, navy, olive, purple, silver and teal"
        },
        "id": {
          "type": "string",
          "description": "Id of the button, this namespace will be used as an identifier when a button click event is emitted."
        },
        "location": {
          "type": "string",
          "description": "@Deprecated This is now Deprecated with the introduction of NavigationBarLeftButton. Allowed enums: left, right"
        },
        "disabled": {
          "type": "boolean",
          "description": "Default to false. If set to true the button will be disabled(non-clickable)"
        },
        "adaLabel": {
          "type": "string",
          "description": "Accessibility label"
        }
      },
      "required": [
        "id"
      ]
    },
    "NavigationBarLeftButton": {
      "properties": {
        "title": {
          "type": "string",
          "description": "Button title if any, applied only for iOS."
        },
        "icon": {
          "type": "string",
          "description": "Icon resource identifier that can be used find the icon"
        },
        "tint": {
          "type": "string",
          "description": "Specifies a tint for the icon. Supported formats: #RRGGBB, #AARRGGBB. Supported values: red, blue, green, black, white, gray, cyan, magenta, yellow, lightgray, darkgray, grey, lightgrey, darkgrey, aqua, fuchsia, lime, maroon, navy, olive, purple, silver and teal"
        },
        "id": {
          "type": "string",
          "description": "Id of the button, this namespace will be used as an identifier when a button click event is emitted. If included, click will not be handled by native instead an event will be fired for react native to handle the backpress."
        },
        "disabled": {
          "type": "boolean",
          "description": "Default to false. If set to true the button will be disabled(non-clickable). Android will remove the left icon indicator"
        },
        "adaLabel": {
          "type": "string",
          "description": "Accessibility label"
        }
      }
    },
    "NavigationBar": {
      "properties": {
        "title": {
          "type": "string",
          "description": "Title of Nav Bar"
        },
        "hide": {
          "type": "boolean",
          "description": "Use to hide the navigation bar."
        },
        "buttons": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/NavigationBarButton"
          },
          "description": "Right button properties"
        },
        "leftButton": {
          "$ref": "#/definitions/NavigationBarLeftButton"
        }
      },
      "required": [
        "title"
      ]
    },
    "NavEventData": {
      "properties": {
        "eventType": {
          "type": "string",
          "description": "Type of the event. Supported values [BUTTON_CLICK, DID_FOCUS, DID_BLUR]"
        },
        "viewId": {
          "type": "string",
          "description": "MiniApp view identifier to indicate the view instance that is firing the event. This is needed when more than one instance of the same component is mounted."
        },
        "jsonPayload": {
          "type": "string",
          "description": "optional payload associated with the event"
        }
      },
      "required": [
        "eventType"
      ]
    }
  }
}
