Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG][Openapi-yaml] Single quotes are deleted in examples #4365

Open
5 of 6 tasks
jorgerod opened this issue Nov 4, 2019 · 1 comment
Open
5 of 6 tasks

[BUG][Openapi-yaml] Single quotes are deleted in examples #4365

jorgerod opened this issue Nov 4, 2019 · 1 comment

Comments

@jorgerod
Copy link
Contributor

jorgerod commented Nov 4, 2019

Bug Report Checklist

  • Have you provided a full/minimal spec to reproduce the issue?
  • Have you validated the input using an OpenAPI validator (example)?
  • What's the version of OpenAPI Generator used?
  • Have you search for related issues/PRs?
  • What's the actual output vs expected output?
  • [Optional] Bounty to sponsor the fix (example)
Description

I use the generator openapi-yaml for merge serveral yaml files into one. The bug is that the generator remove de simple quotes in examples.

openapi-generator version

4.1.3, 4.2.0

OpenAPI declaration file content or url

Simplified input file:

openapi: 3.0.1
info:
  title: ping test
  version: '1.0'
servers:
  - url: 'http://localhost:8000/'
paths:
  /search:
    get:
      operationId: search
      parameters:
        - name: date
          in: query
          description: The date of the document.
          example: '2019-08-06T13:40:43.449Z'
          required: true
          schema:
            type: string
            format: date-time
      responses:
        '201':
          description: OK
Command line used for generation

java -jar openapi-generator-cli.jar generate -g openapi-yaml -i openapi.yml

Steps to reproduce

Run the above command
Expected output:

...
     parameters:
        - name: date
          in: query
          description: The date of the document.
          example: '2019-08-06T13:40:43.449Z'
...

Actual output:

...
     parameters:
        - name: date
          in: query
          description: The date of the document.
          example: 2019-08-06T13:40:43.449Z
...
@jimklo
Copy link

jimklo commented Apr 14, 2020

This may be a duplicate of #3196
Either way it appears related as the stripping of the quotes from the original YAML is causing issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants