azure-rest-api-specs icon indicating copy to clipboard operation
azure-rest-api-specs copied to clipboard

`EventGrid` `2022-06-15`: refactor `parentType` into a parameter and reference it correctly for all URI paths in the swagger

Open stephybun opened this issue 2 years ago • 9 comments

Some of the URI paths in the swagger define parentType as an enum whereas other segments mark it as a string value.

This fixes that.

stephybun avatar Apr 14 '23 12:04 stephybun

Hi, @stephybun Thanks for your PR. I am workflow bot for review process. Here are some small tips.

  • Please ensure to do self-check against checklists in first PR comment.
  • PR assignee is the person auto-assigned and responsible for your current PR reviewing and merging.
  • For specs comparison cross API versions, Use API Specs Comparison Report Generator
  • If there is CI failure(s), to fix CI error(s) is mandatory for PR merging; or you need to provide justification in PR comment for explanation. How to fix?
  • Any feedback about review process or workflow bot, pls contact swagger and tools team. [email protected]

    Swagger Validation Report

    ️❌BreakingChange: 2 Errors, 0 Warnings failed [Detail]
    compared swaggers (via Oad v0.10.4)] new version base version
    EventGrid.json 2022-06-15(caaa752) 2022-06-15(main)
    Rule Message
    1048 - AddedXmsEnum The new version adds a x-ms-enum extension.
    New: Microsoft.EventGrid/stable/2022-06-15/EventGrid.json#L6794:9
    Old: Microsoft.EventGrid/stable/2022-06-15/EventGrid.json#L6857:11
    1048 - AddedXmsEnum The new version adds a x-ms-enum extension.
    New: Microsoft.EventGrid/stable/2022-06-15/EventGrid.json#L6856:9
    Old: Microsoft.EventGrid/stable/2022-06-15/EventGrid.json#L6923:11
    ️️✔️Breaking Change(Cross-Version) succeeded [Detail] [Expand]
    There are no breaking changes.
    ️️✔️CredScan succeeded [Detail] [Expand]
    There is no credential detected.
    ️⚠️LintDiff: 0 Warnings warning [Detail]
    compared tags (via openapi-validator v2.0.0) new version base version
    package-2022-06 package-2022-06(caaa752) package-2022-06(main)

    The following errors/warnings exist before current PR submission:

    Only 30 items are listed, please refer to log for more details.

    Rule Message
    PutGetPatchResponseSchema /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerNamespaces/{partnerNamespaceName}/channels/{channelName} has different responses for PUT/GET/PATCH operations. The PUT/GET/PATCH operations must have same schema response.
    Location: Microsoft.EventGrid/stable/2022-06-15/EventGrid.json#L19
    ResourceNameRestriction The resource name parameter 'partnerNamespaceName' should be defined with a 'pattern' restriction.
    Location: Microsoft.EventGrid/stable/2022-06-15/EventGrid.json#L19
    ResourceNameRestriction The resource name parameter 'channelName' should be defined with a 'pattern' restriction.
    Location: Microsoft.EventGrid/stable/2022-06-15/EventGrid.json#L19
    DeleteOperationAsyncResponseValidation An async DELETE operation must set long running operation options 'x-ms-long-running-operation-options'
    Location: Microsoft.EventGrid/stable/2022-06-15/EventGrid.json#L151
    LroLocationHeader A 202 response should include an Location response header.
    Location: Microsoft.EventGrid/stable/2022-06-15/EventGrid.json#L195
    ResourceNameRestriction The resource name parameter 'partnerNamespaceName' should be defined with a 'pattern' restriction.
    Location: Microsoft.EventGrid/stable/2022-06-15/EventGrid.json#L278
    ResourceNameRestriction The resource name parameter 'partnerNamespaceName' should be defined with a 'pattern' restriction.
    Location: Microsoft.EventGrid/stable/2022-06-15/EventGrid.json#L339
    ResourceNameRestriction The resource name parameter 'channelName' should be defined with a 'pattern' restriction.
    Location: Microsoft.EventGrid/stable/2022-06-15/EventGrid.json#L339
    PutGetPatchResponseSchema /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName} has different responses for PUT/GET/PATCH operations. The PUT/GET/PATCH operations must have same schema response.
    Location: Microsoft.EventGrid/stable/2022-06-15/EventGrid.json#L398
    ResourceNameRestriction The resource name parameter 'domainName' should be defined with a 'pattern' restriction.
    Location: Microsoft.EventGrid/stable/2022-06-15/EventGrid.json#L398
    CreateOperationAsyncResponseValidation An async PUT operation must set long running operation options 'x-ms-long-running-operation-options'
    Location: Microsoft.EventGrid/stable/2022-06-15/EventGrid.json#L449
    DeleteOperationAsyncResponseValidation An async DELETE operation must set long running operation options 'x-ms-long-running-operation-options'
    Location: Microsoft.EventGrid/stable/2022-06-15/EventGrid.json#L511
    LroLocationHeader A 202 response should include an Location response header.
    Location: Microsoft.EventGrid/stable/2022-06-15/EventGrid.json#L548
    LroPatch202 The async patch operation should return 202.
    Location: Microsoft.EventGrid/stable/2022-06-15/EventGrid.json#L609
    ResourceNameRestriction The resource name parameter 'domainName' should be defined with a 'pattern' restriction.
    Location: Microsoft.EventGrid/stable/2022-06-15/EventGrid.json#L732
    ResourceNameRestriction The resource name parameter 'domainName' should be defined with a 'pattern' restriction.
    Location: Microsoft.EventGrid/stable/2022-06-15/EventGrid.json#L784
    ResourceNameRestriction The resource name parameter 'domainName' should be defined with a 'pattern' restriction.
    Location: Microsoft.EventGrid/stable/2022-06-15/EventGrid.json#L847
    ResourceNameRestriction The resource name parameter 'domainTopicName' should be defined with a 'pattern' restriction.
    Location: Microsoft.EventGrid/stable/2022-06-15/EventGrid.json#L847
    CreateOperationAsyncResponseValidation An async PUT operation must set long running operation options 'x-ms-long-running-operation-options'
    Location: Microsoft.EventGrid/stable/2022-06-15/EventGrid.json#L905
    DeleteOperationAsyncResponseValidation An async DELETE operation must set long running operation options 'x-ms-long-running-operation-options'
    Location: Microsoft.EventGrid/stable/2022-06-15/EventGrid.json#L963
    LroLocationHeader A 202 response should include an Location response header.
    Location: Microsoft.EventGrid/stable/2022-06-15/EventGrid.json#L1007
    ResourceNameRestriction The resource name parameter 'domainName' should be defined with a 'pattern' restriction.
    Location: Microsoft.EventGrid/stable/2022-06-15/EventGrid.json#L1025
    ResourceNameRestriction The resource name parameter 'topicName' should be defined with a 'pattern' restriction.
    Location: Microsoft.EventGrid/stable/2022-06-15/EventGrid.json#L1086
    ResourceNameRestriction The resource name parameter 'eventSubscriptionName' should be defined with a 'pattern' restriction.
    Location: Microsoft.EventGrid/stable/2022-06-15/EventGrid.json#L1086
    ResourceNameRestriction The resource name parameter 'domainName' should be defined with a 'pattern' restriction.
    Location: Microsoft.EventGrid/stable/2022-06-15/EventGrid.json#L1145
    ResourceNameRestriction The resource name parameter 'eventSubscriptionName' should be defined with a 'pattern' restriction.
    Location: Microsoft.EventGrid/stable/2022-06-15/EventGrid.json#L1145
    ResourceNameRestriction The resource name parameter 'eventSubscriptionName' should be defined with a 'pattern' restriction.
    Location: Microsoft.EventGrid/stable/2022-06-15/EventGrid.json#L1204
    CreateOperationAsyncResponseValidation An async PUT operation must set long running operation options 'x-ms-long-running-operation-options'
    Location: Microsoft.EventGrid/stable/2022-06-15/EventGrid.json#L1283
    DeleteOperationAsyncResponseValidation An async DELETE operation must set long running operation options 'x-ms-long-running-operation-options'
    Location: Microsoft.EventGrid/stable/2022-06-15/EventGrid.json#L1373
    LroLocationHeader A 202 response should include an Location response header.
    Location: Microsoft.EventGrid/stable/2022-06-15/EventGrid.json#L1408
    ️️✔️Avocado succeeded [Detail] [Expand]
    Validation passes for Avocado.
    ️️✔️ApiReadinessCheck succeeded [Detail] [Expand]
    ️⚠️~[Staging] ServiceAPIReadinessTest: 0 Warnings warning [Detail]

    API Test is not triggered due to precheck failure. Check pipeline log for details.

    ️️✔️SwaggerAPIView succeeded [Detail] [Expand]
    ️️✔️CadlAPIView succeeded [Detail] [Expand]
    ️️✔️TypeSpecAPIView succeeded [Detail] [Expand]
    ️❌ModelValidation: 20 Errors, 0 Warnings failed [Detail]
    Rule Message
    LRO_RESPONSE_HEADER Long running operation should return location or azure-AsyncOperation in header but not provided
    Url: Microsoft.EventGrid/stable/2022-06-15/EventGrid.json#L191:22
    ExampleUrl: stable/2022-06-15/examples/Channels_Delete.json
    LRO_RESPONSE_HEADER Long running operation should return location or azure-AsyncOperation in header but not provided
    Url: Microsoft.EventGrid/stable/2022-06-15/EventGrid.json#L544:22
    ExampleUrl: stable/2022-06-15/examples/Domains_Delete.json
    LRO_RESPONSE_HEADER Long running operation should return location or azure-AsyncOperation in header but not provided
    Url: Microsoft.EventGrid/stable/2022-06-15/EventGrid.json#L1003:22
    ExampleUrl: stable/2022-06-15/examples/DomainTopics_Delete.json
    LRO_RESPONSE_HEADER Long running operation should return location or azure-AsyncOperation in header but not provided
    Url: Microsoft.EventGrid/stable/2022-06-15/EventGrid.json#L1404:22
    ExampleUrl: stable/2022-06-15/examples/EventSubscriptions_DeleteForSubscription.json
    LRO_RESPONSE_HEADER Long running operation should return location or azure-AsyncOperation in header but not provided
    Url: Microsoft.EventGrid/stable/2022-06-15/EventGrid.json#L1404:22
    ExampleUrl: stable/2022-06-15/examples/EventSubscriptions_DeleteForResourceGroup.json
    LRO_RESPONSE_HEADER Long running operation should return location or azure-AsyncOperation in header but not provided
    Url: Microsoft.EventGrid/stable/2022-06-15/EventGrid.json#L1404:22
    ExampleUrl: stable/2022-06-15/examples/EventSubscriptions_DeleteForResource.json
    LRO_RESPONSE_HEADER Long running operation should return location or azure-AsyncOperation in header but not provided
    Url: Microsoft.EventGrid/stable/2022-06-15/EventGrid.json#L1404:22
    ExampleUrl: stable/2022-06-15/examples/EventSubscriptions_DeleteForCustomTopic.json
    LRO_RESPONSE_HEADER Long running operation should return location or azure-AsyncOperation in header but not provided
    Url: Microsoft.EventGrid/stable/2022-06-15/EventGrid.json#L1719:22
    ExampleUrl: stable/2022-06-15/examples/DomainTopicEventSubscriptions_Delete.json
    LRO_RESPONSE_HEADER Long running operation should return location or azure-AsyncOperation in header but not provided
    Url: Microsoft.EventGrid/stable/2022-06-15/EventGrid.json#L1990:22
    ExampleUrl: stable/2022-06-15/examples/TopicEventSubscriptions_Delete.json
    LRO_RESPONSE_HEADER Long running operation should return location or azure-AsyncOperation in header but not provided
    Url: Microsoft.EventGrid/stable/2022-06-15/EventGrid.json#L2254:22
    ExampleUrl: stable/2022-06-15/examples/DomainEventSubscriptions_Delete.json
    LRO_RESPONSE_HEADER Long running operation should return location or azure-AsyncOperation in header but not provided
    Url: Microsoft.EventGrid/stable/2022-06-15/EventGrid.json#L2512:22
    ExampleUrl: stable/2022-06-15/examples/SystemTopicEventSubscriptions_Delete.json
    LRO_RESPONSE_HEADER Long running operation should return location or azure-AsyncOperation in header but not provided
    Url: Microsoft.EventGrid/stable/2022-06-15/EventGrid.json#L2955:22
    ExampleUrl: stable/2022-06-15/examples/PartnerTopicEventSubscriptions_Delete.json
    LRO_RESPONSE_HEADER Long running operation should return location or azure-AsyncOperation in header but not provided
    Url: Microsoft.EventGrid/stable/2022-06-15/EventGrid.json#L4561:22
    ExampleUrl: stable/2022-06-15/examples/Topics_Delete.json
    LRO_RESPONSE_HEADER Long running operation should return location or azure-AsyncOperation in header but not provided
    Url: Microsoft.EventGrid/stable/2022-06-15/EventGrid.json#L4843:22
    ExampleUrl: stable/2022-06-15/examples/Topics_RegenerateKey.json
    LRO_RESPONSE_HEADER Long running operation should return location or azure-AsyncOperation in header but not provided
    Url: Microsoft.EventGrid/stable/2022-06-15/EventGrid.json#L4996:22
    ExampleUrl: stable/2022-06-15/examples/PartnerConfigurations_Delete.json
    LRO_RESPONSE_HEADER Long running operation should return location or azure-AsyncOperation in header but not provided
    Url: Microsoft.EventGrid/stable/2022-06-15/EventGrid.json#L5432:22
    ExampleUrl: stable/2022-06-15/examples/PartnerNamespaces_Delete.json
    LRO_RESPONSE_HEADER Long running operation should return location or azure-AsyncOperation in header but not provided
    Url: Microsoft.EventGrid/stable/2022-06-15/EventGrid.json#L5887:22
    ExampleUrl: stable/2022-06-15/examples/PartnerRegistrations_Delete.json
    LRO_RESPONSE_HEADER Long running operation should return location or azure-AsyncOperation in header but not provided
    Url: Microsoft.EventGrid/stable/2022-06-15/EventGrid.json#L6226:22
    ExampleUrl: stable/2022-06-15/examples/PartnerTopics_Delete.json
    LRO_RESPONSE_HEADER Long running operation should return location or azure-AsyncOperation in header but not provided
    Url: Microsoft.EventGrid/stable/2022-06-15/EventGrid.json#L6699:22
    ExampleUrl: stable/2022-06-15/examples/PrivateEndpointConnections_Delete.json
    LRO_RESPONSE_HEADER Long running operation should return location or azure-AsyncOperation in header but not provided
    Url: Microsoft.EventGrid/stable/2022-06-15/EventGrid.json#L7060:22
    ExampleUrl: stable/2022-06-15/examples/SystemTopics_Delete.json
    ️️✔️SemanticValidation succeeded [Detail] [Expand]
    Validation passes for SemanticValidation.
    ️️✔️PoliCheck succeeded [Detail] [Expand]
    Validation passed for PoliCheck.
    ️️✔️PrettierCheck succeeded [Detail] [Expand]
    Validation passes for PrettierCheck.
    ️️✔️SpellCheck succeeded [Detail] [Expand]
    Validation passes for SpellCheck.
    ️️✔️Lint(RPaaS) succeeded [Detail] [Expand]
    Validation passes for Lint(RPaaS).
    ️️✔️CadlValidation succeeded [Detail] [Expand]
    Validation passes for CadlValidation.
    ️️✔️TypeSpec Validation succeeded [Detail] [Expand]
    Validation passes for TypeSpec Validation.
    ️️✔️PR Summary succeeded [Detail] [Expand]
    Validation passes for Summary.
    Posted by Swagger Pipeline | How to fix these errors?

    Swagger Generation Artifacts

    ️️✔️ApiDocPreview succeeded [Detail] [Expand]

    Only 0 items are rendered, please refer to log for more details.

    ️❌SDK Breaking Change Tracking failed [Detail]

    Only 0 items are rendered, please refer to log for more details.

    ️❌ azure-sdk-for-net-track2 failed [Detail]

    Only 0 items are rendered, please refer to log for more details.

    ️⚠️ azure-sdk-for-python-track2 warning [Detail]

    Only 0 items are rendered, please refer to log for more details.

    ️️✔️ azure-sdk-for-java succeeded [Detail] [Expand]

    Only 0 items are rendered, please refer to log for more details.

    ️️✔️ azure-sdk-for-go succeeded [Detail] [Expand]

    Only 0 items are rendered, please refer to log for more details.

    ️️✔️ azure-sdk-for-js succeeded [Detail] [Expand]

    Only 0 items are rendered, please refer to log for more details.

    ️⚠️ azure-resource-manager-schemas warning [Detail]

    Only 0 items are rendered, please refer to log for more details.

    ️️✔️ azure-powershell succeeded [Detail] [Expand]

    Only 0 items are rendered, please refer to log for more details.

    Posted by Swagger Pipeline | How to fix these errors?

    Generated ApiView

    Language Package Name ApiView Link
    Swagger Microsoft.EventGrid Create ApiView failed. Please ensure your github account in Azure/Microsoft is public and add a comment "/azp run" to re-trigger the CI.
    Go sdk/resourcemanager/eventgrid/armeventgrid Create ApiView failed. Please ensure your github account in Azure/Microsoft is public and add a comment "/azp run" to re-trigger the CI.
    Java azure-resourcemanager-eventgrid Create ApiView failed. Please ensure your github account in Azure/Microsoft is public and add a comment "/azp run" to re-trigger the CI.
    JavaScript @azure/arm-eventgrid Create ApiView failed. Please ensure your github account in Azure/Microsoft is public and add a comment "/azp run" to re-trigger the CI.

    Thank you for your contribution stephybun! We will review the pull request and get back to you soon.

    ghost avatar Apr 14 '23 12:04 ghost

    Hi @stephybun, Your PR has some issues. Please fix the CI sequentially by following the order of Avocado, semantic validation, model validation, breaking change, lintDiff. If you have any questions, please post your questions in this channel https://aka.ms/swaggersupport.

    TaskHow to fixPriority
    AvocadoFix-AvocadoHigh
    Semantic validationFix-SemanticValidation-ErrorHigh
    Model validationFix-ModelValidation-ErrorHigh
    LintDiffFix-LintDiffhigh
    If you need further help, please feedback via swagger feedback.

    Hi @stephybun, one or multiple breaking change(s) is detected in your PR. Please check out the breaking change(s), and provide business justification in the PR comment and @ PR assignee why you must have these change(s), and how external customer impact can be mitigated. Please ensure to follow breaking change policy to request breaking change review and approval before proceeding swagger PR review. Action: To initiate an evaluation of the breaking change, create a new intake using the template for breaking changes. Addition details on the process and office hours are on the Breaking change Wiki. If you want to know the production traffic statistic, please see ARM Traffic statistic. If you think it is false positive breaking change, please provide the reasons in the PR comment, report to Swagger Tooling Team via https://aka.ms/swaggerfeedback. Note: To avoid breaking change, you can refer to Shift Left Solution for detecting breaking change in early phase at your service code repository.

    @microsoft-github-policy-service agree company="HashiCorp"

    stephybun avatar Jun 28 '23 06:06 stephybun

    Next Steps to Merge

    Next steps that must be taken to merge this PR:
    • ❌ Your PR has at least one breaking change (label: BreakingChangeReviewRequired). See the PR description for help.
    • ❌ The required check named Swagger ModelValidation has failed. Refer to the check in the PR's 'Checks' tab for details on how to fix it.