Skip to content

Fix Shipping.yaml: remove tab characters and add missing array items - #255

Open
kruegge82 wants to merge 1 commit into
UPS-API:mainfrom
kruegge82:fix/shipping-yaml-tabs-and-array-items
Open

Fix Shipping.yaml: remove tab characters and add missing array items#255
kruegge82 wants to merge 1 commit into
UPS-API:mainfrom
kruegge82:fix/shipping-yaml-tabs-and-array-items

Conversation

@kruegge82

Copy link
Copy Markdown

Summary

Shipping.yaml currently fails to parse with standard YAML parsers and does not pass OpenAPI validation. This PR fixes two issues:

1. Tab characters in the YAML

YAML forbids tab characters for indentation. The spec contained 46 lines with literal tabs; two places break parsing entirely:

  • Lines ~4784-4785: continuation lines of the "Description of Goods" description are indented with tabs
  • Line ~13707: trailing tabs after the "UPS Premium Care Form container" description

Parsing with snakeyaml (used by swagger-parser and openapi-generator) fails with:

found character '\t(TAB)' that cannot start any token. (Do not use \t(TAB) for indentation)
 in 'string', line 13707, column 86

All tab characters have been replaced with spaces (the remaining occurrences were inside description texts, e.g. the Incoterms and unit-of-measurement lists).

2. Product_ProductIdentifier is an array without items

The schema is declared as type: array but defines its object fields directly under properties. Validators report:

attribute components.schemas.Product_ProductIdentifier.items is missing

The object definition has been moved into items, and maximum: 6 was changed to maxItems: 6, the correct keyword for constraining array length.

Verification

openapi-generator-cli validate -i Shipping.yaml completes without errors after these changes (only pre-existing "unused model" recommendations remain).

🤖 Generated with Claude Code

- Replace all tab characters with spaces. YAML forbids tabs for
  indentation; the tabs on the continuation lines of the AED/UAE
  description (around line 4784) and the trailing tabs after the
  UPS Premium Care description made the spec unparseable with
  standard YAML parsers (snakeyaml: "found character '\t(TAB)'
  that cannot start any token").
- Product_ProductIdentifier: the schema is declared as type: array
  but defined its object fields directly under properties. Moved the
  object definition into items and changed maximum: 6 to maxItems: 6
  so the array constraint is expressed with the correct keyword.

After these changes the spec passes openapi-generator validate with
no errors.
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