Skip to content

OpenAPI references an undefined InvoiceCancelRequest schema #164

Description

@Kewe63

Summary

The /cancelhodlinvoice request body references #/components/schemas/InvoiceCancelRequest, but that schema does not exist. The defined OpenAPI component and the Rust request type are both named CancelHodlInvoiceRequest.

Affected commit / version

  • Commit: af03c7f1a65135a429f05a5820600338215954dc
  • Package version: 0.1.0
  • Branch: dev

Environment

  • Python 3 with PyYAML 6.0.1
  • Local openapi.yaml; no daemon or network service

Expected behavior

Every local OpenAPI $ref should resolve to a component in the same document.

Actual behavior

The reference-resolution test reports one missing component:

test_all_local_schema_references_resolve ... FAIL
AssertionError: ['InvoiceCancelRequest'] != []

Minimal local regression test

Recursively collect every $ref starting with #/components/schemas/ and assert that each referenced name is present under components.schemas.

Exact command and observed output

python3 audit_tests/test_openapi_contract.py
...
AssertionError: ['InvoiceCancelRequest'] != []

Root cause

  • Broken reference:
    /cancelhodlinvoice:
    post:
    tags:
    - Invoices
    summary: Cancel a HODL invoice
    description: Cancel a held HTLC for a HODL invoice. Rejects cancellation if a settlement is already in progress.
    requestBody:
    content:
    application/json:
    schema:
    $ref: '#/components/schemas/InvoiceCancelRequest'
  • Runtime request:
    #[derive(Deserialize, Serialize)]
    pub(crate) struct CancelHodlInvoiceRequest {
    pub(crate) payment_hash: String,
    }

The reference uses the old/inverted name while the component and runtime use CancelHodlInvoiceRequest.

Concrete user impact

The published API contract is internally unresolved for this endpoint. This audit tested reference resolution only; it did not claim a specific generator/runtime error.

Fork / upstream assessment

The endpoint is absent from the compared upstream master. Upstream PR #91 contains HODL invoice work, but no review or issue was found for this OpenAPI reference defect.

Duplicate-check evidence and limitations

Exact schema name, endpoint, $ref, OpenAPI, and unresolved-reference searches found no report/fix in either tracker. Current UTEXO PRs #139/#140 modify the spec but have no relevant schema-name hunk. Private discussions are not visible.

Suggested fix direction

Point the request body at #/components/schemas/CancelHodlInvoiceRequest and add a repository OpenAPI local-reference validation gate.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions