All Downloads are FREE. Search and download functionalities are using the official Maven repository.

.gateleen.gateleen-delegate.2.1.12.source-code.gateleen_delegate_schema_delegates Maven / Gradle / Ivy

The newest version!
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "Delegate definition",
  "type": "object",
  "properties": {
    "methods": {
      "description": "Restricts the HTTP methods concerned by this rule (`GET`, `PUT`, `POST`, `DELETE`).\nWhen absent, all methods are concerned.",
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "description": {
      "description": "Documents this delegate",
      "type": "string"
    },
    "doc": {
      "description": "Link or reference to feature/specification documentation",
      "type": "string"
    },
    "pattern": {
      "description": "Pattern for grouping the incoming uri",
      "type": "string"
    },
    "requests": {
      "type": "array",
      "items": {"$ref": "#/definitions/Request"}
    }
  },
  "additionalProperties": false,
  "definitions": {
    "HeaderFunction": {
        "properties": {
            "header": {
                "description": "the request-header name to manipulate (set, remove or conditional set)",
                "type": "string",
                "minLength": 1
            },
            "value": {
                "description": "the value to be set. null and empty string means 'remove the header'. value can contain other header names between single angular brackets which resolves to their values accordingly",
                "type": [
                    "null",
                    "string"
                ]
            },
            "mode": {
                "description": "define a condition-mode. 'complete' sets the header value only if this header is not yet present. 'overwrite' sets the header value only if the header is already present. Ignored if value is null or empty string",
                "type": "string",
                "enum": [
                    "complete",
                    "override"
                ]
            }
        },
        "required": [
            "header",
            "value"
        ]
    },
    "Request": {
      "oneOf": [
        { "required": ["payload"] },
        { "required": ["transform"] },
        { "required": ["transformWithMetadata"] }
      ],
      "anyOf": [
        {
          "oneOf": [
            {"required": ["dynamicHeaders"]},
            {"required": ["headers"]}
          ]
        },
        {
          "not": {
            "required": ["dynamicHeaders", "headers"]
          }
        }
      ],
      "properties": {
        "uri": {
          "description": "The target of the request",
          "type": "string"
        },
        "method": {
          "description": "The operation to perform",
          "enum": [
            "GET",
            "PUT",
            "POST",
            "DELETE"
          ]
        },
        "payload": {
          "description": "The payload to send in requests body",
          "type": "object"
        },
        "transform": {
          "description": "The jolt spec definition to transform the payload",
          "type": "array"
        },
        "transformWithMetadata": {
          "description": "The jolt spec definition to transform the payload and additional metadata",
          "type": "array"
        },
		"dynamicHeaders": {
			"description": "Manipulate (set / remove / replace) request headers using HeaderFunctions - option to reference other header vales",
			"type": "array",
			"items": {
				"$ref": "#/definitions/HeaderFunction"
			}
		},
        "headers": {
          "description": "Headers to send with the request",
          "type": "array",
          "items": {
            "description": "Header value pairs",
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "required": [
        "uri",
        "method"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "methods",
    "pattern",
    "requests"
  ]
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy