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

Solves #1166 #1179

Merged
merged 1 commit into from
Jul 13, 2022
Merged

Solves #1166 #1179

merged 1 commit into from
Jul 13, 2022

Conversation

ColdanR
Copy link
Contributor

@ColdanR ColdanR commented Jul 12, 2022

Added encoding as parameter to set output file encoding

@MikeEdgar MikeEdgar linked an issue Jul 12, 2022 that may be closed by this pull request
@@ -49,6 +49,7 @@ E.g. for includeDependenciesScopes could be configured as:
- `configProperties` (String) - Load any properties from a file. Example `${basedir}/src/main/resources/application.properties`.
- `attachArtifacts` (boolean, default: false) - Attach the built OpenAPI schema as build artifact.
- `skip` (boolean, default: false) - Skip execution of the plugin.
- `encoding` (String) - Encoding of output OpenAPI files.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can probably make the default UTF-8 to stay backward compatible ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@phillip-kruger, I thought the same thing, but previously it was using String#getBytes, which internally calls Charset.defaultCharset.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, but it should still be able to do this. Not sure if you can make these properties Optional ? If so , use Optional with empty setting to default

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default defaultValue in the @Parameter is an empty string. That flows into the (!StringUtils.isBlank(encoding)) check and then uses the platform default encoding.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok great !

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So then we can merge ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, lgtm!

/**
* Output encoding for openapi document.
*/
@Parameter(property = "encoding")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So here defaultValue = "UTF-8"

Copy link
Member

@phillip-kruger phillip-kruger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks !

@phillip-kruger phillip-kruger added this to the 3.1.0 milestone Jul 13, 2022
@phillip-kruger phillip-kruger merged commit d601b5b into smallrye:main Jul 13, 2022
@phillip-kruger phillip-kruger added the backport/2.x Issue pending backport to the 2.x series label Jul 13, 2022
@MikeEdgar MikeEdgar removed the backport/2.x Issue pending backport to the 2.x series label Jul 20, 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 this pull request may close these issues.

Support different encoding in smallrye-open-api-maven-plugin
3 participants