fix: map seven scalar response fields the API returns - #412
Merged
Merged
Conversation
A sweep of unmapped-member reports gathered from live organizations found seven simple scalars with no model property. Callers who set JsonMissingMemberHandling.ThrowOnError were getting a failed deserialization rather than an ignored field: VlanProfileDeviceAssignment.ConfigurationSource ConfigTemplateSwitchProfilePort.ActiveVlans CameraQualityRetentionProfile.AxisVideoQuality VpnBgp.PriorityRoute RoutingInterface.IsSwitchDefaultGateway TrafficShapingVpnExclusionsApplication.Protocol and .Source ConfigurationSource and AxisVideoQuality are response-only fields in the v1.74.0 OpenAPI spec; the rest appear nowhere in the spec and are mapped from the observed responses. All seven are read-only because none of them appears in a documented request body. Protocol reuses the existing TrafficShapingVpnExclusionsCustomProtocol enum, matching TrafficShapingVpnExclusionsCustom, where both fields were already mapped. Only the first unmapped field in a response is ever reported, so .Source was found by checking every sibling key of a reported field. MissingMemberScalarFieldTests deserializes the verbatim observed payloads with MissingMemberHandling.Error, and CI gained a step for the Meraki.Api.Test.Data namespace, which previously ran no tests in CI.
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 8 |
AI Reviewer: run a review on demand. To trigger the first review automatically, go to your organization or repository integration settings. AI can make mistakes. Always validate suggestions.
TIP This summary will be updated as you push new changes.
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.
What
Maps seven simple scalar response fields that live organizations were observed to return with no matching model property. Callers who set
JsonMissingMemberHandling.ThrowOnErrorwere getting a failed deserialization rather than an ignored field, so for them these were hard failures on ordinary calls.VlanProfileDeviceAssignment.ConfigurationSourcestring?ConfigTemplateSwitchProfilePort.ActiveVlansstring?CameraQualityRetentionProfile.AxisVideoQualitystring?VpnBgp.PriorityRoutestring?RoutingInterface.IsSwitchDefaultGatewaybool?TrafficShapingVpnExclusionsApplication.ProtocolTrafficShapingVpnExclusionsCustomProtocol?TrafficShapingVpnExclusionsApplication.Sourcestring?Where the evidence came from
An
OrganizationStatsunmapped-member export covering 453 reports across many live organizations. Types were cross-checked against the v1.74.0 OpenAPI spec (downloaded with.github/skills/meraki-api-update/Prepare-MerakiApiUpdate.ps1 -Latest).All seven are read-only because none of them appears in a documented request body.
Protocolreuses the existingTrafficShapingVpnExclusionsCustomProtocolenum, matchingTrafficShapingVpnExclusionsCustom, on which bothprotocolandsourcewere already mapped.Only the first unmapped field in a response is ever reported, so
.Sourcewas found by checking every sibling key of a reported field rather than only the reported field itself.Tests
New
Meraki.Api.Test.Data.MissingMemberScalarFieldTestsdeserializes the observed payloads (identifying values replaced) withMissingMemberHandling.Error— the same settings theThrowOnErrorpath uses — so an unmapped field fails the test instead of being silently dropped. No credentials needed.CI gained a
Data model unit testsstep running the wholeMeraki.Api.Test.Datanamespace, which previously ran no tests in CI at all.Notes
1.70.135on the assumption this lands as one commit on top of1.70.134; a merge commit will shift the released number.SwitchPort.ActiveVlans(the device-level equivalent) is already mapped asReadUpdatewhile this PR maps the config-template one asRead. Neither is in the spec; worth a follow-up decision on which is right.fix/map-observed-nested-fields) maps the seven nested objects from the same export and is based on this branch.