Smart-doc is a java restful api document generation tool. Smart-doc is based on interface source code analysis to generate interface documentation, completely zero-injection.
public enum TrainJobType {
TRAIN_TENSORFLOW_JOB( "train-tensorflow-job"),
TRAIN_PYTORCH_JOB("train-pytorch-job");
private final String value;
TrainJobType(String value) {
this.value = value;
}
@JsonValue
public String getValue() {
return value;
}
}
The @JsonValue annotation is applied to the getValue() method. This means that when an instance of TrainJobType is serialized to JSON, the value returned by getValue() is used.
For example, if you serialize TrainJobType.TRAIN_TENSORFLOW_JOB, the resulting JSON would be train-tensorflow-job.
The
@JsonValue
annotation is applied to the getValue() method. This means that when an instance of TrainJobType is serialized to JSON, the value returned by getValue() is used.For example, if you serialize
TrainJobType.TRAIN_TENSORFLOW_JOB
, the resulting JSON would betrain-tensorflow-job
.