Validate a custom function
post/commons/validations/functions
Verifies that the custom function compiles without errors.
1{2 "name": "errors",3 "accept": "application/vnd.sas.error+json",4 "version": 2,5 "items": [6 {7 "id": "4f4bf2a3-5eaa-4899-b238-0e3ebd21ef68",8 "message": "No permission.",9 "statusCode": 1,10 "errorCode": 40111 },12 {13 "id": "4f4bf2a3-5eaa-4899-b234-0e3ebd21ef68",14 "message": "Function arguments must be separated by commas.",15 "statusCode": 1,16 "errorCode": 50017 },18 {19 "errorCode": 13750,20 "message": "The variable name \"cv11\" is invalid.",21 "remediation": null,22 "version": 2,23 "httpStatusCode": 20024 }25 ]26}
The function to be validated.
A new reusable DS2 method with additional metadata.
Example:
{"code":"method custom_add(integer bar, double baz, in_out double foo);\n foo = bar + baz;\nend;","description":"Sums two numbers."}
Name | Type | Required | Description |
---|---|---|---|
description | string | false | A description of the function. |
signature | array [Function Signature Term] | false | An ordered array of the input parameters to the function determined by parsing the function's code. |
code | string | true | The DS2 function implementation, starting with the |
testCustomContextUri | string | false | The URI of a Custom Context DS2 code file that provides a custom context to this function. Normally, this function's custom context is provided by the decision that utimately utilizes it. For syntax validation purpose, you can specify a testing-only custom context. |
Status | Meaning | Description | ||
---|---|---|---|---|
200 | OK | The validations for the custom function were created. | Headers | Schema |
400 | Bad Request | The request was invalid. | Schema |