autorest icon indicating copy to clipboard operation
autorest copied to clipboard

[Potential Bug] Are api-version pattern case-sensitive?

Open vishrutshah opened this issue 9 years ago • 8 comments

Linter Rule APIVersionPattern

Reported by @brjohnstmsft Issue: M3012: "API Version must be in the format: yyyy-MM-dd, optionally followed by -preview, -alpha, -beta, -rc, -privatepreview." Our preview versions have ended in -Preview (with a capital P) for almost four years now, and I'm sure our service is not the only Azure service to do so. IMO this rule has a bug. PR: https://github.com/Azure/azure-rest-api-specs-pr/pull/47

@ravbhatnagar : Can you please verify wether this requirement is case-sensitive or not?

cc: @veronicagg

vishrutshah avatar Mar 25 '17 19:03 vishrutshah

For newer APIversions, we should enforce this. So PrivatePreview should be flagged as violation. Existing one is ok.

ravbhatnagar avatar Mar 27 '17 17:03 ravbhatnagar

Being said that "Existing one is ok", I'd consider that the rule is accurate and we should keep continue to report this violation as RPCViolation under Error severity and now when we define suppression we should add them for existing services. Is my interpretation right?

vishrutshah avatar Mar 28 '17 04:03 vishrutshah

@vishrutshah Who defines these suppressions? Can service teams define them?

bitsforthought avatar Mar 28 '17 23:03 bitsforthought

@brjohnstmsft We are still working towards that feature of suppression we'll keep you posted on how & when we'll have them ready for service teams.

As of today, it's not Incorporated yet.

vishrutshah avatar Mar 29 '17 02:03 vishrutshah

@vishrutshah is this a non-issue? should we close it?

veronicagg avatar Apr 18 '17 17:04 veronicagg

@veronicagg As per @ravbhatnagar the rule only is applicable to the newer RPs not existing RPs so we need to take care for these cases using suppression. We should close this one or move to the category somewhere we are collecting the buckets of rules would fall on either new RPs v/s old RPs.

vishrutshah avatar Apr 18 '17 17:04 vishrutshah

@vishrutshah @veronicagg - Yes, we can continue flagging it for existing RPs too and ask them to fix. If there is a case that RP cant fix it in the next API version, we can add a suppression.

ravbhatnagar avatar Apr 18 '17 17:04 ravbhatnagar

thanks, closing this issue then.

veronicagg avatar Apr 18 '17 20:04 veronicagg