Repository navigation
Conversation
ramonski
force-pushed
the
fix/single-valued-dx-uidreference
branch
from
October 7, 2026 07:28
21ab0f5 to
759f4f6
Compare
A name in a record that matched no field and no setter was dropped
with a line in the log, and the request answered that the object had
been created or updated. A caller asking for `Service` instead of
`services` was told that all was well and got back a profile with
nothing in it, which is how an afternoon goes missing.
It is refused now, and the message names the field the caller probably
meant:
No field named 'Service' on AnalysisProfile. Did you mean 'services'?
The keys that address the object or steer the request rather than
naming a field (portal_type, parent_path, parent_uid, path, uid, id,
transition) are listed as such and skipped, as `id` already was.
This builds on #115. A name a Dexterity type kept from its Archetypes
days has to reach its field first; without that, every payload written
against the documented API, which uses those names throughout, would
now be refused.
ramonski
force-pushed
the
fix/refuse-unknown-fields
branch
from
October 7, 2026 07:29
59dea71 to
ab7a434
Compare
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.
A name in a record that matches no field and no setter is dropped with a line in the log, and the request answers that the object has been created or updated.
Current behavior before PR
Both keys are gone and the caller is told all is well. This is how an afternoon goes missing: the typo was
Serviceforservices, a spec reported fifty-eight objects composed, and the profile it had just written stayed empty.The code says so plainly:
DexterityDataManager.setreturns False when it finds neither a schema field nor a setter for the name.Desired behavior after PR is merged
Without a field close enough to suggest, it says only what it knows:
The suggestion comes from
difflib.get_close_matchesover the object's own field names.The keys that are not fields
A record also carries keys that address the object or steer the request, and those must not be mistaken for fields. They are named now, where only
idwas before:That list is the set of keys the routes themselves read out of a record.
A note on what this changes for callers
A payload carrying a key that is not a field is refused where it used to be accepted. That is the point, and it is worth saying out loud: an integration that sends something extra and harmless will see a 400 it did not see before. The alternative is what we have today, which is that a typo in a field name is indistinguishable from success.
Verification
bin/test-senaite -s senaite.jsonapi: 41 tests, 0 failures, 0 errors, run against a tree carrying Validate only the submitted fields on update #107, Fix single valued Dexterity UID references not settable #115 and this change together, which is the combination that matters.uidreferences.rstcovers both messages, the one with a suggestion and the one without.create.rstuses throughout (Department,Category,Methods,Method) still go through, which is what makes Fix single valued Dexterity UID references not settable #115 a prerequisite rather than a convenience.I confirm I have tested the PR thoroughly and coded it according to PEP8 standards.