Skip to content
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

Form block: Allow dynamic JSON schema input to schemaGetter without sub-flow, avoiding reactivity issues #518

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

lukestanley
Copy link
Member

  • JMESPath mapping string resolved with context.
  • Flexible, tolerant parsing of different input types, if no jsonSchema key is found, treats the result as the schema.

Copy link

vercel bot commented Feb 20, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
kendraio-app ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 21, 2025 3:32pm

Copy link
Collaborator

@CodeKrakken CodeKrakken left a comment

Choose a reason for hiding this comment

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

A couple of typos. Otherwise all good!

} else {
this.fields = [];
// To make it easier for the user, we are flexible with the input of schemaGetter:
// If we get the schemaGetter has a string, we assume it is a JMESPath mapping we need to resolve with context.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Typo - should "has" be "as"?

const contextInjectedJsonSchema = this.injectContextToJsonSchema(plainJsonSchema);
this.fields = this.formService.schemasToFieldConfig(contextInjectedJsonSchema, get(result, 'uiSchema', {}));
} else {
// if a JMESPath string is not provided, we except a sub-workflow is defined
Copy link
Collaborator

Choose a reason for hiding this comment

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

Typo - should "except" be "expect"?

…ub-flow, avoiding reactivity issues

- JMESPath mapping string resolved with context.
- Flexible, tolerant parsing of different input types, if no jsonSchema key is found, treats the result as the schema.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants