Я определяю примеры в swagger, но одно место не отображается так, как я ожидал, я хочу показать адрес как «14 Cycle way», но в swagger он показывает только «14» в формате json.
Я пробую другой пример, все работает, кроме «число + символ», например, «14 циклов». Интересно, что Swagger делает что-то за кулисами, но я не знаю, как отлаживать, устанавливая некоторые конечные точки, потому что я не знаю, где работа Swagger.
Вот мой код
@Schema(description = "Address details in V2 schema")
public interface Address extends ModelObject {
@Schema(description = "The given address line 1", example = "14 Cycle way")
String getAddressLine1();
Address setAddressLine1(String addressLine1);
@Schema(description = "The given address line 2", example = "Apartment 12")
String getAddressLine2();
Address setAddressLine2(String addressLine2);
@Schema(description = "The given city", example = "Fremount")
String getCity();
Address setCity(String city);
@Schema(description = "The given district/state", example = "CA")
String getDistrict();
Address setDistrict(String district);
@Schema(description = "The given postal code", example = "97658")
String getPostalCode();
Address setPostalCode(String postalCode);
}
вот пример значения в чванстве
"address": {
"district": "CA",
"postalCode": "97658",
"addressLine1": "14", // it only show 14 there
"city": "Fremount",
"addressLine2": "Apartment 12"
},