You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Document request body fields for POST /pids/mint API endpoint - #1708
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:
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.
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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On this branch, I documented the fields of the request body for the
POST /pids/mintAPI 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:
Related issue(s)
Fixes #1527
Related subsystem(s)
docsdirectory)Testing
I tested these changes by adding a test demonstrating that the
idfield is now required.Documentation
docsdirectory)Maintainability
study_id: str)# TODOor# FIXMEblackto format all the Python files I created/modifiedSummary by CodeRabbit