chitralverma opened a new pull request, #9327:
URL: https://github.com/apache/opendal/pull/9327

   # Which issue does this PR close?
   
   Closes #9313.
   
   Refs #9261, #9262.
   
   # Rationale for this change
   
   The .NET generator skipped `HashMap` config fields, so `IServiceConfig` 
users could not set `S3ServiceConfig.AssumeRoleSessionTags` or 
`HdfsNativeServiceConfig.Options`. Since #9262, core reads a map-valued option 
from a JSON object string.
   
   # What changes are included in this PR?
   
   - `dev/src/generate/dotnet.rs` maps `HashMap` fields to 
`IReadOnlyDictionary<string, string>?` init properties. `ToOptions()` emits 
them through `Utilities.ToOptionJson`. `config_field` no longer has a failure 
path, so it returns `ConfigField` instead of `Result<ConfigField>`.
   - `Utilities.ToOptionJson` (internal) writes a JSON object with 
`System.Text.Json.Utf8JsonWriter`, with keys in ordinal order and their case 
kept. `null` leaves the option unset, and an empty dictionary becomes `{}`. A 
null value is written as `null`, which core rejects with `ConfigInvalid` naming 
the option.
   - The regenerated `S3ServiceConfig.cs` and `HdfsNativeServiceConfig.cs` each 
gain one property.
   - `ServiceConfigMapTest` covers the exact encoding, key order and case, 
escaping (decoded with `JsonDocument`), `{}` versus unset, a null value, and S3 
operator construction. Each test fails under at least one scratch mutation:
     - `ToOptionJson` returning `k=v` pairs joined by `,` fails the S3 and HDFS 
encoding tests, key order, escaping, empty map, and operator construction.
     - Dropping the ordinal sort fails key order.
     - Returning `""` for an empty map fails the empty-map test.
     - Lowercasing keys fails the S3 encoding and key-order tests.
     - Skipping null values fails the null-value test.
     - Restoring the generator's `HashMap` filter removes both properties, so 
the tests no longer compile.
   
   # Are there any user-facing changes?
   
   Yes. Two new optional properties. Existing code is unaffected: a public API 
dump of `OpenDAL.dll` (net8.0 and net10.0) against main shows only the two 
properties and their accessors as additions. `ToOptionJson` is internal and 
does not appear.
   
   # Breaking changes
   
   # AI Usage Statement
   
   - Harness: Claude Code (in T3 Code)
   - Model: Claude Opus 5.5 (`claude-opus-5-5`)
   - Effort: max (planning), high (implementation), xhigh (orchestration and 
review)
   - Role: Planned the change, implemented the generator change, helper, and 
tests, ran the checks above, and drafted this description. The author reviewed 
them. S3 session tags were not tested against AWS STS, and 
`HdfsNativeServiceConfig.Options` was not tested against a real client because 
the default .NET native library does not enable `services-hdfs-native`.
   


-- 
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]

Reply via email to