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

Support different encoding in smallrye-open-api-maven-plugin #1166

Closed
ColdanR opened this issue Jun 28, 2022 · 2 comments · Fixed by #1179
Closed

Support different encoding in smallrye-open-api-maven-plugin #1166

ColdanR opened this issue Jun 28, 2022 · 2 comments · Fixed by #1179

Comments

@ColdanR
Copy link
Contributor

ColdanR commented Jun 28, 2022

Hello,
I'm currently setting up an automated documentation for OpenAPI, but on Windows 10 the plugin exports the schema files with a different encoding than UTF8. (System Default)

Looking up the code the generated documentation will be transformed to an byte array without usage of encoding.

writeSchemaFile(directory, "yaml", yaml.getBytes());
writeSchemaFile(directory, "json", json.getBytes());

So please allow to configure encoding or use utf-8 encoding as default.

Charset charset = StandardCharsets.UTF_8;
if (charsetParameter != null) {
try {
    charset = Charset.forName(charsetParameter);
} catch (IllegalArgumentException e) {
    throw new MojoExecutionException("Cannot find charset for " + charsetParameter);
}
}

writeSchemaFile(directory, "yaml", yaml.getBytes(charset));
writeSchemaFile(directory, "json", json.getBytes(charset));

Thanks,
Bernd Schmidt

@phillip-kruger
Copy link
Member

Hi Bernd, thanks for the issue. Are you not keen to do a PR to fix this ?

@ColdanR
Copy link
Contributor Author

ColdanR commented Jul 3, 2022

Hi Phillip,
currently I don't have the time to do so. I also didn't find any information about contributing. Would be nice, if you can add a code of conduct and contribution.md file für information.
I will try to find some time next week.

@MikeEdgar MikeEdgar linked a pull request Jul 12, 2022 that will close this issue
phillip-kruger added a commit that referenced this issue Jul 13, 2022
MikeEdgar pushed a commit to MikeEdgar/smallrye-open-api that referenced this issue Jul 17, 2022
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 a pull request may close this issue.

2 participants