Plugin Documentation: Definitions section is displayed even when no definitions
### Expected Behavior

When no definitions for a task, the definitions section must not be visible

### Actual Behaviour

An empty definitions section is displayed, for ex: https://kestra.io/plugins/core/tasks/flows/io.kestra.core.tasks.flows.worker#definitions

### Steps To Reproduce

_No response_

### Environment Information

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


### Example flow

_No response_
core/src/main/java/io/kestra/core/docs/AbstractClassDocumentation.java
core/src/main/java/io/kestra/core/docs/AbstractClassDocumentation.java
core/src/test/java/io/kestra/core/docs/ClassPluginDocumentationTest.java
diff --git a/core/src/main/java/io/kestra/core/docs/AbstractClassDocumentation.java b/core/src/main/java/io/kestra/core/docs/AbstractClassDocumentation.java
index 94b9091208..6fc592c42b 100644
--- a/core/src/main/java/io/kestra/core/docs/AbstractClassDocumentation.java
+++ b/core/src/main/java/io/kestra/core/docs/AbstractClassDocumentation.java
@@ -37,6 +37,9 @@ protected AbstractClassDocumentation(JsonSchemaGenerator jsonSchemaGenerator, Cl
         this.defs = this.getDefs()
             .entrySet()
             .stream()
+            // Remove the Task entry as it only contains a reference that is filtered in the doc template,
+            // which prevent the Definitions section to be empty if no other def exist.
+            .filter(entry -> !entry.getKey().equals("io.kestra.core.models.tasks.Task"))
             .map(entry -> {
                 Map<String, Object> value = (Map<String, Object>) entry.getValue();
                 value.put("properties", flatten(properties(value), required(value)));

diff --git a/core/src/test/java/io/kestra/core/docs/ClassPluginDocumentationTest.java b/core/src/test/java/io/kestra/core/docs/ClassPluginDocumentationTest.java
index 03d5a6daeb..dec16b3476 100644
--- a/core/src/test/java/io/kestra/core/docs/ClassPluginDocumentationTest.java
+++ b/core/src/test/java/io/kestra/core/docs/ClassPluginDocumentationTest.java
@@ -46,6 +46,9 @@ void tasks() throws URISyntaxException {
             assertThat(((Map<String, String>) doc.getInputs().get("format")).get("pattern"), is(".*"));
             assertThat(((Map<String, String>) doc.getInputs().get("format")).get("description"), containsString("of this input"));
 
+            // definitions
+            assertThat(doc.getDefs().size(), is(5));
+
             // enum
             Map<String, Object> enumProperties = (Map<String, Object>) ((Map<String, Object>) ((Map<String, Object>) doc.getDefs().get("io.kestra.plugin.templates.ExampleTask-PropertyChildInput")).get("properties")).get("childEnum");
             assertThat(((List<String>) enumProperties.get("enum")).size(), is(2));
