Я разрабатываю микросервисы, состоящие из различных модулей maven.
Субмодуль rest-api — это тот, который я использую для определения интерфейсов REST API.
Интерфейс определен как таковой:
@Path("/identity")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
public interface IIdentityResource {
/**
* Request a Time Based One Time Password (TOTP) for user's email verification.
*
* @param email The user's email
* The email must be valid and not already verified
* The email must be associated to a user
* @return The generated TOTP
*/
@POST
@Path("/account/verification/send-totp")
@APIResponses(value = {
@APIResponse(
responseCode = "204",
description = "Account successfully verified"
),
@APIResponse(
responseCode = "400",
description = "Bad Request - Invalid account verification data",
content = @Content(schema = @Schema(implementation = ErrorResponseDTO.class))
),
@APIResponse(
responseCode = "401",
description = "Not Authorized - Invalid or expired credentials",
content = @Content(schema = @Schema(implementation = ErrorResponseDTO.class))
),
@APIResponse(
responseCode = "403",
description = "Forbidden - Access to resource is forbidden",
content = @Content(schema = @Schema(implementation = ErrorResponseDTO.class))
),
@APIResponse(
responseCode = "404",
description = "Not Found - Account or verification data not found",
content = @Content(schema = @Schema(implementation = ErrorResponseDTO.class))
),
@APIResponse(
responseCode = "500",
description = "Internal Server Error - Unexpected error",
content = @Content(schema = @Schema(implementation = ErrorResponseDTO.class))
)
})
void requestVerificationTOTP(@Valid AccountVerificationOTPRequest accountVerificationOTPRequest);
/**
* Verify the user's email with the given TOTP.
*
* @param email The user's email
* The email must be valid and not already verified
* The email must be associated to a user
* @param totp The TOTP
* @return The generated TOTP
*/
@POST
@Path("/account/verification/verify")
void verifyAccountTOTP(@Valid AccountVerificationRequest accountVerificationRequest) throws BadRequestException, NotFoundException, ForbiddenException, NotAuthorizedException, InternalServerErrorException ;
/**
* Request a Time Based One Time Password (TOTP) for user's password reset.
*
* @param email The user's email
* The email must be valid and not already verified
* The email must be associated to a user
* @return The generated TOTP
*/
@POST
@Path("/account/password-reset/send-totp")
void requestResetTOTP(@Valid PasswordResetOTPRequest passwordResetOTPRequest);
/**
* Reset the user's password with the given TOTP.
*
* @param email The user's email
* The email must be valid and not already verified
* The email must be associated to a user
* @param totp The TOTP
* @return The generated TOTP
*/
@POST
@Path("/account/password-reset/update-password")
void resetPasswordTOTP(@Valid PasswordResetRequest passwordResetRequest) throws BadRequestException, NotFoundException, ForbiddenException, NotAuthorizedException, InternalServerErrorException ;
}
И мой файл pom.xml:
4.0.0
xxx
api-composer
1.4.1
rest-api
io.smallrye
smallrye-open-api
3.13.0
pom
jakarta.ws.rs
jakarta.ws.rs-api
2.1.6
xxx
model
compile
smallrye-open-api-maven-plugin
io.smallrye
3.13.0
generate-schema
target/openapi.yaml
Когда я пытаюсь сгенерировать спецификации openapi с помощью >mvn clean compile -pl rest-api или просто mvn clean compile -pl rest-api smallrye-open-api:generate -schema определение пусто:
---
openapi: 3.0.3
info:
title: Generated API
version: "1.0"
paths: {}
Подробнее здесь: https://stackoverflow.com/questions/790 ... -and-jaxrs
Невозможно сгенерировать спецификации OpenAPI с помощью плагина зависимостей smallrye openapi и интерфейса jaxrs. ⇐ JAVA
Программисты JAVA общаются здесь
1728553721
Anonymous
Я разрабатываю микросервисы, состоящие из различных модулей maven.
Субмодуль rest-api — это тот, который я использую для определения интерфейсов REST API.
Интерфейс определен как таковой:
@Path("/identity")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
public interface IIdentityResource {
/**
* Request a Time Based One Time Password (TOTP) for user's email verification.
*
* @param email The user's email
* The email must be valid and not already verified
* The email must be associated to a user
* @return The generated TOTP
*/
@POST
@Path("/account/verification/send-totp")
@APIResponses(value = {
@APIResponse(
responseCode = "204",
description = "Account successfully verified"
),
@APIResponse(
responseCode = "400",
description = "Bad Request - Invalid account verification data",
content = @Content(schema = @Schema(implementation = ErrorResponseDTO.class))
),
@APIResponse(
responseCode = "401",
description = "Not Authorized - Invalid or expired credentials",
content = @Content(schema = @Schema(implementation = ErrorResponseDTO.class))
),
@APIResponse(
responseCode = "403",
description = "Forbidden - Access to resource is forbidden",
content = @Content(schema = @Schema(implementation = ErrorResponseDTO.class))
),
@APIResponse(
responseCode = "404",
description = "Not Found - Account or verification data not found",
content = @Content(schema = @Schema(implementation = ErrorResponseDTO.class))
),
@APIResponse(
responseCode = "500",
description = "Internal Server Error - Unexpected error",
content = @Content(schema = @Schema(implementation = ErrorResponseDTO.class))
)
})
void requestVerificationTOTP(@Valid AccountVerificationOTPRequest accountVerificationOTPRequest);
/**
* Verify the user's email with the given TOTP.
*
* @param email The user's email
* The email must be valid and not already verified
* The email must be associated to a user
* @param totp The TOTP
* @return The generated TOTP
*/
@POST
@Path("/account/verification/verify")
void verifyAccountTOTP(@Valid AccountVerificationRequest accountVerificationRequest) throws BadRequestException, NotFoundException, ForbiddenException, NotAuthorizedException, InternalServerErrorException ;
/**
* Request a Time Based One Time Password (TOTP) for user's password reset.
*
* @param email The user's email
* The email must be valid and not already verified
* The email must be associated to a user
* @return The generated TOTP
*/
@POST
@Path("/account/password-reset/send-totp")
void requestResetTOTP(@Valid PasswordResetOTPRequest passwordResetOTPRequest);
/**
* Reset the user's password with the given TOTP.
*
* @param email The user's email
* The email must be valid and not already verified
* The email must be associated to a user
* @param totp The TOTP
* @return The generated TOTP
*/
@POST
@Path("/account/password-reset/update-password")
void resetPasswordTOTP(@Valid PasswordResetRequest passwordResetRequest) throws BadRequestException, NotFoundException, ForbiddenException, NotAuthorizedException, InternalServerErrorException ;
}
И мой файл pom.xml:
4.0.0
xxx
api-composer
1.4.1
rest-api
io.smallrye
smallrye-open-api
3.13.0
pom
jakarta.ws.rs
jakarta.ws.rs-api
2.1.6
xxx
model
compile
smallrye-open-api-maven-plugin
io.smallrye
3.13.0
generate-schema
target/openapi.yaml
Когда я пытаюсь сгенерировать спецификации openapi с помощью >mvn clean compile -pl rest-api или просто mvn clean compile -pl rest-api smallrye-open-api:generate -schema определение пусто:
---
openapi: 3.0.3
info:
title: Generated API
version: "1.0"
paths: {}
Подробнее здесь: [url]https://stackoverflow.com/questions/79073778/cannot-generate-openapi-specs-using-smallrye-openapi-dependency-plugin-and-jaxrs[/url]
Ответить
1 сообщение
• Страница 1 из 1
Перейти
- Кемерово-IT
- ↳ Javascript
- ↳ C#
- ↳ JAVA
- ↳ Elasticsearch aggregation
- ↳ Python
- ↳ Php
- ↳ Android
- ↳ Html
- ↳ Jquery
- ↳ C++
- ↳ IOS
- ↳ CSS
- ↳ Excel
- ↳ Linux
- ↳ Apache
- ↳ MySql
- Детский мир
- Для души
- ↳ Музыкальные инструменты даром
- ↳ Печатная продукция даром
- Внешняя красота и здоровье
- ↳ Одежда и обувь для взрослых даром
- ↳ Товары для здоровья
- ↳ Физкультура и спорт
- Техника - даром!
- ↳ Автомобилистам
- ↳ Компьютерная техника
- ↳ Плиты: газовые и электрические
- ↳ Холодильники
- ↳ Стиральные машины
- ↳ Телевизоры
- ↳ Телефоны, смартфоны, плашеты
- ↳ Швейные машинки
- ↳ Прочая электроника и техника
- ↳ Фототехника
- Ремонт и интерьер
- ↳ Стройматериалы, инструмент
- ↳ Мебель и предметы интерьера даром
- ↳ Cантехника
- Другие темы
- ↳ Разное даром
- ↳ Давай меняться!
- ↳ Отдам\возьму за копеечку
- ↳ Работа и подработка в Кемерове
- ↳ Давай с тобой поговорим...
Мобильная версия