Make function name optional in function.json schema#378
Open
Make function name optional in function.json schema#378
Conversation
…h-based name When `name` is omitted from a function.json/function.jsonc config file, the function name is now derived from the directory path relative to the functions root — matching the existing behavior for zero-config (config-less) functions. Closes #373 Co-authored-by: Kfir Stri <kfirstri@users.noreply.github.com>
Contributor
🚀 Package Preview Available!Install this PR's preview build with npm: npm i @base44-preview/cli@0.0.38-pr.378.bb7fa12Prefer not to change any import paths? Install using npm alias so your code still imports npm i "base44@npm:@base44-preview/cli@0.0.38-pr.378.bb7fa12"Or add it to your {
"dependencies": {
"base44": "npm:@base44-preview/cli@0.0.38-pr.378.bb7fa12"
}
}
Preview published to npm registry — try new features instantly! |
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.
Note
Description
This PR makes the
namefield optional infunction.json/function.jsoncconfig files. When omitted, the function name is automatically derived from the directory path relative to the functions root, matching the existing behavior for zero-config (config-less) functions. This provides a more ergonomic authoring experience where users don't need to repeat the directory name in a config field.Related Issue
Closes #373
Type of Change
Changes Made
namefield optional inFunctionConfigSchema(Zod schema) sofunction.jsoncfiles can omit itnameas a required field onBackendFunctionSchema(the resolved internal type) to enforce it is always present after processingreadFunction()to accept afunctionsDirparameter and derive the name from the relative path whennameis absent in the configrelative(functionsDir, functionDir).split(/[/\\]/).join("/")no-name-in-config/) with afunction.jsoncthat omits thenamefieldTesting
npm test)Checklist
docs/(AGENTS.md) if I made architectural changesAdditional Notes
The path-based fallback is consistent with how zero-config (config-less) functions already derive their names from the directory structure, so this change makes the two approaches behaviorally equivalent when
nameis omitted.🤖 Generated by Claude | 2026-03-08 09:30 UTC