Swagger generator ignore class attributes

I have been generating swagger files from class diagrams.

Some of the classes in the diagram have been imported using Reverse Code from existing Java files. The classes implement java.io.Serializable. To do this there is a static field added to aid in this process. Thus a class would look like:

public class TrainId implements Serializable {
    private static final long serialVersionUID = 6357556159721165786L;
...

Using a different swagger API (annotation based) generator from code it is possible to cause the swagger file generator ignore fields by adding an annotation:

@JsonIgnore

Thus

public class TrainId implements Serializable {
    @JsonIgnore
    private static final long serialVersionUID = 6357556159721165786L;
...

Visual Paradigm currently ignores any such annotations and adds the serialVersionUID field to the swagger data objects.

Is there any way of either:

  • Ignoring static fields.
  • Allow class attributes to be tagged in some way for suppression.

This would then allow the swagger generator to ignore these class attributes.

Thank you for reaching out to us and I have forwarded the details to our engineering team for further investigation. I will keep you updated on any progress and appreciate your patience in this matter. If you have any additional questions or concerns, please don’t hesitate to contact me. Have a great day!