Skip to content

fix(accounting): remove invalid type from parameter reference#829

Draft
KSHITIZ6341 wants to merge 1 commit into
XeroAPI:masterfrom
KSHITIZ6341:fix/account-parameter-ref-schema
Draft

fix(accounting): remove invalid type from parameter reference#829
KSHITIZ6341 wants to merge 1 commit into
XeroAPI:masterfrom
KSHITIZ6341:fix/account-parameter-ref-schema

Conversation

@KSHITIZ6341

Copy link
Copy Markdown

Description

Good catch by @bhaeussermann: the /Accounts path parameter reference includes a sibling type property, which is not allowed on an OpenAPI 3.0 Reference Object. Strict validators therefore reject the Accounting specification with an additional-properties error.

This removes only the redundant sibling. The referenced requiredHeader parameter remains unchanged.

Fixes #694

Root cause

The type: string constraint was placed next to $ref rather than inside a Parameter Object schema. Reference Objects in OpenAPI 3.0 cannot be extended with sibling fields.

Compatibility

This does not change an endpoint, parameter, or generated SDK type. It makes the existing reference valid for standards-compliant tooling.

Validation

  • swagger-cli validate xero_accounting.yaml (failed at #/paths/~1Accounts/parameters/0 before the fix; passes afterward)
  • uvx yamllint -c .yamllint.yml xero_accounting.yaml
  • ./scripts/api-diff/api-diff.test.sh (9 tests passed)
  • Base-versus-current oapi-codegen types comparison (no generated differences)
  • git diff --check

Not run

  • ./scripts/api-diff/api-diff.sh xero_accounting.yaml requires Docker, which is unavailable locally. The repository CI workflow will run the diff check.
  • A secondary openapi-spec-validator pass is blocked on both revisions by a pre-existing string-valued boolean default elsewhere in the Accounting specification.
  • Native oasdiff comparison is blocked on both revisions by a pre-existing duplicate endpoint declaration.

The /Accounts path parameter reference included a sibling type property, which is not allowed on an OpenAPI 3.0 Reference Object and caused strict validators to reject the specification.

Remove the redundant property while retaining the shared requiredHeader parameter definition.

Fixes XeroAPI#694
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.

Schema error in Accounting OpenAPI spec

1 participant