fix(accounting): remove invalid type from parameter reference#829
Draft
KSHITIZ6341 wants to merge 1 commit into
Draft
fix(accounting): remove invalid type from parameter reference#829KSHITIZ6341 wants to merge 1 commit into
KSHITIZ6341 wants to merge 1 commit into
Conversation
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
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.
Description
Good catch by @bhaeussermann: the
/Accountspath parameter reference includes a siblingtypeproperty, 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
requiredHeaderparameter remains unchanged.Fixes #694
Root cause
The
type: stringconstraint was placed next to$refrather 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/0before the fix; passes afterward)uvx yamllint -c .yamllint.yml xero_accounting.yaml./scripts/api-diff/api-diff.test.sh(9 tests passed)oapi-codegentypes comparison (no generated differences)git diff --checkNot run
./scripts/api-diff/api-diff.sh xero_accounting.yamlrequires Docker, which is unavailable locally. The repository CI workflow will run the diff check.openapi-spec-validatorpass is blocked on both revisions by a pre-existing string-valued boolean default elsewhere in the Accounting specification.oasdiffcomparison is blocked on both revisions by a pre-existing duplicate endpoint declaration.