codeconsole commented on PR #16237:
URL: https://github.com/apache/grails-core/pull/16237#issuecomment-5485625433
## Why `grails-xml` is a separate module
`grails-xml` was separated so XML support is an optional application
capability rather than a mandatory part of Grails' core REST stack.
The reasons are:
- Most new REST APIs use JSON. JSON-only applications should not carry XML
converters, renderers, data binding, marshallers, and XML-specific dependencies.
- Spring Boot 4.1 organizes serialization around media-type-specific HTTP
message converters. An optional XML module fits that model: JSON follows the
normal Boot/Jackson path, while XML infrastructure is installed only when
requested.
- The module creates a clear boundary around XML HTTP payload behavior:
- XML rendering and conversion
- XML request data binding
- legacy XML marshalling
- HAL XML compatibility
- Vnd.Error XML compatibility
- Legacy XML support can remain available during migration without keeping
deprecated XML formats permanently coupled to the core REST module.
- Future removal or replacement of legacy XML components becomes safer
because those components no longer intersect the core JSON path.
Applications that need XML add the module:
```groovy
dependencies {
implementation 'org.apache.grails:grails-xml'
}
```
They can then advertise XML on the relevant REST artefact:
```groovy
static responseFormats = ['json', 'xml']
```
JSON-only applications do not need to do anything.
Conceptually, the boundary is:
```text
Core REST support
├── JSON / Problem Details / content negotiation
└── optional grails-xml
├── XML HTTP conversion
├── XML data binding
├── legacy XML marshalling
├── HAL XML compatibility
└── Vnd.Error XML compatibility
```
This separation concerns application HTTP request and response payloads. It
does **not** remove or change XML plugin descriptors; plugin descriptor
publication and consumption are a separate concern and remain supported.
The intent is a smaller, modular modern default—not to declare XML
unsupported.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]