Hello,
I am new to swagger and I would like to open and enpoint where the user can 
request with a date range on the info dateInfo

between
*StartDate
*EndDate 

What's the state of the art to design this endpoint?

I came up with this: 

infos/startDate={startDate=startDate}&endDate={endDate=endDate}


that translates into:



   - 
      - GET 
<http://localhost:8989/swagger/ui/index#!/Deals/GetOTCDealOfGopWithDealTypeAndTradeDate_0>
 /api/v1/infos/startDate={ 
<http://localhost:8989/swagger/ui/index#!/Deals/GetOTCDealOfGopWithDealTypeAndTradeDate_0>startDate
 
<http://localhost:8989/swagger/ui/index#!/Deals/GetOTCDealOfGopWithDealTypeAndTradeDate_0>}&endDate={endDate}
 
<http://localhost:8989/swagger/ui/index#!/Deals/GetOTCDealOfGopWithDealTypeAndTradeDate_0>
         -  
<http://localhost:8989/swagger/ui/index#!/Deals/GetOTCDealOfGopWithDealTypeAndTradeDate_0>
      - 


I wanted to add the string dateInfo as

GET 
<http://localhost:8989/swagger/ui/index#!/Deals/GetOTCDealOfGopWithDealTypeAndTradeDate_0>
 /api/v1/infos/dateInfo?startDate={ 
<http://localhost:8989/swagger/ui/index#!/Deals/GetOTCDealOfGopWithDealTypeAndTradeDate_0>startDate
 
<http://localhost:8989/swagger/ui/index#!/Deals/GetOTCDealOfGopWithDealTypeAndTradeDate_0>}&endDate={endDate}
 
<http://localhost:8989/swagger/ui/index#!/Deals/GetOTCDealOfGopWithDealTypeAndTradeDate_0>

but when I launch swagger I got the following error :

[ERROR] SendAsync -  The object has not yet been initia
lized. Ensure that HttpConfiguration.EnsureInitialized() is called in the applic
ation's startup code after all other initialization code.'
'   at System.Web.Http.Routing.RouteCollectionRoute.get_SubRoutes()
   at System.Web.Http.Routing.RouteCollectionRoute.GetRouteData(String virtualPa
thRoot, HttpRequestMessage request)
   at System.Web.Http.HttpRouteCollection.GetRouteData(HttpRequestMessage reques
t)
   at System.Web.Http.Dispatcher.HttpRoutingDispatcher.SendAsync(HttpRequestMess
age request, CancellationToken cancellationToken)
   at System.Net.Http.DelegatingHandler.SendAsync(HttpRequestMessage request, Ca
ncellationToken cancellationToken)
   at System.Web.Http.Cors.CorsMessageHandler.<SendAsync>d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNot
ification(Task task)
   at System.Web.Http.Tracing.ITraceWriterExtensions.<TraceBeginEndAsyncCore>d__
18`1.MoveNext()
2017-01-13 20:08:47.4939 [ERROR] Data.API.WebApiTracing+NLogWebApiTracingAdapter
.WriteTrace -  The object has not yet been initialized. Ensure that HttpConfigur
ation.EnsureInitialized() is called in the application's startup code after all
other initialization code.'
'   at System.Web.Http.Routing.RouteCollectionRoute.get_SubRoutes()
   at System.Web.Http.Routing.RouteCollectionRoute.GetRouteData(String virtualPa
thRoot, HttpRequestMessage request)
   at System.Web.Http.HttpRouteCollection.GetRouteData(HttpRequestMessage reques
t)
   at System.Web.Http.Dispatcher.HttpRoutingDispatcher.SendAsync(HttpRequestMess
age request, CancellationToken cancellationToken)
   at System.Net.Http.DelegatingHandler.SendAsync(HttpRequestMessage request, Ca
ncellationToken cancellationToken)
   at System.Web.Http.Cors.CorsMessageHandler.<SendAsync>d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNot
ification(Task task)
   at System.Web.Http.Tracing.ITraceWriterExtensions.<TraceBeginEndAsyncCore>d__
18`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNot
ification(Task task)
   at System.Web.Http.Tracing.ITraceWriterExtensions.<TraceBeginEndAsyncCore>d__
18`1.MoveNext()


Thanks for help.

-- 
You received this message because you are subscribed to the Google Groups 
"Swagger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to