-
Notifications
You must be signed in to change notification settings - Fork 141
Open
Description
I tried to use "prettier.io" on my api-doc.yml.
Here is a simplified snippet of my original yml which works:
swagger: '2.0'
host: localhost:4000
basePath: /
info:
title: Sample
version: '3.0.0'
securityDefinitions:
Bearer:
type: apiKey
name: Authorization
in: header
definitions:
Error:
additionalProperties: true
paths:
/participant-organizations/{participantOrganizationId}/policies/validation/{recordType}:
parameters:
- name: participantOrganizationId
in: path
type: string
required: true
description: OrganizationId
- name: recordType
in: path
type: string
required: true
description: specified type of record
put:
tags:
- Validation Policy
description: Update validation policy for the record type
operationId: updateValidationPolicy
security:
- Bearer: []
parameters:
- name: validation policy
in: body
schema:
$ref: "#/definitions/ValidationPolicy"
responses:
201:
description: validation policy was updated
After running the formatter, the yml looks like:
swagger: "2.0"
host: localhost:4000
basePath: /
info:
title: Sample
version: "3.0.0"
securityDefinitions:
Bearer:
type: apiKey
name: Authorization
in: header
definitions:
Error:
additionalProperties: true
paths:
? /participant-organizations/{participantOrganizationId}/policies/validation/{recordType}
: parameters:
- name: participantOrganizationId
in: path
type: string
required: true
description: OrganizationId
- name: recordType
in: path
type: string
required: true
description: specified type of record
put:
tags:
- Validation Policy
description: Update validation policy for the record type
operationId: updateValidationPolicy
security:
- Bearer: []
parameters:
- name: validation policy
in: body
schema:
$ref: "#/definitions/ValidationPolicy"
responses:
201:
description: validation policy was updated
Notice the syntax ? /participant-organizations/{participantOrganizationId}/policies/validation/{recordType}?
According to this thread, this is valid syntax: prettier/prettier#5599 (comment)
However, after these changes my server does not start:
/Users/nathanh/Git/my-project/services/core/node_modules/yamljs/lib/Parser.js:270
throw new ParseException('Unable to parse.', this.getRealCurrentLineNb() + 1, this.currentLine);
^
Error: Unable to parse.
npm ERR! code ELIFECYCLE
Metadata
Metadata
Assignees
Labels
No labels