Skip to content

fix(stores): align response schemas and parameters with the API - #222

Open
gaelsimon wants to merge 2 commits into
masterfrom
fix/stores-spec-accuracy
Open

gaelsimon wants to merge 2 commits into
masterfrom
fix/stores-spec-accuracy

Conversation

@gaelsimon

Copy link
Copy Markdown
Member

What?

Aligns the Stores response schemas and query parameters with what the Stores API returns and accepts. Closes #84.

Responses: marks the always-returned fields as required, types user_properties as a non-null object, makes the address fields nullable, adds localized_names to AssetResponse, and makes next_opening nullable with all-day (its start/end descriptions were swapped).

Parameters: renames encoded_polyline to polyline, the name the API reads, adds bounds to /stores/search, declares the defaults, allows offset=0 on /zones, and documents that lat/lng go together, that polyline needs radius, and that autocomplete without query returns no predictions.

Why?

The API reference is generated from this spec, and llms-rules.txt tells agents it is authoritative for required flags and parameters. A client following it today sends encoded_polyline, which the API ignores, and treats store_id or name as optional. Making fields required tightens the types of SDKs generated from the spec, so MapsJS, the Native SDK and the plugins need a heads-up.

How to test

npm run build && npm test. dist/merged-woosmap-openapi3.json and dist/woosmap-postman.json are left to the release, which regenerates them.

@wgsadmin wgsadmin added ai-reviewer-queued Nairi reviewer has a review in flight for this PR and removed ai-reviewer-queued Nairi reviewer has a review in flight for this PR labels Oct 2, 2026

@wgsadmin wgsadmin left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review finding:

  • Should fix: AssetAutocompleteResponse.predictions is now required, but the property is still missing its array type, so generated docs/SDKs can continue treating it as untyped.

required:
- predictions
properties:
predictions:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ predictions is being made required, but the schema still does not declare it as an array. In OpenAPI 3.1/JSON Schema, items only constrains values that are already arrays; without type: array, validators and SDK generators can still treat this property as untyped, and the generated docs already show a blank Type column. Could we add type: array under predictions before items so clients get predictions[] correctly?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in f598151. A bare type: array makes the doc generator fail on inline object items, so the item moved to a new AssetAutocompletePrediction schema and predictions is now type: array with items: $ref. The generated docs show Array<AssetAutocompletePrediction>.

@wgsadmin wgsadmin added ai-reviewer-done Nairi reviewer has finished with this PR \u2014 remove to ask again and removed ai-reviewer-queued Nairi reviewer has a review in flight for this PR labels Oct 2, 2026
@gaelsimon gaelsimon self-assigned this Oct 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-reviewer-done Nairi reviewer has finished with this PR \u2014 remove to ask again

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Mark always-returned Stores response fields as required

2 participants