Skip to content

Add role field to User model with updated baseline and docs#5

Merged
justinemach merged 1 commit into
mainfrom
devin/1771874907-add-role-field
Feb 23, 2026
Merged

Add role field to User model with updated baseline and docs#5
justinemach merged 1 commit into
mainfrom
devin/1771874907-add-role-field

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Feb 23, 2026

Copy link
Copy Markdown
Contributor

Add role field to User model with updated baseline and docs

Summary

Adds an optional role field (default: "member") to both UserCreate and User Pydantic models. The create_user endpoint now passes the role through. The OpenAPI baseline and auto-generated api_reference.md have been regenerated to reflect the schema change.

This is a backward-compatible change — existing clients that don't send role will get the default value.

Review & Testing Checklist for Human

  • Seed data: The hardcoded users in _users_db (Alice, Bob) don't explicitly set role. Verify that GET /v1/users/1 returns "role": "member" via the Pydantic default — run curl localhost:8000/v1/users/1 with the server up.
  • Contract tests not updated: tests/test_contract.py doesn't assert on the role field. Decide whether tests should be added to validate role appears in responses and is accepted in POST requests.
  • Baseline committed for first time: artifacts/openapi_baseline.json was previously absent. Skim it to confirm it looks reasonable and matches the running API (curl localhost:8000/openapi.json).

Notes

  • docs/api_reference.md went from a placeholder stub to a fully generated doc — the large diff is expected and auto-generated
  • The change is backward-compatible: role has a default so no existing client calls will break

Link to Devin run: https://app.devin.ai/sessions/23d1e596e5f845ec8c47886363e9b2b8
Requested by: @justinemach


Open with Devin

- Added 'role' field (default: 'member') to User and UserCreate models
- Regenerated OpenAPI baseline and api_reference.md via drift_guard baseline
- Docs now reflect the role field in request/response schemas and example curls

Co-Authored-By: unknown <>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 4 additional findings.

Open in Devin Review

@justinemach justinemach merged commit 02e11d5 into main Feb 23, 2026
1 check passed
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