All right, thank you!


Le vendredi 13 janvier 2017 15:18:18 UTC-5, Ron a écrit :
>
> Operations in Swagger are a combination of a few details around the 
> operation itself including the path, parameters, responses and so on.
>
> Operation paths cannot include query parameters, that is, anything coming 
> after a ?.
>
> To get the effect you’re looking for, you simply need to define the start 
> and end dates as query parameters.
>
>  
>
>  
>
>  
>
> *From: *<[email protected] <javascript:>> on behalf of Rem <
> [email protected] <javascript:>>
> *Reply-To: *"[email protected] <javascript:>" <
> [email protected] <javascript:>>
> *Date: *Friday, 13 January 2017 at 12:09
> *To: *Swagger <[email protected] <javascript:>>
> *Subject: *endpoint with parameter as date range
>
>  
>
> 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:
>
>  
>
> ·          
>
> o    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>
>
> §   
>
> ·          
>
>  
>
> 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 [email protected] <javascript:>.
> For more options, visit https://groups.google.com/d/optout.
>
>

-- 
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to