Skip to content

Commit

Permalink
-
Browse files Browse the repository at this point in the history
  • Loading branch information
sabudilovskiy committed Nov 30, 2023
1 parent b35eaa1 commit 3c98245
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 14 deletions.
9 changes: 3 additions & 6 deletions src/legacy/models/day/type.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ enum struct Day : int
saturday
};
struct enum_introspector_Day;
consteval enum_introspector_Day* get_enum_introspector(std
::type_identity<Day>)
consteval enum_introspector_Day* get_enum_introspector(std ::type_identity<Day>)
{
return nullptr;
}
Expand All @@ -23,10 +22,8 @@ struct enum_introspector_Day
using enum Day;
static constexpr std::array<std::string_view, 6> names = {
"monday", "tuesday", "wednesday", "thursday", "friday", "saturday"};
static constexpr std::array<Day, 6> values = {monday, tuesday,
wednesday,
thursday, friday,
saturday};
static constexpr std::array<Day, 6> values = {monday, tuesday, wednesday,
thursday, friday, saturday};
};
// DECLARE_OPENAPI_ENUM(Day, int, monday, tuesday, wednesday, thursday, friday,
// saturday);
Expand Down
4 changes: 2 additions & 2 deletions src/legacy/models/education_type/postgre.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ namespace userver::storages::postgres::io
{
template <>
struct CppToUserPg<::legacy::models::EducationType>
: openapi::PgMapperFixed<::legacy::models::EducationType,
"timetable_vsu" , "grouptype">
: openapi::PgMapperFixed<::legacy::models::EducationType, "timetable_vsu",
"grouptype">
{
};
} // namespace userver::storages::postgres::io
3 changes: 2 additions & 1 deletion src/legacy/models/lesson_type/type.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
#include <openapi/enum/declare.hpp>
namespace legacy::models
{
// DECLARE_OPENAPI_ENUM(LessonType, int, labaratory, lection, practice, some_test,
// DECLARE_OPENAPI_ENUM(LessonType, int, labaratory, lection, practice,
// some_test,
// some_test2, some_test3);
enum struct LessonType : int
{
Expand Down
3 changes: 2 additions & 1 deletion src/legacy/models/subgroup/postgre.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ namespace userver::storages::postgres::io
{
template <>
struct CppToUserPg<::legacy::models::Subgroup>
: openapi::PgMapperFixed<::legacy::models::Subgroup, "timetable_vsu", "subgroup">
: openapi::PgMapperFixed<::legacy::models::Subgroup, "timetable_vsu",
"subgroup">
{
};

Expand Down
3 changes: 2 additions & 1 deletion src/legacy/models/user_type/postgre.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ namespace userver::storages::postgres::io
{
template <>
struct CppToUserPg<legacy::models::UserType>
: openapi::PgMapperFixed<legacy::models::UserType, "timetable_vsu", "user_type">
: openapi::PgMapperFixed<legacy::models::UserType, "timetable_vsu",
"user_type">
{
};
} // namespace userver::storages::postgres::io
8 changes: 5 additions & 3 deletions utests/openapi/doc/serialize/basic_enum.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

namespace test_models
{
//DECLARE_OPENAPI_ENUM(UserType, int, root, teacher, user, admin, tester);
// DECLARE_OPENAPI_ENUM(UserType, int, root, teacher, user, admin, tester);
enum struct UserType : int
{
root,
Expand All @@ -31,8 +31,10 @@ consteval enum_introspector_UserType* get_enum_introspector(
struct enum_introspector_UserType
{
using enum UserType;
static constexpr std::array<std::string_view, 5> names = {"root", "teacher", "user", "admin", "tester"};
static constexpr std::array<UserType, 5> values = {root, teacher, user, admin, tester};
static constexpr std::array<std::string_view, 5> names = {
"root", "teacher", "user", "admin", "tester"};
static constexpr std::array<UserType, 5> values = {root, teacher, user,
admin, tester};
};

} // namespace test_models
Expand Down

0 comments on commit 3c98245

Please sign in to comment.