Add standard Jackson JSON media type to admin API#192
Open
mgaffigan wants to merge 2 commits intoOpenIntegrationEngine:mainfrom
Open
Add standard Jackson JSON media type to admin API#192mgaffigan wants to merge 2 commits intoOpenIntegrationEngine:mainfrom
mgaffigan wants to merge 2 commits intoOpenIntegrationEngine:mainfrom
Conversation
Signed-off-by: Mitch Gaffigan <mitch.gaffigan@comcast.net>
Signed-off-by: Mitch Gaffigan <mitch.gaffigan@comcast.net>
5fcca68 to
39c9523
Compare
Contributor
Author
|
Here's a few examples of the implementation: Login: POST https://localhost:8443/api/users/_login HTTP/1.1
User-Agent: Fiddler
X-Requested-With: Foo
Host: localhost:8443
Content-Type: application/x-www-form-urlencoded
Accept: application/mirthapi+json
Content-Length: 29
username=admin&password=admin
HTTP/1.1 200 OK
Date: Sat, 18 Oct 2025 19:03:49 GMT
Access-Control-Allow-Origin: *
Access-Control-Allow-Credentials: false
Access-Control-Allow-Methods: GET, POST, DELETE, PUT
Access-Control-Allow-Headers: Content-Type
Content-Security-Policy: frame-ancestors 'none'
X-Frame-Options: DENY
X-Content-Type-Options: nosniff
Strict-Transport-Security: max-age=31536000; includeSubDomains
Set-Cookie: JSESSIONID=node05y5j2mlzbr1hslxmsncseev91.node0; Path=/api; Secure
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Content-Type: application/mirthapi+json
Content-Length: 33
{"status":"SUCCESS","message":""}Get Current User: GET https://localhost:8443/api/users/current HTTP/1.1
User-Agent: Fiddler
X-Requested-With: Foo
Host: localhost:8443
Accept: application/mirthapi+json
Cookie: JSESSIONID=node05y5j2mlzbr1hslxmsncseev91.node0
HTTP/1.1 200 OK
Date: Sat, 18 Oct 2025 19:05:02 GMT
Access-Control-Allow-Origin: *
Access-Control-Allow-Credentials: false
Access-Control-Allow-Methods: GET, POST, DELETE, PUT
Access-Control-Allow-Headers: Content-Type
Content-Security-Policy: frame-ancestors 'none'
X-Frame-Options: DENY
X-Content-Type-Options: nosniff
Strict-Transport-Security: max-age=31536000; includeSubDomains
Content-Type: application/mirthapi+json
Content-Length: 107
{"id":1,"username":"admin","lastLogin":"2025-10-18T19:03:49.622+00:00","strikeCount":0,"userConsent":false}Add user: POST https://localhost:8443/api/users/ HTTP/1.1
User-Agent: Fiddler
X-Requested-With: Foo
Host: localhost:8443
Content-Type: application/mirthapi+json
Accept: application/mirthapi+json
Cookie: JSESSIONID=node05y5j2mlzbr1hslxmsncseev91.node0
Content-Length: 22
{"username":"example"}
HTTP/1.1 204 No Content
Date: Sat, 18 Oct 2025 19:06:07 GMT
Access-Control-Allow-Origin: *
Access-Control-Allow-Credentials: false
Access-Control-Allow-Methods: GET, POST, DELETE, PUT
Access-Control-Allow-Headers: Content-Type
Content-Security-Policy: frame-ancestors 'none'
X-Frame-Options: DENY
X-Content-Type-Options: nosniff
Strict-Transport-Security: max-age=31536000; includeSubDomains
|
There was a problem hiding this comment.
Pull request overview
This PR adds a custom JSON media type (application/mirthapi+json) to the Mirth admin API to enable direct Jackson JSON serialization/deserialization, avoiding the historical XML round-trip. This aligns the API with the OpenAPI specification and supports auto-generated clients.
Key Changes:
- Introduces
ApiContentTypes.APPLICATION_MIRTHAPI_JSONconstant - Adds
JacksonJsonObjectMapperConfigprovider for Jackson configuration - Registers Jackson JSON providers in
MirthWebServer - Updates all servlet interface annotations to support the new media type
Reviewed changes
Copilot reviewed 31 out of 34 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| ApiContentTypes.java | Defines the new application/mirthapi+json media type constant |
| JacksonJsonObjectMapperConfig.java | Configures Jackson ObjectMapper with deserialization settings and date handling |
| MirthWebServer.java | Registers Jackson JSON providers for the API |
| ServerLogServletInterface.java | Adds new media type to @Consumes/@Produces/@apiresponse annotations |
| GlobalMapServletInterface.java | Adds new media type to @Consumes/@Produces/@apiresponse annotations |
| DirectoryResourceServletInterface.java | Adds new media type to @Consumes/@Produces/@apiresponse annotations |
| DataPrunerServletInterface.java | Adds new media type to @Consumes/@Produces/@apiresponse annotations |
| DashboardConnectorStatusServletInterface.java | Adds new media type to @Consumes/@Produces/@apiresponse annotations |
| WebServiceConnectorServletInterface.java | Adds new media type to @Consumes/@Produces/@apiresponse annotations |
| TcpConnectorServletInterface.java | Adds new media type to @Consumes/@Produces/@apiresponse annotations |
| SmtpConnectorServletInterface.java | Adds new media type to @Consumes/@Produces/@apiresponse annotations |
| JmsConnectorServletInterface.java | Adds new media type to @Consumes/@Produces/@apiresponse annotations |
| DatabaseConnectorServletInterface.java | Adds new media type to @Consumes/@Produces/@apiresponse annotations |
| HttpConnectorServletInterface.java | Adds new media type to @Consumes/@Produces/@apiresponse annotations |
| FileConnectorServletInterface.java | Adds new media type to @Consumes/@Produces/@apiresponse annotations |
| DocumentConnectorServletInterface.java | Adds new media type to @Consumes/@Produces/@apiresponse annotations |
| UserServletInterface.java | Adds new media type to @Consumes/@Produces/@apiresponse annotations |
| UsageServletInterface.java | Adds new media type to @Consumes/@Produces/@apiresponse annotations |
| SystemServletInterface.java | Adds new media type to @Consumes/@Produces/@apiresponse annotations |
| MessageServletInterface.java | Adds new media type to @Consumes/@Produces/@apiresponse annotations |
| ExtensionServletInterface.java | Adds new media type to @Consumes/@Produces/@apiresponse annotations |
| EventServletInterface.java | Adds new media type to @Consumes/@Produces/@ApiResponse/@produces annotations |
| EngineServletInterface.java | Adds new media type to @Consumes/@Produces/@apiresponse annotations |
| DatabaseTaskServletInterface.java | Adds new media type to @Consumes/@Produces/@apiresponse annotations |
| ConfigurationServletInterface.java | Adds new media type to @Consumes/@Produces/@apiresponse annotations |
| CodeTemplateServletInterface.java | Adds new media type to @Consumes/@Produces/@apiresponse annotations |
| ChannelStatusServletInterface.java | Adds new media type to @Consumes/@Produces/@apiresponse annotations |
| ChannelStatisticsServletInterface.java | Adds new media type to @Consumes/@Produces/@apiresponse annotations |
| ChannelServletInterface.java | Adds new media type to @Consumes/@Produces/@apiresponse annotations |
| ChannelGroupServletInterface.java | Adds new media type to @Consumes/@Produces/@apiresponse annotations |
| AlertServletInterface.java | Adds new media type to @Consumes/@Produces/@apiresponse annotations |
| jackson-module-jaxb-annotations-2.14.3.jar | Binary JAR dependency added |
| jackson-jaxrs-json-provider-2.14.3.jar | Binary JAR dependency added |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds application/mirthapi+json as a supported content-type for the admin API's that serialize or deserialize objects.
application/jsonkeeps the historical behavior - this functionality is opt-in.Closes #188