Skip to content

Commit e4be876

Browse files
committed
Add OpenAPI documentation for /v1/functions
1 parent 552cd86 commit e4be876

File tree

2 files changed

+74
-0
lines changed

2 files changed

+74
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
openapi: 3.0.0
2+
info:
3+
title: Presto function signatures API
4+
description: API for retrieving function signatures in Presto.
5+
version: "1"
6+
servers:
7+
- url: http://localhost:8080
8+
description: Presto endpoint when running locally
9+
paths:
10+
/v1/functions:
11+
get:
12+
summary: Returns the list of function signatures.
13+
description: This endpoint retrieves the supported function signatures from a Prestissimo cluster.
14+
responses:
15+
'200':
16+
description: List of function signatures.
17+
content:
18+
application/json:
19+
schema:
20+
$ref: './schemas.yaml/#/components/schemas/JsonBasedUdfFunctionMetadata'

presto-openapi/src/main/resources/schemas.yaml

+54
Original file line numberDiff line numberDiff line change
@@ -1018,6 +1018,60 @@ components:
10181018
type: string
10191019
hidden:
10201020
type: boolean
1021+
AggregationFunctionMetadata:
1022+
type: object
1023+
required:
1024+
- intermediateType
1025+
- isOrderSensitive
1026+
properties:
1027+
intermediateType:
1028+
$ref: '#/components/schemas/TypeSignature'
1029+
description: Intermediate TypeSignature for the aggregation function
1030+
isOrderSensitive:
1031+
type: boolean
1032+
description: Determines if the corresponding aggregation function is order-sensitive
1033+
JsonBasedUdfFunctionMetadata:
1034+
type: object
1035+
required:
1036+
- docString
1037+
- functionKind
1038+
- outputType
1039+
- paramTypes
1040+
- schema
1041+
- routineCharacteristics
1042+
- variableArity
1043+
properties:
1044+
docString:
1045+
type: string
1046+
description: Description of the function
1047+
functionKind:
1048+
$ref: '#/components/schemas/FunctionKind'
1049+
description: FunctionKind of the function
1050+
outputType:
1051+
$ref: '#/components/schemas/TypeSignature'
1052+
description: Output type of the function
1053+
paramTypes:
1054+
type: array
1055+
items:
1056+
$ref: '#/components/schemas/TypeSignature'
1057+
description: Input types of the function
1058+
schema:
1059+
type: string
1060+
description: Schema the function belongs to. Catalog.schema.function uniquely identifies a function.
1061+
routineCharacteristics:
1062+
$ref: '#/components/schemas/RoutineCharacteristics'
1063+
description: Implement language of the function.
1064+
variableArity:
1065+
type: boolean
1066+
description: Arity of the function.
1067+
typeVariableConstraints:
1068+
type: array
1069+
items:
1070+
$ref: '#/components/schemas/TypeVariableConstraint'
1071+
description: Optional list of the typeVariableConstraints.
1072+
aggregationFunctionMetadata:
1073+
$ref: '#/components/schemas/AggregationFunctionMetadata'
1074+
description: Optional Aggregate-specific metadata (required for aggregation functions)
10211075

10221076

10231077

0 commit comments

Comments
 (0)