Skip to content

Conversation

@heaths
Copy link
Member

@heaths heaths commented Nov 6, 2025

Resolves #1687. As long as we use Value from core, should serde_json::Value ever make a breaking change to Value we can effectively vendor just that while continuing to pick up changes to the de/serializers.

Resolves Azure#1687. As long as we use `Value` from core, should `serde_json::Value` ever make a breaking change to `Value` we can effectively vendor just that while continuing to pick up changes to the de/serializers.
@heaths heaths requested a review from RickWinter as a code owner November 6, 2025 01:00
@heaths heaths requested a review from antkmsft November 6, 2025 01:00
@heaths heaths requested a review from LarryOsterman as a code owner November 6, 2025 01:00
@github-actions github-actions bot added the Azure.Core The azure_core crate label Nov 6, 2025
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

This PR makes serde_json an optional dependency controlled by the json and xml features in typespec_client_core, and re-exports serde_json::Value as Value from both typespec_client_core and azure_core for easier consumption. The changes ensure that JSON-related functionality is only compiled when needed, improving modularity and compilation times for consumers that don't require JSON support.

Key changes:

  • Made serde_json dependency optional, enabled by either json or xml features
  • Re-exported serde_json::Value as a top-level type in both crates
  • Added feature gates throughout the codebase to conditionally compile JSON-related code
  • Updated all references to use the re-exported Value type instead of serde_json::Value directly

Reviewed Changes

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

Show a summary per file
File Description
sdk/core/typespec_client_core/Cargo.toml Made serde_json optional and tied to json/xml features
sdk/core/typespec_client_core/src/lib.rs Re-exported Value conditionally and added feature gate for Sealed trait impl
sdk/core/typespec_client_core/src/http/response.rs Added conditional compilation for Response struct based on json feature
sdk/core/typespec_client_core/src/http/request/mod.rs Added feature gates for JSON-related imports, methods, and types
sdk/core/typespec_client_core/src/http/method.rs Simplified Display trait implementation to be unconditional
sdk/core/typespec_client_core/src/http/format.rs Added feature gates for JsonFormat and its implementations
sdk/core/typespec_client_core/src/base64.rs Added feature gates for JSON serialization/deserialization tests
sdk/core/typespec_client_core/CHANGELOG.md Documented the new re-exported Value type
sdk/core/typespec/Cargo.toml Made serde dependency required for xml feature
sdk/core/azure_core/src/lib.rs Re-exported Value from typespec_client_core
sdk/core/azure_core/src/error/error_response.rs Updated to use crate::Value instead of serde_json::Value
sdk/core/azure_core/benches/deserialization.rs Updated comments and imports to use azure_core::Value
sdk/core/azure_core/CHANGELOG.md Documented the new re-exported Value type

@heaths heaths enabled auto-merge (squash) November 6, 2025 02:36
@heaths heaths disabled auto-merge November 6, 2025 18:41
@heaths heaths merged commit 7f2ccaf into Azure:main Nov 6, 2025
17 checks passed
@heaths heaths deleted the issue1687 branch November 6, 2025 18:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Azure.Core The azure_core crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Define a Value type that can hold a vector of any type

3 participants