Skip to main content
Answer

Schema validation inconsistencies when publishing data model through UI

  • March 22, 2023
  • 3 replies
  • 98 views

The change in the requiredness of one of the field is not consistently validated across all the inherited types.

Below works and the data model is published.

Data Model Version - 1

interface Person @view(version: "1"){

name: String

}​​​​​​​

type Actor implements Person @view(version: "1") {​​​​​​​​​​​​

 name: String

 didWinOscar: Boolean

}​​​​​​​​​​​​

Next step

Below doesn't work and I get an error "Can not change the nullability of the property\n We do not support modifying a field's 'required'ness at the moment."

interface Person @view(version: "2"){​​​​​​​​​​​​​​​​

name: String!

}​​​​​​​​​​​​​​​​

type Actor implements Person @view(version: "2") {​​​​​​​​​​​​​​

 name: String!

 didWinOscar: Boolean

}​​​​​​​​​​​​​​

Next step

Below works

interface Person @view(version: "2"){​​​​​​​​​​​​​​​​

name: String

}​​​​​​​​​​​​​​​​

type Actor implements Person @view(version: "2") {​​​​​​​​​​​​​​

 name: String!

 didWinOscar: Boolean

}​​​​​​​​​​​​​​

Best answer by Dilini Fernando

Hi @Shreyas Mehta,

I hope above issue is solved. As of now, I will solve this thread. Please feel free to create a new post if you still experience problems.

Best regards,
Dilini

3 replies

  • Practitioner
  • April 11, 2023

Hi,

Thank you for the report! This is indeed a bug, however this should not affect the underlying container, so the ‘name’ in this case will still be nullable.


 


Anita Hæhre
Seasoned Practitioner
Forum|alt.badge.img+1
  • Head of Community
  • April 13, 2023

Hi @Shreyas Mehta checking if the above is resolved or if you could need more help from us on the matter? 


Dilini Fernando
Seasoned Practitioner
Forum|alt.badge.img+2
  • Seasoned Practitioner
  • Answer
  • April 26, 2023

Hi @Shreyas Mehta,

I hope above issue is solved. As of now, I will solve this thread. Please feel free to create a new post if you still experience problems.

Best regards,
Dilini