Azure / apiops

APIOps applies the concepts of GitOps and DevOps to API deployment. By using practices from these two methodologies, APIOps can enable everyone involved in the lifecycle of API design, development, and deployment with self-service and automated tools to ensure the quality of the specifications and APIs that they’re building.
https://azure.github.io/apiops
MIT License
275 stars 162 forks source link

Ignore ApiDiagnostics with empty loggerId after JSON transform #530

Open jeroenmaes opened 2 months ago

jeroenmaes commented 2 months ago

Scenario: Use the JSON transform capabilities to transform a loggerId to an empty value in order to disable the API logger in a higher environment, but have it still in the repository for the lower environment.

configuration.env.yaml example:

apis:
  - name: petstore-api    
    diagnostics:
      - name: applicationinsights
        properties:
          loggerId: ''

The result is an empty string value for the loggerId field in the JSON payload

PR Changes: When an empty values is found for the required loggerId value for the API call, the call is not executed and a warning is logged instead.