You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was wondering if the following is possible:
I have a Name object being reused in different objects:
import io.swagger.v3.oas.annotations.media.Schema;
@Schema(type = "string", example = "Henrik")
public class Name {}
The Name object is used many places, e.g. in an Address object:
import io.swagger.v3.oas.annotations.media.Schema;
public class Address {
@Schema(description = "The name of a person",
public Name name;
...
}
The expected output looks like this:
Address:
name:
description: "The name of a person"
type: "string"
example: "Henrik"
so far so good 😊 Name is also used in the Car object (but here I want to use another example value for the name-property e.g. Audi)
import io.swagger.v3.oas.annotations.media.Schema;
public class Car {
@Schema(description = "Name of a car", example = "Audi")
public Name name;
...
}
This does not work! Expected outcome is:
Car:
name:
description: "The name of a car"
type: "string"
example: "Audi"
but instead I get:
Car:
name:
description: "The name of a car"
type: "string"
example: "Henrik"
So example value defined on the name-property in the Car object is ignored... ☹️
It will only accept the description in Address and Car objects because description is not defined in Name object. It will not accept the "overwriting" of example="Audi" in the Car object. Why is this the case? Is it a feature or a Bug?
The text was updated successfully, but these errors were encountered:
I was wondering if the following is possible:
I have a Name object being reused in different objects:
The
Name
object is used many places, e.g. in anAddress
object:The expected output looks like this:
so far so good 😊
Name
is also used in theCar
object (but here I want to use another example value for the name-property e.g.Audi
)This does not work! Expected outcome is:
but instead I get:
So example value defined on the name-property in the☹️
Car
object is ignored...It will only accept the
description
inAddress
andCar
objects becausedescription
is not defined inName
object. It will not accept the "overwriting" ofexample="Audi"
in theCar
object. Why is this the case? Is it a feature or a Bug?The text was updated successfully, but these errors were encountered: