-
-
Notifications
You must be signed in to change notification settings - Fork 583
Description
Describe the bug
PropertyResolverUtils.resolveExtensions will convert ObjectNode instances to Strings in cases where the extension value is a HashMap
If value1, i.e. the hashmap value, is an ObjectNode, it will be converted to a String by the line below:
String value1Resolved = this.resolve(value1.toString(), locale);
A possible solution is to only call "resolve" if "value1 instanceof String", as is done for non-hashmap extension values.
To Reproduce
- What modules and versions of springdoc-openapi are you using? 3.0.1
We have extension properties as part/children of extension-values where the extension property is a json-object, example below:
@Extension(
name = "x-my-extension",
properties = {
@ExtensionProperty(
name = "working-hours",
parseValue = true,
value = "{ \"working-hours\": \"Weekdays 00:15 - 22:59 CET\" }"
),
The output of this is the following
"x-my-extension": {
"working-hours": "{\"working-hours\":\"Weekdays 00:15 - 22:59 CET\"}",
I.e. the value is a string and not a JSON object.
Expected behavior
I expect the result to be a JSON object, like below:
"x-my-extension": {
"working-hours": { "working-hours": "Weekdays 00:15 - 22:59 CET" },
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
Add any other context about the problem here.