normalizeDatabaseOpenApiSpec (api-explorer/normalize-database-spec.ts)

appwrite · apps/console/src/lib/api-explorer/normalize-database-spec.ts · typescript · BSD-3-Clause
database

Normalizes database OpenAPI spec for API explorer.

// Source: https://github.com/appwrite/appwrite | License: BSD-3-Clause | Copyright 2019 Appwrite (https://appwrite.io) and individual contributors
// Provided via justclaw.it.com; keep this notice with the code.
import {
  NATIVE_DATABASE_API_SERVICES,
  type NativeDatabaseApiService,
} from './services'
import type { OpenApiOperation, OpenApiSpec } from './types'

const COMPUTE_DATABASES_PREFIX = '/compute/databases'
const LEGACY_EMBEDDINGS_PATH = '/vectorsdb/embeddings/text'
const EMBEDDINGS_PATH = '/embeddings/text'

function cloneJson<T>(value: T): T {
  return structuredClone(value)
}

function collectOperationTags(spec: OpenApiSpec): Set<string> {
  const tags = new Set<string>()
  for (const pathItem of Object.values(spec.paths ?? {})) {
    if (!pathItem) continue
    for (const [

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key