Skip to content

Conversation

@pkubowicz
Copy link
Contributor

@pkubowicz pkubowicz commented Dec 29, 2025

This is a test for a regression from #22512 where param values were written as a list.

The test passes when the change to ApiClient.kt is reverted. Fails on the regression:

Expected :/pet/findByStatus?status=pending,available
Actual   :/pet/findByStatus?status=%5Bpending%2Cavailable%5D

Expected :/user/login?username=myUsername&password=myPassword
Actual   :/user/login?username=%5BmyUsername%5D&password=%5BmyPassword%5D

PR checklist

  • Read the contribution guidelines.
  • Pull Request title clearly describes the work in the pull request and Pull Request description provides details about how to validate the work. Missing information here may result in delayed response from the community.
  • Run the following to build the project and update samples:
    ./mvnw clean package || exit
    ./bin/generate-samples.sh ./bin/configs/*.yaml || exit
    ./bin/utils/export_docs_generators.sh || exit
    
    (For Windows users, please run the script in WSL)
    Commit all changed files.
    This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
    These must match the expectations made by your contribution.
    You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example ./bin/generate-samples.sh bin/configs/java*.
    IMPORTANT: Do NOT purge/delete any folders/files (e.g. tests) when regenerating the samples as manually written tests may be removed.
  • File the PR against the correct branch: master (upcoming 7.x.0 minor release - breaking changes with fallbacks), 8.0.x (breaking changes without fallbacks)
  • If your PR solves a reported issue, reference it using GitHub's linking syntax (e.g., having "fixes #123" present in the PR description)
  • If your PR is targeting a particular programming language, @mention the technical committee members, so they are more likely to review the pull request.

@karismann @Zomzog @andrewemery @4brunu @yutaka0m @stefankoppier @e5l

I did not run generators because it fails:

[pool-1-thread-14] Generation failed for csharp: (IllegalArgumentException) The input (net10.0) contains Invalid .NET framework version: net10.0. List of supported versions: netstandard1.3, netstandard1.4, netstandard1.5, netstandard1.6, netstandard2.0, netstandard2.1, net47, net48, net8.0, net9.0
java.lang.IllegalArgumentException: The input (net10.0) contains Invalid .NET framework version: net10.0. List of supported versions: netstandard1.3, netstandard1.4, netstandard1.5, netstandard1.6, netstandard2.0, netstandard2.1, net47, net48, net8.0, net9.0
        at org.openapitools.codegen.languages.CSharpClientCodegen.processOpts(CSharpClientCodegen.java:818)


Summary by cubic

Adds Kotlin integration tests to verify query parameter encoding in the Spring RestClient and catch the regression from #22512 where values were wrapped as lists. Tests cover PetApi findByStatus (comma-separated list) and UserApi login (single values).

  • Dependencies
    • Add spring-boot-test for MockServerRestClientCustomizer.

Written for commit 6767688. Summary will update automatically on new commits.

This is a test for a regression from OpenAPITools#22512 where param values
were written as a list.
Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 3 files

implementation "com.fasterxml.jackson.module:jackson-module-kotlin:2.20.0"
implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.20.0"
implementation "org.springframework.boot:spring-boot-starter-web:$spring_boot_version"
testImplementation "org.springframework.boot:spring-boot-test:$spring_boot_version"
Copy link
Member

Choose a reason for hiding this comment

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

thanks for the PR

i think we will need to update the build.gradle mustache template as well to include this testImlementation.

Copy link
Contributor Author

@pkubowicz pkubowicz Dec 30, 2025

Choose a reason for hiding this comment

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

Yes, I was afraid I was editing in a wrong place, but I could not find a better place for integration tests. I wanted to demonstrate the regression quickly.

I think integration tests (checking what URLs are hit, with what request body string) are very important. With Spring Mock Server, it's easy to write such tests with very little code, and they are also very fast (no port is opened, all happens inside JVM). I would be happy if the integration test suite grows somewhere in the future.

I don't know if integration tests should be part of samples (there are many sample projects, making finding and modifying all integration tests relevant to a feature harder). If you show me a 'cleaner' way to plug in my tests, I am happy to modify my PR.

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.

2 participants