question on modify swagger request mapping URI

73 views
Skip to first unread message

Genneva Wang

unread,
Jun 16, 2016, 8:01:30 PM6/16/16
to Swagger
hi Swagger experts,

One of our example request mapping looks like /test/docs/**, with the **, this would not work on swagger UI. Is there any options that the request mapping can be modified ? Thank you very for your help.

Regards,
-Genneva

tony tam

unread,
Jun 16, 2016, 9:32:23 PM6/16/16
to swagger-sw...@googlegroups.com
Can you please share some details?

--
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-swaggers...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Genneva Wang

unread,
Jun 17, 2016, 5:54:59 PM6/17/16
to Swagger

For example, one of out restful requestmap url is /test/docs/**, so this restful URL can take anything including "/p1/p2/test.file

So on swagger UI, it is showing

DELETE /test/docs/**


but I can not replace ** with real content such as p1/p2/test.text

Following code is used to enable Swagger

 @Bean

    public Docket apiServerApi() {

      return new Docket(DocumentationType.SWAGGER_2)

          .groupName("meta-api")

          .apiInfo(apiInfo())

          .genericModelSubstitutes(ResponseEntity.class)

          .select()

          .apis(RequestHandlerSelectors.any())

          .paths(not(regex("/error/.*")))

          .build();

    }




On Thursday, June 16, 2016 at 6:32:23 PM UTC-7, tony tam wrote:
Can you please share some details?
On Jun 16, 2016, at 5:01 PM, Genneva Wang <gen...@gmail.com> wrote:

hi Swagger experts,

One of our example request mapping looks like /test/docs/**, with the **, this would not work on swagger UI. Is there any options that the request mapping can be modified ? Thank you very for your help.

Regards,
-Genneva

--
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+unsub...@googlegroups.com.

tony tam

unread,
Jun 27, 2016, 3:21:37 PM6/27/16
to swagger-sw...@googlegroups.com
Hi, the splat parameter (** in your case) is not supported in the specification and therefore not supported in swagger-ui.

To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggers...@googlegroups.com.

yvonnew...@gmail.com

unread,
Jul 6, 2016, 6:05:06 PM7/6/16
to Swagger
Tony,


Is there a way we can make the url editable? so the actual content can be typed in, does that make sense?

thanks

tony tam

unread,
Jul 7, 2016, 1:36:46 PM7/7/16
to swagger-sw...@googlegroups.com
What do you mean?

To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggers...@googlegroups.com.

yvonnew...@gmail.com

unread,
Jul 11, 2016, 12:55:32 AM7/11/16
to Swagger
I mean is there a way to customize the requestMapping Url, so it is editable instead of label, so ** can be replaced with actual path.
Or is there any suggestion on how to have it work for "try it out" sandbox testing? or is it possible to customize to make it work for testing?



Thanks

Yvonne

tony tam

unread,
Jul 11, 2016, 2:01:52 PM7/11/16
to swagger-sw...@googlegroups.com
Not in swagger-ui, you’ll have to hack the code.  Currently it escapes the path value, so a value of “foo/bar” will become “foo%2F%bar”.

This is by design, the swagger/OpenAPI definition does not allow for splat or arbitrary path parameters because it makes for potentially duplicated, non-deterministic responses.

To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggers...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages