-
Notifications
You must be signed in to change notification settings - Fork 138
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
Automated HTTP API documentation #85
Comments
Unfortunately, I don't think it's possible to generate an OpenAPI spec via code inspection alone when you take a functional approach. The request predicates are too free-form to be able to introspect them and generate an accurate specification. For this reason, AFAIK, SpringFox quite reasonably doesn't even try – I can't find any references to WebFlux in their code. |
Indeed, but we can maybe leverage |
Not sure if that is going to work. Like @wilkinsona said, the request predicates is an open set, and (unless we make the predicates aware of OpenAPI) the only thing of use for a visitor is the String representation. This is what we use for logging: all pre-defined predicates have a |
Using a Maybe This kind of data structure will be used for automated API documentation. |
To explain what I'm saying in my previous message, I've wrote a It's in a very early stage and provide a kind of schema for all routes with |
I will work on that before Spring Boot 2.1 GA. |
Since I am a big fan of Spring REST docs but also recognize the need to document REST API in a machine readable way, I think I will prototype something based on @tgirard12 |
@tgirard12 Do you think it would be possible for you to play a little bit with the Spring Framework branch Arjen Poutsma has been working on (targeting upcoming 5.1.2, see this JIRA comment) to see if that fit the need from your POV? |
I have play a little with this branch. I think it will possible to get all the The current implementation have some limitations with the Kotlin RouterFunction Dsl because when we declare a route with The only missing information for generating a kind of automatic documentation is the return type, we need to create a custom |
@tgirard12 Could you please detail the limitations with Kotlin RouterFunction Dsl? I don't see what would prevent the Kotlin version to work while this Java version is working. |
It will work fine with the Kotlin DSL and a RouterFunctionDsl. |
https://github.com/springdoc/springdoc-openapi README mentions "spring-webflux with Functional Endpoints, will be available in the future release". Maybe worth contacting them for functional WebMvc and WebFlux support? |
We have been collaborating with @poutsma and the project lead of Springdoc to implement functional support of OpenAPI, and it is done, see springdoc/springdoc-openapi#891. Let's try to integrate that in Spring Fu for 0.5.0. |
OpenAPI: we should try springfox/springfox#1773 which has been merged and see if functional support is ok.
Spring REST docs: we should test
WebTestClient
support, see spring-projects/spring-restdocs#384.The text was updated successfully, but these errors were encountered: