#8753·scalar

Multipart form field shows 'null' when using allOf with $ref and description

Author: aarond-spCreated Apr 7, 2026Updated Jun 23, 2026
Labelsbugpackage: @scalar/api-clientsending requests

What happens?

When a multipart/form-data property uses allOf to combine a $ref with a description, the API client shows null as the field value instead of rendering the referenced schema properly.

This is a common pattern when generators (e.g. zod-to-openapi) add a description to a $ref field — since $ref siblings are only supported in OpenAPI 3.1, libraries wrap it in allOf:

yaml
requestBody:
  content:
    multipart/form-data:
      schema:
        type: object
        properties:
          file:
            allOf:
              - $ref: '#/components/schemas/MySchema'
              - description: "JSON file containing the data."
        required:
          - file

The field renders as null in the form instead of showing the schema structure or an appropriate placeholder.

Image

What did you expect to happen?

The field should resolve the $ref through the allOf, display the description, and render a proper input — similar to how a direct $ref without allOf works.

Root cause (from reading the source)

In packages/api-client/src/v2/blocks/request-block/components/RequestTableRow.vue, the type is determined by checking 'type' in data.schema on the raw schema object. When the schema is an allOf, there is no type at the top level, so typeValue becomes undefined.

In packages/workspace-store/src/request-example/builder/helpers/get-example-from-schema.ts, the allOf items are processed independently. The {description: "..."} object has no type, so it contributes undefined to the merge, and the final example falls back to null.

Minimal reproducible OpenAPI spec

json
{
  "openapi": "3.1.0",
  "info": { "title": "Test", "version": "1.0.0" },
  "paths": {
    "/upload": {
      "post": {
        "summary": "Upload",
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "file": {
                    "allOf": [
                      { "$ref": "#/components/schemas/MyData" },
                      { "description": "JSON file containing the data." }
                    ]
                  }
                },
                "required": ["file"]
              }
            }
          }
        },
        "responses": {
          "200": { "description": "OK" }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "MyData": {
        "type": "object",
        "properties": {
          "name": { "type": "string" },
          "value": { "type": "integer" }
        },
        "required": ["name"]
      }
    }
  }
}

Related issues

  • #4834 (structured JSON in multipart)
  • #6974 (allOf description merging)