Skip to content

App Config Spring - Json content type fix#48448

Open
mrm9084 wants to merge 6 commits intoAzure:mainfrom
mrm9084:JsonContentTypeFix
Open

App Config Spring - Json content type fix#48448
mrm9084 wants to merge 6 commits intoAzure:mainfrom
mrm9084:JsonContentTypeFix

Conversation

@mrm9084
Copy link
Member

@mrm9084 mrm9084 commented Mar 17, 2026

Description

Fixes a bug where ';' wasn't checked when checking for json content type. Results in our chat completion type not working.

All SDK Contribution checklist:

  • The pull request does not introduce [breaking changes]
  • CHANGELOG is updated for new features, bug fixes or other significant changes.
  • I have read the contribution guidelines.

General Guidelines and Best Practices

  • Title of the pull request is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, see this page.

Testing Guidelines

  • Pull request includes test coverage for the included changes.

Copilot AI review requested due to automatic review settings March 17, 2026 18:14
@github-actions github-actions bot added the azure-spring All azure-spring related issues label Mar 17, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes JSON Content-Type detection to correctly handle media type parameters (e.g., ; charset=utf-8), restoring expected behavior for chat completions.

Changes:

  • Strip Content-Type parameters before evaluating JSON media types.
  • Improve structured-suffix (+json) matching to be case-insensitive and whitespace-tolerant.
  • Expand unit test coverage for parameters, casing, whitespace, and edge cases.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
sdk/spring/spring-cloud-azure-appconfiguration-config/src/main/java/com/azure/spring/cloud/appconfiguration/config/implementation/JsonConfigurationParser.java Strips ; parameters and improves subtype parsing for JSON detection.
sdk/spring/spring-cloud-azure-appconfiguration-config/src/test/java/com/azure/spring/cloud/appconfiguration/config/implementation/JsonConfigurationParserTest.java Adds broad test coverage for Content-Type variants (parameters/whitespace/case/edge cases).
sdk/spring/spring-cloud-azure-appconfiguration-config/CHANGELOG.md Documents the bug fix in the changelog.

You can also share your feedback on Copilot code review. Take the survey.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes JSON Content-Type detection in spring-cloud-azure-appconfiguration-config so values containing parameters (e.g., application/json; charset=utf-8) and structured syntax suffixes are correctly recognized as JSON, preventing JSON settings from being skipped.

Changes:

  • Strip ; parameters before evaluating the media type and improve subtype parsing to check the structured syntax suffix after the last +.
  • Expand unit test coverage for isJsonContentType, including parameterized content types and additional edge cases.
  • Document the bug fix in the module CHANGELOG.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
sdk/spring/spring-cloud-azure-appconfiguration-config/src/main/java/com/azure/spring/cloud/appconfiguration/config/implementation/JsonConfigurationParser.java Fixes JSON content-type detection by stripping parameters and checking +json suffix correctly.
sdk/spring/spring-cloud-azure-appconfiguration-config/src/test/java/com/azure/spring/cloud/appconfiguration/config/implementation/JsonConfigurationParserTest.java Adds additional isJsonContentType test coverage for parameters, casing, whitespace, and edge cases.
sdk/spring/spring-cloud-azure-appconfiguration-config/CHANGELOG.md Notes the JSON content-type parameter handling bug fix in the Unreleased section.

You can also share your feedback on Copilot code review. Take the survey.

mrm9084 and others added 2 commits March 17, 2026 14:27
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

azure-spring All azure-spring related issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants