mirror of
https://gitee.com/zyjblog/oatpp.git
synced 2024-12-22 22:16:37 +08:00
Merge pull request #135 from bhorn/hideenpoint
Added `hide` to `Endpoint::Info` to hide endpoints from swagger
This commit is contained in:
commit
3a1f9cefd1
@ -45,6 +45,7 @@ ENDPOINT_INTERCEPTOR(ENDPOINTNAME, CORS) { \
|
||||
) \
|
||||
return resp; \
|
||||
} \
|
||||
ENDPOINT_INFO(ZZ__CORS_OPTIONS_ENDPOINT_##ENDPOINTNAME) { info->hide = true; } \
|
||||
ENDPOINT("OPTIONS", Z__ENDPOINT_##ENDPOINTNAME->info()->path, ZZ__CORS_OPTIONS_ENDPOINT_##ENDPOINTNAME) { \
|
||||
auto resp = createResponse(Status::CODE_204, ""); \
|
||||
OATPP_MACRO_API_CONTROLLER_ADDCORS_BODY( \
|
||||
@ -67,6 +68,7 @@ ENDPOINT_INTERCEPTOR(ENDPOINTNAME, CORS) { \
|
||||
) \
|
||||
return resp; \
|
||||
} \
|
||||
ENDPOINT_INFO(ZZ__CORS_OPTIONS_ENDPOINT_##ENDPOINTNAME) { info->hide = true; } \
|
||||
ENDPOINT("OPTIONS", Z__ENDPOINT_##ENDPOINTNAME->info()->path, ZZ__CORS_OPTIONS_ENDPOINT_##ENDPOINTNAME) { \
|
||||
auto resp = createResponse(Status::CODE_204, ""); \
|
||||
OATPP_MACRO_API_CONTROLLER_ADDCORS_BODY( \
|
||||
@ -89,6 +91,7 @@ ENDPOINT_INTERCEPTOR(ENDPOINTNAME, CORS) { \
|
||||
) \
|
||||
return resp; \
|
||||
} \
|
||||
ENDPOINT_INFO(ZZ__CORS_OPTIONS_ENDPOINT_##ENDPOINTNAME) { info->hide = true; } \
|
||||
ENDPOINT("OPTIONS", Z__ENDPOINT_##ENDPOINTNAME->info()->path, ZZ__CORS_OPTIONS_ENDPOINT_##ENDPOINTNAME) { \
|
||||
auto resp = createResponse(Status::CODE_204, ""); \
|
||||
OATPP_MACRO_API_CONTROLLER_ADDCORS_BODY( \
|
||||
@ -111,6 +114,7 @@ ENDPOINT_INTERCEPTOR(ENDPOINTNAME, CORS) { \
|
||||
) \
|
||||
return resp; \
|
||||
} \
|
||||
ENDPOINT_INFO(ZZ__CORS_OPTIONS_ENDPOINT_##ENDPOINTNAME) { info->hide = true; } \
|
||||
ENDPOINT("OPTIONS", Z__ENDPOINT_##ENDPOINTNAME->info()->path, ZZ__CORS_OPTIONS_ENDPOINT_##ENDPOINTNAME) { \
|
||||
auto resp = createResponse(Status::CODE_204, ""); \
|
||||
OATPP_MACRO_API_CONTROLLER_ADDCORS_BODY( \
|
||||
@ -128,6 +132,7 @@ ENDPOINT_INTERCEPTOR(ENDPOINTNAME, CORS) { \
|
||||
OATPP_MACRO_API_CONTROLLER_ADDCORS_BODY(ORIGIN, METHODS, HEADERS, MAX_AGE) \
|
||||
return resp; \
|
||||
} \
|
||||
ENDPOINT_INFO(ZZ__CORS_OPTIONS_ENDPOINT_##ENDPOINTNAME) { info->hide = true; } \
|
||||
ENDPOINT("OPTIONS", Z__ENDPOINT_##ENDPOINTNAME->info()->path, ZZ__CORS_OPTIONS_ENDPOINT_##ENDPOINTNAME) { \
|
||||
auto resp = createResponse(Status::CODE_204, ""); \
|
||||
OATPP_MACRO_API_CONTROLLER_ADDCORS_BODY(ORIGIN, METHODS, HEADERS, MAX_AGE) \
|
||||
|
@ -55,7 +55,7 @@ Endpoint::Info::Param& Endpoint::Info::Params::operator [](const oatpp::String&
|
||||
return m_params[name];
|
||||
}
|
||||
|
||||
Endpoint::Info::Info()
|
||||
Endpoint::Info::Info() : hide(false)
|
||||
{}
|
||||
|
||||
std::shared_ptr<Endpoint::Info> Endpoint::Info::createShared(){
|
||||
|
@ -128,6 +128,7 @@ public:
|
||||
oatpp::String path;
|
||||
oatpp::String method;
|
||||
oatpp::String authorization;
|
||||
oatpp::Boolean hide;
|
||||
|
||||
Param body;
|
||||
oatpp::String bodyContentType;
|
||||
|
Loading…
Reference in New Issue
Block a user