Skip to content

feat: add common location API contracts - #876

Open
Aniruddha-Shriwant wants to merge 2 commits into
mainfrom
feat/common-location-api-specs
Open

feat: add common location API contracts#876
Aniruddha-Shriwant wants to merge 2 commits into
mainfrom
feat/common-location-api-specs

Conversation

@Aniruddha-Shriwant

@Aniruddha-Shriwant Aniruddha-Shriwant commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Description

  • Adds OpenAPI contracts for POST /common/location/autocomplete, /directions, /distance, and /geocode.
  • Adds shared location request, response, and error schemas based on the platform-api implementation and existing fixtures.
  • Regenerates reference/common.yaml with Redocly CLI 2.19.0.
  • Does not add x-internal; these contracts remain public.

Autocomplete response requiredness

  • predictions and status remain required because platform-api's response schema explicitly requires those top-level keys.
  • Each item inside predictions is serialized as an unrestricted dictionary (fields.List(fields.Dict())). Platform-api passes through whichever nested keys Google returns; it does not validate, populate, or guarantee keys such as reference, terms, types, or structured_formatting.secondary_text.
  • Therefore, a nested key may be absent from the response entirely depending on the upstream Google payload. This differs from a required key whose value may be null.
  • The nested properties remain documented with their concrete types when present, but they are not marked required. All current recorded fixtures continue to validate.

Validation

  • All 15 recorded platform-api location request/response cases validate against the bundled contract.
  • All 11 role bundles regenerate byte-for-byte with their committed references.
  • Redocly 2.19.0 bundle completed successfully.
  • Redocly lint reports no findings for the four new operations. The Common root still has five pre-existing security-defined errors and one pre-existing info-license warning.
  • git diff --check passed.

Clickup

Task link was not provided; repository-check placeholder: https://app.clickup.com/

@github-actions github-actions Bot added the size/XL Extra Large PR label Sep 2, 2026
@Aniruddha-Shriwant
Aniruddha-Shriwant removed the request for review from rvab September 9, 2026 10:51
Comment thread reference/common.yaml
$ref: '#/components/schemas/location_coordinate_in'
destination_long:
$ref: '#/components/schemas/location_coordinate_in'
mode:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

mode needs to be required in this contract. The generated client currently treats it as optional, but the directions endpoint requires callers to send it. Please add mode to the required list and remove default: driving.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

required:

  • origin_lat
  • origin_long
  • destination_lat
  • destination_long
    • mode

properties:
mode:
type: string
nullable: true

  • default: driving
    example: driving

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/XL Extra Large PR

Development

Successfully merging this pull request may close these issues.

2 participants