Quarkus Smallrye Eclipse Microprofile OpenAPI schema

So I am currently trying to update my backend which is running Quarkus to version 3.
The new version of Quarkus is using smallrye, but I am having some trouble with generating my OpenAPI specification files (.yaml) as it is not generating the enum property as expected.

I am currently using the smallrye-open-api-maven-plugin version 3.11.

The code below is code I made up, but is based on the experience in my code base.

I have the following Java class:

import org.eclipse.microprofile.openapi.annotations.media.Schema;
@Schema(title = "CoolStuff", description = "This is actually the cool stuff")
public class CoolClass {
   public enum CoolEnum {
      Cool,
      NotCool;
   }

   @Schema(description = "The command")
   private final CoolEnum command;
   @Schema(description = "The id")
   private final String id;

   public CoolClass(CoolEnum command, String id) {
      this.command = command;
      this.id = id;
   }

   public CoolEnum getCommand() {
      return command;
   }
   public String getId() {
      return id;
   }
}

When compiling and making the maven plugin generate the .yaml file I get this:

CoolClass:
   title: CoolStuff
   description: This is actually the cool stuff
   type: object
   properties:
      command:
         description: The command
         type: object
      id:
         description: The id
         type string

I would have expected the following .yaml, which is the .yaml I need:

CoolClass:
   title: CoolStuff
   description: This is actually the cool stuff
   type: object
   properties:
      command:
         description: The command
         type: string
         enum:
            - Cool
            - NotCool
      id:
         description: The id
         type string

I do not really see what I have done wrong here?

I have another example as well:

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.eclipse.microprofile.openapi.annotations.enums.SchemaType;
@Schema(title = "CoolStuffCool", description = "This is actually the cool stuff")
public class CoolClassClass {
   public enum CoolEnumEnum {
      Cool,
      NotCool;
   }
   public enum NotCoolEnumEnum {
      Work,
      NotWork;
   }

   @Schema(description = "The command", implementation = CoolEnumEnum.class, type = SchemaType.STRING)
   private final CoolEnumEnum command;
   @Schema(description = "The mode", implementation = NotCoolEnumEnum.class, type = SchemaType.STRING)
   private final NotCoolEnumEnum mode;

   public CoolClassClass(CoolEnumEnum command, NotCoolEnumEnum mode) {
      this.command = command;
      this.mode = mode;
   }

   public CoolEnumEnum getCommand() {
      return command;
   }
   public NotCoolEnumEnum getMode() {
      return mode;
   }
   
   @JsonCreator
   public static CoolClassClass firValue(
      @JsonProperty("command") String command, @JsonProperty("mode") String mode) {
      CoolEnumEnum commandValue = (value != null && !value.isEmpty()) ? CoolEnumEnum.valueOf(command)) : null;
      NotCoolEnumEnum modeValue = (value != null && !value.isEmpty()) ? NotCoolEnumEnum.valueOf(mode)) : null;
   return new CoolClassClass(command, mode);
  }
}

The class CoolClassClass is being generated correctly with the enum properties. I have tried adding the @JsonCreator to the CoolClass but that did not work. I also tried adding the implementation and type in the CoolClass but also without luck.

When expressing the enumeration property with the values manually, then the .yaml is also generated correctly, however I am relying heavy on that the enum properties can be generated automatically from the code, as the general backend is dependent on multiple classes, which needs to update the APIs for the other classes.

Is there something I am missing?

New contributor

BareMaxx is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật