Azure / autorest.java

Extension for AutoRest (https://github.com/Azure/autorest) that generates Java code
MIT License
33 stars 80 forks source link

Additional properties Java user experience #2658

Closed lmazuel closed 3 months ago

lmazuel commented 3 months ago

Based on what @weidongxu-microsoft said on the implementation issue #2654 , closing this issue as "designed already"

weidongxu-microsoft commented 3 months ago

Java's user-facing API is

class Model {
  public Map<String, T> getAdditionalProperties();
  public Model setAdditionalProperties(Map<String, T> additionalProperties);
}

API is consistent with OpenAPI additionalProperties.

T be the type. If it is a Union that cannot be easily interpretated, BinaryData is used. (it is the same interpretation in Java emitter for Union)

weidongxu-microsoft commented 2 months ago

doc PR https://github.com/Azure/typespec-azure/pull/675