Repository: stoplightio/spectral (ts)

Issue:
Unused parameter error message format

**Describe the bug**
I was building a intentionally broken file for a test, and noticed a funny looking error:

<img width="554" alt="Screen Shot 2019-09-10 at 10 30 58" src="https://user-images.githubusercontent.com/67381/64622996-13619800-d39d-11e9-9fa0-128c4a80e063.png">

Not sure why the quotes and asterix. Maybe just the quotes but definitely not the asterix.

**To Reproduce**

Lint this document on stoplight.io/spectral and it'll appear.

```
openapi: '3.0.0'
info:
  version: 1.0.0
  title: Swagger Petstore
  license:
    name: MIT
paths:
  /pets:
    get:
      summary: Info for a specific pet
      operationId: showPetById
      tags:
        - pets
      parameters:
        - name: petId
          in: path
          required: true
          description: The id of the pet to retrieve
          schema:
            type: string
      responses:
        '200':
          description: Expected response to a valid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Pet'
components:
  schemas:
    Pet:
      required:
        - id
        - name
      properties:
        id:
          type: integer
          format: int64
        name:
          type: string
        tag:
          type: string
```



Pull request:
fix: unused error format in oasPathParam rule
Wanted to get my hands into that sweet open source. 

Fixes #537

**Checklist**
- [x] Tests added / updated

**Does this PR introduce a breaking change?**
- [x] No

**Additional context**
Some context on why some spectral messages contain new lines, asterisks, etc. The messages were originally written in markdown! This was so that we could display them nicely in Stoplight Next. I don't think this is really needed anymore with the new use case. In general the messaging syntax is still pretty ugly but at least now its consistently ugly!


Patch:
diff --git a/src/rulesets/oas/functions/oasPathParam.ts b/src/rulesets/oas/functions/oasPathParam.ts
index 134a9254..ac908550 100644
--- a/src/rulesets/oas/functions/oasPathParam.ts
+++ b/src/rulesets/oas/functions/oasPathParam.ts
@@ -30,12 +30,10 @@ export const oasPathParam: IFunction<Rule> = (targetVal, _options, paths, vals)
     const normalized = path.replace(pathRegex, '%'); // '%' is used here since its invalid in paths
     if (uniquePaths[normalized]) {
       results.push(
-        generateResult(
-          `The paths "**${uniquePaths[normalized]}**" and "**${path}**" are equivalent.
-
-To fix, remove one of the paths or merge them together.`,
-          [...paths.given, 'paths'],
-        ),
+        generateResult(`The paths \`${uniquePaths[normalized]}\` and \`${path}\` are equivalent.`, [
+          ...paths.given,
+          'paths',
+        ]),
       );
     } else {
       uniquePaths[normalized] = path;
@@ -51,11 +49,7 @@ To fix, remove one of the paths or merge them together.`,
         if (pathElements[p]) {
           results.push(
             generateResult(
-              `The path "**${path}**" uses the parameter "**{${p}}**" multiple times.
-
-Path parameters must be unique.
-
-To fix, update the path so that all parameter names are unique.`,
+              `The path \`${path}\` uses the parameter \`{${p}}\` multiple times. Path parameters must be unique.`,
               [...paths.given, 'paths', path],
             ),
           );
@@ -134,9 +128,7 @@ To fix, update the path so that all parameter names are unique.`,
       if (!topParams[p] && !operationParams[p]) {
         results.push(
           generateResult(
-            `The path "**${path}**" uses a parameter "**{${p}}**" that does not have a corresponding definition.
-
-To fix, add a path parameter with the name "**${p}**".`,
+            `The path \`${path}\` uses a parameter \`{${p}}\` that does not have a corresponding definition.`,
             [...paths.given, 'paths', path],
           ),
         );
@@ -152,14 +144,7 @@ To fix, add a path parameter with the name "**${p}**".`,
         if (!pathElements[p]) {
           const resPath = paramObj[p];
           results.push(
-            generateResult(
-              `Parameter "**${p}**" is not used in the path "**${path}**".
-
-Unused parameters are not allowed.
-
-To fix, remove this parameter.`,
-              [...paths.given, ...resPath],
-            ),
+            generateResult(`Parameter \`${p}\` is not used in the path \`${path}\`.`, [...paths.given, ...resPath]),
           );
         }
       }
@@ -176,16 +161,10 @@ function generateResult(message: string, path: Array<string | number>): IFunctio
   };
 }
 
-const requiredMessage = (
-  name: string,
-) => `Path parameter "**${name}**" must have a \`required\` that is set to \`true\`.
-
-To fix, mark this parameter as required.`;
-
-const uniqueDefinitionMessage = (name: string) => `Path parameter '**${name}**' is defined multiple times.
-
-Path parameters must be unique.
+const requiredMessage = (name: string) =>
+  `Path parameter \`${name}\` must have a \`required\` property that is set to \`true\`.`;
 
-To fix, remove the duplicate parameters.`;
+const uniqueDefinitionMessage = (name: string) =>
+  `Path parameter \`${name}\` is defined multiple times. Path parameters must be unique.`;
 
 export default oasPathParam;


Test patch:
diff --git a/src/rulesets/oas/functions/__tests__/oasPathParam.test.ts b/src/rulesets/oas/functions/__tests__/oasPathParam.test.ts
index 4dae5813..ba8c02bc 100644
--- a/src/rulesets/oas/functions/__tests__/oasPathParam.test.ts
+++ b/src/rulesets/oas/functions/__tests__/oasPathParam.test.ts
@@ -35,8 +35,7 @@ describe('oasPathParam', () => {
     expect(results).toEqual([
       {
         code: 'path-params',
-        message:
-          'The path "**/foo/{bar}**" uses a parameter "**{bar}**" that does not have a corresponding definition.\n\nTo fix, add a path parameter with the name "**bar**".',
+        message: 'The path `/foo/{bar}` uses a parameter `{bar}` that does not have a corresponding definition.',
         path: ['paths', '/foo/{bar}'],
         range: {
           end: {
@@ -131,9 +130,7 @@ describe('oasPathParam', () => {
     expect(results).toEqual([
       {
         code: 'path-params',
-        message: `The path "**/foo/{bar}/{bar}**" uses the parameter "**{bar}**" multiple times.\n
-Path parameters must be unique.\n
-To fix, update the path so that all parameter names are unique.`,
+        message: `The path \`/foo/{bar}/{bar}\` uses the parameter \`{bar}\` multiple times. Path parameters must be unique.`,
         path: ['paths', '/foo/{bar}/{bar}'],
         range: {
           end: {
@@ -174,7 +171,7 @@ To fix, update the path so that all parameter names are unique.`,
     expect(results).toEqual([
       {
         code: 'path-params',
-        message: `Path parameter \"**bar**\" must have a \`required\` that is set to \`true\`.\n\nTo fix, mark this parameter as required.`,
+        message: `Path parameter \`bar\` must have a \`required\` property that is set to \`true\`.`,
         path: ['paths', '/foo/{bar}', 'parameters'],
         range: {
           end: {
@@ -220,7 +217,7 @@ To fix, update the path so that all parameter names are unique.`,
     expect(results).toEqual([
       {
         code: 'path-params',
-        message: `The paths \"**/foo/{boo}**\" and \"**/foo/{bar}**\" are equivalent.\n\nTo fix, remove one of the paths or merge them together.`,
+        message: `The paths \`/foo/{boo}\` and \`/foo/{bar}\` are equivalent.`,
         path: ['paths'],
         range: {
           end: {