@@ -23,8 +23,7 @@ const std::string PetApi::base = "/v2";
2323
2424PetApi::PetApi (const std::shared_ptr<Pistache::Rest::Router>& rtr)
2525 : ApiBase(rtr)
26- {
27- }
26+ {}
2827
2928void PetApi::init () {
3029 setupRoutes ();
@@ -93,7 +92,22 @@ void PetApi::add_pet_handler(const Pistache::Rest::Request &request, Pistache::H
9392 }
9493
9594 try {
96- this ->add_pet (pet, response);
95+
96+
97+ #ifndef HTTP_BASIC_AUTH_DEFINED
98+ #define HTTP_BASIC_AUTH_DEFINED 0
99+ #endif
100+ #ifndef HTTP_BEARER_AUTH_DEFINED
101+ #define HTTP_BEARER_AUTH_DEFINED 0
102+ #endif
103+
104+
105+
106+
107+
108+
109+
110+ this ->add_pet (pet, response);
97111 } catch (Pistache::Http::HttpError &e) {
98112 response.send (static_cast <Pistache::Http::Code>(e.code ()), e.what ());
99113 return ;
@@ -106,6 +120,17 @@ void PetApi::add_pet_handler(const Pistache::Rest::Request &request, Pistache::H
106120 response.send (Pistache::Http::Code::Internal_Server_Error, e.what ());
107121 }
108122
123+ #define REST_PATH " /pet"
124+ static_assert (HTTP_BASIC_AUTH_DEFINED + HTTP_BEARER_AUTH_DEFINED < 2 , " Path '" REST_PATH " ' has more than one security scheme specified, and the Pistache server generator does not support that." );
125+ #undef REST_PATH
126+
127+ #ifdef HTTP_BEARER_AUTH_DEFINED
128+ #undef HTTP_BEARER_AUTH_DEFINED
129+ #endif
130+ #ifdef HTTP_BASIC_AUTH_DEFINED
131+ #undef HTTP_BASIC_AUTH_DEFINED
132+ #endif
133+
109134}
110135void PetApi::delete_pet_handler (const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) {
111136 try {
@@ -117,7 +142,21 @@ void PetApi::delete_pet_handler(const Pistache::Rest::Request &request, Pistache
117142 auto apiKey = request.headers ().tryGetRaw (" api_key" );
118143
119144 try {
120- this ->delete_pet (petId, apiKey, response);
145+
146+ #ifndef HTTP_BASIC_AUTH_DEFINED
147+ #define HTTP_BASIC_AUTH_DEFINED 0
148+ #endif
149+ #ifndef HTTP_BEARER_AUTH_DEFINED
150+ #define HTTP_BEARER_AUTH_DEFINED 0
151+ #endif
152+
153+
154+
155+
156+
157+
158+
159+ this ->delete_pet (petId, apiKey, response);
121160 } catch (Pistache::Http::HttpError &e) {
122161 response.send (static_cast <Pistache::Http::Code>(e.code ()), e.what ());
123162 return ;
@@ -130,6 +169,17 @@ void PetApi::delete_pet_handler(const Pistache::Rest::Request &request, Pistache
130169 response.send (Pistache::Http::Code::Internal_Server_Error, e.what ());
131170 }
132171
172+ #define REST_PATH " /pet/:petId"
173+ static_assert (HTTP_BASIC_AUTH_DEFINED + HTTP_BEARER_AUTH_DEFINED < 2 , " Path '" REST_PATH " ' has more than one security scheme specified, and the Pistache server generator does not support that." );
174+ #undef REST_PATH
175+
176+ #ifdef HTTP_BEARER_AUTH_DEFINED
177+ #undef HTTP_BEARER_AUTH_DEFINED
178+ #endif
179+ #ifdef HTTP_BASIC_AUTH_DEFINED
180+ #undef HTTP_BASIC_AUTH_DEFINED
181+ #endif
182+
133183}
134184void PetApi::find_pets_by_status_handler (const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) {
135185 try {
@@ -146,7 +196,21 @@ void PetApi::find_pets_by_status_handler(const Pistache::Rest::Request &request,
146196 }
147197
148198 try {
149- this ->find_pets_by_status (status, response);
199+
200+ #ifndef HTTP_BASIC_AUTH_DEFINED
201+ #define HTTP_BASIC_AUTH_DEFINED 0
202+ #endif
203+ #ifndef HTTP_BEARER_AUTH_DEFINED
204+ #define HTTP_BEARER_AUTH_DEFINED 0
205+ #endif
206+
207+
208+
209+
210+
211+
212+
213+ this ->find_pets_by_status (status, response);
150214 } catch (Pistache::Http::HttpError &e) {
151215 response.send (static_cast <Pistache::Http::Code>(e.code ()), e.what ());
152216 return ;
@@ -159,6 +223,17 @@ void PetApi::find_pets_by_status_handler(const Pistache::Rest::Request &request,
159223 response.send (Pistache::Http::Code::Internal_Server_Error, e.what ());
160224 }
161225
226+ #define REST_PATH " /pet/findByStatus"
227+ static_assert (HTTP_BASIC_AUTH_DEFINED + HTTP_BEARER_AUTH_DEFINED < 2 , " Path '" REST_PATH " ' has more than one security scheme specified, and the Pistache server generator does not support that." );
228+ #undef REST_PATH
229+
230+ #ifdef HTTP_BEARER_AUTH_DEFINED
231+ #undef HTTP_BEARER_AUTH_DEFINED
232+ #endif
233+ #ifdef HTTP_BASIC_AUTH_DEFINED
234+ #undef HTTP_BASIC_AUTH_DEFINED
235+ #endif
236+
162237}
163238void PetApi::find_pets_by_tags_handler (const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) {
164239 try {
@@ -175,7 +250,21 @@ void PetApi::find_pets_by_tags_handler(const Pistache::Rest::Request &request, P
175250 }
176251
177252 try {
178- this ->find_pets_by_tags (tags, response);
253+
254+ #ifndef HTTP_BASIC_AUTH_DEFINED
255+ #define HTTP_BASIC_AUTH_DEFINED 0
256+ #endif
257+ #ifndef HTTP_BEARER_AUTH_DEFINED
258+ #define HTTP_BEARER_AUTH_DEFINED 0
259+ #endif
260+
261+
262+
263+
264+
265+
266+
267+ this ->find_pets_by_tags (tags, response);
179268 } catch (Pistache::Http::HttpError &e) {
180269 response.send (static_cast <Pistache::Http::Code>(e.code ()), e.what ());
181270 return ;
@@ -188,6 +277,17 @@ void PetApi::find_pets_by_tags_handler(const Pistache::Rest::Request &request, P
188277 response.send (Pistache::Http::Code::Internal_Server_Error, e.what ());
189278 }
190279
280+ #define REST_PATH " /pet/findByTags"
281+ static_assert (HTTP_BASIC_AUTH_DEFINED + HTTP_BEARER_AUTH_DEFINED < 2 , " Path '" REST_PATH " ' has more than one security scheme specified, and the Pistache server generator does not support that." );
282+ #undef REST_PATH
283+
284+ #ifdef HTTP_BEARER_AUTH_DEFINED
285+ #undef HTTP_BEARER_AUTH_DEFINED
286+ #endif
287+ #ifdef HTTP_BASIC_AUTH_DEFINED
288+ #undef HTTP_BASIC_AUTH_DEFINED
289+ #endif
290+
191291}
192292void PetApi::get_pet_by_id_handler (const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) {
193293 try {
@@ -196,7 +296,21 @@ void PetApi::get_pet_by_id_handler(const Pistache::Rest::Request &request, Pista
196296 auto petId = request.param (" :petId" ).as <int64_t >();
197297
198298 try {
199- this ->get_pet_by_id (petId, response);
299+
300+ #ifndef HTTP_BASIC_AUTH_DEFINED
301+ #define HTTP_BASIC_AUTH_DEFINED 0
302+ #endif
303+ #ifndef HTTP_BEARER_AUTH_DEFINED
304+ #define HTTP_BEARER_AUTH_DEFINED 0
305+ #endif
306+
307+
308+
309+
310+
311+
312+
313+ this ->get_pet_by_id (petId, response);
200314 } catch (Pistache::Http::HttpError &e) {
201315 response.send (static_cast <Pistache::Http::Code>(e.code ()), e.what ());
202316 return ;
@@ -209,6 +323,17 @@ void PetApi::get_pet_by_id_handler(const Pistache::Rest::Request &request, Pista
209323 response.send (Pistache::Http::Code::Internal_Server_Error, e.what ());
210324 }
211325
326+ #define REST_PATH " /pet/:petId"
327+ static_assert (HTTP_BASIC_AUTH_DEFINED + HTTP_BEARER_AUTH_DEFINED < 2 , " Path '" REST_PATH " ' has more than one security scheme specified, and the Pistache server generator does not support that." );
328+ #undef REST_PATH
329+
330+ #ifdef HTTP_BEARER_AUTH_DEFINED
331+ #undef HTTP_BEARER_AUTH_DEFINED
332+ #endif
333+ #ifdef HTTP_BASIC_AUTH_DEFINED
334+ #undef HTTP_BASIC_AUTH_DEFINED
335+ #endif
336+
212337}
213338void PetApi::update_pet_handler (const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) {
214339 try {
@@ -227,7 +352,22 @@ void PetApi::update_pet_handler(const Pistache::Rest::Request &request, Pistache
227352 }
228353
229354 try {
230- this ->update_pet (pet, response);
355+
356+
357+ #ifndef HTTP_BASIC_AUTH_DEFINED
358+ #define HTTP_BASIC_AUTH_DEFINED 0
359+ #endif
360+ #ifndef HTTP_BEARER_AUTH_DEFINED
361+ #define HTTP_BEARER_AUTH_DEFINED 0
362+ #endif
363+
364+
365+
366+
367+
368+
369+
370+ this ->update_pet (pet, response);
231371 } catch (Pistache::Http::HttpError &e) {
232372 response.send (static_cast <Pistache::Http::Code>(e.code ()), e.what ());
233373 return ;
@@ -240,6 +380,17 @@ void PetApi::update_pet_handler(const Pistache::Rest::Request &request, Pistache
240380 response.send (Pistache::Http::Code::Internal_Server_Error, e.what ());
241381 }
242382
383+ #define REST_PATH " /pet"
384+ static_assert (HTTP_BASIC_AUTH_DEFINED + HTTP_BEARER_AUTH_DEFINED < 2 , " Path '" REST_PATH " ' has more than one security scheme specified, and the Pistache server generator does not support that." );
385+ #undef REST_PATH
386+
387+ #ifdef HTTP_BEARER_AUTH_DEFINED
388+ #undef HTTP_BEARER_AUTH_DEFINED
389+ #endif
390+ #ifdef HTTP_BASIC_AUTH_DEFINED
391+ #undef HTTP_BASIC_AUTH_DEFINED
392+ #endif
393+
243394}
244395void PetApi::update_pet_with_form_handler (const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) {
245396 try {
@@ -258,6 +409,17 @@ void PetApi::update_pet_with_form_handler(const Pistache::Rest::Request &request
258409 response.send (Pistache::Http::Code::Internal_Server_Error, e.what ());
259410 }
260411
412+ #define REST_PATH " /pet/:petId"
413+ static_assert (HTTP_BASIC_AUTH_DEFINED + HTTP_BEARER_AUTH_DEFINED < 2 , " Path '" REST_PATH " ' has more than one security scheme specified, and the Pistache server generator does not support that." );
414+ #undef REST_PATH
415+
416+ #ifdef HTTP_BEARER_AUTH_DEFINED
417+ #undef HTTP_BEARER_AUTH_DEFINED
418+ #endif
419+ #ifdef HTTP_BASIC_AUTH_DEFINED
420+ #undef HTTP_BASIC_AUTH_DEFINED
421+ #endif
422+
261423}
262424void PetApi::upload_file_handler (const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) {
263425 try {
@@ -276,6 +438,17 @@ void PetApi::upload_file_handler(const Pistache::Rest::Request &request, Pistach
276438 response.send (Pistache::Http::Code::Internal_Server_Error, e.what ());
277439 }
278440
441+ #define REST_PATH " /pet/:petId/uploadImage"
442+ static_assert (HTTP_BASIC_AUTH_DEFINED + HTTP_BEARER_AUTH_DEFINED < 2 , " Path '" REST_PATH " ' has more than one security scheme specified, and the Pistache server generator does not support that." );
443+ #undef REST_PATH
444+
445+ #ifdef HTTP_BEARER_AUTH_DEFINED
446+ #undef HTTP_BEARER_AUTH_DEFINED
447+ #endif
448+ #ifdef HTTP_BASIC_AUTH_DEFINED
449+ #undef HTTP_BASIC_AUTH_DEFINED
450+ #endif
451+
279452}
280453
281454void PetApi::pet_api_default_handler (const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) {
0 commit comments