Rust docs for `ToString` explicitly recommend implementing `Display`:
> This trait is automatically implemented for any type which implements the Display trait. As such, ToString shouldn’t be implemented directly: Display should be implemented instead, and you get the ToString implementation for free.
See: https://doc.rust-lang.org/std/string/trait.ToString.html
See: https://github.com/Nitrokey/nethsm-sdk-rs/pull/33
Signed-off-by: Wiktor Kwapisiewicz <wiktor@metacode.biz>
* Check references in additionalProperties correctly
Handle references in additionalProperties correctly when determining free-form status
* Update samples
Python 3.12 has been released in October 2023, it should be tested in
the CI.
Python 3.7 is not maintained anymore, removing it from the minimum
required version in `pyproject.toml` files.
With:
```
sampleObject:
type: object
additionalProperties:
$ref: '#/components/schemas/SampleData'
minProperties: 1
description: Map of Charging data policy decisions.
```
and
```
SampleData:
type: object
...
nullable: true
```
We currently generate: HashMap<String, SampleData>, which doesn't allow
null charging data entries. This MR changes this to be
`HashMap<String, swagger::Nullable<SampleData>>`, which thus will allow null data entries.
We do this by moving null-handling to the Java code - primarily `getTypeDeclaration()`.
Note, to some extent this is wrong. In this MR (and previously) we are treating
`nullable: true` as an extrinsic property (like required), whereas it should be an
intrinsic property (and thus `HashMap<String, SampleData>` is correct, but `SampleData`
absorbs the nullability.
This would be possible with this code:
```
enum ChargingData = {
Null,
Present {
...
}
}
```
Which would remove the usage of https://docs.rs/swagger/2.0.2/swagger/nullable_format/enum.Nullable.html.
I haven't resolved this - and have instead done a more targeted fix.
This, along with some other crude code, creates a scenario where we need to
unpick whether something is null. I've left that, though flagged a TODO to tidy it up at some point.
* [Rust Server] Convert Rust comment to Mustache
The comment about auth types supported by the generator shouldn't be
included in the generated code as it's confusing when the API doesn't
support the same auth types.
As such, we convert it from a Rust comment to a Mustache comment
* Update samples
* Fix issue with toString causing wrong value with collections
With collections, calling toString will result in the value becoming [a,b] instead of just a,b.
Using the existing apiClient::parameterToString method ensures it gets parsed correctly if it is a collection
* Updated samples
---------
Co-authored-by: Rasmus Zweidorff Iversen <rzi@jysk.com>
* [Kotlin] Add a new additional property to configure Jackson's `failOnUnknownProperties`
Default to false
* [Kotlin] Unconditionally import `com.fasterxml.jackson.databind.DeserializationFeature`
* [Kotlin] Refactor and add test
* Update ApiClient.mustache
* Update ApiClient.mustache
Jersey doesn't allow request entities in method DELETE
* Update ApiClient.java
Jersey doesn't allow entities in method DELETE
* Update ApiClient.java
Jersey doesn't allow entities in method DELETE
* Update ApiClient.java
Jersey doesn't allow entities in method DELETE
* Update ApiClient.java
Jersey doesn't allow entities in method DELETE
* Update ApiClient.java
Jersey doesn't allow entities in method DELETE
* Update ApiClient.java
Jersey doesn't allow entities in method DELETE
* Update ApiClient.java
Jersey doesn't allow entities in method DELETE
* Update ApiClient.java
Jersey doesn't allow entities in method DELETE
* Update ApiClient.java
Jersey doesn't allow entities in method DELETE
* Update ApiClient.java
Jersey doesn't allow entities in method DELETE
* jersey ApiClient.mustache invoke DELETE without entity if empty
* jersey ApiClient.mustache invoke DELETE without entity if empty
* jersey ApiClient invoke DELETE without entity if empty
* jersey ApiClient invoke DELETE without entity if empty
* jersey ApiClient invoke DELETE without entity if empty
* jersey ApiClient invoke DELETE without entity if empty
* jersey ApiClient invoke DELETE without entity if empty
* jersey ApiClient invoke DELETE without entity if empty
* jersey ApiClient invoke DELETE without entity if empty
* jersey ApiClient invoke DELETE without entity if empty
* jersey ApiClient invoke DELETE without entity if empty
* jersey ApiClient invoke DELETE without entity if empty
* fix: object serialization for multipart requests
This PR is essentially
<https://github.com/OpenAPITools/openapi-generator/pull/18140> but for
the asyncio client.
* fix: int serialization for multipart requests
urllib3 handles serializing ints in post params (ref 1), while asyncio
explicitly does not (ref 2).
ref 1: <9316764e90/src/urllib3/filepost.py (L75-L76)>
ref 2: <https://github.com/aio-libs/aiohttp/issues/920>
* test: new fake multipart endpoint with files and body
* test: regression test for stringified body params
* fix: mypy tweak
* fix: FILES regeneration
* feat: object, int serialization for multipart reqs
Extends previous commits (and #18140) to cover the python-pydantic-v1
client as well.
* fix: use async with in test
* test: regression test for pydantic-v1-aiohttp
* test: add regression test to pydantic-v1
Also brings the second test in line with the first, patching
`urllib3.PoolManager.urlopen`
* Upgrade erlang-server code generation and fix is_authorized crashes
* Introduce structured logging
* Improve general formatting
* Update generated files
* Enable erlang server on CI
* Add echo-server testing to CI
* Require OTP27 explicitly in the generated rebar.config file
* Rework handler and API
With this work, json validation becomes optional, fully implemented in
the `_api` module as it was before, but without being forcibly called by
the `_handler`. It is instead left as optional for the user to take
advantage of the exposed callbacks. Jesse also chooses draft-06 as a
default, but these can be chosen manually by the user too, as long as
jesse implements them.
`_handler` also becomes lighter, it now handles all mime types
transparently by forwarding to a user-given module that must implement
`accept_callback/4` and `provide_callback/4` as described in the
`_logic_handler` callbacks. These will simply be the return values of
cowboy_rest's `content_types_accepted` and `content_types_provided`
respectively, and should simply comply with their defined APIs. They
only get two parameters extending the behaviour, so that the user-given
callback can pattern-match on them: the path prefix of the logic
handler, and the operationID of the call.
* Fix return types for provide_callbacks
* Upgrade jesse to incur no dependencies
The less dependencies the built code requires the better.
* Fix dialyzer errors in the generated code
* Apply stronger dialyzer checks