swagger-cli icon indicating copy to clipboard operation
swagger-cli copied to clipboard

swagger-cli bundle -t yaml results in invalid example.

Open jjjasper opened this issue 5 years ago • 0 comments

When bundling a spec that has references to examples in json files some numbers that should appear as string are written as number.

fi. the spec

                      properties:
                        branchCode:
                          maxLength: 11
                          type: string
                          description: 'Code to identify a branch, e.g. ABA or BIC'

my example json

{
   "branchCode": "0123456789"
}

the example in the bundled yaml

   brancheCode: 0123456789

Current workaround, bundle as json, convert to yaml using yamljs v0.3.0

swagger-cli bundle -t json -o openapi.json
json2yaml -s -d 99 openapi.json

jjjasper avatar Oct 16 '20 07:10 jjjasper