* [C++][Pistache] Do not use JSON for primitive types in request body
Request body can contain any input, simple strings, CSV text or something else
* [C++][Pistache] Update Petstore sample version
* WIP: add faraday support to Ruby client
* update samples
* bin/console
* https only
* ruby-faraday: Add a gemspec template for faraday
* Add a test for ruby-faraday client options
* Remove Gemfile.lock from ruby-client-faraday
* Implement faraday client
* Problem: can't use Faraday library for ruby clients
Solution: add support for Faraday library
This patch builds on the work started by @meganemura
* Problem: Faraday is set as default library
Solution: Make Typhoeus default
This patch also updates the api_client template for Faraday to include query params with requests.
* Update python client java generator
* Updates python generator mustache files
* Python sample regenerated
* Switches from getfullargspec to getargspec for python2 compatibility
* Uses getattr to get model class init method to correctly see its arguments, linting fixes to pass python tests
* Updates comment in python centerator to restart CI tests
* Adds bin/windows/python-experimental-petstore.bat
* CHanges spec update to apply to the python-experimental spec
* Moves new python templates to python-experimental
* Moves generator python java code to python-experimental
* Reverts python generator mustache files
* Regenerates python, v3 python, python-experimental samples
* Test moved to python-experimental, unused python files removed
* Default outputFile value is `openapi/openapi.yaml`.
* Mustache Lambdas documentation.
* Default OpenAPIYamlGenerator outputFile value is `openapi/openapi.yaml`.
It fails if the model contains a float, which don't implement Eq.
Fix for bug introduced in #3309.
We really need to improve the testing of the rust generator to catch this sort of mistake in future. I don't have time to do this now, though.
* fix name sanitation when using kebab case filenaming
* remove whitespaces
* sanitize names by removing spec 3 ref keys
* Revert "sanitize names by removing spec 3 ref keys"
This reverts commit 7e58719317bb936884f5ed0049177ef961871464.
* add pipes to datatype names
* split imports
* remove comment
* fix when using a mixture of (any|one) and standard imports
* sanitize names by removing spec 3 ref keys
* Revert "sanitize names by removing spec 3 ref keys"
This reverts commit 7e58719317bb936884f5ed0049177ef961871464.
* Merge conflict DefMerge branch 'master' into name-ref-fix
# Conflicts:
# modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java
* split imports
* remove comment
* fix when using a mixture of (any|one) and standard imports
* Fix merge error
import missing package, merge error.
* format
* fix tests
* create test, fi regex
* Début d'un générateur pour OCaml.
* Ajout du script bash de generation pour OCaml.
* Implémentation de la partie model du générateur OCaml.
* Suppression du fichier Model.mustache.
* Légère modification dans le générateur OCaml.
* Début d'implémentation de la génération des opérations.
* Avancées dans l'implémenatation des opérations.
* Avancée dans la gestion des enums : reste à traiter le fait que Yojson sérialize les variants comme des tableaux JSON.
* Prise en compte du fait que Yojson représente les variants constants sous forme d'un tableau JSON contenant une unique string.
* Utilisation des variants polymorphe pour les enums car il se peut que plusieurs énumérations partagent des valeurs communes ce que ne permettent pas les variants ordinaires au sein d'un même module.
* Avancées dans le générateur de code OCaml : le code produit compile et prendre en compte les pathParams, les queryParams, les headersParams, les bodyParams et la réponse JSON. Manque le support du multipart, du form encoded et des mécanismes d'authentification.
* More tests.
* Correction de problèmes dans la génération mis en évidence par l'utilisation d'un fichier OAS plus gros et complexe que Petstore.
* Mapping du case Error de Ppx_deriving_yojson_runtime.ok_error vers l'exception Failure pour avoir des types plus simples et non dépendants de Pppx_deriving_yoson_runtime dans les APIs générées.
* Ajout de la génération des fichiers d'interfaces .mli pour les APIs.
* Ajout du support des parametres de type x-www-form-urlencoded.
* Le paramètres d'url de type number étaient mal gérés.
* Cleanup.
* Replace block comment start and end sequences in input text.
* Make apis calls without a return type return unit rather than Yojson.Safe.t.
* Make modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml generate properly.
* Added generated code for modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml.
* Better handling of enums and map container and better sanitizing of generated identifiers to support all the corner cases present in modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml.
* Correcting a violation : using toLowerCase without relying on the default Locale.
* Changed authoring in partial_header.mustache.
* Deleted commented code.
* Collect enum schemas in items properties of operation parameters in the case of ArraySchema parameters. This allows correct processing of modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml.
* Collect enums also in additional properties schemas of operation parameters in the case of MapSchema parameters (if this type of parameter can is allowed).
* Removed copy-pasted Copyright notice from SmartBear.
* update doc
* Use Locale.ROOT instead of Locale.ENGLISH for toLowerCase calls.
* Make GET operations with body generate compilable code.
* Updated ocaml-client generated samples using the latest version of the OCaml code generator.
* Added [@default None] for record fields with option types so that if those fields are missing at deserialization time, None is assumed.
* Added support of api keys in query params.
* Updated generated ocaml samples to reflect latest changes in templates.
* Added [@default] on enum record fields for which the enum type has only one accepted value so that those fields can be deserialized even if the value is absent of the json payload.
* Delete useless space character in template.
* Added proper handling of http response codes.
* Updated generated ocaml samples to reflect latest changes in templates.
* Bash: Update samples
I'm about to make a fix to the bash generator. I'm regenerating the
samples in this commit so that the change I make isn't lost amongst
the noise.
https://github.com/OpenAPITools/openapi-generator/pull/3290
* Bash client: Fix query params seperation
Fix bug where empty query parameters weren't separated by ampersands.
For example, this
```bash
bash bash_keycloak/client.sh -v --oauth2-bearer "$access_token" --host "$api_host" realmUsersGet realm=demo_realm2 email=foo+bar@baz.com
```
would generate the path
`/auth/admin/realms/demo_realm2/users?briefRepresentation=email=foo+bar@baz.comfirst=firstName=lastName=max=search=username=`.
It now puts ampersands around them to make
`/auth/admin/realms/demo_realm2/users?briefRepresentation=&email=foo+bar@baz.com&first=&firstName=&lastName=&max=&search=&username=`
Instead of predicting if there is going to be a `parameter_value` ahead of
time, we now put in the ampersand if there is a `parameter_value` and existing
`query_request_part`.
https://github.com/OpenAPITools/openapi-generator/pull/3290
* Bash: Skip query parameters with empty value
I have a route with many optional query parameters.
I observed that when they weren't specified, they were still included in
the routes, but without a value.
Running:
```bash
bash bash_keycloak/client.sh -v --header "Authorization: Bearer $access_token" --host "$api_host" --dry-run realmUsersGet realm=demo_realm2 email=foo+bar@baz.com username=foo
```
Would produce the route:
`http://localhost:8080/auth/admin/realms/demo_realm2/users?briefRepresentation=&email=foo+bar@baz.com&first=&firstName=&lastName=&max=search=&username=foo`
After this change it produces the route:
``http://localhost:8080/auth/admin/realms/demo_realm2/users?email=foo+bar@baz.com&username=foo
---
I discussed with @wing328 in the pull request about if empty values (eg
`username=` should produce an empty query parameter, or if the query
parameter should be removed.
We decided it should remove the query parameter.
https://github.com/OpenAPITools/openapi-generator/pull/3290
----
The OpenAPI definition I was using:
Using:
https://github.com/ccouzens/keycloak-openapi/blob/master/keycloak/6.0.json
In particular:
```json
"/{realm}/users": {
"get": {
"summary": "Get users Returns a list of users, filtered according to query parameters",
"parameters": [
{
"in": "query",
"name": "briefRepresentation",
"schema": {
"type": "boolean"
},
"style": "form"
},
{
"in": "query",
"name": "email",
"schema": {
"type": "string"
},
"style": "form"
},
{
"in": "query",
"name": "first",
"schema": {
"type": "integer",
"format": "int32"
},
"style": "form"
},
{
"in": "query",
"name": "firstName",
"schema": {
"type": "string"
},
"style": "form"
},
{
"in": "query",
"name": "lastName",
"schema": {
"type": "string"
},
"style": "form"
},
{
"in": "query",
"name": "max",
"description": "Maximum results size (defaults to 100)",
"schema": {
"type": "integer",
"format": "int32"
},
"style": "form"
},
{
"in": "query",
"name": "search",
"description": "A String contained in username, first or last name, or email",
"schema": {
"type": "string"
},
"style": "form"
},
{
"in": "query",
"name": "username",
"schema": {
"type": "string"
},
"style": "form"
}
],
```
* [java] Support for number enum
* [core] add isLong, isNumber, isNumeric, isFloat, isDouble to CodegenModel
* [java-gson] fix Enum TypeAdapter in BigDecimal case.
I already contributed proper enum supports a few weeks ago, but somehow missed actually using them when they're used as a property. This PR fixes that.
I also took the liberty of fixing a bunch of unused warnings.
* Make sure we use the enum types in Rust
* Fix unused warnings in Rust and regenerate samples
* Use crate:: import path that works both with Rust 2015 and 2018
* Derive PartialEq and Eq in generated Rust structs and enums