Ниже приведен мой файл yaml:
Код: Выделить всё
openapi: "3.0.0"
info:
version: 1.0.0
title: Swagger Petstore
license:
name: MIT
servers:
- url: http://petstore.swagger.io/v1
paths:
/pets:
get:
summary: List all pets
operationId: listPets
tags:
- pets
parameters:
- name: limit
in: path
description: How many items to return at one time (max 100)
required: true
schema:
type: integer
maximum: 100
format: int32
responses:
'200':
description: A paged array of pets
headers:
x-next:
description: A link to the next page of responses
schema:
type: string
content:
application/json:
schema:
$ref: "#/components/schemas/Pets"
default:
description: unexpected error
content:
application/json:
schema:
$ref: "#/components/schemas/Error"Сгенерированный метод интерфейса, в котором отсутствует "@Valid":
Код: Выделить всё
default ResponseEntity listPets(
@Max(100) @Parameter(name = "limit", description = "How many items to return at one time (max 100)", required = true, in = ParameterIn.PATH) @PathVariable("limit") Integer limit
) {Аннотация генерируется правильно, когда я меняю параметр Query вместо Path. Может ли кто-нибудь посоветовать, почему Valid не генерируется для параметра Path, хотя он работает для параметра Query?
Подробнее здесь: https://stackoverflow.com/questions/790 ... i-generato