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

@link does not add model to the doc generation #1153

Open
vghero opened this issue Jan 20, 2023 · 1 comment
Open

@link does not add model to the doc generation #1153

vghero opened this issue Jan 20, 2023 · 1 comment

Comments

@vghero
Copy link

vghero commented Jan 20, 2023

We have the situation where we have a REST API where an enum should be rendered as a String type (in swagger.json). So we don't expose the actual enum BUT want to simply reference to that enum in the javadoc of the string field, to not having to manually write down its values in the docs. We thought a simple:

public class MyModel {
 /**
  * The following {@link acme.SomeClass.MyInnerEnum} values are allowed.
  */
 public String myEnumValue;
}

would do the trick. But it doesn't 😢.

Only if we explicitly put @JsonSeeAlso(acme.SomeClass.MyInnerEnum) to the field it seems to work. Could enunciate be smart about it and automatically add it to the list for doc generation :)?

@stoicflame
Copy link
Owner

It's probably technically possible, but I'm not sure it's a good idea because it would require Enunciate (which already scans all classes on the classpath and all sources on the sourcepath) to also scan all javadocs on all sources on the sourcepath.

I'll leave this open for others to comment or to provide alternative solutions, but I'm not currently inclined to add that overhead.

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

No branches or pull requests

2 participants