You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@grails.apache.org by ja...@apache.org on 2026/07/23 20:06:44 UTC

(grails-core) 07/10: Generate URL mappings configuration metadata

This is an automated email from the ASF dual-hosted git repository.

jamesfredley pushed a commit to branch feature/automated-configuration-metadata
in repository https://gitbox.apache.org/repos/asf/grails-core.git

commit ccc41535b2f1c584893979d5a465784f12816582
Author: James Fredley <ja...@users.noreply.github.com>
AuthorDate: Thu Jul 23 14:02:59 2026 -0400

    Generate URL mappings configuration metadata
    
    Assisted-by: opencode:gpt-5.6-sol
---
 .../META-INF/spring-configuration-metadata.json    | 58 --------------------
 grails-web-url-mappings/build.gradle               |  3 +-
 .../additional-spring-configuration-metadata.json  | 64 ++++++++++++++++++++++
 3 files changed, 66 insertions(+), 59 deletions(-)

diff --git a/grails-web-core/src/main/resources/META-INF/spring-configuration-metadata.json b/grails-web-core/src/main/resources/META-INF/spring-configuration-metadata.json
index 831f5866b6..6b5ec41fee 100644
--- a/grails-web-core/src/main/resources/META-INF/spring-configuration-metadata.json
+++ b/grails-web-core/src/main/resources/META-INF/spring-configuration-metadata.json
@@ -20,10 +20,6 @@
             "name": "grails.logging",
             "description": "Web & Controllers"
         },
-        {
-            "name": "grails.cors",
-            "description": "CORS"
-        },
         {
             "name": "grails.mime",
             "description": "Content Negotiation & MIME Types"
@@ -123,60 +119,6 @@
             "description": "Fully qualified class name of a custom StackTraceFilterer implementation.",
             "defaultValue": "org.grails.exceptions.reporting.DefaultStackTraceFilterer"
         },
-        {
-            "name": "grails.cors.enabled",
-            "type": "java.lang.Boolean",
-            "description": "Whether CORS support is enabled.",
-            "defaultValue": false
-        },
-        {
-            "name": "grails.cors.filter",
-            "type": "java.lang.Boolean",
-            "description": "Whether CORS is handled via a servlet filter (true) or an interceptor (false).",
-            "defaultValue": true
-        },
-        {
-            "name": "grails.cors.allowedOrigins",
-            "type": "java.util.List<java.lang.String>",
-            "description": "List of allowed origins (e.g., http://localhost:5000), only applies when grails.cors.enabled is true.",
-            "defaultValue": ["*"]
-        },
-        {
-            "name": "grails.cors.allowedMethods",
-            "type": "java.util.List<java.lang.String>",
-            "description": "List of allowed HTTP methods.",
-            "defaultValue": ["*"]
-        },
-        {
-            "name": "grails.cors.allowedHeaders",
-            "type": "java.util.List<java.lang.String>",
-            "description": "List of allowed request headers.",
-            "defaultValue": ["*"]
-        },
-        {
-            "name": "grails.cors.exposedHeaders",
-            "type": "java.util.List<java.lang.String>",
-            "description": "List of response headers to expose to the client.",
-            "defaultValue": []
-        },
-        {
-            "name": "grails.cors.maxAge",
-            "type": "java.lang.Integer",
-            "description": "How long (in seconds) the preflight response can be cached.",
-            "defaultValue": 1800
-        },
-        {
-            "name": "grails.cors.allowCredentials",
-            "type": "java.lang.Boolean",
-            "description": "Whether credentials (cookies, authorization headers) are supported.",
-            "defaultValue": false
-        },
-        {
-            "name": "grails.cors.mappings",
-            "type": "java.util.Map<java.lang.String,java.lang.Object>",
-            "description": "Map of URL patterns to per-path CORS configuration where defining any mapping disables the global /** mapping.",
-            "defaultValue": {}
-        },
         {
             "name": "grails.mime.types",
             "type": "java.util.Map<java.lang.String,java.lang.Object>",
diff --git a/grails-web-url-mappings/build.gradle b/grails-web-url-mappings/build.gradle
index 9e9e27762a..e5d58cb94d 100644
--- a/grails-web-url-mappings/build.gradle
+++ b/grails-web-url-mappings/build.gradle
@@ -25,6 +25,7 @@ plugins {
     id 'org.apache.grails.buildsrc.properties'
     id 'org.apache.grails.buildsrc.dependency-validator'
     id 'org.apache.grails.buildsrc.compile'
+    id 'org.apache.grails.buildsrc.configuration-metadata'
     id 'org.apache.grails.buildsrc.publish'
     id 'org.apache.grails.buildsrc.sbom'
     id 'org.apache.grails.buildsrc.vulnerability-scan'
@@ -101,4 +102,4 @@ dependencies {
 apply {
     from rootProject.layout.projectDirectory.file('gradle/docs-config.gradle')
     from rootProject.layout.projectDirectory.file('gradle/test-config.gradle')
-}
\ No newline at end of file
+}
diff --git a/grails-web-url-mappings/src/main/resources/META-INF/additional-spring-configuration-metadata.json b/grails-web-url-mappings/src/main/resources/META-INF/additional-spring-configuration-metadata.json
new file mode 100644
index 0000000000..ff1754b610
--- /dev/null
+++ b/grails-web-url-mappings/src/main/resources/META-INF/additional-spring-configuration-metadata.json
@@ -0,0 +1,64 @@
+{
+    "groups": [
+        {
+            "name": "grails.cors",
+            "description": "CORS"
+        }
+    ],
+    "properties": [
+        {
+            "name": "grails.cors.enabled",
+            "type": "java.lang.Boolean",
+            "description": "Whether CORS support is enabled.",
+            "defaultValue": false
+        },
+        {
+            "name": "grails.cors.filter",
+            "type": "java.lang.Boolean",
+            "description": "Whether CORS is handled via a servlet filter (true) or an interceptor (false).",
+            "defaultValue": true
+        },
+        {
+            "name": "grails.cors.allowedOrigins",
+            "type": "java.util.List<java.lang.String>",
+            "description": "List of allowed origins (e.g., http://localhost:5000), only applies when grails.cors.enabled is true.",
+            "defaultValue": ["*"]
+        },
+        {
+            "name": "grails.cors.allowedMethods",
+            "type": "java.util.List<java.lang.String>",
+            "description": "List of allowed HTTP methods.",
+            "defaultValue": ["*"]
+        },
+        {
+            "name": "grails.cors.allowedHeaders",
+            "type": "java.util.List<java.lang.String>",
+            "description": "List of allowed request headers.",
+            "defaultValue": ["*"]
+        },
+        {
+            "name": "grails.cors.exposedHeaders",
+            "type": "java.util.List<java.lang.String>",
+            "description": "List of response headers to expose to the client.",
+            "defaultValue": []
+        },
+        {
+            "name": "grails.cors.maxAge",
+            "type": "java.lang.Integer",
+            "description": "How long (in seconds) the preflight response can be cached.",
+            "defaultValue": 1800
+        },
+        {
+            "name": "grails.cors.allowCredentials",
+            "type": "java.lang.Boolean",
+            "description": "Whether credentials (cookies, authorization headers) are supported.",
+            "defaultValue": false
+        },
+        {
+            "name": "grails.cors.mappings",
+            "type": "java.util.Map<java.lang.String,java.lang.Object>",
+            "description": "Map of URL patterns to per-path CORS configuration where defining any mapping disables the global /** mapping.",
+            "defaultValue": {}
+        }
+    ]
+}