datatracker icon indicating copy to clipboard operation
datatracker copied to clipboard

feat: django-rest-framework

Open jennifer-richards opened this issue 4 months ago • 0 comments

Add django-rest-framework and friends, then reimplement the existing API. Generates nearly the same API schema with a few notable exceptions:

  • Several URLs have moved around a bit (e.g., things that were under /doc are under /draft or /rfc). This is transparent when using the API generators. We should aim to end up with something logical, but it's easy to adjust.
  • Endpoints that mapped list[<id>] to dict(<id>, <some complex structure>) now just return list[<some complex structure>] because that's easier to express.
  • Error return values are now included via drf-standardized-errors. (Currently only 400/404 to keep noise down, but we can add other types if they're interesting)

Re: the dict mapping, since refactoring those endpoints I believe I have a better idea how to wrangle DRF so I believe we could revert that API change.

The API schema can be generated by running ietf/manage.py spectacular --file rpcapi-generated.yaml. I've temporarily committed a copy of this for comparison (though diffs are pretty noisy)

jennifer-richards avatar Oct 16 '24 03:10 jennifer-richards