Skip to content

Consider using a DSLMarker annotation #102

@jogro

Description

@jogro

I think your DSL could benefit greatly from using a DSLMarker annotation.

Consider defining an annotation like:

@Target(AnnotationTarget.CLASS, AnnotationTarget.TYPE, AnnotationTarget.FUNCTION)
@DslMarker
annotation class OpenApiDsl

Then annotate the API receiver lambdas like:

fun OpenAPI.paths(init: @OpenApiDsl Paths.() -> Unit) {
    paths = paths ?: Paths()
    paths.init()
}

Sadly, this could potentially break existing code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions