fix: allow hidden property in editor without redefine validation #3661#3675
fix: allow hidden property in editor without redefine validation #3661#3675maximepvrt wants to merge 2 commits intonuxt:mainfrom
Conversation
|
@maximepvrt is attempting to deploy a commit to the Nuxt Team on Vercel. A member of the Team first needs to authorize it. |
There was a problem hiding this comment.
Additional Suggestion:
Line 92 still uses the old property(z.object({})).inherit() syntax while line 38 was updated to the new simplified property().inherit() syntax in the same file. This appears to be an incomplete refactoring.
View Details
📝 Patch Details
diff --git a/playground/content.config.ts b/playground/content.config.ts
index 618fa5a4..bff602b5 100644
--- a/playground/content.config.ts
+++ b/playground/content.config.ts
@@ -89,7 +89,7 @@ const collections = {
buttons: defineCollection({
type: 'data',
source: 'testd/**',
- schema: property(z.object({})).inherit('@nuxt/ui/components/Button.vue'),
+ schema: property().inherit('@nuxt/ui/components/Button.vue'),
}),
contentV2: defineCollection({
type: 'page',
Analysis
Incomplete refactoring: property(z.object({})).inherit() in playground/content.config.ts
What fails: Inconsistent use of the property() API - line 38 uses the new simplified property().inherit() syntax while line 92 still uses the old property(z.object({})).inherit() syntax, despite both having identical usage patterns.
How to reproduce: Line 38 (content collection):
testd: property().inherit('components/TestD.vue'),
Line 92 (buttons collection):
schema: property(z.object({})).inherit('@nuxt/ui/components/Button.vue'),
Both lines use .inherit() with a component path, but employ different property() syntax.
Result: Recent commit e3ddbb5 (Jan 7, 2026) updated the playground to use the simplified syntax on line 38, but line 92 was missed. The property() function signature in src/utils/schema/index.ts shows the input parameter is optional (input?: T), and both syntaxes are functionally equivalent when using .inherit().
Expected: Both lines should use the consistent new simplified syntax property().inherit() per the API refactoring in commit e3ddbb5.
commit: |
|
Do you mean using inherit with |
|
@farnabaz Yes, exactly ! the goal is to avoid having to write |
|
@maximepvrt have you already tested and it worked for you? |
|
@farnabaz The tests seem to pass on my side, but I’d appreciate it if you could confirm it’s all good, as I have some doubts. It’s quite tricky to validate the JSON Schema output at the moment, and there’s not really a place in the playground to see the generated JSON. That’s also why I suggested adding this composable: #3672 |
@farnabaz I realized I forgot to commit everything in my PR #3661. With this update, I was wondering if we could also simplify the usage when it’s combined with
inherit?🔗 Linked issue
❓ Type of change
📚 Description
📝 Checklist