This commit modifies BeanOutputParser to utilize the newly introduced LineEndingsNormalizer utility, ensuring all platform-specific line endings are normalized to LF (Unix-style). The LineEndingsNormalizer is designed to perform a no-op if the platform's default line ending matches the specified target line ending.
This change addresses and fixes BeanOutputParserTest failures observed on the Windows platform by ensuring consistent line ending normalization across different operating systems.
Note: There are failures in spring-ai-weaviate-store on Windows as well but I'd prefer to submit that as its own PR since its a different sub-module. I think it's better to keep this PR focused.
Thank you for taking time to contribute this pull request! You might have already read the [contributor guide][1], but as a reminder, please make sure to:
- Sign the contributor license agreement [done]
- Rebase your changes on the latest
main
branch and squash your commits [done] - Add/Update unit tests as needed [done]
- Run a build and make sure all tests pass prior to submission [done: mac and windows]
Comment From: markpollack
I found a simpler way to do this, so modified your PR. I think it is probably a false negative on windows anyway, since the text that would get sent over the wire would generate the correct response from the AI model (at least for chatgpt). The line endings in in the string literal are causing this. In any case, the behavior is now to only emit \n
in the json schema string.
Thanks for bringing it up and the PR.
fixed in 1c222a695c7bec9e853dd213ce35c866bda16806