https://github.com/Azure/azure-rest-api-specs/pull/34322/checks?check_run_id=42881265079
The XXInner model is only used in output, since PUT request is using another model.
https://github.com/Azure/azure-rest-api-specs/blob/8ab62e07ff4f8966e00072b2a634c817a2b57971/specification/nginx/Nginx.Management/NginxConfigurationResponse.tsp#L40-L53
createOrUpdate is Azure.ResourceManager.Legacy.UpdateOperation<
ResourceInstanceParameters<
NginxConfigurationResponse,
Azure.ResourceManager.Foundations.DefaultBaseParameters<NginxConfigurationResponse>
>,
NginxConfigurationRequest,
NginxConfigurationResponse | ArmResourceCreatedResponse<
NginxConfigurationResponse,
LroHeaders = ArmAsyncOperationHeader<FinalResult = NginxConfigurationResponse>
>,
ErrorResponse,
OptionalRequestBody = true
>;
In current resource model implementation, we'll initialize innerModel in ctor by name:
NginxConfigurationResponseImpl(String name, com.azure.resourcemanager.nginx.NginxManager serviceManager) {
this.innerObject = new NginxConfigurationResponseInner();
this.serviceManager = serviceManager;
this.configurationName = name;
this.createBody = new NginxConfigurationRequest();
}
NginxConfigurationResponseInner is output immutable model and only has private ctor, which cannot be initialized.
Possible solution would be,
- Do not initialize it in ctor by name, and in simple property methods, check
innerModel() != null before returning, e.g.
if (this.innerModel() != null) {
return this.innerModel().systemData();
}
Though should check other references.
- When model is used as fluent response(xxInner), make the ctor public. This is probably not good, since output only model shouldn't be initialized by client(either us or user).
https://github.com/Azure/azure-rest-api-specs/pull/34322/checks?check_run_id=42881265079
The XXInner model is only used in output, since PUT request is using another model.
https://github.com/Azure/azure-rest-api-specs/blob/8ab62e07ff4f8966e00072b2a634c817a2b57971/specification/nginx/Nginx.Management/NginxConfigurationResponse.tsp#L40-L53
In current resource model implementation, we'll initialize innerModel in ctor by name:
NginxConfigurationResponseInneris output immutable model and only has private ctor, which cannot be initialized.Possible solution would be,
innerModel() != nullbefore returning, e.g.Though should check other references.