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

Unsupported field type: undefined #1006

Closed
mdesousa opened this issue Sep 3, 2021 · 1 comment · Fixed by #1012
Closed

Unsupported field type: undefined #1006

mdesousa opened this issue Sep 3, 2021 · 1 comment · Fixed by #1012
Assignees
Labels
Type: Bug Bug reports and their fixes
Milestone

Comments

@mdesousa
Copy link

mdesousa commented Sep 3, 2021

Hi, we are getting an error "Unsupported field type: undefined" when using the json schema below.
If we change the reference in my_property to GoodType then the form is rendered without errors. It seems to be a problem with BadType being a $ref... thanks

react@17.0.2
uniforms-bridge-json-schema@3.5.5
unforms-material@3.5.5
uniforms@3.5.5

{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$ref": "#/definitions/MyObjectType",
  "definitions": {
    "MyObjectType": {
      "type": "object",
      "properties": {
        "my_property": {
          "$ref": "#/definitions/BadType"
        }
      },
      "required": ["my_property"],
      "additionalProperties": false
    },
    "BadType": {
      "$ref": "#/definitions/GoodType"
    },
    "GoodType": {
      "type": "integer"
    }
  }
}
@wadamek65
Copy link
Contributor

Hi @mdesousa , thanks for the issue report.

$ref is supported in uniforms, but seems like there is a bug when resolving a $ref that is pointing to another $ref

Until this is fixed, as a workaround, you can skip the intermediate reference and reference the definition directly.

@wadamek65 wadamek65 self-assigned this Sep 6, 2021
@wadamek65 wadamek65 added the Type: Bug Bug reports and their fixes label Sep 6, 2021
@wadamek65 wadamek65 added this to Needs triage in Open Source (migrated) via automation Sep 6, 2021
@wadamek65 wadamek65 moved this from Needs triage to In progress in Open Source (migrated) Sep 6, 2021
@wadamek65 wadamek65 linked a pull request Sep 10, 2021 that will close this issue
Open Source (migrated) automation moved this from In progress to Closed Sep 13, 2021
@radekmie radekmie added this to the v3.6 milestone Apr 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Bug reports and their fixes
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants