Add new configuration flags: REMOVE_OPERATION_ID_PREFIX_DELIMITER and REMOVE_OPERATION_ID_PREFIX_COUNT
Add the corresponding fields in the DefaultCodegen
Sanitize the operationId according to the new fields
Add delimiter to list of nonNameElementPattern
Add unit test
* pass init and url as returned by the premiddleware to the postmiddleware
Current implementation will always pass the initial url and init object. However if a pre middleware changes returns an object whose `init` or `url` property refer to a different url string or object, any following post middleware wont have access to it. Effectively providing the post middleware with a completely different request information then what was actually used to make the fetch call.
* update samples and docs
Model naming conforms to the property: modelPropertyNaming, however the
parameter naming scheme is currently hardcoded to camelcase. Since the
parameter names are closely tied to the model properties names, is maybe
desirable to use a similar naming approach.
The toParamName cannot directly use the paramPropertyNaming since that
will cause issues with current generated code, since the
modelPropertyNaming currently defaults to "original"
A new property has been created to override this behavior, named
"paramPropertyNaming", and its default is set to "camelcase".
* [python-fastapi] Apply constraints to models
Signed-off-by: Nikita Vakula <programmistov.programmist@gmail.com>
* [python-fastapi] Use pydantic types to validate models fields
Some data formats can be validated by annotating fields with some
special pydantic data types (EmailStr, forr example).
Signed-off-by: Nikita Vakula <programmistov.programmist@gmail.com>
* [python-fastapi] Updated samples
Signed-off-by: Nikita Vakula <programmistov.programmist@gmail.com>
* [dart][dart-dio] Add support for query collection parameter format
* add support for collectionFormat in query parameters and www-url-encoded content
* add tests
* remove empty query parameter maps from generated code
* closes#6681
* closes#9522
* closes#8271 (the last remaining parts)
* Fix formatting
`toModelImportMap` only accounts for union types and not intersection types, so I've combined those cases into `splitComposedType`. For `splitComposedType` I combined `replace(" ","").split("\\|")` and `split("( [|&] )|[<>]")` into `replace(" ","").split("[|&<>]")`.
I've added the `needToImport` check to `toModelImportMap`. This is the same check that happens in `addImport`.
* Allow to run ValidateTask tests against Gradle 7.0 as well
* Drop setters for ValidateTask properties of mutable types
This is applicable to the following properties:
- inputSpec
- recommend
Otherwise, Gradle 7.0 now returns an error when attempting
to configure this task.
See https://docs.gradle.org/7.0/userguide/validation_problems.html#mutable_type_with_setter
* Be more specific about the versions of Gradle tested in ValidateTaskDslTest
Test against the latests Gradle 5.x and 6.x versions
* [python-fastapi] Ignore some flake8 warnings
1. Some of the "imported but not used" warnings are there because
it is not easy to express what should be imported in mustache template
language. These warnings are silenced in order to keep the templates
morre readable.
2. Single quotes -> Double quotes (for consistency).
Signed-off-by: Nikita Vakula <programmistov.programmist@gmail.com>
* [python-fastapi] Added flake8 config
Signed-off-by: Nikita Vakula <programmistov.programmist@gmail.com>
* [python-fastapi] Set extra constraints on values
It is important to set all constraints (pattern, greater than, etc.)
on values of all arguments, because FastAPI can handle them automatically.
Signed-off-by: Nikita Vakula <programmistov.programmist@gmail.com>
* [python-fastapi] Updated samples
Signed-off-by: Nikita Vakula <programmistov.programmist@gmail.com>
* fix handle_request_json spec res
* fix client spec
* make it possible to answer with 0 size binary for 204
* only generate empty bin for 204
* only generate empty bin for 204
* [swift5] Rename the API class to {{projectName}}
Instead of {{projectName}}API. This removes some unnecessary naming
complexity.
* [swift5] Define models and Configuration classes under namespace
When swiftUseApiNamespace is set, API classes get defined under the
projectName namespace. This does the same for models and the
Configuration class. Plus adding a deprecation warning when using the
un-namespaced variants.
* [swift5] Use CodingKeys in model decoder
Fixes: 0f5e7d1e3cb9 ("Swift5 models improvements (#9205)")
* [swift5] Add swiftUseApiNamespace to urlsessionLibrary config
* Update samples
* Try to reduce model changes
Co-authored-by: Bruno Coelho <4brunu@gmail.com>
And update to Kotlin 1.5.0 and kotlinx.serialization 1.2.1. Fix nested
enum annotation '@Serializable' instead of '@KSerializable' when
'kotlinx_serialization' is used. Fix missing JsonMediaType in
ApiClient.kt (#9242). Add 'kotlinx_serialization' serialization library
to documentation. Use explicity type in RequestConfig to keep type
information for JSON serialization.
Resolves#9242
* [python-fastapi] Added new generator
See https://fastapi.tiangolo.com/ for more details about FastAPI
Signed-off-by: Nikita Vakula <programmistov.programmist@gmail.com>
* [python-fastapi] Added samples
Signed-off-by: Nikita Vakula <programmistov.programmist@gmail.com>