Skip to content

Support double quote in pattern #1110

@YanaXu

Description

@YanaXu

Description

The Swagger API is sqlvm.json.
The relative part in Swagger API is:

"SqlVirtualMachineNameParameter": {
      "name": "sqlVirtualMachineName",
      "in": "path",
      "description": "Name of the SQL virtual machine.",
      "required": true,
      "type": "string",
      "maxLength": 64,
      "minLength": 1,
      "pattern": "^((?!_)[^\\\\/\"'\\[\\]:|<>+=;,?*@&]{1,64}(?<![.-]))$",
      "x-ms-parameter-location": "method"
    }

I configure the README.md as below:

branch: 0e20dd2e4e2a40e83840c30cce2efc4847fd9cb9
require:
# readme.azure.noprofile.md is the common configuration file
  - $(this-folder)/../readme.azure.noprofile.md
  - $(repo)/specification/sqlvirtualmachine/resource-manager/readme.md

try-require: 
  - $(repo)/specification/sqlvirtualmachine/resource-manager/readme.powershell.md

I run autorest and build-module.ps1. There is a bug in generated\api\SqlVirtualMachineManagementClient.cs.

await eventListener.AssertRegEx(nameof(sqlVirtualMachineName),sqlVirtualMachineName,@"^((?!_)[^\\/"'\[\]:|<>+=;,?*@&]{1,64}(?<![.-]))$");

The correct pattern value should be with 2 double quotes.

@"^((?!_)[^\\/""'\[\]:|<>+=;,?*@&]{1,64}(?<![.-]))$"

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugv4Need to be done in autorest.powershell V4

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions