I have created a custom connector to check a database health. Very simple request. I have a azure function that uses http triggers to check a cosmos db. I then layered Azure API Management ontop and built the OpenAPI 3.0 spec. From this spec I was building my customer connector.
I have verified that the swagger file is correct and very small. I have also verified that my spec follows the limits from Microsoft in their documentation. Anything helps!
Here is the YAML Open API 3.0 spec:
swagger: '2.0'
info:
title: Health Check API
version: '1.0'
description: Simple health check endpoint for testing
host: ***********************
basePath: /echo
schemes:
- https
produces:
- application/json
paths:
/health:
get:
operationId: health-check
summary: Health check
description: Check if the service is running
responses:
'200':
description: Service is healthy
schema:
$ref: '#/definitions/HealthResponse'
'503':
description: Service is unhealthy
schema:
$ref: '#/definitions/HealthResponse'
definitions:
HealthResponse:
type: object
properties:
status:
type: string
description: Health status
timestamp:
type: string
description: Timestamp of health check
database_connected:
type: boolean
description: Database connection status
message:
type: string
description: Additional status message
securityDefinitions:
api_key:
type: apiKey
in: header
name: Ocp-Apim-Subscription-Key
security:
- api_key: []