Skip to content

Add support for Annotations to Conjure types #1616

@xavier630

Description

@xavier630

What happened?

Recently while working on a use case which involved Jackson serialisation, a lot of the potential workflows required annotating classes and fields with annotations like @JsonPropertyOrder(alphabetic = true).

However, since the class I wanted to serialise came from Conjure (via Conjure-Java) and Conjure doesn't support annotations currently (from my searching of the docs), it wasn't possible to set these annotations.

There were quite a few cases where I wanted annotations on my conjure-generated classes and their fields like the above.

This issue applies mostly to Conjure Java, but I've opened it in Conjure since it relates to the Conjure specification itself.

One proposal would be to allow annotations on Conjure types and their properties like:

  annotations:
    - "@com.fasterxml.jackson.annotation.JsonPropertyOrder(alphabetic = true)"

You would want it to be fairly flexible and open so that it could work with transpilers for various different languages.

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