* [cpp][pistache-server] Add extraction and forwarding of credentials for HTTP Basic protected endpoints.
* [cpp][pistache-server] Change HTTP Basic credentials to be contained on a struct instead of two std::strings
* [cpp][pistache-server] Add callbacks to authenticate http basic credentials.
* [cpp][pistache-server] Add `void* userdata` to HttpBasicCredentials.
This allows for data ft be passed on from the authenticator to the
handler implementation. For example a userid that has already been
looked up
* [cpp][pistache-server] Add support for HTTP Bearer authentication.
* [cpp][pistache-server] Add new file `api-base-source.mustache`
`api-base-source.mustache` contain implementations of security
related methods and also the empty constructor.
* [cpp][pistache-server] Add re-generated samples.
* Fix PR 19978: Updated indentation levels and fixed test problems
---------
Co-authored-by: Morten Winkler <morten@winkler.dk>
Passing `stringEnums=false` was incorrectly treated as `true`. This went unnoticed since the default behavior works as expected. Made the logic consistent with `typescript-axios`.
* fix(java): add header parameter handling for google-api-client
Header parameters defined in OpenAPI specs were being accepted as method
parameters but never actually added to the HTTP request.
Fixes#22457
* update samples
* minor enhancement
---------
Co-authored-by: artnan <artn@outlook.com>
* [kotlin] Make API classes open (non-final) unless nonPublicApi is used
By making those classes open, AspectJ can be used to enhance their
behavior.
I'm not changing kotlin-multiplatform templates, where 'open' was
already present before my changes.
Closes#22271
* Fail Kotlin sample compilation if API classes stop to be public
Serves as a 'regression test'.
* Generate skeleton for new integration test
* Typescript-angular: Move query param deep-object test
* typescript-angular: Add query param JSON test
* Typescript-angular: Add query param form test
* Test for #20998
* typescript-angular: Reimplement query param serialisation
This notably fixes:
- JSON query param serialisation
- array serialisation with style=form and explode=true
As the class HttpParams from Angular is specially designed for the
mimetype: `application/x-www-form-urlencoded` it does not support
the range of query parameters defined by the OpenAPI specification.
To workaround this issue, this patch introduces a custom
`OpenAPIHttpParams` class which supports a wider range of query param
styles.
Note that as `HttpClient` is used afterwards, the class
`OpenApiHttpParams` has a method to convert it into a `HttpParams` from
Angular with a no-op HttpParameterCodec to avoid double serialisation of
the query parameters.
* update samples
---------
Co-authored-by: Vladimir Svoboda <vsvoboda@forkoder.eu>
* fix: do not add dependency on urllib3 if not required
* update samples
* remove import
---------
Co-authored-by: Sascha Kreutz <saschakreutz@hotmail.de>
* remove "async" and "responseWrapper" from template as these are not supported by kotlin-spring generator
* try to force pipelines rerun
* force pipelines rerun
* fix mustache to keep generated code identical
* Revert "fix mustache to keep generated code identical"
This reverts commit c573b43401.
* Reapply "fix mustache to keep generated code identical"
This reverts commit 2c3b065c5c.
* Add support for 'useResponseEntity' in kotlin-spring. Consolidate with the separate flag 'declarativeInterfaceWrapResponses' as these can now be controlled both by one flag. Default to true.
* fix status annotation and add compile-test samples
* satisfy samples-up-to-date check
* add unit tests covering both reactive and non-reactive
* fix template to avoid unnecessary empty line
* fix template to avoid unnecessary empty line
* put method params (if present) on separate lines to improve readability
* put method params (if present) on separate lines to improve readability; fix double spaces, spaces before comma, incorrect spaces
* fix test
* store PATHs as accesible strings in companion objects.
* fix missing import
* fix incorrect import
* fix fallback to nested placeholders.
* this allows pushing client jar to local maven repository gradle -i clean jar publishToMavenLocal; also generates jar with sources;
* this allows pushing client jar to local maven repository gradle -i clean jar publishToMavenLocal; also generates jar with sources;
* replace headers with same caseinsensitive key to match http spec
* regenerate samples
* regenerate samples
* enable test for header case-insensitive replacement
* reduce redundant test comments
* Nim Generator Fixes
* remove test that is tested via yaml anyway
* Only include required parameters or non-empty optional parameters in URLs, support oneOf/anyOf via nim object variants, optional field support
* snapshot
* docs gen
* Improved handling of enums
* feat(typescript-rxjs): Add @deprecated tag to generated API operations
This commit introduces the JSDoc @deprecated tag to API operations in the typescript-rxjs generator when the operation is marked as deprecated in the OpenAPI specification.
This ensures that IDEs (like VS Code or WebStorm) correctly flag the method as deprecated, providing better developer experience and warning consumers about upcoming removals or changes.
* minor updates
---------
Co-authored-by: Dirk Niemeier <dirk.niemeier@cgi.com>
* Generate wrappers for oneOf with discriminator when using kotlinx.serialization
* Add spec with oneOf using discriminator
* Add config to generate samples
* Generate samples
* Update samples
* Change naming of wrapper classes
* Fix empty model test
* Update GH workflow with new samples
* Add CLI option
* Add dep to generated Cargo.toml
* Add new `Error::SerdePathToError` error type
* Add `serde_path_to_error` invocation to API layer
* Add sample for serde-path-to-error
* Add arg & docstring to cliOptions as well
* Fix sample
* feat: add support for Swagger v3 annotations to jaxrs-spec
* test added unittest for jaxrs-spec with swagger3Annotations
* test added integrationtest for jaxrs-spec with swagger3Annotations
* test added integrationtest for jaxrs-spec with swaggerV2Annotations
* documentation update for new option useSwaggerV3Annotations in the jaxrs-spec.md
* test added integrationtest for jaxrs-spec with swaggerV3Annotations icm use JakartaEE
* update documentation by executing: ./bin/utils/export_docs_generators.sh
* ran on wsl: ./bin/generate-samples.sh ./bin/configs/*.yaml
* fix(c): Remove duplicate code generation for UUID path parameters
The C generator was generating duplicate path parameter handling code
when a parameter had format: uuid. This occurred because UUID parameters
have both isString=true and isUuid=true flags set, causing both the
{{#isString}} and {{#isUuid}} template blocks to execute.
The duplicate {{#isUuid}} block has been removed since it generated
identical code to the {{#isString}} block. This makes UUID parameters
consistent with email parameters, which already work this way
(isEmail=true and isString=true, but only use the {{#isString}} block).
The generated code now compiles successfully without duplicate variable
declarations.
* test(c): Add UUID path parameter test case to petstore
Adds endpoint with UUID path parameter to verify C generator produces compilable code without duplicate variable declarations.
* chore(samples): Regenerate all C samples with template fix
Regenerated all C sample variants to include the UUID path parameter example.
The Ruby code that is generated copies numerous methods into every
model. This creates bloat both in file size and run-time memory usage.
This commit introduces a base class for all models to store common
methods. This commit's focus is only on static methods that do not
change between models.
* Expose mtls config params in python template
* Expose certFile and keyFile configuration items to support mtls in php generated client
* Regenerate of examples
They were never really intended to support null values, so this is kind of a bug. However, this is technically also breaking for users that set these properties to `null` explicitly (instead of leaving them unset).
* [Julia] Fix docstring parameter formatting with backticks
Wrap parameter names in backticks in generated Julia client docstrings
to prevent markdown from misinterpreting underscores as italic formatting.
This fixes an issue where parameter names like `pet_id`, `api_key`, and
`additional_metadata` would render incorrectly in documentation, with
underscores being treated as markdown italic markers instead of literal
characters.
Related issue: JuliaComputing/OpenAPI.jl#72
* Also wrap data types and return types in backticks
* Regenerate Julia client samples with backticked docstrings
* [Julia] Add backticks to all markdown documentation templates
Extend backtick formatting to markdown documentation templates for
both Julia client and server generators. This ensures consistent
markdown rendering of identifiers with underscores.
Changes:
- julia-client/api_doc.mustache: Add backticks to function signatures,
parameter names, types, and return types in markdown API docs
- julia-server/api_doc.mustache: Same changes for server API docs
- julia-client/model_doc.mustache: Add backticks to property names and
types in markdown model documentation
- julia-server/model_doc.mustache: Same changes for server model docs
All generated markdown files now properly display identifiers like
`pet_id`, `Custom_Type`, `update_pet_with_form` with literal
underscores instead of broken italic formatting.
Related to JuliaComputing/OpenAPI.jl#72
* allow configuring jackson, remove jackson import if disabled
* do not generate root resource or application file if generating interface
* change template files to remove jackson if disabled
* updated samples and docs as required by PR checklist
* [rust-axum] Make discriminator field name camelCase
* [rust-axum] Give polymorphic enum values a serde alias using the mapping keys if available
* update samples
* update test file checksum
* Use Filter Parser and allow multiple filters
* OpenAPINormalizer fails for invalid FILTER syntax
* Fix typo
* Use constants for filter keys.
Improve exception handling and tests.
* Fix format missing Locale.ROOT
* Make Filter extensible
* Additional unit test for invalid filter
* Support nullable `org.springframework.web.multipart.MultipartFile` in Kotlin Spring generator
- nullable is only supported for MultipartFile. However, Array<MultipartFile> could be also nullable
* Support nullable `org.springframework.web.multipart.MultipartFile` in Kotlin Spring generator
* Support nullable `org.springframework.web.multipart.MultipartFile` in Kotlin Spring generator
Update kotlin-spring-additionalproperties samples
Adds a new boolean option 'includeEndpointUrl' that, when enabled, includes endpoint URL information as JSDoc comments in generated service methods and interfaces. This helps developers quickly identify the HTTP method and path for each API operation.
Co-authored-by: Robin Csutoras <robin.csutoras@Robins-Laptop.local>
* [python-fastapi] Fix: Skip sorting of path operations (#22163)
Make use of helpful code added in
243f501aef to skip sorting of path
parameters. In FastAPI, order matters, see link for details:
https://fastapi.tiangolo.com/tutorial/path-params/?h=path#order-matters
Issue: https://github.com/OpenAPITools/openapi-generator/issues/22163
* Update samples after previous commit
Reading comprehension is hard. I missed the part of step 3 where
samples would be updated in response to the change I had previous
submitted.
Via this commit, update samples to match expectations. The order of
various endpoint implementations is now changed in the sample, matchcing
the order in the yaml files that created them.
Previously, if an API endpoint was marked deprecated, this fact was not
reflected in the generated Rust clients using the reqwest library. We
want to know exactly when our client code is using a deprecated endpoint,
so marking the corresponding functions with the `#[deprecatd]` attribute
would be very helpful. Uses of the endpoint would then be picked up by
linters so that we can react.
This adds a line to the template which marks functions generated from
deprecated endpoints with the `#[deprecated]` attribute.
This does not touch any of the other client generators for Rust or any
other language, since they are out of scope for our needs.
Co-authored-by: Bradford Hovinen <bho@qwello.eu>
* Jersey2/3: Fix a bug where, when using OAuth, the HTTP 401 status code persisted even if the second request after renewing the Bearer access token succeeded
* Jersey2/3: Regenerate samples
* fix: Apply REMOVE_X_INTERNAL normalizer to nested inline properties
When REMOVE_X_INTERNAL=true is set, the normalizer removes the x-internal
extension from top-level schemas in components/schemas but fails to remove
it from inline object properties within those schemas.
This causes issues when:
1. A schema is imported cross-file (e.g., admin.yaml imports from chat.yaml)
2. That schema has an inline object property with x-internal: true
3. The inline property has type: object with nested properties
Result: TypeScript generator creates a type reference but no interface
definition, causing compilation errors.
This fix applies the same x-internal removal logic to normalizeProperties()
that already exists in normalizeComponentsSchemas(), ensuring inline
properties are handled consistently.
Fixes behavior for inline schemas with x-internal in cross-file imports.
* Update modules/openapi-generator/src/main/java/org/openapitools/codegen/OpenAPINormalizer.java
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* test: Add test case for REMOVE_X_INTERNAL with inline properties
Adds test to verify that REMOVE_X_INTERNAL normalizer correctly removes
x-internal extension from inline object properties, not just top-level schemas.
* Apply suggestion from @Copilot
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Revert "Apply suggestion from @Copilot"
This reverts commit c899e9ec96.
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* [C-Curl] Client generator does not handle float properly (#21092)
- Change function signature to float*
- Change generator to convert float to string
- Similar change for double and long
* [C-Curl] Client generator does not handle float properly (#21092)
- Generate samples
- Fix generator for headers and path params
* Revert "[C-Curl] Client generator does not handle float properly (#21092)"
This reverts commit ba044a65d5.
* Revert "[C-Curl] Client generator does not handle float properly (#21092)"
This reverts commit f99c5b0382.
* [C-Curl] Client generator does not handle float properly (#21092)
- Convert float, double and long to string
- Generate samples
* [C-Curl] Client generator does not handle float properly (#21092)
- Add missing yaml example file
* [C-Curl] Client generator does not handle float properly (#21092)
- Transfer float and double in scientific notation with resp. 7 and 16 decimals
- Adapt string size to number of required characters
* [C-Curl] Client generator does not handle float properly (#21092)
- Fix unused variable.
- Fix snprintf string
* * [C-Curl] Client generator does not handle float properly (#21092)
- Generating samples
* * [C-Curl] Client generator does not handle float properly (#21092)
- Always allocate the exact string size
* Update Spring Boot dependency for WebClient
* Adapt WebClient ApiClient to change in HttpHeaders with Spring 7
---------
Co-authored-by: Timo Schwarz <timo.schwarz@bredex.de>
* Add spring api versioning support
* Do not add version if not requested
* Fix duplicate VendorExtensions
* Improve description
* Fix removal of RequestMapping version attribute if x-spring-api-version: '' is set at the operation level
* fix(rust): Remove default features from reqwest dependency
This change removes the default features (specifically native-tls) from the reqwest
dependency in the Rust client generator. This allows users to explicitly choose
their TLS backend without automatically including openssl-sys as a transitive dependency.
Users can now explicitly enable TLS backends using feature flags:
- native-tls
- rustls-tls
- default-tls
Fixes#21933
* feat(rust): Add reqwestDefaultFeatures option with backward-compatible default
This change adds a new generator option `reqwestDefaultFeatures` that allows
users to configure the default Cargo features for the reqwest dependency.
The option accepts:
- An array of strings in YAML config: reqwestDefaultFeatures: ["native-tls"]
- A comma-separated string via CLI: --additional-properties=reqwestDefaultFeatures=native-tls
- An empty value for no defaults: reqwestDefaultFeatures: []
Default value: ["native-tls"] (maintains backward compatibility)
This addresses the feedback in #21933 to make the change opt-in rather than
breaking existing users.
Users can now:
- Keep the current behavior (default)
- Opt-out: reqwestDefaultFeatures: []
- Use alternative TLS: reqwestDefaultFeatures: ["rustls-tls"]
- Combine features: reqwestDefaultFeatures: ["native-tls", "cookies"]
Fixes#21933
* Add an enum to centralize common internal vendor extensions used for Codegen processing
* Extend the normalizer tests to illustrate that an AllOfs with several refs have all of them marked as parents
* Add x-internal to the Codegen vendor extensions
* Move the Codegen vendor extensions into CodegenConstants
* Add assertion to JavaClient CodegenTest
* fix(kotlin-spring): add missing constructor parentheses for hashmap models
This commit fixes a bug in the kotlin-spring generator where models
defined with additionalProperties would result in uncompilable code.
The generated data class was missing the constructor invocation '()'
when inheriting from a map type.
This has been corrected to only add parentheses when the parent is a map.
The existing samples have been regenerated to reflect this change.
* Trigger CI
Separate models are located in `modelPackage` folder with `index.ts` file. ESM requires an index file with the provided extension when `importFileExtension` is defined.
* [python] fix#19255 add async httpx support
* update docs
* 1. "async" parameter for templates
2. hand written tests for python-httpx
3. CI workflow updated
* fix mypy
Previous mustache template was using #isBodyParam outside of #operation
context, so it was not effective.
Even if we'd add the proper context, we'd then risk generating duplicate
imports for multiple matching parameters.
For this reason, this patch implements detection of an optional body
parameter in code, making sure the corresponding import is added just
once.
Fixes#19237
* replace deprecated 'typings' field with standard 'types' in package.json
* regenerate samples after replacing 'typings' with 'types' field
---------
Co-authored-by: winiga <winiga@rocketmail.com>
For **Windows** users, you will need to install [wget](http://gnuwin32.sourceforge.net/packages/wget.htm) or you can use Invoke-WebRequest in PowerShell (3.0+), e.g.
(if you're on Windows, replace the last command with `java -jar modules\openapi-generator-cli\target\openapi-generator-cli.jar generate -i https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g php -o c:\temp\php_api_client`)
<!-- RELEASE_VERSION -->
You can also download the JAR (latest release) directly from [maven.org](https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.15.0/openapi-generator-cli-7.15.0.jar)
You can also download the JAR (latest release) directly from [maven.org](https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.17.0/openapi-generator-cli-7.17.0.jar)
<!-- /RELEASE_VERSION -->
To get a list of **general** options available, please run `java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar help generate`
@@ -1182,6 +1182,7 @@ Here is a list of template creators:
Some files were not shown because too many files have changed in this diff
Show More
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.