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

feat: Enums in JVM #2842

Open
wants to merge 38 commits into
base: main
Choose a base branch
from
Open

feat: Enums in JVM #2842

wants to merge 38 commits into from

Conversation

tomdaffurn
Copy link
Contributor

@tomdaffurn tomdaffurn commented Sep 26, 2024

For #2514

Tasks:

  • Test cases for all enum variants
  • Generate Java classes for enums in schema
  • Generate Kotlin classes for enums in schema
  • Serialize/deserialise enums for JVM verb server
  • Serialize/deserialise enums for JVM verb clients
  • Generate schema for enums in Java code
  • Generate schema for enums in Kotlin code
  • Update comment extraction code to include enums

@github-actions github-actions bot changed the title Enums in JVM feat: Enums in JVM Sep 26, 2024
This was referenced Sep 26, 2024
@tomdaffurn tomdaffurn marked this pull request as ready for review October 8, 2024 08:03
@tomdaffurn tomdaffurn requested review from a team as code owners October 8, 2024 08:03
@tomdaffurn tomdaffurn requested review from tlongwell-block and worstell and removed request for a team October 8, 2024 08:03
Copy link
Contributor

@stuartwdouglas stuartwdouglas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, except for the logging changes.

@@ -4,6 +4,9 @@
import java.util.ArrayList;
import java.util.List;

import org.slf4j.Logger;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be the jboss logger used by Quarkus (slf4j still works, but it delegates to JBoss logging under the hood).


public class EnumProcessor {

private static final Logger log = LoggerFactory.getLogger(EnumProcessor.class);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here.

@@ -26,6 +29,7 @@ public abstract class JVMCodeGenerator implements CodeGenProvider {

public static final String PACKAGE_PREFIX = "ftl.";
public static final String TYPE_MAPPER = "TypeAliasMapper";
private static final Logger log = LoggerFactory.getLogger(JVMCodeGenerator.class);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

slf4j


public class ModuleProcessor {

private static final Logger log = Logger.getLogger(ModuleProcessor.class);
private static final Logger log = LoggerFactory.getLogger(ModuleProcessor.class);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And here


@Enum
public interface Animal {
@JsonIgnore
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we can eventually remove the need for these annotations.

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

Successfully merging this pull request may close these issues.

2 participants