mckaywrigley/chatbot-ui · error · Error

Some object schemas are missing properties

Error message

Some object schemas are missing properties

What it means

This is the aggregated version of the schema-properties check: it fires when any object schema anywhere in the spec (components, nested schemas, response schemas) is missing or has empty properties. It complements the per-path contextual message by telling you the problem exists somewhere in the document even when it is not in a path's requestBody.

Source

Thrown at lib/openapi-conversion.ts:88

    Object.values(openapiSpec.paths).some((methods: any) =>
      Object.values(methods).some((spec: any) => {
        if (spec.requestBody?.content?.["application/json"]?.schema) {
          if (
            !spec.requestBody.content["application/json"].schema.properties ||
            Object.keys(spec.requestBody.content["application/json"].schema)
              .length === 0
          ) {
            throw new Error(
              `In context=('paths', '${Object.keys(methods)[0]}', '${
                Object.keys(spec)[0]
              }', 'requestBody', 'content', 'application/json', 'schema'), object schema missing properties`
            )
          }
        }
      })
    )
  ) {
    throw new Error("Some object schemas are missing properties")
  }
}

export const openapiToFunctions = async (
  openapiSpec: any
): Promise<OpenAPIData> => {
  const functions: any[] = [] // Define a proper type for function objects
  const routes: {
    path: string
    method: string
    operationId: string
    requestInBody?: boolean // Add a flag to indicate if the request should be in the body
  }[] = []

  for (const [path, methods] of Object.entries(openapiSpec.paths)) {
    if (typeof methods !== "object" || methods === null) {
      continue
    }

View on GitHub (pinned to 81328b61d2)

Solutions

  1. Audit every object schema in the spec (components/schemas and inline) and add properties where missing
  2. Run a JSON Schema linter or a script that walks the spec and reports schemas with empty properties, then fix each reported location
  3. Remove or fully define stub schemas before conversion

Example fix

// before
components:
  schemas:
    Empty:
      type: object
// after
components:
  schemas:
    Empty:
      type: object
      properties:
        message:
          type: string
Defensive patterns

Strategy: validation

Validate before calling

const emptySchemas = [];
const walk = (node) => {
  if (node?.type === 'object' && (!node.properties || Object.keys(node.properties).length === 0)) emptySchemas.push(node);
  Object.values(node ?? {}).forEach(v => typeof v === 'object' && v !== null && walk(v));
};
walk(spec); // emptySchemas.length === 0 before calling openapiToFunctions

Type guard

const isCompleteObjectSchema = (s: any): boolean => s.type !== 'object' || (s.properties != null && Object.keys(s.properties).length > 0);

Prevention

When it happens

Trigger: Passing a spec to openapiToFunctions where at least one object schema in the document lacks a properties key or has properties: {} — typically in components/schemas, response definitions, or nested items — after the earlier per-operation checks have passed or as the final catch-all validation.

Common situations: Large specs where one buried schema is a stub; adding a new model without fields; $ref chains that end in an empty object schema; automated spec generation tools emitting {type: object} placeholders.

Related errors


AI-assisted analysis of mckaywrigley/chatbot-ui@81328b61d2 (2026-08-27). Data as JSON: /api/errors/636da4f2e6e0b98b. Report an issue: GitHub.