#749 audit REST resources to confirm that they all follow the rules of the road
Closed: Fixed None Opened 9 years ago by vakwetu.

We'll put this on a wiki page, but just a few:

  1. GET methods that return a collection should return an empty collection if no entries are found, rather than 404 or 204 and null.

  2. GET methods to return a specific resource should return 404 if no resource is found.

  3. Methods that create a resource should return 201 (Created) on success, providing the link for the resource created. In practice, this will likely mean returning some of type Response.

  4. Methods that either delete or modify a resource should return 200 on success. If the resource is not found, a 404 should be returned.


  1. Methods should check for Bad or null required parameters and return 400 (Bad Request) as required.

Revision to 4:

Methods that either delete or modify a resource should return 200/204 on success. 204 is returned when the response has no content (ie. returns void type). This is likely to be the response for DELETE operations. Resteasy should select the right response 200/204 here. If the resource is not found, a 404 should be returned.

master:

  • 5e748a5b62457210c67f0c05ae3be6247604e988
  • cbb907afcad95284503eaf6bdb00ee3c50047960
  • 89eebe6729b8a7ed53441649d0baa98c98fdfa7f
  • 66eabd97adafa95f97215202a825d73f5fca7692
  • f74c644b09dd1e18289c4a543a211c3ff8cd02d9
  • 014fdc85a7e018df419aad3dce460f0e58d42f92
  • 17a52b686bd81cda1bce76b454b3127d6575de62

Metadata Update from @vakwetu:
- Issue assigned to edewata
- Issue set to the milestone: 10.1 - 10/13 (October)

5 years ago

Dogtag PKI is moving from Pagure issues to GitHub issues. This means that existing or new
issues will be reported and tracked through Dogtag PKI's GitHub Issue tracker.

This issue has been cloned to GitHub and is available here:
https://github.com/dogtagpki/pki/issues/1316

If you want to receive further updates on the issue, please navigate to the
GitHub issue and click on Subscribe button.

Thank you for understanding, and we apologize for any inconvenience.

Login to comment on this ticket.

Metadata