void (JsonValueAdapter element, JsonSchemaObject object) { if (!(element instanceof JsonObjectValueAdapter)) return; Map<String, Map<String, String>> metadataMap = new HashMap<>(); for (JsonPropertyAdapter adapter : ((JsonObjectValueAdapter)element).getPropertyList()) { String name = adapter.getName(); if (name == null) continue; Collection<JsonValueAdapter> values = adapter.getValues(); if (values.size() != 1) continue; JsonValueAdapter valueAdapter = values.iterator().next(); if (valueAdapter.isStringLiteral()) { metadataMap.put(name, Collections.singletonMap("description", getString(valueAdapter))); } else if (valueAdapter instanceof JsonObjectValueAdapter) { Map<String, String> valueMap = new HashMap<>(); for (JsonPropertyAdapter propertyAdapter : ((JsonObjectValueAdapter)valueAdapter).getPropertyList()) { String adapterName = propertyAdapter.getName(); if (adapterName == null) continue; Collection<JsonValueAdapter> adapterValues = propertyAdapter.getValues(); if (adapterValues.size() != 1) continue; JsonValueAdapter next = adapterValues.iterator().next(); if (next.isStringLiteral()) { valueMap.put(adapterName, getString(next)); } } metadataMap.put(name, valueMap); } } object.setEnumMetadata(metadataMap); }