When a GET/PUT/POST operations includes queryParams, then the feign generator wrongly generates the Basename instead of the paramName. That leads to
a java.illegalstateException ("Body parameters cannot be used with form parameters") in Feign Contract when attempting to invoke the Method.
i.e: a generated feign client:
public interface PersonClientTest extends RestApi {
@RequestLine("GET /personen/{kundenNummer}?mitUnterstruktur={mitUnterstruktur}")
@Headers({
"Accept: application/json",
"If-None-Match: {ifNoneMatch}"
})
PersonOut getPersonByKundenNummer(@Param(value="kundenNummer", expander=ParamExpander.class) String kundenNummer, @Param(value="If-None-Match", expander=ParamExpander.class) String ifNoneMatch, @Param(value="mitUnterstruktur", expander=ParamExpander.class) Boolean mitUnterstruktur);
}
in the headers:
"If-None-Match: {ifNoneMatch}"
but in the method:
@Param(value="If-None-Match", expander=ParamExpander.class) String ifNoneMatch
the value should be ifNoneMatch instead of "If-None-Match"
* [dart][dart-dio] Refactor API template
* first construct a `RequestOptions` instance with all parameters etc. inline
* then construct and serialize the body data
* then send the request and await the response
* then deserialize the response
* always use the `specifiedType` for built_value (de)serialization instead of a mix of ways (this does the same as finding the serializer directly)
* use indent of 2 spaces (as per Dart convention)
* prefix all local variables to prevent name clashes with parameters
* Add tests that (de)serialize collections and add API key header
* Add Dart configuration flag to set new generator
* Change templates to add json_serializable generator
* Fix dart tests
* Add custom serialization for standard generator
* this change opens us a way to allow adding more than 2 generators
* Add sample project for json_serializer
* Use basename for json field name
* Update samples with basename as json key
* Update dart generator docs
* Create AbstractDartCodegen class
* Update docs, dart-dio and dart-jaguar dont get json_serializable yet
* Deduplicate method calls
* Dix dart-dio generation
* Revert formatting change in dart mustache
* Fix formatting changes again
* Improve dart serialization documentation
specify default serializer
* Better name for cli option
* Rename default dart generator to 'native'
* Another attempt to reduce whitespace noise
* Fix api-client and api-helper
* Rename default serialization mode to include word serialization
* Remove trailing whitespace in enums
* [dart][dart-dio] Remove manual json encode/decode calls in API classes
Dio automatically adds a default transformer which does call `json.encode` and `json.decode` when the content-type is `application/json`. When the content-type is different, then it is up to the consumer to configure the Dio instance correctly to support custom content-types.
Also tests!!!
* [dart] Constraint test library to < 1.16.0 as it requires Dart 2.12.0
* Fix more constraint problems for the new test project
* use Files.createTempFile to address security concerns
* Update modules/openapi-generator-online/src/main/java/org/openapitools/codegen/online/service/Generator.java
Co-authored-by: Jonathan Leitschuh <Jlleitschuh@wpi.edu>
Co-authored-by: Jonathan Leitschuh <Jlleitschuh@wpi.edu>
* [typescript-axios] Support array query arguments
typescript-axios does not correctly output query arguments when you use `explode: true` for a parameter.
fixes#7966fixes#7973
* Fix mistake in query parameter setting
* [dart-dio] Disable nullable fields by default
This is not in line with the OAS and will prevent future Dart nullabilty features (NNBD) from being useful as all types would be optional.
Users can still opt-in for this.
* [dart-dio] Properties are nullable when not required AND not nullable
* [dart][dart-dio] Support nullable/required fields
* properties in built_value need to be nullable when they are nullable in OAS or when they are not required in OAS
* built_value does not support serializing `null` values by default as it is based on a serialization format based on iterables/lists and not maps
* dart-dio uses the built_value json plugin to convert the built_value format to regular json
* by generating a custom serializer for each class we can add support for serializing `null` values if the property is required AND nullable in OAS
* this is a breaking change as not all properties in the models are nullable by default anymore
* Implement required/nullable for dart
* Changes for set types and enum names after rebase
* Add some comments and fix built_value fields with default being nullable
* More rebase changes and regenerate docs
* [dart][dart-dio] Improve prefixing of inner enums with classname
* prevent further name conflicts by correctly naming the enum, until now there could potentially occur conflicts e.g. 2x `MapTestInnerEnum` by renaming the `items` child property
* correctly set `enumName` to match `datatypeWithEnum`
* Unrelated test regeneration
* [REQ] Added enumClassPrefix option to go-gin-server. Used same approach as #7008 (go-server)
modified: docs/generators/go-gin-server.md
modified: modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoGinServerCodegen.java
modified: modules/openapi-generator/src/main/resources/go-gin-server/model.mustache
* Fixed CI error in docs