Skip to content

feat(entities-plugins): standalone free form schema builder#2973

Draft
TT1228 wants to merge 4 commits intomainfrom
refactor/add-build-free-form-schema
Draft

feat(entities-plugins): standalone free form schema builder#2973
TT1228 wants to merge 4 commits intomainfrom
refactor/add-build-free-form-schema

Conversation

@TT1228
Copy link
Copy Markdown
Contributor

@TT1228 TT1228 commented Mar 6, 2026

Summary

Add standalone free form schema builder and avoid running buildFormSchema for free-form

const field = item[key]

// Filter out hidden/overwrite fields
if (Object.prototype.hasOwnProperty.call(field, 'overwrite') || field.hidden) return false
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Q: What are these fields? why do we filter out them?

if (field.elements && Array.isArray(field.elements.fields)) {
return { [key]: { ...field, elements: buildFreeFormSchema(field.elements) } }
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Build schema for map's value, see https://github.com/Kong/gateway-schema-watcher/blob/c02f5ba15d83e5926fe577e2466d8ce6ad7adb42/plugins/ai-rag-injector.json#L14

Suggested change
if (field.type === 'map' && Array.isArray(field.values.fields)) {
return { [key]: { ...field, values: buildFreeFormSchema(field.values) } }
}

Copy link
Copy Markdown
Contributor

@2eha0 2eha0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@kongponents-bot
Copy link
Copy Markdown
Collaborator

🔴 PR audit failed. 🔴

🔥 No test coverage detected.

This PR does not include any test coverage changes, but it modifies source code. Please add appropriate tests to cover the changes made in this PR.

If you believe this is a false positive or if there are valid reasons for not including test coverage changes, please request an exemption by adding the test-coverage-exempt label to the PR and ensure it is approved by one of those managers jillztom, nateslo, erichsend, lahabana, hangrao, ryanmoore, elen4, DaniellaFreese, mfollett, ValeryG.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants