stoicflame / enunciate

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

Enum in nested class is not linked properly #1206

Closed vghero closed 4 weeks ago

vghero commented 1 month ago

Hey, I'm using Enunciate 2.14.1 to generate Spring MVC REST resource documentation. Usually those APIs contain a couple of enums which are also referred to in the javadoc of the different models and controllers which appear then in the enunciate docs.

As it seems that enums that are not defined in its own files but are nested within another model as static classes, are not properly linked from the javadoc documentation into the resulting description. See the example below:

@RestController
public class ProductController {

    @ResponseStatus(HttpStatus.CREATED)
    @PostMapping(path = "/products", consumes = APPLICATION_JSON_VALUE)
    void create(@RequestBody @Valid Product product) {
        //
    }
}

public class Product {

    /**
     * The {@link Unit#PIECE} is one piece. Link is not generated.
     */
    public Unit unit;

    /**
     * The {@link Availability#OUT_OF_STOCK} means product is sold out. Link is working.
     */
    public Availability availability;

    public enum Unit {
        PIECE,
        WEIGHTED
    }
}

public enum Availability {
    AVAILABLE,
    OUT_OF_STOCK
}

The output is:

image

Is this a known issue?

stoicflame commented 3 weeks ago

Enunciate 2.18.0 has been released.