Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

different body types #44

Closed
y9san9 opened this issue May 14, 2020 · 3 comments
Closed

different body types #44

y9san9 opened this issue May 14, 2020 · 3 comments

Comments

@y9san9
Copy link

y9san9 commented May 14, 2020

Can I use different body types on success and on error? Because in Retrofit Im using different bodies with different types

@Wicpar
Copy link
Collaborator

Wicpar commented May 14, 2020

Sending different response types should work if you use exception handlers, if they are on the same error code it should generate a oneOf definition.
If you mean receiving different body types, then you might want to define an object that has a nullable parameters for the one or the other.
Tell me if it doesn't work and i'll look into it.

@y9san9
Copy link
Author

y9san9 commented May 14, 2020

Thanks that works pretty well. This library is rly nice, do not stop it's support :)
And you should also write about this feature in wiki or README, cuz I'm exporing library from issues and I think there are so many unknown for users features

@y9san9 y9san9 closed this as completed May 14, 2020
@Wicpar
Copy link
Collaborator

Wicpar commented May 14, 2020

i added an example page in the wiki
https://github.com/papsign/Ktor-OpenAPI-Generator/wiki/A-few-examples

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants