0

I am implementing API calls that are used to delete data in 2 ways via DELETE and GET requests:

@url DELETE /{id}
@url GET /delete/{id}


Is there a way to make the Swagger to color in red the GET request too?
They are used for same purpose - to delete data so it is natural.
This way it will be very intuitive for the API user!
Currently only DELETE requests are in red.


Thanks for your time!

Antoan Milkov
  • 2,152
  • 17
  • 30

1 Answers1

1

Colours are for the request methods so it should be left as it is. Your description should do the explaining

GET /deltete/{id}

is not the RESTful way

Arul Kumaran
  • 983
  • 7
  • 23
  • Yes, for sure using `GET` request for delete operations is not by specification, but actually this is what my client expect, so I don't have much choice here ... If I develop it, will you consider to incorporate a patch to the @url annotation that specifies the color for the Swagger? – Antoan Milkov Aug 16 '13 at 05:32
  • If you surely want to do this, do it at the explorer's javascript level by looking if the url contains the word delete – Arul Kumaran Aug 16 '13 at 06:07
  • Here is how it looks like with only the

    tag changed to red color, when delete word is present in the URL: [picture](https://s3.amazonaws.com/AMilkov/Restler_Swagger_delete_red_color.jpg) Also made a pull request if you like the change: https://github.com/Luracast/Restler-API-Explorer/pull/3

    – Antoan Milkov Aug 16 '13 at 13:12
  • I will manually merge it into hacks branch so anyone who needs it can make use of it – Arul Kumaran Aug 17 '13 at 08:53