Refactor: Move content schema version from Accept header to query parameter

Edgar Rivera
2026-03-31T14:43:32Z

## Summary

The content schema version for data endpoints is currently specified in the `Accept` header (e.g., `Accept: application/json;version=1.0.0`). This should be moved to a query parameter for better usability and semantics.

## Current Behavior

```bash
curl -X POST ".../v2/samplesanalysis/routinecoreanalysis/{id}/data" \
-H "Accept: application/json;version=1.0.0" \
-d '...'
```

## Proposed Behavior

```bash
curl -X POST ".../v2/samplesanalysis/routinecoreanalysis/{id}/data?schema_version=1.0.0" \
-d '...'
```

## Rationale

**Query parameter is better because:**

- **Visibility**: Visible in URL vs hidden in headers
- **Testing**: Easy to test in browser/Swagger vs requires `-H` flag
- **Discoverability**: Shows in Swagger UI automatically
- **Semantics**: The `Accept` header is meant for media type negotiation (`application/json` vs `application/xml`), not schema versioning - using it for version selection is unconventional
- **HTTP Caching**: URL-based caching works correctly vs header can affect caching behavior

## Affected Endpoints

- `POST /v2/samplesanalysis/{type}/{id}/data` - Add data
- `GET /v2/samplesanalysis/{type}/{id}/data` - Get data
- Similar endpoints for other WPC types (FluidModel, SaturationFunctionSet, etc.)

## Implementation Notes

1. Add `schema_version: str = Query(...)` parameter to data endpoints
2. Consider backward compatibility period (support both header and parameter)
3. Update OpenAPI documentation
4. Update client documentation and examples

## Affected Files

- `app/api/dependencies/request.py` - `get_content_schema_version()`
- `app/api/routes/v2/data/endpoints.py`
- `app/api/routes/samplesanalysis/api.py`
- Similar route files for other WPC types