Closed dicolanl closed 2 years ago
@dicolanl Would post your swagger link and readme.md?
Hi @dolauli Swaggers are here: https://github.com/Azure/azure-rest-api-specs/tree/Microsoft.SecurityInsights-2021-09-01-preview-rebased/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview
README:
This directory contains the PowerShell module for the SecurityInsights service.
This module was primarily generated via AutoRest using the PowerShell extension.
AutoRest does not generate authentication code for the module. Authentication is handled via Az.Accounts by altering the HTTP payload before it is sent.
For information on how to develop for Az.SecurityInsights
, see how-to.md.
Use of the beta version of autorest.powershell
generator requires the following:
If you want an easy way to install and update Node, NVS - Node Version Switcher or NVM - Node Version Manager is recommended.
npm install -g autorest@autorest
npm install -g pwsh
npm install -g dotnet-sdk-2.2
In this directory, run AutoRest:
autorest
require:
- $(this-folder)/../readme.azure.noprofile.md
# lock the commit
input-file:
- https://github.com/Azure/azure-rest-api-specs/tree/Microsoft.SecurityInsights-2021-09-01-preview-rebased/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/AlertRules.json
- https://github.com/Azure/azure-rest-api-specs/tree/Microsoft.SecurityInsights-2021-09-01-preview-rebased/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/AutomationRules.json
- https://github.com/Azure/azure-rest-api-specs/tree/Microsoft.SecurityInsights-2021-09-01-preview-rebased/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/Bookmarks.json
- https://github.com/Azure/azure-rest-api-specs/tree/Microsoft.SecurityInsights-2021-09-01-preview-rebased/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/Enrichment.json
- https://github.com/Azure/azure-rest-api-specs/tree/Microsoft.SecurityInsights-2021-09-01-preview-rebased/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/Entities.json
- https://github.com/Azure/azure-rest-api-specs/tree/Microsoft.SecurityInsights-2021-09-01-preview-rebased/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/EntityQueries.json
- https://github.com/Azure/azure-rest-api-specs/tree/Microsoft.SecurityInsights-2021-09-01-preview-rebased/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/EntityQueryTemplates.json
- https://github.com/Azure/azure-rest-api-specs/tree/Microsoft.SecurityInsights-2021-09-01-preview-rebased/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/Incidents.json
- https://github.com/Azure/azure-rest-api-specs/tree/Microsoft.SecurityInsights-2021-09-01-preview-rebased/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/Metadata.json
- https://github.com/Azure/azure-rest-api-specs/tree/Microsoft.SecurityInsights-2021-09-01-preview-rebased/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/OfficeConsents.json
- https://github.com/Azure/azure-rest-api-specs/tree/Microsoft.SecurityInsights-2021-09-01-preview-rebased/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/OnboardingStates.json
- https://github.com/Azure/azure-rest-api-specs/tree/Microsoft.SecurityInsights-2021-09-01-preview-rebased/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/Settings.json
- https://github.com/Azure/azure-rest-api-specs/tree/Microsoft.SecurityInsights-2021-09-01-preview-rebased/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/SourceControls.json
- https://github.com/Azure/azure-rest-api-specs/tree/Microsoft.SecurityInsights-2021-09-01-preview-rebased/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/ThreatIntelligence.json
- https://github.com/Azure/azure-rest-api-specs/tree/Microsoft.SecurityInsights-2021-09-01-preview-rebased/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/Watchlists.json
- https://github.com/Azure/azure-rest-api-specs/tree/Microsoft.SecurityInsights-2021-09-01-preview-rebased/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/dataConnectors.json
- https://github.com/Azure/azure-rest-api-specs/tree/Microsoft.SecurityInsights-2021-09-01-preview-rebased/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/operations.json
module-version: 1.2.0
title: SecurityInsights
subject-prefix: $(service-name)
inlining-threshold: 50
directive:
# Remove the unexpanded parameter set
- where:
variant: ^Create$|^CreateViaIdentity$|^CreateViaIdentityExpanded$|^Update$|^UpdateViaIdentity$|^UpdateViaIdentityExpanded$
remove: true
The root cause of this issue is the same as https://github.com/Azure/autorest.powershell/issues/530. So close it. And the work around is to remove the 'x-ms-enum' in https://github.com/Azure/azure-rest-api-specs/blob/Microsoft.SecurityInsights-2021-09-01-preview-rebased/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-09-01-preview/dataConnectors.json#L1997. And by doing that, the property 'status' will be treated as a normal integer. And for how to delete a property from the swagger through directive, you should be able to find some examples in https://raw.githubusercontent.com/Azure/azure-powershell/main/src/Functions/readme.md.
running autorest generates error:
root@499058902a09:/src/SecurityInsights# autorest AutoRest code generation utility [cli version: 3.4.2; node: v14.15.5] (C) 2018 Microsoft Corporation. https://aka.ms/autorest info | Loading AutoRest core '/root/.autorest/@autorestcore@3.6.6/nodemodules/@autorest/core/dist' (3.6.6) info | The default version of @autorest/powershell has been bumped from 2.1+ to 3.0+.
info | Loading AutoRest extension '@autorest/powershell' (~3.0.0->3.0.460) info | Loading AutoRest extension '@autorest/modelerfour' (4.15.414->4.15.414) warning | IgnoredPropertyNextToRef | Semantic violation: Sibling values alongside $ref will be ignored. See https://github.com/Azure/autorest/blob/main/docs/openapi/howto/$ref-siblings.md for allowed values (components > schemas > AlertRuleTemplate > properties > kind) keys: [ 'type' ]