feat(entities-plugins): standalone free form schema builder#2973
feat(entities-plugins): standalone free form schema builder#2973
Conversation
| const field = item[key] | ||
|
|
||
| // Filter out hidden/overwrite fields | ||
| if (Object.prototype.hasOwnProperty.call(field, 'overwrite') || field.hidden) return false |
There was a problem hiding this comment.
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) } } | ||
| } | ||
|
|
There was a problem hiding this comment.
Build schema for map's value, see https://github.com/Kong/gateway-schema-watcher/blob/c02f5ba15d83e5926fe577e2466d8ce6ad7adb42/plugins/ai-rag-injector.json#L14
| if (field.type === 'map' && Array.isArray(field.values.fields)) { | |
| return { [key]: { ...field, values: buildFreeFormSchema(field.values) } } | |
| } |
🔴 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 |
Summary
Add standalone free form schema builder and avoid running buildFormSchema for free-form