In case it helps, this is the code:
import { Component } from '@angular/core';
import { angularMaterialRenderers } from '@jsonforms/angular-material';
@Component({
selector: 'app-test',
template: `<jsonforms
[data]="data"
[schema]="schema"
[uischema]="uischema"
[renderers]="renderers"
></jsonforms>`,
})
export class TestComponent {
renderers = angularMaterialRenderers;
schema = {
definitions: {
address: {
type: 'object',
title: 'Address',
properties: {
street_address: {
type: 'string',
},
city: {
type: 'string',
},
state: {
type: 'string',
},
},
required: ['street_address', 'city', 'state'],
},
user: {
type: 'object',
title: 'User',
properties: {
name: {
type: 'string',
},
mail: {
type: 'string',
},
},
required: ['name', 'mail'],
},
},
type: 'object',
properties: {
addressOrUser: {
oneOf: [
{
$ref: '#/definitions/address',
},
{
$ref: '#/definitions/user',
},
],
},
},
};
uischema = {
type: 'VerticalLayout',
elements: [
{
type: 'Control',
label: 'Basic Information',
scope: '#/properties/addressOrUser',
},
],
};
data = {
addressOrUser: {},
};
}