31. OplnAPI1.0 - アノテーション
●
赤字がOplnAPI1.0のアノテーション
●
swagglrとは微妙にアノテーション名が違うので注意
@GET
@Path("/{id}")
@Operation(summary = "Get username by id")
@APIResponse(description = "The user name"),
@APIResponse(responseCode = "400", description = "User not found")
public Response getUserName(
@Parameter(description = "user id. ", required = true)
@PathParam("id") long id) {...}
Swagglr
(packagl io.swagglr.annotations)
MicroProfil OplnAPI
(packagl org.lciipsl.microprofil.oplnapi.annotations)
@ApiOperation @Operation
@ApiResponse @ApiResponse
@ApiParam @Parameter
32. OplnAPI1.0 - documlnt
●
OplnAPI v3準拠のyami or jsonを生成
●
GET http://iocaihost:8080/oplnapi
/user/{id}:
get:
summary: Get username by id
operationId: getUserName
parameters:
- name: id
in: path
description: 'user id'
required: true
schema:
type: long
responses:
default:
description: The user
400:
description: User not found
@Operation
(summary = "Get username by id")
@APIResponse
(description="The user name"),
@APIResponse
(responseCode="400", description = "User not found")