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

Sample using Swagger #158

Closed
loxal opened this issue Jul 25, 2017 · 8 comments
Closed

Sample using Swagger #158

loxal opened this issue Jul 25, 2017 · 8 comments

Comments

@loxal
Copy link
Contributor

loxal commented Jul 25, 2017

Would be nice to have a sample with Swagger integration. Especially I am interested whether Swagger could work with Ktor like with Spring Boot and automatically generate the API using reflection, i.e. generate a Swagger console that reflects the API of the implementation.

Generating code from Swagger specification is another pattern but one that usually does not work in practice beyond "Hello, World!".

Enable Ktor services to expose something like http://petstore.swagger.io, to communicate their APIs would be a key asset to Ktor.

@jimschubert
Copy link

@loxal I have added the initial implementation of a swagger codegen generator for ktor servers at swagger-api/swagger-codegen#7412. If you have some time to review it (even if just the generated outputs), I'd appreciate it any feedback.

@orangy orangy self-assigned this Jan 29, 2018
@soywiz soywiz self-assigned this Apr 23, 2018
@timbuethe
Copy link

@jimschubert implemented something for generating ktor server stubs out of existing swagger definition, right?

And @loxal asking for generating swagger from an existing ktor server.

@jimschubert
Copy link

Yes, I've setup a server stub generator for ktor. I've since moved from swagger-codegen to a community driven fork: https://github.com/OpenAPITools/openapi-generator

Our fork supports all generators using OpenAPI 2 and 3.x specs, while swagger-codegen doesn't. We've also had some contributions to the ktor generator in our fork. Please check it out and open any issues you find.

This is spec -> API and not the other way around.

@astoialtsev
Copy link

@loxal I was looking for the same. And here is a nice lib, already proposed to be adopted by Ktor.
#453

@oleg-larshin
Copy link

Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks.

@allevo
Copy link

allevo commented Oct 10, 2020

I'll happy to provide an example of swagger integration.

@ddska
Copy link

ddska commented Jan 19, 2021

I'll happy to provide an example of swagger integration.

@allevo so please do it :)

@e5l
Copy link
Member

e5l commented Mar 30, 2021

Duplicated by https://youtrack.jetbrains.com/issue/KTOR-774. Currently WIP

@e5l e5l closed this as completed Mar 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

10 participants