* [OCaml] Fix bugs around enum parsing
Problem: The OCaml client generator threw IllegalArgumentException: Unreferenced enum when encountering enums inside composed schemas
(anyOf/allOf/oneOf).
Root Causes:
1. The enum collection logic didn't traverse into composed schemas
2. The enum hashing used order-dependent string concatenation, causing lookups to fail when enum values appeared in different orders
3. Enums directly within composed schema branches (not in properties) weren't collected
Solution:
1. Added composed schema support:
- New `collectEnumSchemasFromComposed()` method handles `anyOf/allOf/oneOf`
- New `collectEnumSchemasFromList()` method recursively processes composed schema branches
- Enums directly in composed schemas (not just in properties) are now collected
2. Refactored enum hashing to use Set:
- Changed from comma-joined strings to `TreeSet<String>` for order-independent, collision-free hashing
- Handles edge cases like empty string enums `""`
3. Added test case:
- Tests enums in nested composed schemas
- Tests enum with empty string value in anyOf
* OCaml: Add support for direct recursive types
* OCaml: Fix enums in anyOf
* OCaml: fix recursive types
* Fix recursion tests
* Fix recursive types, improve tests
* [OCaml] Improve title of generated README.md
* add 'useJackson3' option
* add 'useSpringBoot4' option
* add support for RestClient in spring-http-interfaces
* add 'jacksonPackage' template variable set from useJackson3 option
See #22294
* [new] Add Terraform provider generator
Add a new experimental code generator that produces HashiCorp Terraform
providers from OpenAPI specifications using the Plugin Framework SDK.
The generator (terraform-provider) supports:
- CRUD operation detection from REST patterns and vendor extensions
- Resource, data source, and model generation per API tag
- HTTP client with API key, bearer token, and basic auth
- Type mapping from OpenAPI/Go types to Terraform schema types
- Import state support
- Configurable provider name, registry address, and version
Includes mustache templates for: provider, resources, data sources,
models, client, go.mod, GNUmakefile, README, and example configs.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* [new] Add Terraform provider petstore sample and acceptance tests
Add sample generation config and generated Terraform provider for the
petstore OpenAPI spec, along with Go acceptance tests that exercise
the provider lifecycle (create, read, update, delete, import).
Generated output includes:
- Provider with auth configuration (API key, bearer, basic)
- Pet, User, and Store resources and data sources
- Client package with HTTP client and model structs
- Go acceptance tests using terraform-plugin-testing
- Example Terraform configurations for each resource/data source
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* chore: docs
* terraform: add more sample tests and ci workflow
* ci: get ci passing
* ci: fixes
* chore: docs
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
* Update rust-server examples to have namespaces by API name. Preventing warnings about clashing example names
* Update rust-server-deprecated examples to have namespaces by API name. Preventing warnings about clashing example names
* Fixup compilation errors
* fix: Resolve bug in header parsing when parsing multi-item headers
* add x-kotlin-implements
* implement tests
* update samples
* fix tests - forbidden api issue
* add samples
* add samples. use Pageable only for server-side
* add support for auto-detecting x-spring-paginated in Spring Boot operations
* fix maven dependencies import
* add unit tests
* add support for vendor extension
* remove files
* fix samples
* fix docs
* implement suggestions from CR. Fix declarative interface naming.
* move import around
* add x-operation-extra-annotation
* make sure the PageableAsQueryParam does not remove already present x-operation-extra-annotation content
* support also list format
* regenerate samples and docs
* regenerate samples and docs
* force tests rerun
* remove files
* add files
* trigger test rerun
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
* fix(java/feign): handle binary response types in ApiResponseDecoder
The Feign library's ApiResponseDecoder routes all responses through
JacksonDecoder, including binary ones (File, byte[], InputStream).
This causes JsonParseException when an endpoint returns non-JSON
content (e.g. PDF, ZIP, images).
Add binary type detection and handling before delegating to
JacksonDecoder. This applies to both direct return types and
ApiResponse<T> wrappers.
Consistent with the native library fix in #21346.
Closes#2486
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix: address code review feedback
- Sanitize Content-Disposition filename to prevent path traversal
(Paths.get(filename).getFileName() strips directory components)
- Add null check for response.body() to handle 204/205 empty responses
- Fix regex to support quoted filenames with spaces
(e.g. filename="my invoice.pdf")
* fix: regenerate feign-hc5 sample with updated ApiResponseDecoder
The feign-hc5 sample was missed during the second commit's regeneration
because setTemplateDir("feign") overrides the filesystem templateDir
from the config, causing the generator to use embedded JAR resources.
After rebuilding the JAR with the updated mustache template, the
feign-hc5 sample now matches feign and feign-no-nullable.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
* [php-symfony] do not interpret sequential escape
* chore: update samples
* refactor: add missing return type
* [php-symfony] make template compatible with Symfony 8
* feat(python): enhance retry configuration in REST client
Updated the retry parameter in the Configuration class to support different types based on the library used (urllib3 or asyncio). Adjusted the RESTClientObject to handle the new retry configuration, allowing for more flexible retry options. This change improves the handling of retries in API requests, ensuring compatibility with various retry strategies.
* add samples
* use async context for retry doc string
* [Java] add missing nullable judgement when required property is true
* [Java] add okhttp template test and regenerate sample
* [Java] add tests when field is nullable and required
* [Java] regenerate samples to fix pipeline error
* [Java] add JSONTest fro RequiredNullableBody class
* run generate-samples after rebase
* review feedback
* review feedback
* fix test
* update hash of test file
---------
Co-authored-by: weirdo0314 <2019215183@stu.cqupt.edu.cn>
* BUG:21187 put back hardcoded client without the issue created in 8484
* BUG:21187 put back hardcoded client without the issue created in 8484
---------
Co-authored-by: Sri Sushma Karra <srisushmakarra@Sris-MacBook-Air.local>
* [kotlin][jvm-okhttp4] Fix multipart/form-data with JSON content-type
Fixes#16457
Fixes two critical bugs in multipart/form-data handling when parts
have Content-Type application/json:
1. IllegalArgumentException: OkHttp throws "Unexpected header: Content-Type"
because Content-Type was passed in headers map instead of via
asRequestBody(mediaType)/toRequestBody(mediaType) parameter.
2. Invalid JSON serialization: Non-file parts with application/json
Content-Type were serialized using toString() instead of proper
JSON serialization, producing invalid output like:
"MyObject(field1=value, field2=123)" instead of
'{"field1":"value","field2":123}'
Changes:
- Filter Content-Type from headers before passing to OkHttp
- Check part Content-Type and use appropriate serializer (JSON vs toString)
- Add integration tests with echo server to verify fix
- Support all serialization libraries (gson, moshi, jackson, kotlinx)
Fixes issues with multipart endpoints that mix file uploads with
JSON metadata, common in REST APIs for document/image uploads.
* Run mvn clean/package, and regenerate samples
* Add fix for kotlinx serialisation issue
* Refactor multipart helpers for reified type parameter support
* Fix kotlinx.serialization multipart by adding serializer lambda to PartConfig
* Fix internal Ktor API usage in multipart forms