Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix _id and _score in records APIs #334

Merged
merged 2 commits into from
Mar 4, 2025

Conversation

austin-denoble
Copy link
Contributor

@austin-denoble austin-denoble commented Mar 4, 2025

Problem

Code generation from OpenAPI specs has some quirks, one of which is trying to get rid of leading underscores in objects and classes in some languages. We currently use _id and _score in our records API to denote reserved keys. We previously needed to add some logic during codegen in python to prevent this same issue.

Currently:

  • You cannot call upsertRecords with records containing _id.
  • When calling searchRecords the resulting object has the keys mapped from _id -> id and _score -> score.

Solution

  • Updated IntegratedRecord type which resolves the problem with upsertRecords
  • Add a new function to the build-oas.sh script that handles massaging the Hit.ts file fields to maintain the shape of the API.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update
  • Infrastructure change (CI configs, etc)
  • Non-code change (docs, etc)
  • None of the above: (explain here)

Test Plan

CI Unit + Integration


Sorry, something went wrong.

@austin-denoble austin-denoble merged commit 7468566 into main Mar 4, 2025
32 checks passed
@austin-denoble austin-denoble deleted the adenoble/fix-id-upsert-records branch March 4, 2025 06:24
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.

None yet

1 participant