api-platform / admin

A beautiful and fully-featured administration interface builder for hypermedia APIs
https://api-platform.com/docs/admin/
MIT License
480 stars 130 forks source link

fix reference input validation #474

Closed PawelSuwinski closed 1 year ago

PawelSuwinski commented 1 year ago

Required referenced fields are not marked as required by InputGuesser:

For example field form parsed from hydra:

{ 
  name: "sourceLanguage", 
  (...)
  embedded: null,
  required: true,
  maxCardinality: 1,
  deprecated: false
}

Looks like this: obraz SwaggerUI recognizes it correctly: obraz

It seems that validation prop should be passed directly to Input field component, not to ReferenceInput wrapper. With that change all works fine.

alanpoulain commented 1 year ago

Thanks @PawelSuwinski.