You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the example link from steps to reproduce, the required field error message displays for the Test field, which uses enumNames, but not for the Location field, which uses oneOf.
Expected Behavior
Expected the validation message to be displayed for the Location field, which uses oneOf.
@bmmpt This is a duplicate of #3908. Sorry you ran into it. If you'd like to help fix this issue, we'd love a PR from you. Also, I am closing this as a duplicate.
@heath-freenome Sorry for creating a duplicate. The word "helper" on the other issue threw me off. I will circle back to this on Thursday and if @cwendtxealth hasn't gotten around fixing this, I will see if I can come up with an easy fix.
Prerequisites
What theme are you using?
core
Version
5.13.2
Current Behavior
In the example link from
steps to reproduce
, the required field error message displays for theTest
field, which usesenumNames
, but not for theLocation
field, which usesoneOf
.Expected Behavior
Expected the validation message to be displayed for the
Location
field, which usesoneOf
.Steps To Reproduce
https://rjsf-team.github.io/react-jsonschema-form/#eyJmb3JtRGF0YSI6e30sInNjaGVtYSI6eyJ0eXBlIjoib2JqZWN0IiwicmVxdWlyZWQiOlsibG9jYXRpb24iLCJ0ZXN0Il0sInByb3BlcnRpZXMiOnsidGVzdCI6eyJ0aXRsZSI6IlRlc3QiLCJ0eXBlIjoibnVtYmVyIiwiZW51bSI6WzEsMl19LCJsb2NhdGlvbiI6eyJ0aXRsZSI6IkxvY2F0aW9uIiwidHlwZSI6InN0cmluZyIsIm9uZU9mIjpbeyJjb25zdCI6Ik5ldyBZb3JrIiwidGl0bGUiOiJOZXcgWW9yayJ9LHsiY29uc3QiOiJBbXN0ZXJkYW0iLCJ0aXRsZSI6IkFtc3RlcmRhbSJ9XX19fSwidWlTY2hlbWEiOnsiZmlyc3ROYW1lIjp7InVpOmF1dG9mb2N1cyI6dHJ1ZSwidWk6ZW1wdHlWYWx1ZSI6IiIsInVpOnBsYWNlaG9sZGVyIjoidWk6ZW1wdHlWYWx1ZSBjYXVzZXMgdGhpcyBmaWVsZCB0byBhbHdheXMgYmUgdmFsaWQgZGVzcGl0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HRyYURhdGEiOmZhbHNlLCJsaXZlT21pdCI6ZmFsc2UsImV4cGVyaW1lbnRhbF9kZWZhdWx0Rm9ybVN0YXRlQmVoYXZpb3IiOnsiYXJyYXlNaW5JdGVtcyI6InBvcHVsYXRlIiwiZW1wdHlPYmplY3RGaWVsZHMiOiJwb3B1bGF0ZUFsbERlZmF1bHRzIn19fQ==
Environment
Anything else?
I believe the issue is caused by this line of code:
react-jsonschema-form/packages/core/src/components/fields/SchemaField.tsx
Line 236 in 42e138c
AnyOf/OneOf errors handled by child schema
, but there is no child schema in this case.The text was updated successfully, but these errors were encountered: