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.
- 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-clientfor 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-*toopenapi-request-validator-*
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 |
swagger-request-validator-mockmvc-legacy— removed. Migrate toopenapi-request-validator-mockmvcwhich supports Spring MockMVC 7+.swagger-request-validator-wiremock(JUnit 4 module) — removed. Migrate toopenapi-request-validator-wiremock-junit5which uses the non-deprecatedServeEventListenerAPI and supports JUnit 5.
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 |
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+.)
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.
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.VisibleForTestingor 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.
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();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).
The WireMock module now uses the non-deprecated ServeEventListener interface (replacing the old
RequestListener-based approach). The recommended class is OpenApiValidationListener.
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]andtype: [string, 'null']for nullable fields const— exact value matchingif/then/else— conditional schema applicationdependentRequired/dependentSchemas— conditional required fieldsprefixItems— tuple validationunevaluatedProperties— strict object property validation- Numeric
exclusiveMinimum/exclusiveMaximum— OAS 3.1 form (value, not boolean) $refwith sibling keywords — allowed in 3.1 (previously prohibited)- Webhooks — validate webhook requests and responses using
validateWebhookRequest(),validateWebhookResponse(), andvalidateWebhook()
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 | 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 |
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.
Ensure you are building and running on Java 21 or later.
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.
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 → OpenApiValidationListenerswagger-request-validator-mockmvc-legacyusers: migrate toopenapi-request-validator-mockmvcand update to Spring MockMVC 7+.swagger-request-validator-wiremock(JUnit 4) users: migrate toopenapi-request-validator-wiremock-junit5and update your tests to JUnit 5. See the WireMock JUnit 5 README for examples.
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:junitwithau.com.dius.pact.consumer:junit5 - Add
org.junit.jupiter:junit-jupiterto your test dependencies if not already present @IgnoreApiValidationcontinues to work as before
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).
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.
- Bump dependencies:
spring: 6.1.21 -> 6.2.11spring (legacy): 5.3.26 -> 5.3.39spring-boot: 2.6.12 -> 2.6.15jackson: 2.19.0 -> 2.20.0swagger-parser: 2.1.31 -> 2.1.34jetty: 9.4.56.v20240826 -> 9.4.58.v20250814commons-codec: 1.17.1 -> 1.19.0awaitility: 4.2.2 -> 4.3.0snakeyaml: 2.4 -> 2.5
- Bump dependencies:
spring: 6.1.13 -> 6.1.21jackson: 2.15.2 -> 2.19.0mockito: 4.8.0 -> 4.11.0swagger-parser: 2.1.22 -> 2.1.31scala-library: 2.13.14 -> 2.13.16license-maven-plugin: 2.4.0 -> 2.6.0build-helper-maven-plugin: 3.6.0 -> 3.6.1snakeyaml: 2.0 -> 2.4
- Bump dependencies:
spring (legacy): 5.3.26 -> 5.3.39netty: 4.1.113.Final -> 4.1.115.Finalcommons-codec: 1.16.0 -> 1.17.1awaitility: 4.2.1 -> 4.2.2maven-checkstyle-plugin: 3.3.1 -> 3.6.0
- Fix handling of encoded characters when validating path params [#328] [Details]
- Bump dependencies:
spring: 6.1.3 -> 6.1.13guava: 33.0.0-jre -> 33.3.1-jrejetty: 9.4.53.v20231009 -> 9.4.56.v20240826netty: 4.1.106.Final -> 4.1.113.Finaljunit: 5.10.0 -> 5.11.1
- Bump dependencies:
maven: 3.9.1 -> 3.9.7scala-library: 2.13.11 -> 2.13.14wiremock: 2.35.1 -> 2.35.2swagger-parser: 2.1.20 -> 2.1.22
- Bump dependencies:
guava: 31.1-jre -> 33.0.0-jrewiremock: 2.35.0 -> 2.35.1spring: 6.0.8 -> 6.1.3jetty: 9.4.51.v20230217 -> v9.4.53.v20231009netty: 4.1.92.Final -> v4.1.106.Finalswagger-parser: 2.1.13 -> 2.1.20
- Support for "strict" operation matching that strictly matches trailing slashes on a path [Details]
- Support operation response code ranges [Details]
- Support configuring the schema validation cache size. Allows consumers to limit the size to avoid OOME. [#774] [Details]
- Bump dependencies:
scala-library: 2.13.9 -> 2.13.11jackson: 2.14.1 -> 2.15.2hamcrest-optional: 1.2.0 -> 1.3.2mockito: 4.8.0 -> 4.11.0commons-codec: 1.13 -> 1.16.0junit-jupiter: 5.8.2 -> 5.10.0
- 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]
- Bump
swagger-parser2.1.9 -> 2.1.13
- Bump dependencies:
maven: 3.8.7 -> 3.9.1snakeyaml: 1.33 -> 2.0spring: 6.0.2 -> 6.0.8netty: 4.1.85.Final -> 4.1.92.Finaljetty: 9.4.49.v20220914 -> 9.4.51.v20230217rhino: 1.7.12 -> 1.7.14tika: 1.28.4 -> 1.28.5
- Bumped Spring 5.x dependency to 5.3.26 to address open CVE [Details]
- Changed
swagger-request-validator-spring-web-clientto support Spring 6+ and added a new moduleswagger-request-validator-spring-web-client-legacyfor 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.
- Add a new module
swagger-request-validator-spring-webmvcthat 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.
Version burned (failed deployment pipeline)
- 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]
- Fix behavior of arrays for "exploded" params
- [Details]
- Bump dependencies:
swagger-parser: 2.0.28 -> 2.1.9guava: 30.1.1 -> 31.1jackson: 2.13.3 -> 2.14.1mockito: 4.4.0 -> 4.8.0pact-jvm: 4.1.38 -> 4.1.40wiremock: 2.32.0 -> 2.35.0jmh-core: 1.34 -> 1.36jsonassert: 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.
- Add a new module
swagger-request-validator-wiremock-junit5for use with Wiremock in JUnit 5. See the README for more information. [#386] [Details]
- 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.
- Fix NPE when no query params in request [Details]
- Bump
org.json:jsontransitive dependency to address CVE
- Bump dependencies:
jackson-core: 2.13.2 -> 2.13.3jackson-databind: 2.13.2.2. -> 2.13.3spring: 5.3.18 -> 5.3.20logback: 1.2.10 -> 1.2.11pack-jvm: 4.1.34 -> 4.1.38jetty: 9.4.44.v20210927 -> 9.4.46.v20220331rest-assured: 4.5.1 -> 5.1.1 (Note: This is a major version change)
- Remove the unnecessary schema copy step during
discriminatorvalidation [Details]
- Fix a race condition when running validation with a
discriminatorwith many concurrent requests [Details]
- Fix NPE when running validation with a
discriminatorwith many concurrent requests [Details]
- Bump dependencies to address CVEs
[Details]:
jackson-core: 2.13.1 -> 2.13.2jackson-databind: 2.13.1 -> 2.13.2.2spring: 5.3.16 -> 5.3.18
- Add support for exploded form params as per OpenAPI spec [#376] [Details]
- Version bumps:
mockito: 4.2.0 -> 4.4.0pact-jvm: 4.1.33 -> 4.1.44slf4j: 1.7.33 -> 1.7.36rest-assured: 4.5.0 -> 4.5.1spring: 5.3.15 -> 5.3.16xerces: 2.12.0 -> 2.12.2 (transitive)checkstyle: 9.2.1 -> 9.3 (plugin)
- Changed the
wiremockdep towiremock-jre8to fix build failures aswiremockis no longer available in maven-central after version 2.27.2 [#377] [Details]
- More improvements to
allOf+discriminatorvalidation to address validation loops and improve threadsafety of the schema validation [#269] [Details] - Add a builder option to disable schema
$refresolution without needing to supply aParseOptionsinstance [Details]
- Bumped version of Wiremock from 2.27.2 -> 2.32.0
- Bumped version of Rest Assured from 4.4.0 -> 4.5.0
- Bumped a number of dependencies (mostly plugins and build tooling):
jackson: 2.13.0 -> 2.13.1logback: 1.2.6 -> 1.2.10slf4j: 1.7.32 -> 1.7.33pact-jvm: 4.1.28 -> 4.1.33spring: 5.3.12 -> 5.3.15
- 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
- Bumped a number of dependencies:
guava: 28.2-jre -> 30.1.1-jrejackson: 2.12.5 -> 2.13.0mockito: 3.12.4 -> 4.0.0 (test)spring: 5.3.9 -> 5.3.12netty: 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)
- Fix for
ResettableRequestServletWrappertreating bytes as signed and incorrectly reporting negative numbers [#367] [Details]
Note: This makes the validator stricter in the way it handles empty parameters.
- Bumped a number of dependencies:
spring: 5.3.3 -> 5.3.9netty: 4.1.66.Final -> 4.1.68.Finaljetty: 9.4.43.v20210629 -> 9.4.44.v20210927jackson: 2.12.3 -> 2.12.5swagger-parser: 2.0.27 -> 2.0.28mockito-core: 3.11.2 -> 3.12.4logback-classic: 1.2.5 -> 1.2.6checkstyle: 8.45.1 -> 9.0.1jmh: 1.32 -> 1.33
- Fixed the broken release pipeline. No lib changes
(see release notes for
2.19.2,2.19.3and2.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
ContentTypeheader when wildcard ranges exist [#318] [Details] - Fixed a problem with the JDK8 time module not being registered with Jackson during schema parsing [#331] [Details]
Important Due to a broken release pipeline this version is not available in Maven Central. Please use 2.19.5.
- Fixed behavior around
additionalPropertiesvalidations for the case of non-Object schemas. This should address a number of problems aroundoneOf,anyOfandallOfvalidation for schemas that contain non-Object types. [#336] [Details]
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.3logback: 1.2.3 -> 1.2.5slf4j: 1.7.30 -> 1.7.32mockito: 3.9.0 -> 3.11.2rest-assured: 4.3.3 -> 4.4.0swagger-parser: 2.0.25 -> 2.0.27jmh: 1.29 -> 1.32jetty: 9.4.39.v20210325 -> 9.4.43.v20210629netty: 4.1.63.FINAL -> 4.1.66.FINAL
Version burned (broken release pipeline)
Version burned (broken release pipeline)
- Allow adding multiple headers using
OpenApiInteractionValidator.Builder#withAuthHeaderData. [Details]
- Exposed
ParseOptionsfrom the underlying swagger-parser library so they can be set during validator creation. Specifically, theresolveCombinatorsoption may be used in some cases to avoid the problem withadditionalPropertiesvalidation with theallOfkeyword (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
Pointerinformation 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]
- Bumped a number of minor/patch versions of dependencies:
jackson: 2.12.1 -> 2.12.2swagger-parser: 2.0.24 -> 2.0.25jetty: 9.4.36.v20210114 -> 9.4.39.v20210325netty: 4.1.59.FINAL -> 4.1.63.FINAL
- Bumped the version of
spring5.1.14 -> 5.3.3 - Bumped the version of
spring-bootused in tests 1.5.22 -> 2.4.2
- Fixed the version specifier of
json-schema-validatorfromv2.2.14to2.2.14[Details]
- Bumped
rest-assured3.3.0 -> 4.3.3
Note: This is a major version bump of rest-assured.
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.RELEASEjson-schema-validator: 2.2.11 -> 2.2.14guava: 28.1-jre -> 28.2-jrecheckstyle: 8.25 -> 8.40jmh: 1.26 -> 1.27hamcrest-optional: 1.1.5 -> 1.2.0junit: 4.12 -> 4.13.1mockito: 3.3.3 -> 3.7.7netty: 4.1.58.Final -> 4.1.59.Final
- Bumped some dependencies to address vulnerabilities in transitive dependencies
pact: 3.6.14 -> 3.6.15netty: 4.1.30.Final -> 4.1.58.Finaljetty: 9.2.28.v20190418 -> 9.4.36.v20210114wiremock: 2.25.1 -> 2.27.2jackson: 2.10.3 -> 2.12.1commons-codec: 1.10 -> 1.15httpclient: 4.5.6 -> 4.5.13
- A number of improvements to the validation behavior around use of
discriminatorwith 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
discriminatorforanyOfandoneOf - 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.
- Performance improvement: Memoized the processed schema to avoid de-serializing the schema multiple times for the same spec [#292] [Details]
- Bumped
swagger-parsertov2.0.24to pick up a change to included versions ofjackson-coreutils(see swagger-api/swagger-parser#1480) [#305] [Details]
- 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]
- Added ability to set the request/response bodies as
byte[]orInputStreamto avoid unnecessary deserialization [#273] [Details] [Details] - Added some benchmarks to allow future performance improvements to be better tested [#294] [Details]
- 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]
- 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
matrixandlabelstyle 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).
- Fix a bug in matching of responses with wildcards in the defined media type [#177] [Details]
- Added support for the
allowEmptyValuesparam property and cleaned up handling of empty arrays [#61] [Details]
- Bump
swagger-parserto pickup change around treatment of multiple path params in a single path segment. Added tests to exercise this scenario. [#275] [Details] - Add support for basic validation for cookie authentication [#278] [Details]
- 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]
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.
- Fix behavior of
readOnly/writeOnlywithrequiredfor nested/composed schemas [#265] [Details] - Add a new factory method to construct validator instances from pre-parsed
OpenAPIinstances [#226] [Details] - Fix the example tests so that they run as expected [#261] [Details]
- Bump some dependency versions
[Details]
swagger-parser-> 2.0.19jackson-> 2.10.3slf4j-> 1.7.30mockito-> 3.3.3wiremock-> 2.25.1spring-> 4.3.25-RELEASE and 5.1.14-RELEASEhamcrest-> 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.
- Bump
swagger-parser2.0.14 -> 2.0.17 (including bump ofjackson2.9.10 -> 2.10.2 ) [Details]
- Improve performance of Base64 validation [#259] [Details]
- Include
deepObjectparams in the unexpected param validation [#258] [Details]
Version burned
- Add ability to provide a pre-parsed
OpenApiobject to the validator [Details] - Improve Base64 format validation by detecting strings that are missing padding [Details]
- Remove usage of
@BetaGuava methods [Details] - Fix a race condition in the
LevelResolver[#251] [Details]
- 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]
- Bumped versions of a number of dependencies
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.
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.
- Added factory methods to create
OpenApiInteractionValidatorinstances with a spec or URL to avoid having to guess at what has been provided. [#236] [Details]
- Added support for Cookie parameter validation [#224] [Details]
- Improved validation messages by including messages from deeply nested objects during schema validation [#221] [Details]
- Added a constructor to
com.atlassian.oai.validator.springmvc.OpenApiValidationInterceptorto allow a custom report handler to be provided [Details]
- Improved performance for validation of long Base64 encoded strings [#225] [Details]
- Fixed treatment of the
requiredflag when used withreadOnlyandwriteOnlyin request/response bodies [#207] [Details]
- Fixed a bug where backslashes in query params etc. are treated incorrectly during validation [#220] [Details]
- Fixed a problem where the request path can be null under some circumstances in Spring MVC [#218] [Details]
- Bump version of
json-schema-validatorto pickup improvements [#216] [Details] - Fix decoding of query param names in the
swagger-request-validator-springmvcmodule [#215] [Details]
- Added support for custom validation logic that can be used to e.g. provide validation for vendor extensions [Docs] [Details]
- Fixed content type matching to return un-modified content types [Details]
- Added support for basic HTTP Bearer auth validation [#195]
- Fixed NPE when
securitydefined but nosecuritySchemesdefined [#188] - Added better support for using multiple authentication types [Details]
- To address a breaking change in
spring-test-5.1.0.RELEASE, introducedswagger-request-validator-mockmvc-legacyfor 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.
- Added a new module for performing Swagger / Open API validation with Spring Web Client [Details]
- Changed JSON mediatype detection to support
+jsonsuffixes [Details]
- Fixed a bug when the
producesclause is empty in a swagger v2 spec [#179]
- Added ability to change behavior in the
OpenApiValidationInterceptorto suit consumer use cases [Details]
- 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]
- Decode query params before validation in Spring MVC [#155]
- Bumped version of
swagger-parserto 2.0.5 - Fixed behavior of validation with referenced request bodies [#165]
- Decode query params before validation in Spring MVC [#155]
Major release milestone.
Provides support for both Swagger v2 and OpenAPI v3 specifications.
- Support for OpenAPI v3
- Additional context attached to validation messages
- Standardization of validation message keys
- Substantial refactoring within the library
- Bumping dependency versions
SwaggerRequestResponseValidatorhas been deprecated in favor ofOpenApiInteractionValidator. The originalSwaggerRequestResponseValidatorwill 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 originalSwagger*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.
-
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
ValidatedPactProviderRuleshould now useprovider.getUrl()instead ofprovider.config().url().
- Fixed the 'additional properties' validation for inline and nested schema definitions [#131]
- Bumped the version of
swagger-parserto 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]
- Added support for HAL+JSON content type [#127]
- Added an overloaded constructor to allow the host/port of the
ValidatedPactProviderRuleto be specified [#72] - Ensuring the stream is closed after reading the request/response body in the
SwaggerRequestValidationService
[#132]
- 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]
- Added support for basic auth in the Pact Provider validator for retrieving Pacts from a broker that requires authentication [#122] [Details]
- Stopped trying to validate non-JSON request/response bodies with the JSON schema validator [#65] [#94]
- Added additional context to validation messages to describe where a validation error occurred [#33] [Details]
- Bumped dependency versions [Details]
- Added support for HTTP Basic auth validation, and AND/OR security operations [#99]
- Split comma-separated headers into individual values before validating [#97]
- Improved the way API operations are resolved when multiple paths potentially match an incoming request [#83]
- Exposed the RestAssured
SwaggerValidationExceptionso it can be handled in tests [#89]
Version burned
Version burned
Version burned
- Fixed a bug with handling of leading/trailing slashes in the api basePath [#87]
- Added support for
uri,ipv4,ipv6,emailanduuidformat validation in query/path params [#85]
- Added support for path params that aren't an entire path part, e.g.
/{param}.json[#81]
- 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
definitionsblock would fail validation [#74] - Bumped version of
swagger-parserto1.0.32
- Added support for fine-grained whitelisting of validation errors based on user-defined rules. [Details]
- Fixed NPE when using an 'anything' request schema. Validation with the
{}schema will now accept any JSON value. [Details]
- Fixed an NPE with Spring MockMVC when no body [#71]
- Default collection format to CSV when not provided [#68]
- SpringMVC filter now ignores CORS pre-flight requests during validation [#67]
- 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]
- Refactored request/response adapters to use Builders that create
SimpleRequestandSimpleResponseinstances. 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]
- Fixed a bug where a
StackOverflowErroroccurs when there are too many messages in a report [#52]
- Added support for Spring MockMvc [Details]
- Fixed a bug where subsequent validations of 'discriminator' changed behavior [#46]
- Bumped version of
json-schema-validatorand switched to new groupId
- Added support for RFC3339 timestamp validation [#48]
- Moved message bundle to avoid collision with parent project [#49]
- Fixed a bug with Pact validation not treating header names as case-insensitive [Details]
- Added support for additional HTTP methods [#42]
- Fixed NPE when missing required header parameters [#43]
- Added support for providing auth data when retrieving remote Swagger API documents [#41]
- Fixed a bug where API path prefix is not used in operation lookup [#40]
- 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]
- 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]
- Added ability to validate requests/responses independently [Details]
- 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
discriminatorkeyword [#26]
- Added basic support for validation of security tokens in headers and query params [#30]
- Added support for validation of
x-www-form-urlencodedrequest bodies [#28]
- Added additional error messages from schema validation when composite schema validation fails (e.g.
allOf) [#25]
- Disabling
additionalPropertiesvalidation when message levelvalidation.schema.additionalProperties=IGNOREto support validation ofallOfetc. [#24]
- 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]