Repository: kestra-io/kestra
Issue: Triggers do not display conditions attribute in doc
Labels: bug
documentation
enhancement

### Expected Behavior

_No response_

### Actual Behaviour

I think it is related to the inherited attributes not being displayed, didn't you do something around it @loicmathieu recently ?

### Steps To Reproduce

_No response_

### Environment Information

- Kestra Version: 0.10.0-SNAPSHOT
- Operating System (OS / Docker / Kubernetes):
- Java Version (If not docker):


### Example flow

_No response_

Issue comments:
Yes, attributes from the AbstractTrigger are filtered as with attributes from the abstract Task class for all tasks.
I think this conditions attribute is really important in doc and should be an exception for this rule 🤔

Pull request review comments:
```suggestion
        // we don't return base properties unless specified with @PluginProperty
```

Patch that resolved the issue:
diff --git a/core/src/main/java/io/kestra/core/docs/JsonSchemaGenerator.java b/core/src/main/java/io/kestra/core/docs/JsonSchemaGenerator.java
index 5e381441cc..cae09adbd3 100644
--- a/core/src/main/java/io/kestra/core/docs/JsonSchemaGenerator.java
+++ b/core/src/main/java/io/kestra/core/docs/JsonSchemaGenerator.java
@@ -424,10 +424,10 @@ protected <T> Map<String, Object> generate(Class<? extends T> cls, @Nullable Cla
 
         this.build(builder,false);
 
-        // base is passed, we don't return base properties
+        // we don't return base properties unless specified with @PluginProperty
         builder
             .forFields()
-            .withIgnoreCheck(fieldScope -> base != null && fieldScope.getDeclaringType().getTypeName().equals(base.getName()));
+            .withIgnoreCheck(fieldScope -> base != null && fieldScope.getAnnotation(PluginProperty.class) == null && fieldScope.getDeclaringType().getTypeName().equals(base.getName()));
 
         SchemaGeneratorConfig schemaGeneratorConfig = builder.build();
 
diff --git a/core/src/main/java/io/kestra/core/models/triggers/AbstractTrigger.java b/core/src/main/java/io/kestra/core/models/triggers/AbstractTrigger.java
index 4d3e6c2434..caf232712f 100644
--- a/core/src/main/java/io/kestra/core/models/triggers/AbstractTrigger.java
+++ b/core/src/main/java/io/kestra/core/models/triggers/AbstractTrigger.java
@@ -2,6 +2,7 @@
 
 import com.fasterxml.jackson.annotation.JsonInclude;
 import com.fasterxml.jackson.annotation.JsonTypeInfo;
+import io.kestra.core.models.annotations.PluginProperty;
 import io.kestra.core.models.conditions.Condition;
 import io.kestra.core.models.tasks.WorkerGroup;
 import io.micronaut.core.annotation.Introspected;
@@ -39,6 +40,7 @@ abstract public class AbstractTrigger {
     private String description;
 
     @Valid
+    @PluginProperty
     @Schema(
         title = "List of Conditions in order to limit the flow trigger."
     )


Test patch:
diff --git a/core/src/test/java/io/kestra/core/docs/JsonSchemaGeneratorTest.java b/core/src/test/java/io/kestra/core/docs/JsonSchemaGeneratorTest.java
index 91598b4fab..2de360d3b2 100644
--- a/core/src/test/java/io/kestra/core/docs/JsonSchemaGeneratorTest.java
+++ b/core/src/test/java/io/kestra/core/docs/JsonSchemaGeneratorTest.java
@@ -22,6 +22,7 @@
 import lombok.NoArgsConstructor;
 import lombok.ToString;
 import lombok.experimental.SuperBuilder;
+import org.hamcrest.Matchers;
 import org.junit.jupiter.api.Test;
 
 import java.net.URISyntaxException;
@@ -121,6 +122,13 @@ void trigger() throws URISyntaxException {
             var allOf = (List<Object>) task.get("allOf");
 
             assertThat(allOf.size(), is(1));
+
+            Map<String, Object> jsonSchema = jsonSchemaGenerator.generate(AbstractTrigger.class, AbstractTrigger.class);
+
+            assertThat((Map<String, Object>) jsonSchema.get("properties"), allOf(
+                Matchers.aMapWithSize(1),
+                hasKey("conditions")
+            ));
         });
     }