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

[BUG] The filter for operationId does not trim the input #20186

Open
4 of 5 tasks
danielalmqvist opened this issue Nov 26, 2024 · 0 comments
Open
4 of 5 tasks

[BUG] The filter for operationId does not trim the input #20186

danielalmqvist opened this issue Nov 26, 2024 · 0 comments

Comments

@danielalmqvist
Copy link

danielalmqvist commented Nov 26, 2024

Bug Report Checklist

  • Have you provided a full/minimal spec to reproduce the issue?
  • Have you tested with the latest master to confirm the issue still exists?
  • Have you searched for related issues/PRs?
  • What's the actual output vs expected output?
  • [Optional] Sponsorship to speed up the bug fix or feature request (example)
Description

If you use filter of operationIds and configure this in OpenApiNormalizer in a plugin such as the one from maven you might want to use newlines to make it more readable, but this is not supported at the moment.

openapi-generator version

Latest 7.10.0

Generation Details

<openapiNormalizer> FILTER=operationId: addPet| getPetById </openapiNormalizer>

Steps to reproduce

Use openapiNormalizer and FILTER and set them on separate lines.
Expected the operationIdFilters to contain addPet and getPetById.
Actually the operationIdFilters contains addPet and \n\t\t\t\t\t\t\tgetPetById

Related issues/PRs

Not what I can find

Suggest a fix

Instead of
operationIdFilters = new HashSet<>(Arrays.asList(filterStrs[1].split("[|]")));
use
Arrays.stream(filterStrs[1].split("[|]")) .filter(Objects::nonNull) .map(String::trim) .collect(Collectors.toSet());

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant