Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 27, 2026

Purpose

Establishes formal API contract. CDS lacked machine-readable API documentation, preventing SDK generation, API testing tool integration, and contract-driven development.

Goals

Provide complete OpenAPI 3.0 specification covering all endpoints, authentication schemes, request/response schemas, error formats, and multi-tenancy support.

Approach

Enhanced api/customer-data-service.yaml (703→2,340 lines):

  • Added missing endpoint groups: Profile Schema Management (complete CRUD), health checks, /profiles/Me endpoints, admin sync operations
  • Documented authentication: Bearer JWT (scope-based) + Basic Auth (admin sync)
  • Defined 20+ schemas: Profile, SchemaAttribute, UnificationRule, EnrichmentRule, Consent, ConsentCategory, Device, Event
  • Standardized error responses with machine-readable codes
  • Added query parameters: filtering, pagination, selective attributes
  • Created reusable components (ScopePathParam) to eliminate duplication
  • Multi-tenant URL structure: /t/{tenant}/cds/api/v1/*

Created api/README.md:

  • SDK generation examples (TypeScript, Python, Java, Go)
  • Interactive documentation setup (Swagger UI, Redoc)
  • Authentication flow with scope requirements
  • API testing tool integration guide

Validation: OpenAPI 3.0 compliant via swagger-cli

User stories

  • Developers generate type-safe client SDKs in their language of choice
  • API consumers browse interactive documentation with request/response examples
  • QA engineers import spec into Postman/Insomnia for automated testing
  • Platform teams validate implementation against contract
  • New engineers onboard via comprehensive, machine-readable documentation

Release note

Added comprehensive OpenAPI 3.0 specification documenting all CDS API endpoints, authentication schemes, schemas, and error formats. Enables SDK generation, interactive documentation, and API testing tool integration.

Documentation

N/A - This PR adds the API documentation itself. The api/README.md provides usage instructions for the specification.

Training

N/A - Documentation change only. Training content should reference the new OpenAPI spec for API contract details.

Certification

N/A - Infrastructure documentation enhancement, no user-facing feature changes requiring certification updates.

Marketing

N/A - Internal API documentation improvement

Automation tests

  • Unit tests: N/A (YAML specification file)
  • Integration tests: N/A (documentation only)
  • Validation: OpenAPI 3.0 spec validated via swagger-cli

Security checks

Samples

N/A - The OpenAPI spec itself serves as the canonical reference. README includes authentication examples and SDK generation commands.

Related PRs

None

Migrations (if applicable)

N/A - Additive documentation, no breaking changes

Test environment

Validated on:

  • OpenAPI 3.0 validator (swagger-cli v4.0.4)
  • Node.js v18+ (for validation tooling)

Learning

  • Analyzed internal route handlers to extract complete endpoint inventory
  • Studied authentication middleware to document JWT scope requirements and Basic Auth flows
  • Reviewed error handling patterns for standardized response format
  • Applied OpenAPI 3.0 reusable components pattern for parameter deduplication
Original prompt

This section details on the original issue you should resolve

<issue_title>Create API definition</issue_title>
<issue_description>CDS currently doesn’t have a formal API contract. We should add an OpenAPI (Swagger) specification to clearly define all endpoints, request/response schemas, authentication, and error formats</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Copilot AI and others added 3 commits January 27, 2026 09:31
- Added complete API documentation with all endpoints
- Documented authentication schemes (Bearer JWT and Basic Auth)
- Added comprehensive request/response schemas
- Included error response definitions
- Added query parameters for filtering and pagination
- Updated server URLs to reflect tenant path structure
- Validated specification against OpenAPI 3.0 standards

Co-authored-by: VivekVinushanth <[email protected]>
- Added detailed usage guide for the OpenAPI specification
- Documented how to view, validate, and use the API spec
- Included examples for client SDK generation
- Added authentication and scope documentation
- Provided testing and integration guidance

Co-authored-by: VivekVinushanth <[email protected]>
Address code review feedback by creating a reusable ScopePathParam component
to eliminate duplication and improve maintainability when adding new scope values.

Co-authored-by: VivekVinushanth <[email protected]>
Copilot AI changed the title [WIP] Add OpenAPI specification for API contract Add comprehensive OpenAPI 3.0 specification for Customer Data Service API Jan 27, 2026
Copilot AI requested a review from VivekVinushanth January 27, 2026 09:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create API definition

3 participants