[BUG] Parameter example strings rendered without quotes in docs
Created by: timbedard
Description
For several generators (tested Python, Java, and JavaScript), parameter example
strings are rendered without quotes for example code in docs, resulting in invalid example code. It's worth noting that values for the default
property of parameters are rendered correctly.
openapi-generator version
4.0.0
OpenAPI declaration file content or url
openapi: "3.0.0"
info:
version: 1.0.0
title: Status Check API
paths:
/check/{target}:
get:
summary: Check Pass/Fail Status
operationId: checkStatus
parameters:
- name: target
in: path
description: target whose status will be checked
required: true
schema:
type: string
example: potato # or 'potato'
responses:
default:
description: Status
content:
application/json:
schema:
$ref: "#/components/schemas/Status"
components:
schemas:
Status:
type: object
required:
- pass
properties:
pass:
type: boolean
description:
type: string
example: 'out to pasture'
Command line used for generation
openapi-generator generate --i openapi.yaml --g python
Steps to reproduce
- Create a declaration that includes a path with a string parameter that has an example and no default.
- Run the above command and look at the API docs. The example code will not wrap the example value in quotes.
Suggest a fix
I can't seem to figure out what's causing it, so I'm not sure what to suggest.