Skip to content

OpenAPI schema code block not colored #783

@LeRoiLambda

Description

@LeRoiLambda

When viewing documentation pages that use the openapi-schema directive to embed schema code blocks, the syntax highlighting for the code-group is no longer applied.

Steps to Reproduce

  1. Create an OpenAPI file (e.g., openapi.yaml) in your project with the following contents:

    openapi: 3.0.0
    info:
      title: Simple Order API
      version: 1.0.0
    servers:
      - url: https://api.example.com/v1
    paths:
      /order-items:
        get:
          summary: Retrieve a list of order items
          responses:
            '200':
              description: A JSON array of order items
              content:
                application/json:
                  schema:
                    type: array
                    items:
                      $ref: '#/components/schemas/OrderItem'
    components:
      schemas:
        OrderItem:
          type: object
          description: An item in an order
          properties:
            id:
              type: integer
              format: int64
              description: Unique identifier for the order item
            name:
              type: string
              description: Name of the product
            quantity:
              type: integer
              description: Number of items ordered
            price:
              type: number
              format: float
              description: Price per item
          required:
            - id
            - name
            - quantity
            - price
    
  2. Add an MDX page (e.g., order-item.mdx) that references the schema:

    ---
    openapi-schema: OrderItem
    ---
    
  3. Build your Mintlify documentation site.

Expected Behavior

The code block generated by openapi-schema should have syntax highlighting applied.

Actual Behavior

The schema block renders without syntax highlighting:

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions