Azure / Azure/azure-rest-api-specs
[BUG] `APIM API Diagnostic` - `loggerId` of `DiagnosticContractProperties` should not be a required property
- Dominant language
- TypeSpec
- Stars
- 3.1k
- Forks
- 5.9k
- Avg merge
- 3d 37m
- Merged PRs (30d)
- 446
Description
### API Spec link
https://github.com/Azure/azure-rest-api-specs/blob/7b8c7b5a83ea874d6edf8f01d44bd923a664f31e/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/definitions.json#L2707
### API Spec version
Both 2022-08-01 and 2024-05-01
### Describe the bug
For [ApiDiagnostic_CreateOrUpdate](https://github.com/Azure/azure-rest-api-specs/blob/7b8c7b5a83ea874d6edf8f01d44bd923a664f31e/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/apimapis.json#L3269C25-L3269C53) api, the [loggerId](https://github.com/Azure/azure-rest-api-specs/blob/7b8c7b5a83ea874d6edf8f01d44bd923a664f31e/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/definitions.json#L2606) property of `DiagnosticContractProperties` should not be a [required ](https://github.com/Azure/azure-rest-api-specs/blob/7b8c7b5a83ea874d6edf8f01d44bd923a664f31e/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/definitions.json#L2707) property when the DiagnosticId is `local`. (The corresponding feature are shown in the Azure Portal settings below, where the `Diagnostics Logs` is specified as `Local`.)

### Expected behavior
The `loggerId` should not be listed as a required property because `loggerId` does not need to be specified when setting `Diagnostics Logs` to `Local`. (`loggerId` is listed as a required property, which makes TF unable to specify `loggerId` as null)
### Actual behavior
The `loggerId` be listed as a [required ](https://github.com/Azure/azure-rest-api-specs/blob/7b8c7b5a83ea874d6edf8f01d44bd923a664f31e/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/definitions.json#L2707) property.
### Reproduction Steps
Create a APIM API Diagnostic by [ApiDiagnostic_CreateOrUpdate](https://github.com/Azure/azure-rest-api-specs/blob/7b8c7b5a83ea874d6edf8f01d44bd923a664f31e/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/apimapis.json#L3269C25-L3269C53) api, specify DiagnosticId as `local`, do not specify `loggerId`, and the resource is created successfully.
### Environment
_No response_
Contributor guide
Research direction
Inspect the linked definitions.json and apimapis.json files for the 2022-08-01 and 2024-05-01 API specifications, starting at DiagnosticContractProperties and ApiDiagnostic_CreateOrUpdate. Compare the required-property declarations across both versions and validate that the local diagnostic case permits an omitted loggerId without weakening unrelated requirements.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- openapi
- Domain
- api
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 50/100