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][JAVA-WIREMOCK] improper escaping of example responses #17724

Open
5 of 6 tasks
martin-mfg opened this issue Jan 27, 2024 · 0 comments
Open
5 of 6 tasks

[BUG][JAVA-WIREMOCK] improper escaping of example responses #17724

martin-mfg opened this issue Jan 27, 2024 · 0 comments

Comments

@martin-mfg
Copy link
Contributor

Bug Report Checklist

  • Have you provided a full/minimal spec to reproduce the issue?
  • Have you validated the input using an OpenAPI validator (example)?
  • Have you tested with the latest master to confirm the issue still exists?
  • Have you searched for related issues/PRs?
  • What's the actual output vs expected output?
  • [Optional] Sponsorship to speed up the bug fix or feature request (example)
Description

In the java-wiremock generator, conversion of example responses to strings can lead to uncompilable output due to improper escaping.

openapi-generator version

latest master

OpenAPI declaration file content or url
openapi: 3.0.3
info:
  version: 1.0.0
  title: OpenAPI Petstore
paths:
  /:
    get:
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                type: object
                properties:
                  dummyProp:
                    type: string
                    example: '"' # this causes problems

Compiling the generated output results in

[ERROR] src/main/java/org/openapitools/mockserver/api/DefaultApiMockServer.java:[39,40] illegal character: '\'
Generation Details

use generator "java-wiremock", with no additional settings

Related issues/PRs

originally discovered in #17614

possibly related issues: #3140, #1691

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

1 participant