Skip to content

feat: add user guide, license, and Python examples to API docs#15

Merged
ckouder merged 1 commit into
mainfrom
feat/issue-12-examples-license
May 12, 2026
Merged

feat: add user guide, license, and Python examples to API docs#15
ckouder merged 1 commit into
mainfrom
feat/issue-12-examples-license

Conversation

@ckouder
Copy link
Copy Markdown
Contributor

@ckouder ckouder commented May 12, 2026

Closes #12.

Summary

Brings the CLEANDB-api Swagger UI to parity with the OpenEnzymeDB-api pattern requested in the issue:

  • User Guide + Data License + Support sections appended to the FastAPI description, rendered at the top of /api/v1/docs and /api/v1/redoc.
  • Per-endpoint URL examples + Python (requests) snippets for /search, /typeahead, /curation-statuses, and /ec_lookup.
  • Syntax-highlight theme switched from default Monokai to obsidian via swagger_ui_parameters, addressing Le Yuan's note that the purple theme on OED looked off.

Per Le Yuan's comment, the "Data Download" section from the OED pattern is intentionally omitted (full CLEAN dataset is too large to publish for direct download). The license matches OED (CC BY 4.0).

Scope: API repo only. The frontend FAQ "API" tab and License page mentioned in the issue live in the CLEAN frontend repo and will be handled separately.

Test plan

  • docker-compose up -d against a populated CLEAN DB
  • Open http://localhost:8000/api/v1/docs — confirm User Guide / Pagination / License / Support render at the top
  • Expand each endpoint — confirm URL examples + Python code blocks render with the obsidian (dark, neutral) theme
  • Open http://localhost:8000/api/v1/redoc — confirm the description renders the same content
  • Copy the /search Python example and run it against the deployed API at https://fastapi.cleandb.mmli2.ncsa.illinois.edu — confirm it returns data

Mirrors the OpenEnzymeDB-api pattern (moleculemaker/oed-api) for the
Swagger UI at /api/v1/docs:

- Expand the FastAPI description with User Guide, Automatic Pagination
  technical note, CC BY 4.0 data license, and support contact sections.
- Switch the Swagger UI syntax-highlight theme to "obsidian" so Python
  code blocks render with a neutral dark palette instead of purple.
- Add URL examples and copy-pasteable Python (requests) snippets to the
  docstrings for /search, /typeahead, /curation-statuses, and /ec_lookup.

Refs: #12
@ckouder ckouder merged commit 4eedbde into main May 12, 2026
1 check passed
@ckouder ckouder deleted the feat/issue-12-examples-license branch May 12, 2026 23:13
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.

Examples, How To Use, License

1 participant