asyncapi / saunter

Saunter is a code-first AsyncAPI documentation generator for dotnet.

Home Page:https://www.asyncapi.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Is it possible to add automatically request examples for testing asyncAPI?

jorgeromeral opened this issue · comments

Hi evryone,
I wonder, if there is any option to add examples to autogenerated AsyncAPI document. It would be very useful to be able to add them using decorators (swagger-like) to have more complete APIs definitions when importing them into other tools such as Microcks (API listing, mocking and testing tool).
Thanks.

This is partially supported by the <example> XML tag.
It will use that as an example in the property definition.

/// <example>
/// Bar
/// <example>
public string Foo { get; set; }

Will result in

type: string
example: "Bar"

This is not as strong as full examples for different scenarios, but it should be a good start

Ok, I will try it. Thanks for reply!

This is partially supported by the <example> XML tag. It will use that as an example in the property definition.

/// <example>
/// Bar
/// <example>
public string Foo { get; set; }

Will result in

type: string
example: "Bar"

This is not as strong as full examples for different scenarios, but it should be a good start

This generates the json key as follows,

type: string
x-example: "Bar"

Shouldn't it be "example" instead? I don't see it reflects the UI when the key is "x-example". Am I missing something?