Skip to content

How can I add enum field inside a composite so that enum class is generated #1070

@samkhopkar

Description

@samkhopkar

How can I add enum field inside a composite so that enum class is generated

Say I have the following enum inside the composite - it does not generate a header class for RequestType

    <enum name="RequestType" encodingType="uInt8NULL">
        <validValue name="None">0</validValue> <!-- Example: Unsolicited Cancel -->
        <validValue name="Submit">1</validValue>
        <validValue name="Update">2</validValue>
        <validValue name="Cancel">3</validValue>
    </enum>

    <composite name="OrderRequest" description="Order Request">
        <type name="order_id" primitiveType="uint64" semanticType="int"/>
        <type name="req_id" primitiveType="uint64" semanticType="int"/>
        <type name="user_token" presence="optional" primitiveType="uint64" semanticType="int"/>
        <type name="request_type" type="RequestType" primitiveType="uint8" semanticType="RequestType"/>
    </composite>

Activity

vyazelenko

vyazelenko commented on Jun 11, 2025

@vyazelenko
Contributor

@samkhopkar You need to use OrderRequest in one of the message types, i.e. if types/enums/composites are not used then no code will be generated for it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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

        Participants

        @vyazelenko@samkhopkar

        Issue actions

          How can I add enum field inside a composite so that enum class is generated · Issue #1070 · aeron-io/simple-binary-encoding