Skip to content

The Unified and Autonomous Development Platform

Merge branch 'main' into agent

Robin Shen592e81268a58
diff --cc server-core/src/main/java/io/onedev/server/web/page/help/ApiHelpUtils.java
index 1c6c31016d,3d8edae37f..d0ea228bfb
--- a/server-core/src/main/java/io/onedev/server/web/page/help/ApiHelpUtils.java
+++ b/server-core/src/main/java/io/onedev/server/web/page/help/ApiHelpUtils.java
@@@ -114,10 -114,10 +116,10 @@@ public class ApiHelpUtils
instantiationClass = valueClass;
}
value = new ObjenesisStd(true).getInstantiatorOf(instantiationClass).newInstance();
- for (Field field: getJsonFields(instantiationClass)) {
+ for (Field field: getJsonFields(instantiationClass, origin)) {
Object fieldValue = new ExampleProvider(valueClass, field.getAnnotation(Api.class)).getExample();
if (fieldValue == null) {
- if (field.getAnnotation(ManyToOne.class) != null) {
+ if (field.getAnnotation(ManyToOne.class) != null || field.getAnnotation(JoinColumn.class) != null) {
fieldValue = field.getType().newInstance();
Field idField = AbstractEntity.class.getDeclaredField("id");
Object id = new ExampleProvider(idField.getType(), idField.getAnnotation(Api.class)).getExample();
@@@ -179,9 -179,12 +181,13 @@@
if (field.getAnnotation(JsonIgnore.class) != null
|| field.getAnnotation(OneToMany.class) != null
|| field.getAnnotation(Transient.class) != null
+ || field.getAnnotation(OneToOne.class) != null && field.getAnnotation(JoinColumn.class) == null
- || Modifier.isTransient(field.getModifiers()))
+ || Modifier.isTransient(field.getModifiers())
+ || origin == Origin.REQUEST_BODY
+ && field.getAnnotation(Api.class) != null
+ && field.getAnnotation(Api.class).readOnly()) {
continue;
+ }
if (field.getAnnotation(JsonProperty.class) != null) {
fields.add(field);
} else {
diff --cc server-plugin/server-plugin-executor-serverdocker/pom.xml
index e656e05070,c29e3febf8..0b76207d7e
--- a/server-plugin/server-plugin-executor-serverdocker/pom.xml
+++ b/server-plugin/server-plugin-executor-serverdocker/pom.xml
@@@ -5,9 -5,9 +5,9 @@@
<parent>
<groupId>io.onedev</groupId>
<artifactId>server-plugin</artifactId>
- <version>4.9.3</version>
+ <version>4.9.4</version>
</parent>
<properties>
- <moduleClass>io.onedev.server.plugin.executor.docker.DockerModule</moduleClass>
+ <moduleClass>io.onedev.server.plugin.executor.serverdocker.ServerDockerModule</moduleClass>
</properties>
</project>