feat: return 422 for malformed OpenSearch query syntax#15
Merged
Conversation
5 tasks
4df54ab to
253aa48
Compare
4d99510 to
dec87d9
Compare
alvinsw
approved these changes
Mar 27, 2026
Detect OpenSearch 400 errors (e.g. parsing_exception from invalid query_string syntax) and return a 422 with INVALID_REQUEST error code instead of a generic 500.
dec87d9 to
5fcb9bd
Compare
Coverage Report
File Coverage
|
||||||||||||||||||||||||||||||||||||||||||||
github-actions bot
pushed a commit
that referenced
this pull request
Mar 31, 2026
## [3.0.0](v2.1.0...v3.0.0) (2026-03-31) ### ⚠ BREAKING CHANGES * Entity and File primary keys change from auto-increment integers to string-based IDs. Entity.rocrateId is renamed to Entity.id, File.fileId is renamed to File.id. File now has an entityId foreign key to Entity instead of Entity having a fileId. Redundant fields removed from File (memberOf, rootCollection, contentLicenseId). Also includes: - findFirst replaced with findUnique for primary key lookups - Promise.all for parallel count+findMany queries - Simplified transformer types (removed discriminated unions) * Existing databases must run the migration to rename tables from Entity/File to entity/file. * update to prisma 7.x ### Features * make geohashPrecision optional in search aggregations ([#14](#14)) ([9e4a546](9e4a546)) * return 422 for malformed OpenSearch query syntax ([#15](#15)) ([38280cb](38280cb)) * update to prisma 7.x ([117efa0](117efa0)) * use string primary keys and normalise Entity/File schema ([#19](#19)) ([a864503](a864503)) ### Bug Fixes * rename database tables to lowercase ([#18](#18)) ([921fe65](921fe65)) * typescript error ([d078263](d078263))
|
🎉 This PR is included in version 3.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
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.
Summary
parsing_exceptionfrom invalid query_string syntax) and return 422 withINVALID_REQUESTerror code instead of a generic 500createInvalidRequestErrorutility functionDepends on: #13
Test plan
pnpm lintpassespnpm testpasses