Skip to content

Add OpenAPI spec for the LDP HTTP API #8

@sunilp

Description

@sunilp

Summary

LDP defines three HTTP endpoints (/ldp/identity, /ldp/capabilities, /ldp/messages) but has no machine-readable API spec. An OpenAPI 3.1 spec would enable auto-generated clients in any language and interactive API docs.

What to do

  1. Create docs/openapi.yaml (or .json)
  2. Document the three endpoints with request/response schemas
  3. Define JSON Schema components for all protocol types:
    • LdpIdentityCard
    • LdpCapability, QualityMetrics
    • LdpEnvelope, LdpMessageBody (all 12 message types)
    • Provenance, TrustDomain, PayloadMode
  4. Include example requests and responses

References

  • HTTP endpoints: see README.md "HTTP API" section
  • Message types: sdk/python/src/ldp_protocol/types/messages.py
  • Identity card: sdk/python/src/ldp_protocol/types/identity.py
  • Protocol spec: docs/RFC.md

Why this matters

An OpenAPI spec lets anyone generate a client in their language without writing an SDK from scratch. It also serves as a testable contract for protocol conformance.

Acceptance criteria

  • Valid OpenAPI 3.1 spec (passes swagger-cli validate)
  • All three endpoints documented
  • All message types have schemas with examples
  • Schema matches the Python SDK pydantic models

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationprotocolProtocol specification changes

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions