Forum Discussion

Surya98's avatar
Surya98
Visitor
2 years ago

Plugin not rendering ExtensionProperty as a JSON/YAML value

The swagger maven plugin doesn't adhere to the parseValue flag in the ExtensionProperty annotation. The docs suggest the following:

If set to true, field value will be parsed and serialized as JSON/YAML

 

API definition

@ApiOperation(value = "create a user",
response = User.class,
extensions = {
@Extension(name = "x-authorities", properties = {
@ExtensionProperty(name = "roles",
value = "{\"user_create\" : \"admin\"}",
parseValue = true)
})
})

 

But when the final extension property is rendered it is a string in the swagger.json file.

"x-authorities": {
"roles": "{\"user_create\" : \"admin\"}"
}

Is this the intended behavior or am I missing something while configuring the plugin?
My Expected Output is
"x-authorities": {
"roles": {"user_create" : "admin"}
}

No RepliesBe the first to reply