Skip to content

Conversation

@KRJ-RTX
Copy link

@KRJ-RTX KRJ-RTX commented Nov 12, 2025

This pull request continues the work from #19978 by @mowijo.
I’ve updated the branch, and resolved the remaining issues. I ran mvn integration-test -f samples/server/petstore/cpp-pistache/pom.xml which passed.

Summary of changes:

Changed indentation levels for readability.

The integration test failed due to defines not being declared when calling the
'static_assert(HTTP_BASIC_AUTH_DEFINED + HTTP_BEARER_AUTH_DEFINED < 2, "Path '" REST_PATH "' has more than one security scheme specified, and the Pistache server generator does not support that.");'

Closes #19978

Thanks again to @mowijo for the initial contribution!

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.

@wing328
Copy link
Member

wing328 commented Nov 12, 2025

thanks for the PR to fix the remaining issue in another PR.

will review and get it merged

@wing328
Copy link
Member

wing328 commented Nov 12, 2025

did a quick test locally but got

hare/cmake/nlohmann_json/nlohmann_jsonConfigVersion.cmake
-- Up-to-date: /mnt/c/Users/User/code/openapi-generator/samples/server/petstore/cpp-pistache/external/share/cmake/nlohmann_json/nlohmann_jsonTargets.cmake
-- Up-to-date: /mnt/c/Users/User/code/openapi-generator/samples/server/petstore/cpp-pistache/external/share/pkgconfig/nlohmann_json.pc
make[3]: warning:  Clock skew detected.  Your build may be incomplete.
[ 21%] Completed 'NLOHMANN'
make[2]: warning:  Clock skew detected.  Your build may be incomplete.
[ 28%] Built target NLOHMANN
HEAD is now at 5a713d4 Merge pull request #1324 from pistacheio/test-missing-fstream
Already up to date.
[ 31%] No patch step for 'PISTACHE'
[ 34%] Performing configure step for 'PISTACHE'
-- RapidJSON found. Headers: /usr/local/include
-- Configuring done
CMake Error at tests/CMakeLists.txt:25 (add_executable):
  Target "run_mime_test" links to target "GTest::gmock_main" but the target
  was not found.  Perhaps a find_package() call is missing for an IMPORTED
  target, or an ALIAS target is missing?
Call Stack (most recent call first):
  tests/CMakeLists.txt:76 (pistache_test)

did you encounter similar issues locally?

@wing328 wing328 added this to the 7.18.0 milestone Nov 12, 2025
@wing328 wing328 changed the title Fix for stale PR #19978 Add Basic and Bearer Authorization to the CPP Pistache generator #19978 Nov 12, 2025
@wing328 wing328 changed the title Add Basic and Bearer Authorization to the CPP Pistache generator #19978 Add Basic and Bearer Authorization to the CPP Pistache generator Nov 12, 2025
@KRJ-RTX
Copy link
Author

KRJ-RTX commented Nov 12, 2025

Yes, at first. I did not have GTEST installed but after installing GoogleTest and GoogleMock libraries I did not see this error. I did something similar to:

Clone the repository

git clone https://github.com/google/googletest.git
cd googletest

Build and install

cmake -S . -B build
cmake --build build
sudo cp -r build/lib/* /usr/local/lib/
sudo cp -r googletest/include /usr/local/include/gtest
sudo cp -r googlemock/include /usr/local/include/gmock

I got some "libevent" errors somewhere else and installed

sudo apt-get update
sudo apt-get install libevent-dev

I am not sure if it is intended that these should be installed. Please let me know!

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants