OpenAPITools / OpenAPITools/openapi-generator

[BUG] Description

Open
#9,245 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

Bug Report Checklist
Description

When attempting to compile the code generated for https://developer.atlassian.com/cloud/jira/platform/swagger.v3.json the error "illegal escape character" is showing up in numerous locations. I am using the following options in my maven plugin:

For example, the generated class com.atlassian.jira.software.api.RemotelinksApi, there is a method argument annotion that looks like this:

@ApiParam("Free-form query parameters to specify which properties to delete by. Properties refer to the arbitrary information the provider tagged Remote Links with previously.  For example, if the provider previously tagged a remote link with accountId:   \"properties\": {     \"accountId\": \"account-123\"   }  And now they want to delete Remote Links in bulk by that specific accountId as follows: e.g. DELETE /bulkByProperties?accountId=account-123 ")

Which doesn't compile. The \" within the spec has become &quote;
I think either the \" should be retained or the &quote; shouldn't be prefixed by the \

openapi-generator version

5.1.0 of the maven plugin

OpenAPI declaration file content or url

https://developer.atlassian.com/cloud/jira/platform/swagger.v3.json

Generation Details

jaxrs-spec, using the maven plugin (see below)

Steps to reproduce

Here is a extract of my POM https://gist.github.com/taroquu/724c377a9ffd8ed273db7a16406b60bf
If you try to run it clean package you'll get the issue.

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 linked swagger.v3.json and the Maven plugin configuration in the referenced POM gist, then run clean package to reproduce the generated RemotelinksApi output. Trace how the annotation text becomes escaped in the generated Java source; done means the generated classes compile without illegal escape character errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, openapi
Domain
api, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.