Azure / Azure/autorest.powershell

[Discussion] directive has ambiguous syntax

Open
#1,236 2 comments 0 reactions 1 assignee Claimed by @VeryEarly View on GitHub
discussion
Dominant language
C#
Stars
123
Forks
99
PR merge metrics
No merged PRs in 30d

Description

for where statement, following have ambiguous syntax
```
const subjectRegex = getPatternToMatch(directive.where.subject);
const subjectPrefixRegex = getPatternToMatch(directive.where['subject-prefix']);
const verbRegex = getPatternToMatch(directive.where.verb);
const variantRegex = getPatternToMatch(directive.where.variant);
const parameterRegex = getPatternToMatch(directive.where['parameter-name']);
const enumNameRegex = getPatternToMatch(directive.where['enum-name']);
const enumValueNameRegex = getPatternToMatch(directive.where['enum-value-name']);
const modelNameRegex = getPatternToMatch(directive.where['model-name']);
const modelFullNameRegex = getPatternToMatch(directive.where['model-fullname']);
const modelNamespaceRegex = getPatternToMatch(directive.where['model-namespace']);
const propertyNameRegex = getPatternToMatch(directive.where['property-name']);
```
the method "getPatternToMatch" treat "pattern" as /^pattern$/ and "pattern.*" as /pattern.*/
for a regex, /pattern/ has different meaning from /^pattern$/, autorest.powershell should not make such assumption.

We should treat all input as regex.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.