Skip to content

Commit

Permalink
Add OpenAPI documentation for /v1/functions
Browse files Browse the repository at this point in the history
  • Loading branch information
pdabre12 authored and Pratik Joseph Dabre committed Nov 1, 2024
1 parent ab418ab commit 88e1152
Show file tree
Hide file tree
Showing 2 changed files with 74 additions and 0 deletions.
20 changes: 20 additions & 0 deletions presto-openapi/src/main/resources/function_signatures.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
openapi: 3.0.0
info:
title: Presto function signatures API
description: API for retrieving function signatures in Presto.
version: "1"
servers:
- url: http://localhost:8080
description: Presto endpoint when running locally
paths:
/v1/functions:
get:
summary: Returns the list of function signatures.
description: This endpoint retrieves the supported function signatures from a Prestissimo cluster.
responses:
'200':
description: List of function signatures.
content:
application/json:
schema:
$ref: './schemas.yaml/#/components/schemas/JsonBasedUdfFunctionMetadata'
54 changes: 54 additions & 0 deletions presto-openapi/src/main/resources/schemas.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1018,6 +1018,60 @@ components:
type: string
hidden:
type: boolean
AggregationFunctionMetadata:
type: object
required:
- intermediateType
- isOrderSensitive
properties:
intermediateType:
$ref: '#/components/schemas/TypeSignature'
description: Intermediate TypeSignature for the aggregation function
isOrderSensitive:
type: boolean
description: Determines if the corresponding aggregation function is order-sensitive
JsonBasedUdfFunctionMetadata:
type: object
required:
- docString
- functionKind
- outputType
- paramTypes
- schema
- routineCharacteristics
- variableArity
properties:
docString:
type: string
description: Description of the function
functionKind:
$ref: '#/components/schemas/FunctionKind'
description: FunctionKind of the function
outputType:
$ref: '#/components/schemas/TypeSignature'
description: Output type of the function
paramTypes:
type: array
items:
$ref: '#/components/schemas/TypeSignature'
description: Input types of the function
schema:
type: string
description: Schema the function belongs to. Catalog.schema.function uniquely identifies a function.
routineCharacteristics:
$ref: '#/components/schemas/RoutineCharacteristics'
description: Implement language of the function.
variableArity:
type: boolean
description: Arity of the function.
typeVariableConstraints:
type: array
items:
$ref: '#/components/schemas/TypeVariableConstraint'
description: Optional list of the typeVariableConstraints.
aggregationFunctionMetadata:
$ref: '#/components/schemas/AggregationFunctionMetadata'
description: Optional Aggregate-specific metadata (required for aggregation functions)



Expand Down

0 comments on commit 88e1152

Please sign in to comment.