-
Notifications
You must be signed in to change notification settings - Fork 1
Fix object form rendering to avoid field duplication #11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -119,7 +119,7 @@ func (r *Repository) reflect(value any, name string) (fs FormSchema, err error) | |
|
|
||
| schema, err := r.reflector.Reflect(value, jsonschema.InlineRefs, jsonschema.InterceptProp( | ||
| func(params jsonschema.InterceptPropParams) error { | ||
| if !params.Processed { | ||
| if !params.Processed || params.PropertySchema.HasType(jsonschema.Object) { | ||
| return nil | ||
| } | ||
|
|
||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Contextual Comment] P1 | Confidence: High The core logic change prevents object-typed properties from being added as a whole FormItem. Previously, the condition |
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -62,7 +62,6 @@ func TestRepository_AddSchema(t *testing.T) { | |
| "html":"Arbitrary HTML code <button onclick=\"alert('hello world!');return false\">Hi</button>" | ||
| }, | ||
| {"key":"user.code","type":"ace","aceMode":"ace/mode/sql"}, | ||
| {"key":"user.counters"},{"key":"user"}, | ||
| { | ||
| "type":"fieldhtml", | ||
|
Comment on lines
64
to
66
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P2 | Confidence: High The test expectations are updated to remove the duplicate items that were previously generated for object-typed properties. This correctly aligns the test with the fixed behaviour. However, the test coverage for nested objects is limited to the Code Suggestion: Consider adding a test case using the `Image` type (similar to how the existing example harness works) to assert that no duplicate items appear and that all sub‑fields are correctly listed. |
||
| "html":"Arbitrary HTML code <button onclick=\"alert('hello world!');return false\">Hi</button>" | ||
|
|
@@ -78,8 +77,7 @@ func TestRepository_AddSchema(t *testing.T) { | |
| {"key":"neighbors[].age","optionalToggle":true}, | ||
| {"key":"neighbors[].status"}, | ||
| {"key":"neighbors[].bio","type":"textarea"}, | ||
| {"key":"neighbors[].code","type":"ace","aceMode":"ace/mode/sql"}, | ||
| {"key":"neighbors[].counters"} | ||
| {"key":"neighbors[].code","type":"ace","aceMode":"ace/mode/sql"} | ||
| ] | ||
| } | ||
| ] | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P2 | Confidence: High
The PR removes long-commented optional configuration lines from the CI workflow, updates the
golangci/golangci-lint-actionfrom v8.0.0 to v9.2.0, and updates several dependency versions ingo.modandexample/go.mod. The lint configuration.golangci.ymlalso disables two linters (embeddedstructfieldcheck,nilnil) and adds a complexity limit. These changes reduce technical debt but are not directly related to the bug fix. The dependency bumps may introduce slight behavioural changes in downstream libraries; however, all CI checks pass, so they are safe. No functional impact is expected.