102 lines
4.0 KiB
YAML
102 lines
4.0 KiB
YAML
openapi: 3.0.3
|
|||
|
|
info:
|
||
|
|
title: Reklamator Landing Page API
|
||
|
|
version: 1.0.0
|
||
|
|
description: Product selection landing page contract for feature 002-product-list
|
||
|
|
|
||
|
|
paths:
|
||
|
|
/:
|
||
|
|
get:
|
||
|
|
summary: Landing page - list active products
|
||
|
|
description: |
|
||
|
|
Display a landing page showing all active products available for feedback submission.
|
||
|
|
Products are sorted alphabetically by name (case-insensitive), with product_id as tiebreaker.
|
||
|
|
operationId: getLandingPage
|
||
|
|
tags:
|
||
|
|
- Landing Page
|
||
|
|
responses:
|
||
|
|
'200':
|
||
|
|
description: HTML page with product list or empty state message
|
||
|
|
content:
|
||
|
|
text/html:
|
||
|
|
schema:
|
||
|
|
type: string
|
||
|
|
description: Server-rendered HTML page
|
||
|
|
examples:
|
||
|
|
with_products:
|
||
|
|
summary: Multiple active products displayed
|
||
|
|
value: |
|
||
|
|
<!DOCTYPE html>
|
||
|
|
<html>
|
||
|
|
<head><title>Select a Product</title></head>
|
||
|
|
<body>
|
||
|
|
<h1>Select a Product for Feedback</h1>
|
||
|
|
<ul>
|
||
|
|
<li>
|
||
|
|
<a href="/submit/acme-app">Acme Application</a>
|
||
|
|
<p>Enterprise resource planning system</p>
|
||
|
|
</li>
|
||
|
|
<li>
|
||
|
|
<a href="/submit/beta-service">Beta Service</a>
|
||
|
|
<p>Cloud infrastructure platform</p>
|
||
|
|
</li>
|
||
|
|
</ul>
|
||
|
|
</body>
|
||
|
|
</html>
|
||
|
|
|
||
|
|
no_products:
|
||
|
|
summary: No active products (empty state)
|
||
|
|
value: |
|
||
|
|
<!DOCTYPE html>
|
||
|
|
<html>
|
||
|
|
<head><title>Select a Product</title></head>
|
||
|
|
<body>
|
||
|
|
<h1>Select a Product for Feedback</h1>
|
||
|
|
<p>No products are currently accepting feedback. Please check back later.</p>
|
||
|
|
</body>
|
||
|
|
</html>
|
||
|
|
|
||
|
|
product_without_description:
|
||
|
|
summary: Product without description (no placeholder text)
|
||
|
|
value: |
|
||
|
|
<!DOCTYPE html>
|
||
|
|
<html>
|
||
|
|
<head><title>Select a Product</title></head>
|
||
|
|
<body>
|
||
|
|
<h1>Select a Product for Feedback</h1>
|
||
|
|
<ul>
|
||
|
|
<li>
|
||
|
|
<a href="/submit/simple-app">Simple App</a>
|
||
|
|
</li>
|
||
|
|
</ul>
|
||
|
|
</body>
|
||
|
|
</html>
|
||
|
|
|
||
|
|
components:
|
||
|
|
schemas:
|
||
|
|
# No request/response schemas needed (HTML rendering)
|
||
|
|
# Product data comes from file-based storage, not API request body
|
||
|
|
|
||
|
|
# Contract Test Scenarios
|
||
|
|
# These scenarios should be covered in tests/contract/test_landing_routes.py:
|
||
|
|
#
|
||
|
|
# 1. GET / with active products → 200 OK with product list HTML
|
||
|
|
# 2. GET / with no active products → 200 OK with empty state message
|
||
|
|
# 3. GET / with mixed active/archived → 200 OK showing only active
|
||
|
|
# 4. GET / verifies alphabetical sorting (name, then product_id)
|
||
|
|
# 5. GET / excludes products with missing submission_url_slug
|
||
|
|
# 6. GET / properly escapes product names (XSS prevention)
|
||
|
|
# 7. GET / displays descriptions when present
|
||
|
|
# 8. GET / omits description placeholder when missing
|
||
|
|
# 9. GET / accessible to anonymous users
|
||
|
|
# 10. GET / accessible to authenticated users (same behavior)
|
||
|
|
|
||
|
|
# Success Criteria Validation:
|
||
|
|
# - SC-001: Page contains clickable links to /submit/{slug}
|
||
|
|
# - SC-002: Response time <1s for up to 100 products
|
||
|
|
# - SC-004: Existing /submit/{slug} routes still functional (backwards compatibility)
|
||
|
|
# - SC-005: Empty state message displayed when no active products
|
||
|
|
# - SC-006: HTML escaping prevents XSS (test with <script> in product name)
|
||
|
|
# - SC-007: No JavaScript in response (server-side rendered only)
|
||
|
|
# - SC-008: Visual separation via HTML list structure
|