Skip to content

Releases: javalin/javalin-openapi

5.5.0

19 May 12:09
e040d73

Choose a tag to compare

Changes

Sponsors
Also thanks for all sponsors that support my work this month 💜

Active @dzikoysk's
GitHub Sponsors
milkyway0308, andrm, insertt, Koressi, zugazagoitia, tipsy, neg4n, mattwelke, Kamilkime, crejk, asikkema Szczurowsky, Rollczi,

Minimal requirements

  • Java 11+ / Kotlin 1.8+
  • Javalin 5.5.0

Download

5.4.2

09 Mar 15:39
9a68615

Choose a tag to compare

Changes

  • #173 Bumped Javalin to 5.4.2

Sponsors
Also thanks for all sponsors that support my work this month 💜

Active @dzikoysk's
GitHub Sponsors
milkyway0308, andrm, insertt, Koressi, zugazagoitia, tipsy, neg4n, mattwelke, Kamilkime, crejk, asikkema Szczurowsky, Rollczi,

Minimal requirements

  • Java 11+ / Kotlin 1.8+
  • Javalin 5.4.2

Download

5.4.0

05 Mar 17:46
e80a769

Choose a tag to compare

5.3.2

23 Jan 16:28
3cc0dc3

Choose a tag to compare

5.3.1

10 Jan 00:15
11b7167

Choose a tag to compare

Changes

  • Bumped Javalin to 5.3.1

5.3.0

07 Jan 23:35
ae61091

Choose a tag to compare

Changes (since 5.2.0)

  • GH-116 Reimplemented OpenApiPlugin configuration
    • OpenApiConfiguration has been deprecated and will be no longer developed - Those changes were required to properly address different versions of generated schemes.
      • GH-118 Implement backwards compatible layer for old OpenApi plugin configuration
    • Use OpenApiPluginConfiguration to configure OpenApiPlugin with a new builder-like API
    • See updated setup on wiki to check the new approach
  • GH-96 Support @OneOf/@AllOf/@AnyOf on classes
  • GH-97 Use reusable enums to cover enum values
  • GH-111 Hide implementation details of enum classes
  • GH-113 Automatically add missing / to routes
  • GH-112 Exclude dependencies of ReDoc webjar by default
  • GH-95 Add error location to the missing mime type warning
  • GH-122 Support @OpenApiName on classes
  • GH-123 Fix invalid info object serialization in OpenApiPlugin
  • GH-121 Preserve declared order of parameters
  • GH-124 Remove generic type signature from TypeMirror names
  • GH-125 Sort routes by name, not enum's ordinal number
  • GH-128 Keep OpenApi & JsonSchema annotations in compiled sources
  • GH-128 Make OpenApi & JsonSchema annotations visible in runtime
  • GH-129 Support discriminator in composition annotations
  • GH-130 Support custom base path in Swagger plugin
  • GH-129 Support @OpenApiName in composition API
  • GH-129 Support injection of discriminator property
  • GH-132 Support custom base path in ReDoc plugin
  • GH-141 Support IntelliJ's ProcessingEnvironment
  • GH-137 Render global security as array
  • GH-143 Generate missing schemes for listed composition references
  • GH-127 Support compile-time Groovy script to preconfigure annotation processor (Experimental API)
    • Script should be defined in src/main/compile/openapi.groovy file
    • GH-125 Support enhanced debug logging
@ExperimentalCompileOpenApiConfiguration
class OpenApiConfiguration implements OpenApiAnnotationProcessorConfigurer {

    @Override
    void configure(OpenApiAnnotationProcessorConfiguration openApiAnnotationProcessorConfiguration) {
        // enable extra debug logging
        openApiAnnotationProcessorConfiguration.debug = true
    }

}
  • GH-125 Print in debug mode all annotations on element with usage and its implementation
  • GH-80 Expose simple types in scripting API
@ExperimentalCompileOpenApiConfiguration
class OpenApiConfiguration implements OpenApiAnnotationProcessorConfigurer {

    @Override
    void configure(OpenApiAnnotationProcessorConfiguration openApiAnnotationProcessorConfiguration) {
        // represents all `CustomType` usages as strings in OpenApi specification
        configuration.simpleTypeMappings['io.javalin.openapi.processor.TypeMappersTest.CustomType'] = new SimpleType("string")
    }

}
  • GH-108 Extend experimental scripting API with a possibility to filter specific properties from schemes
@ExperimentalCompileOpenApiConfiguration
class OpenApiConfiguration implements OpenApiAnnotationProcessorConfigurer {

    @Override
    void configure(OpenApiAnnotationProcessorConfiguration openApiAnnotationProcessorConfiguration) {
        // example of custom property filter to exclude/include given element in class scheme
        configuration.propertyInSchemeFilter = { AnnotationProcessorContext ctx, ClassDefinition type, Element property ->
            TypeElement specificRecord = ctx.forTypeElement('io.javalin.openapi.processor.UserCasesTest.SpecificRecord')

            if (ctx.isAssignable(type.mirror, specificRecord.asType())) {
                return !ctx.hasElement(specificRecord, property)
            }

            return true
        }
    }

}
  • GH-133 Support custom type mappings
@ExperimentalCompileOpenApiConfiguration
class OpenApiConfiguration implements OpenApiAnnotationProcessorConfigurer {

    @Override
    void configure(OpenApiAnnotationProcessorConfiguration openApiAnnotationProcessorConfiguration) {
        // resolves all usages of Option<T> signatures to T reference
        configuration.insertEmbeddedTypeProcessor({ EmbeddedTypeProcessorContext context ->
            if (context.type.simpleName == 'Optional' && context.type.generics.size() == 1) {
                context.parentContext.typeSchemaGenerator.addType(context.scheme, context.type.generics[0], context.inlineRefs, context.references, false)
                return true
            }

            return false
        })
    }

}

Download

5.3.0-alpha.7

27 Dec 13:29
181f460

Choose a tag to compare

5.3.0-alpha.7 Pre-release
Pre-release

This is alpha build
API may be changed between alpha builds to properly form its final shape in the official release.

Changes

Download

5.3.0-alpha.6

23 Dec 16:22
36336b8

Choose a tag to compare

5.3.0-alpha.6 Pre-release
Pre-release

This is alpha build
API may be changed between alpha builds to properly form its final shape in the official release.

Changes

Download

5.3.0-alpha.5

22 Dec 01:44
3262ffb

Choose a tag to compare

5.3.0-alpha.4

19 Dec 13:51
da35db3

Choose a tag to compare

5.3.0-alpha.4 Pre-release
Pre-release

This is alpha build
API may be changed between alpha builds to properly form its final shape in the official release.

Changes

  • GH-127 Support compile-time Groovy script to preconfigure annotation processor (Experimental API)
    • GH-125 Add debug logging to custom annotation mapper
    • GH-108 Extend experimental scripting API with a possibility to filter specific properties from schemes
    • GH-125 Print in debug mode all annotations on element with usage and its implementation
    • Script should be defined in src/main/compile/openapi.groovy file as follows:
import groovy.transform.CompileStatic
import io.javalin.openapi.experimental.ExperimentalCompileOpenApiConfiguration
import io.javalin.openapi.experimental.OpenApiAnnotationProcessorConfiguration
import io.javalin.openapi.experimental.OpenApiAnnotationProcessorConfigurer

@CompileStatic
@ExperimentalCompileOpenApiConfiguration
class OpenApiConfiguration implements OpenApiAnnotationProcessorConfigurer {

    @Override
    void configure(OpenApiAnnotationProcessorConfiguration openApiAnnotationProcessorConfiguration) {
        // enable extra debug logging
        openApiAnnotationProcessorConfiguration.debug = true

        // example of custom property filter to exclude/include given element in class scheme
        configuration.propertyInSchemeFilter = { AnnotationProcessorContext ctx, ClassDefinition type, Element property ->
            TypeElement specificRecord = ctx.forTypeElement('io.javalin.openapi.processor.UserCasesTest.SpecificRecord')

            if (ctx.isAssignable(type.mirror, specificRecord.asType())) {
                return !ctx.hasElement(specificRecord, property)
            }

            return true
        }
    }

}
  • GH-124 Remove generic type signature from TypeMirror names

Download