Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Annotations to Conjure types #1616

Open
xavier630 opened this issue Aug 8, 2024 · 2 comments
Open

Add support for Annotations to Conjure types #1616

xavier630 opened this issue Aug 8, 2024 · 2 comments

Comments

@xavier630
Copy link

xavier630 commented Aug 8, 2024

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.

@sfackler
Copy link
Member

sfackler commented Aug 8, 2024

If you need to have that level of control over the JSON encoding of a type, Conjure probably isn't the right thing to be using to define it.

@xavier630
Copy link
Author

Sounds fair. This type is pretty widely consumed by other services and defined in a conjure spec - but agreed that that doesn't mean it has to be like that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants