forked from loafle/openapi-generator-original
Add standalone C++ server using cpp-httplib for OpenAPI-based APIs (#21724)
Supports: All OpenAPI 3.x data types: primitives, arrays, enums, nullable/optional fields, nested objects All parameter types: path, query, header, cookie, and combinations Schema composition: allOf (inheritance), oneOf (discriminated unions), anyOf (flexible unions) Security schemes: API key and bearer token authentication Discriminator-based polymorphic deserialization and error handling Provides: Error handling for invalid JSON, type mismatches, missing/unknown discriminator, and parameter validation Build system integration (CMake) for easy compilation and linking with required dependencies Clear build and run instructions for local development and testing Enables comprehensive, real-world validation of generated C++ server code against OpenAPI specifications
This commit is contained in:
59
.github/workflows/samples-cpp-httplib-server.yaml
vendored
Normal file
59
.github/workflows/samples-cpp-httplib-server.yaml
vendored
Normal file
@@ -0,0 +1,59 @@
|
||||
name: Samples cpp httplib server
|
||||
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- "samples/server/petstore/cpp-httplib-server/**"
|
||||
- ".github/workflows/samples-cpp-httplib-server.yaml"
|
||||
pull_request:
|
||||
paths:
|
||||
- "samples/server/petstore/cpp-httplib-server/**"
|
||||
- ".github/workflows/samples-cpp-httplib-server.yaml"
|
||||
|
||||
env:
|
||||
GRADLE_VERSION: 6.9
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build cpp httplib server
|
||||
strategy:
|
||||
matrix:
|
||||
sample:
|
||||
- samples/server/petstore/cpp-httplib-server/petstore
|
||||
- samples/server/petstore/cpp-httplib-server/feature-test
|
||||
os:
|
||||
- ubuntu-latest
|
||||
- macOS-latest
|
||||
- windows-latest
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Install dependencies (Linux)
|
||||
if: matrix.os == 'ubuntu-latest'
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y build-essential libssl-dev zlib1g-dev cmake
|
||||
|
||||
- name: Install dependencies (macOS)
|
||||
if: matrix.os == 'macOS-latest'
|
||||
run: |
|
||||
brew install openssl zlib cmake
|
||||
|
||||
- name: Install dependencies (Windows)
|
||||
if: matrix.os == 'windows-latest'
|
||||
run: |
|
||||
vcpkg install openssl:x64-windows zlib:x64-windows
|
||||
shell: cmd
|
||||
timeout-minutes: 20
|
||||
|
||||
- name: Build
|
||||
working-directory: ${{ matrix.sample }}
|
||||
run: |
|
||||
if [ "${{ matrix.os }}" = "windows-latest" ]; then
|
||||
cmake -S . -B build -DCMAKE_TOOLCHAIN_FILE="C:/vcpkg/scripts/buildsystems/vcpkg.cmake"
|
||||
else
|
||||
cmake -S . -B build
|
||||
fi
|
||||
cmake --build build --verbose
|
||||
shell: bash
|
||||
Reference in New Issue
Block a user