Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add "required" flag for mandatory properties #19550

Closed

Conversation

arpit-gagneja
Copy link
Contributor

MSFT employees can try out our new experience at OpenAPI Hub - one location for using our validation tools and finding your workflow.

Changelog

Add a changelog entry for this PR by answering the following questions:

  1. What's the purpose of the update?
    • new service onboarding
    • new API version
    • update existing version for new feature
    • update existing version to fix swagger quality issue in s360
    • Other, please clarify: fix swagger issues so that generated powershell cmdlets by autorest mandates the required parameters.
  2. When are you targeting to deploy the new service/feature to public regions? Please provide the date or, if the date is not yet available, the month. No change in service is required.
  3. When do you expect to publish the swagger? Please provide date or, the the date is not yet available, the month. The swagger is already published. This PR is to fix the existing swagger
  4. If updating an existing version, please select the specific language SDKs and CLIs that must be refreshed after the swagger is published.
    • SDK of .NET (need service team to ensure code readiness)
    • SDK of Python
    • SDK of Java
    • SDK of Js
    • SDK of Go
    • PowerShell
    • CLI
    • Terraform
    • No refresh required for updates in this PR

Contribution checklist:

If any further question about AME onboarding or validation tools, please view the FAQ.

ARM API Review Checklist

Applicability: ⚠️

If your changes encompass only the following scenarios, you should SKIP this section, as these scenarios do not require ARM review.

  • Change to data plane APIs
  • Adding new properties
  • All removals

Otherwise your PR may be subject to ARM review requirements. Complete the following:

  • Check this box if any of the following appy to the PR so that the label "ARMReview" and "WaitForARMFeedback" will be added by bot to kick off ARM API Review. Missing to check this box in the following scenario may result in delays to the ARM manifest review and deployment.

    • Adding a new service
    • Adding new API(s)
    • Adding a new API version
      -[ ] To review changes efficiently, ensure you are using OpenAPIHub to initialize the PR for adding a new version. More details, refer to the wiki.
  • Ensure you've reviewed following guidelines including ARM resource provider contract and REST guidelines. Estimated time (4 hours). This is required before you can request review from ARM API Review board.

  • If you are blocked on ARM review and want to get the PR merged with urgency, please get the ARM oncall for reviews (RP Manifest Approvers team under Azure Resource Manager service) from IcM and reach out to them.

Breaking Change Review Checklist

If any of the following scenarios apply to the PR, request approval from the Breaking Change Review Board as defined in the Breaking Change Policy.

  • Removing API(s) in a stable version
  • Removing properties in a stable version
  • Removing API version(s) in a stable version
  • Updating API in a stable or public preview version with Breaking Change Validation errors
  • Updating API(s) in public preview over 1 year (refer to Retirement of Previews)

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.

Please follow the link to find more details on PR review process.

@openapi-pipeline-app
Copy link

openapi-pipeline-app bot commented Jun 21, 2022

Swagger Validation Report

️❌BreakingChange: 64 Errors, 0 Warnings failed [Detail]

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

Rule Message
1034 - AddedRequiredProperty The new version has new required property 'id' that was not found in the old version.
New: Microsoft.Network/preview/2020-04-01-preview/dnsresolver.json#L1797:9
Old: Microsoft.Network/preview/2020-04-01-preview/dnsresolver.json#L1797:9
1034 - AddedRequiredProperty The new version has new required property 'properties' that was not found in the old version.
New: Microsoft.Network/preview/2020-04-01-preview/dnsresolver.json#L51:13
Old: Microsoft.Network/preview/2020-04-01-preview/dnsresolver.json#L51:13
1034 - AddedRequiredProperty The new version has new required property 'properties' that was not found in the old version.
New: Microsoft.Network/preview/2020-04-01-preview/dnsresolver.json#L75:13
Old: Microsoft.Network/preview/2020-04-01-preview/dnsresolver.json#L75:13
1034 - AddedRequiredProperty The new version has new required property 'properties' that was not found in the old version.
New: Microsoft.Network/preview/2020-04-01-preview/dnsresolver.json#L69:13
Old: Microsoft.Network/preview/2020-04-01-preview/dnsresolver.json#L69:13
1034 - AddedRequiredProperty The new version has new required property 'properties' that was not found in the old version.
New: Microsoft.Network/preview/2020-04-01-preview/dnsresolver.json#L131:13
Old: Microsoft.Network/preview/2020-04-01-preview/dnsresolver.json#L131:13
1034 - AddedRequiredProperty The new version has new required property 'properties' that was not found in the old version.
New: Microsoft.Network/preview/2020-04-01-preview/dnsresolver.json#L222:13
Old: Microsoft.Network/preview/2020-04-01-preview/dnsresolver.json#L222:13
1034 - AddedRequiredProperty The new version has new required property 'properties' that was not found in the old version.
New: Microsoft.Network/preview/2020-04-01-preview/dnsresolver.json#L1884:11
Old: Microsoft.Network/preview/2020-04-01-preview/dnsresolver.json#L1881:11
1034 - AddedRequiredProperty The new version has new required property 'id' that was not found in the old version.
New: Microsoft.Network/preview/2020-04-01-preview/dnsresolver.json#L2414:9
Old: Microsoft.Network/preview/2020-04-01-preview/dnsresolver.json#L2374:9
1034 - AddedRequiredProperty The new version has new required property 'subnet' that was not found in the old version.
New: Microsoft.Network/preview/2020-04-01-preview/dnsresolver.json#L1905:11
Old: Microsoft.Network/preview/2020-04-01-preview/dnsresolver.json#L1899:11
1034 - AddedRequiredProperty The new version has new required property 'ipConfigurations' that was not found in the old version.
New: Microsoft.Network/preview/2020-04-01-preview/dnsresolver.json#L1934:9
Old: Microsoft.Network/preview/2020-04-01-preview/dnsresolver.json#L1925:9
1034 - AddedRequiredProperty The new version has new required property 'properties' that was not found in the old version.
New: Microsoft.Network/preview/2020-04-01-preview/dnsresolver.json#L351:13
Old: Microsoft.Network/preview/2020-04-01-preview/dnsresolver.json#L351:13
1034 - AddedRequiredProperty The new version has new required property 'properties' that was not found in the old version.
New: Microsoft.Network/preview/2020-04-01-preview/dnsresolver.json#L375:13
Old: Microsoft.Network/preview/2020-04-01-preview/dnsresolver.json#L375:13
1034 - AddedRequiredProperty The new version has new required property 'properties' that was not found in the old version.
New: Microsoft.Network/preview/2020-04-01-preview/dnsresolver.json#L369:13
Old: Microsoft.Network/preview/2020-04-01-preview/dnsresolver.json#L369:13
1034 - AddedRequiredProperty The new version has new required property 'properties' that was not found in the old version.
New: Microsoft.Network/preview/2020-04-01-preview/dnsresolver.json#L434:13
Old: Microsoft.Network/preview/2020-04-01-preview/dnsresolver.json#L434:13
1034 - AddedRequiredProperty The new version has new required property 'properties' that was not found in the old version.
New: Microsoft.Network/preview/2020-04-01-preview/dnsresolver.json#L531:13
Old: Microsoft.Network/preview/2020-04-01-preview/dnsresolver.json#L531:13
1034 - AddedRequiredProperty The new version has new required property 'properties' that was not found in the old version.
New: Microsoft.Network/preview/2020-04-01-preview/dnsresolver.json#L1976:11
Old: Microsoft.Network/preview/2020-04-01-preview/dnsresolver.json#L1967:11
1034 - AddedRequiredProperty The new version has new required property 'id' that was not found in the old version.
New: Microsoft.Network/preview/2020-04-01-preview/dnsresolver.json#L1994:9
Old: Microsoft.Network/preview/2020-04-01-preview/dnsresolver.json#L1982:9
1034 - AddedRequiredProperty The new version has new required property 'subnet' that was not found in the old version.
New: Microsoft.Network/preview/2020-04-01-preview/dnsresolver.json#L2022:9
Old: Microsoft.Network/preview/2020-04-01-preview/dnsresolver.json#L2007:9
1034 - AddedRequiredProperty The new version has new required property 'properties' that was not found in the old version.
New: Microsoft.Network/preview/2020-04-01-preview/dnsresolver.json#L621:13
Old: Microsoft.Network/preview/2020-04-01-preview/dnsresolver.json#L621:13
1034 - AddedRequiredProperty The new version has new required property 'properties' that was not found in the old version.
New: Microsoft.Network/preview/2020-04-01-preview/dnsresolver.json#L645:13
Old: Microsoft.Network/preview/2020-04-01-preview/dnsresolver.json#L645:13
1034 - AddedRequiredProperty The new version has new required property 'properties' that was not found in the old version.
New: Microsoft.Network/preview/2020-04-01-preview/dnsresolver.json#L639:13
Old: Microsoft.Network/preview/2020-04-01-preview/dnsresolver.json#L639:13
1034 - AddedRequiredProperty The new version has new required property 'properties' that was not found in the old version.
New: Microsoft.Network/preview/2020-04-01-preview/dnsresolver.json#L704:13
Old: Microsoft.Network/preview/2020-04-01-preview/dnsresolver.json#L704:13
1034 - AddedRequiredProperty The new version has new required property 'properties' that was not found in the old version.
New: Microsoft.Network/preview/2020-04-01-preview/dnsresolver.json#L801:13
Old: Microsoft.Network/preview/2020-04-01-preview/dnsresolver.json#L801:13
1034 - AddedRequiredProperty The new version has new required property 'properties' that was not found in the old version.
New: Microsoft.Network/preview/2020-04-01-preview/dnsresolver.json#L2064:11
Old: Microsoft.Network/preview/2020-04-01-preview/dnsresolver.json#L2049:11
1034 - AddedRequiredProperty The new version has new required property 'id' that was not found in the old version.
New: Microsoft.Network/preview/2020-04-01-preview/dnsresolver.json#L2085:11
Old: Microsoft.Network/preview/2020-04-01-preview/dnsresolver.json#L2067:11
1034 - AddedRequiredProperty The new version has new required property 'dnsResolverOutboundEndpoints' that was not found in the old version.
New: Microsoft.Network/preview/2020-04-01-preview/dnsresolver.json#L2113:9
Old: Microsoft.Network/preview/2020-04-01-preview/dnsresolver.json#L2092:9
1034 - AddedRequiredProperty The new version has new required property 'properties' that was not found in the old version.
New: Microsoft.Network/preview/2020-04-01-preview/dnsresolver.json#L888:13
Old: Microsoft.Network/preview/2020-04-01-preview/dnsresolver.json#L888:13
1034 - AddedRequiredProperty The new version has new required property 'properties' that was not found in the old version.
New: Microsoft.Network/preview/2020-04-01-preview/dnsresolver.json#L912:13
Old: Microsoft.Network/preview/2020-04-01-preview/dnsresolver.json#L912:13
1034 - AddedRequiredProperty The new version has new required property 'properties' that was not found in the old version.
New: Microsoft.Network/preview/2020-04-01-preview/dnsresolver.json#L906:13
Old: Microsoft.Network/preview/2020-04-01-preview/dnsresolver.json#L906:13
1034 - AddedRequiredProperty The new version has new required property 'properties' that was not found in the old version.
New: Microsoft.Network/preview/2020-04-01-preview/dnsresolver.json#L968:13
Old: Microsoft.Network/preview/2020-04-01-preview/dnsresolver.json#L968:13
️️✔️Breaking Change(Cross-Version) succeeded [Detail] [Expand]
There are no breaking changes.
️️✔️CredScan succeeded [Detail] [Expand]
There is no credential detected.
️️✔️LintDiff succeeded [Detail] [Expand]
Validation passes for LintDiff.

️️✔️Avocado succeeded [Detail] [Expand]
Validation passes for Avocado.
️️✔️ApiReadinessCheck succeeded [Detail] [Expand]
️️✔️ModelValidation succeeded [Detail] [Expand]
Validation passes for ModelValidation.
️️✔️SemanticValidation succeeded [Detail] [Expand]
Validation passes for SemanticValidation.
️️✔️PoliCheck succeeded [Detail] [Expand]
Validation passed for PoliCheck.
️⚠️SDK Track2 Validation: 0 Warnings warning [Detail]
The following errors/warnings are introduced by current PR:

|:speech_balloon: |"readme":"dnsresolver/resource-manager/readme.md",
"tag":"package-2020-04-preview",
"details":"> Installing AutoRest extension '@microsoft.azure/openapi-validator' (1.11.0 -> 1.11.0)"|
|:speech_balloon: |"readme":"dnsresolver/resource-manager/readme.md",
"tag":"package-2020-04-preview",
"details":"> Installed AutoRest extension '@microsoft.azure/openapi-validator' (1.11.0->1.11.0)"|
|:speech_balloon: |"readme":"dnsresolver/resource-manager/readme.md",
"tag":"package-2020-04-preview",
"details":"> Installing AutoRest extension '@autorest/modelerfour' (4.21.4 -> 4.21.4)"|
|:speech_balloon: |"readme":"dnsresolver/resource-manager/readme.md",
"tag":"package-2020-04-preview",
"details":"> Installed AutoRest extension '@autorest/modelerfour' (4.21.4->4.21.4)"|
|:speech_balloon: |"readme":"dnsresolver/resource-manager/readme.md",
"tag":"package-2020-04-preview",
"details":"Autorest completed in 10.42s. 0 files generated."|


The following errors/warnings exist before current PR submission:

Rule Message
⚠️ DeprecatedConfig "readme":"dnsresolver/resource-manager/readme.md",
"tag":"package-2020-04-preview",
"details":"Using directive.0.suppress which is deprecated and will be removed in the future."
⚠️ DeprecatedConfig "readme":"dnsresolver/resource-manager/readme.md",
"tag":"package-2020-04-preview",
"details":"Using directive.1.suppress which is deprecated and will be removed in the future."
⚠️ DeprecatedConfig "readme":"dnsresolver/resource-manager/readme.md",
"tag":"package-2020-04-preview",
"details":"Using directive.2.suppress which is deprecated and will be removed in the future."
⚠️ DeprecatedConfig "readme":"dnsresolver/resource-manager/readme.md",
"tag":"package-2020-04-preview",
"details":"Using directive.3.suppress which is deprecated and will be removed in the future."
⚠️ DeprecatedConfig "readme":"dnsresolver/resource-manager/readme.md",
"tag":"package-2020-04-preview",
"details":"Using directive.4.suppress which is deprecated and will be removed in the future."
💬 "readme":"dnsresolver/resource-manager/readme.md",
"tag":"package-2020-04-preview",
"details":"AutoRest core version selected from configuration: ^3.2.0."
️❌PrettierCheck: 1 Errors, 0 Warnings failed [Detail]
Rule Message
HowToFix Code style issues found
path: Microsoft.Network/preview/2020-04-01-preview/dnsresolver.json
️️✔️SpellCheck succeeded [Detail] [Expand]
Validation passes for SpellCheck.
️️✔️Lint(RPaaS) succeeded [Detail] [Expand]
Validation passes for Lint(RPaaS).
Posted by Swagger Pipeline | How to fix these errors?

@openapi-workflow-bot
Copy link

Hi, @arpit-gagneja 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]

    @openapi-pipeline-app
    Copy link

    openapi-pipeline-app bot commented Jun 21, 2022

    Swagger Generation Artifacts

    ️️✔️ApiDocPreview succeeded [Detail] [Expand]
     Please click here to preview with your @microsoft account. 
    ️❌SDK Breaking Change Tracking failed [Detail]

    Breaking Changes Tracking

    ️✔️azure-sdk-for-go - armdnsresolver - 0.5.0
    azure-sdk-for-python-track2 - track2_azure-mgmt-dnsresolver - 1.0.0b1
    +	Parameter dns_resolver_outbound_endpoints of model DnsForwardingRuleset is now required
    +	Parameter domain_name of model ForwardingRule is now required
    +	Parameter id of model SubResource is now required
    +	Parameter ip_address of model TargetDnsServer is now required
    +	Parameter ip_configurations of model InboundEndpoint is now required
    +	Parameter subnet of model IpConfiguration is now required
    +	Parameter subnet of model OutboundEndpoint is now required
    +	Parameter target_dns_servers of model ForwardingRule is now required
    +	Parameter virtual_network of model DnsResolver is now required
    +	Parameter virtual_network of model VirtualNetworkLink is now required
    ️🔄 azure-sdk-for-net-track2 inProgress [Detail]
    ️⚠️ azure-sdk-for-python-track2 warning [Detail]
    • ⚠️Warning [Logs] Generate from 166f3ac28f40a67476f3516fbab104e663a23b5f. SDK Automation 14.0.0
      command	sh scripts/automation_init.sh ../azure-sdk-for-python_tmp/initInput.json ../azure-sdk-for-python_tmp/initOutput.json
      cmderr	[automation_init.sh] WARNING: Skipping azure-nspkg as it is not installed.
      command	sh scripts/automation_generate.sh ../azure-sdk-for-python_tmp/generateInput.json ../azure-sdk-for-python_tmp/generateOutput.json
      cmderr	[automation_generate.sh] WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.
    • ️✔️track2_azure-mgmt-dnsresolver [View full logs]  [Preview SDK Changes] Breaking Change Detected
      info	[Changelog] **Features**
      info	[Changelog]
      info	[Changelog]   - Model DnsForwardingRulesetPatch has a new parameter dns_resolver_outbound_endpoints
      info	[Changelog]
      info	[Changelog] **Breaking changes**
      info	[Changelog]
      info	[Changelog]   - Parameter dns_resolver_outbound_endpoints of model DnsForwardingRuleset is now required
      info	[Changelog]   - Parameter domain_name of model ForwardingRule is now required
      info	[Changelog]   - Parameter id of model SubResource is now required
      info	[Changelog]   - Parameter ip_address of model TargetDnsServer is now required
      info	[Changelog]   - Parameter ip_configurations of model InboundEndpoint is now required
      info	[Changelog]   - Parameter subnet of model IpConfiguration is now required
      info	[Changelog]   - Parameter subnet of model OutboundEndpoint is now required
      info	[Changelog]   - Parameter target_dns_servers of model ForwardingRule is now required
      info	[Changelog]   - Parameter virtual_network of model DnsResolver is now required
      info	[Changelog]   - Parameter virtual_network of model VirtualNetworkLink is now required
    ️️✔️ azure-sdk-for-go succeeded [Detail] [Expand]
    • ️✔️Succeeded [Logs] Generate from 166f3ac28f40a67476f3516fbab104e663a23b5f. SDK Automation 14.0.0
      command	sh ./eng/scripts/automation_init.sh ../../../../../azure-sdk-for-go_tmp/initInput.json ../../../../../azure-sdk-for-go_tmp/initOutput.json
      command	generator automation-v2 ../../../../../azure-sdk-for-go_tmp/generateInput.json ../../../../../azure-sdk-for-go_tmp/generateOutput.json
    • ️✔️armdnsresolver [View full logs]  [Preview SDK Changes]
      info	[Changelog] ### Features Added
      info	[Changelog]
      info	[Changelog] - New field `DNSResolverOutboundEndpoints` in struct `DNSForwardingRulesetPatch`
      info	[Changelog]
      info	[Changelog] Total 0 breaking change(s), 1 additive change(s).
    ️️✔️ azure-powershell succeeded [Detail] [Expand]
    • ️✔️Succeeded [Logs] Generate from 166f3ac28f40a67476f3516fbab104e663a23b5f. SDK Automation 14.0.0
      command	sh ./tools/SwaggerCI/init.sh ../azure-powershell_tmp/initInput.json ../azure-powershell_tmp/initOutput.json
      command	pwsh ./tools/SwaggerCI/psci.ps1 ../azure-powershell_tmp/generateInput.json ../azure-powershell_tmp/generateOutput.json
    • ️✔️Az.DnsResolver [View full logs]  [Preview SDK Changes]
    Posted by Swagger Pipeline | How to fix these errors?

    @openapi-workflow-bot
    Copy link

    Hi @arpit-gagneja, 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.

    @openapi-workflow-bot
    Copy link

    NewApiVersionRequired reason:

    A service’s API is a contract with customers and is represented by using the api-version query parameter. Changes such as adding an optional property to a request/response or introducing a new operation is a change to the service’s contract and therefore requires a new api-version value. This is critically important for documentation, client libraries, and customer support.

    EXAMPLE: if a customer calls a service in the public cloud using api-version=2020-07-27, the new property or operation may exist but if they call the service in a government cloud, air-gapped cloud, or Azure Stack Hub cloud using the same api-version, the property or operation may not exist. Because there is no clear relationship between the service api-version and the new property/operation, customers can’t trust the documentation and Azure customer have difficulty helping customers diagnose issues. In addition, each client library version documents the service version it supports. When an optional property or new operation is added to a service and its Swagger, new client libraries must be produced to expose this functionality to customers. Without updating the api-version, it is unclear to customers which version of a client library supports these new features.

    @arpit-gagneja
    Copy link
    Contributor Author

    Closing this PR because I need to introduce new stable version for GA. (#19553)

    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    None yet
    Projects
    None yet
    Development

    Successfully merging this pull request may close these issues.

    3 participants