Skip to content

switch field type to string to avoid unmarshal errors#8919

Merged
akning-ms merged 1 commit into
Azure:masterfrom
marwanad:hotfix-field-type
Apr 7, 2020
Merged

switch field type to string to avoid unmarshal errors#8919
akning-ms merged 1 commit into
Azure:masterfrom
marwanad:hotfix-field-type

Conversation

@marwanad

@marwanad marwanad commented Apr 2, 2020

Copy link
Copy Markdown
Contributor

Latest improvements:

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

Contribution checklist:

  • I have reviewed the documentation for the workflow.
  • Validation tools were run on swagger spec(s) and have all been fixed in this PR.
  • The OpenAPI Hub was used for checking validation status and next steps.

ARM API Review Checklist

  • Service team MUST add the "WaitForARMFeedback" label if the management plane API changes fall into one of the below categories.
  • adding/removing APIs.
  • adding/removing properties.
  • adding/removing API-version.
  • adding a new service in Azure.

Failure to comply may result in delays for manifest application. Note this does not apply to data plane APIs.

  • If you are blocked on ARM review and want to get the PR merged urgently, please get the ARM oncall for reviews (RP Manifest Approvers team under Azure Resource Manager service) from IcM and reach out to them.
    Please follow the link to find more details on API review process.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@openapi-sdkautomation

openapi-sdkautomation Bot commented Apr 2, 2020

Copy link
Copy Markdown

azure-sdk-for-go - Release

⚠️ warning [Logs] [Expand Details]
  • ⚠️ Generate from 01e3636 with merge commit 63284ad. SDK Automation 13.0.17.20200326.3
  • ⚠️containerservice/mgmt/2017-07-01 [Logs
      No file is changed.
    • ⚠️containerservice/mgmt/2017-08-31 [Logs
        No file is changed.
      • ⚠️containerservice/mgmt/2017-09-30 [Logs
          No file is changed.
        • ⚠️containerservice/mgmt/2018-03-31 [Logs
            No file is changed.
          • ⚠️containerservice/mgmt/2019-02-01 [Logs
              No file is changed.
            • ⚠️containerservice/mgmt/2019-04-30 [Logs
                No file is changed.
              • ⚠️containerservice/mgmt/2019-06-01 [Logs
                  No file is changed.
                • ⚠️containerservice/mgmt/2019-08-01 [Logs
                    No file is changed.
                  • ⚠️containerservice/mgmt/2019-10-01 [Logs
                      No file is changed.
                    • ⚠️containerservice/mgmt/2019-11-01 [Logs
                        No file is changed.
                      • ⚠️containerservice/mgmt/2020-01-01 [Logs
                          No file is changed.
                        • ⚠️containerservice/mgmt/2020-02-01 [Logs
                            No file is changed.
                          • ️✔️containerservice/mgmt/2020-03-01 [Logs]  [Release SDK Changes]
                          • ⚠️preview/containerservice/mgmt/2018-08-01-preview [Logs
                              No file is changed.
                            • ⚠️preview/containerservice/mgmt/2018-09-30-preview [Logs
                                No file is changed.
                              • ⚠️preview/containerservice/mgmt/2019-09-30-preview [Logs
                                  No file is changed.
                                • ⚠️preview/containerservice/mgmt/2019-10-27-preview [Logs
                                    No file is changed.

                                  @openapi-sdkautomation

                                  openapi-sdkautomation Bot commented Apr 2, 2020

                                  Copy link
                                  Copy Markdown

                                  azure-sdk-for-js - Release

                                  ️✔️ succeeded [Logs] [Expand Details]
                                  • ️✔️ Generate from 01e3636 with merge commit 63284ad. SDK Automation 13.0.17.20200326.3
                                  • ️✔️@azure/arm-containerservice [Logs]  [Release SDK Changes]
                                    [npmPack] npm WARN lifecycle @azure/arm-containerservice@11.0.0~prepack: cannot run in wd @azure/arm-containerservice@11.0.0 npm install && npm run build (wd=/z/work/azure-sdk-for-js/sdk/containerservice/arm-containerservice)

                                  @openapi-sdkautomation

                                  openapi-sdkautomation Bot commented Apr 2, 2020

                                  Copy link
                                  Copy Markdown

                                  azure-cli-extensions - Release

                                  No readme.md specification configuration files were found that are associated with the files modified in this pull request, or swagger_to_sdk section in readme.md is not configured

                                  @openapi-sdkautomation

                                  openapi-sdkautomation Bot commented Apr 2, 2020

                                  Copy link
                                  Copy Markdown

                                  azure-sdk-for-python - Release

                                  ️✔️ succeeded [Logs] [Expand Details]
                                  • ️✔️ Generate from 01e3636 with merge commit 63284ad. SDK Automation 13.0.17.20200326.3
                                  • ️✔️azure-mgmt-containerservice [Logs]  [Release SDK Changes]
                                    [after_scripts|python] WARNING:__main__:Found too much API version: {'2019-04-01', '2017-07-01'} in label v2017_07_01
                                    [after_scripts|python] WARNING:__main__:Guessing you want 2017-07-01 based on label v2017_07_01
                                    [build_package] /usr/lib/python3.6/distutils/dist.py:261: UserWarning: Unknown distribution option: 'long_description_content_type'
                                    [build_package]   warnings.warn(msg)
                                    [build_package] /usr/lib/python3.6/distutils/dist.py:261: UserWarning: Unknown distribution option: 'long_description_content_type'
                                    [build_package]   warnings.warn(msg)
                                    [breaking_change_setup] Ignoring mock: markers 'python_version <= "2.7"' don't match your environment
                                    [breaking_change_setup] Cannot uninstall requirement azure-nspkg, not installed
                                    [breaking_change_setup] Command '['/usr/local/bin/python', '-m', 'pip', 'uninstall', '-y', 'azure-nspkg']' returned non-zero exit status 1.
                                    [ChangeLog] Size of delta 0.244% size of original (original: 55753 chars, delta: 136 chars)
                                    [ChangeLog] 

                                  @openapi-sdkautomation

                                  openapi-sdkautomation Bot commented Apr 2, 2020

                                  Copy link
                                  Copy Markdown

                                  azure-sdk-for-net - Release

                                  ️✔️ succeeded [Logs] [Expand Details]

                                  @openapi-sdkautomation

                                  openapi-sdkautomation Bot commented Apr 2, 2020

                                  Copy link
                                  Copy Markdown

                                  azure-sdk-for-java - Release

                                  ️✔️ succeeded [Logs] [Expand Details]

                                  This was referenced Apr 2, 2020
                                  @azuresdkci

                                  Copy link
                                  Copy Markdown
                                  Contributor

                                  Can one of the admins verify this patch?

                                  "type": "object",
                                  "properties": {
                                  "balance-similar-node-groups": {
                                  "type": "boolean"

                                  Copy link
                                  Copy Markdown
                                  Member

                                  Choose a reason for hiding this comment

                                  The reason will be displayed to describe this comment to others. Learn more.

                                  boolean [](start = 23, length = 7)

                                  I discussed this over IM and while this appears to be a breaking change, this property never worked right in the service. As a result, I'm considering this more of a swagger bug fix.

                                  From past API reviews, I recall this was basically a property bag of string properties, so coercing the bool into a string is fine here.

                                  @majastrz majastrz added the ARMSignedOff <valid label in PR review process>add this label when ARM approve updates after review label Apr 2, 2020

                                  @majastrz majastrz left a comment

                                  Copy link
                                  Copy Markdown
                                  Member

                                  Choose a reason for hiding this comment

                                  The reason will be displayed to describe this comment to others. Learn more.

                                  Signed off from ARM side.

                                  @fengzhou-msft

                                  Copy link
                                  Copy Markdown
                                  Member

                                  @NullMDR Please check the above comment about the breaking change and force merge the PR.

                                  @PhoenixHe-NV PhoenixHe-NV added the Approved-BreakingChange DO NOT USE! OBSOLETE label. See https://github.com/Azure/azure-sdk-tools/issues/6374 label Apr 5, 2020
                                  @PhoenixHe-NV

                                  Copy link
                                  Copy Markdown

                                  @akning-ms Please help to merge this PR with breaking change approved

                                  @aristosvo

                                  aristosvo commented Apr 24, 2020

                                  Copy link
                                  Copy Markdown

                                  @marwanad @jluk I don't understand why this is merged and not handled in the backend. The solution is now customer-facing and non-consistent with the other boolean options in the api specs.

                                  Other than that are the other fields of the autoScaleProfile are not typed (duration, int32), but all implemented as strings. Seems like there is some room for improvement for the next release!

                                  @marwanad

                                  Copy link
                                  Copy Markdown
                                  Contributor Author

                                  @aristosvo I agree and apologize for the inconvenience. In hindsight, it would've been better to handle on the backend.

                                  To answer your question about typing, we can't enforce Go's time.Duration in Swagger so the generated SDK would have to resort to string type. The best-case scenario would be a mix of strings with validations (for all the duration ones) and a boolean (for the balance one). Almost all the flags were durations and strings, hence the decision. We will re-evaluate this as we open up more config options.

                                  FYI, you should be able to use v42.0.0 for the SDK which contains the fix to unblock your PR.

                                  Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

                                  Labels

                                  Approved-BreakingChange DO NOT USE! OBSOLETE label. See https://github.com/Azure/azure-sdk-tools/issues/6374 ARMSignedOff <valid label in PR review process>add this label when ARM approve updates after review

                                  Projects

                                  None yet

                                  Development

                                  Successfully merging this pull request may close these issues.

                                  8 participants