fix+feat(kiota): schema-default stripping (run #7's five 400s) + the final wave — full 23-resource parity - #111
Merged
Conversation
…five 400s
A Kiota constructor stamps every spec-declared default onto the model it
builds. The provider's construct overwrites the fields it wires -- nil
when unset -- so what leaks into a create is exactly the defaulted fields
the curated schema never wires, and the live API refuses some of them:
the dns-server minimal body with the leaked networkMeasurements:true is
400 ('Cloud Agents are not supported for bandwidth measurements'), and
byte-for-byte without it -- which is what the recorded evidence sent --
is 201. Five of the thirteen tests_* resources failed run #7 on this
class. Response models carry the mirror defect: a constructor default
masks absence, the getter answering the default where the wire said
nothing.
docpatch gains strip-schema-defaults, an operation RFC 6902 cannot
express: every schema in the document loses its default, walking the
schema grammar rather than matching keys -- a property literally named
default and a default key inside an example both survive, and a document
with no defaults refuses the strip as stale. The third ThousandEyes
patch applies it; the regenerated constructors set nothing but their
AdditionalData map, and a wire test pins that a fresh request model
serializes only what was set.
The errors scaffold now quotes RFC 7807 title and detail from the
deserialized error model when kiota's message is its say-nothing
fallback -- the dns-server 400 above carried its full explanation in
title while the diagnostic said 'no further explanation'. Small
single-method interfaces, so the package still names no generated model.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
alert_rule, dashboard and dashboard_filter complete the parity plan: the kiota pilot now carries the same 23 resources, 2 data sources, 1 ephemeral, 1 action and 1 list facet as the resty pilot, at 1126 verified bindings. The single-nested-heavy trio ported as pure blueprint data; the one manual touch was dropping resty's named-slice cast on dashboard_filter's context expand, which a method-typed SDK has no counterpart for. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Why
Two things in two commits: the root-cause fix for acceptance run #7's five failures, and the final wave of the parity plan.
Commit 1 — why five
tests_*creates returned bare 400sReproduced offline by serializing the generated
constructResourceoutput for the dns_server minimal fixture and diffing against the recorded accepted body: ours carried one extra field,"networkMeasurements": true. Kiota constructors stamp every spec-declareddefault:onto the model; construct overwrites the fields the schema wires (nil when unset), so what leaks is exactly the defaulted-but-unwired fields. Confirmed against the live lab: the body with the leaked default → 400 ("Cloud Agents are not supported for bandwidth measurements" — the API's own words); byte-for-byte without it (= what the recordings sent) → 201 (object deleted immediately after). The five failing resources are precisely the ones whose request models default fields the curation doesn't wire. Response models carry the mirror defect: a constructor default masks field absence from flatten.Fix, through the document-patch machinery from #109:
docpatchgainsstrip-schema-defaults— an op RFC 6902 can't express: every schema in the document loses itsdefault, walking the schema grammar (properties/items/allOf/…) so a property literally nameddefaultand adefaultkey inside an example both survive; a document with no defaults refuses as stale. Unit-tested.AdditionalDatamap, and a client wire test pins that a fresh request model serializes only what was set.title/detailfrom the deserialized error model when kiota's message is its say-nothing fallback — the 400 above carried its full explanation while the diagnostic said "The API offered no further explanation".Commit 2 — the final wave
alert_rule, dashboard, dashboard_filter complete parity: the kiota pilot now binds the same 23 resources, 2 data sources, 1 ephemeral, 1 action, 1 list facet as the resty pilot — 1126 verified bindings. The single-nested-heavy trio ported as pure blueprint data; the one manual touch was dropping resty's named-slice cast on dashboard_filter's
contextexpand (no counterpart in a method-typed SDK).Verification
bindings check✅ 1126/1126;probe verifyexit 0 (all recorded subjects reproduce);sdk generate -check✅ with all three patches; provider drift 0 on both pilots; all suites 0 failures.After merge: dispatch
go | Acceptance tests (kiota)— this should be the first fully green run at complete parity. Then the lab token can be cycled.🤖 Generated with Claude Code