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

Adding structured objects as values in CEDAR templates #962

Open
bleonar5 opened this issue Jan 5, 2024 · 1 comment
Open

Adding structured objects as values in CEDAR templates #962

bleonar5 opened this issue Jan 5, 2024 · 1 comment

Comments

@bleonar5
Copy link

bleonar5 commented Jan 5, 2024

From what I can see at the moment, it does not seem possible to embed a structured object as the value of a given field within a CEDAR template.

Here is the concrete example: in our schema, we want to specify that the schema.org/variableMeasured property is required and potentially multiple. Within our specification, we either want the value for variableMeasured to be either an array of strings or an array of schema.org/PropertyValue objects. For strings, the template wizard works fine, but it doesn't seem possible to allow users to input PropertyValues as values.

It is possible to specify that the value for variableMeasured should be a PropertyValue, but this is in the sense of a dropdown option, not a structured object. We'd like the user to be able to specify sub-properties like maxValue, minValue, etc (all properties of the PropertyValue type within schema.org) for every element of their variableMeasured array.

Is this possible at the current moment? Is it possible by creating the JSON-schema for the template manually? Is it planned to ever be implemented?

@martinjoconnor
Copy link
Member

We have intentionally not allowed arbitrary JSON content in CEDAR artifacts, be they schema artifacts (templates, elements and fields), or instance artifacts. The meta schema (which validates schema artifacts) and the schema artifacts themselves lock down content very tightly. (Note that if you modify templates manually the REST APIs will likely reject them. FYI, the meta schema-driven validation library cedar-model-validation-library is used to perform this validation.)

So, unfortunately, it is really not possible to have the type of variable value content that you desire.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants