Grzegorz Szeliga
Grzegorz Szeliga
This has not changed anything. ``` #[derive(Debug, Object, Serialize, Deserialize)] #[oai(inline)] pub struct CreateSessionResponseOk { #[serde(rename="accountId")] #[oai(rename="accountId")] pub account_id: u64, #[serde(rename="access_token")] #[oai(rename="access_token")] pub access_token: String, } #[derive(Debug, Object, Serialize, Deserialize)]...
@sunli829 I found this piece of documentation https://swagger.io/docs/specification/data-models/inheritance-and-polymorphism/ Maybe it is better to generate the enum specification this in way ? There is much less code and the discriminator is...
This is a swaggerUI error. I understand that you have good intentions. But the result is a strange contract. It is better to stick to the specifications.
can you expand on how discriminator is defined ? If you add explicit mapping to structures, that's already cool for me. ``` "discriminator": { "propertyName": "type", "mapping": "CreateSessionResponseOk": "#/components/schemas/CreateSessionResponseOk", "CreateSessionResponseErrors":...
I would like to advise you but I am having trouble getting this new version to work: In the test repository I switched to this new branch: https://github.com/szagi3891/poem-test https://github.com/szagi3891/poem-test/commit/4df7b618acba36461eb2d5e3f96b65ccbd4cacae ```...
``` RUST_BACKTRACE=1 cargo run .... Finished dev [unoptimized + debuginfo] target(s) in 0.17s Running `target/debug/example-openapi-oneof` thread 'main' panicked at 'explicit panic', /Users/grzegorzszeliga/.cargo/git/checkouts/poem-5d35782906f249bc/09ed17c/poem-openapi/src/registry/mod.rs:323:41 stack backtrace: 0: rust_begin_unwind at /rustc/306ba8357fb36212b7d30efb9eb9e41659ac1445/library/std/src/panicking.rs:584:5 1: core::panicking::panic_fmt...
Yes, it is much better now :) Only now there is another problem. The "discriminator" is missing one of the types: ``` "/api2/fun3": { "get": { "responses": { "200": {...
I suggest that It is better to generate a model for each of the generics. What do you think about it ? ``` "/api2/fun3": { "get": { "responses": { "200":...
@sunli829 Do you want the "type" field to necessarily be shown by swaggerUI ? I got information from a colleague that this openapi visualisation tool https://redocly.com/ correctly shows descriminators.
@sunli829 Hello. Will you be publishing these changes ? Even what is now on the branch unfinished works well. I use these changes in production :)