我swagger-maven-plugin
用来生成 swagger.json。但是,我注意到属性的顺序从运行到运行会发生变化。例如,它可以是:
{
...
"definitions" : {
"MyClass1" : {
"type" : "object",
"properties" : {
"name" : {
"type" : "string"
},
"title" : {
"type" : "string"
},
"description" : {
"type" : "string"
},
}
}
}
...
}
然后在下一代之后:
{
...
"definitions" : {
"MyClass1" : {
"type" : "object",
"properties" : {
"description" : {
"type" : "string"
},
"title" : {
"type" : "string"
},
"name" : {
"type" : "string"
}
}
}
}
...
}
我的Java课程:
public interface MyClass1 {
String getName();
String getTitle();
String getDescription();
}