Skip to content

Features-core-api: Add PDF generation API models for unified PDF endpoint#38

Open
nando-bingani wants to merge 2 commits intov2-prodfrom
v2-prod-protologue
Open

Features-core-api: Add PDF generation API models for unified PDF endpoint#38
nando-bingani wants to merge 2 commits intov2-prodfrom
v2-prod-protologue

Conversation

@nando-bingani
Copy link
Copy Markdown
Collaborator

Add Pydantic models for PDF generation API request/response validation.

New Models:

  • PDFGenerationRequest - Request model for PDF generation endpoint
  • PDFResponse - Response model with PDF metadata

Features:

  • Supports auto-detection of metadata format (DataCite4 or ISO19115)
  • Explicit format specification option (metadata_format parameter)
  • Optional temporal extent parameters (temporal_start, temporal_end)
  • Optional keywords array parameter
  • Validation with Pydantic for type safety

File Added:

  • odp/api/models/pdf.py (177 lines)

Usage:
These models are used by the unified PDF generation endpoint in odp-server:

  • POST /catalog/metadata/generate-pdf
  • Schema-agnostic PDF creation from DataCite4 or ISO19115 metadata

Integration:

  • Used by odp-server API routers
  • Consumed by odp-ui proxy endpoints
  • Supports both MIMS and SAEON catalogs

Validation:

  • Pydantic ensures correct request structure
  • Type hints provide IDE autocomplete
  • Auto-detection fallback if format not specified

- Add PDFGenerationRequest: Pydantic model for PDF generation API endpoint
- Add PDFResponse: Response model with PDF metadata
- Supports auto-detection or explicit specification of metadata format
- Includes optional temporal extent and keywords parameters

These models are used by the unified PDF generation endpoint in odp-server.

Authored by nando-bingani <n.bingani@saeon.nrf.ac.za>
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.

1 participant