mirror of
https://github.com/oatpp/oatpp-swagger.git
synced 2025-03-07 16:16:46 +08:00
Response Description
This commit is contained in:
parent
fa0a5d8ac5
commit
45f1793ce4
@ -252,7 +252,7 @@ Generator::Fields<OperationResponse::ObjectWrapper>::ObjectWrapper Generator::ge
|
||||
mediaType->schema = generateSchemaForType(it->second.schema, linkSchema, usedTypes);
|
||||
|
||||
auto response = OperationResponse::createShared();
|
||||
response->description = it->first.description;
|
||||
response->description = it->second.description.get() == nullptr ? it->first.description : it->second.description;
|
||||
response->content = response->content->createShared();
|
||||
response->content->put(it->second.contentType, mediaType);
|
||||
responses->put(oatpp::utils::conversion::int32ToStr(it->first.code), response);
|
||||
|
@ -124,8 +124,8 @@ public:
|
||||
|
||||
ENDPOINT_INFO(getUserById) {
|
||||
info->summary = "Get one User by userId";
|
||||
info->addResponse<UserDto::ObjectWrapper>(Status::CODE_200, "application/json");
|
||||
info->addResponse<String>(Status::CODE_404, "text/plain");
|
||||
info->addResponse<UserDto::ObjectWrapper>(Status::CODE_200, "application/json", "User found for id");
|
||||
info->addResponse<String>(Status::CODE_404, "text/plain", "User not found");
|
||||
info->pathParams.add("someId", String::Class::getType()).description = "Some ID:)";
|
||||
info->pathParams["userId"].description = "User Id";
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user