Skip to content

feat: add method for mode discovery - #2201

Open
aaqilniz wants to merge 2 commits into
loopbackio:masterfrom
aaqilniz:feat/strict-mode
Open

aaqilniz wants to merge 2 commits into
loopbackio:masterfrom
aaqilniz:feat/strict-mode

Conversation

@aaqilniz

@aaqilniz aaqilniz commented Mar 3, 2024 •

Copy link
Copy Markdown
Contributor

Description

This PR enables lb4 discover to automatically detect database strict mode and inject jsonSchema.maxLength alongside the length property, preventing unhandled database truncation errors.

Purpose and Context

When the database is in strict mode and validation relies solely on model metadata length limits, requests exceeding column length fail with generic database errors.

@property({
  type: 'string',
  length: 100,
})
name: string;

Adding jsonSchema.maxLength ensures client-side validation catches data length violations before requests reach the database layer.

Related Issue:

Related PRs:

Checklist

  • Sign off your commits with DCO (Developer Certificate of Origin)
  • npm test passes on your machine
  • New tests added or existing tests modified to cover all changes
  • Code conforms with the style guide
  • Commit messages are following our guidelines

@coveralls

coveralls commented Mar 3, 2024 •

Copy link
Copy Markdown

Pull Request Test Coverage Report for Build 8599495495

Details

  • 12 of 13 (92.31%) changed or added relevant lines in 1 file are covered.
  • 5 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-0.04%) to 84.727%

Changes Missing Coverage Covered Lines Changed/Added Lines %
lib/datasource.js 12 13 92.31%
Files with Coverage Reduction New Missed Lines %
lib/datasource.js 5 72.29%
Totals Coverage Status
Change from base Build 8594443975: -0.04%
Covered Lines: 7279
Relevant Lines: 8283

💛 - Coveralls

@aaqilniz
aaqilniz force-pushed the feat/strict-mode branch 2 times, most recently from 51066c4 to 13bf61a Compare March 9, 2024 15:43
@aaqilniz
aaqilniz marked this pull request as ready for review April 13, 2024 17:03
@aaqilniz
aaqilniz requested a review from dhmlau as a code owner April 13, 2024 17:03
@aaqilniz
aaqilniz marked this pull request as draft October 25, 2026 10:19
@aaqilniz
aaqilniz force-pushed the feat/strict-mode branch 4 times, most recently from c9ad715 to 7621f00 Compare October 25, 2026 16:59
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
@aaqilniz
aaqilniz force-pushed the feat/strict-mode branch 3 times, most recently from 928e554 to 1565ba7 Compare October 25, 2026 17:05
@aaqilniz
aaqilniz marked this pull request as ready for review October 25, 2026 17:19
Signed-off-by: Muhammad Aaqil <aaqilcs102@gmail.com>
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.

2 participants