stoicflame / enunciate

Build-time enhancement tool for Java-based Web services projects
http://enunciate.webcohesion.com/
Other
480 stars 201 forks source link

@AllowedValues not documenting enum values? #1167

Closed sbrattla closed 1 year ago

sbrattla commented 1 year ago

@stoicflame this is a followup on #1057 - which I am very greatful that you found the time to implement. Thank you!

I tried out release 2.15.0, and this is what I did :

@XmlRootElement(name = "reportDetail")
public class MTReportDetail implements ReportDetail {

    public enum MTReportDetailType  {
        /**
         * Advertiser
         */
        ADV,
        /**
         * Advertised product
         */
        APR,
        /**
         * Broadcaster
         */
        BRC
    }

    @Override
    @XmlElement(type = String.class)
    @AllowedValues(MTReportDetailType.class)
    public ReportDetailType getType() {
        throw new UnsupportedOperationException("Documentation only");
    }

    @Override
    @XmlElement(type = String.class)
    @AllowedValues(MTReportDetailType.class)
    public void setType(ReportDetailType type) {
        throw new UnsupportedOperationException("Documentation only");
    }

    [...]

}

I expected that the documentation for getType() would somehow list enum values from MTReportDetailType. However, when I generate the documentation I see the following :

image

I also tried out the enunciate sample app to see if I could get the @AllowedValues to work there. The sample application started fine, but I unfortunately got a 503 when I tried to access it on my localhost, so I couldn't really get it to work.

stoicflame commented 1 year ago

Yep, missed a spot. Fix included in patch release 2.15.1.

sbrattla commented 1 year ago

Thank you @stoicflame! Works as expected now :

image