Skip to content

Document request body fields for POST /pids/mint API endpoint - #1708

Merged
eecavanna merged 1 commit into
mainfrom
1527-user-facing-parameter-documentation-for-pidsmint-is-not-user-friendly
Nov 30, 2026
Merged

eecavanna merged 1 commit into
mainfrom
1527-user-facing-parameter-documentation-for-pidsmint-is-not-user-friendly

Conversation

@eecavanna

@eecavanna eecavanna commented Nov 29, 2026 •

Copy link
Copy Markdown
Collaborator

On this branch, I documented the fields of the request body for the POST /pids/mint API endpoint. I also made the class URI field required (to my surprise, it was previously optional).

Screenshots showing the changes as they appear on Swagger UI are in the "Details" section below.

Details

The "before" (i.e. production) is on the left, and the "after" (i.e. this branch) is on the right:

image

Related issue(s)

Fixes #1527

Related subsystem(s)

  • Runtime API (except the Minter)
  • Minter
  • Dagster
  • Project documentation (in the docs directory)
  • Translators (metadata ingest pipelines)
  • MongoDB migrations
  • Other

Testing

  • I tested these changes (explain below)
  • I did not test these changes

I tested these changes by adding a test demonstrating that the id field is now required.

Documentation

  • I have not checked for relevant documentation yet (e.g. in the docs directory)
  • I have updated all relevant documentation so it will remain accurate
  • Other (explain below)

Maintainability

  • Every Python function I defined includes a docstring (test functions are exempt from this)
  • Every Python function parameter I introduced includes a type hint (e.g. study_id: str)
  • All "to do" or "fix me" Python comments I added begin with either # TODO or # FIXME
  • I used black to format all the Python files I created/modified
  • The PR title is in the imperative mood (e.g. "Do X") and not the declarative mood (e.g. "Does X" or "Did X")

Summary by CodeRabbit

  • API Changes
    • Minting requests must now include a schema class. Requests without one are rejected with a validation error.
    • The request documentation now provides clearer descriptions and examples for the schema class and requested mint count.

@eecavanna eecavanna self-assigned this Nov 29, 2026
@coderabbitai

coderabbitai Bot commented Nov 29, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Changes: Mint request contract

Layer / File(s) Summary
Request model and missing-field validation
nmdc_runtime/minter/domain/model.py, tests/e2e/test_minter_api.py
The request model adds SchemaClass and makes schema_class required. how_many retains its default of 1 and gains field metadata. The end-to-end test checks for HTTP 422 when schema_class is omitted.

Suggested reviewers: dwinston

Change: Other · Severity of issue fixed: Low

Merge Risk: Minimal · up to 30b0a

The change makes the schema class explicit in the mint request and documents the fields. The existing site client already sends this field, so the compatibility risk is low. No merge-blocking issues were identified.

Security architecture risk: Minimal · up to 30b0a

Clients that omit the schema class will now receive HTTP 422 instead of minting identifiers for a default class. The bundled client already sends the field, and the change does not grant callers new minting permissions.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The changed validation narrows which request bodies can reach minting without expanding the set of caller-selectable classes or changing the identity used for the write.
Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 808394c5-6e98-45c8-86a4-6fa4e7fd92eb
Commits

Reviewing files that changed from the base of the PR and between cb3f128 and 30b0a5f.

Files selected for processing: 2

  • nmdc_runtime/minter/domain/model.py
  • tests/e2e/test_minter_api.py

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

@eecavanna

eecavanna commented Nov 29, 2026 •

Copy link
Copy Markdown
Collaborator Author

Note to reviewers: I technically requested Reviews from y'all, but my real intention is just to inform you that this (i.e. requiring the HTTP client to specify the schema class in the request) is a change I want to make and see whether you have any concerns. I don't expect y'all to have any concerns about the field descriptions I added (see screenshot in PR description).

@eecavanna
eecavanna merged commit 10f2ddc into main Nov 30, 2026
3 checks passed
@eecavanna
eecavanna deleted the 1527-user-facing-parameter-documentation-for-pidsmint-is-not-user-friendly branch November 30, 2026 20:05
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.

User-facing parameter documentation for /pids/mint is not user friendly

2 participants