Skip to content

Latest commit

 

History

History
1458 lines (1072 loc) · 61.8 KB

RELEASE-NOTES.md

File metadata and controls

1458 lines (1072 loc) · 61.8 KB

3.0.0

v3.0.0 is a major release that brings OpenAPI 3.1 support, a new Ktor client adapter, significant dependency and framework upgrades, and a clean break from legacy APIs accumulated since v1.

See the migration guide below for step-by-step upgrade instructions.


Highlights

  • OpenAPI 3.1 support — full validation against OAS 3.1 specs, including type unions, const, if/then/else, dependentRequired, prefixItems, unevaluatedProperties, webhooks, and more
  • New Ktor client adapter — openapi-request-validator-ktor-client for Kotlin / Ktor 3.x
  • Spring 7 / Spring Boot 4 — all Spring modules upgraded to Spring Framework 7+ and Spring Boot 4+ (Jakarta namespace)
  • JDK 21 minimum — build and runtime now require Java 21+
  • Guava removed — no longer a transitive dependency of the core module
  • networknt schema validator upgraded — from v1 to v2, enabling JSON Schema 2020-12 for OAS 3.1
  • Artifact rename — all artifacts renamed from swagger-request-validator-* to openapi-request-validator-*

Breaking Changes

1. Artifact / Maven coordinate rename

All Maven artifact IDs have been renamed from swagger-request-validator-* to openapi-request-validator-*. The group ID (com.atlassian.oai) is unchanged.

<!-- Before -->
<dependency>
    <groupId>com.atlassian.oai</groupId>
    <artifactId>swagger-request-validator-core</artifactId>
    <version>2.x.x</version>
</dependency>

<!-- After -->
<dependency>
    <groupId>com.atlassian.oai</groupId>
    <artifactId>openapi-request-validator-core</artifactId>
    <version>3.0.0</version>
</dependency>

The full list of renamed artifacts:

Before (v2) After (v3)
swagger-request-validator openapi-request-validator
swagger-request-validator-core openapi-request-validator-core
swagger-request-validator-pact openapi-request-validator-pact
swagger-request-validator-restassured openapi-request-validator-restassured
swagger-request-validator-mockmvc openapi-request-validator-mockmvc
swagger-request-validator-mockmvc-legacy Removed — see below
swagger-request-validator-wiremock Removed — see below
swagger-request-validator-wiremock-junit5 openapi-request-validator-wiremock-junit5
swagger-request-validator-spring-webmvc openapi-request-validator-spring-webmvc
swagger-request-validator-spring-web-client openapi-request-validator-spring-web-client

2. Removed modules

  • swagger-request-validator-mockmvc-legacy — removed. Migrate to openapi-request-validator-mockmvc which supports Spring MockMVC 7+.
  • swagger-request-validator-wiremock (JUnit 4 module) — removed. Migrate to openapi-request-validator-wiremock-junit5 which uses the non-deprecated ServeEventListener API and supports JUnit 5.

3. Removed deprecated classes and APIs

The following classes that were deprecated in v2 have been removed:

Removed class Replacement
SwaggerRequestResponseValidator OpenApiInteractionValidator
SwaggerValidationFilter (restassured) OpenApiValidationFilter
SwaggerValidatorMatchers (mockmvc) OpenApiValidationMatchers
SwaggerMatchers (mockmvc) OpenApiMatchers
OpenApiValidator (wiremock-junit5) OpenApiValidationListener

4. Java version: minimum JDK 21

The core library and all adapter modules now require Java 21 or later to build and run. (The Spring Web Client module requires Java 17+.)

5. Spring Framework 7 / Spring Boot 4 (Jakarta namespace)

All Spring-related modules (spring-webmvc, mockmvc, spring-web-client) have been upgraded to Spring Framework 7 and Spring Boot 4, which use the jakarta.* namespace instead of javax.*. If you are on Spring Boot 3.x or earlier, remain on the v2.x releases of this library.

6. Guava removed from core

com.google.guava:guava is no longer a dependency of openapi-request-validator-core. If your code relied on Guava being available transitively through this library, you will need to add Guava directly to your own dependencies, or migrate to the JDK equivalents:

  • Multimap<String, Collection<String>> → Map<String, Collection<String>>
  • @com.google.common.annotations.VisibleForTesting → @com.atlassian.oai.validator.util.VisibleForTesting or remove the annotation entirely

Caffeine (com.github.ben-manes.caffeine:caffeine) is now used for the schema validation cache in place of Guava's CacheBuilder.

7. Request content-type validation behaviour change

Requests that do not include a Content-Type header are now validated against the spec. Previously, missing content types were silently ignored.

If you need to restore the previous behaviour, add the missingRequestContentType() whitelist rule:

OpenApiInteractionValidator.createForSpecificationUrl(specUrl)
    .withWhitelist(ValidationErrorsWhitelist.create()
        .withRule("Allow missing content type", WhitelistRules.missingRequestContentType()))
    .build();

8. Pact module: JUnit 5 migration

ValidatedPactProviderRule (JUnit 4 @Rule) has been removed and replaced by ValidatedPactConsumerTestExtension (JUnit 5 @RegisterExtension). The Pact JUnit 5 library (au.com.dius.pact.consumer:junit5) is now required in place of the JUnit 4 library (au.com.dius.pact.consumer:junit).

9. WireMock module: listener API change

The WireMock module now uses the non-deprecated ServeEventListener interface (replacing the old RequestListener-based approach). The recommended class is OpenApiValidationListener.


New Features

OpenAPI 3.1 support

OAS 3.1 specs are now fully supported, backed by JSON Schema 2020-12 via the upgraded networknt schema validator (v2). New keywords supported in 3.1 specs:

  • Type unions — type: [string, integer] and type: [string, 'null'] for nullable fields
  • const — exact value matching
  • if / then / else — conditional schema application
  • dependentRequired / dependentSchemas — conditional required fields
  • prefixItems — tuple validation
  • unevaluatedProperties — strict object property validation
  • Numeric exclusiveMinimum / exclusiveMaximum — OAS 3.1 form (value, not boolean)
  • $ref with sibling keywords — allowed in 3.1 (previously prohibited)
  • Webhooks — validate webhook requests and responses using validateWebhookRequest(), validateWebhookResponse(), and validateWebhook()

New adapter: Ktor client (openapi-request-validator-ktor-client)

A new Kotlin adapter for Ktor 3.x HTTP client. Install the OpenAPIValidation plugin on your Ktor HttpClient to automatically validate all outgoing requests and responses:

val client = HttpClient(Java) {
    install(OpenAPIValidation) {
        validator {
            withApiSpecification("https://api.example.com/openapi.json")
        }
    }
}

Dependency Changes

Dependency v2 v3
Java 8+ 21+
Spring Framework 5.x / 6.x 7+
Spring Boot 2.x / 3.x 4+
networknt schema validator 1.x 2.x
Guava Runtime dependency Removed
Caffeine Not included Added (cache)
JUnit (test) JUnit 4 JUnit 5 (Jupiter)
Pact consumer junit (JUnit 4) junit5

Migration Guide: v2 → v3

Step 1: Update artifact IDs

Replace all swagger-request-validator-* artifact IDs with openapi-request-validator-* in your pom.xml / build.gradle, and update the version to 3.0.0.

Step 2: Update Java version

Ensure you are building and running on Java 21 or later.

Step 3: Update Spring dependencies (Spring users only)

Upgrade to Spring Framework 7 / Spring Boot 4. This requires migrating javax.* imports to jakarta.* across your application. See the Spring Boot 4.0 Migration Guide for details.

Step 4: Rename deprecated class references

If you used any of the removed Swagger* classes, update to the OpenApi* equivalents:

// Core
SwaggerRequestResponseValidator  →  OpenApiInteractionValidator

// REST Assured
SwaggerValidationFilter          →  OpenApiValidationFilter

// Spring MockMVC
SwaggerValidatorMatchers         →  OpenApiValidationMatchers
SwaggerMatchers                  →  OpenApiMatchers

// WireMock
OpenApiValidator                 →  OpenApiValidationListener

Step 5: Migrate from the legacy MockMVC or JUnit 4 WireMock modules

  • swagger-request-validator-mockmvc-legacy users: migrate to openapi-request-validator-mockmvc and update to Spring MockMVC 7+.
  • swagger-request-validator-wiremock (JUnit 4) users: migrate to openapi-request-validator-wiremock-junit5 and update your tests to JUnit 5. See the WireMock JUnit 5 README for examples.

Step 6: Migrate the Pact module (Pact users only)

Replace ValidatedPactProviderRule with ValidatedPactConsumerTestExtension:

// Before (JUnit 4)
@Rule
public final ValidatedPactProviderRule provider =
        new ValidatedPactProviderRule("http://my-provider/api-spec.yaml", null, this);

@Pact(provider = "MyProvider", consumer = "MyConsumer")
public RequestResponsePact myInteraction(final PactDslWithProvider builder) { ... }

@Test
@PactVerification(value = "MyProvider", fragment = "myInteraction")
public void myTest() { /* use provider.getMockServer().getUrl() */ }

// After (JUnit 5)
@RegisterExtension
static final ValidatedPactConsumerTestExtension provider =
        new ValidatedPactConsumerTestExtension("http://my-provider/api-spec.yaml", null);

@Pact(provider = "MyProvider", consumer = "MyConsumer")
public V4Pact myInteraction(final PactBuilder builder) {
    return builder.usingLegacyDsl()...toPact(V4Pact.class);
}

@Test
@PactTestFor(pactMethod = "myInteraction")
public void myTest(final MockServer mockServer) { /* use mockServer.getUrl() */ }

Also:

  • Replace au.com.dius.pact.consumer:junit with au.com.dius.pact.consumer:junit5
  • Add org.junit.jupiter:junit-jupiter to your test dependencies if not already present
  • @IgnoreApiValidation continues to work as before

Step 7: Handle the missing content-type validation change

If you have requests that legitimately omit Content-Type and were previously passing validation, add a whitelist rule to suppress the new error (see Breaking Change #7 above).

Step 8: Remove Guava if it was only a transitive dependency

If Guava was only available in your project transitively through this library, either add it explicitly or migrate to JDK equivalents. If you used @VisibleForTesting, replace with @com.atlassian.oai.validator.util.VisibleForTesting or remove it.

2.46.0

  • Bump dependencies:
    • spring: 6.1.21 -> 6.2.11
    • spring (legacy): 5.3.26 -> 5.3.39
    • spring-boot: 2.6.12 -> 2.6.15
    • jackson: 2.19.0 -> 2.20.0
    • swagger-parser: 2.1.31 -> 2.1.34
    • jetty: 9.4.56.v20240826 -> 9.4.58.v20250814
    • commons-codec: 1.17.1 -> 1.19.0
    • awaitility: 4.2.2 -> 4.3.0
    • snakeyaml: 2.4 -> 2.5

2.45.1

  • Fix single level of ref resolution when parseOptions.resolveFully is disabled [#824] [Details]

2.45.0

  • Bump dependencies:
    • spring: 6.1.13 -> 6.1.21
    • jackson: 2.15.2 -> 2.19.0
    • mockito: 4.8.0 -> 4.11.0
    • swagger-parser: 2.1.22 -> 2.1.31
    • scala-library: 2.13.14 -> 2.13.16
    • license-maven-plugin: 2.4.0 -> 2.6.0
    • build-helper-maven-plugin: 3.6.0 -> 3.6.1
    • snakeyaml: 2.0 -> 2.4

2.44.9

2.44.8

2.44.1

  • Bump dependencies:
    • spring (legacy): 5.3.26 -> 5.3.39
    • netty: 4.1.113.Final -> 4.1.115.Final
    • commons-codec: 1.16.0 -> 1.17.1
    • awaitility: 4.2.1 -> 4.2.2
    • maven-checkstyle-plugin: 3.3.1 -> 3.6.0
  • Fix handling of encoded characters when validating path params [#328] [Details]

2.43.0

  • Bump dependencies:
    • spring: 6.1.3 -> 6.1.13
    • guava: 33.0.0-jre -> 33.3.1-jre
    • jetty: 9.4.53.v20231009 -> 9.4.56.v20240826
    • netty: 4.1.106.Final -> 4.1.113.Final
    • junit: 5.10.0 -> 5.11.1

2.42.0

  • Support for discriminator validation of oneOf and anyOf composition [#771] [Details]

2.41.0

  • Bump dependencies:
    • maven: 3.9.1 -> 3.9.7
    • scala-library: 2.13.11 -> 2.13.14
    • wiremock: 2.35.1 -> 2.35.2
    • swagger-parser: 2.1.20 -> 2.1.22

2.40.0

  • Bump dependencies:
    • guava: 31.1-jre -> 33.0.0-jre
    • wiremock: 2.35.0 -> 2.35.1
    • spring: 6.0.8 -> 6.1.3
    • jetty: 9.4.51.v20230217 -> v9.4.53.v20231009
    • netty: 4.1.92.Final -> v4.1.106.Final
    • swagger-parser: 2.1.13 -> 2.1.20

2.39.0

  • Support for "strict" operation matching that strictly matches trailing slashes on a path [Details]

2.38.1

  • Support operation response code ranges [Details]

2.38.0

  • Support configuring the schema validation cache size. Allows consumers to limit the size to avoid OOME. [#774] [Details]

2.37.0

2.36.0

  • Bump dependencies:
    • scala-library: 2.13.9 -> 2.13.11
    • jackson: 2.14.1 -> 2.15.2
    • hamcrest-optional: 1.2.0 -> 1.3.2
    • mockito: 4.8.0 -> 4.11.0
    • commons-codec: 1.13 -> 1.16.0
    • junit-jupiter: 5.8.2 -> 5.10.0

2.35.2

  • Fix problem with path normalization when server base path overlaps with request path [#129] [Details]
  • Fix behavior with exploded query params that are optional but include required properties [#770] [Details]

2.35.1

  • Bump swagger-parser 2.1.9 -> 2.1.13

2.35.0

  • Bump dependencies:
    • maven: 3.8.7 -> 3.9.1
    • snakeyaml: 1.33 -> 2.0
    • spring: 6.0.2 -> 6.0.8
    • netty: 4.1.85.Final -> 4.1.92.Final
    • jetty: 9.4.49.v20220914 -> 9.4.51.v20230217
    • rhino: 1.7.12 -> 1.7.14
    • tika: 1.28.4 -> 1.28.5

2.34.1

  • Bumped Spring 5.x dependency to 5.3.26 to address open CVE [Details]

2.34.0

  • Changed swagger-request-validator-spring-web-client to support Spring 6+ and added a new module swagger-request-validator-spring-web-client-legacy for continued Spring 5 support [#404] [Details]
  • Support resetting the Spring request body so that it can be accessed multiple times during validation [#374] [Details]

Note: Users of Spring 5.x with the swagger-request-validator-spring-web-client will need to change their artifact ID to swagger-request-validator-spring-web-client-legacy as part of this change. The legacy support will be dropped in the next major version.

v2.33.1

  • Add a new module swagger-request-validator-spring-webmvc that supports Spring 6 and Spring Boot 3 (with the Jakarta namespace). [#399] [Details]

Note: The (now legacy) existing module swagger-request-validator-springmvc continues to support Spring 5.x and Spring Boot 2.x. It will be dropped in the next major version.

Note: As of this release the project builds with JDK17 but continues to maintain support for JDK8 for all modules except the new swagger-request-validator-spring-webmvc module that requires JDK17. Support for JDK8 will be dropped in the next major version.

v2.33.0

Version burned (failed deployment pipeline)

v2.32.1

  • Fixed a problem in the Spring WebMVC module where headers are removed during request validation and not made available to later filters (e.g. CORS headers). [#310] [Details]

v2.32.0

  • Add support for specifying a different / custom JsonSchemaFactory impl [#306] [Details]

v2.31.1

  • Fix behavior of arrays for "exploded" params
  • [Details]

v2.31.0

  • Bump dependencies:
    • swagger-parser: 2.0.28 -> 2.1.9
    • guava: 30.1.1 -> 31.1
    • jackson: 2.13.3 -> 2.14.1
    • mockito: 4.4.0 -> 4.8.0
    • pact-jvm: 4.1.38 -> 4.1.40
    • wiremock: 2.32.0 -> 2.35.0
    • jmh-core: 1.34 -> 1.36
    • jsonassert: 1.5.0 -> 1.5.1

Note: The change the swagger-parser:2.1.9 brings in swagger-models:2.2 which is a breaking change compared to swagger-models:2.1.

v2.30.0

  • Add a new module swagger-request-validator-wiremock-junit5 for use with Wiremock in JUnit 5. See the README for more information. [#386] [Details]

v2.29.0

  • Fail validation if a response body is found but not expected OR if one is expected but not provided [#246] [Details]

Note: This version includes a change to validation behavior. See the FAQ for how to disable specific validations if needed.

v2.28.2

  • Fix NPE when no query params in request [Details]

v2.28.1

  • Bump org.json:json transitive dependency to address CVE

v2.28.0

  • Bump dependencies:
    • jackson-core: 2.13.2 -> 2.13.3
    • jackson-databind: 2.13.2.2. -> 2.13.3
    • spring: 5.3.18 -> 5.3.20
    • logback: 1.2.10 -> 1.2.11
    • pack-jvm: 4.1.34 -> 4.1.38
    • jetty: 9.4.44.v20210927 -> 9.4.46.v20220331
    • rest-assured: 4.5.1 -> 5.1.1 (Note: This is a major version change)

v2.27.4

  • Remove the unnecessary schema copy step during discriminator validation [Details]

v2.27.3

  • Fix a race condition when running validation with a discriminator with many concurrent requests [Details]

v2.27.2

  • Fix NPE when running validation with a discriminator with many concurrent requests [Details]

v2.27.1

  • Bump dependencies to address CVEs [Details]:
    • jackson-core: 2.13.1 -> 2.13.2
    • jackson-databind: 2.13.1 -> 2.13.2.2
    • spring: 5.3.16 -> 5.3.18

v2.27.0

  • Add support for exploded form params as per OpenAPI spec [#376] [Details]
  • Version bumps:
    • mockito: 4.2.0 -> 4.4.0
    • pact-jvm: 4.1.33 -> 4.1.44
    • slf4j: 1.7.33 -> 1.7.36
    • rest-assured: 4.5.0 -> 4.5.1
    • spring: 5.3.15 -> 5.3.16
    • xerces: 2.12.0 -> 2.12.2 (transitive)
    • checkstyle: 9.2.1 -> 9.3 (plugin)

v2.26.2

v2.26.0

  • Changed the wiremock dep to wiremock-jre8 to fix build failures as wiremock is no longer available in maven-central after version 2.27.2 [#377] [Details]

v2.25.1

  • More improvements to allOf + discriminator validation to address validation loops and improve threadsafety of the schema validation [#269] [Details]
  • Add a builder option to disable schema $ref resolution without needing to supply a ParseOptions instance [Details]

v2.25.0

  • More improvements to allOf + discriminator validation to address validation loops [#269] [Details]

v2.24.0

  • Bumped version of Wiremock from 2.27.2 -> 2.32.0
  • Bumped version of Rest Assured from 4.4.0 -> 4.5.0

v2.23.1

  • Bumped a number of dependencies (mostly plugins and build tooling):
    • jackson: 2.13.0 -> 2.13.1
    • logback: 1.2.6 -> 1.2.10
    • slf4j: 1.7.32 -> 1.7.33
    • pact-jvm: 4.1.28 -> 4.1.33
    • spring : 5.3.12 -> 5.3.15

v2.23.0

  • Bumped the version of Pact from 3.6.x -> 4.1.x [#368] [Details]
    • This version removes the dependency on Scala and is (currently) a supported version train.
    • This version of Pact changes some packages etc. - see the pact-jvm release notes for details

v2.22.0

  • Bumped a number of dependencies:
    • guava: 28.2-jre -> 30.1.1-jre
    • jackson: 2.12.5 -> 2.13.0
    • mockito: 3.12.4 -> 4.0.0 (test)
    • spring: 5.3.9 -> 5.3.12
    • netty: 4.1.68.Final -> 4.1.70.Final (transitive)
    • rhino: 1.7.7.2 -> 1.7.12 (transitive)
    • gson: 2.8.6 -> 2.8.9 (transitive)
    • checkstyle: 9.0.1 -> 9.1 (plugin)
    • spring-boot: 2.4.2 -> 2.5.5 (test)

v2.21.1

  • Fix for ResettableRequestServletWrapper treating bytes as signed and incorrectly reporting negative numbers [#367] [Details]

v2.21.0

  • Report empty params as missing if they don't adhere to schema [#364] [Details]

Note: This makes the validator stricter in the way it handles empty parameters.

v2.20.0

  • Bumped a number of dependencies:
    • spring: 5.3.3 -> 5.3.9
    • netty: 4.1.66.Final -> 4.1.68.Final
    • jetty: 9.4.43.v20210629 -> 9.4.44.v20210927
    • jackson: 2.12.3 -> 2.12.5
    • swagger-parser: 2.0.27 -> 2.0.28
    • mockito-core: 3.11.2 -> 3.12.4
    • logback-classic: 1.2.5 -> 1.2.6
    • checkstyle: 8.45.1 -> 9.0.1
    • jmh: 1.32 -> 1.33

v2.19.5

  • Fixed the broken release pipeline. No lib changes (see release notes for 2.19.2, 2.19.3 and 2.19.4).

v2.19.4

Important Due to a broken release pipeline this version is not available in Maven Central. Please use 2.19.5.

  • Added an example configuration for request-only validation. See the FAQ for details. [#348] [Details]
  • Fixed behavior of mediatype matching for the ContentType header when wildcard ranges exist [#318] [Details]
  • Fixed a problem with the JDK8 time module not being registered with Jackson during schema parsing [#331] [Details]

v2.19.3

Important Due to a broken release pipeline this version is not available in Maven Central. Please use 2.19.5.

  • Fixed behavior around additionalProperties validations for the case of non-Object schemas. This should address a number of problems around oneOf, anyOf and allOf validation for schemas that contain non-Object types. [#336] [Details]

v2.19.2

Important Due to a broken release pipeline this version is not available in Maven Central. Please use 2.19.5.

  • Made the library backwards compatible with older versions of Guava (this is a temporary state - do not rely on this being the case going forward) [Details]
  • Bumped parent pom version to fix incorrect licensing [#338] [Details]
  • Bumped a number of minor/patch versions of dependencies:
    • jackson: 2.12.2 -> 2.12.3
    • logback: 1.2.3 -> 1.2.5
    • slf4j: 1.7.30 -> 1.7.32
    • mockito: 3.9.0 -> 3.11.2
    • rest-assured: 4.3.3 -> 4.4.0
    • swagger-parser: 2.0.25 -> 2.0.27
    • jmh: 1.29 -> 1.32
    • jetty: 9.4.39.v20210325 -> 9.4.43.v20210629
    • netty: 4.1.63.FINAL -> 4.1.66.FINAL

v2.19.1

Version burned (broken release pipeline)

v2.19.0

Version burned (broken release pipeline)

v2.18.1

  • Allow adding multiple headers using OpenApiInteractionValidator.Builder#withAuthHeaderData. [Details]

v2.18.0

  • Exposed ParseOptions from the underlying swagger-parser library so they can be set during validator creation. Specifically, the resolveCombinators option may be used in some cases to avoid the problem with additionalProperties validation with the allOf keyword (see the FAQ for details) [#320] [Details]
  • Fixed a regression where nested Messages from sub-validations were not being included in the validation report [#316] [#323] [Details]
  • Added optional Pointer information to the message context to give access to the instance and schema pointers in the case where a validation error has come from schema validation. [#300] [Details]

v2.17.0

  • Bumped a number of minor/patch versions of dependencies:
    • jackson: 2.12.1 -> 2.12.2
    • swagger-parser: 2.0.24 -> 2.0.25
    • jetty: 9.4.36.v20210114 -> 9.4.39.v20210325
    • netty: 4.1.59.FINAL -> 4.1.63.FINAL

v2.16.0

  • Bumped the version of spring 5.1.14 -> 5.3.3
  • Bumped the version of spring-boot used in tests 1.5.22 -> 2.4.2

v2.15.1

  • Fixed the version specifier of json-schema-validator from v2.2.14 to 2.2.14 [Details]

v2.15.0

  • Bumped rest-assured 3.3.0 -> 4.3.3

Note: This is a major version bump of rest-assured.

v2.14.0

Important: This version includes an incorrect version specifier for json-schema-validator that may prevent it from building. This has been fixed in version 2.15.1 onwards. If you are unable to roll forward to this version you may need to override the dependency yourself:

<dependency>
  <groupId>com.github.java-json-tools</groupId>
  <artifactId>json-schema-validator</artifactId>
  <version>2.2.14</version>
</dependency>
  • Bumped some dependencies from renovate:
    • spring-core: 4.3.26-RELEASE -> 4.3.30.RELEASE
    • json-schema-validator: 2.2.11 -> 2.2.14
    • guava: 28.1-jre -> 28.2-jre
    • checkstyle: 8.25 -> 8.40
    • jmh: 1.26 -> 1.27
    • hamcrest-optional: 1.1.5 -> 1.2.0
    • junit: 4.12 -> 4.13.1
    • mockito: 3.3.3 -> 3.7.7
    • netty: 4.1.58.Final -> 4.1.59.Final

v2.13.0

  • Bumped some dependencies to address vulnerabilities in transitive dependencies
    • pact: 3.6.14 -> 3.6.15
    • netty: 4.1.30.Final -> 4.1.58.Final
    • jetty: 9.2.28.v20190418 -> 9.4.36.v20210114
    • wiremock: 2.25.1 -> 2.27.2
    • jackson: 2.10.3 -> 2.12.1
    • commons-codec: 1.10 -> 1.15
    • httpclient: 4.5.6 -> 4.5.13

v2.12.1

  • Fixed a problem with ConcurrentModificationException during schema validation [#253] [Details]

v2.12.0

  • A number of improvements to the validation behavior around use of discriminator with schema composition (allOf , oneOf, anyOf). [#286] [#241] [#269] [Details]
    • Better adherence to the OpenAPI v3 spec
    • Fixed a number of scenarios where a validation loop is reported when validating the discriminator
    • Better handling of discriminator for anyOf and oneOf
    • Fixes a problem with dirty state left over between validations

Note: This change makes the validator more strict in it's handling of discriminator. Some schemas that were previously passing may now be reported as invalid.

v2.11.5

  • Performance improvement: Memoized the processed schema to avoid de-serializing the schema multiple times for the same spec [#292] [Details]

v2.11.4

v2.11.3

  • Added support for async requests in SpringMVC [Details]
  • Fixed a problem with the request body being corrupted if it is not validated (e.g. its content-type is not supported by the validator) [#312] [Details]

v2.11.2

  • Added ability to set the request/response bodies as byte[] or InputStream to avoid unnecessary deserialization [#273] [Details] [Details]
  • Added some benchmarks to allow future performance improvements to be better tested [#294] [Details]

v2.11.1

  • Improved performance of form-data validation by not deserializing the data multiple times [#274] [Details]
  • Fixed a problem with form params not available for validation in the SpringMVC module [#303] [Details]

v2.11.0

  • Fixed handling of headers so that we no longer split on , unless the header is marked as an array param with an appropriate style. [#256] [Details]
  • Improved handling of array params, with better support for matrix and label style params [#290] [Details]

Note: This version is stricter in the handling of array parameters, particularly headers, and now follows the default style for each parameter type as described in the OAI v3 spec. One result of this is that e.g. header array params that previously would have accepted multiple header values will now likely fail validation unless the style has been set correctly (the default style for header params is simple which expects comma-separated values in a single header).

v2.10.3

  • Fix a bug in matching of responses with wildcards in the defined media type [#177] [Details]
  • Added support for the allowEmptyValues param property and cleaned up handling of empty arrays [#61] [Details]

v2.10.2

v2.10.1

  • Fix operation resolution to favor exact matches [#252] [Details]
  • Improve naming of whitelist rules to make it clearer that a regex match is used; Add support for plain substring matching. [#267] [Details]
  • Add additional information to the Base64 validation messages [#285] [Details]
  • Add support for requests with byte[] bodies in the RestAssured module [#270] [Details]
  • Fix handling of empty string defaults in sever variables [#276] [Details]

v2.10.0

Note: This change adds new error keys of the form validation.prefix.schema.format.int32 etc. It also adds a format type suffix to existing format keys, allowing finer-grained control of validation behavior.

v2.9.1

  • Fix behavior of readOnly/writeOnly with required for nested/composed schemas [#265] [Details]
  • Add a new factory method to construct validator instances from pre-parsed OpenAPI instances [#226] [Details]
  • Fix the example tests so that they run as expected [#261] [Details]
  • Bump some dependency versions [Details]
    • swagger-parser -> 2.0.19
    • jackson -> 2.10.3
    • slf4j -> 1.7.30
    • mockito -> 3.3.3
    • wiremock -> 2.25.1
    • spring -> 4.3.25-RELEASE and 5.1.14-RELEASE
    • hamcrest -> 2.2

Note: The swagger-parser is now strictly enforcing API spec adherence to schema. Most notably it now enforces that all path params must have required: true. Path params that are missing the required: true will fail to load.

v2.9.0

  • Bump swagger-parser 2.0.14 -> 2.0.17 (including bump of jackson 2.9.10 -> 2.10.2 ) [Details]

v2.8.4

v2.8.3

  • Fix a NPE when using a discriminator with the oneOf keyword [#166] [Details]

v2.8.2

Version burned

v2.8.1

  • Add ability to provide a pre-parsed OpenApi object to the validator [Details]
  • Improve Base64 format validation by detecting strings that are missing padding [Details]
  • Remove usage of @Beta Guava methods [Details]
  • Fix a race condition in the LevelResolver [#251] [Details]

v2.8.0

v2.7.2

  • Updated SpringMVC module to use new builders [Details]
  • Allow discriminator property to be a $ref [#247] [Details]
  • Fix validation of readOnly/writeOnly properties within items in an array [#240] [Details]

v2.7.1

  • Removed duplicate validation of Base64 encoded String/Byte fields [#214] [Details]

v2.7.0

  • Bumped versions of a number of dependencies

Upgrade notes

Swagger / OpenAPI parsing

The Swagger / OpenAPI parser is now stricter in applying schema validation to the parsed spec. If your spec does not adhere to the schema it will fail to load.

Pact

If you use the Pact adapter, the change from version v3.5.20 to v3.6.14 of the Pact JVM library has brought some changes to the ConsumerInfo constructor. If you create these directly (rather than using the builders on the PactProviderValidator) please review your usage.

The Pact JUnit fragment builder now also requires returning a RequestResponsePact rather than a PactFragment. See OpenApiValidatorPactConsumerTestExample for examples.

v2.6.0

  • Added factory methods to create OpenApiInteractionValidator instances with a spec or URL to avoid having to guess at what has been provided. [#236] [Details]

v2.5.0

  • Added support for Cookie parameter validation [#224] [Details]
  • Improved validation messages by including messages from deeply nested objects during schema validation [#221] [Details]

v2.4.7

  • Added a constructor to com.atlassian.oai.validator.springmvc.OpenApiValidationInterceptor to allow a custom report handler to be provided [Details]

v2.4.6

  • Improved performance for validation of long Base64 encoded strings [#225] [Details]
  • Fixed treatment of the required flag when used with readOnly and writeOnly in request/response bodies [#207] [Details]

v2.4.5

  • Fixed a bug where backslashes in query params etc. are treated incorrectly during validation [#220] [Details]

v2.4.4

  • Fixed a problem where the request path can be null under some circumstances in Spring MVC [#218] [Details]

v2.4.3

  • Fix NPE in the IsEntityWhitelistRule when there is no content in the response [#222] [Details]

v2.4.2

  • Bump version of json-schema-validator to pickup improvements [#216] [Details]
  • Fix decoding of query param names in the swagger-request-validator-springmvc module [#215] [Details]

v2.4.1

v2.4.0

v2.3.0

  • Added support for custom validation logic that can be used to e.g. provide validation for vendor extensions [Docs] [Details]

v2.2.3

  • Fixed content type matching to return un-modified content types [Details]

v2.2.2

  • Added support for basic HTTP Bearer auth validation [#195]

v2.2.1

v2.2.0

  • To address a breaking change in spring-test-5.1.0.RELEASE, introduced swagger-request-validator-mockmvc-legacy for pre-5.1 versions. [Details] [#181] [#190]

Important

If you use versions of Spring prior to 5.1.0.RELEASE (or Spring Boot prior to 2.1.0) you will need to change your dependency from swagger-request-validator-mockmvc to swagger-request-validator-mockmvc-legacy.

v2.1.0

  • Added a new module for performing Swagger / Open API validation with Spring Web Client [Details]
  • Changed JSON mediatype detection to support +json suffixes [Details]

v2.0.4

  • Fixed a bug when the produces clause is empty in a swagger v2 spec [#179]

v2.0.3

  • Added ability to change behavior in the OpenApiValidationInterceptor to suit consumer use cases [Details]

v2.0.2

  • Fixed a bug in validation when consumes clause is empty in a swagger v2 spec [#167]
  • Fixed cause exceptions in the spring-mockmvc module when the request body is empty [#163]

v2.0.1

  • Decode query params before validation in Spring MVC [#155]
  • Bumped version of swagger-parser to 2.0.5
  • Fixed behavior of validation with referenced request bodies [#165]

v1.5.1

  • Decode query params before validation in Spring MVC [#155]

v2.0.0

Major release milestone.

Provides support for both Swagger v2 and OpenAPI v3 specifications.

Major changes from v1.x

  • Support for OpenAPI v3
  • Additional context attached to validation messages
  • Standardization of validation message keys
  • Substantial refactoring within the library
  • Bumping dependency versions

Upgrade notes

  • SwaggerRequestResponseValidator has been deprecated in favor of OpenApiInteractionValidator. The original SwaggerRequestResponseValidator will be removed in a future release.
  • Various filters and interceptors etc. in the adapter modules have been deprecated and replaced with versions named with OpenApi*. The original Swagger* named versions will be removed in a future release.
  • Schema validation errors now have the form validation.{request|response}.{body|parameter}.schema.{keyword} e.g. validation.request.parameter.schema.type
  • Multi-part formdata validation is currently not supported. This will be re-added in an upcoming release.

See OpenAPI v3 feature coverage for details on supported OpenAPI v3 features.

v1.5.0

  • Bumped version of Pact from 3.2.13 to 3.5.20 [Details]

    Important: This changes the required Scala version from 2.11 to 2.12. There are also breaking changes in the Pact API. Importantly, usages of the ValidatedPactProviderRule should now use provider.getUrl() instead of provider.config().url().

v1.4.7

  • Fixed the 'additional properties' validation for inline and nested schema definitions [#131]
  • Bumped the version of swagger-parser to pick up a fix for pattern validation [#44] [Details]
  • Added response validation to the Spring MVC adaptor [#58]
  • Added control over 'unknown request' validation in the Spring MVC adaptor [#55]

v1.4.6

  • Added support for HAL+JSON content type [#127]
  • Added an overloaded constructor to allow the host/port of the ValidatedPactProviderRule to be specified [#72]
  • Ensuring the stream is closed after reading the request/response body in the SwaggerRequestValidationService
    [#132]

v1.4.5

  • Fixed validation of non-string enums in request/response bodies. [#118]
  • Removed usage of servletRequest.getContentLengthLong() to be compatible with Servlet 2.0 [#114]
  • Added support for dynamic path matching to the operation resolver. [#121]

v1.4.4

  • Added support for basic auth in the Pact Provider validator for retrieving Pacts from a broker that requires authentication [#122] [Details]

v1.4.3

  • Bumped version of json-schema-validator to pick up a bugfix [#120] [Details]

v1.4.2

  • Stopped trying to validate non-JSON request/response bodies with the JSON schema validator [#65] [#94]

v1.4.1

  • Added additional context to validation messages to describe where a validation error occurred [#33] [Details]

v1.4.0

v1.3.10

  • Added support for HTTP Basic auth validation, and AND/OR security operations [#99]

v1.3.9

  • Split comma-separated headers into individual values before validating [#97]

v1.3.8

v1.3.7

  • Improved the way API operations are resolved when multiple paths potentially match an incoming request [#83]
  • Exposed the RestAssured SwaggerValidationException so it can be handled in tests [#89]

v1.3.6

Version burned

v1.3.5

Version burned

v1.3.4

Version burned

v1.3.3

  • Fixed a bug with handling of leading/trailing slashes in the api basePath [#87]
  • Added support for uri, ipv4, ipv6, email and uuid format validation in query/path params [#85]

v1.3.2

  • Added support for path params that aren't an entire path part, e.g. /{param}.json [#81]

v1.3.1

  • Improved performance of the SpringMVC filter [Details]
  • Fixed a bug where params with $ref would throw a NPE [#59]
  • Fixed a bug where specs with a definitions block would fail validation [#74]
  • Bumped version of swagger-parser to 1.0.32

v1.3.0

  • Added support for fine-grained whitelisting of validation errors based on user-defined rules. [Details]

v1.2.4

  • Fixed NPE when using an 'anything' request schema. Validation with the {} schema will now accept any JSON value. [Details]

v1.2.3

  • Fixed an NPE with Spring MockMVC when no body [#71]

v1.2.2

  • Default collection format to CSV when not provided [#68]
  • SpringMVC filter now ignores CORS pre-flight requests during validation [#67]

v1.2.1

  • Fixed a bug where RFC3339 timestamps in headers could cause validation to fail even if they are valid [#54] [#63]
  • Added examples of using Spring MVC exception resolvers with the request validator [#56]

v1.2.0

  • Refactored request/response adapters to use Builders that create SimpleRequest and SimpleResponse instances. The module-specific adapter constructors are now deprecated and will be removed in a future release. [Details]
  • Added support for Spring MVC. Requests can now be validated at runtime in production. [#51]
  • Fixed a bug where non-form params were validated as form params [Details]

v1.1.1

  • Fixed a bug where a StackOverflowError occurs when there are too many messages in a report [#52]

v1.1.0

  • Added support for Spring MockMvc [Details]
  • Fixed a bug where subsequent validations of 'discriminator' changed behavior [#46]
  • Bumped version of json-schema-validator and switched to new groupId

v1.0.19

  • Added support for RFC3339 timestamp validation [#48]
  • Moved message bundle to avoid collision with parent project [#49]

v1.0.18

  • Fixed a bug with Pact validation not treating header names as case-insensitive [Details]

v1.0.17

  • Added support for additional HTTP methods [#42]
  • Fixed NPE when missing required header parameters [#43]

v1.0.16

  • Removed MutableValidationReport and improved validation report behavior [#35] [#14]

v1.0.15

  • Added support for providing auth data when retrieving remote Swagger API documents [#41]

v1.0.14

  • Fixed a bug where API path prefix is not used in operation lookup [#40]

v1.0.13

  • Fixed a bug in validation of nulls in arrays, or in objects within arrays [#37]
  • Added support for no-value query params and headers in the SimpleRequest builder [#34]

v1.0.12

  • Added support for Swagger format validation within JSON schema (string/date, integer/int32 etc.) [#36]
  • Added support for matching on method+path where there are overlapping path patterns across request operations [Details]

v1.0.11

  • Added ability to validate requests/responses independently [Details]

v1.0.10

  • Added support for request and response header validation [#22]
  • Added support for request Content-Type validation against spec Consumes types [#22]
  • Added support for request Accept validation against spec Produces types [#22]
  • Added support for response Content-Type validation against spec Produces types [#22]
  • Added support for the Swagger/OpenAPI discriminator keyword [#26]

v1.0.9

  • Added basic support for validation of security tokens in headers and query params [#30]

v1.0.8

  • Added support for validation of x-www-form-urlencoded request bodies [#28]

v1.0.7

  • Added additional error messages from schema validation when composite schema validation fails (e.g. allOf) [#25]

v1.0.6

  • Disabling additionalProperties validation when message level validation.schema.additionalProperties=IGNORE to support validation of allOf etc. [#24]

v1.0.5

  • Additional parameter validation support (pattern, min/max length, date format etc.)
  • Support for JSON string payloads as well as URLs
  • Added Pact Provider validator that retrieves Consumer Pacts from a broker and validates them against a spec [#20]