Create Kotlin DSL for Spring RestDocs
See original GitHub issueI’ve been working on a Kotlin DSL for restDocs and have converted a number of samples to demonstrate it.
I would love to contribute the DSL into the spring-restdocs project. Would you be interested in that DSL? (I also wanted to contribute the base MockMVC DSL to spring test, but that is a different project)
Example DSL:
@Test
fun indexExample() {
this.mockMvc.performGet("/") {
expect { status { isOk } }
document(documentationHandler) {
"notes" link { description("The <<resources-notes,Notes resource>>") }
"tags" link { description("The <<resources-tags,Tags resource>>") }
response {
"Content-Type" header { description("The Content-Type of the payload, e.g. `application/hal+json`") }
"_links" subsection { description("<<resources-index-links,Links>> to other resources") }
}
}
}
}
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:29 (7 by maintainers)
Top Results From Across the Web
Get started with Spring Boot and Kotlin
Start by creating a Spring Boot project with Kotlin using IntelliJ IDEA. See also. Look through our Java to Kotlin (J2K) interop and...
Read more >spring-projects/spring-restdocs - Gitter
Atm I use the openapi spec during pre-development to discuss what we are planning to build with the analists. To define models and...
Read more >Spring Cloud Contract Features
Contract DSL in Kotlin. To get started with writing contracts in Kotlin you would need to start with a (newly created) Kotlin Script...
Read more >spring-restdocs-mockmvc : 2.0.4.RELEASE - Maven Central
org.springframework.restdocs:spring-restdocs-mockmvc: 2.0.4.RELEASE ... Gradle Kotlin DSL github.com/gradle/kotlin-dsl. content_copy ... Bazel bazel.build.
Read more >Upgrading asciidoctor.convert to asciidoctor.jvm.convert
... asciidoctorExt by configurations.creating dependencies { asciidoctorExt("org.springframework.restdocs:spring-restdocs-asciidoctor:2.0.5.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I agree with @jnizet, the inconsistency between
infix
and noninfix
form is an issue, which is also present withandReturn()
, so I have removed it via this commit.Snapshot builds of Spring Framework
5.2.0.BUILD-SNAPSHOT
are available on https://repo.spring.io./snapshot.I’m also in favor of @jnizet 's direction. So I’ll let him lead on his proposal while I focus on https://github.com/spring-projects/spring-framework/pull/1951
I like that the focus is ease of discoverabiliy, readability, and allowing extension points for further custom extension functions