Skip to content

fix: add quotes to defaultFn in model property generation - #11939

Open
warisniz02 wants to merge 2 commits into
loopbackio:masterfrom
warisniz02:fix/add-quotes-to-default-fn
Open

warisniz02 wants to merge 2 commits into
loopbackio:masterfrom
warisniz02:fix/add-quotes-to-default-fn

Conversation

@warisniz02

@warisniz02 warisniz02 commented Dec 5, 2026 •

Copy link
Copy Markdown
Contributor

Description

This PR fixes the handling of defaultFn when generating model properties with the LoopBack CLI.

Problem

When a model property is configured with a defaultFn value, the model property generator does not add the required quotes around the value.

For example, a property configured as:

{ "createdAt": { "type": "date", "defaultFn": "CURRENT_TIMESTAMP" } }

should be preserve CURRENT_TIMESTAMP as a quoted string in the generated model property definition.

Checklist

  • DCO (Developer Certificate of Origin) signed in all commits
  • npm test passes on your machine
  • New tests added or existing tests modified to cover all changes
  • Code conforms with the style guide
  • API Documentation in code was updated
  • Documentation in /docs/site was updated
  • Affected artifact templates in packages/cli were updated
  • Affected example projects in examples/* were updated

👉 Check out how to submit a PR 👈

Signed-off-by: warisniz02 <warisniz02@gmail.com>
Signed-off-by: warisniz02 <warisniz02@gmail.com>

This branch has not been deployed

No deployments
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.

1 participant