Skip to content

[Python] Clarify direction for output_schema → request_structure rename #849

@sohw400

Description

@sohw400

Summary

Found TODO comments in the Python SDK middleware files suggesting a rename from output_schema to request_structure:

  • python/x402/src/x402/fastapi/middleware.py:111
  • python/x402/src/x402/flask/middleware.py:195
# TODO: Rename output_schema to request_structure

Context

After investigating, I found that:

  1. TypeScript SDK uses outputSchema in v1 types (typescript/packages/core/src/types/v1/index.ts)
  2. v2 seems to use a different approach with extensions instead of outputSchema
  3. Python SDK currently follows v1 patterns

Impact

This rename would be a breaking change affecting:

  • python/x402/src/x402/types.py
  • python/x402/src/x402/fastapi/middleware.py
  • python/x402/src/x402/flask/middleware.py
  • Multiple test files

Questions

  1. Should this rename be pursued as part of Python SDK v2 migration?
  2. Is there a planned timeline for Python SDK v2 alignment?
  3. Should we remove the TODO and keep current naming for v1 compatibility?

Happy to help with the implementation once the direction is clarified.

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