Validate a custom function

post/commons/validations/functions
Internal-Use Only

Verifies that the custom function compiles without errors.

Request Samples

1

Response Samples

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": 401
11 },
12 {
13 "id": "4f4bf2a3-5eaa-4899-b234-0e3ebd21ef68",
14 "message": "Function arguments must be separated by commas.",
15 "statusCode": 1,
16 "errorCode": 500
17 },
18 {
19 "errorCode": 13750,
20 "message": "The variable name \"cv11\" is invalid.",
21 "remediation": null,
22 "version": 2,
23 "httpStatusCode": 200
24 }
25 ]
26}

Request Body

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."}
NameTypeRequiredDescription
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 method my_func(); statement.

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.

Responses

StatusMeaningDescription
200OKThe validations for the custom function were created.HeadersSchema
400Bad RequestThe request was invalid.Schema