Open Mcourt opened 4 years ago
This seems to be a bug in the js-yaml package. See: https://github.com/nodeca/js-yaml/issues/530
Tried it with your example:
node -e "console.log(require('js-yaml').safeDump({example: '0612345678'}))"
// example: 0612345678
Using only digits below 8 (octal digits) seems to work fine:
node -e "console.log(require('js-yaml').safeDump({example: '0612345677'}))"
// example: '0612345677'
Describe the bug My examples are being converted to integers although they should be strings (ex: phone numbers). This causes problem when validating my openapi file, as the parameter is set as "string" but has a number as example.
To Reproduce
openapi: 3.0.0 info: title: My title version: 1.0.0 paths: /my/route: post: summary: My route requestBody: content: application/json: schema: type: object properties: phone: type: string example: 0612345678 required: true responses: '204': description: No Content '400': description: Bad Request