From 50cf09f0155dfa0ad24cb9cbc519812258dd1260 Mon Sep 17 00:00:00 2001 From: arcuri82 Date: Wed, 3 Jun 2026 20:47:16 +0200 Subject: [PATCH 1/4] starting with 3.1 advanced formats --- .../BBAdvancedFormatsApplication.kt | 71 ++++++++++ .../static/openapi-bbadvancedformats.json | 109 ++++++++++++++++ .../BBAdvancedFormatsController.kt | 16 +++ .../BBAdvancedFormatsEMTest.kt | 51 ++++++++ .../kotlin/org/evomaster/core/EMConfig.kt | 4 + .../rest/builder/RestActionBuilderV3.kt | 121 +++++++++++++++++- docs/options.md | 1 + 7 files changed, 366 insertions(+), 7 deletions(-) create mode 100644 core-tests/e2e-tests/spring/spring-rest-bb/src/main/kotlin/com/foo/rest/examples/bb/advancedformats/BBAdvancedFormatsApplication.kt create mode 100644 core-tests/e2e-tests/spring/spring-rest-bb/src/main/resources/static/openapi-bbadvancedformats.json create mode 100644 core-tests/e2e-tests/spring/spring-rest-bb/src/test/kotlin/com/foo/rest/examples/bb/advancedformats/BBAdvancedFormatsController.kt create mode 100644 core-tests/e2e-tests/spring/spring-rest-bb/src/test/kotlin/org/evomaster/e2etests/spring/rest/bb/advancedformats/BBAdvancedFormatsEMTest.kt diff --git a/core-tests/e2e-tests/spring/spring-rest-bb/src/main/kotlin/com/foo/rest/examples/bb/advancedformats/BBAdvancedFormatsApplication.kt b/core-tests/e2e-tests/spring/spring-rest-bb/src/main/kotlin/com/foo/rest/examples/bb/advancedformats/BBAdvancedFormatsApplication.kt new file mode 100644 index 0000000000..0cac89d9a4 --- /dev/null +++ b/core-tests/e2e-tests/spring/spring-rest-bb/src/main/kotlin/com/foo/rest/examples/bb/advancedformats/BBAdvancedFormatsApplication.kt @@ -0,0 +1,71 @@ +package com.foo.rest.examples.bb.advancedformats + +import org.evomaster.e2etests.utils.CoveredTargets +import org.springframework.boot.SpringApplication +import org.springframework.boot.autoconfigure.SpringBootApplication +import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration +import org.springframework.http.ResponseEntity +import org.springframework.web.bind.annotation.* +import java.net.URI +import java.util.UUID + +@SpringBootApplication(exclude = [SecurityAutoConfiguration::class]) +@RequestMapping(path = ["/api/advancedformats"]) +@RestController +open class BBAdvancedFormatsApplication { + + companion object { + @JvmStatic + fun main(args: Array) { + SpringApplication.run(BBAdvancedFormatsApplication::class.java, *args) + } + } + + + @GetMapping("/uuid") + open fun getUuid( + @RequestParam(required = true) x: String? + ) : ResponseEntity { + + if (x == null) { + return ResponseEntity.status(400).build() + } + + UUID.fromString(x) + + CoveredTargets.cover("uuid") + + return ResponseEntity.status(200).body("OK") + } + + @GetMapping("/email") + open fun getEmail( + @RequestParam(required = true) x: String? + ) : ResponseEntity { + + if (x == null || !x.contains('@')) { + return ResponseEntity.status(400).build() + } + + CoveredTargets.cover("email") + + return ResponseEntity.status(200).body("OK") + } + + @GetMapping("/uri") + open fun getUri( + @RequestParam(required = true) x: String? + ) : ResponseEntity { + + if (x == null) { + return ResponseEntity.status(400).build() + } + + URI(x) + + CoveredTargets.cover("uri") + + return ResponseEntity.status(200).body("OK") + } + +} \ No newline at end of file diff --git a/core-tests/e2e-tests/spring/spring-rest-bb/src/main/resources/static/openapi-bbadvancedformats.json b/core-tests/e2e-tests/spring/spring-rest-bb/src/main/resources/static/openapi-bbadvancedformats.json new file mode 100644 index 0000000000..7b2993c186 --- /dev/null +++ b/core-tests/e2e-tests/spring/spring-rest-bb/src/main/resources/static/openapi-bbadvancedformats.json @@ -0,0 +1,109 @@ +{ + "openapi": "3.0.1", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost:8080", + "description": "Generated server url" + } + ], + "paths": { + "/api/advancedformats/uuid": { + "get": { + "tags": [ + "bb-advanced-formats-application" + ], + "operationId": "getUuid", + "parameters": [ + { + "name": "x", + "in": "query", + "required": false, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/api/advancedformats/uri": { + "get": { + "tags": [ + "bb-advanced-formats-application" + ], + "operationId": "getUri", + "parameters": [ + { + "name": "x", + "in": "query", + "required": false, + "schema": { + "type": "string", + "format": "uri" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/api/advancedformats/email": { + "get": { + "tags": [ + "bb-advanced-formats-application" + ], + "operationId": "getEmail", + "parameters": [ + { + "name": "x", + "in": "query", + "required": false, + "schema": { + "type": "string", + "format": "email" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": {} +} \ No newline at end of file diff --git a/core-tests/e2e-tests/spring/spring-rest-bb/src/test/kotlin/com/foo/rest/examples/bb/advancedformats/BBAdvancedFormatsController.kt b/core-tests/e2e-tests/spring/spring-rest-bb/src/test/kotlin/com/foo/rest/examples/bb/advancedformats/BBAdvancedFormatsController.kt new file mode 100644 index 0000000000..83477e956a --- /dev/null +++ b/core-tests/e2e-tests/spring/spring-rest-bb/src/test/kotlin/com/foo/rest/examples/bb/advancedformats/BBAdvancedFormatsController.kt @@ -0,0 +1,16 @@ +package com.foo.rest.examples.bb.advancedformats + +import com.foo.rest.examples.bb.SpringController +import org.evomaster.client.java.controller.problem.ProblemInfo +import org.evomaster.client.java.controller.problem.RestProblem + +class BBAdvancedFormatsController : SpringController(BBAdvancedFormatsApplication::class.java){ + + + override fun getProblemInfo(): ProblemInfo { + return RestProblem( + "http://localhost:$sutPort/openapi-bbadvancedformats.json", + null + ) + } +} \ No newline at end of file diff --git a/core-tests/e2e-tests/spring/spring-rest-bb/src/test/kotlin/org/evomaster/e2etests/spring/rest/bb/advancedformats/BBAdvancedFormatsEMTest.kt b/core-tests/e2e-tests/spring/spring-rest-bb/src/test/kotlin/org/evomaster/e2etests/spring/rest/bb/advancedformats/BBAdvancedFormatsEMTest.kt new file mode 100644 index 0000000000..2cbd3cbc6b --- /dev/null +++ b/core-tests/e2e-tests/spring/spring-rest-bb/src/test/kotlin/org/evomaster/e2etests/spring/rest/bb/advancedformats/BBAdvancedFormatsEMTest.kt @@ -0,0 +1,51 @@ +package org.evomaster.e2etests.spring.rest.bb.advancedformats + +import com.foo.rest.examples.bb.advancedformats.BBAdvancedFormatsController +import com.foo.rest.examples.bb.exampleobject.BBExampleObjectController +import org.evomaster.core.output.OutputFormat +import org.evomaster.core.problem.rest.data.HttpVerb +import org.evomaster.core.problem.rest.param.BodyParam +import org.evomaster.e2etests.spring.rest.bb.SpringTestBase +import org.evomaster.e2etests.utils.EnterpriseTestBase +import org.junit.jupiter.api.Assertions.assertTrue +import org.junit.jupiter.api.BeforeAll +import org.junit.jupiter.params.ParameterizedTest +import org.junit.jupiter.params.provider.EnumSource + +class BBAdvancedFormatsEMTest : SpringTestBase() { + + companion object { + init { + shouldApplyInstrumentation = false + } + + @BeforeAll + @JvmStatic + fun init() { + initClass(BBAdvancedFormatsController()) + } + } + + @ParameterizedTest + @EnumSource + fun testBlackBoxOutput(outputFormat: OutputFormat) { + + executeAndEvaluateBBTest( + outputFormat, + "advancedformats", + 100, + 3, + listOf("uuid","uri","email") + ){ args: MutableList -> + + setOption(args, "schema", "$baseUrlOfSut/openapi-bbadvancedformats.json") + + val solution = initAndRun(args) + + assertTrue(solution.individuals.size >= 1) + assertHasAtLeastOne(solution, HttpVerb.GET, 200, "/api/advancedformats/uuid", "OK") + assertHasAtLeastOne(solution, HttpVerb.GET, 200, "/api/advancedformats/uri", "OK") + assertHasAtLeastOne(solution, HttpVerb.GET, 200, "/api/advancedformats/email", "OK") + } + } +} diff --git a/core/src/main/kotlin/org/evomaster/core/EMConfig.kt b/core/src/main/kotlin/org/evomaster/core/EMConfig.kt index cc041e3535..efd5bdba0f 100644 --- a/core/src/main/kotlin/org/evomaster/core/EMConfig.kt +++ b/core/src/main/kotlin/org/evomaster/core/EMConfig.kt @@ -2906,6 +2906,10 @@ class EMConfig { @Cfg("Whether to employ constraints specified in API schema (e.g., OpenAPI) in test generation") var enableSchemaConstraintHandling = true + @Experimental + @Cfg("Whether to enable the handling of new type formats in OpenAPI schemas, e.g., the ones introduced in 3.1.0") + var enableAdvancedFormats = false + @Cfg("a probability of enabling single insertion strategy to insert rows into database.") @Probability(activating = true) var probOfEnablingSingleInsertionForTable = 0.5 diff --git a/core/src/main/kotlin/org/evomaster/core/problem/rest/builder/RestActionBuilderV3.kt b/core/src/main/kotlin/org/evomaster/core/problem/rest/builder/RestActionBuilderV3.kt index 306d746182..8961c5fb01 100644 --- a/core/src/main/kotlin/org/evomaster/core/problem/rest/builder/RestActionBuilderV3.kt +++ b/core/src/main/kotlin/org/evomaster/core/problem/rest/builder/RestActionBuilderV3.kt @@ -51,6 +51,7 @@ import org.evomaster.core.search.gene.placeholder.LimitObjectGene import org.evomaster.core.search.gene.regex.RegexGene import org.evomaster.core.search.gene.string.Base64StringGene import org.evomaster.core.search.gene.string.StringGene +import org.evomaster.core.search.gene.uri.UriGene import org.evomaster.core.search.gene.utils.GeneUtils import org.evomaster.core.search.gene.wrapper.NullableGene import org.slf4j.Logger @@ -106,21 +107,24 @@ object RestActionBuilderV3 { which might impact how we design the chromosome. but, for black-box, they would not be useful */ - val usingWhiteBox: Boolean = true + val usingWhiteBox: Boolean = true, + + val enableAdvancedFormats: Boolean = true, ){ constructor(config: EMConfig): this( enableConstraintHandling = config.enableSchemaConstraintHandling, invalidData = config.allowInvalidData, probUseDefault = config.probRestDefault, probUseExamples = config.probRestExamples, - usingWhiteBox = !config.blackBox + usingWhiteBox = !config.blackBox, + enableAdvancedFormats = config.enableAdvancedFormats ) init { - if(probUseDefault < 0 || probUseDefault > 1){ + if(probUseDefault !in 0.0..1.0){ throw IllegalArgumentException("Invalid probUseDefault: $probUseDefault") } - if(probUseExamples < 0 || probUseExamples > 1){ + if(probUseExamples !in 0.0..1.0){ throw IllegalArgumentException("Invalid probUseExamples: $probUseExamples") } } @@ -978,7 +982,7 @@ object RestActionBuilderV3 { )//Base64StringGene(name) "date", "local-date" -> return DateGene(name, onlyValidDates = !options.invalidData) "date-time", "local-date-time" -> { - val f = if (format?.lowercase() == "date-time") { + val f = if (format.lowercase() == "date-time") { FormatForDatesAndTimes.RFC3339 } else { FormatForDatesAndTimes.ISO_LOCAL @@ -992,6 +996,11 @@ object RestActionBuilderV3 { } else -> if (format != null) { + + val advanced = createGeneBasedOnAdvancedFormats(format,schema,name, options, messages, isInPath, examples, schemaHolder, currentSchema, history, referenceClassDef) + if(advanced != null) { + return advanced + } messages.add("Unhandled format '$format' for '$name'") } } @@ -1010,7 +1019,7 @@ object RestActionBuilderV3 { isInPath, examples, messages = messages - )//IntegerGene(name) + ) "number" -> return createNonObjectGeneWithSchemaConstraints( schema, name, @@ -1170,7 +1179,7 @@ object RestActionBuilderV3 { isInPath, examples, messages = messages - ) //StringGene(name) + ) } if ((name == "body" || referenceClassDef != null) && schema.properties?.isNotEmpty() == true) { @@ -1202,6 +1211,104 @@ object RestActionBuilderV3 { throw IllegalArgumentException("Cannot handle combination $type/$format") } + private fun createGeneBasedOnAdvancedFormats( + format: String, + schema: Schema<*>, + name: String, + options: Options, + messages: MutableList, + isInPath: Boolean, + examples: List>, + schemaHolder: RestSchema, + currentSchema: SchemaOpenAPI, + history: Deque, + referenceClassDef: String? + ) : Gene? { + + /* + https://spec.openapis.org/registry/format/ + + The (YES) are new, whereas (NO) are already supported since 3.0 + + Value Description JSON Data Type Source Deprecated + (YES) base64url Binary data encoded as a url-safe string as defined in RFC4648 string Yes + (NO) binary any sequence of octets string OAS Yes + (NO) byte base64 encoded data as defined in RFC4648 string OAS Yes + (YES) char A single character string No + (YES) commonmark commonmark-formatted text string OAS No + (YES) date-time-local RFC3339 date-time without the timezone component string RFC 3339 No + (NO) date-time date and time as defined by date-time - RFC3339 string JSON Schema No + (NO) date date as defined by full-date - RFC3339 string JSON Schema No + (YES) decimal A fixed point decimal number of unspecified precision and range string, number No + (YES) decimal128 A decimal floating-point number with 34 significant decimal digits string, number No + (YES) double-int an integer that can be stored in an IEEE 754 double-precision number without loss of precision number No + (NO) double double precision floating point number number OAS No + (YES) duration duration as defined by duration - RFC3339 string JSON Schema No + (YES) email An email address as defined as Mailbox in RFC5321 string JSON Schema No + (NO) float single precision floating point number number OAS No + (YES) hostname A host name as defined by RFC1123 string JSON Schema No + (YES) html HTML-formatted text string OAS No + (YES) http-date date and time as defined by HTTP-date - RFC7231 string No + (YES) idn-email An email address as defined as Mailbox in RFC6531 string JSON Schema No + (YES) idn-hostname An internationalized host name as defined by RFC5890 string JSON Schema No + (YES) int16 signed 16-bit integer number No + (NO) int32 signed 32-bit integer number OAS No + (NO) int64 signed 64-bit integer number, string OAS No + (YES) int8 signed 8-bit integer number OAS No + (YES) ipv4 An IPv4 address as defined as dotted-quad by RFC2673 string JSON Schema No + (YES) ipv6 An IPv6 address as defined by RFC4673 string JSON Schema No + (YES) iri-reference A Internationalized Resource Identifier as defined in RFC3987 string JSON Schema No + (YES) iri A Internationalized Resource Identifier as defined in RFC3987 string JSON Schema No + (YES) json-pointer A JSON string representation of a JSON Pointer as defined in RFC6901 string JSON Schema No + (YES) media-range A media type as defined by the media-range ABNF production in RFC9110. string OpenAPI No + (NO) password a string that hints to obscure the value. string OAS No + (YES) regex A regular expression as defined in ECMA-262 string JSON Schema No + (YES) relative-json-pointer A JSON string representation of a relative JSON Pointer as defined in draft RFC 01 string JSON Schema No + (YES) sf-binary structured fields byte sequence as defined in [RFC8941] string RFC 8941 No + (YES) sf-boolean structured fields boolean as defined in [RFC8941] string RFC 8941 No + (YES) sf-decimal structured fields decimal as defined in [RFC8941] number RFC 8941 No + (YES) sf-integer structured fields integer as defined in [RFC8941] number RFC 8941 No + (YES) sf-string structured fields string as defined in [RFC8941] string RFC 8941 No + (YES) sf-token structured fields token as defined in [RFC8941] string RFC 8941 No + (YES) time-local RFC3339 time without the timezone component string RFC 3339 No + (YES) time time as defined by full-time - RFC3339 string JSON Schema No + (YES) uint16 unsigned 16-bit integer number OAS No + (YES) uint32 unsigned 32-bit integer number OAS No + (YES) uint64 unsigned 64-bit integer number, string OAS No + (YES) uint8 unsigned 8-bit integer number OAS No + (YES) unixtime seconds since Jan 1st 1970 - IEEE1003.1-2024/POSIX.1-2024 number, string IEEE1003.1-2024 No + (YES) uri-reference A URI reference as defined in RFC3986 string JSON Schema No + (YES) uri-template A URI Template as defined in RFC6570 string JSON Schema No + (YES) uri A Uniform Resource Identifier as defined in RFC3986 string JSON Schema No + (YES) uuid A Universally Unique IDentifier as defined in RFC4122 string JSON Schema No + */ + + when(format){ + "uuid" -> return UUIDGene(name) + "uri" -> return UriGene(name) + "email" -> return createEmailGene(name, options) + //TODO all the other cases, and update BBAdvancedFormatsEMTest accordingly + } + + return null + } + + private fun createEmailGene( + name: String, + options: Options + ): Gene { + + /* + A new EmailGene might be on overkill if we can just use a regex. + However, RFC5321 is quite complex. + This regex is quite simple, but should do. + After all, here we just need to sample valid emails, and not verify + if a string is a valid email. + */ + return RegexHandler.createGeneForJVM("[A-Za-z0-9]{2,}@[A-Za-z0-9]+.[A-Za-z]{2,}") + .apply { this.name = name } + } + /** * @param referenceTypeName is the name of object type */ diff --git a/docs/options.md b/docs/options.md index aa6b5227d1..062f072167 100644 --- a/docs/options.md +++ b/docs/options.md @@ -276,6 +276,7 @@ There are 3 types of options: |`dpcTargetTestSize`| __Int__. Specify a max size of a test to be targeted when either DPC_INCREASING or DPC_DECREASING is enabled. *Default value*: `1`.| |`employResourceSizeHandlingStrategy`| __Enum__. Specify a strategy to determinate a number of resources to be manipulated throughout the search. *Valid values*: `NONE, RANDOM, DPC`. *Default value*: `NONE`.| |`enableAdaptiveResourceStructureMutation`| __Boolean__. Specify whether to decide the resource-based structure mutator and resource to be mutated adaptively based on impacts during focused search.Note that it only works when resource-based solution is enabled for solving REST problem. *Default value*: `false`.| +|`enableAdvancedFormats`| __Boolean__. Whether to enable the handling of new type formats in OpenAPI schemas, e.g., the ones introduced in 3.1.0. *Default value*: `false`.| |`enableCustomizedMethodForMockObjectHandling`| __Boolean__. Whether to apply customized method (i.e., implement 'customizeMockingRPCExternalService' for external services or 'customizeMockingDatabase' for database) to handle mock object. *Default value*: `false`.| |`enableCustomizedMethodForScheduleTaskHandling`| __Boolean__. Whether to apply customized method (i.e., implement 'customizeScheduleTaskInvocation' for invoking schedule task) to invoke schedule task. *Default value*: `false`.| |`enableRPCCustomizedTestOutput`| __Boolean__. Whether to enable customized RPC Test output if 'customizeRPCTestOutput' is implemented. *Default value*: `false`.| From bb6c56bd85ebb05e0fc8c9694c46feef06425759 Mon Sep 17 00:00:00 2001 From: arcuri82 Date: Wed, 3 Jun 2026 20:59:00 +0200 Subject: [PATCH 2/4] fixed compilation issue --- .../spring/examples/adaptivehypermutation/DeterminismTest.java | 2 +- .../spring/examples/adaptivehypermutation/DeterminismTest.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core-tests/e2e-tests/spring/spring-rest-h2-v1/src/test/java/org/evomaster/e2etests/spring/examples/adaptivehypermutation/DeterminismTest.java b/core-tests/e2e-tests/spring/spring-rest-h2-v1/src/test/java/org/evomaster/e2etests/spring/examples/adaptivehypermutation/DeterminismTest.java index d1da1d440e..80a61ac578 100644 --- a/core-tests/e2e-tests/spring/spring-rest-h2-v1/src/test/java/org/evomaster/e2etests/spring/examples/adaptivehypermutation/DeterminismTest.java +++ b/core-tests/e2e-tests/spring/spring-rest-h2-v1/src/test/java/org/evomaster/e2etests/spring/examples/adaptivehypermutation/DeterminismTest.java @@ -28,7 +28,7 @@ public void testDeterminismOfLog(boolean enableConstraintHandling){ OpenAPI schema = (new OpenAPIParser()).readLocation("swagger-ahm/ahm.json", null, null).getOpenAPI(); isDeterminismConsumer( new ArrayList<>(), (args) -> RestActionBuilderV3.INSTANCE .getModelsFromSwagger(schema, new LinkedHashMap<>(), - new RestActionBuilderV3.Options(false,enableConstraintHandling,false,0.0,0.0,true))); + new RestActionBuilderV3.Options(false,enableConstraintHandling,false,0.0,0.0,true,false))); } diff --git a/core-tests/jdk-8/spring-rest-openapi-v2-tests/src/test/java/org/evomaster/e2etests/spring/examples/adaptivehypermutation/DeterminismTest.java b/core-tests/jdk-8/spring-rest-openapi-v2-tests/src/test/java/org/evomaster/e2etests/spring/examples/adaptivehypermutation/DeterminismTest.java index 293a58469a..2ed5d64793 100644 --- a/core-tests/jdk-8/spring-rest-openapi-v2-tests/src/test/java/org/evomaster/e2etests/spring/examples/adaptivehypermutation/DeterminismTest.java +++ b/core-tests/jdk-8/spring-rest-openapi-v2-tests/src/test/java/org/evomaster/e2etests/spring/examples/adaptivehypermutation/DeterminismTest.java @@ -27,7 +27,7 @@ public void testDeterminismOfLog(boolean enableConstraintHandling){ OpenAPI schema = (new OpenAPIParser()).readLocation("swagger-ahm/ahm.json", null, null).getOpenAPI(); isDeterminismConsumer( new ArrayList<>(), (args) -> { RestActionBuilderV3.INSTANCE.getModelsFromSwagger(schema, new LinkedHashMap<>(), - new RestActionBuilderV3.Options(false,enableConstraintHandling,false,0.0,0.0,true)); + new RestActionBuilderV3.Options(false,enableConstraintHandling,false,0.0,0.0,true,false)); }); } From 39ac01112cd853bcad91542076b2e08d703596ad Mon Sep 17 00:00:00 2001 From: arcuri82 Date: Wed, 3 Jun 2026 22:16:33 +0200 Subject: [PATCH 3/4] fix due to ignoring new config --- .../core/problem/rest/builder/RestActionBuilderV3.kt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/core/src/main/kotlin/org/evomaster/core/problem/rest/builder/RestActionBuilderV3.kt b/core/src/main/kotlin/org/evomaster/core/problem/rest/builder/RestActionBuilderV3.kt index 8961c5fb01..aca892b6d6 100644 --- a/core/src/main/kotlin/org/evomaster/core/problem/rest/builder/RestActionBuilderV3.kt +++ b/core/src/main/kotlin/org/evomaster/core/problem/rest/builder/RestActionBuilderV3.kt @@ -997,9 +997,11 @@ object RestActionBuilderV3 { else -> if (format != null) { - val advanced = createGeneBasedOnAdvancedFormats(format,schema,name, options, messages, isInPath, examples, schemaHolder, currentSchema, history, referenceClassDef) - if(advanced != null) { - return advanced + if(options.enableAdvancedFormats){ + val advanced = createGeneBasedOnAdvancedFormats(format,schema,name, options, messages, isInPath, examples, schemaHolder, currentSchema, history, referenceClassDef) + if(advanced != null) { + return advanced + } } messages.add("Unhandled format '$format' for '$name'") } From 003fb8a8f9daaf0a3513e5d3b82c9c50cc5a0ee5 Mon Sep 17 00:00:00 2001 From: arcuri82 Date: Wed, 3 Jun 2026 22:32:12 +0200 Subject: [PATCH 4/4] fixed E2E test --- .../spring/rest/bb/advancedformats/BBAdvancedFormatsEMTest.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/core-tests/e2e-tests/spring/spring-rest-bb/src/test/kotlin/org/evomaster/e2etests/spring/rest/bb/advancedformats/BBAdvancedFormatsEMTest.kt b/core-tests/e2e-tests/spring/spring-rest-bb/src/test/kotlin/org/evomaster/e2etests/spring/rest/bb/advancedformats/BBAdvancedFormatsEMTest.kt index 2cbd3cbc6b..c51be0d8d4 100644 --- a/core-tests/e2e-tests/spring/spring-rest-bb/src/test/kotlin/org/evomaster/e2etests/spring/rest/bb/advancedformats/BBAdvancedFormatsEMTest.kt +++ b/core-tests/e2e-tests/spring/spring-rest-bb/src/test/kotlin/org/evomaster/e2etests/spring/rest/bb/advancedformats/BBAdvancedFormatsEMTest.kt @@ -39,6 +39,7 @@ class BBAdvancedFormatsEMTest : SpringTestBase() { ){ args: MutableList -> setOption(args, "schema", "$baseUrlOfSut/openapi-bbadvancedformats.json") + setOption(args, "enableAdvancedFormats", "true") val solution = initAndRun(args)