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

Add support for message headers

devlux opened this issue · comments

Add support for message headers:

{
    "asyncapi": "2.4.0",
    "defaultContentType": "application/json",
    "channels": {
        "channel.my.message": {
            "publish": {
                "operationId": "MyMessagePublisher",
                "summary": "",
                "message": {
                    "$ref": "#/components/messages/myMessage"
                }
            }
        }
    },
    "components": {
        "schemas": {
            "myMessage": {
                "id": "myMessage",
                "type": "object",
                "additionalProperties": false
            },
            "myMessageHeader": {
                "id": "myMessageHeader",
                "type": "object",
                "additionalProperties": false,
                "required": ["stringHeader"],
                "properties": {
                    "stringHeader": {
                        "type": "string",
                        "minLength": 1
                    },
                    "nullableIntHeader": {
                        "type": ["integer", "null"],
                        "format": "int32"
                    }
                }
            }
        },
        "messages": {
            "myMessage": {
                "headers": {
                    "$ref": "#/components/schemas/myMessageHeader"
                },
                "payload": {
                    "$ref": "#/components/schemas/myMessage"
                },
                "name": "myMessage"
            }
        }
    }
}

https://www.asyncapi.com/docs/reference/specification/v2.5.0#messageObject

This is live in v0.12.0