Skip to content

Yaml formatted output file in double quotes instead of single quotes #213

@shaunthomas999

Description

@shaunthomas999

Hello,

I use openapi-format to format my OAS file in yaml. Input file have double quotes but when using the openapi-format tool, output always comes with single quotes instead of double quotes. How to have the yaml output in double quotes?

Example input file

openapi: 3.0.1
info:
    title: Swagger
    license:
        name: Apache 2.0
        url: http://www.apache.org/licenses/LICENSE-2.0.html
    version: "1.0"
paths:
    /api/resources/{operation-name}:
        get:
            summary: getResources
            operationId: getResources
            parameters:
                - name: operation-name
                  in: path
                  required: true
                  schema:
                      type: string
            responses:
                "200":
                    description: getResourcesResponse
                    content:
                        application/json:
                            schema:
                                $ref: "#/components/schemas/GetResourcesResponse"

Example output file

openapi: 3.0.1
info:
    title: Swagger
    license:
        name: Apache 2.0
        url: http://www.apache.org/licenses/LICENSE-2.0.html
    version: '1.0'
paths:
    /api/resources/{operation-name}:
        get:
            summary: getResources
            operationId: getResources
            parameters:
                - name: operation-name
                  in: path
                  required: true
                  schema:
                      type: string
            responses:
                "200":
                    description: getResourcesResponse
                    content:
                        application/json:
                            schema:
                                $ref: '#/components/schemas/GetResourcesResponse'
  • version value was in double quotes in the input file. Got converted to single quotes.
  • $ref value was in double quotes in the input file. Also, got converted to single quotes.

-Shaun

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions