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

Certain schemas can cause unhandled undefined in Formly JSON parser #2884

Closed
camden-penn opened this issue Jun 10, 2021 · 1 comment
Closed
Labels

Comments

@camden-penn
Copy link

Description

Came to light in discussion of issue #2875. Schemas such as

{
  "type": "object",
  "properties":{
    "prop":{
      "type":"array"
    }
  }
}

cause the parser to call FormlyJsonschema.resolveSchema(schema, options) with schema set to the unexpected value undefined. This function is not hardened against such a possibility, and errors out before the schema can be parsed.

Minimal Reproduction

https://stackblitz.com/edit/extended-formly-config-does-not-intercede?file=src%2Fapp%2Fapp.component.ts

Your Environment

  • Angular version: 8.2.14
  • Formly version: 5.10.20
camden-penn pushed a commit to camden-penn/ngx-formly that referenced this issue Jun 10, 2021
Fix issue in which an array without an items keyword causes an error in
FormlyJsonschema.toFieldConfig().

fix ngx-formly#2884
aitboudad added a commit that referenced this issue Jul 6, 2021
fix #2884

Co-authored-by: Camden Penn <camden.penn@gmail.com>
@aitboudad
Copy link
Member

This issue has been fixed and released as part of v5.10.22 release.

Please let us know, in case you are still encountering a similar issue/problem.
Thank you!

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

Successfully merging a pull request may close this issue.

2 participants