'Apache Avro: Complex POJO Objects as values of a Map

Consider some POJOs such as follows.

class Configuration {
  private String id;
  private Map<String, LocationConfig> locationConfiguration;
}

class LocationConfig {
  private String locationId;
  private Integer capacity;
  private Boolean available;
}

How can I come up with a JSON based Avro schema for the above? As far as I could find, even though maps are supported in Avro, the key type should always be String (which I can somehow live with) and the values cannot be of Record type. Is there a way around this? The documentation has only follows.

enter image description here

Upon research I could find somewhat of a similar question, which doesn't look very useful.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source