code: @Override
  	public void serialize(Resource value, JsonGenerator jg, SerializerProvider provider) throws IOException {
  		if (value.getContents().size() == 1) {
  			serializeOne(value.getContents().get(0), jg, provider);
  		} else {
  			jg.writeStartArray();
  			for (EObject o : value.getContents()) {
  				serializeOne(o, jg, provider);
  			}
  			jg.writeEndArray();
  		}
  	}
docs: private final EcoreTypeFactory typeFactory = new EcoreTypeFactory();