Azure / Azure/azure-openapi-validator
OperationId naming rules are not applied
- Dominant language
- TypeScript
- Stars
- 53
- Forks
- 57
- Avg merge
- 1d 23h
- Merged PRs (30d)
- 2
Description
From [this](https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FAzure%2Fazure-rest-api-specs%2Fpull%2F3691&data=02%7C01%7C%7C09305b1fda8c46ce4ec708d6087ca706%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636705728796189139&sdata=uNXID5Hes6I4Mnh1ELaWOJzg1wQ%2FUNwWJUCCFtaWEOg%3D&reserved=0) PR, it looks like the operationId naming rules (operation ids must be of the form *_Create/*_Get/*_Delete) are not being applied as expected.
Needs a fix in the regexes as @veronicagg found out, copying over from offline thread:
return IsOperationIdValid(entity) && (PUT_NOUN_VERB_PATTERN.IsMatch(entity) || PUT_VERB_PATTERN.IsMatch(entity)); [here](https://github.com/Azure/azure-openapi-validator/blob/42ae8eedab0a3894443966e4513fd28ae5aa77d8/src/dotnet/OpenAPI.Validator/Validation/PutInOperationName.cs)
and the last piece matches, when PUT_VERB_PATTERN = ^(Create) the first part of the string matches “Create_AttestationService”.
If we only want to allow “Create” as operation id, which may have been the intent (honestly, I can’t remember), we would need to say that no other characters are allowed after “Create”.
Contributor guide
Assessment
This issue has not been assessed yet.