oneOf JSON Schema in Angular

Hi there,

I was looking to implement something related “oneOf” JSON Schema that we already can use in React stack, does someone is looking/thinking how to implement it?

I need to display one value to show to the user and send to the backend just the default values that I need to receive in the automation to work as expected.

Thanks in advance.

Kind regards,

Gabriel Souza.

Hi @bielsouza99,

are you talking about the oneOf enum constructs with const and title entries? The existing Angular autocomplete renderer could be extended to also being able to support these entries.

For this you can reuse the mapStateToEnumControlProps and mapStateToOneOfEnumControlProps mappers. The current implementation looks directly at the enum array, which is not ideal as it therefore bypasses some core functionality.

Hi @sdirix,

Thanks for the reply.

Yes, I’m talking about the oneOf with const and title entries, it’s the exact one that I need. Yeah, I saw that I can use Angular autocomplete renderer, but I have no experience with jsonforms and the example on GitHub seems a bit confusing to apply in my current environment and extend to use these entries, currently, we are using the AngularMaterialRenderers. Is there any example where someone already implemented to support these entries or just is possible to do it?

Also, my team tried to apply the codes from this pull request (Add support for enum using OneOf constructs by eneufeld · Pull Request #1591 · eclipsesource/jsonforms · GitHub) creating the files and lines to our Angular environment but we have no success on this, we don’t know which file is needed to let JSON form recognize the JSON structure. Do you know in which file is it?

Kind regards,

Gabriel Souza.