Skip to content

[Bug]: autoapi v3: @op_ctx custom ops not discovered/bound #3916

@MichaelDecent

Description

@MichaelDecent

Describe the Bug

Custom ctx-only ops declared with @op_ctx (e.g., publish, search) aren’t showing up under Book.opspecs after api.rebind(Book). Canonical ops (CRUD/list/clear/bulk) appear as expected, with alias_ctx applied.

Steps to Reproduce

  1. Define model with @alias_ctx and columns; include model to create tables.
  2. Define custom ops using @op_ctx as free functions, then attach to the class:
    • Book.publish = _publish
    • Book.search = _search
  3. Call api.include_model(Book, mount_router=False))
  4. Inspect:
    • Book.opspecs.all → only canonical ops present
  5. Confirm canonical set is present:
    • Output example:
[('add','create','collection'),('browse','list','collection'),('clear','clear','collection'),('delete','delete','member'),('get','read','member'),('replace','replace','member'),('update','update','member')]

Software Version

<0.4.0

Python Version

Python 3.8

Environment Details

No response

Relevant Logs or Error Output

Additional Context (Optional)

No response

Confirmation

  • I have searched the existing issues for this bug.
  • I have provided all necessary information to reproduce the bug.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtriage

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions