Add a @webapi_docs decorator to store docs on the function.

Review Request #14046 — Created July 17, 2024 and updated

Information

Djblets
release-6.x

Reviewers

This change adds a new decorator for us to use for attaching
public-facing documentation to HTTP methods, rather than putting it into
the docstring. This will let us have internal codebase docs in the docstring
instead, which is much more appropriate.

Used along with a change to our webapidocs Sphinx extension to pull this
data out.

Summary ID
Add a @webapi_docs decorator to store docs on the function.
This change adds a new decorator for us to use for attaching public-facing documentation to HTTP methods, rather than putting it into the docstring. This will let us have internal codebase docs in the docstring instead, which is much more appropriate. Testing Done: Used along with a change to our webapidocs Sphinx extension to pull this data out.
07ea9819d74c9280b46db50e336c0d144a2083b3
Description From Last Updated

Can you add a unit test in test_decorators.py for this, and make sure that other state from other decorators (including …

chipx86chipx86
There are no open issues
maubin
  1. Ship It!
  2. 
      
chipx86
  1. 
      
  2. Show all issues

    Can you add a unit test in test_decorators.py for this, and make sure that other state from other decorators (including name, type hints, etc.) are retained?

  3. 
      
david
chipx86
  1. Code looks good, but all the cleanup changes makes it really hard to focus on what's relevant to this new unit test, and makes for more difficult code archaeology later. Possible to split this out?

  2. 
      
david
Review request changed
Change Summary:

Split out test cleanup changes.

Commits:
Summary ID
Add a @webapi_docs decorator to store docs on the function.
This change adds a new decorator for us to use for attaching public-facing documentation to HTTP methods, rather than putting it into the docstring. This will let us have internal codebase docs in the docstring instead, which is much more appropriate. Testing Done: Used along with a change to our webapidocs Sphinx extension to pull this data out.
099af51e231f815a6a1a877c200ceef753422b24
Add a @webapi_docs decorator to store docs on the function.
This change adds a new decorator for us to use for attaching public-facing documentation to HTTP methods, rather than putting it into the docstring. This will let us have internal codebase docs in the docstring instead, which is much more appropriate. Testing Done: Used along with a change to our webapidocs Sphinx extension to pull this data out.
07ea9819d74c9280b46db50e336c0d144a2083b3
Diff:

Revision 3 (+142 -18)

Show changes

djblets/webapi/decorators.py
djblets/webapi/tests/test_decorators.py

Checks run (2 succeeded)

flake8 passed.
JSHint passed.
Loading...