You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using JSONDoc with Spring MVC it automatically generates documentation also for "static" fields causing the UI to show them in the list of fields and in the prefilled JSON in the playground.
Example:
public class Pojo {
...
private static final long serialVersionUID = 1234;
...
}
generates the following in the list of fields of Pojo class:
serialVersionUID Type: long
and the following in the prefilled JSON in the playground:
{
...
"serialVersionUID": 0,
...
}
A solution is simply to ignore all static fields when iterating over all fields in the SpringObjectBuilder:
for (Field field : clazz.getDeclaredFields()) {
// Only add fields that are not static
if (!Modifier.isStatic(field.getModifiers())) {
ApiObjectFieldDoc fieldDoc = new ApiObjectFieldDoc();
...
}
...
}
The text was updated successfully, but these errors were encountered:
When using JSONDoc with Spring MVC it automatically generates documentation also for "static" fields causing the UI to show them in the list of fields and in the prefilled JSON in the playground.
Example:
generates the following in the list of fields of Pojo class:
serialVersionUID Type: long
and the following in the prefilled JSON in the playground:
A solution is simply to ignore all static fields when iterating over all fields in the SpringObjectBuilder:
The text was updated successfully, but these errors were encountered: