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
I am working with Backstage. I have a schema for JSONSchema and for UISchema. Backstage templates use a schema that is basically jsonschema merged with uischema. How would i create a schema that works like this in KCL that includes validations from both the uischema and json schema modules?
It seems to me that i should be able to create two mixins that inherit these base schemas, but maybe i am misunderstanding something. If i define the following base schemas - with the idea that I cannot modify these directly (representing the json and ui schemas):
schema A:
a?: str = "A"
schema B:
b?: str = "B"
I create a third schema and mix these in as follows:
If i try to create an object that uses T schema, I cannot set a or b or else i get "Cannot add member 'a' to schema 'T'". However, it works if i move the definition of a into AMixin directly, or if i instantiate AMixin instead of T. Should this not work? How else can this situation be handled? Ideally, I dont have to replicate the entire schema definition a second time...
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I am working with Backstage. I have a schema for JSONSchema and for UISchema. Backstage templates use a schema that is basically jsonschema merged with uischema. How would i create a schema that works like this in KCL that includes validations from both the uischema and json schema modules?
It seems to me that i should be able to create two mixins that inherit these base schemas, but maybe i am misunderstanding something. If i define the following base schemas - with the idea that I cannot modify these directly (representing the json and ui schemas):
I create a third schema and mix these in as follows:
If i try to create an object that uses
T
schema, I cannot seta
orb
or else i get "Cannot add member 'a' to schema 'T'". However, it works if i move the definition ofa
into AMixin directly, or if i instantiate AMixin instead of T. Should this not work? How else can this situation be handled? Ideally, I dont have to replicate the entire schema definition a second time...Beta Was this translation helpful? Give feedback.
All reactions