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.
099af51e231f815a6a1a877c200ceef753422b24
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
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
Review request changed
Change Summary:
  • Add a unit test for state preservation.
  • Clean up test_decorators a bit and update for modern world.
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.
ab2fbc43320257bdf92d0b34edbe5e1242150c85
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

Checks run (2 succeeded)

flake8 passed.
JSHint passed.