Skip to content

Payload of message example shows in the document as a dictionary, not an actual objectΒ #66

@leo-epshtein

Description

@leo-epshtein

I tried this:

Given the message of this type:

public class SomeMessage
{
    public int CaseId { get; set; }
    public Guid CustomerId { get; set; }
}

when doing something like this:

message.WithExample(exampleBuilder =>
	{
	  exampleBuilder
		  .WithName($"{messageType.Name}")
		  .WithSummary($"Example of {messageType.Name}")
		  .WithPayload(new Dictionary<string, object>
		  {
			  ["CaseId"] = 12345,
			  ["CustomerId"] = Guid.Parse("6952a129-7aac-41f7-b98f-10c3d9ebd131")
		  });
	});

This happened:

This is how the example payload shows in the generated document:

..................
SomeInfo:
        payload:
          IsReference: true
          schemaFormat: application/vnd.aai.asyncapi+json;version=3.0.0
          $ref: '#/components/schemas/SomeMessage'
        contentType: application/json
        name: SomeMessage
        title: Do something
        summary: Message of type SomeMessage
        description: Command to do something
        examples:
        - payload:
            comparer: {}
            count: 2
            keys:
            - CaseId
            - CustomerId
            values:
            - 12345
            - 6952a129-7aac-41f7-b98f-10c3d9ebd131
          name: SomeMessage
          summary: Example of SomeMessage

I expected this:

would expect to see an actual object, not a dictionary

Is there a workaround?

No response

Anything else?

No response

Platform(s)

No response

Community Notes

  • Please vote by adding a πŸ‘ reaction to the issue to help us prioritize.
  • If you are interested to work on this issue, please leave a comment.name: Bug Report 🐞

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