Home / Function/ ApiOperationRequestBodyDetailsInternal() — supabase Function Reference

ApiOperationRequestBodyDetailsInternal() — supabase Function Reference

Architecture documentation for the ApiOperationRequestBodyDetailsInternal() function in Reference.ui.tsx from the supabase codebase.

Entity Profile

Dependency Diagram

graph TD
  5a053538_7f1d_9407_4fd0_1115584fb1d7["ApiOperationRequestBodyDetailsInternal()"]
  ddd25313_39f7_44ef_a55f_cf32b776fdab["getTypeDisplayFromSchema()"]
  5a053538_7f1d_9407_4fd0_1115584fb1d7 -->|calls| ddd25313_39f7_44ef_a55f_cf32b776fdab
  style 5a053538_7f1d_9407_4fd0_1115584fb1d7 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

apps/docs/features/docs/Reference.ui.tsx lines 392–464

function ApiOperationRequestBodyDetailsInternal({
  schema,
  ...props
}: ApiOperationRequestBodyDetailsInternalProps) {
  if ('allOf' in schema) {
    return (
      <>
        <span className="font-mono text-sm font-medium text-foreground">All of the following:</span>
        {schema.allOf.map((option, index) => (
          <ApiSchemaParamSubdetails key={index} schema={option} />
        ))}
      </>
    )
  } else if ('anyOf' in schema) {
    return (
      <>
        <span className="font-mono text-sm font-medium text-foreground">Any of the following:</span>
        {schema.anyOf.map((option, index) => (
          <ApiSchemaParamSubdetails key={index} schema={option} />
        ))}
      </>
    )
  } else if ('oneOf' in schema) {
    return (
      <>
        <span className="font-mono text-sm font-medium text-foreground">One of the following:</span>
        {schema.oneOf.map((option, index) => (
          <ApiSchemaParamSubdetails key={index} schema={option} />
        ))}
      </>
    )
  } else if ('enum' in schema) {
    return (
      <span className="font-mono text-sm font-medium text-foreground">
        {schema.enum.join(' | ')}
      </span>
    )
  } else if (
    schema.type === 'string' ||
    schema.type === 'boolean' ||
    schema.type === 'number' ||
    schema.type === 'integer'
  ) {
    return <span className="font-mono text-sm font-medium text-foreground">{schema.type}</span>
  } else if (schema.type === 'array') {
    const itemTypeDisplay = getTypeDisplayFromSchema(schema.items)
    const displayName = itemTypeDisplay?.displayName ?? 'unknown'
    return (
      <>
        <span className="font-mono text-sm font-medium text-foreground">{`Array of ${displayName}`}</span>
        {!(
          'type' in schema.items &&
          ['string', 'boolean', 'number', 'integer'].includes(schema.items.type)
        ) && <ApiSchemaParamSubdetails className="mt-4" schema={schema.items} />}
      </>
    )
  } else if (schema.type === 'object') {
    return (
      <ul {...props}>
        {Object.keys(schema.properties || {})
          .map((property) => ({
            name: property,
            required: schema.required?.includes(property) || false,
            in: 'body' as const,
            schema: schema.properties?.[property] || ({} as ISchema),
          }))
          .map((property, index) => (
            <ApiSchemaParamDetails key={index} param={property} />
          ))}
      </ul>
    )
  }
}

Subdomains

Frequently Asked Questions

What does ApiOperationRequestBodyDetailsInternal() do?
ApiOperationRequestBodyDetailsInternal() is a function in the supabase codebase.
What does ApiOperationRequestBodyDetailsInternal() call?
ApiOperationRequestBodyDetailsInternal() calls 1 function(s): getTypeDisplayFromSchema.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free