Skip to content

fix(files): remove invalid FileObject requirements - #833

Closed
ryanduguid wants to merge 3 commits into
XeroAPI:masterfrom
ryanduguid:fix/files-file-object-required-fields
Closed

fix(files): remove invalid FileObject requirements#833
ryanduguid wants to merge 3 commits into
XeroAPI:masterfrom
ryanduguid:fix/files-file-object-required-fields

Conversation

@ryanduguid

@ryanduguid ryanduguid commented Aug 6, 2026

Copy link
Copy Markdown

Draft hold — domain decision required. Do not merge this change until the Files API owner confirms whether FileObject.Id and FileObject.Name are required response fields and whether the shared response/update schema should be split. Local schema validation cannot establish that contract.

Proposed change

  • remove four undefined, lower-case required fields from the Files FileObject schema
  • allow the documented partial PUT /Files/{FileId} request body (for example, { "FolderId": "..." })

FileObject is shared by file responses and the partial-update request body. Replacing the fields with Name/Id would still make valid partial updates invalid. Removing the list is mechanically consistent with the partial-update example, but may weaken the response contract; splitting request and response schemas may be the correct domain-owned solution.

Limited verification

  • parsed the OpenAPI YAML with PyYAML
  • validated the documented FolderId-only PUT example against the proposed FileObject with jsonschema
  • npx -y @redocly/cli lint xero_files.yaml --format stylish: removes the four FileObject no-required-schema-properties-undefined warnings; the file retains unrelated baseline lint findings

These checks establish schema mechanics only. They are not authoritative evidence for Files API field requiredness.

@ryanduguid
ryanduguid marked this pull request as draft August 12, 2026 17:49
@ryanduguid
ryanduguid marked this pull request as ready for review August 18, 2026 15:08
The Folder schema declared `required: [name]` while its matching property
is `Name`, so POST /Folders rejected the spec's own documented body
{"Name": "My Docs"} with "'name' is a required property".

Corrects the casing rather than dropping the requirement, matching the fix
on fix/files-folder-required-property so the two branches stay
semantically consistent.

redocly lint no-required-schema-properties-undefined for xero_files.yaml:
5 on master, 1 on this branch before the change, 0 after.
@ryanduguid

Copy link
Copy Markdown
Author

Closing this as part of cleaning up an unsolicited batch I opened across several Xero repositories. I will not reopen unless a maintainer asks for a single focused change.

@ryanduguid ryanduguid closed this Aug 20, 2026
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