From 328114dac53585be8f361509182f904319e5b1d2 Mon Sep 17 00:00:00 2001 From: Antoine REY Date: Mon, 5 Dec 2022 19:10:50 +0100 Subject: [PATCH] #14141 Add externalDocs to @Operation to the JavaSpring generator: regenerate the spring-boot-oas3.yaml sample --- .../src/main/java/org/openapitools/api/PetApi.java | 5 ++++- .../petstore/springboot/src/main/resources/openapi.yaml | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/api/PetApi.java b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/api/PetApi.java index e850a25c2e24..818a674ccb5d 100644 --- a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/api/PetApi.java @@ -291,6 +291,8 @@ default ResponseEntity getPetById( * or Invalid ID supplied (status code 400) * or Pet not found (status code 404) * or Validation exception (status code 405) + * API documentation for the updatePet operation + * @see Update an existing pet Documentation */ @Operation( operationId = "updatePet", @@ -308,7 +310,8 @@ default ResponseEntity getPetById( }, security = { @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" }) - } + }, + externalDocs = @ExternalDocumentation(description = "API documentation for the updatePet operation", url = "http://petstore.swagger.io/v2/doc/updatePet") ) @RequestMapping( method = RequestMethod.PUT, diff --git a/samples/openapi3/server/petstore/springboot/src/main/resources/openapi.yaml b/samples/openapi3/server/petstore/springboot/src/main/resources/openapi.yaml index ce4ba1e4a4ea..65092456cbdb 100644 --- a/samples/openapi3/server/petstore/springboot/src/main/resources/openapi.yaml +++ b/samples/openapi3/server/petstore/springboot/src/main/resources/openapi.yaml @@ -51,6 +51,9 @@ paths: - tag: pet put: description: "" + externalDocs: + description: API documentation for the updatePet operation + url: http://petstore.swagger.io/v2/doc/updatePet operationId: updatePet requestBody: $ref: '#/components/requestBodies/Pet'