Response Description

This commit is contained in:
Benedikt-Alexander Mokroß 2020-04-02 13:53:53 +02:00
parent fa0a5d8ac5
commit 45f1793ce4
2 changed files with 3 additions and 3 deletions

View File

@ -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);

View File

@ -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";
}