Skip to content

Do not split on spaces for properties which take a comma-separated list of values#316

Merged
santam85 merged 2 commits intomainfrom
bugfix/allow-spaces-in-tag-names
Aug 22, 2022
Merged

Do not split on spaces for properties which take a comma-separated list of values#316
santam85 merged 2 commits intomainfrom
bugfix/allow-spaces-in-tag-names

Conversation

@daiscog
Copy link
Copy Markdown
Contributor

@daiscog daiscog commented Aug 15, 2022

Splitting on spaces causes issues where a value contains a legitimate space.

For example, an operation could have a tag with a space in it. Passing that tag to the apisToGenerate config property causes it to be interpreted as two separate tags and therefore it is omitted from the generated APIs.

if (isNotEmpty(text)) {
return stream(text.split("[,;\\s]+"))
return stream(text.split("[,;]+"))
.map(StringUtils::trimToNull)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Could be worth extending this test to that oas-examples/petstore.yaml contains tags with white space?

mojo.inputSpec = "src/test/resources/oas-examples/petstore.yaml";

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I've had a quick look at that test file and I'm not really sure how best to test that the tags are properly split, to be honest.

@bartveenstra, would welcome any pointers you may have?

@ngohungphuc
Copy link
Copy Markdown
Contributor

ngohungphuc commented Aug 15, 2022

Please add small release note to a readme @daiscog for your changed. Thank you

@brianvabb brianvabb requested a review from nlr234 August 15, 2022 12:09
@daiscog daiscog requested a review from ngohungphuc August 15, 2022 16:23
@sonarqubecloud
Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@santam85 santam85 merged commit 858f6b8 into main Aug 22, 2022
@santam85 santam85 deleted the bugfix/allow-spaces-in-tag-names branch August 22, 2022 06:50
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.

4 participants