Skip to content

ISSDK-742: fix MoDisplayNames returns {Name} instead of actual values#174

Open
sagadira wants to merge 2 commits into
CiscoM31:masterfrom
sagadira:ISSDK-742
Open

ISSDK-742: fix MoDisplayNames returns {Name} instead of actual values#174
sagadira wants to merge 2 commits into
CiscoM31:masterfrom
sagadira:ISSDK-742

Conversation

@sagadira

@sagadira sagadira commented May 29, 2026

Copy link
Copy Markdown

Problem

Get-IntersightAaaAuditRecord | select ObjectMoid,MoDisplayNames displays {Name} (JObject key) instead of actual values like BT-ntp-policy.

Root Cause

For response types extending AbstractOpenAPISchema (oneOf/anyOf wrappers like AaaAuditRecordResponse), ApiClient.ExecClientAsync calls FromJson() which re-deserializes using AbstractOpenAPISchema.SerializerSettings. These settings lacked the custom converter, so System.Object-typed properties (like MoDisplayNames) were left as raw JObject/JArray instead of being converted to native .NET types.

Fix

  • ApiClient.mustache: Added NonPublicSetterContractResolver (enables private-setter deserialization with camelCase mapping) and ObjectToNativeDictionaryConverter (converts JObject to Dictionary, JArray to List, flattens single-element arrays to scalar for cleaner display).
  • AbstractOpenAPISchema.mustache: Updated both SerializerSettings and AdditionalPropertiesSerializerSettings to use the same resolver and converter, ensuring the FromJson deserialization path produces native .NET types.

Result

Before: MoDisplayNames : {Name}
After: MoDisplayNames : {[Name, BT-ntp-policy]}

sagadira added 2 commits May 29, 2026 09:27
… - Add NonPublicSetterContractResolver for private setter deserialization - Add ObjectToNativeDictionaryConverter to convert JObject/JArray to Dictionary/List
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant