Re: endpoint with parameter as date range

2017-01-13 Thread Rem
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: * on behalf of Rem <
> remi.de...@gmail.com >
> *Reply-To: *"swagger-sw...@googlegroups.com " <
> swagger-sw...@googlegroups.com >
> *Date: *Friday, 13 January 2017 at 12:09
> *To: *Swagger 
> *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}
>
>  
>
> that translates into:
>
>  
>
> ·  
>
> oGET 
> 
>  /api/v1/infos/startDate={ 
> 
> startDate 
> 
> }={endDate} 
> 
>
> §   
>
> ·  
>
>  
>
> I wanted to add the string dateInfo as
>
>  
>
> GET 
> 
>  /api/v1/infos/dateInfo?startDate={ 
> 
> startDate 
> 
> }={endDate} 
> 
>
>  
>
> 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.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.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.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.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 

Re: endpoint with parameter as date range

2017-01-13 Thread Ron Ratovsky
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:  on behalf of Rem 

Reply-To: "swagger-swaggersocket@googlegroups.com" 

Date: Friday, 13 January 2017 at 12:09
To: Swagger 
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}
 
that translates into:
 
·  
oGET /api/v1/infos/startDate={startDate}={endDate}
§   
·  
 
I wanted to add the string dateInfo as
 
GET /api/v1/infos/dateInfo?startDate={startDate}={endDate}
 
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.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.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.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.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.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.


-- 
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.


endpoint with parameter as date range

2017-01-13 Thread Rem
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}


that translates into:



   - 
  - GET 

 /api/v1/infos/startDate={ 
startDate
 
}={endDate}
 

 -  

  - 


I wanted to add the string dateInfo as

GET 

 /api/v1/infos/dateInfo?startDate={ 
startDate
 
}={endDate}
 


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.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.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.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.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.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.


Re: @PathVariable binding and Swagger

2017-01-13 Thread tony tam
Hi Kevin, I’m not positive if there are other tricks with SpringFox, but you 
can use @ApiImplicitParams as an annotation to your function

> On Jan 12, 2017, at 8:53 PM, ksm2...@email.vccs.edu wrote:
> 
> 
> 
>  
> 
>  
> 
>  
> 
> 
> 
> 
> 
> Hello,
> 
> I'm trying to utilize @PathVariable binding within my @RequestMapping method 
> while also preserving Swagger UI's capability to input each path variable in 
> a separate input box.
> 
> For example, if I have the above code (pic 1) it produces the above Swagger 
> page (pic 2+3) which is fantastic, but you can see that the Args Object is 
> just a json block (pic 2) when I was hoping it would unwrap into the full 
> args as in (pic 3).
> 
> Is there any configuration value I can set up or annotation I can use to mark 
> the behavior I'd like? Or even any thoughts on how to extend Swagger to do so?
> 
> Thank you so much for your time,
> Kevin
> 
> 
> 
> 
> -- 
> 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 
> .

-- 
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.


Re: Optional and variable object properties

2017-01-13 Thread tony tam
Use the required array:

http://json-schema.org/example2.html 

for your example you would say:

required:
- attributeA
- attributeB
properties:
  attributeA:
type: string
# etc.


> On Jan 13, 2017, at 6:53 AM, nicholas.tul...@temboinc.com wrote:
> 
> How do i specify optional and variable object properties in swagger?
> 
> For example, let's say my JSON is structured like this:
> 
> {
>   "name": "Test object 1",
>   "attributeA": "Some kind of text",
>   "attributeB": "Another kind of text"
> },
> {
>   "name": "Test object 2",
>   "attributeC": "A different kind of text"
> }
> 
> Now, let's assume that there could be dozens of optional keys associated with 
> a given object. And these keys might be added to or changed over time 
> arbitrarily. 
> 
> How do i specify these without having to enumerate all of them in the API 
> response documentation?
> 
> Thanks for your help!
> 
> nick
> 
> -- 
> 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 
> .

-- 
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.


Re: API reorder

2017-01-13 Thread lange.kay via Swagger


On Fri, 1/13/17, lange.kay via Swagger  
wrote:

 Subject: Re: API reorder
 To: swagger-swaggersocket@googlegroups.com
 Date: Friday, January 13, 2017, 11:50 AM
 
 
 
 On Fri, 1/13/17, Deepika Vijay 
 wrote:
 
  Subject: Re: API reorder
  To: "Swagger" 
  Date: Friday, January 13, 2017, 10:07 AM
  
  Can you
  please provide example how can it be implemented through
  tags?
  
  On Thursday,
  12 January 2017 17:44:24 UTC+5:30, Deepika Vijay 
  wrote:hi All,
  
  i have Swagger api setup but
  now i need to reorder it.
  What all options
  are available to do so and also i tried with tag but it
  doesnt get reflected.
  My webservices are
  like one webservice has 2 version say v1 and v2 but all v1
  webservices coming together and v2 web services coming
  together.
  i want to reorder it as for same
  service v1 and v2 come next to each other.
  Please provide guidance.
  
  Thanks,
  Deepika
  
  
  
  
  -- 
  
  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.
  4 oct. - Intra in vigoare Carta O.N.U. 16 nov. - Crearea
 UNESCO. 20 nov. 1945-1 oct. 1946 - Procesul de la
 Niirenberg. 29 nov. - Proclamarea de catre Tito  losip
 B. -1892-1980  a R.P. Iugoslavia.
 
 -- 
 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.
 3 25 sept. - Otomanii forteaza intrarea in Bucuresti in ciuda rezistentei 
populare. 25 sept. 7 oct. - Exilarea conducatorilor revolutiei din tara 
Romaneasca  dec. - incepe ofensiva maghiara in Transilvania  care este ocupata  
cu exceptia zonei Muntilor Apuseni  pana in martie 1849. - Rezistenta motilor 
din Apuseni  condusa de Avram lancu.

-- 
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.


Re: API reorder

2017-01-13 Thread lange.kay via Swagger


On Fri, 1/13/17, Deepika Vijay  wrote:

 Subject: Re: API reorder
 To: "Swagger" 
 Date: Friday, January 13, 2017, 10:07 AM
 
 Can you
 please provide example how can it be implemented through
 tags?
 
 On Thursday,
 12 January 2017 17:44:24 UTC+5:30, Deepika Vijay 
 wrote:hi All,
 
 i have Swagger api setup but
 now i need to reorder it.
 What all options
 are available to do so and also i tried with tag but it
 doesnt get reflected.
 My webservices are
 like one webservice has 2 version say v1 and v2 but all v1
 webservices coming together and v2 web services coming
 together.
 i want to reorder it as for same
 service v1 and v2 come next to each other.
 Please provide guidance.
 
 Thanks,
 Deepika
 
 
 
 
 -- 
 
 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.
 4 oct. - Intra in vigoare Carta O.N.U. 16 nov. - Crearea UNESCO. 20 nov. 
1945-1 oct. 1946 - Procesul de la Niirenberg. 29 nov. - Proclamarea de catre 
Tito  losip B. -1892-1980  a R.P. Iugoslavia.

-- 
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.


Re: API reorder

2017-01-13 Thread Deepika Vijay
Can you please provide example how can it be implemented through tags?

On Thursday, 12 January 2017 17:44:24 UTC+5:30, Deepika Vijay wrote:
>
> hi All,
>
> i have Swagger api setup but now i need to reorder it.
> What all options are available to do so and also i tried with tag but it 
> doesnt get reflected.
> My webservices are like one webservice has 2 version say v1 and v2 but all 
> v1 webservices coming together and v2 web services coming together.
> i want to reorder it as for same service v1 and v2 come next to each other.
> Please provide guidance.
>
> Thanks,
> Deepika
>

-- 
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.