OpenAPITools / OpenAPITools/openapi-generator

[BUG] [dart-dio] Output document is not enclosed in symbols when example is a String type

Open
#15,243 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Issue: Bug
Dominant language
Java
Stars
26.8k
Forks
7.7k
PR merge metrics
PR metrics pending

Description

Description

Output document is not enclosed in symbols when example is a String type.

Input
# openapi-3.0.yaml
openapi: 3.0.3
...
paths:
  /test:
    get:
      parameters:
        - name: query
          in: query
          required: true
          schema:
            type: string
            example: This is a sample string
      responses:
        "200":
          description: description
...
Outout
// Example code in doc/DefaultApi.md
...
final api = TestOpenapiDart().getDefaultApi();
final String query = This is a sample string; // String | 
...
Expected Output
// Example code in doc/DefaultApi.md
...
final api = TestOpenapiDart().getDefaultApi();
final String query = 'This is a sample string'; // String | 
...
openapi-generator version

6.3.0

OpenAPI declaration file content or url

java -jar openapi-generator-cli.jar generate -g dart-dio ...

Generation Details
Related issues/PRs
Suggest a fix

Check the type and add a symbol if it is a String.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the dart-dio generator using the supplied OpenAPI YAML and CLI command, then inspect the generated doc/DefaultApi.md. Compare the String example with the expected quoted output; done means String examples are enclosed in quotes while other types remain unchanged.

Written by the indexing model from the issue text.

Assessment

Tech stack
dart, java
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.