Skip to content

Bug Report: AsyncAPI UI does not render schema properties for object payloads #1189

Description

@ilyamikhaylov07

Description

When using AsyncAPI v3 with a valid schema definition and $ref in the message payload, the UI only displays object without rendering its properties.

The issue appears to originate from incorrect schema deserialization in the Razor view (_V3Schema.cshtml), where the entire V3SchemaDefinition object is deserialized instead of its inner Schema property.


Expected behavior

Schema properties (e.g. title, sub) should be displayed in the UI under both:

  • components.schemas
  • message payloads

Actual behavior

Only the object type is shown, without any properties rendered.


Example AsyncAPI document

Schema

{
  "components": {
    "schemas": {
      "SampleMessage": {
        "type": "object",
        "properties": {
          "title": { "type": "string" },
          "sub": { "type": "integer" }
        },
        "required": ["sub"]
      }
    }
  }
}

Payload

"payload": {
  "$ref": "#/components/schemas/SampleMessage"
}

Root cause

In _V3Schema.cshtml, schema deserialization is implemented as:

JsonSerializer.Deserialize<JsonSchema>(
    JsonSerializer.SerializeToText(Model.Definition))

However, Model.Definition is a wrapper (V3SchemaDefinition) with structure:

{
  "schemaFormat": "...",
  "schema": { ...actual schema... }
}

As a result, the deserializer receives an incorrect structure and fails to properly extract properties.


Proposed fix

Replace:

JsonSerializer.SerializeToText(Model.Definition)

with:

JsonSerializer.SerializeToText(Model.Definition.Schema)

This ensures that only the actual schema object is deserialized.


Environment

  • AsyncAPI .NET SDK version: 3.0.6
  • UI: Razor Pages (Neuroglia.AsyncApi.UI)

Notes

  • The AsyncAPI document is valid and renders correctly in other tools.
  • The issue is isolated to the UI rendering layer.

Suggested next step

If this behavior is confirmed, I can submit a Pull Request with the fix.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions