Skip to content

feat(api): add REST API blueprint for snippets - #28

Open
AdvaitVarhade wants to merge 3 commits into
byteofhoney:mainfrom
AdvaitVarhade:feature/rest-api
Open

feat(api): add REST API blueprint for snippets#28
AdvaitVarhade wants to merge 3 commits into
byteofhoney:mainfrom
AdvaitVarhade:feature/rest-api

Conversation

@AdvaitVarhade

@AdvaitVarhade AdvaitVarhade commented Jul 30, 2026

Copy link
Copy Markdown

What changed

  • Created new Flask blueprint app/api.py mounted at /api.
  • Implemented GET /api/snippets with query filtering (?q=, ?language=, ?tag=) returning JSON.
  • Implemented GET /api/snippets/ returning single snippet JSON or 404 for invalid/missing IDs.
  • Updated format_snippet in app/models.py to handle ISO datetime serialization.
  • Added endpoint documentation to README.md.
  • Added comprehensive unit tests in tests/test_api.py.

Please check and tell if any changes are required

@AdvaitVarhade

Copy link
Copy Markdown
Author

Hi @byteofhoney, following up on PR #28 where I created the REST API blueprint (GET /api/snippets with query filtering, GET /api/snippets/<id>), updated JSON serialization, added README documentation, and unit test coverage. Let me know if you have any feedback or if you'd like anything adjusted, Thank you.

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.

2 participants