Repository: Redocly/redocly-cli (ts)

Issue:
Change four types names for consistency
## Issue

Type name consistency is important because custom plugins and assertions use type names to target logical evaluations.

I noticed some type names that feel inconsistent with OAS compared to how we name other types.

Samples that seemed consistent (✅ ) and inconsistent (⚠️ ).

- Info Object and we name our type `Info`. :white_check_mark:
- Schema Object and we name our type `Schema`. :white_check_mark:
- Parameter Object and we name our type `Parameter`. :white_check_mark:  etc...
- Paths Object and we name our type `PathsMap`. :warning:
- Responses Object and we name our type `ResponsesMap`. :warning:
- OAuth2 Flows Object and we name our type `SecuritySchemeFlows`. :warning:


## Solution

Rename the following from `X` to `Y`:

- [ ] `PathsMap` to `Paths` (because there is a `Paths Object` explicitly defined in OAS)
- [ ] `ResponsesMap` to `Responses` (because there is a `Responses Object` explicitly defined in OAS)
- [ ] `SecuritySchemeFlows` to `OAuth2Flows`
- [ ] `EncodingsMap` to `EncodingMap` (because there is no word "encodings" in English)

We leave these alone because they aren't defined as objects in OAS:
- `ServerVariablesMap`
- `WebhooksMap`
- `MediaTypesMap`
- `CallbacksMap`
- `HeadersMap`
- `LinksMap`
- `ExamplesMap`

**Background**
I hand-wrote out the types on note cards as part of an exercise called ["The Suck"](https://scottscheper.com/letter/40/). It wasn't fun, but because writing is so slow it gives you time to think about what you're writing at deeper than usual levels. I was also writing out excerpts of the OAS and this resulted in identifying the inconsistency in naming which led to this issue.

Pull request description:
refactor: rename four types
Changed **types**:

- `PathsMap` to `Paths`
- `ResponsesMap` to `Responses`
- `EncodingsMap` to `EncodingMap`
- `SecuritySchemeFlows` to `OAuth2Flows`

## Reference

Closes #900 

## Testing

No code changes (only type names) -- existing tests should pass.

## Check yourself

- [x] Code is linted
- [ ] Tested with redoc/reference-docs/workflows
- [x] All new/updated code is covered with tests

## Security

- [x] Security impact of change has been considered
- [x] Code follows company security practices and guidelines


Patch:
diff --git a/docs/guides/change-token-url.md b/docs/guides/change-token-url.md
index dea0b51e..111a4701 100644
--- a/docs/guides/change-token-url.md
+++ b/docs/guides/change-token-url.md
@@ -47,7 +47,7 @@ Estimated time: 20 minutes
     /** @type {import('@redocly/cli').OasDecorator} */
     function ChangeTokenUrl() {
       return {
-        SecuritySchemeFlows: {
+        OAuth2Flows: {
           leave(flows, ctx) {
             if ('TOKEN_URL' in process.env && flows?.clientCredentials) {
               flows.clientCredentials.tokenUrl = process.env.TOKEN_URL;
diff --git a/docs/rules/assertions.md b/docs/rules/assertions.md
index 902b2b8d..4f925d5b 100644
--- a/docs/rules/assertions.md
+++ b/docs/rules/assertions.md
@@ -355,7 +355,7 @@ The following example asserts that when `PUT` requests have either `200` or `201
 ```yaml Response example
 rules:
   assert/put-200-and-201:
-    subject: ResponsesMap
+    subject: Responses
     context:
       - type: Operation
         matchParentKeys:
@@ -375,7 +375,7 @@ The difference between `mutuallyRequired` is that neither `200` and `201` need t
 ```yaml Response example
 rules:
   assert/put-200-and-201:
-    subject: ResponsesMap
+    subject: Responses
     context:
       - type: Operation
         matchParentKeys:
@@ -540,7 +540,7 @@ List of types for OpenAPI 3.0 and 3.1:
 - Info
 - Contact
 - License
-- PathsMap
+- Paths
 - PathItem
 - Parameter
 - Operation
@@ -551,7 +551,7 @@ List of types for OpenAPI 3.0 and 3.1:
 - Example
 - Encoding
 - Header
-- ResponsesMap
+- Responses
 - Response
 - Link
 - Schema
@@ -573,7 +573,7 @@ List of types for OpenAPI 3.0 and 3.1:
 - PasswordFlow
 - ClientCredentials
 - AuthorizationCode
-- SecuritySchemeFlows
+- OAuth2Flows
 - SecurityScheme
 - XCodeSample
 - WebhooksMap
diff --git a/docs/rules/boolean-parameter-prefixes.md b/docs/rules/boolean-parameter-prefixes.md
index 9566175e..354c0f7e 100644
--- a/docs/rules/boolean-parameter-prefixes.md
+++ b/docs/rules/boolean-parameter-prefixes.md
@@ -13,7 +13,7 @@ When this rule is enabled, the `name` fields of all `boolean` parameters in your
 ```mermaid
 flowchart TD
 
-root ==> PathsMap --> PathItem --> Operation --> Parameter --enforces names for boolean types--> Schema
+root ==> Paths --> PathItem --> Operation --> Parameter --enforces names for boolean types--> Schema
 PathItem --> Parameter
 NamedParameter --> Parameter
 
diff --git a/docs/rules/no-ambiguous-paths.md b/docs/rules/no-ambiguous-paths.md
index 05dac67a..e2780cea 100644
--- a/docs/rules/no-ambiguous-paths.md
+++ b/docs/rules/no-ambiguous-paths.md
@@ -24,11 +24,11 @@ According to the OpenAPI specification:
 ```mermaid
 flowchart TD
 
-root ==> PathsMap
+root ==> Paths
 
 root ==> components
 
-style PathsMap fill:#codaf9,stroke:#0044d4,stroke-width:5px
+style Paths fill:#codaf9,stroke:#0044d4,stroke-width:5px
 ```
 
 ## API design principles
diff --git a/docs/rules/no-enum-type-mismatch.md b/docs/rules/no-enum-type-mismatch.md
index 3a14bee2..dd4f6e51 100644
--- a/docs/rules/no-enum-type-mismatch.md
+++ b/docs/rules/no-enum-type-mismatch.md
@@ -12,11 +12,11 @@ Requires that the contents of every `enum` value in your API definition conform
 ```mermaid
 flowchart TD
 
-Root ==> PathsMap --> PathItem --> Operation --> Parameter --> Schema
+Root ==> Paths --> PathItem --> Operation --> Parameter --> Schema
 PathItem --> Parameter
 NamedParameter --> Parameter
 Operation --> RequestBody --> MediaType --> Schema
-Operation --> ResponsesMap --> MediaType
+Operation --> Responses --> MediaType
 NamedSchema --> Schema
 Root ==> components
 
diff --git a/docs/rules/no-example-value-and-externalValue.md b/docs/rules/no-example-value-and-externalValue.md
index d0e1ef06..538be763 100644
--- a/docs/rules/no-example-value-and-externalValue.md
+++ b/docs/rules/no-example-value-and-externalValue.md
@@ -11,10 +11,10 @@ Ensures that `examples` object properties `externalValue` and `value` are mutual
 ```mermaid
 flowchart TD
 
-Root ==> PathsMap --> PathItem --> Operation --> Parameter --> MediaType
+Root ==> Paths --> PathItem --> Operation --> Parameter --> MediaType
 PathItem --> Parameter
 Operation --> RequestBody --> MediaType --> Example
-Operation --> ResponsesMap --> MediaType
+Operation --> Responses --> MediaType
 NamedExample --> Example
 Root ==> components
 
diff --git a/docs/rules/no-http-verbs-in-paths.md b/docs/rules/no-http-verbs-in-paths.md
index a9860a2c..f96854ff 100644
--- a/docs/rules/no-http-verbs-in-paths.md
+++ b/docs/rules/no-http-verbs-in-paths.md
@@ -12,8 +12,8 @@ Disallows HTTP verbs used in paths.
 ```mermaid
 flowchart TD
 
-Root ==> PathsMap
-style PathsMap fill:#codaf9,stroke:#0044d4,stroke-width:5px
+Root ==> Paths
+style Paths fill:#codaf9,stroke:#0044d4,stroke-width:5px
 ```
 
 List of HTTP verbs:
diff --git a/docs/rules/no-identical-paths.md b/docs/rules/no-identical-paths.md
index e70871cd..0cef38e5 100644
--- a/docs/rules/no-identical-paths.md
+++ b/docs/rules/no-identical-paths.md
@@ -18,8 +18,8 @@ According to the OpenAPI specification:
 ```mermaid
 flowchart TD
 
-Root ==> PathsMap
-style PathsMap fill:#codaf9,stroke:#0044d4,stroke-width:5px
+Root ==> Paths
+style Paths fill:#codaf9,stroke:#0044d4,stroke-width:5px
 ```
 
 ## API design principles
diff --git a/docs/rules/no-invalid-media-type-examples.md b/docs/rules/no-invalid-media-type-examples.md
index b5c58d55..2478903c 100644
--- a/docs/rules/no-invalid-media-type-examples.md
+++ b/docs/rules/no-invalid-media-type-examples.md
@@ -11,7 +11,7 @@ Disallow invalid media type examples by ensuring they comply with the correspond
 ```mermaid
 flowchart TD
 
-root ==> PathsMap --> PathItem --> Operation --> MediaType --> Example
+root ==> Paths --> PathItem --> Operation --> MediaType --> Example
 MediaType --> Examples --> Example
 
 root ==> components
diff --git a/docs/rules/no-invalid-parameter-examples.md b/docs/rules/no-invalid-parameter-examples.md
index 21f846cc..11893907 100644
--- a/docs/rules/no-invalid-parameter-examples.md
+++ b/docs/rules/no-invalid-parameter-examples.md
@@ -11,7 +11,7 @@ Disallow invalid parameter examples.
 ```mermaid
 flowchart TD
 
-Root ==> PathsMap --> PathItem --> Operation --> Parameter --> Example
+Root ==> Paths --> PathItem --> Operation --> Parameter --> Example
 PathItem --> Parameter
 Parameter --> Schema
 Root ==> components
diff --git a/docs/rules/no-invalid-schema-examples.md b/docs/rules/no-invalid-schema-examples.md
index d91d6c93..e3c52921 100644
--- a/docs/rules/no-invalid-schema-examples.md
+++ b/docs/rules/no-invalid-schema-examples.md
@@ -11,7 +11,7 @@ Disallow invalid schema examples.
 ```mermaid
 flowchart TD
 
-Root ==> PathsMap --> PathItem --> Operation --> Parameter --> Example
+Root ==> Paths --> PathItem --> Operation --> Parameter --> Example
 PathItem --> Parameter
 Parameter --> Schema
 Operation --> MediaType --> Schema
diff --git a/packages/core/src/rules/common/no-ambiguous-paths.ts b/packages/core/src/rules/common/no-ambiguous-paths.ts
index b32ad8e4..3edfa0ba 100644
--- a/packages/core/src/rules/common/no-ambiguous-paths.ts
+++ b/packages/core/src/rules/common/no-ambiguous-paths.ts
@@ -5,7 +5,7 @@ import { Oas2Paths } from '../../typings/swagger';
 
 export const NoAmbiguousPaths: Oas3Rule | Oas2Rule = () => {
   return {
-    PathsMap(pathMap: Oas3Paths | Oas2Paths, { report, location }: UserContext) {
+    Paths(pathMap: Oas3Paths | Oas2Paths, { report, location }: UserContext) {
       const seenPaths: string[] = [];
 
       for (const currentPath of Object.keys(pathMap)) {
diff --git a/packages/core/src/rules/common/no-identical-paths.ts b/packages/core/src/rules/common/no-identical-paths.ts
index 47169331..a81e5a73 100644
--- a/packages/core/src/rules/common/no-identical-paths.ts
+++ b/packages/core/src/rules/common/no-identical-paths.ts
@@ -5,18 +5,18 @@ import { Oas2Paths } from '../../typings/swagger';
 
 export const NoIdenticalPaths: Oas3Rule | Oas2Rule = () => {
   return {
-    PathsMap(pathMap: Oas3Paths | Oas2Paths, { report, location }: UserContext) {
-      const pathsMap = new Map<string, string>();
+    Paths(pathMap: Oas3Paths | Oas2Paths, { report, location }: UserContext) {
+      const Paths = new Map<string, string>();
       for (const pathName of Object.keys(pathMap)) {
         const id = pathName.replace(/{.+?}/g, '{VARIABLE}');
-        const existingSamePath = pathsMap.get(id);
+        const existingSamePath = Paths.get(id);
         if (existingSamePath) {
           report({
             message: `The path already exists which differs only by path parameter name(s): \`${existingSamePath}\` and \`${pathName}\`.`,
             location: location.child([pathName]).key(),
           });
         } else {
-          pathsMap.set(id, pathName);
+          Paths.set(id, pathName);
         }
       }
     },
diff --git a/packages/core/src/rules/common/operation-2xx-response.ts b/packages/core/src/rules/common/operation-2xx-response.ts
index 476d09e3..e9a3980d 100644
--- a/packages/core/src/rules/common/operation-2xx-response.ts
+++ b/packages/core/src/rules/common/operation-2xx-response.ts
@@ -3,7 +3,7 @@ import { UserContext } from '../../walk';
 
 export const Operation2xxResponse: Oas3Rule | Oas2Rule = () => {
   return {
-    ResponsesMap(responses: Record<string, object>, { report }: UserContext) {
+    Responses(responses: Record<string, object>, { report }: UserContext) {
       const codes = Object.keys(responses || {});
       if (!codes.some((code) => code === 'default' || /2[Xx0-9]{2}/.test(code))) {
         report({
diff --git a/packages/core/src/rules/common/operation-4xx-response.ts b/packages/core/src/rules/common/operation-4xx-response.ts
index bc4ecc3b..eae1d3a4 100644
--- a/packages/core/src/rules/common/operation-4xx-response.ts
+++ b/packages/core/src/rules/common/operation-4xx-response.ts
@@ -3,7 +3,7 @@ import { UserContext } from '../../walk';
 
 export const Operation4xxResponse: Oas3Rule | Oas2Rule = () => {
   return {
-    ResponsesMap(responses: Record<string, object>, { report }: UserContext) {
+    Responses(responses: Record<string, object>, { report }: UserContext) {
       const codes = Object.keys(responses || {});
 
       if (!codes.some((code) => /4[Xx0-9]{2}/.test(code))) {
diff --git a/packages/core/src/rules/common/path-not-include-query.ts b/packages/core/src/rules/common/path-not-include-query.ts
index c068535b..b300cdfd 100644
--- a/packages/core/src/rules/common/path-not-include-query.ts
+++ b/packages/core/src/rules/common/path-not-include-query.ts
@@ -3,7 +3,7 @@ import { UserContext } from '../../walk';
 
 export const PathNotIncludeQuery: Oas3Rule | Oas2Rule = () => {
   return {
-    PathsMap: {
+    Paths: {
       PathItem(_operation: object, { report, key }: UserContext) {
         if (key.toString().includes('?')) {
           report({
diff --git a/packages/core/src/rules/oas3/request-mime-type.ts b/packages/core/src/rules/oas3/request-mime-type.ts
index 8a18ff0d..b7e31570 100644
--- a/packages/core/src/rules/oas3/request-mime-type.ts
+++ b/packages/core/src/rules/oas3/request-mime-type.ts
@@ -5,7 +5,7 @@ import { validateMimeTypeOAS3 } from '../../utils';
 
 export const RequestMimeType: Oas3Rule = ({ allowedValues }) => {
   return {
-    PathsMap: {
+    Paths: {
       RequestBody: {
         leave(requestBody: Oas3RequestBody, ctx: UserContext) {
           validateMimeTypeOAS3({ type: 'consumes', value: requestBody }, ctx, allowedValues);
diff --git a/packages/core/src/rules/oas3/response-mime-type.ts b/packages/core/src/rules/oas3/response-mime-type.ts
index ebe32eb1..c0e16df9 100644
--- a/packages/core/src/rules/oas3/response-mime-type.ts
+++ b/packages/core/src/rules/oas3/response-mime-type.ts
@@ -5,7 +5,7 @@ import { validateMimeTypeOAS3 } from '../../utils';
 
 export const ResponseMimeType: Oas3Rule = ({ allowedValues }) => {
   return {
-    PathsMap: {
+    Paths: {
       Response: {
         leave(response: Oas3Response, ctx: UserContext) {
           validateMimeTypeOAS3({ type: 'produces', value: response }, ctx, allowedValues);
diff --git a/packages/core/src/rules/other/stats.ts b/packages/core/src/rules/other/stats.ts
index e1f12780..cb4e573e 100644
--- a/packages/core/src/rules/other/stats.ts
+++ b/packages/core/src/rules/other/stats.ts
@@ -41,7 +41,7 @@ export const Stats = (statsAccumulator: StatsAccumulator) => {
         },
       },
     },
-    PathsMap: {
+    Paths: {
       PathItem: {
         leave() {
           statsAccumulator.pathItems.total++;
diff --git a/packages/core/src/types/oas2.ts b/packages/core/src/types/oas2.ts
index be156e8e..3bd67b5e 100644
--- a/packages/core/src/types/oas2.ts
+++ b/packages/core/src/types/oas2.ts
@@ -11,7 +11,7 @@ const Root: NodeType = {
     schemes: { type: 'array', items: { type: 'string' } },
     consumes: { type: 'array', items: { type: 'string' } },
     produces: { type: 'array', items: { type: 'string' } },
-    paths: 'PathsMap',
+    paths: 'Paths',
     definitions: 'NamedSchemas',
     parameters: 'NamedParameters',
     responses: 'NamedResponses',
@@ -51,7 +51,7 @@ const License: NodeType = {
   required: ['name'],
 };
 
-const PathsMap: NodeType = {
+const Paths: NodeType = {
   properties: {},
   additionalProperties: (_value: any, key: string) =>
     key.startsWith('/') ? 'PathItem' : undefined,
@@ -82,7 +82,7 @@ const Operation: NodeType = {
     consumes: { type: 'array', items: { type: 'string' } },
     produces: { type: 'array', items: { type: 'string' } },
     parameters: listOf('Parameter'),
-    responses: 'ResponsesMap',
+    responses: 'Responses',
     schemes: { type: 'array', items: { type: 'string' } },
     deprecated: { type: 'boolean' },
     security: listOf('SecurityRequirement'),
@@ -180,7 +180,7 @@ const ParameterItems: NodeType = {
   },
 };
 
-const ResponsesMap: NodeType = {
+const Responses: NodeType = {
   properties: {
     default: 'Response',
   },
@@ -376,14 +376,14 @@ export const Oas2Types: Record<string, NodeType> = {
   Info,
   Contact,
   License,
-  PathsMap,
+  Paths,
   PathItem,
   Parameter,
   ParameterItems,
   Operation,
   Examples,
   Header,
-  ResponsesMap,
+  Responses,
   Response,
   Schema,
   Xml,
diff --git a/packages/core/src/types/oas3.ts b/packages/core/src/types/oas3.ts
index 79cd16ba..dd4dad7f 100755
--- a/packages/core/src/types/oas3.ts
+++ b/packages/core/src/types/oas3.ts
@@ -10,7 +10,7 @@ const Root: NodeType = {
     security: listOf('SecurityRequirement'),
     tags: listOf('Tag'),
     externalDocs: 'ExternalDocs',
-    paths: 'PathsMap',
+    paths: 'Paths',
     components: 'Components',
     'x-webhooks': 'WebhooksMap',
   },
@@ -88,7 +88,7 @@ const License: NodeType = {
   required: ['name'],
 };
 
-const PathsMap: NodeType = {
+const Paths: NodeType = {
   properties: {},
   additionalProperties: (_value: any, key: string) =>
     key.startsWith('/') ? 'PathItem' : undefined,
@@ -153,7 +153,7 @@ const Operation: NodeType = {
     security: listOf('SecurityRequirement'),
     servers: listOf('Server'),
     requestBody: 'RequestBody',
-    responses: 'ResponsesMap',
+    responses: 'Responses',
     deprecated: { type: 'boolean' },
     callbacks: 'CallbacksMap',
     'x-codeSamples': listOf('XCodeSample'),
@@ -190,7 +190,7 @@ const MediaType: NodeType = {
     schema: 'Schema',
     example: { isExample: true },
     examples: 'ExamplesMap',
-    encoding: 'EncodingsMap',
+    encoding: 'EncodingMap',
   },
 };
 
@@ -234,7 +234,7 @@ const Header: NodeType = {
   requiredOneOf: ['schema', 'content'],
 };
 
-const ResponsesMap: NodeType = {
+const Responses: NodeType = {
   properties: { default: 'Response' },
   additionalProperties: (_v: any, key: string) =>
     responseCodeRegexp.test(key) ? 'Response' : undefined,
@@ -408,7 +408,7 @@ const AuthorizationCode: NodeType = {
   required: ['authorizationUrl', 'tokenUrl', 'scopes'],
 };
 
-const SecuritySchemeFlows: NodeType = {
+const OAuth2Flows: NodeType = {
   properties: {
     implicit: 'ImplicitFlow',
     password: 'PasswordFlow',
@@ -425,7 +425,7 @@ const SecurityScheme: NodeType = {
     in: { type: 'string', enum: ['query', 'header', 'cookie'] },
     scheme: { type: 'string' },
     bearerFormat: { type: 'string' },
-    flows: 'SecuritySchemeFlows',
+    flows: 'OAuth2Flows',
     openIdConnectUrl: { type: 'string' },
   },
   required(value) {
@@ -470,7 +470,7 @@ export const Oas3Types: Record<string, NodeType> = {
   Info,
   Contact,
   License,
-  PathsMap,
+  Paths,
   PathItem,
   Parameter,
   Operation,
@@ -482,10 +482,10 @@ export const Oas3Types: Record<string, NodeType> = {
   Example,
   ExamplesMap: mapOf('Example'),
   Encoding,
-  EncodingsMap: mapOf('Encoding'),
+  EncodingMap: mapOf('Encoding'),
   Header,
   HeadersMap: mapOf('Header'),
-  ResponsesMap,
+  Responses,
   Response,
   Link,
   Schema,
@@ -508,7 +508,7 @@ export const Oas3Types: Record<string, NodeType> = {
   PasswordFlow,
   ClientCredentials,
   AuthorizationCode,
-  SecuritySchemeFlows,
+  OAuth2Flows,
   SecurityScheme,
   XCodeSample,
   WebhooksMap,
diff --git a/packages/core/src/types/oas3_1.ts b/packages/core/src/types/oas3_1.ts
index ad60e1d8..8fd5ff8e 100755
--- a/packages/core/src/types/oas3_1.ts
+++ b/packages/core/src/types/oas3_1.ts
@@ -9,7 +9,7 @@ const Root: NodeType = {
     security: listOf('SecurityRequirement'),
     tags: listOf('Tag'),
     externalDocs: 'ExternalDocs',
-    paths: 'PathsMap',
+    paths: 'Paths',
     webhooks: 'WebhooksMap',
     components: 'Components',
     jsonSchemaDialect: { type: 'string' },
@@ -69,7 +69,7 @@ const Operation: NodeType = {
     security: listOf('SecurityRequirement'),
     servers: listOf('Server'),
     requestBody: 'RequestBody',
-    responses: 'ResponsesMap',
+    responses: 'Responses',
     deprecated: { type: 'boolean' },
     callbacks: mapOf('Callback'),
     'x-codeSamples': listOf('XCodeSample'),
@@ -176,7 +176,7 @@ const SecurityScheme: NodeType = {
     in: { type: 'string', enum: ['query', 'header', 'cookie'] },
     scheme: { type: 'string' },
     bearerFormat: { type: 'string' },
-    flows: 'SecuritySchemeFlows',
+    flows: 'OAuth2Flows',
     openIdConnectUrl: { type: 'string' },
   },
   required(value) {
diff --git a/packages/core/src/types/redocly-yaml.ts b/packages/core/src/types/redocly-yaml.ts
index 5f2001d2..4c2be979 100644
--- a/packages/core/src/types/redocly-yaml.ts
+++ b/packages/core/src/types/redocly-yaml.ts
@@ -66,7 +66,7 @@ const nodeTypesList = [
   'Info',
   'Contact',
   'License',
-  'PathsMap',
+  'Paths',
   'PathItem',
   'Parameter',
   'Operation',
@@ -78,10 +78,10 @@ const nodeTypesList = [
   'Example',
   'ExamplesMap',
   'Encoding',
-  'EncodingsMap',
+  'EncodingMap',
   'Header',
   'HeadersMap',
-  'ResponsesMap',
+  'Responses',
   'Response',
   'Link',
   'LinksMap',
@@ -104,7 +104,7 @@ const nodeTypesList = [
   'PasswordFlow',
   'ClientCredentials',
   'AuthorizationCode',
-  'SecuritySchemeFlows',
+  'OAuth2Flows',
   'SecurityScheme',
   'XCodeSample',
   'WebhooksMap',
diff --git a/packages/core/src/visitors.ts b/packages/core/src/visitors.ts
index db2ad031..a304a6c3 100644
--- a/packages/core/src/visitors.ts
+++ b/packages/core/src/visitors.ts
@@ -136,9 +136,10 @@ type Oas3FlatVisitor = {
   Info?: VisitFunctionOrObject<Oas3Info>;
   Contact?: VisitFunctionOrObject<Oas3Contact>;
   License?: VisitFunctionOrObject<Oas3License>;
-  PathsMap?: VisitFunctionOrObject<Record<string, Oas3PathItem>>;
+  Paths?: VisitFunctionOrObject<Record<string, Oas3PathItem>>;
   PathItem?: VisitFunctionOrObject<Oas3PathItem>;
-  Callback?: VisitFunctionOrObject<Record<string, Oas3PathItem>>;
+  Callback?: VisitFunctionOrObject<Oas3Callback>;
+  CallbacksMap?: VisitFunctionOrObject<Record<string, Oas3Callback>>;
   Parameter?: VisitFunctionOrObject<Oas3Parameter>;
   Operation?: VisitFunctionOrObject<Oas3Operation>;
   RequestBody?: VisitFunctionOrObject<Oas3RequestBody>;
@@ -147,7 +148,7 @@ type Oas3FlatVisitor = {
   Example?: VisitFunctionOrObject<Oas3Example>;
   Encoding?: VisitFunctionOrObject<Oas3Encoding>;
   Header?: VisitFunctionOrObject<Oas3Header>;
-  ResponsesMap?: VisitFunctionOrObject<Record<string, Oas3Response>>;
+  Responses?: VisitFunctionOrObject<Record<string, Oas3Response>>;
   Response?: VisitFunctionOrObject<Oas3Response>;
   Link?: VisitFunctionOrObject<Oas3Link>;
   Schema?: VisitFunctionOrObject<Oas3Schema>;
@@ -169,7 +170,7 @@ type Oas3FlatVisitor = {
   PasswordFlow?: VisitFunctionOrObject<Oas3SecurityScheme['flows']['password']>;
   ClientCredentials?: VisitFunctionOrObject<Oas3SecurityScheme['flows']['clientCredentials']>;
   AuthorizationCode?: VisitFunctionOrObject<Oas3SecurityScheme['flows']['authorizationCode']>;
-  SecuritySchemeFlows?: VisitFunctionOrObject<Oas3SecurityScheme['flows']>;
+  OAuth2Flows?: VisitFunctionOrObject<Oas3SecurityScheme['flows']>;
   SecurityScheme?: VisitFunctionOrObject<Oas3SecurityScheme>;
 };
 
@@ -181,13 +182,13 @@ type Oas2FlatVisitor = {
   Info?: VisitFunctionOrObject<Oas2Info>;
   Contact?: VisitFunctionOrObject<Oas2Contact>;
   License?: VisitFunctionOrObject<Oas2License>;
-  PathsMap?: VisitFunctionOrObject<Record<string, Oas2PathItem>>;
+  Paths?: VisitFunctionOrObject<Record<string, Oas2PathItem>>;
   PathItem?: VisitFunctionOrObject<Oas2PathItem>;
   Parameter?: VisitFunctionOrObject<any>;
   Operation?: VisitFunctionOrObject<Oas2Operation>;
   Examples?: VisitFunctionOrObject<Record<string, any>>;
   Header?: VisitFunctionOrObject<Oas2Header>;
-  ResponsesMap?: VisitFunctionOrObject<Record<string, Oas2Response>>;
+  Responses?: VisitFunctionOrObject<Record<string, Oas2Response>>;
   Response?: VisitFunctionOrObject<Oas2Response>;
   Schema?: VisitFunctionOrObject<Oas2Schema>;
   Xml?: VisitFunctionOrObject<Oas2Xml>;
@@ -201,13 +202,14 @@ type Oas2FlatVisitor = {
 const legacyTypesMap = {
   Root: 'DefinitionRoot',
   ServerVariablesMap: 'ServerVariableMap',
-  PathsMap: 'PathMap',
+  Paths: ['PathMap', 'PathsMap'],
   CallbacksMap: 'CallbackMap',
   MediaTypesMap: 'MediaTypeMap',
   ExamplesMap: 'ExampleMap',
-  EncodingsMap: 'EncodingMap',
+  EncodingMap: 'EncodingsMap',
   HeadersMap: 'HeaderMap',
   LinksMap: 'LinkMap',
+  OAuth2Flows: 'SecuritySchemeFlows',
 };
 
 type Oas3NestedVisitor = {
@@ -372,6 +374,18 @@ export function normalizeVisitors<T extends BaseVisitor>(
     }
   }
 
+  function findLegacyVisitorNode<T>(
+    visitor: NestedVisitObject<any, T>,
+    typeName: keyof T | Array<keyof T>
+  ) {
+    if (Array.isArray(typeName)) {
+      const name = typeName.find((name) => visitor[name]) || undefined;
+      return name && visitor[name];
+    }
+
+    return visitor[typeName];
+  }
+
   function normalizeVisitorLevel(
     ruleConf: RuleInstanceConfig,
     visitor: NestedVisitObject<any, T>,
@@ -394,9 +408,10 @@ export function normalizeVisitors<T extends BaseVisitor>(
 
     for (const typeName of visitorKeys as Array<keyof T>) {
       const typeVisitor = (visitor[typeName] ||
-        visitor[
+        findLegacyVisitorNode(
+          visitor,
           legacyTypesMap[typeName as keyof typeof legacyTypesMap] as keyof T
-        ]) as any as NestedVisitObject<any, T>;
+        )) as any as NestedVisitObject<any, T>;
       const normalizedTypeVisitor = normalizedVisitors[typeName];
 
       if (!typeVisitor) continue;


Test patch:
diff --git a/__tests__/lint-config/invalid-config-assertation-config-type/snapshot.js b/__tests__/lint-config/invalid-config-assertation-config-type/snapshot.js
index 6cbfb3ed..39bfa7a0 100644
--- a/__tests__/lint-config/invalid-config-assertation-config-type/snapshot.js
+++ b/__tests__/lint-config/invalid-config-assertation-config-type/snapshot.js
@@ -4,7 +4,7 @@ exports[`E2E lint-config test with option: { dirName: 'invalid-config-assertatio
 
 [1] .redocly.yaml:9:17 at #/styleguide/rules/assert~1path-item-mutually-required/context/0/type
 
-\`type\` can be one of the following only: "Root", "Tag", "ExternalDocs", "Server", "ServerVariable", "ServerVariablesMap", "SecurityRequirement", "Info", "Contact", "License", "PathsMap", "PathItem", "Parameter", "Operation", "Callback", "CallbacksMap", "RequestBody", "MediaTypesMap", "MediaType", "Example", "ExamplesMap", "Encoding", "EncodingsMap", "Header", "HeadersMap", "ResponsesMap", "Response", "Link", "LinksMap", "Schema", "Xml", "SchemaProperties", "DiscriminatorMapping", "Discriminator", "Components", "NamedSchemas", "NamedResponses", "NamedParameters", "NamedExamples", "NamedRequestBodies", "NamedHeaders", "NamedSecuritySchemes", "NamedLinks", "NamedCallbacks", "ImplicitFlow", "PasswordFlow", "ClientCredentials", "AuthorizationCode", "SecuritySchemeFlows", "SecurityScheme", "XCodeSample", "WebhooksMap".
+\`type\` can be one of the following only: "Root", "Tag", "ExternalDocs", "Server", "ServerVariable", "ServerVariablesMap", "SecurityRequirement", "Info", "Contact", "License", "Paths", "PathItem", "Parameter", "Operation", "Callback", "CallbacksMap", "RequestBody", "MediaTypesMap", "MediaType", "Example", "ExamplesMap", "Encoding", "EncodingMap", "Header", "HeadersMap", "Responses", "Response", "Link", "LinksMap", "Schema", "Xml", "SchemaProperties", "DiscriminatorMapping", "Discriminator", "Components", "NamedSchemas", "NamedResponses", "NamedParameters", "NamedExamples", "NamedRequestBodies", "NamedHeaders", "NamedSecuritySchemes", "NamedLinks", "NamedCallbacks", "ImplicitFlow", "PasswordFlow", "ClientCredentials", "AuthorizationCode", "OAuth2Flows", "SecurityScheme", "XCodeSample", "WebhooksMap".
 
  7 | assert/path-item-mutually-required:
  8 |   context:
diff --git a/__tests__/lint-config/invalid-definition-and-config/snapshot.js b/__tests__/lint-config/invalid-definition-and-config/snapshot.js
index f83351d4..5b0cb8e2 100644
--- a/__tests__/lint-config/invalid-definition-and-config/snapshot.js
+++ b/__tests__/lint-config/invalid-definition-and-config/snapshot.js
@@ -50,7 +50,7 @@ Error was generated by the operation-summary rule.
 
 [3] ../__fixtures__/invalid-openapi.yaml:11:7 at #/paths/~1pet~1findByStatus/get/responses
 
-Expected type \`ResponsesMap\` (object) but got \`null\`
+Expected type \`Responses\` (object) but got \`null\`
 
  9 | /pet/findByStatus:
 10 |   get:
diff --git a/__tests__/lint/assertions-error/.redocly.yaml b/__tests__/lint/assertions-error/.redocly.yaml
index c0273cb8..5c359d31 100644
--- a/__tests__/lint/assertions-error/.redocly.yaml
+++ b/__tests__/lint/assertions-error/.redocly.yaml
@@ -94,7 +94,7 @@ rules:
       - updated_at
   # mutuallyRequired example with context
   assert/operation-mutually-required-w-context:
-    subject: ResponsesMap
+    subject: Responses
     context:
         - type: Operation
           matchParentKeys:
diff --git a/__tests__/lint/assertions-map-types/.redocly.yaml b/__tests__/lint/assertions-map-types/.redocly.yaml
index 511c0336..88a5898f 100644
--- a/__tests__/lint/assertions-map-types/.redocly.yaml
+++ b/__tests__/lint/assertions-map-types/.redocly.yaml
@@ -10,7 +10,7 @@ rules:
     defined: false
 
   assert/encodingMap:
-    subject: EncodingsMap
+    subject: EncodingMap
     casing: kebab-case
 
   assert/linkMap:
diff --git a/__tests__/lint/assertions-map-types/openapi.yaml b/__tests__/lint/assertions-map-types/openapi.yaml
index cba02af3..ca8c6ad9 100644
--- a/__tests__/lint/assertions-map-types/openapi.yaml
+++ b/__tests__/lint/assertions-map-types/openapi.yaml
@@ -31,7 +31,7 @@ paths:
                 type: string
           content:
             application/json:
-              encoding: # EncodingsMap
+              encoding: # EncodingMap
                 historyMetadata:
                   contentType: application/json; charset=utf-8
           links: # LinksMap
diff --git a/__tests__/lint/assertions-map-types/snapshot.js b/__tests__/lint/assertions-map-types/snapshot.js
index 28afe372..4b1807d2 100644
--- a/__tests__/lint/assertions-map-types/snapshot.js
+++ b/__tests__/lint/assertions-map-types/snapshot.js
@@ -37,10 +37,10 @@ Error was generated by the headerMap assertion rule.
 
 [3] openapi.yaml:35:17 at #/paths/~1pets/get/responses/200/content/application~1json/encoding/historyMetadata
 
-encodingMap assertion failed because the EncodingsMap didn't meet the assertions: "historyMetadata" should use kebab-case
+encodingMap assertion failed because the EncodingMap didn't meet the assertions: "historyMetadata" should use kebab-case
 
 33 |   application/json:
-34 |     encoding: # EncodingsMap
+34 |     encoding: # EncodingMap
 35 |       historyMetadata:
    |       ^^^^^^^^^^^^^^^
 36 |         contentType: application/json; charset=utf-8
diff --git a/__tests__/lint/assertions/.redocly.yaml b/__tests__/lint/assertions/.redocly.yaml
index a117082f..b95bf4ba 100644
--- a/__tests__/lint/assertions/.redocly.yaml
+++ b/__tests__/lint/assertions/.redocly.yaml
@@ -94,7 +94,7 @@ rules:
       - updated_at
   # mutuallyRequired example with context
   assert/response-map-required-with-context:
-    subject: ResponsesMap
+    subject: Responses
     context:
       - type: Operation
         matchParentKeys:
diff --git a/__tests__/webpack-bundle/bundle-workflows/meta-snapshot.js b/__tests__/webpack-bundle/bundle-workflows/meta-snapshot.js
index aff2f462..454865d5 100644
--- a/__tests__/webpack-bundle/bundle-workflows/meta-snapshot.js
+++ b/__tests__/webpack-bundle/bundle-workflows/meta-snapshot.js
@@ -1,3 +1,3 @@
 // Jest Snapshot v1, https://goo.gl/fbAQLP
 
-exports[`webpack-bundle test bundle-workflows 1`] = `{"fileDependencies":{},"rootType":{"properties":{"openapi":null,"info":{"properties":{"title":{"type":"string"},"version":{"type":"string"},"description":{"type":"string"},"termsOfService":{"type":"string"},"contact":{"properties":{"name":{"type":"string"},"url":{"type":"string"},"email":{"type":"string"}},"name":"Contact"},"license":{"properties":{"name":{"type":"string"},"url":{"type":"string"}},"required":["name"],"name":"License"}},"required":["title","version"],"name":"Info"},"servers":{"name":"ServerList","properties":{},"items":{"properties":{"url":{"type":"string"},"description":{"type":"string"},"variables":{"name":"ServerVariablesMap","properties":{}}},"required":["url"],"name":"Server"}},"security":{"name":"SecurityRequirementList","properties":{},"items":{"properties":{},"additionalProperties":{"type":"array","items":{"type":"string"}},"name":"SecurityRequirement"}},"tags":{"name":"TagList","properties":{},"items":{"properties":{"name":{"type":"string"},"description":{"type":"string"},"externalDocs":{"properties":{"description":{"type":"string"},"url":{"type":"string"}},"required":["url"],"name":"ExternalDocs"}},"required":["name"],"name":"Tag"}},"externalDocs":{"properties":{"description":{"type":"string"},"url":{"type":"string"}},"required":["url"],"name":"ExternalDocs"},"paths":{"properties":{},"name":"PathsMap"},"components":{"properties":{"parameters":{"name":"NamedParameters","properties":{}},"schemas":{"name":"NamedSchemas","properties":{}},"responses":{"name":"NamedResponses","properties":{}},"examples":{"name":"NamedExamples","properties":{}},"requestBodies":{"name":"NamedRequestBodies","properties":{}},"headers":{"name":"NamedHeaders","properties":{}},"securitySchemes":{"name":"NamedSecuritySchemes","properties":{}},"links":{"name":"NamedLinks","properties":{}},"callbacks":{"name":"NamedCallbacks","properties":{}}},"name":"Components"},"x-webhooks":{"properties":{},"name":"WebhooksMap"}},"required":["openapi","paths","info"],"name":"Root"},"refTypes":{},"visitorsData":{"registry-dependencies":{"links":[]}}}`;
+exports[`webpack-bundle test bundle-workflows 1`] = `{"fileDependencies":{},"rootType":{"properties":{"openapi":null,"info":{"properties":{"title":{"type":"string"},"version":{"type":"string"},"description":{"type":"string"},"termsOfService":{"type":"string"},"contact":{"properties":{"name":{"type":"string"},"url":{"type":"string"},"email":{"type":"string"}},"name":"Contact"},"license":{"properties":{"name":{"type":"string"},"url":{"type":"string"}},"required":["name"],"name":"License"}},"required":["title","version"],"name":"Info"},"servers":{"name":"ServerList","properties":{},"items":{"properties":{"url":{"type":"string"},"description":{"type":"string"},"variables":{"name":"ServerVariablesMap","properties":{}}},"required":["url"],"name":"Server"}},"security":{"name":"SecurityRequirementList","properties":{},"items":{"properties":{},"additionalProperties":{"type":"array","items":{"type":"string"}},"name":"SecurityRequirement"}},"tags":{"name":"TagList","properties":{},"items":{"properties":{"name":{"type":"string"},"description":{"type":"string"},"externalDocs":{"properties":{"description":{"type":"string"},"url":{"type":"string"}},"required":["url"],"name":"ExternalDocs"}},"required":["name"],"name":"Tag"}},"externalDocs":{"properties":{"description":{"type":"string"},"url":{"type":"string"}},"required":["url"],"name":"ExternalDocs"},"paths":{"properties":{},"name":"Paths"},"components":{"properties":{"parameters":{"name":"NamedParameters","properties":{}},"schemas":{"name":"NamedSchemas","properties":{}},"responses":{"name":"NamedResponses","properties":{}},"examples":{"name":"NamedExamples","properties":{}},"requestBodies":{"name":"NamedRequestBodies","properties":{}},"headers":{"name":"NamedHeaders","properties":{}},"securitySchemes":{"name":"NamedSecuritySchemes","properties":{}},"links":{"name":"NamedLinks","properties":{}},"callbacks":{"name":"NamedCallbacks","properties":{}}},"name":"Components"},"x-webhooks":{"properties":{},"name":"WebhooksMap"}},"required":["openapi","paths","info"],"name":"Root"},"refTypes":{},"visitorsData":{"registry-dependencies":{"links":[]}}}`;
diff --git a/__tests__/webpack-bundle/bundle-workflows/metafile.json b/__tests__/webpack-bundle/bundle-workflows/metafile.json
index 16223caa..79a3c2d2 100644
--- a/__tests__/webpack-bundle/bundle-workflows/metafile.json
+++ b/__tests__/webpack-bundle/bundle-workflows/metafile.json
@@ -1,1 +1,1 @@
-{"fileDependencies":{},"rootType":{"properties":{"openapi":null,"info":{"properties":{"title":{"type":"string"},"version":{"type":"string"},"description":{"type":"string"},"termsOfService":{"type":"string"},"contact":{"properties":{"name":{"type":"string"},"url":{"type":"string"},"email":{"type":"string"}},"name":"Contact"},"license":{"properties":{"name":{"type":"string"},"url":{"type":"string"}},"required":["name"],"name":"License"}},"required":["title","version"],"name":"Info"},"servers":{"name":"ServerList","properties":{},"items":{"properties":{"url":{"type":"string"},"description":{"type":"string"},"variables":{"name":"ServerVariablesMap","properties":{}}},"required":["url"],"name":"Server"}},"security":{"name":"SecurityRequirementList","properties":{},"items":{"properties":{},"additionalProperties":{"type":"array","items":{"type":"string"}},"name":"SecurityRequirement"}},"tags":{"name":"TagList","properties":{},"items":{"properties":{"name":{"type":"string"},"description":{"type":"string"},"externalDocs":{"properties":{"description":{"type":"string"},"url":{"type":"string"}},"required":["url"],"name":"ExternalDocs"}},"required":["name"],"name":"Tag"}},"externalDocs":{"properties":{"description":{"type":"string"},"url":{"type":"string"}},"required":["url"],"name":"ExternalDocs"},"paths":{"properties":{},"name":"PathsMap"},"components":{"properties":{"parameters":{"name":"NamedParameters","properties":{}},"schemas":{"name":"NamedSchemas","properties":{}},"responses":{"name":"NamedResponses","properties":{}},"examples":{"name":"NamedExamples","properties":{}},"requestBodies":{"name":"NamedRequestBodies","properties":{}},"headers":{"name":"NamedHeaders","properties":{}},"securitySchemes":{"name":"NamedSecuritySchemes","properties":{}},"links":{"name":"NamedLinks","properties":{}},"callbacks":{"name":"NamedCallbacks","properties":{}}},"name":"Components"},"x-webhooks":{"properties":{},"name":"WebhooksMap"}},"required":["openapi","paths","info"],"name":"Root"},"refTypes":{},"visitorsData":{"registry-dependencies":{"links":[]}}}
\ No newline at end of file
+{"fileDependencies":{},"rootType":{"properties":{"openapi":null,"info":{"properties":{"title":{"type":"string"},"version":{"type":"string"},"description":{"type":"string"},"termsOfService":{"type":"string"},"contact":{"properties":{"name":{"type":"string"},"url":{"type":"string"},"email":{"type":"string"}},"name":"Contact"},"license":{"properties":{"name":{"type":"string"},"url":{"type":"string"}},"required":["name"],"name":"License"}},"required":["title","version"],"name":"Info"},"servers":{"name":"ServerList","properties":{},"items":{"properties":{"url":{"type":"string"},"description":{"type":"string"},"variables":{"name":"ServerVariablesMap","properties":{}}},"required":["url"],"name":"Server"}},"security":{"name":"SecurityRequirementList","properties":{},"items":{"properties":{},"additionalProperties":{"type":"array","items":{"type":"string"}},"name":"SecurityRequirement"}},"tags":{"name":"TagList","properties":{},"items":{"properties":{"name":{"type":"string"},"description":{"type":"string"},"externalDocs":{"properties":{"description":{"type":"string"},"url":{"type":"string"}},"required":["url"],"name":"ExternalDocs"}},"required":["name"],"name":"Tag"}},"externalDocs":{"properties":{"description":{"type":"string"},"url":{"type":"string"}},"required":["url"],"name":"ExternalDocs"},"paths":{"properties":{},"name":"Paths"},"components":{"properties":{"parameters":{"name":"NamedParameters","properties":{}},"schemas":{"name":"NamedSchemas","properties":{}},"responses":{"name":"NamedResponses","properties":{}},"examples":{"name":"NamedExamples","properties":{}},"requestBodies":{"name":"NamedRequestBodies","properties":{}},"headers":{"name":"NamedHeaders","properties":{}},"securitySchemes":{"name":"NamedSecuritySchemes","properties":{}},"links":{"name":"NamedLinks","properties":{}},"callbacks":{"name":"NamedCallbacks","properties":{}}},"name":"Components"},"x-webhooks":{"properties":{},"name":"WebhooksMap"}},"required":["openapi","paths","info"],"name":"Root"},"refTypes":{},"visitorsData":{"registry-dependencies":{"links":[]}}}
\ No newline at end of file
diff --git a/packages/core/src/__tests__/__snapshots__/bundle.test.ts.snap b/packages/core/src/__tests__/__snapshots__/bundle.test.ts.snap
index a7e94e80..c2fcbea4 100644
--- a/packages/core/src/__tests__/__snapshots__/bundle.test.ts.snap
+++ b/packages/core/src/__tests__/__snapshots__/bundle.test.ts.snap
@@ -94,7 +94,7 @@ rootType:
       name: ExternalDocs
     paths:
       properties: {}
-      name: PathsMap
+      name: Paths
     components:
       properties:
         parameters:
diff --git a/packages/core/src/__tests__/walk.test.ts b/packages/core/src/__tests__/walk.test.ts
index 6e8d4fb5..0236c50d 100644
--- a/packages/core/src/__tests__/walk.test.ts
+++ b/packages/core/src/__tests__/walk.test.ts
@@ -1115,7 +1115,7 @@ describe('walk order', () => {
     expect(calls).toMatchInlineSnapshot(`
       Array [
         "enter Root",
-        "enter PathsMap",
+        "enter Paths",
         "enter PathItem",
         "enter ParameterList",
         "enter Parameter",
@@ -1134,7 +1134,7 @@ describe('walk order', () => {
         "leave ParameterList",
         "leave Operation",
         "leave PathItem",
-        "leave PathsMap",
+        "leave Paths",
         "enter Components",
         "enter NamedParameters",
         "leave NamedParameters",
diff --git a/packages/core/src/rules/common/assertions/__tests__/utils.test.ts b/packages/core/src/rules/common/assertions/__tests__/utils.test.ts
index c2ee4cf1..20879e31 100644
--- a/packages/core/src/rules/common/assertions/__tests__/utils.test.ts
+++ b/packages/core/src/rules/common/assertions/__tests__/utils.test.ts
@@ -65,7 +65,7 @@ describe('Oas3 assertions', () => {
             matchParentKeys: ['put'],
           },
           {
-            type: 'ResponsesMap',
+            type: 'Responses',
             matchParentKeys: [201, 200],
           },
         ];
@@ -75,7 +75,7 @@ describe('Oas3 assertions', () => {
         expect(visitors).toMatchInlineSnapshot(`
           Object {
             "Operation": Object {
-              "ResponsesMap": Object {
+              "Responses": Object {
                 "MediaTypesMap": [Function],
                 "skip": [Function],
               },