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

Blutorange patch 1 #1159

Merged
merged 2 commits into from
May 31, 2023
Merged

Blutorange patch 1 #1159

merged 2 commits into from
May 31, 2023

Conversation

HugoMario
Copy link
Contributor

No description provided.

blutorange and others added 2 commits March 10, 2022 22:32
When e.g. the Accept-Header contains special characters such as `=`, mustache escapes them, which results in code like this to be generated:

```java
// MyApi.java
public interface MyApi extends ApiClient.Api {
  @RequestLine("GET /rest/protected/items?size={size}&page={page}")
  @headers({
      "Content-Type: */*",
      "Accept: application/com.example+json; version=1.0; charset=utf-8,application/com.example+xml; version=1.0; charset=utf-8,application/json; charset=utf-8,application/xml; charset=utf-8",
  })
  LicenseListResource getLicenses(@QueryMap(encoded=true) Map<String, Object> queryParams);
}
```

Note the `Accept: application/com.example+json; version&#x3D;1.0; charset&#x3D;utf-8` with the escaped `=`, which does not work. This disables HTML escaping for the header values.

On a side note though, I had been wondering whether HTML escaping makes sense when generating Java files? It does in JavaDocs I suppose, but shouldn't it be disabled everywhere else?
@HugoMario HugoMario merged commit ae3b978 into master May 31, 2023
@HugoMario HugoMario deleted the blutorange-patch-1 branch May 31, 2023 12:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants