Skip to content

fix: map seven scalar response fields the API returns - #412

Merged
danielabbatt merged 1 commit into
mainfrom
fix/map-observed-scalar-fields
Sep 9, 2026
Merged

danielabbatt merged 1 commit into
mainfrom
fix/map-observed-scalar-fields

Conversation

@danielabbatt

@danielabbatt danielabbatt commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

What

Maps seven simple scalar response fields that live organizations were observed to return with no matching model property. Callers who set JsonMissingMemberHandling.ThrowOnError were getting a failed deserialization rather than an ignored field, so for them these were hard failures on ordinary calls.

Field Type Access Source
VlanProfileDeviceAssignment.ConfigurationSource string? Read v1.74.0 spec, response-only
ConfigTemplateSwitchProfilePort.ActiveVlans string? Read Observed only
CameraQualityRetentionProfile.AxisVideoQuality string? Read v1.74.0 spec, response-only
VpnBgp.PriorityRoute string? Read Observed only
RoutingInterface.IsSwitchDefaultGateway bool? Read Observed only
TrafficShapingVpnExclusionsApplication.Protocol TrafficShapingVpnExclusionsCustomProtocol? Read Observed only
TrafficShapingVpnExclusionsApplication.Source string? Read Observed only

Where the evidence came from

An OrganizationStats unmapped-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. Protocol reuses the existing TrafficShapingVpnExclusionsCustomProtocol enum, matching TrafficShapingVpnExclusionsCustom, on which both protocol and source 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 rather than only the reported field itself.

Tests

New Meraki.Api.Test.Data.MissingMemberScalarFieldTests deserializes the observed payloads (identifying values replaced) with MissingMemberHandling.Error — the same settings the ThrowOnError path uses — so an unmapped field fails the test instead of being silently dropped. No credentials needed.

CI gained a Data model unit tests step running the whole Meraki.Api.Test.Data namespace, which previously ran no tests in CI at all.

Meraki.Api.Test  Total: 8, Errors: 0, Failed: 0, Skipped: 0
dotnet build Meraki.Api.slnx -c Debug   Build succeeded, 0 Error(s)

Notes

  • The changelog section is labelled 1.70.135 on the assumption this lands as one commit on top of 1.70.134; a merge commit will shift the released number.
  • SwitchPort.ActiveVlans (the device-level equivalent) is already mapped as ReadUpdate while this PR maps the config-template one as Read. Neither is in the spec; worth a follow-up decision on which is right.
  • Follow-up PR #413 (fix/map-observed-nested-fields) maps the seven nested objects from the same export and is based on this branch.

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.
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 8 complexity

Metric Results
Complexity 8

View in Codacy

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.

Run reviewer

TIP This summary will be updated as you push new changes.

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